Agora Server Gateway SDK C++ API Reference
NGIAgoraVideoTrack.h
Go to the documentation of this file.
1
2// Copyright (c) 2019 Agora.io. All rights reserved
3
4// This program is confidential and proprietary to Agora.io.
5// And may not be copied, reproduced, modified, disclosed to others, published
6// or used, in whole or in part, without the express prior written permission
7// of Agora.io.
8
9#pragma once // NOLINT(build/header_guard)
10
11#include "AgoraBase.h"
12
13#ifndef OPTIONAL_OVERRIDE
14#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
15#define OPTIONAL_OVERRIDE override
16#else
17#define OPTIONAL_OVERRIDE
18#endif
19#endif
20
21namespace agora {
22namespace rtc {
23class IVideoFilter;
25class IMediaPacketReceiver;
26class IVideoSinkBase;
27
62};
63
83 bool enable;
86 bool operator==(const StreamLayerConfigInternal& rhs) const {
87 return dimensions == rhs.dimensions && bitrate_kbps == rhs.bitrate_kbps && framerate == rhs.framerate && enable == rhs.enable;
88 }
89
90 StreamLayerConfigInternal& operator=(const SimulcastConfig::StreamLayerConfig& slc) {
91 dimensions = slc.dimensions;
92 framerate = slc.framerate;
93 enable = slc.enable;
94 return *this;
95 }
96
97 void reset() {
98 dimensions.width = 0;
100 framerate = 0;
102 enable = false;
103 }
104};
105
110
111 void reset() {
112 for (int i = STREAM_LAYER_1; i < STREAM_LAYER_COUNT_MAX; i++) {
114 }
115 }
116
117 bool operator==(const SimulcastConfigInternal& rhs) const {
118 for (int i = 0; i < STREAM_LAYER_COUNT_MAX; i++) {
120 continue;
121 } else {
122 return false;
123 }
124 }
125 return true;
126 }
127};
128
142 REMOTE_VIDEO_IMAGE_TRACK,
144};
145
149class IVideoTrack : public RefCountInterface {
150 public:
166 virtual bool addRenderer(agora_refptr<IVideoSinkBase> videoRenderer, media::base::VIDEO_MODULE_POSITION position = media::base::POSITION_POST_FILTERS, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
177 virtual bool removeRenderer(agora_refptr<IVideoSinkBase> videoRenderer, media::base::VIDEO_MODULE_POSITION position = media::base::POSITION_POST_FILTERS, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
183 virtual VideoTrackType getType() = 0;
184
185 protected:
187};
188
248 int total_bitrate_bps; // Include FEC
268 int width;
274 uint32_t encoder_type;
276
280
285
300 capture_width(0),
304 width(0),
305 height(0),
306 encoder_type(0),
309};
310
317 public:
328 virtual void setEnabled(bool enable, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
329
347 virtual int setVideoEncoderConfiguration(const VideoEncoderConfiguration& config, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
348
366 virtual int setSimulcastStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastConfigInternal& config, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
367
374
383 virtual bool getStatistics(LocalVideoTrackStats& stats) = 0;
387 protected:
389};
401 int delay;
405 int width;
467
473};
474
479 public:
480
488 virtual bool getStatistics(RemoteVideoTrackStats& stats) = 0;
501 virtual bool getTrackInfo(VideoTrackInfo& info) = 0;
515 virtual int registerVideoEncodedImageReceiver(IVideoEncodedImageReceiver* videoReceiver, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
527 protected:
529};
530
531} // namespace rtc
532} // namespace agora
#define OPTIONAL_OVERRIDE
Definition: NGIAgoraVideoTrack.h:17
Definition: AgoraMediaBase.h:783
Definition: NGIAgoraVideoTrack.h:316
virtual int setVideoEncoderConfiguration(const VideoEncoderConfiguration &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool getStatistics(LocalVideoTrackStats &stats)=0
virtual LOCAL_VIDEO_STREAM_STATE getState()=0
~ILocalVideoTrack()
Definition: NGIAgoraVideoTrack.h:388
virtual void setEnabled(bool enable, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int setSimulcastStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastConfigInternal &config, aosl_ref_t ares=AOSL_REF_INVALID)=0
Definition: NGIAgoraVideoTrack.h:478
virtual int unregisterVideoEncodedImageReceiver(IVideoEncodedImageReceiver *videoReceiver)=0
virtual int registerVideoEncodedImageReceiver(IVideoEncodedImageReceiver *videoReceiver, aosl_ref_t ares=AOSL_REF_INVALID)=0
~IRemoteVideoTrack()
Definition: NGIAgoraVideoTrack.h:528
virtual REMOTE_VIDEO_STATE getState()=0
virtual bool getTrackInfo(VideoTrackInfo &info)=0
virtual bool getStatistics(RemoteVideoTrackStats &stats)=0
Definition: AgoraBase.h:3179
Definition: NGIAgoraVideoTrack.h:149
virtual bool removeRenderer(agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_FILTERS, aosl_ref_t ares=AOSL_REF_INVALID)=0
~IVideoTrack()
Definition: NGIAgoraVideoTrack.h:186
virtual VideoTrackType getType()=0
virtual bool addRenderer(agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_FILTERS, aosl_ref_t ares=AOSL_REF_INVALID)=0
SIMULCAST_STREAM_MODE
Definition: AgoraBase.h:2130
VideoTrackType
Definition: NGIAgoraVideoTrack.h:132
@ REMOTE_VIDEO_TRACK
Definition: NGIAgoraVideoTrack.h:140
@ LOCAL_VIDEO_TRACK
Definition: NGIAgoraVideoTrack.h:136
VIDEO_STREAM_TYPE
Definition: AgoraBase.h:1837
@ VIDEO_STREAM_HIGH
Definition: AgoraBase.h:1841
LOCAL_VIDEO_STREAM_STATE
Definition: AgoraBase.h:2789
REMOTE_VIDEO_STATE
Definition: AgoraBase.h:2919
const int STANDARD_BITRATE
Definition: AgoraBase.h:1526
unsigned int uid_t
Definition: AgoraMediaBase.h:25
QUALITY_ADAPT_INDICATION
Definition: AgoraBase.h:2428
@ ADAPT_NONE
Definition: AgoraBase.h:2430
StreamLayerIndexInternal
Definition: NGIAgoraVideoTrack.h:29
@ STREAM_LAYER_COUNT_MAX
Definition: NGIAgoraVideoTrack.h:61
@ STREAM_LAYER_6
Definition: NGIAgoraVideoTrack.h:53
@ STREAM_LAYER_2
Definition: NGIAgoraVideoTrack.h:37
@ STREAM_LAYER_3
Definition: NGIAgoraVideoTrack.h:41
@ STREAM_LOW
Definition: NGIAgoraVideoTrack.h:57
@ STREAM_LAYER_4
Definition: NGIAgoraVideoTrack.h:45
@ STREAM_LAYER_1
Definition: NGIAgoraVideoTrack.h:33
@ STREAM_LAYER_5
Definition: NGIAgoraVideoTrack.h:49
Definition: AgoraBase.h:86
VIDEO_MODULE_POSITION
Definition: AgoraMediaBase.h:644
@ POSITION_POST_FILTERS
Definition: AgoraMediaBase.h:648
Definition: NGIAgoraVideoTrack.h:192
int regulated_capture_height
Definition: NGIAgoraVideoTrack.h:264
uint32_t frames_encoded
Definition: NGIAgoraVideoTrack.h:208
uint32_t ssrc_minor_stream
Definition: NGIAgoraVideoTrack.h:216
int height
Definition: NGIAgoraVideoTrack.h:272
int total_bitrate_bps
Definition: NGIAgoraVideoTrack.h:248
uint64_t bytes_major_stream
Definition: NGIAgoraVideoTrack.h:200
int regulated_capture_frame_rate
Definition: NGIAgoraVideoTrack.h:224
uint64_t number_of_streams
Definition: NGIAgoraVideoTrack.h:196
int width
Definition: NGIAgoraVideoTrack.h:268
int input_frame_rate
Definition: NGIAgoraVideoTrack.h:228
QUALITY_ADAPT_INDICATION quality_adapt_indication
Definition: NGIAgoraVideoTrack.h:284
uint64_t bytes_minor_stream
Definition: NGIAgoraVideoTrack.h:204
int encode_frame_rate
Definition: NGIAgoraVideoTrack.h:232
int target_media_bitrate_bps
Definition: NGIAgoraVideoTrack.h:240
int capture_width
Definition: NGIAgoraVideoTrack.h:252
int media_bitrate_bps
Definition: NGIAgoraVideoTrack.h:244
uint32_t uplink_cost_time_ms
Definition: NGIAgoraVideoTrack.h:279
int render_frame_rate
Definition: NGIAgoraVideoTrack.h:236
LocalVideoTrackStats()
Definition: NGIAgoraVideoTrack.h:286
uint32_t ssrc_major_stream
Definition: NGIAgoraVideoTrack.h:212
int capture_frame_rate
Definition: NGIAgoraVideoTrack.h:220
int capture_height
Definition: NGIAgoraVideoTrack.h:256
int regulated_capture_width
Definition: NGIAgoraVideoTrack.h:260
Definition: NGIAgoraVideoTrack.h:393
int frameLossRate
Definition: NGIAgoraVideoTrack.h:422
uint64_t totalActiveTime
Definition: NGIAgoraVideoTrack.h:462
int receivedBitrate
Definition: NGIAgoraVideoTrack.h:413
VIDEO_STREAM_TYPE rxStreamType
Definition: NGIAgoraVideoTrack.h:429
int totalFrozenTime
Definition: NGIAgoraVideoTrack.h:435
int delay
Definition: NGIAgoraVideoTrack.h:401
RemoteVideoTrackStats()
Definition: NGIAgoraVideoTrack.h:468
int width
Definition: NGIAgoraVideoTrack.h:405
uint32_t frame_render_delay_ms
Definition: NGIAgoraVideoTrack.h:457
uint32_t downlink_process_time_ms
Definition: NGIAgoraVideoTrack.h:453
int rendererOutputFrameRate
Definition: NGIAgoraVideoTrack.h:419
int avSyncTimeMs
Definition: NGIAgoraVideoTrack.h:448
uid_t uid
Definition: NGIAgoraVideoTrack.h:397
int decoderOutputFrameRate
Definition: NGIAgoraVideoTrack.h:416
int packetLossRate
Definition: NGIAgoraVideoTrack.h:425
uint64_t publishDuration
Definition: NGIAgoraVideoTrack.h:466
int frozenRate
Definition: NGIAgoraVideoTrack.h:439
uint32_t totalDecodedFrames
Definition: NGIAgoraVideoTrack.h:443
int height
Definition: NGIAgoraVideoTrack.h:409
Definition: NGIAgoraVideoTrack.h:107
void reset()
Definition: NGIAgoraVideoTrack.h:111
bool operator==(const SimulcastConfigInternal &rhs) const
Definition: NGIAgoraVideoTrack.h:117
StreamLayerConfigInternal simulcastlayerConfigs[STREAM_LAYER_COUNT_MAX]
Definition: NGIAgoraVideoTrack.h:109
Definition: NGIAgoraVideoTrack.h:65
bool enable
Definition: NGIAgoraVideoTrack.h:83
int framerate
Definition: NGIAgoraVideoTrack.h:73
bool operator==(const StreamLayerConfigInternal &rhs) const
Definition: NGIAgoraVideoTrack.h:86
StreamLayerConfigInternal(const StreamLayerConfigInternal &other)
Definition: NGIAgoraVideoTrack.h:85
VideoDimensions dimensions
Definition: NGIAgoraVideoTrack.h:69
void reset()
Definition: NGIAgoraVideoTrack.h:97
int bitrate_kbps
Definition: NGIAgoraVideoTrack.h:77
StreamLayerConfigInternal()
Definition: NGIAgoraVideoTrack.h:84
StreamLayerConfigInternal & operator=(const SimulcastConfig::StreamLayerConfig &slc)
Definition: NGIAgoraVideoTrack.h:90
Definition: AgoraBase.h:1500
int height
Definition: AgoraBase.h:1508
int width
Definition: AgoraBase.h:1504
Definition: AgoraBase.h:1998
Definition: AgoraBase.h:3015