Agora C++ API Reference for All Platforms
Public Member Functions | List of all members
agora::rtc::IMediaRecorderEX Class Referenceabstract

Inherits agora::rtc::IAVDataObserver, agora::media::IAudioFrameObserver, and agora::media::IVideoEncodedFrameObserver.

Public Member Functions

virtual int startRecording (const media::MediaRecorderConfiguration &config)=0
 
virtual int stopRecording ()=0
 
virtual void release ()=0
 
virtual void setMediaRecorderObserver (media::IMediaRecorderObserverEx *observer)=0
 
virtual void setSysVersion (int sys_version)=0
 
virtual void setRemoteUid (uid_t uid)=0
 
bool onPlaybackAudioFrame (const char *channelId, AudioFrame &audioFrame) override
 
bool onMixedAudioFrame (const char *channelId, AudioFrame &audioFrame) override
 
bool onEarMonitoringAudioFrame (AudioFrame &audioFrame) override
 
bool onPlaybackAudioFrameBeforeMixing (const char *channelId, user_id_t userId, AudioFrame &audioFrame) override
 
bool onPlaybackAudioFrameBeforeMixing (const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame) override
 
AudioParams getPlaybackAudioParams () override
 
AudioParams getRecordAudioParams () override
 
AudioParams getMixedAudioParams () override
 
AudioParams getEarMonitoringAudioParams () override
 
virtual bool onEncodedVideoFrameReceived (rtc::uid_t uid, const uint8_t *imageBuffer, size_t length, const rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo) override
 
- Public Member Functions inherited from agora::rtc::IAVDataObserver
virtual ~IAVDataObserver ()
 
virtual bool onAVDataReady (const AVData &avdata)=0
 
- Public Member Functions inherited from agora::media::IAudioFrameObserver
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
 
- Public Member Functions inherited from agora::media::IAudioFrameObserverBase
virtual ~IAudioFrameObserverBase ()
 
virtual bool onRecordAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
 
virtual int getObservedAudioFramePosition ()=0
 
- Public Member Functions inherited from agora::media::IVideoEncodedFrameObserver
virtual ~IVideoEncodedFrameObserver ()
 

Additional Inherited Members

- Public Types inherited from agora::rtc::IAVDataObserver
enum  AVDATA_TYPE { AVDATA_UNKNOWN = 0, AVDATA_VIDEO = 1, AVDATA_AUDIO = 2, AVDATA_AUDIO_MUTE = 3 }
 
enum  CODEC_VIDEO { CODEC_VIDEO_AVC = 0, CODEC_VIDEO_HEVC = 1, CODEC_VIDEO_VP8 = 2 }
 
enum  CODEC_AUDIO { CODEC_AUDIO_PCM = 0, CODEC_AUDIO_AAC = 1, CODEC_AUDIO_G722 = 2 }
 
- Public Types inherited from agora::media::IAudioFrameObserverBase
enum  AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
 
enum  { MAX_HANDLE_TIME_CNT = 10 }
 
enum  AUDIO_FRAME_POSITION {
  AUDIO_FRAME_POSITION_NONE = 0x0000, AUDIO_FRAME_POSITION_PLAYBACK = 0x0001, AUDIO_FRAME_POSITION_RECORD = 0x0002, AUDIO_FRAME_POSITION_MIXED = 0x0004,
  AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008, AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010
}
 

Member Function Documentation

◆ startRecording()

virtual int agora::rtc::IMediaRecorderEX::startRecording ( const media::MediaRecorderConfiguration config)
pure virtual

◆ stopRecording()

virtual int agora::rtc::IMediaRecorderEX::stopRecording ( )
pure virtual

◆ release()

virtual void agora::rtc::IMediaRecorderEX::release ( )
pure virtual

◆ setMediaRecorderObserver()

virtual void agora::rtc::IMediaRecorderEX::setMediaRecorderObserver ( media::IMediaRecorderObserverEx observer)
pure virtual

◆ setSysVersion()

virtual void agora::rtc::IMediaRecorderEX::setSysVersion ( int  sys_version)
pure virtual

◆ setRemoteUid()

virtual void agora::rtc::IMediaRecorderEX::setRemoteUid ( uid_t  uid)
pure virtual

◆ onPlaybackAudioFrame()

bool agora::rtc::IMediaRecorderEX::onPlaybackAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the playback audio frame is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The playback audio frame is valid and is encoded and sent.
  • false: The playback audio frame is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ onMixedAudioFrame()

bool agora::rtc::IMediaRecorderEX::onMixedAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the mixed audio data is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The mixed audio data is valid and is encoded and sent.
  • false: The mixed audio data is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ onEarMonitoringAudioFrame()

bool agora::rtc::IMediaRecorderEX::onEarMonitoringAudioFrame ( AudioFrame audioFrame)
inlineoverridevirtual

Occurs when the ear monitoring audio frame is received.

Parameters
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The ear monitoring audio data is valid and is encoded and sent.
  • false: The ear monitoring audio data is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ onPlaybackAudioFrameBeforeMixing() [1/2]

bool agora::rtc::IMediaRecorderEX::onPlaybackAudioFrameBeforeMixing ( const char *  channelId,
user_id_t  userId,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the before-mixing playback audio frame is received.

Parameters
channelIdThe channel name
userIdID of the remote user.
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The before-mixing playback audio frame is valid and is encoded and sent.
  • false: The before-mixing playback audio frame is invalid and is not encoded or sent.

Reimplemented from agora::media::IAudioFrameObserverBase.

◆ onPlaybackAudioFrameBeforeMixing() [2/2]

bool agora::rtc::IMediaRecorderEX::onPlaybackAudioFrameBeforeMixing ( const char *  channelId,
rtc::uid_t  uid,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the before-mixing playback audio frame is received.

Parameters
channelIdThe channel name
uidID of the remote user.
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The before-mixing playback audio frame is valid and is encoded and sent.
  • false: The before-mixing playback audio frame is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserver.

◆ getPlaybackAudioParams()

AudioParams agora::rtc::IMediaRecorderEX::getPlaybackAudioParams ( )
inlineoverridevirtual

Sets the audio playback format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onPlaybackAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getRecordAudioParams()

AudioParams agora::rtc::IMediaRecorderEX::getRecordAudioParams ( )
inlineoverridevirtual

Sets the audio recording format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onRecordAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getMixedAudioParams()

AudioParams agora::rtc::IMediaRecorderEX::getMixedAudioParams ( )
inlineoverridevirtual

Sets the audio mixing format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onMixedAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getEarMonitoringAudioParams()

AudioParams agora::rtc::IMediaRecorderEX::getEarMonitoringAudioParams ( )
inlineoverridevirtual

Sets the ear monitoring audio format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onEarMonitoringAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ onEncodedVideoFrameReceived()

virtual bool agora::rtc::IMediaRecorderEX::onEncodedVideoFrameReceived ( rtc::uid_t  uid,
const uint8_t *  imageBuffer,
size_t  length,
const rtc::EncodedVideoFrameInfo videoEncodedFrameInfo 
)
inlineoverridevirtual

Occurs each time the SDK receives an encoded video image.

Parameters
uidThe user id of remote user.
imageBufferThe pointer to the video image buffer.
lengthThe data length of the video image.
videoEncodedFrameInfoThe information of the encoded video frame: EncodedVideoFrameInfo.
Returns
Determines whether to accept encoded video image.
  • true: Accept.
  • false: Do not accept.

Implements agora::media::IVideoEncodedFrameObserver.