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;
51 uid_t uid;
55 const char *providerName;
59 const char *extensionName;
60 ExtensionContext():isValid(false), uid(0), providerName(NULL), extensionName(NULL) {}
61 };
62
63
67 enum VIDEO_SOURCE_TYPE {
71 VIDEO_SOURCE_CAMERA_PRIMARY = 0,
75 VIDEO_SOURCE_CAMERA = VIDEO_SOURCE_CAMERA_PRIMARY,
79 VIDEO_SOURCE_CAMERA_SECONDARY = 1,
83 VIDEO_SOURCE_SCREEN_PRIMARY = 2,
87 VIDEO_SOURCE_SCREEN = VIDEO_SOURCE_SCREEN_PRIMARY,
91 VIDEO_SOURCE_SCREEN_SECONDARY = 3,
95 VIDEO_SOURCE_CUSTOM = 4,
99 VIDEO_SOURCE_MEDIA_PLAYER = 5,
103 VIDEO_SOURCE_RTC_IMAGE_PNG = 6,
107 VIDEO_SOURCE_RTC_IMAGE_JPEG = 7,
111 VIDEO_SOURCE_RTC_IMAGE_GIF = 8,
115 VIDEO_SOURCE_REMOTE = 9,
119 VIDEO_SOURCE_TRANSCODED = 10,
120
124 VIDEO_SOURCE_CAMERA_THIRD = 11,
128 VIDEO_SOURCE_CAMERA_FOURTH = 12,
132 VIDEO_SOURCE_SCREEN_THIRD = 13,
136 VIDEO_SOURCE_SCREEN_FOURTH = 14,
140 VIDEO_SOURCE_SPEECH_DRIVEN = 15,
141
145 VIDEO_SOURCE_UNKNOWN = 100
146 };
147
151 enum AUDIO_SOURCE_TYPE {
155 AUDIO_SOURCE_MICROPHONE = 0,
159 AUDIO_SOURCE_CUSTOM = 1,
163 AUDIO_SOURCE_MEDIA_PLAYER = 2,
167 AUDIO_SOURCE_LOOPBACK_RECORDING = 3,
170 AUDIO_SOURCE_MIXED_STREAM = 4,
174 AUDIO_SOURCE_REMOTE_USER = 5,
178 AUDIO_SOURCE_REMOTE_CHANNEL = 6,
179
183 AUDIO_SOURCE_UNKNOWN = 100
184 };
185
189 enum AudioRoute {
193 ROUTE_DEFAULT = -1,
197 ROUTE_HEADSET = 0,
201 ROUTE_EARPIECE = 1,
205 ROUTE_HEADSETNOMIC = 2,
209 ROUTE_SPEAKERPHONE = 3,
213 ROUTE_LOUDSPEAKER = 4,
217 ROUTE_BLUETOOTH_DEVICE_HFP = 5,
221 ROUTE_USB = 6,
225 ROUTE_HDMI = 7,
229 ROUTE_DISPLAYPORT = 8,
233 ROUTE_AIRPLAY = 9,
237 ROUTE_BLUETOOTH_DEVICE_A2DP = 10,
238 };
239
243 enum BYTES_PER_SAMPLE {
247 TWO_BYTES_PER_SAMPLE = 2,
248 };
249
250 struct AudioParameters {
251 int sample_rate;
252 size_t channels;
253 size_t frames_per_buffer;
254
255 AudioParameters() : sample_rate(0), channels(0), frames_per_buffer(0) {}
256 };
257
261 enum RAW_AUDIO_FRAME_OP_MODE_TYPE {
267 RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0,
268
274 RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2,
275 };
276
277 } // namespace rtc
278
279 namespace media {
283 enum MEDIA_SOURCE_TYPE {
287 AUDIO_PLAYOUT_SOURCE = 0,
291 AUDIO_RECORDING_SOURCE = 1,
295 PRIMARY_CAMERA_SOURCE = 2,
299 SECONDARY_CAMERA_SOURCE = 3,
303 PRIMARY_SCREEN_SOURCE = 4,
307 SECONDARY_SCREEN_SOURCE = 5,
311 CUSTOM_VIDEO_SOURCE = 6,
315 MEDIA_PLAYER_SOURCE = 7,
319 RTC_IMAGE_PNG_SOURCE = 8,
323 RTC_IMAGE_JPEG_SOURCE = 9,
327 RTC_IMAGE_GIF_SOURCE = 10,
331 REMOTE_VIDEO_SOURCE = 11,
335 TRANSCODED_VIDEO_SOURCE = 12,
339 SPEECH_DRIVEN_VIDEO_SOURCE = 13,
343 UNKNOWN_MEDIA_SOURCE = 100
344 };
345
346 namespace base {
347
348 typedef void* view_t;
349
350 typedef const char* user_id_t;
351
352 static const uint8_t kMaxCodecNameLength = 50;
353
358 struct PacketOptions {
362 uint32_t timestamp;
363 // Audio level indication.
364 uint8_t audioLevelIndication;
365 PacketOptions() : timestamp(0), audioLevelIndication(127) {}
366 };
367
372 struct AudioEncodedFrameInfo {
376 uint64_t sendTs;
380 uint8_t codec;
381 AudioEncodedFrameInfo() : sendTs(0), codec(0) {}
382 };
383
387 struct AudioPcmFrame {
391 OPTIONAL_ENUM_SIZE_T{
392 // Stereo, 32 kHz, 60 ms (2 * 32 * 60)
400 kMaxDataSizeSamples = 3840,
402 kMaxDataSizeBytes = kMaxDataSizeSamples * sizeof(int16_t),
403 };
404
408 int64_t capture_timestamp;
412 size_t samples_per_channel_;
416 int sample_rate_hz_;
420 size_t num_channels_;
424 int audio_track_number_;
428 rtc::BYTES_PER_SAMPLE bytes_per_sample;
432 int16_t data_[kMaxDataSizeSamples];
433
438 bool is_stereo_;
439
440 AudioPcmFrame& operator=(const AudioPcmFrame& src) {
441 if (this == &src) {
442 return *this;
443 }
444
445 capture_timestamp = src.capture_timestamp;
446 samples_per_channel_ = src.samples_per_channel_;
447 sample_rate_hz_ = src.sample_rate_hz_;
448 bytes_per_sample = src.bytes_per_sample;
449 num_channels_ = src.num_channels_;
450 is_stereo_ = src.is_stereo_;
451 this->audio_track_number_ = src.audio_track_number_;
452
453 size_t length = src.samples_per_channel_ * src.num_channels_;
454 if (length > kMaxDataSizeSamples) {
455 length = kMaxDataSizeSamples;
456 }
457
458 memcpy(data_, src.data_, length * sizeof(int16_t));
459
460 return *this;
461 }
462
463 AudioPcmFrame()
464 : capture_timestamp(0),
465 samples_per_channel_(0),
466 sample_rate_hz_(0),
467 num_channels_(0),
468 audio_track_number_(0),
469 bytes_per_sample(rtc::TWO_BYTES_PER_SAMPLE),
470 is_stereo_(false) {
471 memset(data_, 0, sizeof(data_));
472 }
473
474 AudioPcmFrame(const AudioPcmFrame& src)
475 : capture_timestamp(src.capture_timestamp),
476 samples_per_channel_(src.samples_per_channel_),
477 sample_rate_hz_(src.sample_rate_hz_),
478 num_channels_(src.num_channels_),
479 audio_track_number_(src.audio_track_number_),
480 bytes_per_sample(src.bytes_per_sample),
481 is_stereo_(src.is_stereo_) {
482 size_t length = src.samples_per_channel_ * src.num_channels_;
483 if (length > kMaxDataSizeSamples) {
484 length = kMaxDataSizeSamples;
485 }
486
487 memcpy(this->data_, src.data_, length * sizeof(int16_t));
488 }
489 };
490
494 enum AUDIO_DUAL_MONO_MODE {
498 AUDIO_DUAL_MONO_STEREO = 0,
503 AUDIO_DUAL_MONO_L = 1,
508 AUDIO_DUAL_MONO_R = 2,
513 AUDIO_DUAL_MONO_MIX = 3
514 };
515
519 enum VIDEO_PIXEL_FORMAT {
523 VIDEO_PIXEL_DEFAULT = 0,
527 VIDEO_PIXEL_I420 = 1,
531 VIDEO_PIXEL_BGRA = 2,
535 VIDEO_PIXEL_NV21 = 3,
539 VIDEO_PIXEL_RGBA = 4,
543 VIDEO_PIXEL_NV12 = 8,
547 VIDEO_TEXTURE_2D = 10,
551 VIDEO_TEXTURE_OES = 11,
552 /*
553 12: pixel format for iOS CVPixelBuffer NV12
554 */
555 VIDEO_CVPIXEL_NV12 = 12,
556 /*
557 13: pixel format for iOS CVPixelBuffer I420
558 */
559 VIDEO_CVPIXEL_I420 = 13,
560 /*
561 14: pixel format for iOS CVPixelBuffer BGRA
562 */
563 VIDEO_CVPIXEL_BGRA = 14,
567 VIDEO_CVPIXEL_P010 = 15,
571 VIDEO_PIXEL_I422 = 16,
576 VIDEO_TEXTURE_ID3D11TEXTURE2D = 17,
581 VIDEO_PIXEL_I010 = 18,
582 };
583
587 enum RENDER_MODE_TYPE {
592 RENDER_MODE_HIDDEN = 1,
598 RENDER_MODE_FIT = 2,
603 RENDER_MODE_ADAPTIVE __deprecated = 3,
604 };
605
609 enum CAMERA_VIDEO_SOURCE_TYPE {
613 CAMERA_SOURCE_FRONT = 0,
617 CAMERA_SOURCE_BACK = 1,
621 VIDEO_SOURCE_UNSPECIFIED = 2,
622 };
623
628 class IVideoFrameMetaInfo {
629 public:
630 enum META_INFO_KEY {
631 KEY_FACE_CAPTURE = 0,
632 };
633 virtual ~IVideoFrameMetaInfo(){};
634 virtual const char* getMetaInfoStr(META_INFO_KEY key) const = 0;
635 };
636
637 struct ColorSpace {
638 enum PrimaryID {
639 // The indices are equal to the values specified in T-REC H.273 Table 2.
640 PRIMARYID_BT709 = 1,
641 PRIMARYID_UNSPECIFIED = 2,
642 PRIMARYID_BT470M = 4,
643 PRIMARYID_BT470BG = 5,
644 PRIMARYID_SMPTE170M = 6, // Identical to BT601
645 PRIMARYID_SMPTE240M = 7,
646 PRIMARYID_FILM = 8,
647 PRIMARYID_BT2020 = 9,
648 PRIMARYID_SMPTEST428 = 10,
649 PRIMARYID_SMPTEST431 = 11,
650 PRIMARYID_SMPTEST432 = 12,
651 PRIMARYID_JEDECP22 = 22, // Identical to EBU3213-E
652 };
653
654 enum RangeID {
655 // The indices are equal to the values specified at
656 // https://www.webmproject.org/docs/container/#colour for the element Range.
657 RANGEID_INVALID = 0,
658 // Limited Rec. 709 color range with RGB values ranging from 16 to 235.
659 RANGEID_LIMITED = 1,
660 // Full RGB color range with RGB valees from 0 to 255.
661 RANGEID_FULL = 2,
662 // Range is defined by MatrixCoefficients/TransferCharacteristics.
663 RANGEID_DERIVED = 3,
664 };
665
666 enum MatrixID {
667 // The indices are equal to the values specified in T-REC H.273 Table 4.
668 MATRIXID_RGB = 0,
669 MATRIXID_BT709 = 1,
670 MATRIXID_UNSPECIFIED = 2,
671 MATRIXID_FCC = 4,
672 MATRIXID_BT470BG = 5,
673 MATRIXID_SMPTE170M = 6,
674 MATRIXID_SMPTE240M = 7,
675 MATRIXID_YCOCG = 8,
676 MATRIXID_BT2020_NCL = 9,
677 MATRIXID_BT2020_CL = 10,
678 MATRIXID_SMPTE2085 = 11,
679 MATRIXID_CDNCLS = 12,
680 MATRIXID_CDCLS = 13,
681 MATRIXID_BT2100_ICTCP = 14,
682 };
683
684 enum TransferID {
685 // The indices are equal to the values specified in T-REC H.273 Table 3.
686 TRANSFERID_BT709 = 1,
687 TRANSFERID_UNSPECIFIED = 2,
688 TRANSFERID_GAMMA22 = 4,
689 TRANSFERID_GAMMA28 = 5,
690 TRANSFERID_SMPTE170M = 6,
691 TRANSFERID_SMPTE240M = 7,
692 TRANSFERID_LINEAR = 8,
693 TRANSFERID_LOG = 9,
694 TRANSFERID_LOG_SQRT = 10,
695 TRANSFERID_IEC61966_2_4 = 11,
696 TRANSFERID_BT1361_ECG = 12,
697 TRANSFERID_IEC61966_2_1 = 13,
698 TRANSFERID_BT2020_10 = 14,
699 TRANSFERID_BT2020_12 = 15,
700 TRANSFERID_SMPTEST2084 = 16,
701 TRANSFERID_SMPTEST428 = 17,
702 TRANSFERID_ARIB_STD_B67 = 18,
703 };
704
705 PrimaryID primaries;
706 TransferID transfer;
707 MatrixID matrix;
708 RangeID range;
709
710 ColorSpace()
711 : primaries(PRIMARYID_UNSPECIFIED), transfer(TRANSFERID_UNSPECIFIED),
712 matrix(MATRIXID_UNSPECIFIED), range(RANGEID_INVALID) {}
713
714 bool validate() const {
715 return primaries != PRIMARYID_UNSPECIFIED || transfer != TRANSFERID_UNSPECIFIED ||
716 matrix != MATRIXID_UNSPECIFIED ||
717 range != RANGEID_INVALID;
718 }
719 };
720
724 struct Hdr10MetadataInfo {
728 uint16_t redPrimaryX;
732 uint16_t redPrimaryY;
736 uint16_t greenPrimaryX;
740 uint16_t greenPrimaryY;
744 uint16_t bluePrimaryX;
748 uint16_t bluePrimaryY;
752 uint16_t whitePointX;
756 uint16_t whitePointY;
760 unsigned int maxMasteringLuminance;
764 unsigned int minMasteringLuminance;
768 uint16_t maxContentLightLevel;
772 uint16_t maxFrameAverageLightLevel;
773
774 Hdr10MetadataInfo()
775 : redPrimaryX(0),
776 redPrimaryY(0),
777 greenPrimaryX(0),
778 greenPrimaryY(0),
779 bluePrimaryX(0),
780 bluePrimaryY(0),
781 whitePointX(0),
782 whitePointY(0),
783 maxMasteringLuminance(0),
784 minMasteringLuminance(0),
785 maxContentLightLevel(0),
786 maxFrameAverageLightLevel(0){}
787
788 bool validate() const {
789 return maxContentLightLevel >= 0 && maxContentLightLevel <= 20000 &&
790 maxFrameAverageLightLevel >= 0 &&
791 maxFrameAverageLightLevel <= 20000;
792 }
793 };
794
798 enum ALPHA_STITCH_MODE {
802 NO_ALPHA_STITCH = 0,
806 ALPHA_STITCH_UP = 1,
810 ALPHA_STITCH_BELOW = 2,
814 ALPHA_STITCH_LEFT = 3,
818 ALPHA_STITCH_RIGHT = 4,
819 };
820
821
825 struct ExternalVideoFrame {
826 ExternalVideoFrame()
827 : type(VIDEO_BUFFER_RAW_DATA),
828 format(VIDEO_PIXEL_DEFAULT),
829 buffer(NULL),
830 stride(0),
831 height(0),
832 cropLeft(0),
833 cropTop(0),
834 cropRight(0),
835 cropBottom(0),
836 rotation(0),
837 timestamp(0),
838 eglContext(NULL),
839 eglType(EGL_CONTEXT10),
840 textureId(0),
841 fenceObject(0),
842 metadataBuffer(NULL),
843 metadataSize(0),
844 alphaBuffer(NULL),
845 fillAlphaBuffer(false),
846 alphaStitchMode(NO_ALPHA_STITCH),
847 d3d11Texture2d(NULL),
848 textureSliceIndex(0){}
849
853 enum EGL_CONTEXT_TYPE {
857 EGL_CONTEXT10 = 0,
861 EGL_CONTEXT14 = 1,
862 };
863
867 enum VIDEO_BUFFER_TYPE {
871 VIDEO_BUFFER_RAW_DATA = 1,
875 VIDEO_BUFFER_ARRAY = 2,
879 VIDEO_BUFFER_TEXTURE = 3,
880 };
881
885 VIDEO_BUFFER_TYPE type;
889 VIDEO_PIXEL_FORMAT format;
890
894 void* buffer;
899 int stride;
903 int height;
907 int cropLeft;
911 int cropTop;
915 int cropRight;
919 int cropBottom;
924 int rotation;
929 long long timestamp;
937 void* eglContext;
941 EGL_CONTEXT_TYPE eglType;
946 int textureId;
951 long long fenceObject;
955 float matrix[16];
961 uint8_t* metadataBuffer;
966 int metadataSize;
974 uint8_t* alphaBuffer;
986 bool fillAlphaBuffer;
991 ALPHA_STITCH_MODE alphaStitchMode;
992
997 void *d3d11Texture2d;
998
1003 int textureSliceIndex;
1004
1008 Hdr10MetadataInfo hdr10MetadataInfo;
1009
1014 ColorSpace colorSpace;
1015 };
1016
1025 struct VideoFrame {
1026 VideoFrame():
1027 type(VIDEO_PIXEL_DEFAULT),
1028 width(0),
1029 height(0),
1030 yStride(0),
1031 uStride(0),
1032 vStride(0),
1033 yBuffer(NULL),
1034 uBuffer(NULL),
1035 vBuffer(NULL),
1036 rotation(0),
1037 renderTimeMs(0),
1038 avsync_type(0),
1039 metadata_buffer(NULL),
1040 metadata_size(0),
1041 sharedContext(0),
1042 textureId(0),
1043 d3d11Texture2d(NULL),
1044 alphaBuffer(NULL),
1045 alphaStitchMode(NO_ALPHA_STITCH),
1046 pixelBuffer(NULL),
1047 metaInfo(NULL){
1048 memset(matrix, 0, sizeof(matrix));
1049 }
1053 VIDEO_PIXEL_FORMAT type;
1057 int width;
1061 int height;
1067 int yStride;
1073 int uStride;
1079 int vStride;
1083 uint8_t* yBuffer;
1087 uint8_t* uBuffer;
1091 uint8_t* vBuffer;
1096 int rotation;
1101 int64_t renderTimeMs;
1105 int avsync_type;
1111 uint8_t* metadata_buffer;
1117 int metadata_size;
1121 void* sharedContext;
1125 int textureId;
1130 void* d3d11Texture2d;
1135 float matrix[16];
1145 uint8_t* alphaBuffer;
1150 ALPHA_STITCH_MODE alphaStitchMode;
1154 void* pixelBuffer;
1158 IVideoFrameMetaInfo* metaInfo;
1159
1163 Hdr10MetadataInfo hdr10MetadataInfo;
1164
1169 ColorSpace colorSpace;
1170 };
1171
1175 class IVideoFrameObserver {
1176 public:
1187 virtual void onFrame(const VideoFrame* frame) = 0;
1188 virtual ~IVideoFrameObserver() {}
1189 virtual bool isExternal() { return true; }
1216 virtual VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return VIDEO_PIXEL_DEFAULT; }
1217 };
1218
1219 enum MEDIA_PLAYER_SOURCE_TYPE {
1225 MEDIA_PLAYER_SOURCE_DEFAULT,
1231 MEDIA_PLAYER_SOURCE_FULL_FEATURED,
1236 MEDIA_PLAYER_SOURCE_SIMPLE,
1237 };
1238
1242 enum VIDEO_MODULE_POSITION {
1248 POSITION_POST_CAPTURER = 1 << 0,
1253 POSITION_PRE_RENDERER = 1 << 1,
1263 POSITION_PRE_ENCODER = 1 << 2,
1269 POSITION_POST_CAPTURER_ORIGIN = 1 << 3,
1270 };
1271
1272 } // namespace base
1273
1276 #define MAX_CONTENT_INSPECT_MODULE_COUNT 32
1277 enum CONTENT_INSPECT_RESULT {
1278 CONTENT_INSPECT_NEUTRAL = 1,
1279 CONTENT_INSPECT_SEXY = 2,
1280 CONTENT_INSPECT_PORN = 3,
1281 };
1282
1286 enum CONTENT_INSPECT_TYPE {
1290 CONTENT_INSPECT_INVALID = 0,
1295 CONTENT_INSPECT_MODERATION __deprecated = 1,
1300 CONTENT_INSPECT_SUPERVISION = 2,
1306 CONTENT_INSPECT_IMAGE_MODERATION = 3
1307 };
1308
1313 struct ContentInspectModule {
1317 CONTENT_INSPECT_TYPE type;
1323 unsigned int interval;
1327 base::VIDEO_MODULE_POSITION position;
1328 ContentInspectModule() {
1329 type = CONTENT_INSPECT_INVALID;
1330 interval = 0;
1331 position = base::POSITION_PRE_ENCODER;
1332 }
1333 };
1337 struct ContentInspectConfig {
1344 const char* extraInfo;
1350 const char* serverConfig;
1358 ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
1364 int moduleCount;
1365 ContentInspectConfig& operator=(const ContentInspectConfig& rth) {
1366 extraInfo = rth.extraInfo;
1367 serverConfig = rth.serverConfig;
1368 moduleCount = rth.moduleCount;
1369 memcpy(&modules, &rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
1370 return *this;
1371 }
1372 ContentInspectConfig() : extraInfo(NULL), serverConfig(NULL), moduleCount(0) {}
1373 };
1377 struct SnapshotConfig {
1386 const char* filePath;
1387
1391 media::base::VIDEO_MODULE_POSITION position;
1392 SnapshotConfig() :filePath(NULL), position(media::base::POSITION_PRE_ENCODER) {}
1393 };
1394
1398 class IAudioPcmFrameSink {
1399 public:
1410 virtual void onFrame(agora::media::base::AudioPcmFrame* frame) = 0;
1411 virtual ~IAudioPcmFrameSink() {}
1412 };
1413
1417 class IAudioFrameObserverBase {
1418 public:
1422 enum AUDIO_FRAME_TYPE {
1426 FRAME_TYPE_PCM16 = 0,
1427 };
1428 enum { MAX_HANDLE_TIME_CNT = 10 };
1432 struct AudioFrame {
1436 AUDIO_FRAME_TYPE type;
1440 int samplesPerChannel;
1444 agora::rtc::BYTES_PER_SAMPLE bytesPerSample;
1450 int channels;
1454 int samplesPerSec;
1460 void* buffer;
1467 int64_t renderTimeMs;
1471 int avsync_type;
1478 int64_t presentationMs;
1482 int audioTrackNumber;
1486 uint32_t rtpTimestamp;
1487
1488 AudioFrame()
1489 : type(FRAME_TYPE_PCM16),
1490 samplesPerChannel(0),
1491 bytesPerSample(rtc::TWO_BYTES_PER_SAMPLE),
1492 channels(0),
1493 samplesPerSec(0),
1494 buffer(NULL),
1495 renderTimeMs(0),
1496 avsync_type(0),
1497 presentationMs(0),
1498 audioTrackNumber(0),
1499 rtpTimestamp(0) {}
1500 };
1501
1502 enum AUDIO_FRAME_POSITION {
1503 AUDIO_FRAME_POSITION_NONE = 0x0000,
1506 AUDIO_FRAME_POSITION_PLAYBACK = 0x0001,
1509 AUDIO_FRAME_POSITION_RECORD = 0x0002,
1512 AUDIO_FRAME_POSITION_MIXED = 0x0004,
1515 AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008,
1518 AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010,
1519 };
1520
1542 struct AudioParams {
1551 int sample_rate;
1552
1558 int channels;
1559
1563 rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE mode;
1564
1568 int samples_per_call;
1569
1570 AudioParams()
1571 : sample_rate(0),
1572 channels(0),
1573 mode(rtc::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY),
1574 samples_per_call(0) {}
1575 AudioParams(int samplerate, int channel, rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE type,
1576 int samplesPerCall)
1577 : sample_rate(samplerate),
1578 channels(channel),
1579 mode(type),
1580 samples_per_call(samplesPerCall) {}
1581 };
1582
1583 public:
1584 virtual ~IAudioFrameObserverBase() {}
1585
1611 virtual bool onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1637 virtual bool onPlaybackAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1663 virtual bool onMixedAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1689 virtual bool onEarMonitoringAudioFrame(AudioFrame& audioFrame) = 0;
1699 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, base::user_id_t userId,
1700 AudioFrame& audioFrame) {
1701 (void)channelId;
1702 (void)userId;
1703 (void)audioFrame;
1704 return true;
1705 }
1706
1736 virtual int getObservedAudioFramePosition() = 0;
1737
1755 virtual AudioParams getPlaybackAudioParams() = 0;
1756
1774 virtual AudioParams getRecordAudioParams() = 0;
1775
1793 virtual AudioParams getMixedAudioParams() = 0;
1794
1812 virtual AudioParams getEarMonitoringAudioParams() = 0;
1813 };
1814
1818 class IAudioFrameObserver : public IAudioFrameObserverBase {
1819 public:
1820 using IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing;
1831 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, rtc::uid_t uid,
1832 AudioFrame& audioFrame) = 0;
1833 };
1834
1838 struct AudioSpectrumData {
1844 const float* audioSpectrumData;
1848 int dataLength;
1849
1850 AudioSpectrumData() : audioSpectrumData(NULL), dataLength(0) {}
1851 AudioSpectrumData(const float* data, int length) : audioSpectrumData(data), dataLength(length) {}
1852 };
1853
1857 struct UserAudioSpectrumInfo {
1861 agora::rtc::uid_t uid;
1865 struct AudioSpectrumData spectrumData;
1866
1867 UserAudioSpectrumInfo() : uid(0) {}
1868
1869 UserAudioSpectrumInfo(agora::rtc::uid_t uid, const float* data, int length)
1870 : uid(uid), spectrumData(data, length) {}
1871 };
1872
1876 class IAudioSpectrumObserver {
1877 public:
1878 virtual ~IAudioSpectrumObserver() {}
1879
1896 virtual bool onLocalAudioSpectrum(const AudioSpectrumData& data) = 0;
1916 virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo* spectrums,
1917 unsigned int spectrumNumber) = 0;
1918 };
1919
1923 class IVideoEncodedFrameObserver {
1924 public:
1944 virtual bool onEncodedVideoFrameReceived(
1945 const char* channelId, rtc::uid_t uid, const uint8_t* imageBuffer, size_t length,
1946 const rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo) = 0;
1947
1948 virtual ~IVideoEncodedFrameObserver() {}
1949 };
1950
1954 class IVideoFrameObserver {
1955 public:
1956 typedef media::base::VideoFrame VideoFrame;
1960 enum VIDEO_FRAME_PROCESS_MODE {
1965 PROCESS_MODE_READ_ONLY, // Observer works as a pure renderer and will not modify the original
1966 // frame.
1971 PROCESS_MODE_READ_WRITE, // Observer works as a filter that will process the video frame and
1972 // affect the following frame processing in SDK.
1973 };
1974
1975 public:
1976 virtual ~IVideoFrameObserver() {}
1977
2021 virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
2022 VideoFrame& videoFrame) = 0;
2023
2061 virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
2062 VideoFrame& videoFrame) = 0;
2063
2087 virtual bool onMediaPlayerVideoFrame(VideoFrame& videoFrame, int mediaPlayerId) = 0;
2088
2129 virtual bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
2130 VideoFrame& videoFrame) = 0;
2131
2132 virtual bool onTranscodedVideoFrame(VideoFrame& videoFrame) = 0;
2133
2146 virtual VIDEO_FRAME_PROCESS_MODE getVideoFrameProcessMode() { return PROCESS_MODE_READ_ONLY; }
2147
2163 virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return base::VIDEO_PIXEL_DEFAULT; }
2164
2190 virtual bool getRotationApplied() { return false; }
2191
2219 virtual bool getMirrorApplied() { return false; }
2220
2251 virtual uint32_t getObservedFramePosition() {
2252 return base::POSITION_POST_CAPTURER | base::POSITION_PRE_RENDERER;
2253 }
2254
2262 virtual bool isExternal() { return true; }
2263 };
2264
2268 enum EXTERNAL_VIDEO_SOURCE_TYPE {
2272 VIDEO_FRAME = 0,
2276 ENCODED_VIDEO_FRAME,
2277 };
2278
2284 enum MediaRecorderContainerFormat {
2288 FORMAT_MP4 = 1,
2289 };
2295 enum MediaRecorderStreamType {
2299 STREAM_TYPE_AUDIO = 0x01,
2303 STREAM_TYPE_VIDEO = 0x02,
2307 STREAM_TYPE_BOTH = STREAM_TYPE_AUDIO | STREAM_TYPE_VIDEO,
2308 };
2314 enum RecorderState {
2318 RECORDER_STATE_ERROR = -1,
2322 RECORDER_STATE_START = 2,
2326 RECORDER_STATE_STOP = 3,
2327 };
2333 enum RecorderReasonCode {
2337 RECORDER_REASON_NONE = 0,
2341 RECORDER_REASON_WRITE_FAILED = 1,
2346 RECORDER_REASON_NO_STREAM = 2,
2350 RECORDER_REASON_OVER_MAX_DURATION = 3,
2354 RECORDER_REASON_CONFIG_CHANGED = 4,
2355 };
2361 struct MediaRecorderConfiguration {
2371 const char* storagePath;
2375 MediaRecorderContainerFormat containerFormat;
2379 MediaRecorderStreamType streamType;
2383 int maxDurationMs;
2389 int recorderInfoUpdateInterval;
2396 int width;
2403 int height;
2409 int fps;
2415 int sample_rate;
2423 int channel_num;
2429 agora::rtc::VIDEO_SOURCE_TYPE videoSourceType;
2430
2431 MediaRecorderConfiguration()
2432 : storagePath(NULL),
2433 containerFormat(FORMAT_MP4),
2434 streamType(STREAM_TYPE_BOTH),
2435 maxDurationMs(120000),
2436 recorderInfoUpdateInterval(0),
2437 width(1280),
2438 height(720),
2439 fps(30),
2440 sample_rate(48000),
2441 channel_num(1),
2442 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2443 MediaRecorderConfiguration(const char* path, MediaRecorderContainerFormat format,
2444 MediaRecorderStreamType type, int duration, int interval)
2445 : storagePath(path),
2446 containerFormat(format),
2447 streamType(type),
2448 maxDurationMs(duration),
2449 recorderInfoUpdateInterval(interval),
2450 width(1280),
2451 height(720),
2452 fps(30),
2453 sample_rate(48000),
2454 channel_num(1),
2455 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2456 };
2457
2458 class IFaceInfoObserver {
2459 public:
2502 virtual bool onFaceInfo(const char* outFaceInfo) = 0;
2503
2504 virtual ~IFaceInfoObserver() {}
2505 };
2506
2512 struct RecorderInfo {
2516 const char* fileName;
2520 unsigned int durationMs;
2524 unsigned int fileSize;
2525
2526 RecorderInfo() : fileName(NULL), durationMs(0), fileSize(0) {}
2527 RecorderInfo(const char* name, unsigned int dur, unsigned int size)
2528 : fileName(name), durationMs(dur), fileSize(size) {}
2529 };
2530
2531 class IMediaRecorderObserver {
2532 public:
2548 virtual void onRecorderStateChanged(const char* channelId, rtc::uid_t uid, RecorderState state,
2549 RecorderReasonCode reason) = 0;
2566 virtual void onRecorderInfoUpdated(const char* channelId, rtc::uid_t uid,
2567 const RecorderInfo& info) = 0;
2568
2569 virtual ~IMediaRecorderObserver() {}
2570 };
2571
2572 } // namespace media
2573 } // namespace agora
agora::media::IVideoEncodedFrameObserver::onEncodedVideoFrameReceived
virtual bool onEncodedVideoFrameReceived(const char *channelId, rtc::uid_t uid, const uint8_t *imageBuffer, size_t length, const rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo)=0
Reports that the receiver has received the to-be-decoded video frame sent by the remote end.
agora::media::IVideoFrameObserver::PROCESS_MODE_READ_ONLY
@ PROCESS_MODE_READ_ONLY
Definition: AgoraMediaBase.h:1965
agora::media::base::VideoFrame
Configurations of the video frame.
Definition: AgoraMediaBase.h:1025
agora::media::base::ExternalVideoFrame::cropBottom
int cropBottom
Definition: AgoraMediaBase.h:919
agora::media::IAudioFrameObserverBase::AudioParams::channels
int channels
Definition: AgoraMediaBase.h:1558
agora::media::base::Hdr10MetadataInfo::redPrimaryY
uint16_t redPrimaryY
Definition: AgoraMediaBase.h:732
agora::media::base::VideoFrame::metadata_size
int metadata_size
Definition: AgoraMediaBase.h:1117
agora::media::SnapshotConfig::filePath
const char * filePath
Definition: AgoraMediaBase.h:1386
agora::media::AudioSpectrumData::audioSpectrumData
const float * audioSpectrumData
Definition: AgoraMediaBase.h:1844
agora::media::IAudioFrameObserverBase::onEarMonitoringAudioFrame
virtual bool onEarMonitoringAudioFrame(AudioFrame &audioFrame)=0
Gets the in-ear monitoring audio frame.
agora::rtc::ExtensionContext::providerName
const char * providerName
Definition: AgoraMediaBase.h:55
agora::media::base::ExternalVideoFrame::matrix
float matrix[16]
Definition: AgoraMediaBase.h:955
agora::media::IAudioPcmFrameSink
Definition: AgoraMediaBase.h:1398
agora::media::IMediaRecorderObserver
Definition: AgoraMediaBase.h:2531
agora::media::IAudioFrameObserverBase
Definition: AgoraMediaBase.h:1417
agora::media::base::ExternalVideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:1014
agora::media::ContentInspectConfig::modules
ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT]
Definition: AgoraMediaBase.h:1358
agora::media::base::VideoFrame::uStride
int uStride
Definition: AgoraMediaBase.h:1073
agora::media::IAudioFrameObserverBase::AudioFrame::rtpTimestamp
uint32_t rtpTimestamp
Definition: AgoraMediaBase.h:1486
agora::media::IAudioFrameObserverBase::FRAME_TYPE_PCM16
@ FRAME_TYPE_PCM16
Definition: AgoraMediaBase.h:1426
agora::media::IAudioFrameObserverBase::AudioFrame::audioTrackNumber
int audioTrackNumber
Definition: AgoraMediaBase.h:1482
agora::media::base::VideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:1145
agora::media::base::IVideoFrameObserver::getVideoFormatPreference
virtual VIDEO_PIXEL_FORMAT getVideoFormatPreference()
Sets the format of the raw video data output by the SDK.
Definition: AgoraMediaBase.h:1216
agora::media::IFaceInfoObserver
Definition: AgoraMediaBase.h:2458
agora::media::base::VideoFrame::height
int height
Definition: AgoraMediaBase.h:1061
agora::media::base::AudioPcmFrame::data_
int16_t data_[kMaxDataSizeSamples]
Definition: AgoraMediaBase.h:432
agora::media::IAudioFrameObserverBase::onRecordAudioFrame
virtual bool onRecordAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
Gets the captured audio frame.
agora::media::MediaRecorderConfiguration::maxDurationMs
int maxDurationMs
Definition: AgoraMediaBase.h:2383
agora::media::IAudioSpectrumObserver
Definition: AgoraMediaBase.h:1876
agora::rtc::AudioParameters
Definition: AgoraMediaBase.h:250
agora::media::IAudioFrameObserverBase::AudioFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1467
agora::media::IAudioFrameObserverBase::AudioParams::mode
rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE mode
Definition: AgoraMediaBase.h:1563
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_RAW_DATA
@ VIDEO_BUFFER_RAW_DATA
Definition: AgoraMediaBase.h:871
agora::media::IAudioFrameObserverBase::getPlaybackAudioParams
virtual AudioParams getPlaybackAudioParams()=0
Sets the audio format for the onPlaybackAudioFrame callback.
agora::media::base::ExternalVideoFrame::buffer
void * buffer
Definition: AgoraMediaBase.h:894
agora::media::IAudioFrameObserverBase::AudioFrame::channels
int channels
Definition: AgoraMediaBase.h:1450
agora::media::IVideoFrameObserver::getVideoFormatPreference
virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference()
Definition: AgoraMediaBase.h:2163
agora::rtc::EncodedVideoFrameInfo
Information about externally encoded video frames.
Definition: AgoraBase.h:1735
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_TYPE
VIDEO_BUFFER_TYPE
The video buffer type.
Definition: AgoraMediaBase.h:867
agora::media::ContentInspectConfig::serverConfig
const char * serverConfig
Definition: AgoraMediaBase.h:1350
agora::media::base::IVideoFrameObserver
Definition: AgoraMediaBase.h:1175
agora::media::IVideoFrameObserver::getVideoFrameProcessMode
virtual VIDEO_FRAME_PROCESS_MODE getVideoFrameProcessMode()
Occurs each time the SDK receives a video frame and prompts you to set the process mode of the video ...
Definition: AgoraMediaBase.h:2146
agora::media::IVideoFrameObserver
Definition: AgoraMediaBase.h:1954
agora::media::IAudioFrameObserverBase::AudioFrame
Raw audio data.
Definition: AgoraMediaBase.h:1432
agora::media::base::AudioEncodedFrameInfo::codec
uint8_t codec
Definition: AgoraMediaBase.h:380
agora::media::MediaRecorderConfiguration::recorderInfoUpdateInterval
int recorderInfoUpdateInterval
Definition: AgoraMediaBase.h:2389
agora::media::IAudioFrameObserver
Definition: AgoraMediaBase.h:1818
agora::media::base::Hdr10MetadataInfo
Definition: AgoraMediaBase.h:724
agora::media::IAudioFrameObserverBase::getEarMonitoringAudioParams
virtual AudioParams getEarMonitoringAudioParams()=0
Sets the audio format for the onEarMonitoringAudioFrame callback.
agora::media::base::VideoFrame::d3d11Texture2d
void * d3d11Texture2d
Definition: AgoraMediaBase.h:1130
agora::media::base::VideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:1096
agora::media::base::VideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:1150
agora::media::base::IVideoFrameObserver::onFrame
virtual void onFrame(const VideoFrame *frame)=0
Occurs each time the player receives a video frame.
agora::media::IMediaRecorderObserver::onRecorderStateChanged
virtual void onRecorderStateChanged(const char *channelId, rtc::uid_t uid, RecorderState state, RecorderReasonCode reason)=0
Callback when the recording state changes.
agora::media::IAudioFrameObserverBase::getMixedAudioParams
virtual AudioParams getMixedAudioParams()=0
Sets the audio format for the onMixedAudioFrame callback.
agora::media::base::AudioPcmFrame::OPTIONAL_ENUM_SIZE_T
OPTIONAL_ENUM_SIZE_T
Definition: AgoraMediaBase.h:391
agora::media::MediaRecorderConfiguration::sample_rate
int sample_rate
Definition: AgoraMediaBase.h:2415
agora::media::base::ExternalVideoFrame::eglContext
void * eglContext
Definition: AgoraMediaBase.h:937
agora::media::base::VideoFrame::metaInfo
IVideoFrameMetaInfo * metaInfo
Definition: AgoraMediaBase.h:1158
agora::media::base::ExternalVideoFrame::cropRight
int cropRight
Definition: AgoraMediaBase.h:915
agora::media::IAudioFrameObserverBase::getRecordAudioParams
virtual AudioParams getRecordAudioParams()=0
Sets the audio format for the onRecordAudioFrame callback.
agora::media::base::VideoFrame::textureId
int textureId
Definition: AgoraMediaBase.h:1125
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_ARRAY
@ VIDEO_BUFFER_ARRAY
Definition: AgoraMediaBase.h:875
agora::rtc::ExtensionContext
The context information of the extension.
Definition: AgoraMediaBase.h:41
agora::media::MediaRecorderConfiguration::videoSourceType
agora::rtc::VIDEO_SOURCE_TYPE videoSourceType
Definition: AgoraMediaBase.h:2429
agora::media::base::ExternalVideoFrame::VIDEO_BUFFER_TEXTURE
@ VIDEO_BUFFER_TEXTURE
Definition: AgoraMediaBase.h:879
agora::media::IAudioFrameObserverBase::AudioFrame::presentationMs
int64_t presentationMs
Definition: AgoraMediaBase.h:1478
agora::media::base::VideoFrame::avsync_type
int avsync_type
Definition: AgoraMediaBase.h:1105
agora::media::base::Hdr10MetadataInfo::greenPrimaryY
uint16_t greenPrimaryY
Definition: AgoraMediaBase.h:740
agora::media::base::VideoFrame::matrix
float matrix[16]
Definition: AgoraMediaBase.h:1135
agora::media::base::ExternalVideoFrame::fenceObject
long long fenceObject
Definition: AgoraMediaBase.h:951
agora::media::base::ExternalVideoFrame::cropLeft
int cropLeft
Definition: AgoraMediaBase.h:907
agora::media::IAudioFrameObserverBase::AudioFrame::samplesPerSec
int samplesPerSec
Definition: AgoraMediaBase.h:1454
agora::media::ContentInspectModule
ContentInspectModule class, a structure used to configure the frequency of video screenshot and uploa...
Definition: AgoraMediaBase.h:1313
agora::media::IAudioFrameObserverBase::AudioFrame::buffer
void * buffer
Definition: AgoraMediaBase.h:1460
agora::media::IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing
virtual bool onPlaybackAudioFrameBeforeMixing(const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
Definition: AgoraMediaBase.h:1699
agora::media::IAudioSpectrumObserver::onRemoteAudioSpectrum
virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo *spectrums, unsigned int spectrumNumber)=0
Gets the remote audio spectrum.
agora::media::MediaRecorderConfiguration::fps
int fps
Definition: AgoraMediaBase.h:2409
agora::media::base::ColorSpace
Definition: AgoraMediaBase.h:637
agora::media::IMediaRecorderObserver::onRecorderInfoUpdated
virtual void onRecorderInfoUpdated(const char *channelId, rtc::uid_t uid, const RecorderInfo &info)=0
Callback for recording information updates.
agora::media::base::ExternalVideoFrame
The external video frame.
Definition: AgoraMediaBase.h:825
agora::media::base::ExternalVideoFrame::d3d11Texture2d
void * d3d11Texture2d
Definition: AgoraMediaBase.h:997
agora::media::base::AudioEncodedFrameInfo::sendTs
uint64_t sendTs
Definition: AgoraMediaBase.h:376
agora::media::ContentInspectConfig::moduleCount
int moduleCount
Definition: AgoraMediaBase.h:1364
agora::media::base::Hdr10MetadataInfo::whitePointX
uint16_t whitePointX
Definition: AgoraMediaBase.h:752
agora::media::base::VideoFrame::type
VIDEO_PIXEL_FORMAT type
Definition: AgoraMediaBase.h:1053
agora::media::base::AudioPcmFrame::capture_timestamp
int64_t capture_timestamp
Definition: AgoraMediaBase.h:408
agora::media::base::ExternalVideoFrame::timestamp
long long timestamp
Definition: AgoraMediaBase.h:929
agora::media::base::AudioPcmFrame::sample_rate_hz_
int sample_rate_hz_
Definition: AgoraMediaBase.h:416
agora::media::MediaRecorderConfiguration::height
int height
Definition: AgoraMediaBase.h:2403
agora::media::IFaceInfoObserver::onFaceInfo
virtual bool onFaceInfo(const char *outFaceInfo)=0
Occurs when the facial information processed by speech driven extension is received.
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION
AUDIO_FRAME_POSITION
Definition: AgoraMediaBase.h:1502
agora::media::base::ExternalVideoFrame::height
int height
Definition: AgoraMediaBase.h:903
agora::media::base::VideoFrame::sharedContext
void * sharedContext
Definition: AgoraMediaBase.h:1121
agora::media::base::ExternalVideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:924
agora::media::RecorderInfo
Information about the recording file.
Definition: AgoraMediaBase.h:2512
agora::media::base::ExternalVideoFrame::metadataBuffer
uint8_t * metadataBuffer
Definition: AgoraMediaBase.h:961
agora::media::IVideoFrameObserver::onCaptureVideoFrame
virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType, VideoFrame &videoFrame)=0
Occurs each time the SDK receives a video frame captured by local devices.
agora::media::base::Hdr10MetadataInfo::minMasteringLuminance
unsigned int minMasteringLuminance
Definition: AgoraMediaBase.h:764
agora::media::UserAudioSpectrumInfo::spectrumData
struct AudioSpectrumData spectrumData
Definition: AgoraMediaBase.h:1865
agora::media::IAudioFrameObserverBase::AudioParams::samples_per_call
int samples_per_call
Definition: AgoraMediaBase.h:1568
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_PLAYBACK
@ AUDIO_FRAME_POSITION_PLAYBACK
Definition: AgoraMediaBase.h:1506
agora::media::base::ExternalVideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:991
agora::media::base::PacketOptions
Definition: AgoraMediaBase.h:358
agora::media::base::PacketOptions::timestamp
uint32_t timestamp
Definition: AgoraMediaBase.h:362
agora::media::base::Hdr10MetadataInfo::maxMasteringLuminance
unsigned int maxMasteringLuminance
Definition: AgoraMediaBase.h:760
agora::media::base::Hdr10MetadataInfo::whitePointY
uint16_t whitePointY
Definition: AgoraMediaBase.h:756
agora::media::base::Hdr10MetadataInfo::greenPrimaryX
uint16_t greenPrimaryX
Definition: AgoraMediaBase.h:736
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_TYPE
AUDIO_FRAME_TYPE
Audio frame type.
Definition: AgoraMediaBase.h:1422
agora::media::MediaRecorderConfiguration::channel_num
int channel_num
Definition: AgoraMediaBase.h:2423
agora::media::base::VideoFrame::yBuffer
uint8_t * yBuffer
Definition: AgoraMediaBase.h:1083
agora::media::base::VideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:1163
agora::media::base::VideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:1169
agora::media::base::AudioPcmFrame::bytes_per_sample
rtc::BYTES_PER_SAMPLE bytes_per_sample
Definition: AgoraMediaBase.h:428
agora::media::UserAudioSpectrumInfo
Audio spectrum information of the remote user.
Definition: AgoraMediaBase.h:1857
agora::media::base::Hdr10MetadataInfo::redPrimaryX
uint16_t redPrimaryX
Definition: AgoraMediaBase.h:728
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_EAR_MONITORING
@ AUDIO_FRAME_POSITION_EAR_MONITORING
Definition: AgoraMediaBase.h:1518
agora::media::RecorderInfo::fileName
const char * fileName
Definition: AgoraMediaBase.h:2516
agora::media::IVideoFrameObserver::onRenderVideoFrame
virtual bool onRenderVideoFrame(const char *channelId, rtc::uid_t remoteUid, VideoFrame &videoFrame)=0
Occurs each time the SDK receives a video frame sent by the remote user.
agora::media::IVideoFrameObserver::PROCESS_MODE_READ_WRITE
@ PROCESS_MODE_READ_WRITE
Definition: AgoraMediaBase.h:1971
agora::media::IVideoFrameObserver::isExternal
virtual bool isExternal()
Definition: AgoraMediaBase.h:2262
agora::media::ContentInspectModule::interval
unsigned int interval
Definition: AgoraMediaBase.h:1323
agora::media::IVideoFrameObserver::getObservedFramePosition
virtual uint32_t getObservedFramePosition()
Sets the frame position for the video observer.
Definition: AgoraMediaBase.h:2251
agora::media::base::VideoFrame::yStride
int yStride
Definition: AgoraMediaBase.h:1067
agora::media::base::ExternalVideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:974
agora::media::base::Hdr10MetadataInfo::bluePrimaryX
uint16_t bluePrimaryX
Definition: AgoraMediaBase.h:744
agora::media::ContentInspectModule::type
CONTENT_INSPECT_TYPE type
Definition: AgoraMediaBase.h:1317
agora::media::MediaRecorderConfiguration::containerFormat
MediaRecorderContainerFormat containerFormat
Definition: AgoraMediaBase.h:2375
agora::media::base::ExternalVideoFrame::EGL_CONTEXT14
@ EGL_CONTEXT14
Definition: AgoraMediaBase.h:861
agora::media::RecorderInfo::fileSize
unsigned int fileSize
Definition: AgoraMediaBase.h:2524
agora::media::base::ExternalVideoFrame::cropTop
int cropTop
Definition: AgoraMediaBase.h:911
agora::media::base::ExternalVideoFrame::type
VIDEO_BUFFER_TYPE type
Definition: AgoraMediaBase.h:885
agora::media::IVideoFrameObserver::onPreEncodeVideoFrame
virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType, VideoFrame &videoFrame)=0
Occurs each time the SDK receives a video frame before encoding.
agora::media::base::ExternalVideoFrame::textureSliceIndex
int textureSliceIndex
Definition: AgoraMediaBase.h:1003
agora::media::base::Hdr10MetadataInfo::bluePrimaryY
uint16_t bluePrimaryY
Definition: AgoraMediaBase.h:748
agora::media::IVideoFrameObserver::getRotationApplied
virtual bool getRotationApplied()
Occurs each time the SDK receives a video frame, and prompts you whether to rotate the captured video...
Definition: AgoraMediaBase.h:2190
agora::media::base::Hdr10MetadataInfo::maxContentLightLevel
uint16_t maxContentLightLevel
Definition: AgoraMediaBase.h:768
agora::media::SnapshotConfig
The snapshot configuration.
Definition: AgoraMediaBase.h:1377
agora::media::base::VideoFrame::vBuffer
uint8_t * vBuffer
Definition: AgoraMediaBase.h:1091
agora::media::AudioSpectrumData::dataLength
int dataLength
Definition: AgoraMediaBase.h:1848
agora::media::base::ExternalVideoFrame::EGL_CONTEXT_TYPE
EGL_CONTEXT_TYPE
Definition: AgoraMediaBase.h:853
agora::media::IAudioFrameObserverBase::onMixedAudioFrame
virtual bool onMixedAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
Retrieves the mixed captured and playback audio frame.
agora::media::IAudioFrameObserverBase::AudioParams
Audio data format.
Definition: AgoraMediaBase.h:1542
agora::media::base::AudioPcmFrame::num_channels_
size_t num_channels_
Definition: AgoraMediaBase.h:420
agora::rtc::ExtensionContext::uid
uid_t uid
Definition: AgoraMediaBase.h:51
agora::media::IAudioFrameObserverBase::AudioFrame::avsync_type
int avsync_type
Definition: AgoraMediaBase.h:1471
agora::media::IAudioFrameObserverBase::getObservedAudioFramePosition
virtual int getObservedAudioFramePosition()=0
Sets the frame position for the video observer.
agora::media::MediaRecorderConfiguration
Configuration for audio and video stream recording.
Definition: AgoraMediaBase.h:2361
agora::media::base::VideoFrame::metadata_buffer
uint8_t * metadata_buffer
Definition: AgoraMediaBase.h:1111
agora::rtc::ExtensionContext::isValid
bool isValid
Definition: AgoraMediaBase.h:47
agora::media::MediaRecorderConfiguration::streamType
MediaRecorderStreamType streamType
Definition: AgoraMediaBase.h:2379
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_BEFORE_MIXING
@ AUDIO_FRAME_POSITION_BEFORE_MIXING
Definition: AgoraMediaBase.h:1515
agora::media::ContentInspectModule::position
base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1327
agora::media::MediaRecorderConfiguration::storagePath
const char * storagePath
Definition: AgoraMediaBase.h:2371
agora::media::AudioSpectrumData
The audio spectrum data.
Definition: AgoraMediaBase.h:1838
agora::media::base::VideoFrame::width
int width
Definition: AgoraMediaBase.h:1057
agora::media::base::AudioPcmFrame::audio_track_number_
int audio_track_number_
Definition: AgoraMediaBase.h:424
agora::media::RecorderInfo::durationMs
unsigned int durationMs
Definition: AgoraMediaBase.h:2520
agora::media::base::VideoFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1101
agora::media::base::AudioPcmFrame::samples_per_channel_
size_t samples_per_channel_
Definition: AgoraMediaBase.h:412
agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing
virtual bool onPlaybackAudioFrameBeforeMixing(const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame)=0
Retrieves the audio frame before mixing of subscribed remote users.
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:1444
agora::media::base::ExternalVideoFrame::textureId
int textureId
Definition: AgoraMediaBase.h:946
agora::media::base::VideoFrame::pixelBuffer
void * pixelBuffer
Definition: AgoraMediaBase.h:1154
agora::media::IAudioFrameObserverBase::AudioFrame::type
AUDIO_FRAME_TYPE type
Definition: AgoraMediaBase.h:1436
agora::media::IAudioPcmFrameSink::onFrame
virtual void onFrame(agora::media::base::AudioPcmFrame *frame)=0
Occurs each time the player receives an audio frame.
agora::media::base::AudioPcmFrame::is_stereo_
bool is_stereo_
Definition: AgoraMediaBase.h:438
agora::media::IVideoEncodedFrameObserver
Definition: AgoraMediaBase.h:1923
agora::media::IAudioFrameObserverBase::AudioFrame::samplesPerChannel
int samplesPerChannel
Definition: AgoraMediaBase.h:1440
agora::media::IVideoFrameObserver::getMirrorApplied
virtual bool getMirrorApplied()
Occurs each time the SDK receives a video frame and prompts you whether or not to mirror the captured...
Definition: AgoraMediaBase.h:2219
agora::media::IAudioSpectrumObserver::onLocalAudioSpectrum
virtual bool onLocalAudioSpectrum(const AudioSpectrumData &data)=0
Gets the statistics of a local audio spectrum.
agora::media::base::AudioEncodedFrameInfo
Definition: AgoraMediaBase.h:372
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_RECORD
@ AUDIO_FRAME_POSITION_RECORD
Definition: AgoraMediaBase.h:1509
agora::media::MediaRecorderConfiguration::width
int width
Definition: AgoraMediaBase.h:2396
agora::media::base::VideoFrame::vStride
int vStride
Definition: AgoraMediaBase.h:1079
agora::media::base::ExternalVideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:1008
agora::media::ContentInspectConfig
Screenshot and upload configuration.
Definition: AgoraMediaBase.h:1337
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_MIXED
@ AUDIO_FRAME_POSITION_MIXED
Definition: AgoraMediaBase.h:1512
agora::media::base::AudioPcmFrame
The parameters of the audio frame in PCM format.
Definition: AgoraMediaBase.h:387
agora::media::base::ExternalVideoFrame::fillAlphaBuffer
bool fillAlphaBuffer
Definition: AgoraMediaBase.h:986
agora::media::IAudioFrameObserverBase::AudioParams::sample_rate
int sample_rate
Definition: AgoraMediaBase.h:1551
agora::media::base::VideoFrame::uBuffer
uint8_t * uBuffer
Definition: AgoraMediaBase.h:1087
agora::media::IAudioFrameObserverBase::onPlaybackAudioFrame
virtual bool onPlaybackAudioFrame(const char *channelId, AudioFrame &audioFrame)=0
Gets the raw audio frame for playback.
agora::media::base::ExternalVideoFrame::EGL_CONTEXT10
@ EGL_CONTEXT10
Definition: AgoraMediaBase.h:857
agora::media::base::IVideoFrameMetaInfo
Definition: AgoraMediaBase.h:628
agora::media::UserAudioSpectrumInfo::uid
agora::rtc::uid_t uid
Definition: AgoraMediaBase.h:1861
agora::media::SnapshotConfig::position
media::base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1391
agora::rtc::ExtensionContext::extensionName
const char * extensionName
Definition: AgoraMediaBase.h:59
agora::media::IVideoFrameObserver::VIDEO_FRAME_PROCESS_MODE
VIDEO_FRAME_PROCESS_MODE
The process mode of the video frame:
Definition: AgoraMediaBase.h:1960
agora::media::base::ExternalVideoFrame::format
VIDEO_PIXEL_FORMAT format
Definition: AgoraMediaBase.h:889
agora::media::base::ExternalVideoFrame::metadataSize
int metadataSize
Definition: AgoraMediaBase.h:966
agora::media::ContentInspectConfig::extraInfo
const char * extraInfo
Definition: AgoraMediaBase.h:1344
agora::media::base::Hdr10MetadataInfo::maxFrameAverageLightLevel
uint16_t maxFrameAverageLightLevel
Definition: AgoraMediaBase.h:772
agora::media::base::ExternalVideoFrame::stride
int stride
Definition: AgoraMediaBase.h:899
agora::media::base::ExternalVideoFrame::eglType
EGL_CONTEXT_TYPE eglType
Definition: AgoraMediaBase.h:941