Agora Server Gateway SDK C++ API Reference
NGIAgoraMediaNode.h
Go to the documentation of this file.
1#pragma once
2#include "AgoraRefPtr.h"
3#include "AgoraBase.h"
4#include "IAgoraLog.h"
5#include "NGIAgoraVideoFrame.h"
6
7#ifndef OPTIONAL_PROCESSRESULT_SPECIFIER
8#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
9#define OPTIONAL_PROCESSRESULT_SPECIFIER ProcessResult::
10#else
11#define OPTIONAL_PROCESSRESULT_SPECIFIER
12#endif
13#endif
14
15namespace agora {
16namespace rtc {
17
21class IVideoSinkBase : public RefCountInterface {
22 public:
33 virtual int setProperty(const char* key, const void* buf, int buf_size) { return -1; }
44 virtual int getProperty(const char* key, void* buf, int buf_size) { return -1; }
49 virtual int onFrame(const media::base::VideoFrame& videoFrame) = 0;
51
55 virtual bool isExternalSink() { return true; }
63 virtual bool onDataStreamWillStart() { return true; }
68 virtual void onDataStreamWillStop() { }
70
76 virtual bool applyMirror() { return false; }
83 virtual bool applyRotation() { return false; }
84};
85
91class IAudioPcmDataSender : public RefCountInterface {
92 public:
108 virtual int sendAudioPcmData(
109 const void* audio_data, uint32_t capture_timestamp, int64_t presentation_ms,
110 const size_t samples_per_channel,
111 const agora::rtc::BYTES_PER_SAMPLE bytes_per_sample,
112 const size_t number_of_channels,
113 const uint32_t sample_rate) = 0;
114
115 protected:
117};
118
126class IAudioEncodedFrameSender : public RefCountInterface {
127 public:
140 virtual bool sendEncodedAudioFrame(const uint8_t* payload_data, size_t payload_size,
141 const EncodedAudioFrameInfo& audioFrameInfo) = 0;
142
143 protected:
145};
146
151class IAudioSinkBase : public RefCountInterface {
152 public:
160 virtual bool onAudioFrame(const media::base::AudioPcmFrame& audioFrame) = 0;
161
162 protected:
164};
165
173class IVideoFrameSender : public RefCountInterface {
174 public:
184 virtual int sendVideoFrame(const media::base::ExternalVideoFrame& videoFrame) = 0;
185
186 protected:
188};
189
197class IVideoEncodedImageSender : public RefCountInterface {
198 public:
210 virtual bool sendEncodedVideoImage(const uint8_t* imageBuffer, size_t length,
211 const EncodedVideoFrameInfo& videoEncodedFrameInfo) = 0;
212
213 protected:
215};
216};
217
218}
Definition: NGIAgoraMediaNode.h:126
~IAudioEncodedFrameSender()
Definition: NGIAgoraMediaNode.h:144
virtual bool sendEncodedAudioFrame(const uint8_t *payload_data, size_t payload_size, const EncodedAudioFrameInfo &audioFrameInfo)=0
Definition: NGIAgoraMediaNode.h:91
virtual int sendAudioPcmData(const void *audio_data, uint32_t capture_timestamp, int64_t presentation_ms, const size_t samples_per_channel, const agora::rtc::BYTES_PER_SAMPLE bytes_per_sample, const size_t number_of_channels, const uint32_t sample_rate)=0
~IAudioPcmDataSender()
Definition: NGIAgoraMediaNode.h:116
Definition: NGIAgoraMediaNode.h:151
virtual bool onAudioFrame(const media::base::AudioPcmFrame &audioFrame)=0
~IAudioSinkBase()
Definition: NGIAgoraMediaNode.h:163
Definition: NGIAgoraMediaNode.h:197
~IVideoEncodedImageSender()
Definition: NGIAgoraMediaNode.h:214
virtual bool sendEncodedVideoImage(const uint8_t *imageBuffer, size_t length, const EncodedVideoFrameInfo &videoEncodedFrameInfo)=0
Definition: NGIAgoraMediaNode.h:173
~IVideoFrameSender()
Definition: NGIAgoraMediaNode.h:187
virtual int sendVideoFrame(const media::base::ExternalVideoFrame &videoFrame)=0
Definition: NGIAgoraMediaNode.h:21
virtual int onFrame(const media::base::VideoFrame &videoFrame)=0
virtual int getProperty(const char *key, void *buf, int buf_size)
Definition: NGIAgoraMediaNode.h:44
virtual bool applyRotation()
Definition: NGIAgoraMediaNode.h:83
virtual bool applyMirror()
Definition: NGIAgoraMediaNode.h:76
virtual int setProperty(const char *key, const void *buf, int buf_size)
Definition: NGIAgoraMediaNode.h:33
BYTES_PER_SAMPLE
Definition: AgoraMediaBase.h:38
Definition: AgoraBase.h:86
Definition: AgoraBase.h:1740
Definition: AgoraBase.h:1880