Agora Java API Reference for Android

AgoraMediaBase.h
1 // Agora Engine SDK
2 //
3 // Created by Sting Feng in 2017-11.
4 // Copyright (c) 2017 Agora.io. All rights reserved.
5
6 #pragma once // NOLINT(build/header_guard)
7
8 #include <cstring>
9 #include <stdint.h>
10 #include <limits>
11 #include <stddef.h>
12
13 #ifndef OPTIONAL_ENUM_SIZE_T
14 #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
15 #define OPTIONAL_ENUM_SIZE_T enum : size_t
16 #else
17 #define OPTIONAL_ENUM_SIZE_T enum
18 #endif
19 #endif
20
21 #if !defined(__APPLE__)
22 #define __deprecated
23 #endif
24
25 namespace agora {
26 namespace rtc {
27
28 typedef unsigned int uid_t;
29 typedef unsigned int track_id_t;
30 typedef unsigned int conn_id_t;
31 typedef unsigned int video_track_id_t;
32
33 static const unsigned int INVALID_TRACK_ID = 0xffffffff;
34 static const unsigned int DEFAULT_CONNECTION_ID = 0;
35 static const unsigned int DUMMY_CONNECTION_ID = (std::numeric_limits<unsigned int>::max)();
36
37 struct EncodedVideoFrameInfo;
41 struct ExtensionContext {
47 bool isValid;
52 uid_t uid;
56 const char *providerName;
60 const char *extensionName;
61 ExtensionContext():isValid(false), uid(0), providerName(NULL), extensionName(NULL) {}
62 };
63
64
68 enum VIDEO_SOURCE_TYPE {
71 VIDEO_SOURCE_CAMERA_PRIMARY = 0,
72 VIDEO_SOURCE_CAMERA = VIDEO_SOURCE_CAMERA_PRIMARY,
75 VIDEO_SOURCE_CAMERA_SECONDARY = 1,
78 VIDEO_SOURCE_SCREEN_PRIMARY = 2,
79 VIDEO_SOURCE_SCREEN = VIDEO_SOURCE_SCREEN_PRIMARY,
82 VIDEO_SOURCE_SCREEN_SECONDARY = 3,
85 VIDEO_SOURCE_CUSTOM = 4,
88 VIDEO_SOURCE_MEDIA_PLAYER = 5,
91 VIDEO_SOURCE_RTC_IMAGE_PNG = 6,
94 VIDEO_SOURCE_RTC_IMAGE_JPEG = 7,
97 VIDEO_SOURCE_RTC_IMAGE_GIF = 8,
100 VIDEO_SOURCE_REMOTE = 9,
103 VIDEO_SOURCE_TRANSCODED = 10,
104
107 VIDEO_SOURCE_CAMERA_THIRD = 11,
110 VIDEO_SOURCE_CAMERA_FOURTH = 12,
113 VIDEO_SOURCE_SCREEN_THIRD = 13,
116 VIDEO_SOURCE_SCREEN_FOURTH = 14,
119 VIDEO_SOURCE_SPEECH_DRIVEN = 15,
120
121 VIDEO_SOURCE_UNKNOWN = 100
122 };
123
127 enum AUDIO_SOURCE_TYPE {
130 AUDIO_SOURCE_MICROPHONE = 0,
133 AUDIO_SOURCE_CUSTOM = 1,
136 AUDIO_SOURCE_MEDIA_PLAYER = 2,
139 AUDIO_SOURCE_LOOPBACK_RECORDING = 3,
142 AUDIO_SOURCE_MIXED_STREAM = 4,
145 AUDIO_SOURCE_REMOTE_USER = 5,
148 AUDIO_SOURCE_REMOTE_CHANNEL = 6,
149
150 AUDIO_SOURCE_UNKNOWN = 100
151 };
152
156 enum AudioRoute {
160 ROUTE_DEFAULT = -1,
164 ROUTE_HEADSET = 0,
168 ROUTE_EARPIECE = 1,
172 ROUTE_HEADSETNOMIC = 2,
176 ROUTE_SPEAKERPHONE = 3,
180 ROUTE_LOUDSPEAKER = 4,
184 ROUTE_BLUETOOTH_DEVICE_HFP = 5,
188 ROUTE_USB = 6,
192 ROUTE_HDMI = 7,
196 ROUTE_DISPLAYPORT = 8,
200 ROUTE_AIRPLAY = 9,
204 ROUTE_BLUETOOTH_DEVICE_A2DP = 10,
205 };
206
210 enum BYTES_PER_SAMPLE {
214 TWO_BYTES_PER_SAMPLE = 2,
215 };
216
217 struct AudioParameters {
218 int sample_rate;
219 size_t channels;
220 size_t frames_per_buffer;
221
222 AudioParameters() : sample_rate(0), channels(0), frames_per_buffer(0) {}
223 };
224
228 enum RAW_AUDIO_FRAME_OP_MODE_TYPE {
232 RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0,
233
238 RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2,
239 };
240
241 } // namespace rtc
242
243 namespace media {
247 enum MEDIA_SOURCE_TYPE {
251 AUDIO_PLAYOUT_SOURCE = 0,
255 AUDIO_RECORDING_SOURCE = 1,
259 PRIMARY_CAMERA_SOURCE = 2,
263 SECONDARY_CAMERA_SOURCE = 3,
267 PRIMARY_SCREEN_SOURCE = 4,
271 SECONDARY_SCREEN_SOURCE = 5,
275 CUSTOM_VIDEO_SOURCE = 6,
279 MEDIA_PLAYER_SOURCE = 7,
283 RTC_IMAGE_PNG_SOURCE = 8,
287 RTC_IMAGE_JPEG_SOURCE = 9,
291 RTC_IMAGE_GIF_SOURCE = 10,
295 REMOTE_VIDEO_SOURCE = 11,
299 TRANSCODED_VIDEO_SOURCE = 12,
303 SPEECH_DRIVEN_VIDEO_SOURCE = 13,
307 UNKNOWN_MEDIA_SOURCE = 100
308 };
309
310 namespace base {
311
312 typedef void* view_t;
313
314 typedef const char* user_id_t;
315
316 static const uint8_t kMaxCodecNameLength = 50;
317
322 struct PacketOptions {
326 uint32_t timestamp;
327 // Audio level indication.
328 uint8_t audioLevelIndication;
329 PacketOptions() : timestamp(0), audioLevelIndication(127) {}
330 };
331
336 struct AudioEncodedFrameInfo {
340 uint64_t sendTs;
344 uint8_t codec;
345 AudioEncodedFrameInfo() : sendTs(0), codec(0) {}
346 };
347
351 struct AudioPcmFrame {
355 OPTIONAL_ENUM_SIZE_T{
356 // Stereo, 32 kHz, 60 ms (2 * 32 * 60)
364 kMaxDataSizeSamples = 3840,
366 kMaxDataSizeBytes = kMaxDataSizeSamples * sizeof(int16_t),
367 };
368
371 int64_t capture_timestamp;
374 size_t samples_per_channel_;
377 int sample_rate_hz_;
380 size_t num_channels_;
384 int audio_track_number_;
387 rtc::BYTES_PER_SAMPLE bytes_per_sample;
389 int16_t data_[kMaxDataSizeSamples];
390
395 bool is_stereo_;
396
397 AudioPcmFrame& operator=(const AudioPcmFrame& src) {
398 if (this == &src) {
399 return *this;
400 }
401
402 capture_timestamp = src.capture_timestamp;
403 samples_per_channel_ = src.samples_per_channel_;
404 sample_rate_hz_ = src.sample_rate_hz_;
405 bytes_per_sample = src.bytes_per_sample;
406 num_channels_ = src.num_channels_;
407 is_stereo_ = src.is_stereo_;
408 this->audio_track_number_ = src.audio_track_number_;
409
410 size_t length = src.samples_per_channel_ * src.num_channels_;
411 if (length > kMaxDataSizeSamples) {
412 length = kMaxDataSizeSamples;
413 }
414
415 memcpy(data_, src.data_, length * sizeof(int16_t));
416
417 return *this;
418 }
419
420 AudioPcmFrame()
421 : capture_timestamp(0),
422 samples_per_channel_(0),
423 sample_rate_hz_(0),
424 num_channels_(0),
425 audio_track_number_(0),
426 bytes_per_sample(rtc::TWO_BYTES_PER_SAMPLE),
427 is_stereo_(false) {
428 memset(data_, 0, sizeof(data_));
429 }
430
431 AudioPcmFrame(const AudioPcmFrame& src)
432 : capture_timestamp(src.capture_timestamp),
433 samples_per_channel_(src.samples_per_channel_),
434 sample_rate_hz_(src.sample_rate_hz_),
435 num_channels_(src.num_channels_),
436 audio_track_number_(src.audio_track_number_),
437 bytes_per_sample(src.bytes_per_sample),
438 is_stereo_(src.is_stereo_) {
439 size_t length = src.samples_per_channel_ * src.num_channels_;
440 if (length > kMaxDataSizeSamples) {
441 length = kMaxDataSizeSamples;
442 }
443
444 memcpy(this->data_, src.data_, length * sizeof(int16_t));
445 }
446 };
447
450 enum AUDIO_DUAL_MONO_MODE {
452 AUDIO_DUAL_MONO_STEREO = 0,
454 AUDIO_DUAL_MONO_L = 1,
456 AUDIO_DUAL_MONO_R = 2,
458 AUDIO_DUAL_MONO_MIX = 3
459 };
460
464 enum VIDEO_PIXEL_FORMAT {
468 VIDEO_PIXEL_DEFAULT = 0,
472 VIDEO_PIXEL_I420 = 1,
476 VIDEO_PIXEL_BGRA = 2,
480 VIDEO_PIXEL_NV21 = 3,
484 VIDEO_PIXEL_RGBA = 4,
488 VIDEO_PIXEL_NV12 = 8,
492 VIDEO_TEXTURE_2D = 10,
496 VIDEO_TEXTURE_OES = 11,
497 /*
498 12: pixel format for iOS CVPixelBuffer NV12
499 */
500 VIDEO_CVPIXEL_NV12 = 12,
501 /*
502 13: pixel format for iOS CVPixelBuffer I420
503 */
504 VIDEO_CVPIXEL_I420 = 13,
505 /*
506 14: pixel format for iOS CVPixelBuffer BGRA
507 */
508 VIDEO_CVPIXEL_BGRA = 14,
512 VIDEO_CVPIXEL_P010 = 15,
516 VIDEO_PIXEL_I422 = 16,
521 VIDEO_TEXTURE_ID3D11TEXTURE2D = 17,
526 VIDEO_PIXEL_I010 = 18,
527 };
528
532 enum RENDER_MODE_TYPE {
537 RENDER_MODE_HIDDEN = 1,
543 RENDER_MODE_FIT = 2,
548 RENDER_MODE_ADAPTIVE __deprecated = 3,
549 };
550
554 enum CAMERA_VIDEO_SOURCE_TYPE {
558 CAMERA_SOURCE_FRONT = 0,
562 CAMERA_SOURCE_BACK = 1,
566 VIDEO_SOURCE_UNSPECIFIED = 2,
567 };
568
573 class IVideoFrameMetaInfo {
574 public:
575 enum META_INFO_KEY {
576 KEY_FACE_CAPTURE = 0,
577 };
578 virtual ~IVideoFrameMetaInfo(){};
579 virtual const char* getMetaInfoStr(META_INFO_KEY key) const = 0;
580 };
581
582 struct ColorSpace {
583 enum PrimaryID {
584 // The indices are equal to the values specified in T-REC H.273 Table 2.
585 PRIMARYID_BT709 = 1,
586 PRIMARYID_UNSPECIFIED = 2,
587 PRIMARYID_BT470M = 4,
588 PRIMARYID_BT470BG = 5,
589 PRIMARYID_SMPTE170M = 6, // Identical to BT601
590 PRIMARYID_SMPTE240M = 7,
591 PRIMARYID_FILM = 8,
592 PRIMARYID_BT2020 = 9,
593 PRIMARYID_SMPTEST428 = 10,
594 PRIMARYID_SMPTEST431 = 11,
595 PRIMARYID_SMPTEST432 = 12,
596 PRIMARYID_JEDECP22 = 22, // Identical to EBU3213-E
597 };
598
599 enum RangeID {
600 // The indices are equal to the values specified at
601 // https://www.webmproject.org/docs/container/#colour for the element Range.
602 RANGEID_INVALID = 0,
603 // Limited Rec. 709 color range with RGB values ranging from 16 to 235.
604 RANGEID_LIMITED = 1,
605 // Full RGB color range with RGB valees from 0 to 255.
606 RANGEID_FULL = 2,
607 // Range is defined by MatrixCoefficients/TransferCharacteristics.
608 RANGEID_DERIVED = 3,
609 };
610
611 enum MatrixID {
612 // The indices are equal to the values specified in T-REC H.273 Table 4.
613 MATRIXID_RGB = 0,
614 MATRIXID_BT709 = 1,
615 MATRIXID_UNSPECIFIED = 2,
616 MATRIXID_FCC = 4,
617 MATRIXID_BT470BG = 5,
618 MATRIXID_SMPTE170M = 6,
619 MATRIXID_SMPTE240M = 7,
620 MATRIXID_YCOCG = 8,
621 MATRIXID_BT2020_NCL = 9,
622 MATRIXID_BT2020_CL = 10,
623 MATRIXID_SMPTE2085 = 11,
624 MATRIXID_CDNCLS = 12,
625 MATRIXID_CDCLS = 13,
626 MATRIXID_BT2100_ICTCP = 14,
627 };
628
629 enum TransferID {
630 // The indices are equal to the values specified in T-REC H.273 Table 3.
631 TRANSFERID_BT709 = 1,
632 TRANSFERID_UNSPECIFIED = 2,
633 TRANSFERID_GAMMA22 = 4,
634 TRANSFERID_GAMMA28 = 5,
635 TRANSFERID_SMPTE170M = 6,
636 TRANSFERID_SMPTE240M = 7,
637 TRANSFERID_LINEAR = 8,
638 TRANSFERID_LOG = 9,
639 TRANSFERID_LOG_SQRT = 10,
640 TRANSFERID_IEC61966_2_4 = 11,
641 TRANSFERID_BT1361_ECG = 12,
642 TRANSFERID_IEC61966_2_1 = 13,
643 TRANSFERID_BT2020_10 = 14,
644 TRANSFERID_BT2020_12 = 15,
645 TRANSFERID_SMPTEST2084 = 16,
646 TRANSFERID_SMPTEST428 = 17,
647 TRANSFERID_ARIB_STD_B67 = 18,
648 };
649
650 PrimaryID primaries;
651 TransferID transfer;
652 MatrixID matrix;
653 RangeID range;
654
655 ColorSpace()
656 : primaries(PRIMARYID_UNSPECIFIED), transfer(TRANSFERID_UNSPECIFIED),
657 matrix(MATRIXID_UNSPECIFIED), range(RANGEID_INVALID) {}
658
659 bool validate() const {
660 return primaries != PRIMARYID_UNSPECIFIED || transfer != TRANSFERID_UNSPECIFIED ||
661 matrix != MATRIXID_UNSPECIFIED ||
662 range != RANGEID_INVALID;
663 }
664 };
665
669 struct Hdr10MetadataInfo {
673 uint16_t redPrimaryX;
677 uint16_t redPrimaryY;
681 uint16_t greenPrimaryX;
685 uint16_t greenPrimaryY;
689 uint16_t bluePrimaryX;
693 uint16_t bluePrimaryY;
697 uint16_t whitePointX;
701 uint16_t whitePointY;
705 unsigned int maxMasteringLuminance;
709 unsigned int minMasteringLuminance;
713 uint16_t maxContentLightLevel;
717 uint16_t maxFrameAverageLightLevel;
718
719 Hdr10MetadataInfo()
720 : redPrimaryX(0),
721 redPrimaryY(0),
722 greenPrimaryX(0),
723 greenPrimaryY(0),
724 bluePrimaryX(0),
725 bluePrimaryY(0),
726 whitePointX(0),
727 whitePointY(0),
728 maxMasteringLuminance(0),
729 minMasteringLuminance(0),
730 maxContentLightLevel(0),
731 maxFrameAverageLightLevel(0){}
732
733 bool validate() const {
734 return maxContentLightLevel >= 0 && maxContentLightLevel <= 20000 &&
735 maxFrameAverageLightLevel >= 0 &&
736 maxFrameAverageLightLevel <= 20000;
737 }
738 };
739
743 enum ALPHA_STITCH_MODE {
747 NO_ALPHA_STITCH = 0,
751 ALPHA_STITCH_UP = 1,
755 ALPHA_STITCH_BELOW = 2,
759 ALPHA_STITCH_LEFT = 3,
763 ALPHA_STITCH_RIGHT = 4,
764 };
765
766
770 struct ExternalVideoFrame {
771 ExternalVideoFrame()
772 : type(VIDEO_BUFFER_RAW_DATA),
773 format(VIDEO_PIXEL_DEFAULT),
774 buffer(NULL),
775 stride(0),
776 height(0),
777 cropLeft(0),
778 cropTop(0),
779 cropRight(0),
780 cropBottom(0),
781 rotation(0),
782 timestamp(0),
783 eglContext(NULL),
784 eglType(EGL_CONTEXT10),
785 textureId(0),
786 fenceObject(0),
787 metadataBuffer(NULL),
788 metadataSize(0),
789 alphaBuffer(NULL),
790 fillAlphaBuffer(false),
791 alphaStitchMode(NO_ALPHA_STITCH),
792 d3d11Texture2d(NULL),
793 textureSliceIndex(0){}
794
798 enum EGL_CONTEXT_TYPE {
802 EGL_CONTEXT10 = 0,
806 EGL_CONTEXT14 = 1,
807 };
808
812 enum VIDEO_BUFFER_TYPE {
816 VIDEO_BUFFER_RAW_DATA = 1,
820 VIDEO_BUFFER_ARRAY = 2,
824 VIDEO_BUFFER_TEXTURE = 3,
825 };
826
830 VIDEO_BUFFER_TYPE type;
834 VIDEO_PIXEL_FORMAT format;
835
839 void* buffer;
844 int stride;
848 int height;
853 int cropLeft;
858 int cropTop;
863 int cropRight;
868 int cropBottom;
873 int rotation;
881 long long timestamp;
888 void* eglContext;
892 EGL_CONTEXT_TYPE eglType;
897 int textureId;
902 long long fenceObject;
906 float matrix[16];
911 uint8_t* metadataBuffer;
916 int metadataSize;
922 uint8_t* alphaBuffer;
927 bool fillAlphaBuffer;
937 ALPHA_STITCH_MODE alphaStitchMode;
938
942 void *d3d11Texture2d;
943
947 int textureSliceIndex;
948
952 Hdr10MetadataInfo hdr10MetadataInfo;
953
957 ColorSpace colorSpace;
958 };
959
963 struct VideoFrame {
964 VideoFrame():
965 type(VIDEO_PIXEL_DEFAULT),
966 width(0),
967 height(0),
968 yStride(0),
969 uStride(0),
970 vStride(0),
971 yBuffer(NULL),
972 uBuffer(NULL),
973 vBuffer(NULL),
974 rotation(0),
975 renderTimeMs(0),
976 avsync_type(0),
977 metadata_buffer(NULL),
978 metadata_size(0),
979 sharedContext(0),
980 textureId(0),
981 d3d11Texture2d(NULL),
982 alphaBuffer(NULL),
983 alphaStitchMode(NO_ALPHA_STITCH),
984 pixelBuffer(NULL),
985 metaInfo(NULL){
986 memset(matrix, 0, sizeof(matrix));
987 }
991 VIDEO_PIXEL_FORMAT type;
995 int width;
999 int height;
1003 int yStride;
1007 int uStride;
1011 int vStride;
1015 uint8_t* yBuffer;
1019 uint8_t* uBuffer;
1023 uint8_t* vBuffer;
1027 int rotation;
1034 int64_t renderTimeMs;
1038 int avsync_type;
1043 uint8_t* metadata_buffer;
1048 int metadata_size;
1052 void* sharedContext;
1056 int textureId;
1061 void* d3d11Texture2d;
1065 float matrix[16];
1071 uint8_t* alphaBuffer;
1081 ALPHA_STITCH_MODE alphaStitchMode;
1085 void* pixelBuffer;
1090 IVideoFrameMetaInfo* metaInfo;
1091
1095 Hdr10MetadataInfo hdr10MetadataInfo;
1096
1100 ColorSpace colorSpace;
1101 };
1102
1106 class IVideoFrameObserver {
1107 public:
1116 virtual void onFrame(const VideoFrame* frame) = 0;
1117 virtual ~IVideoFrameObserver() {}
1118 virtual bool isExternal() { return true; }
1119 virtual VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return VIDEO_PIXEL_DEFAULT; }
1120 };
1121
1122 enum MEDIA_PLAYER_SOURCE_TYPE {
1128 MEDIA_PLAYER_SOURCE_DEFAULT,
1134 MEDIA_PLAYER_SOURCE_FULL_FEATURED,
1139 MEDIA_PLAYER_SOURCE_SIMPLE,
1140 };
1141
1142 enum VIDEO_MODULE_POSITION {
1143 POSITION_POST_CAPTURER = 1 << 0,
1144 POSITION_PRE_RENDERER = 1 << 1,
1145 POSITION_PRE_ENCODER = 1 << 2,
1146 POSITION_POST_CAPTURER_ORIGIN = 1 << 3,
1147 };
1148
1149 } // namespace base
1150
1153 #define MAX_CONTENT_INSPECT_MODULE_COUNT 32
1154 enum CONTENT_INSPECT_RESULT {
1155 CONTENT_INSPECT_NEUTRAL = 1,
1156 CONTENT_INSPECT_SEXY = 2,
1157 CONTENT_INSPECT_PORN = 3,
1158 };
1159
1160 enum CONTENT_INSPECT_TYPE {
1164 CONTENT_INSPECT_INVALID = 0,
1169 CONTENT_INSPECT_MODERATION __deprecated = 1,
1173 CONTENT_INSPECT_SUPERVISION = 2,
1177 CONTENT_INSPECT_IMAGE_MODERATION = 3
1178 };
1179
1180 struct ContentInspectModule {
1184 CONTENT_INSPECT_TYPE type;
1188 unsigned int interval;
1192 base::VIDEO_MODULE_POSITION position;
1193 ContentInspectModule() {
1194 type = CONTENT_INSPECT_INVALID;
1195 interval = 0;
1196 position = base::POSITION_PRE_ENCODER;
1197 }
1198 };
1201 struct ContentInspectConfig {
1202 const char* extraInfo;
1206 const char* serverConfig;
1210 ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
1213 int moduleCount;
1214 ContentInspectConfig& operator=(const ContentInspectConfig& rth) {
1215 extraInfo = rth.extraInfo;
1216 serverConfig = rth.serverConfig;
1217 moduleCount = rth.moduleCount;
1218 memcpy(&modules, &rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
1219 return *this;
1220 }
1221 ContentInspectConfig() : extraInfo(NULL), serverConfig(NULL), moduleCount(0) {}
1222 };
1225 struct SnapshotConfig {
1233 const char* filePath;
1234
1243 media::base::VIDEO_MODULE_POSITION position;
1244 SnapshotConfig() :filePath(NULL), position(media::base::POSITION_PRE_ENCODER) {}
1245 };
1246
1250 class IAudioPcmFrameSink {
1251 public:
1260 virtual void onFrame(agora::media::base::AudioPcmFrame* frame) = 0;
1261 virtual ~IAudioPcmFrameSink() {}
1262 };
1263
1267 class IAudioFrameObserverBase {
1268 public:
1272 enum AUDIO_FRAME_TYPE {
1276 FRAME_TYPE_PCM16 = 0,
1277 };
1278 enum { MAX_HANDLE_TIME_CNT = 10 };
1282 struct AudioFrame {
1286 AUDIO_FRAME_TYPE type;
1290 int samplesPerChannel;
1294 agora::rtc::BYTES_PER_SAMPLE bytesPerSample;
1300 int channels;
1304 int samplesPerSec;
1311 void* buffer;
1319 int64_t renderTimeMs;
1327 int avsync_type;
1334 int64_t presentationMs;
1338 int audioTrackNumber;
1342 uint32_t rtpTimestamp;
1343
1344 AudioFrame()
1345 : type(FRAME_TYPE_PCM16),
1346 samplesPerChannel(0),
1347 bytesPerSample(rtc::TWO_BYTES_PER_SAMPLE),
1348 channels(0),
1349 samplesPerSec(0),
1350 buffer(NULL),
1351 renderTimeMs(0),
1352 avsync_type(0),
1353 presentationMs(0),
1354 audioTrackNumber(0),
1355 rtpTimestamp(0) {}
1356 };
1357
1358 enum AUDIO_FRAME_POSITION {
1359 AUDIO_FRAME_POSITION_NONE = 0x0000,
1362 AUDIO_FRAME_POSITION_PLAYBACK = 0x0001,
1365 AUDIO_FRAME_POSITION_RECORD = 0x0002,
1368 AUDIO_FRAME_POSITION_MIXED = 0x0004,
1371 AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008,
1374 AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010,
1375 };
1376
1377 struct AudioParams {
1386 int sample_rate;
1387
1388 /* The number of audio channels, which can be set as either of the following values:
1389
1390 - `1`: Mono (Default)
1391 - `2`: Stereo
1392 */
1393 int channels;
1394
1395 /* The use mode of the audio data. See AgoraAudioRawFrameOperationMode.
1396 */
1397 rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE mode;
1398
1402 int samples_per_call;
1403
1404 AudioParams()
1405 : sample_rate(0),
1406 channels(0),
1407 mode(rtc::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY),
1408 samples_per_call(0) {}
1409 AudioParams(int samplerate, int channel, rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE type,
1410 int samplesPerCall)
1411 : sample_rate(samplerate),
1412 channels(channel),
1413 mode(type),
1414 samples_per_call(samplesPerCall) {}
1415 };
1416
1417 public:
1418 virtual ~IAudioFrameObserverBase() {}
1419
1428 virtual bool onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1437 virtual bool onPlaybackAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1446 virtual bool onMixedAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1454 virtual bool onEarMonitoringAudioFrame(AudioFrame& audioFrame) = 0;
1464 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, base::user_id_t userId,
1465 AudioFrame& audioFrame) {
1466 (void)channelId;
1467 (void)userId;
1468 (void)audioFrame;
1469 return true;
1470 }
1471
1494 virtual int getObservedAudioFramePosition() = 0;
1495
1507 virtual AudioParams getPlaybackAudioParams() = 0;
1508
1519 virtual AudioParams getRecordAudioParams() = 0;
1520
1531 virtual AudioParams getMixedAudioParams() = 0;
1532
1543 virtual AudioParams getEarMonitoringAudioParams() = 0;
1544 };
1545
1549 class IAudioFrameObserver : public IAudioFrameObserverBase {
1550 public:
1551 using IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing;
1561 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, rtc::uid_t uid,
1562 AudioFrame& audioFrame) = 0;
1563 };
1564
1565 struct AudioSpectrumData {
1569 const float* audioSpectrumData;
1573 int dataLength;
1574
1575 AudioSpectrumData() : audioSpectrumData(NULL), dataLength(0) {}
1576 AudioSpectrumData(const float* data, int length) : audioSpectrumData(data), dataLength(length) {}
1577 };
1578
1579 struct UserAudioSpectrumInfo {
1583 agora::rtc::uid_t uid;
1587 struct AudioSpectrumData spectrumData;
1588
1589 UserAudioSpectrumInfo() : uid(0) {}
1590
1591 UserAudioSpectrumInfo(agora::rtc::uid_t uid, const float* data, int length)
1592 : uid(uid), spectrumData(data, length) {}
1593 };
1594
1598 class IAudioSpectrumObserver {
1599 public:
1600 virtual ~IAudioSpectrumObserver() {}
1601
1615 virtual bool onLocalAudioSpectrum(const AudioSpectrumData& data) = 0;
1635 virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo* spectrums,
1636 unsigned int spectrumNumber) = 0;
1637 };
1638
1642 class IVideoEncodedFrameObserver {
1643 public:
1654 virtual bool onEncodedVideoFrameReceived(
1655 rtc::uid_t uid, const uint8_t* imageBuffer, size_t length,
1656 const rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo) = 0;
1657
1658 virtual ~IVideoEncodedFrameObserver() {}
1659 };
1660
1664 class IVideoFrameObserver {
1665 public:
1666 typedef media::base::VideoFrame VideoFrame;
1670 enum VIDEO_FRAME_PROCESS_MODE {
1676 PROCESS_MODE_READ_ONLY, // Observer works as a pure renderer and will not modify the original
1677 // frame.
1683 PROCESS_MODE_READ_WRITE, // Observer works as a filter that will process the video frame and
1684 // affect the following frame processing in SDK.
1685 };
1686
1687 public:
1688 virtual ~IVideoFrameObserver() {}
1689
1712 virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
1713 VideoFrame& videoFrame) = 0;
1714
1738 virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
1739 VideoFrame& videoFrame) = 0;
1740
1764 virtual bool onMediaPlayerVideoFrame(VideoFrame& videoFrame, int mediaPlayerId) = 0;
1765
1785 virtual bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
1786 VideoFrame& videoFrame) = 0;
1787
1788 virtual bool onTranscodedVideoFrame(VideoFrame& videoFrame) = 0;
1789
1799 virtual VIDEO_FRAME_PROCESS_MODE getVideoFrameProcessMode() { return PROCESS_MODE_READ_ONLY; }
1800
1816 virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return base::VIDEO_PIXEL_DEFAULT; }
1817
1833 virtual bool getRotationApplied() { return false; }
1834
1851 virtual bool getMirrorApplied() { return false; }
1852
1875 virtual uint32_t getObservedFramePosition() {
1876 return base::POSITION_POST_CAPTURER | base::POSITION_PRE_RENDERER;
1877 }
1878
1886 virtual bool isExternal() { return true; }
1887 };
1888
1892 enum EXTERNAL_VIDEO_SOURCE_TYPE {
1896 VIDEO_FRAME = 0,
1900 ENCODED_VIDEO_FRAME,
1901 };
1902
1908 enum MediaRecorderContainerFormat {
1912 FORMAT_MP4 = 1,
1913 };
1919 enum MediaRecorderStreamType {
1923 STREAM_TYPE_AUDIO = 0x01,
1927 STREAM_TYPE_VIDEO = 0x02,
1931 STREAM_TYPE_BOTH = STREAM_TYPE_AUDIO | STREAM_TYPE_VIDEO,
1932 };
1938 enum RecorderState {
1942 RECORDER_STATE_ERROR = -1,
1946 RECORDER_STATE_START = 2,
1950 RECORDER_STATE_STOP = 3,
1951 };
1957 enum RecorderReasonCode {
1961 RECORDER_REASON_NONE = 0,
1965 RECORDER_REASON_WRITE_FAILED = 1,
1970 RECORDER_REASON_NO_STREAM = 2,
1974 RECORDER_REASON_OVER_MAX_DURATION = 3,
1978 RECORDER_REASON_CONFIG_CHANGED = 4,
1979 };
1985 struct MediaRecorderConfiguration {
1994 const char* storagePath;
1999 MediaRecorderContainerFormat containerFormat;
2003 MediaRecorderStreamType streamType;
2007 int maxDurationMs;
2014 int recorderInfoUpdateInterval;
2018 int width;
2022 int height;
2026 int fps;
2030 int sample_rate;
2034 int channel_num;
2038 agora::rtc::VIDEO_SOURCE_TYPE videoSourceType;
2039
2040 MediaRecorderConfiguration()
2041 : storagePath(NULL),
2042 containerFormat(FORMAT_MP4),
2043 streamType(STREAM_TYPE_BOTH),
2044 maxDurationMs(120000),
2045 recorderInfoUpdateInterval(0),
2046 width(1280),
2047 height(720),
2048 fps(30),
2049 sample_rate(48000),
2050 channel_num(1),
2051 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2052 MediaRecorderConfiguration(const char* path, MediaRecorderContainerFormat format,
2053 MediaRecorderStreamType type, int duration, int interval)
2054 : storagePath(path),
2055 containerFormat(format),
2056 streamType(type),
2057 maxDurationMs(duration),
2058 recorderInfoUpdateInterval(interval),
2059 width(1280),
2060 height(720),
2061 fps(30),
2062 sample_rate(48000),
2063 channel_num(1),
2064 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2065 };
2066
2067 class IFaceInfoObserver {
2068 public:
2076 virtual bool onFaceInfo(const char* outFaceInfo) = 0;
2077
2078 virtual ~IFaceInfoObserver() {}
2079 };
2080
2086 struct RecorderInfo {
2090 const char* fileName;
2094 unsigned int durationMs;
2098 unsigned int fileSize;
2099
2100 RecorderInfo() : fileName(NULL), durationMs(0), fileSize(0) {}
2101 RecorderInfo(const char* name, unsigned int dur, unsigned int size)
2102 : fileName(name), durationMs(dur), fileSize(size) {}
2103 };
2104
2105 class IMediaRecorderObserver {
2106 public:
2121 virtual void onRecorderStateChanged(const char* channelId, rtc::uid_t uid, RecorderState state,
2122 RecorderReasonCode reason) = 0;
2139 virtual void onRecorderInfoUpdated(const char* channelId, rtc::uid_t uid,
2140 const RecorderInfo& info) = 0;
2141
2142 virtual ~IMediaRecorderObserver() {}
2143 };
2144
2145 } // namespace media
2146 } // namespace agora
agora::media::IVideoFrameObserver::PROCESS_MODE_READ_ONLY
@ PROCESS_MODE_READ_ONLY
Definition: AgoraMediaBase.h:1676
agora::media::base::VideoFrame
Definition: AgoraMediaBase.h:963
agora::media::base::ExternalVideoFrame::cropBottom
int cropBottom
Definition: AgoraMediaBase.h:868
agora::media::base::Hdr10MetadataInfo::redPrimaryY
uint16_t redPrimaryY
Definition: AgoraMediaBase.h:677
agora::media::base::VideoFrame::metadata_size
int metadata_size
Definition: AgoraMediaBase.h:1048
agora::media::SnapshotConfig::filePath
const char * filePath
Definition: AgoraMediaBase.h:1233
agora::media::AudioSpectrumData::audioSpectrumData
const float * audioSpectrumData
Definition: AgoraMediaBase.h:1569
agora::media::IAudioFrameObserverBase::onEarMonitoringAudioFrame
virtual bool onEarMonitoringAudioFrame(AudioFrame &audioFrame)=0
agora::rtc::ExtensionContext::providerName
const char * providerName
Definition: AgoraMediaBase.h:56
agora::media::base::ExternalVideoFrame::matrix
float matrix[16]
Definition: AgoraMediaBase.h:906
agora::media::IAudioPcmFrameSink
Definition: AgoraMediaBase.h:1250
agora::media::IMediaRecorderObserver
Definition: AgoraMediaBase.h:2105
agora::media::IAudioFrameObserverBase
Definition: AgoraMediaBase.h:1267
agora::media::base::ExternalVideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:957
agora::media::ContentInspectConfig::modules
ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT]
Definition: AgoraMediaBase.h:1210
agora::media::base::VideoFrame::uStride
int uStride
Definition: AgoraMediaBase.h:1007
agora::media::IAudioFrameObserverBase::AudioFrame::rtpTimestamp
uint32_t rtpTimestamp
Definition: AgoraMediaBase.h:1342
agora::media::IAudioFrameObserverBase::FRAME_TYPE_PCM16
@ FRAME_TYPE_PCM16
Definition: AgoraMediaBase.h:1276
agora::media::IAudioFrameObserverBase::AudioFrame::audioTrackNumber
int audioTrackNumber
Definition: AgoraMediaBase.h:1338
agora::media::base::VideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:1071
agora::media::IFaceInfoObserver
Definition: AgoraMediaBase.h:2067
agora::media::base::VideoFrame::height
int height
Definition: AgoraMediaBase.h:999
agora::media::base::AudioPcmFrame::data_
int16_t data_[kMaxDataSizeSamples]
Definition: AgoraMediaBase.h:389
agora::media::IAudioFrameObserverBase::onRecordAudioFrame
virtual bool onRecordAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
agora::media::MediaRecorderConfiguration::maxDurationMs
int maxDurationMs
Definition: AgoraMediaBase.h:2007
agora::media::IAudioSpectrumObserver
Definition: AgoraMediaBase.h:1598
agora::rtc::AudioParameters
Definition: AgoraMediaBase.h:217
agora::media::IAudioFrameObserverBase::AudioFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1319
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_RAW_DATA
@ VIDEO_BUFFER_RAW_DATA
Definition: AgoraMediaBase.h:816
agora::media::IAudioFrameObserverBase::getPlaybackAudioParams
virtual AudioParams getPlaybackAudioParams()=0
agora::media::base::ExternalVideoFrame::buffer
void * buffer
Definition: AgoraMediaBase.h:839
agora::media::IAudioFrameObserverBase::AudioFrame::channels
int channels
Definition: AgoraMediaBase.h:1300
agora::media::IVideoFrameObserver::getVideoFormatPreference
virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference()
Definition: AgoraMediaBase.h:1816
agora::rtc::EncodedVideoFrameInfo
Definition: AgoraBase.h:1640
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_TYPE
VIDEO_BUFFER_TYPE
Definition: AgoraMediaBase.h:812
agora::media::ContentInspectConfig::serverConfig
const char * serverConfig
Definition: AgoraMediaBase.h:1206
agora::media::base::IVideoFrameObserver
Definition: AgoraMediaBase.h:1106
agora::media::IVideoFrameObserver::getVideoFrameProcessMode
virtual VIDEO_FRAME_PROCESS_MODE getVideoFrameProcessMode()
Definition: AgoraMediaBase.h:1799
agora::media::IVideoFrameObserver
Definition: AgoraMediaBase.h:1664
agora::media::IAudioFrameObserverBase::AudioFrame
Definition: AgoraMediaBase.h:1282
agora::media::base::AudioEncodedFrameInfo::codec
uint8_t codec
Definition: AgoraMediaBase.h:344
agora::media::IVideoEncodedFrameObserver::onEncodedVideoFrameReceived
virtual bool onEncodedVideoFrameReceived(rtc::uid_t uid, const uint8_t *imageBuffer, size_t length, const rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo)=0
agora::media::MediaRecorderConfiguration::recorderInfoUpdateInterval
int recorderInfoUpdateInterval
Definition: AgoraMediaBase.h:2014
agora::media::IAudioFrameObserver
Definition: AgoraMediaBase.h:1549
agora::media::base::Hdr10MetadataInfo
Definition: AgoraMediaBase.h:669
agora::media::IAudioFrameObserverBase::getEarMonitoringAudioParams
virtual AudioParams getEarMonitoringAudioParams()=0
agora::media::base::VideoFrame::d3d11Texture2d
void * d3d11Texture2d
Definition: AgoraMediaBase.h:1061
agora::media::base::VideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:1027
agora::media::base::VideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:1081
agora::media::base::IVideoFrameObserver::onFrame
virtual void onFrame(const VideoFrame *frame)=0
agora::media::IMediaRecorderObserver::onRecorderStateChanged
virtual void onRecorderStateChanged(const char *channelId, rtc::uid_t uid, RecorderState state, RecorderReasonCode reason)=0
agora::media::IAudioFrameObserverBase::getMixedAudioParams
virtual AudioParams getMixedAudioParams()=0
agora::media::base::AudioPcmFrame::OPTIONAL_ENUM_SIZE_T
OPTIONAL_ENUM_SIZE_T
Definition: AgoraMediaBase.h:355
agora::media::MediaRecorderConfiguration::sample_rate
int sample_rate
Definition: AgoraMediaBase.h:2030
agora::media::base::ExternalVideoFrame::eglContext
void * eglContext
Definition: AgoraMediaBase.h:888
agora::media::base::VideoFrame::metaInfo
IVideoFrameMetaInfo * metaInfo
Definition: AgoraMediaBase.h:1090
agora::media::base::ExternalVideoFrame::cropRight
int cropRight
Definition: AgoraMediaBase.h:863
agora::media::IAudioFrameObserverBase::getRecordAudioParams
virtual AudioParams getRecordAudioParams()=0
agora::media::base::VideoFrame::textureId
int textureId
Definition: AgoraMediaBase.h:1056
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_ARRAY
@ VIDEO_BUFFER_ARRAY
Definition: AgoraMediaBase.h:820
agora::rtc::ExtensionContext
Definition: AgoraMediaBase.h:41
agora::media::MediaRecorderConfiguration::videoSourceType
agora::rtc::VIDEO_SOURCE_TYPE videoSourceType
Definition: AgoraMediaBase.h:2038
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_TEXTURE
@ VIDEO_BUFFER_TEXTURE
Definition: AgoraMediaBase.h:824
agora::media::IAudioFrameObserverBase::AudioFrame::presentationMs
int64_t presentationMs
Definition: AgoraMediaBase.h:1334
agora::media::base::VideoFrame::avsync_type
int avsync_type
Definition: AgoraMediaBase.h:1038
agora::media::base::Hdr10MetadataInfo::greenPrimaryY
uint16_t greenPrimaryY
Definition: AgoraMediaBase.h:685
agora::media::base::VideoFrame::matrix
float matrix[16]
Definition: AgoraMediaBase.h:1065
agora::media::base::ExternalVideoFrame::fenceObject
long long fenceObject
Definition: AgoraMediaBase.h:902
agora::media::base::ExternalVideoFrame::cropLeft
int cropLeft
Definition: AgoraMediaBase.h:853
agora::media::IAudioFrameObserverBase::AudioFrame::samplesPerSec
int samplesPerSec
Definition: AgoraMediaBase.h:1304
agora::media::ContentInspectModule
Definition: AgoraMediaBase.h:1180
agora::media::IAudioFrameObserverBase::AudioFrame::buffer
void * buffer
Definition: AgoraMediaBase.h:1311
agora::media::IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing
virtual bool onPlaybackAudioFrameBeforeMixing(const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
Definition: AgoraMediaBase.h:1464
agora::media::IAudioSpectrumObserver::onRemoteAudioSpectrum
virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo *spectrums, unsigned int spectrumNumber)=0
agora::media::MediaRecorderConfiguration::fps
int fps
Definition: AgoraMediaBase.h:2026
agora::media::base::ColorSpace
Definition: AgoraMediaBase.h:582
agora::media::IMediaRecorderObserver::onRecorderInfoUpdated
virtual void onRecorderInfoUpdated(const char *channelId, rtc::uid_t uid, const RecorderInfo &info)=0
agora::media::base::ExternalVideoFrame
Definition: AgoraMediaBase.h:770
agora::media::base::ExternalVideoFrame::d3d11Texture2d
void * d3d11Texture2d
Definition: AgoraMediaBase.h:942
agora::media::base::AudioEncodedFrameInfo::sendTs
uint64_t sendTs
Definition: AgoraMediaBase.h:340
agora::media::ContentInspectConfig::moduleCount
int moduleCount
Definition: AgoraMediaBase.h:1213
agora::media::base::Hdr10MetadataInfo::whitePointX
uint16_t whitePointX
Definition: AgoraMediaBase.h:697
agora::media::base::VideoFrame::type
VIDEO_PIXEL_FORMAT type
Definition: AgoraMediaBase.h:991
agora::media::base::AudioPcmFrame::capture_timestamp
int64_t capture_timestamp
Definition: AgoraMediaBase.h:371
agora::media::base::ExternalVideoFrame::timestamp
long long timestamp
Definition: AgoraMediaBase.h:881
agora::media::base::AudioPcmFrame::sample_rate_hz_
int sample_rate_hz_
Definition: AgoraMediaBase.h:377
agora::media::MediaRecorderConfiguration::height
int height
Definition: AgoraMediaBase.h:2022
agora::media::IFaceInfoObserver::onFaceInfo
virtual bool onFaceInfo(const char *outFaceInfo)=0
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION
AUDIO_FRAME_POSITION
Definition: AgoraMediaBase.h:1358
agora::media::base::ExternalVideoFrame::height
int height
Definition: AgoraMediaBase.h:848
agora::media::base::VideoFrame::sharedContext
void * sharedContext
Definition: AgoraMediaBase.h:1052
agora::media::base::ExternalVideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:873
agora::media::RecorderInfo
Definition: AgoraMediaBase.h:2086
agora::media::base::ExternalVideoFrame::metadataBuffer
uint8_t * metadataBuffer
Definition: AgoraMediaBase.h:911
agora::media::IVideoFrameObserver::onCaptureVideoFrame
virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType, VideoFrame &videoFrame)=0
agora::media::base::Hdr10MetadataInfo::minMasteringLuminance
unsigned int minMasteringLuminance
Definition: AgoraMediaBase.h:709
agora::media::UserAudioSpectrumInfo::spectrumData
struct AudioSpectrumData spectrumData
Definition: AgoraMediaBase.h:1587
agora::media::IAudioFrameObserverBase::AudioParams::samples_per_call
int samples_per_call
Definition: AgoraMediaBase.h:1402
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_PLAYBACK
@ AUDIO_FRAME_POSITION_PLAYBACK
Definition: AgoraMediaBase.h:1362
agora::media::base::ExternalVideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:937
agora::media::base::PacketOptions
Definition: AgoraMediaBase.h:322
agora::media::base::PacketOptions::timestamp
uint32_t timestamp
Definition: AgoraMediaBase.h:326
agora::media::base::Hdr10MetadataInfo::maxMasteringLuminance
unsigned int maxMasteringLuminance
Definition: AgoraMediaBase.h:705
agora::media::base::Hdr10MetadataInfo::whitePointY
uint16_t whitePointY
Definition: AgoraMediaBase.h:701
agora::media::base::Hdr10MetadataInfo::greenPrimaryX
uint16_t greenPrimaryX
Definition: AgoraMediaBase.h:681
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_TYPE
AUDIO_FRAME_TYPE
Definition: AgoraMediaBase.h:1272
agora::media::MediaRecorderConfiguration::channel_num
int channel_num
Definition: AgoraMediaBase.h:2034
agora::media::base::VideoFrame::yBuffer
uint8_t * yBuffer
Definition: AgoraMediaBase.h:1015
agora::media::base::VideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:1095
agora::media::base::VideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:1100
agora::media::base::AudioPcmFrame::bytes_per_sample
rtc::BYTES_PER_SAMPLE bytes_per_sample
Definition: AgoraMediaBase.h:387
agora::media::UserAudioSpectrumInfo
Definition: AgoraMediaBase.h:1579
agora::media::base::Hdr10MetadataInfo::redPrimaryX
uint16_t redPrimaryX
Definition: AgoraMediaBase.h:673
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_EAR_MONITORING
@ AUDIO_FRAME_POSITION_EAR_MONITORING
Definition: AgoraMediaBase.h:1374
agora::media::RecorderInfo::fileName
const char * fileName
Definition: AgoraMediaBase.h:2090
agora::media::IVideoFrameObserver::onRenderVideoFrame
virtual bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, VideoFrame &videoFrame)=0
agora::media::IVideoFrameObserver::PROCESS_MODE_READ_WRITE
@ PROCESS_MODE_READ_WRITE
Definition: AgoraMediaBase.h:1683
agora::media::IVideoFrameObserver::isExternal
virtual bool isExternal()
Definition: AgoraMediaBase.h:1886
agora::media::ContentInspectModule::interval
unsigned int interval
Definition: AgoraMediaBase.h:1188
agora::media::IVideoFrameObserver::getObservedFramePosition
virtual uint32_t getObservedFramePosition()
Definition: AgoraMediaBase.h:1875
agora::media::base::VideoFrame::yStride
int yStride
Definition: AgoraMediaBase.h:1003
agora::media::base::ExternalVideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:922
agora::media::base::Hdr10MetadataInfo::bluePrimaryX
uint16_t bluePrimaryX
Definition: AgoraMediaBase.h:689
agora::media::ContentInspectModule::type
CONTENT_INSPECT_TYPE type
Definition: AgoraMediaBase.h:1184
agora::media::MediaRecorderConfiguration::containerFormat
MediaRecorderContainerFormat containerFormat
Definition: AgoraMediaBase.h:1999
agora::media::base::ExternalVideoFrame::EGL_CONTEXT14
@ EGL_CONTEXT14
Definition: AgoraMediaBase.h:806
agora::media::RecorderInfo::fileSize
unsigned int fileSize
Definition: AgoraMediaBase.h:2098
agora::media::base::ExternalVideoFrame::cropTop
int cropTop
Definition: AgoraMediaBase.h:858
agora::media::base::ExternalVideoFrame::type
VIDEO_BUFFER_TYPE type
Definition: AgoraMediaBase.h:830
agora::media::IVideoFrameObserver::onPreEncodeVideoFrame
virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType, VideoFrame &videoFrame)=0
agora::media::base::ExternalVideoFrame::textureSliceIndex
int textureSliceIndex
Definition: AgoraMediaBase.h:947
agora::media::base::Hdr10MetadataInfo::bluePrimaryY
uint16_t bluePrimaryY
Definition: AgoraMediaBase.h:693
agora::media::IVideoFrameObserver::getRotationApplied
virtual bool getRotationApplied()
Definition: AgoraMediaBase.h:1833
agora::media::base::Hdr10MetadataInfo::maxContentLightLevel
uint16_t maxContentLightLevel
Definition: AgoraMediaBase.h:713
agora::media::SnapshotConfig
Definition: AgoraMediaBase.h:1225
agora::media::base::VideoFrame::vBuffer
uint8_t * vBuffer
Definition: AgoraMediaBase.h:1023
agora::media::AudioSpectrumData::dataLength
int dataLength
Definition: AgoraMediaBase.h:1573
agora::media::base::ExternalVideoFrame::EGL_CONTEXT_TYPE
EGL_CONTEXT_TYPE
Definition: AgoraMediaBase.h:798
agora::media::IAudioFrameObserverBase::onMixedAudioFrame
virtual bool onMixedAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
agora::media::IAudioFrameObserverBase::AudioParams
Definition: AgoraMediaBase.h:1377
agora::media::base::AudioPcmFrame::num_channels_
size_t num_channels_
Definition: AgoraMediaBase.h:380
agora::rtc::ExtensionContext::uid
uid_t uid
Definition: AgoraMediaBase.h:52
agora::media::IAudioFrameObserverBase::AudioFrame::avsync_type
int avsync_type
Definition: AgoraMediaBase.h:1327
agora::media::IAudioFrameObserverBase::getObservedAudioFramePosition
virtual int getObservedAudioFramePosition()=0
agora::media::MediaRecorderConfiguration
Definition: AgoraMediaBase.h:1985
agora::media::base::VideoFrame::metadata_buffer
uint8_t * metadata_buffer
Definition: AgoraMediaBase.h:1043
agora::rtc::ExtensionContext::isValid
bool isValid
Definition: AgoraMediaBase.h:47
agora::media::MediaRecorderConfiguration::streamType
MediaRecorderStreamType streamType
Definition: AgoraMediaBase.h:2003
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_BEFORE_MIXING
@ AUDIO_FRAME_POSITION_BEFORE_MIXING
Definition: AgoraMediaBase.h:1371
agora::media::ContentInspectModule::position
base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1192
agora::media::MediaRecorderConfiguration::storagePath
const char * storagePath
Definition: AgoraMediaBase.h:1994
agora::media::AudioSpectrumData
Definition: AgoraMediaBase.h:1565
agora::media::base::VideoFrame::width
int width
Definition: AgoraMediaBase.h:995
agora::media::base::AudioPcmFrame::audio_track_number_
int audio_track_number_
Definition: AgoraMediaBase.h:384
agora::media::RecorderInfo::durationMs
unsigned int durationMs
Definition: AgoraMediaBase.h:2094
agora::media::base::VideoFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1034
agora::media::base::AudioPcmFrame::samples_per_channel_
size_t samples_per_channel_
Definition: AgoraMediaBase.h:374
agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing
virtual bool onPlaybackAudioFrameBeforeMixing(const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame)=0
agora::media::IVideoFrameObserver::onMediaPlayerVideoFrame
virtual bool onMediaPlayerVideoFrame(VideoFrame &videoFrame, int mediaPlayerId)=0
agora::media::IAudioFrameObserverBase::AudioFrame::bytesPerSample
agora::rtc::BYTES_PER_SAMPLE bytesPerSample
Definition: AgoraMediaBase.h:1294
agora::media::base::ExternalVideoFrame::textureId
int textureId
Definition: AgoraMediaBase.h:897
agora::media::base::VideoFrame::pixelBuffer
void * pixelBuffer
Definition: AgoraMediaBase.h:1085
agora::media::IAudioFrameObserverBase::AudioFrame::type
AUDIO_FRAME_TYPE type
Definition: AgoraMediaBase.h:1286
agora::media::IAudioPcmFrameSink::onFrame
virtual void onFrame(agora::media::base::AudioPcmFrame *frame)=0
agora::media::base::AudioPcmFrame::is_stereo_
bool is_stereo_
Definition: AgoraMediaBase.h:395
agora::media::IVideoEncodedFrameObserver
Definition: AgoraMediaBase.h:1642
agora::media::IAudioFrameObserverBase::AudioFrame::samplesPerChannel
int samplesPerChannel
Definition: AgoraMediaBase.h:1290
agora::media::IVideoFrameObserver::getMirrorApplied
virtual bool getMirrorApplied()
Definition: AgoraMediaBase.h:1851
agora::media::IAudioSpectrumObserver::onLocalAudioSpectrum
virtual bool onLocalAudioSpectrum(const AudioSpectrumData &data)=0
agora::media::base::AudioEncodedFrameInfo
Definition: AgoraMediaBase.h:336
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_RECORD
@ AUDIO_FRAME_POSITION_RECORD
Definition: AgoraMediaBase.h:1365
agora::media::MediaRecorderConfiguration::width
int width
Definition: AgoraMediaBase.h:2018
agora::media::base::VideoFrame::vStride
int vStride
Definition: AgoraMediaBase.h:1011
agora::media::base::ExternalVideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:952
agora::media::ContentInspectConfig
Definition: AgoraMediaBase.h:1201
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_MIXED
@ AUDIO_FRAME_POSITION_MIXED
Definition: AgoraMediaBase.h:1368
agora::media::base::AudioPcmFrame
Definition: AgoraMediaBase.h:351
agora::media::base::ExternalVideoFrame::fillAlphaBuffer
bool fillAlphaBuffer
Definition: AgoraMediaBase.h:927
agora::media::IAudioFrameObserverBase::AudioParams::sample_rate
int sample_rate
Definition: AgoraMediaBase.h:1386
agora::media::base::VideoFrame::uBuffer
uint8_t * uBuffer
Definition: AgoraMediaBase.h:1019
agora::media::IAudioFrameObserverBase::onPlaybackAudioFrame
virtual bool onPlaybackAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
agora::media::base::ExternalVideoFrame::EGL_CONTEXT10
@ EGL_CONTEXT10
Definition: AgoraMediaBase.h:802
agora::media::base::IVideoFrameMetaInfo
Definition: AgoraMediaBase.h:573
agora::media::UserAudioSpectrumInfo::uid
agora::rtc::uid_t uid
Definition: AgoraMediaBase.h:1583
agora::media::SnapshotConfig::position
media::base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1243
agora::rtc::ExtensionContext::extensionName
const char * extensionName
Definition: AgoraMediaBase.h:60
agora::media::IVideoFrameObserver::VIDEO_FRAME_PROCESS_MODE
VIDEO_FRAME_PROCESS_MODE
Definition: AgoraMediaBase.h:1670
agora::media::base::ExternalVideoFrame::format
VIDEO_PIXEL_FORMAT format
Definition: AgoraMediaBase.h:834
agora::media::base::ExternalVideoFrame::metadataSize
int metadataSize
Definition: AgoraMediaBase.h:916
agora::media::base::Hdr10MetadataInfo::maxFrameAverageLightLevel
uint16_t maxFrameAverageLightLevel
Definition: AgoraMediaBase.h:717
agora::media::base::ExternalVideoFrame::stride
int stride
Definition: AgoraMediaBase.h:844
agora::media::base::ExternalVideoFrame::eglType
EGL_CONTEXT_TYPE eglType
Definition: AgoraMediaBase.h:892