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];
960 uint8_t* metadataBuffer;
965 int metadataSize;
973 uint8_t* alphaBuffer;
985 bool fillAlphaBuffer;
990 ALPHA_STITCH_MODE alphaStitchMode;
991
996 void *d3d11Texture2d;
997
1002 int textureSliceIndex;
1003
1007 Hdr10MetadataInfo hdr10MetadataInfo;
1008
1013 ColorSpace colorSpace;
1014 };
1015
1024 struct VideoFrame {
1025 VideoFrame():
1026 type(VIDEO_PIXEL_DEFAULT),
1027 width(0),
1028 height(0),
1029 yStride(0),
1030 uStride(0),
1031 vStride(0),
1032 yBuffer(NULL),
1033 uBuffer(NULL),
1034 vBuffer(NULL),
1035 rotation(0),
1036 renderTimeMs(0),
1037 avsync_type(0),
1038 metadata_buffer(NULL),
1039 metadata_size(0),
1040 sharedContext(0),
1041 textureId(0),
1042 d3d11Texture2d(NULL),
1043 alphaBuffer(NULL),
1044 alphaStitchMode(NO_ALPHA_STITCH),
1045 pixelBuffer(NULL),
1046 metaInfo(NULL){
1047 memset(matrix, 0, sizeof(matrix));
1048 }
1052 VIDEO_PIXEL_FORMAT type;
1056 int width;
1060 int height;
1066 int yStride;
1072 int uStride;
1078 int vStride;
1082 uint8_t* yBuffer;
1086 uint8_t* uBuffer;
1090 uint8_t* vBuffer;
1095 int rotation;
1100 int64_t renderTimeMs;
1104 int avsync_type;
1109 uint8_t* metadata_buffer;
1114 int metadata_size;
1118 void* sharedContext;
1122 int textureId;
1127 void* d3d11Texture2d;
1132 float matrix[16];
1142 uint8_t* alphaBuffer;
1147 ALPHA_STITCH_MODE alphaStitchMode;
1151 void* pixelBuffer;
1155 IVideoFrameMetaInfo* metaInfo;
1156
1160 Hdr10MetadataInfo hdr10MetadataInfo;
1161
1166 ColorSpace colorSpace;
1167 };
1168
1172 class IVideoFrameObserver {
1173 public:
1184 virtual void onFrame(const VideoFrame* frame) = 0;
1185 virtual ~IVideoFrameObserver() {}
1186 virtual bool isExternal() { return true; }
1213 virtual VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return VIDEO_PIXEL_DEFAULT; }
1214 };
1215
1216 enum MEDIA_PLAYER_SOURCE_TYPE {
1222 MEDIA_PLAYER_SOURCE_DEFAULT,
1228 MEDIA_PLAYER_SOURCE_FULL_FEATURED,
1233 MEDIA_PLAYER_SOURCE_SIMPLE,
1234 };
1235
1239 enum VIDEO_MODULE_POSITION {
1245 POSITION_POST_CAPTURER = 1 << 0,
1250 POSITION_PRE_RENDERER = 1 << 1,
1260 POSITION_PRE_ENCODER = 1 << 2,
1266 POSITION_POST_CAPTURER_ORIGIN = 1 << 3,
1267 };
1268
1269 } // namespace base
1270
1273 #define MAX_CONTENT_INSPECT_MODULE_COUNT 32
1274 enum CONTENT_INSPECT_RESULT {
1275 CONTENT_INSPECT_NEUTRAL = 1,
1276 CONTENT_INSPECT_SEXY = 2,
1277 CONTENT_INSPECT_PORN = 3,
1278 };
1279
1283 enum CONTENT_INSPECT_TYPE {
1287 CONTENT_INSPECT_INVALID = 0,
1292 CONTENT_INSPECT_MODERATION __deprecated = 1,
1297 CONTENT_INSPECT_SUPERVISION = 2,
1303 CONTENT_INSPECT_IMAGE_MODERATION = 3
1304 };
1305
1310 struct ContentInspectModule {
1314 CONTENT_INSPECT_TYPE type;
1320 unsigned int interval;
1324 base::VIDEO_MODULE_POSITION position;
1325 ContentInspectModule() {
1326 type = CONTENT_INSPECT_INVALID;
1327 interval = 0;
1328 position = base::POSITION_PRE_ENCODER;
1329 }
1330 };
1334 struct ContentInspectConfig {
1341 const char* extraInfo;
1347 const char* serverConfig;
1355 ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
1361 int moduleCount;
1362 ContentInspectConfig& operator=(const ContentInspectConfig& rth) {
1363 extraInfo = rth.extraInfo;
1364 serverConfig = rth.serverConfig;
1365 moduleCount = rth.moduleCount;
1366 memcpy(&modules, &rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
1367 return *this;
1368 }
1369 ContentInspectConfig() : extraInfo(NULL), serverConfig(NULL), moduleCount(0) {}
1370 };
1374 struct SnapshotConfig {
1383 const char* filePath;
1384
1388 media::base::VIDEO_MODULE_POSITION position;
1389 SnapshotConfig() :filePath(NULL), position(media::base::POSITION_PRE_ENCODER) {}
1390 };
1391
1395 class IAudioPcmFrameSink {
1396 public:
1407 virtual void onFrame(agora::media::base::AudioPcmFrame* frame) = 0;
1408 virtual ~IAudioPcmFrameSink() {}
1409 };
1410
1414 class IAudioFrameObserverBase {
1415 public:
1419 enum AUDIO_FRAME_TYPE {
1423 FRAME_TYPE_PCM16 = 0,
1424 };
1425 enum { MAX_HANDLE_TIME_CNT = 10 };
1429 struct AudioFrame {
1433 AUDIO_FRAME_TYPE type;
1437 int samplesPerChannel;
1441 agora::rtc::BYTES_PER_SAMPLE bytesPerSample;
1447 int channels;
1451 int samplesPerSec;
1457 void* buffer;
1464 int64_t renderTimeMs;
1468 int avsync_type;
1475 int64_t presentationMs;
1479 int audioTrackNumber;
1483 uint32_t rtpTimestamp;
1484
1485 AudioFrame()
1486 : type(FRAME_TYPE_PCM16),
1487 samplesPerChannel(0),
1488 bytesPerSample(rtc::TWO_BYTES_PER_SAMPLE),
1489 channels(0),
1490 samplesPerSec(0),
1491 buffer(NULL),
1492 renderTimeMs(0),
1493 avsync_type(0),
1494 presentationMs(0),
1495 audioTrackNumber(0),
1496 rtpTimestamp(0) {}
1497 };
1498
1499 enum AUDIO_FRAME_POSITION {
1500 AUDIO_FRAME_POSITION_NONE = 0x0000,
1503 AUDIO_FRAME_POSITION_PLAYBACK = 0x0001,
1506 AUDIO_FRAME_POSITION_RECORD = 0x0002,
1509 AUDIO_FRAME_POSITION_MIXED = 0x0004,
1512 AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008,
1515 AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010,
1516 };
1517
1539 struct AudioParams {
1548 int sample_rate;
1549
1555 int channels;
1556
1560 rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE mode;
1561
1565 int samples_per_call;
1566
1567 AudioParams()
1568 : sample_rate(0),
1569 channels(0),
1570 mode(rtc::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY),
1571 samples_per_call(0) {}
1572 AudioParams(int samplerate, int channel, rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE type,
1573 int samplesPerCall)
1574 : sample_rate(samplerate),
1575 channels(channel),
1576 mode(type),
1577 samples_per_call(samplesPerCall) {}
1578 };
1579
1580 public:
1581 virtual ~IAudioFrameObserverBase() {}
1582
1608 virtual bool onRecordAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1634 virtual bool onPlaybackAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1660 virtual bool onMixedAudioFrame(const char* channelId, AudioFrame& audioFrame) = 0;
1686 virtual bool onEarMonitoringAudioFrame(AudioFrame& audioFrame) = 0;
1696 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, base::user_id_t userId,
1697 AudioFrame& audioFrame) {
1698 (void)channelId;
1699 (void)userId;
1700 (void)audioFrame;
1701 return true;
1702 }
1703
1733 virtual int getObservedAudioFramePosition() = 0;
1734
1752 virtual AudioParams getPlaybackAudioParams() = 0;
1753
1771 virtual AudioParams getRecordAudioParams() = 0;
1772
1790 virtual AudioParams getMixedAudioParams() = 0;
1791
1809 virtual AudioParams getEarMonitoringAudioParams() = 0;
1810 };
1811
1815 class IAudioFrameObserver : public IAudioFrameObserverBase {
1816 public:
1817 using IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing;
1828 virtual bool onPlaybackAudioFrameBeforeMixing(const char* channelId, rtc::uid_t uid,
1829 AudioFrame& audioFrame) = 0;
1830 };
1831
1835 struct AudioSpectrumData {
1841 const float* audioSpectrumData;
1845 int dataLength;
1846
1847 AudioSpectrumData() : audioSpectrumData(NULL), dataLength(0) {}
1848 AudioSpectrumData(const float* data, int length) : audioSpectrumData(data), dataLength(length) {}
1849 };
1850
1854 struct UserAudioSpectrumInfo {
1858 agora::rtc::uid_t uid;
1862 struct AudioSpectrumData spectrumData;
1863
1864 UserAudioSpectrumInfo() : uid(0) {}
1865
1866 UserAudioSpectrumInfo(agora::rtc::uid_t uid, const float* data, int length)
1867 : uid(uid), spectrumData(data, length) {}
1868 };
1869
1873 class IAudioSpectrumObserver {
1874 public:
1875 virtual ~IAudioSpectrumObserver() {}
1876
1893 virtual bool onLocalAudioSpectrum(const AudioSpectrumData& data) = 0;
1913 virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo* spectrums,
1914 unsigned int spectrumNumber) = 0;
1915 };
1916
1920 class IVideoEncodedFrameObserver {
1921 public:
1941 virtual bool onEncodedVideoFrameReceived(
1942 const char* channelId, rtc::uid_t uid, const uint8_t* imageBuffer, size_t length,
1943 const rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo) = 0;
1944
1945 virtual ~IVideoEncodedFrameObserver() {}
1946 };
1947
1951 class IVideoFrameObserver {
1952 public:
1953 typedef media::base::VideoFrame VideoFrame;
1957 enum VIDEO_FRAME_PROCESS_MODE {
1962 PROCESS_MODE_READ_ONLY, // Observer works as a pure renderer and will not modify the original
1963 // frame.
1968 PROCESS_MODE_READ_WRITE, // Observer works as a filter that will process the video frame and
1969 // affect the following frame processing in SDK.
1970 };
1971
1972 public:
1973 virtual ~IVideoFrameObserver() {}
1974
2018 virtual bool onCaptureVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
2019 VideoFrame& videoFrame) = 0;
2020
2058 virtual bool onPreEncodeVideoFrame(agora::rtc::VIDEO_SOURCE_TYPE sourceType,
2059 VideoFrame& videoFrame) = 0;
2060
2084 virtual bool onMediaPlayerVideoFrame(VideoFrame& videoFrame, int mediaPlayerId) = 0;
2085
2123 virtual bool onRenderVideoFrame(const char* channelId, rtc::uid_t remoteUid,
2124 VideoFrame& videoFrame) = 0;
2125
2126 virtual bool onTranscodedVideoFrame(VideoFrame& videoFrame) = 0;
2127
2140 virtual VIDEO_FRAME_PROCESS_MODE getVideoFrameProcessMode() { return PROCESS_MODE_READ_ONLY; }
2141
2157 virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference() { return base::VIDEO_PIXEL_DEFAULT; }
2158
2184 virtual bool getRotationApplied() { return false; }
2185
2213 virtual bool getMirrorApplied() { return false; }
2214
2245 virtual uint32_t getObservedFramePosition() {
2246 return base::POSITION_POST_CAPTURER | base::POSITION_PRE_RENDERER;
2247 }
2248
2256 virtual bool isExternal() { return true; }
2257 };
2258
2262 enum EXTERNAL_VIDEO_SOURCE_TYPE {
2266 VIDEO_FRAME = 0,
2270 ENCODED_VIDEO_FRAME,
2271 };
2272
2278 enum MediaRecorderContainerFormat {
2282 FORMAT_MP4 = 1,
2283 };
2289 enum MediaRecorderStreamType {
2293 STREAM_TYPE_AUDIO = 0x01,
2297 STREAM_TYPE_VIDEO = 0x02,
2301 STREAM_TYPE_BOTH = STREAM_TYPE_AUDIO | STREAM_TYPE_VIDEO,
2302 };
2308 enum RecorderState {
2312 RECORDER_STATE_ERROR = -1,
2316 RECORDER_STATE_START = 2,
2320 RECORDER_STATE_STOP = 3,
2321 };
2327 enum RecorderReasonCode {
2331 RECORDER_REASON_NONE = 0,
2335 RECORDER_REASON_WRITE_FAILED = 1,
2340 RECORDER_REASON_NO_STREAM = 2,
2344 RECORDER_REASON_OVER_MAX_DURATION = 3,
2348 RECORDER_REASON_CONFIG_CHANGED = 4,
2349 };
2355 struct MediaRecorderConfiguration {
2365 const char* storagePath;
2369 MediaRecorderContainerFormat containerFormat;
2373 MediaRecorderStreamType streamType;
2377 int maxDurationMs;
2383 int recorderInfoUpdateInterval;
2390 int width;
2397 int height;
2403 int fps;
2409 int sample_rate;
2417 int channel_num;
2423 agora::rtc::VIDEO_SOURCE_TYPE videoSourceType;
2424
2425 MediaRecorderConfiguration()
2426 : storagePath(NULL),
2427 containerFormat(FORMAT_MP4),
2428 streamType(STREAM_TYPE_BOTH),
2429 maxDurationMs(120000),
2430 recorderInfoUpdateInterval(0),
2431 width(1280),
2432 height(720),
2433 fps(30),
2434 sample_rate(48000),
2435 channel_num(1),
2436 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2437 MediaRecorderConfiguration(const char* path, MediaRecorderContainerFormat format,
2438 MediaRecorderStreamType type, int duration, int interval)
2439 : storagePath(path),
2440 containerFormat(format),
2441 streamType(type),
2442 maxDurationMs(duration),
2443 recorderInfoUpdateInterval(interval),
2444 width(1280),
2445 height(720),
2446 fps(30),
2447 sample_rate(48000),
2448 channel_num(1),
2449 videoSourceType(rtc::VIDEO_SOURCE_CAMERA_PRIMARY) {}
2450 };
2451
2452 class IFaceInfoObserver {
2453 public:
2496 virtual bool onFaceInfo(const char* outFaceInfo) = 0;
2497
2498 virtual ~IFaceInfoObserver() {}
2499 };
2500
2506 struct RecorderInfo {
2510 const char* fileName;
2514 unsigned int durationMs;
2518 unsigned int fileSize;
2519
2520 RecorderInfo() : fileName(NULL), durationMs(0), fileSize(0) {}
2521 RecorderInfo(const char* name, unsigned int dur, unsigned int size)
2522 : fileName(name), durationMs(dur), fileSize(size) {}
2523 };
2524
2525 class IMediaRecorderObserver {
2526 public:
2542 virtual void onRecorderStateChanged(const char* channelId, rtc::uid_t uid, RecorderState state,
2543 RecorderReasonCode reason) = 0;
2560 virtual void onRecorderInfoUpdated(const char* channelId, rtc::uid_t uid,
2561 const RecorderInfo& info) = 0;
2562
2563 virtual ~IMediaRecorderObserver() {}
2564 };
2565
2566 } // namespace media
2567 } // 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:1962
agora::media::base::VideoFrame
Configurations of the video frame.
Definition: AgoraMediaBase.h:1024
agora::media::base::ExternalVideoFrame::cropBottom
int cropBottom
Definition: AgoraMediaBase.h:919
agora::media::IAudioFrameObserverBase::AudioParams::channels
int channels
Definition: AgoraMediaBase.h:1555
agora::media::base::Hdr10MetadataInfo::redPrimaryY
uint16_t redPrimaryY
Definition: AgoraMediaBase.h:732
agora::media::base::VideoFrame::metadata_size
int metadata_size
Definition: AgoraMediaBase.h:1114
agora::media::SnapshotConfig::filePath
const char * filePath
Definition: AgoraMediaBase.h:1383
agora::media::AudioSpectrumData::audioSpectrumData
const float * audioSpectrumData
Definition: AgoraMediaBase.h:1841
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:1395
agora::media::IMediaRecorderObserver
Definition: AgoraMediaBase.h:2525
agora::media::IAudioFrameObserverBase
Definition: AgoraMediaBase.h:1414
agora::media::base::ExternalVideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:1013
agora::media::ContentInspectConfig::modules
ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT]
Definition: AgoraMediaBase.h:1355
agora::media::base::VideoFrame::uStride
int uStride
Definition: AgoraMediaBase.h:1072
agora::media::IAudioFrameObserverBase::AudioFrame::rtpTimestamp
uint32_t rtpTimestamp
Definition: AgoraMediaBase.h:1483
agora::media::IAudioFrameObserverBase::FRAME_TYPE_PCM16
@ FRAME_TYPE_PCM16
Definition: AgoraMediaBase.h:1423
agora::media::IAudioFrameObserverBase::AudioFrame::audioTrackNumber
int audioTrackNumber
Definition: AgoraMediaBase.h:1479
agora::media::base::VideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:1142
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:1213
agora::media::IFaceInfoObserver
Definition: AgoraMediaBase.h:2452
agora::media::base::VideoFrame::height
int height
Definition: AgoraMediaBase.h:1060
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:2377
agora::media::IAudioSpectrumObserver
Definition: AgoraMediaBase.h:1873
agora::rtc::AudioParameters
Definition: AgoraMediaBase.h:250
agora::media::IAudioFrameObserverBase::AudioFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1464
agora::media::IAudioFrameObserverBase::AudioParams::mode
rtc::RAW_AUDIO_FRAME_OP_MODE_TYPE mode
Definition: AgoraMediaBase.h:1560
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:1447
agora::media::IVideoFrameObserver::getVideoFormatPreference
virtual base::VIDEO_PIXEL_FORMAT getVideoFormatPreference()
Definition: AgoraMediaBase.h:2157
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:1347
agora::media::base::IVideoFrameObserver
Definition: AgoraMediaBase.h:1172
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:2140
agora::media::IVideoFrameObserver
Definition: AgoraMediaBase.h:1951
agora::media::IAudioFrameObserverBase::AudioFrame
Raw audio data.
Definition: AgoraMediaBase.h:1429
agora::media::base::AudioEncodedFrameInfo::codec
uint8_t codec
Definition: AgoraMediaBase.h:380
agora::media::MediaRecorderConfiguration::recorderInfoUpdateInterval
int recorderInfoUpdateInterval
Definition: AgoraMediaBase.h:2383
agora::media::IAudioFrameObserver
Definition: AgoraMediaBase.h:1815
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:1127
agora::media::base::VideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:1095
agora::media::base::VideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:1147
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:2409
agora::media::base::ExternalVideoFrame::eglContext
void * eglContext
Definition: AgoraMediaBase.h:937
agora::media::base::VideoFrame::metaInfo
IVideoFrameMetaInfo * metaInfo
Definition: AgoraMediaBase.h:1155
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:1122
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:2423
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:1475
agora::media::base::VideoFrame::avsync_type
int avsync_type
Definition: AgoraMediaBase.h:1104
agora::media::base::Hdr10MetadataInfo::greenPrimaryY
uint16_t greenPrimaryY
Definition: AgoraMediaBase.h:740
agora::media::base::VideoFrame::matrix
float matrix[16]
Definition: AgoraMediaBase.h:1132
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:1451
agora::media::ContentInspectModule
ContentInspectModule class, a structure used to configure the frequency of video screenshot and uploa...
Definition: AgoraMediaBase.h:1310
agora::media::IAudioFrameObserverBase::AudioFrame::buffer
void * buffer
Definition: AgoraMediaBase.h:1457
agora::media::IAudioFrameObserverBase::onPlaybackAudioFrameBeforeMixing
virtual bool onPlaybackAudioFrameBeforeMixing(const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
Definition: AgoraMediaBase.h:1696
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:2403
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:996
agora::media::base::AudioEncodedFrameInfo::sendTs
uint64_t sendTs
Definition: AgoraMediaBase.h:376
agora::media::ContentInspectConfig::moduleCount
int moduleCount
Definition: AgoraMediaBase.h:1361
agora::media::base::Hdr10MetadataInfo::whitePointX
uint16_t whitePointX
Definition: AgoraMediaBase.h:752
agora::media::base::VideoFrame::type
VIDEO_PIXEL_FORMAT type
Definition: AgoraMediaBase.h:1052
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:2397
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:1499
agora::media::base::ExternalVideoFrame::height
int height
Definition: AgoraMediaBase.h:903
agora::media::base::VideoFrame::sharedContext
void * sharedContext
Definition: AgoraMediaBase.h:1118
agora::media::base::ExternalVideoFrame::rotation
int rotation
Definition: AgoraMediaBase.h:924
agora::media::RecorderInfo
Information about the recording file.
Definition: AgoraMediaBase.h:2506
agora::media::base::ExternalVideoFrame::metadataBuffer
uint8_t * metadataBuffer
Definition: AgoraMediaBase.h:960
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:1862
agora::media::IAudioFrameObserverBase::AudioParams::samples_per_call
int samples_per_call
Definition: AgoraMediaBase.h:1565
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_PLAYBACK
@ AUDIO_FRAME_POSITION_PLAYBACK
Definition: AgoraMediaBase.h:1503
agora::media::base::ExternalVideoFrame::alphaStitchMode
ALPHA_STITCH_MODE alphaStitchMode
Definition: AgoraMediaBase.h:990
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:1419
agora::media::MediaRecorderConfiguration::channel_num
int channel_num
Definition: AgoraMediaBase.h:2417
agora::media::base::VideoFrame::yBuffer
uint8_t * yBuffer
Definition: AgoraMediaBase.h:1082
agora::media::base::VideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:1160
agora::media::base::VideoFrame::colorSpace
ColorSpace colorSpace
Definition: AgoraMediaBase.h:1166
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:1854
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:1515
agora::media::RecorderInfo::fileName
const char * fileName
Definition: AgoraMediaBase.h:2510
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:1968
agora::media::IVideoFrameObserver::isExternal
virtual bool isExternal()
Definition: AgoraMediaBase.h:2256
agora::media::ContentInspectModule::interval
unsigned int interval
Definition: AgoraMediaBase.h:1320
agora::media::IVideoFrameObserver::getObservedFramePosition
virtual uint32_t getObservedFramePosition()
Sets the frame position for the video observer.
Definition: AgoraMediaBase.h:2245
agora::media::base::VideoFrame::yStride
int yStride
Definition: AgoraMediaBase.h:1066
agora::media::base::ExternalVideoFrame::alphaBuffer
uint8_t * alphaBuffer
Definition: AgoraMediaBase.h:973
agora::media::base::Hdr10MetadataInfo::bluePrimaryX
uint16_t bluePrimaryX
Definition: AgoraMediaBase.h:744
agora::media::ContentInspectModule::type
CONTENT_INSPECT_TYPE type
Definition: AgoraMediaBase.h:1314
agora::media::MediaRecorderConfiguration::containerFormat
MediaRecorderContainerFormat containerFormat
Definition: AgoraMediaBase.h:2369
agora::media::base::ExternalVideoFrame::EGL_CONTEXT14
@ EGL_CONTEXT14
Definition: AgoraMediaBase.h:861
agora::media::RecorderInfo::fileSize
unsigned int fileSize
Definition: AgoraMediaBase.h:2518
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:1002
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:2184
agora::media::base::Hdr10MetadataInfo::maxContentLightLevel
uint16_t maxContentLightLevel
Definition: AgoraMediaBase.h:768
agora::media::SnapshotConfig
The snapshot configuration.
Definition: AgoraMediaBase.h:1374
agora::media::base::VideoFrame::vBuffer
uint8_t * vBuffer
Definition: AgoraMediaBase.h:1090
agora::media::AudioSpectrumData::dataLength
int dataLength
Definition: AgoraMediaBase.h:1845
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:1539
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:1468
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:2355
agora::media::base::VideoFrame::metadata_buffer
uint8_t * metadata_buffer
Definition: AgoraMediaBase.h:1109
agora::rtc::ExtensionContext::isValid
bool isValid
Definition: AgoraMediaBase.h:47
agora::media::MediaRecorderConfiguration::streamType
MediaRecorderStreamType streamType
Definition: AgoraMediaBase.h:2373
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_BEFORE_MIXING
@ AUDIO_FRAME_POSITION_BEFORE_MIXING
Definition: AgoraMediaBase.h:1512
agora::media::ContentInspectModule::position
base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1324
agora::media::MediaRecorderConfiguration::storagePath
const char * storagePath
Definition: AgoraMediaBase.h:2365
agora::media::AudioSpectrumData
The audio spectrum data.
Definition: AgoraMediaBase.h:1835
agora::media::base::VideoFrame::width
int width
Definition: AgoraMediaBase.h:1056
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:2514
agora::media::base::VideoFrame::renderTimeMs
int64_t renderTimeMs
Definition: AgoraMediaBase.h:1100
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:1441
agora::media::base::ExternalVideoFrame::textureId
int textureId
Definition: AgoraMediaBase.h:946
agora::media::base::VideoFrame::pixelBuffer
void * pixelBuffer
Definition: AgoraMediaBase.h:1151
agora::media::IAudioFrameObserverBase::AudioFrame::type
AUDIO_FRAME_TYPE type
Definition: AgoraMediaBase.h:1433
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:1920
agora::media::IAudioFrameObserverBase::AudioFrame::samplesPerChannel
int samplesPerChannel
Definition: AgoraMediaBase.h:1437
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:2213
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:1506
agora::media::MediaRecorderConfiguration::width
int width
Definition: AgoraMediaBase.h:2390
agora::media::base::VideoFrame::vStride
int vStride
Definition: AgoraMediaBase.h:1078
agora::media::base::ExternalVideoFrame::hdr10MetadataInfo
Hdr10MetadataInfo hdr10MetadataInfo
Definition: AgoraMediaBase.h:1007
agora::media::ContentInspectConfig
Screenshot and upload configuration.
Definition: AgoraMediaBase.h:1334
agora::media::IAudioFrameObserverBase::AUDIO_FRAME_POSITION_MIXED
@ AUDIO_FRAME_POSITION_MIXED
Definition: AgoraMediaBase.h:1509
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:985
agora::media::IAudioFrameObserverBase::AudioParams::sample_rate
int sample_rate
Definition: AgoraMediaBase.h:1548
agora::media::base::VideoFrame::uBuffer
uint8_t * uBuffer
Definition: AgoraMediaBase.h:1086
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:1858
agora::media::SnapshotConfig::position
media::base::VIDEO_MODULE_POSITION position
Definition: AgoraMediaBase.h:1388
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:1957
agora::media::base::ExternalVideoFrame::format
VIDEO_PIXEL_FORMAT format
Definition: AgoraMediaBase.h:889
agora::media::base::ExternalVideoFrame::metadataSize
int metadataSize
Definition: AgoraMediaBase.h:965
agora::media::ContentInspectConfig::extraInfo
const char * extraInfo
Definition: AgoraMediaBase.h:1341
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