-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AUTO] Update native headers to rtc_4.3.2.9 (#159)
native headers source: https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_rel.v4.3.2.9_27193_FULL_20241118_1624_437681.zip Co-authored-by: guoxianzhe <[email protected]>
- Loading branch information
1 parent
846ef93
commit bc2d246
Showing
21 changed files
with
24,663 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
|
||
// Copyright (c) 2019 Agora.io. All rights reserved | ||
|
||
// This program is confidential and proprietary to Agora.io. | ||
// And may not be copied, reproduced, modified, disclosed to others, published | ||
// or used, in whole or in part, without the express prior written permission | ||
// of Agora.io. | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#if !(__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) | ||
#include <cstddef> | ||
#endif | ||
#ifndef OPTIONAL_ENUM_CLASS | ||
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) | ||
#define OPTIONAL_ENUM_CLASS enum class | ||
#else | ||
#define OPTIONAL_ENUM_CLASS enum | ||
#endif | ||
#endif | ||
|
||
namespace agora { | ||
|
||
OPTIONAL_ENUM_CLASS RefCountReleaseStatus { kDroppedLastRef, kOtherRefsRemained }; | ||
|
||
// Interfaces where refcounting is part of the public api should | ||
// inherit this abstract interface. The implementation of these | ||
// methods is usually provided by the RefCountedObject template class, | ||
// applied as a leaf in the inheritance tree. | ||
class RefCountInterface { | ||
public: | ||
virtual void AddRef() const = 0; | ||
virtual RefCountReleaseStatus Release() const = 0; | ||
virtual bool HasOneRef() const = 0; | ||
|
||
// Non-public destructor, because Release() has exclusive responsibility for | ||
// destroying the object. | ||
protected: | ||
virtual ~RefCountInterface() {} | ||
}; | ||
|
||
template <class T> | ||
class agora_refptr { | ||
public: | ||
agora_refptr() : ptr_(NULL) {} | ||
|
||
agora_refptr(T* p) : ptr_(p) { | ||
if (ptr_) ptr_->AddRef(); | ||
} | ||
|
||
template<typename U> | ||
agora_refptr(U* p) : ptr_(p) { | ||
if (ptr_) ptr_->AddRef(); | ||
} | ||
|
||
agora_refptr(const agora_refptr<T>& r) : ptr_(r.get()) { | ||
if (ptr_) ptr_->AddRef(); | ||
} | ||
|
||
template <typename U> | ||
agora_refptr(const agora_refptr<U>& r) : ptr_(r.get()) { | ||
if (ptr_) ptr_->AddRef(); | ||
} | ||
|
||
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) | ||
agora_refptr(agora_refptr<T>&& r) : ptr_(r.move()) {} | ||
|
||
template <typename U> | ||
agora_refptr(agora_refptr<U>&& r) : ptr_(r.move()) {} | ||
#endif | ||
|
||
~agora_refptr() { | ||
reset(); | ||
} | ||
|
||
T* get() const { return ptr_; } | ||
operator bool() const { return (ptr_ != NULL); } | ||
|
||
T* operator->() const { return ptr_; } | ||
T& operator*() const { return *ptr_; } | ||
|
||
// Returns the (possibly null) raw pointer, and makes the agora_refptr hold a | ||
// null pointer, all without touching the reference count of the underlying | ||
// pointed-to object. The object is still reference counted, and the caller of | ||
// move() is now the proud owner of one reference, so it is responsible for | ||
// calling Release() once on the object when no longer using it. | ||
T* move() { | ||
T* retVal = ptr_; | ||
ptr_ = NULL; | ||
return retVal; | ||
} | ||
|
||
agora_refptr<T>& operator=(T* p) { | ||
if (ptr_ == p) return *this; | ||
|
||
if (p) p->AddRef(); | ||
if (ptr_) ptr_->Release(); | ||
ptr_ = p; | ||
return *this; | ||
} | ||
|
||
agora_refptr<T>& operator=(const agora_refptr<T>& r) { | ||
return *this = r.get(); | ||
} | ||
|
||
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) | ||
agora_refptr<T>& operator=(agora_refptr<T>&& r) { | ||
agora_refptr<T>(std::move(r)).swap(*this); | ||
return *this; | ||
} | ||
|
||
template <typename U> | ||
agora_refptr<T>& operator=(agora_refptr<U>&& r) { | ||
agora_refptr<T>(std::move(r)).swap(*this); | ||
return *this; | ||
} | ||
#endif | ||
|
||
// For working with std::find() | ||
bool operator==(const agora_refptr<T>& r) const { return ptr_ == r.ptr_; } | ||
|
||
// For working with std::set | ||
bool operator<(const agora_refptr<T>& r) const { return ptr_ < r.ptr_; } | ||
|
||
void swap(T** pp) { | ||
T* p = ptr_; | ||
ptr_ = *pp; | ||
*pp = p; | ||
} | ||
|
||
void swap(agora_refptr<T>& r) { swap(&r.ptr_); } | ||
|
||
void reset() { | ||
if (ptr_) { | ||
ptr_->Release(); | ||
ptr_ = NULL; | ||
} | ||
} | ||
|
||
protected: | ||
T* ptr_; | ||
}; | ||
|
||
} // namespace agora | ||
|
||
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) | ||
namespace std { | ||
template <typename T> | ||
struct hash<agora::agora_refptr<T>> { | ||
std::size_t operator()(const agora::agora_refptr<T>& k) const { | ||
return reinterpret_cast<size_t>(k.get()); | ||
} | ||
}; | ||
} // namespace std | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
// | ||
// Agora Media SDK | ||
// | ||
// Copyright (c) 2022 Agora IO. All rights reserved. | ||
// | ||
|
||
#pragma once | ||
|
||
#include "AgoraBase.h" | ||
#include "AgoraMediaBase.h" | ||
|
||
namespace agora{ | ||
namespace rtc{ | ||
|
||
/** | ||
* The result of IH265Transcoder interface invoking. | ||
*/ | ||
enum H265_TRANSCODE_RESULT { | ||
/** | ||
* -1: Unknown error. | ||
*/ | ||
H265_TRANSCODE_RESULT_UNKNOWN = -1, | ||
/** | ||
* 0: The request of operation is successfully. | ||
*/ | ||
H265_TRANSCODE_RESULT_SUCCESS = 0, | ||
/** | ||
* 1: This request is invalid. Possible reasons include incorrect parameters. | ||
*/ | ||
H265_TRANSCODE_RESULT_REQUEST_INVALID = 1, | ||
/** | ||
* 2: Authentication failed, please check for correctness of token. | ||
*/ | ||
H265_TRANSCODE_RESULT_UNAUTHORIZED = 2, | ||
/** | ||
* 3: The token is expired, please update token. | ||
*/ | ||
H265_TRANSCODE_RESULT_TOKEN_EXPIRED = 3, | ||
/** | ||
* 4: No permission to access the interface. | ||
*/ | ||
H265_TRANSCODE_RESULT_FORBIDDEN = 4, | ||
/** | ||
* 5: The url of request is not found. | ||
*/ | ||
H265_TRANSCODE_RESULT_NOT_FOUND = 5, | ||
/** | ||
* 6: The request encountered a conflict, please try again. | ||
*/ | ||
H265_TRANSCODE_RESULT_CONFLICTED = 6, | ||
/** | ||
* 7: Content type not supported. | ||
*/ | ||
H265_TRANSCODE_RESULT_NOT_SUPPORTED = 7, | ||
/** | ||
* 8: The requests are too frequent. | ||
*/ | ||
H265_TRANSCODE_RESULT_TOO_OFTEN = 8, | ||
/** | ||
* 9: Internal Server Error, you can try sending the request again. | ||
*/ | ||
H265_TRANSCODE_RESULT_SERVER_INTERNAL_ERROR = 9, | ||
/** | ||
* 10: Service is unavailable. | ||
*/ | ||
H265_TRANSCODE_RESULT_SERVICE_UNAVAILABLE = 10 | ||
}; | ||
|
||
/** | ||
* The IH265TranscoderObserver class | ||
*/ | ||
class IH265TranscoderObserver { | ||
public: | ||
virtual ~IH265TranscoderObserver() {}; | ||
|
||
/** | ||
* Use to notify the result of invoking enableTranscode interface. | ||
* @param result Result of invoking enableTranscode interface. There are some processing advice below of result. | ||
* - H265_TRANSCODE_RESULT_REQUEST_INVALID: Channel or uid param have a mistake, you need to check them for correctness. | ||
* - H265_TRANSCODE_RESULT_UNAUTHORIZED: Authentication failed, please check for correctness of token. | ||
* - H265_TRANSCODE_RESULT_TOKEN_EXPIRED: The token has expired, you need to generate a new token. | ||
* - H265_TRANSCODE_RESULT_FORBIDDEN: You need to contact agora staff to add the vid whitelist. | ||
* - H265_TRANSCODE_RESULT_NOT_FOUND: Indicates that the network may be faulty. | ||
* - H265_TRANSCODE_RESULT_TOO_OFTEN: Request is too often, please request again later. | ||
* - H265_TRANSCODE_RESULT_SERVER_INTERNAL_ERROR: The service has an internal error. A request can be made again. | ||
*/ | ||
virtual void onEnableTranscode(H265_TRANSCODE_RESULT result) = 0; | ||
|
||
/** | ||
* Use to notify the result of invoking queryChannel interface. | ||
* @param result Result of invoking queryChannel interface. There are some processing advice below of result. | ||
* - H265_TRANSCODE_RESULT_UNAUTHORIZED: Authentication failed, please check for correctness of token. | ||
* - H265_TRANSCODE_RESULT_TOKEN_EXPIRED: The token has expired, you need to generate a new token. | ||
* - H265_TRANSCODE_RESULT_NOT_FOUND: Indicates that the network may be faulty or the channel param may be is empty. | ||
* - H265_TRANSCODE_RESULT_TOO_OFTEN: Request is too often, please request again later. | ||
* - H265_TRANSCODE_RESULT_SERVER_INTERNAL_ERROR: The service has an internal error. A request can be made again. | ||
* | ||
* @param originChannel Origin channel id | ||
* @param transcodeChannel Transcode channel id | ||
*/ | ||
virtual void onQueryChannel(H265_TRANSCODE_RESULT result, const char* originChannel, const char* transcodeChannel) = 0; | ||
|
||
/** Use to notify the result of invoking triggerTranscode interface. | ||
* @param result Result of invoking triggerTranscode interface. There are some processing advice below of result. | ||
* - H265_TRANSCODE_RESULT_UNAUTHORIZED: Authentication failed, please check for correctness of token. | ||
* - H265_TRANSCODE_RESULT_TOKEN_EXPIRED: The token has expired, you need to generate a new token. | ||
* - H265_TRANSCODE_RESULT_NOT_FOUND: Indicates that the network may be faulty or the channel param may be is empty. | ||
* - H265_TRANSCODE_RESULT_CONFLICTED: The request of trigger transcode is conflicted, please try again. | ||
* - H265_TRANSCODE_RESULT_TOO_OFTEN: Request is too often, please request again later | ||
* - H265_TRANSCODE_RESULT_SERVER_INTERNAL_ERROR: The service has an internal error. A request can be made again. | ||
* - H265_TRANSCODE_RESULT_SERVICE_UNAVAILABLE: May be the number of transcode service is over the limit. | ||
*/ | ||
virtual void onTriggerTranscode(H265_TRANSCODE_RESULT result) = 0; | ||
|
||
}; | ||
|
||
/** | ||
* The IH265Transcoder class | ||
*/ | ||
class IH265Transcoder : public RefCountInterface { | ||
public: | ||
/** | ||
* Enable transcoding for a channel. | ||
* @param token The token for authentication. | ||
* @param channel The unique channel name for the AgoraRTC session in the string format. | ||
* @param uid User ID. | ||
* @return | ||
* - 0: Success. | ||
* - <0: Failure. | ||
*/ | ||
virtual int enableTranscode(const char *token, const char *channel, uid_t uid) = 0; | ||
|
||
/** | ||
* Query the transcoded channel of a channel. | ||
* @param token The token for authentication. | ||
* @param channel The unique channel name for the AgoraRTC session in the string format. | ||
* @param uid User ID. | ||
* @return | ||
* - 0: Success. | ||
* - <0: Failure. | ||
*/ | ||
virtual int queryChannel(const char *token, const char *channel, uid_t uid) = 0; | ||
|
||
/** | ||
* Trigger channel transcoding. | ||
* @param token The token for authentication. | ||
* @param channel The unique channel name for the AgoraRTC session in the string format. | ||
* @param uid User ID. | ||
* @return | ||
* - 0: Success. | ||
* - <0: Failure. | ||
*/ | ||
virtual int triggerTranscode(const char* token, const char* channel, uid_t uid) = 0; | ||
/** | ||
* Register a IH265TranscoderObserver object. | ||
* @param observer IH265TranscoderObserver. | ||
* @return | ||
* - 0: Success. | ||
* - <0: Failure. | ||
*/ | ||
virtual int registerTranscoderObserver(IH265TranscoderObserver *observer) = 0; | ||
/** | ||
* Unregister a IH265TranscoderObserver object. | ||
* @param observer IH265TranscoderObserver. | ||
* @return | ||
* - 0: Success. | ||
* - <0: Failure. | ||
*/ | ||
virtual int unregisterTranscoderObserver(IH265TranscoderObserver *observer) = 0; | ||
|
||
|
||
protected: | ||
virtual ~IH265Transcoder() {}; | ||
|
||
}; | ||
|
||
} // namespace rtc | ||
} // namespace agora |
Oops, something went wrong.