Skip to content

Commit

Permalink
fix: custom headers (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe authored Dec 6, 2024
1 parent 8d8a62d commit 1abcc87
Show file tree
Hide file tree
Showing 7 changed files with 590 additions and 0 deletions.
6 changes: 6 additions & 0 deletions headers/rtc_4.3.2.11/custom_headers/CustomIAgoraRtcEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ class IRtcEngine {
* @source: virtual int takeSnapshot(uid_t uid, const agora::media::SnapshotConfig& config) = 0;
*/
virtual int takeSnapshotWithConfig(uid_t uid, const agora::media::SnapshotConfig& config) = 0;

/**
* @iris_api_id: RtcEngine_setExternalMediaProjection_f337cbf
* @source: virtual int setExternalMediaProjection(void* mediaProjection) = 0;
*/
virtual int setExternalMediaProjection(const void* mediaProjection) = 0;
};

} // namespace ext
Expand Down
49 changes: 49 additions & 0 deletions headers/rtc_4.5.0/custom_headers/CustomIAgoraMediaEngine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

#include "AgoraBase.h"
#include "IAgoraMediaEngine.h"

namespace agora {
namespace media {
namespace ext {

class IMediaEngine {
// ----------------------------- 👇🏻new API👇🏻 -----------------------------

/**
* @iris_api_id: MediaEngine_unregisterAudioFrameObserver
* @source: virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0;
*/
virtual int unregisterAudioFrameObserver(IAudioFrameObserver *observer) = 0;

/**
* @iris_api_id: MediaEngine_unregisterVideoFrameObserver
* @source: virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0;
*/
virtual int unregisterVideoFrameObserver(IVideoFrameObserver *observer) = 0;

/**
* @iris_api_id: MediaEngine_unregisterVideoEncodedFrameObserver
* @source: virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0;
*/
virtual int
unregisterVideoEncodedFrameObserver(IVideoEncodedFrameObserver *observer) = 0;

/**
* @iris_api_id: MediaEngine_unregisterFaceInfoObserver
* @source: virtual int registerFaceInfoObserver(IFaceInfoObserver* observer) = 0;
*/
virtual int unregisterFaceInfoObserver(IFaceInfoObserver* observer) = 0;

/**
* @iris_api_id: MediaEngine_setExternalRemoteEglContext_f337cbf
* @source: virtual int setExternalRemoteEglContext(void* eglContext) = 0;
*/
virtual int setExternalRemoteEglContext(const void* eglContext) = 0;

// ----------------------------- 👆🏻new API👆🏻 -----------------------------
};

} // namespace ext
} // namespace media
} // namespace agora
63 changes: 63 additions & 0 deletions headers/rtc_4.5.0/custom_headers/CustomIAgoraMediaPlayer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#pragma once

#include "AgoraBase.h"
#include "AgoraMediaBase.h"
#include "IAgoraMediaPlayer.h"

namespace agora {
namespace rtc {

// Put this class to the agora::rtc namespaces to avoid unecessary namespace trimming(trim the `ext` namespace).
class IMediaPlayerVideoFrameObserver {
virtual void onFrame(const agora::media::base::VideoFrame *frame) = 0;
};

namespace ext {

class IMediaPlayer {
// ----------------------------- 👇🏻overload API👇🏻 -----------------------------

/**
* @iris_api_id: MediaPlayer_setPlayerOption_4d05d29
* @source: virtual int setPlayerOption(const char* key, int value) = 0;
*/
virtual int setPlayerOptionInInt(const char *key, int value) = 0;

/**
* @iris_api_id: MediaPlayer_setPlayerOption_ccad422
* @source: virtual int setPlayerOption(const char* key, char* value) = 0;
*/
virtual int setPlayerOptionInString(const char *key, const char *value) = 0;

/**
* @iris_api_id: MediaPlayer_registerAudioFrameObserver_a5b510b
* @source: virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer, RAW_AUDIO_FRAME_OP_MODE_TYPE mode) = 0;
*/
virtual int
registerAudioFrameObserver(media::IAudioPcmFrameSink* observer,
RAW_AUDIO_FRAME_OP_MODE_TYPE mode = RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY) = 0;

// ----------------------------- 👆🏻overload API👆🏻 -----------------------------

// ----------------------------- 👇🏻rename API👇🏻 -----------------------------

/**
* @iris_api_id: MediaPlayer_registerVideoFrameObserver_833bd8d
* @source: virtual int registerVideoFrameObserver(media::base::IVideoFrameObserver* observer) = 0;
*/
virtual int
registerVideoFrameObserver(IMediaPlayerVideoFrameObserver *observer) = 0;

/**
* @iris_api_id: MediaPlayer_unregisterVideoFrameObserver_5165d4c
* @source: virtual int unregisterVideoFrameObserver(agora::media::base::IVideoFrameObserver* observer) = 0;
*/
virtual int
unregisterVideoFrameObserver(IMediaPlayerVideoFrameObserver *observer) = 0;

// ----------------------------- 👆🏻rename API👆🏻 -----------------------------
};

} // namespace ext
} // namespace rtc
} // namespace agora
32 changes: 32 additions & 0 deletions headers/rtc_4.5.0/custom_headers/CustomIAgoraMusicContentCenter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include "IAgoraMediaPlayer.h"

namespace agora {
namespace rtc {
namespace ext {

class IMusicPlayer : public IMediaPlayer {
// ----------------------------- 👇🏻overload API👇🏻 -----------------------------

/**
* @iris_api_id: MusicPlayer_open_303b92e
* @source: virtual int open(int64_t songCode, int64_t startPos = 0) = 0;
* @generate_iris_api_id: true
*/
virtual int openWithSongCode(int64_t songCode, int64_t startPos = 0) = 0;

// ----------------------------- 👆🏻overload API👆🏻 -----------------------------
};

class IMusicContentCenter
{
/**
* @iris_api_id: MusicContentCenter_preload_d3baeab
* @source: virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0;
*/
virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0;
};
} // namespace ext
} // namespace rtc
} // namespace agora
Loading

0 comments on commit 1abcc87

Please sign in to comment.