Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
agora::rtc::ILocalVideoTrack Class Referenceabstract

`#include <NGIAgoraVideoTrack.h>`

Inherits agora::rtc::IVideoTrack.

Inherited by agora::rtc::ILocalVideoTrackEx.

## Public Member Functions
virtual int | setEnabled (bool enable, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | setVideoEncoderConfiguration (const VideoEncoderConfiguration &config, 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
virtual LOCAL_VIDEO_STREAM_STATE | getState ()=0
virtual bool | getStatistics (LocalVideoTrackStats &stats)=0
virtual VideoTrackType | getType () OPTIONAL_OVERRIDE
Public Member Functions inherited from agora::rtc::IVideoTrack
virtual bool | addVideoFilter (agora_refptr< IVideoFilter > filter, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER, const char *id=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool | removeVideoFilter (agora_refptr< IVideoFilter > filter, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER, const char *id=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool | hasVideoFilter (const char *id, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER)=0
virtual bool | addRenderer (agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool | removeRenderer (agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | enableVideoFilter (const char *id, bool enable, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | setFilterProperty (const char *id, const char *key, const char *json_value, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | getFilterProperty (const char *id, const char *key, char *json_value, size_t buf_size, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | registerVideoEncodedFrameObserver (agora::media::IVideoEncodedFrameObserver *encodedObserver, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | unregisterVideoEncodedFrameObserver (agora::media::IVideoEncodedFrameObserver *encodedObserver)
Public Member Functions inherited from agora::RefCountInterface
virtual void | AddRef () const =0
virtual RefCountReleaseStatus | Release () const =0
virtual bool | HasOneRef () const =0

## Protected Member Functions
| ~ILocalVideoTrack ()
Protected Member Functions inherited from agora::rtc::IVideoTrack
| ~IVideoTrack ()
Protected Member Functions inherited from agora::RefCountInterface
virtual | ~RefCountInterface ()

## Detailed Description

`ILocalVideoTrack` is the basic class for local video tracks, providing the main methods of local video tracks. You can create a local video track by calling one of the following methods:

- `createCameraVideoTrack`
- `createScreenVideoTrack`
- `createMixedVideoTrack`
- `createCustomVideoTrack`
- `createMediaPlayerVideoTrack`

After creating local video tracks, you can publish one or more local video tracks by calling publishVideo.

## Constructor & Destructor Documentation

## ◆ ~ILocalVideoTrack()

agora::rtc::ILocalVideoTrack::~ILocalVideoTrack | ( |  | ) |
| inlineprotected

## Member Function Documentation

## ◆ setEnabled()

virtual int agora::rtc::ILocalVideoTrack::setEnabled | ( | bool | enable,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Enables or disables the local video track.

Once the local video track is enabled, the SDK allows for local video capturing, processing, and encoding.

Parameters

  enable | Determines whether to enable the local video track. `true`: Enable the local video track. `false`: Disable the local video track.

## ◆ setVideoEncoderConfiguration()

virtual int agora::rtc::ILocalVideoTrack::setVideoEncoderConfiguration | ( | const VideoEncoderConfiguration & | config,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Sets the video encoder configuration.

Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation.

The configurations specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the configurations further down the list are considered until a successful configuration is found.

Parameters

  config | The reference to the video encoder configuration. See VideoEncoderConfiguration.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setSimulcastStreamMode()

virtual int agora::rtc::ILocalVideoTrack::setSimulcastStreamMode | ( | SIMULCAST_STREAM_MODE | mode,
|  | const SimulcastConfigInternal & | config,
|  | aosl_ref_t | ares = AOSL_REF_INVALID )
| pure virtual

Set simulcast stream mode, enable, disable or auto enable

Parameters

  mode | Determines simulcast stream mode. See SIMULCAST_STREAM_MODE.
  config | The reference to the configurations for the simulcast stream mode. See SimulcastStreamConfig.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ getState()

virtual LOCAL_VIDEO_STREAM_STATE agora::rtc::ILocalVideoTrack::getState | ( |  | ) |
| pure virtual

Gets the state of the local video stream.

Returns
  The current state of the local video stream.

## ◆ getStatistics()

virtual bool agora::rtc::ILocalVideoTrack::getStatistics | ( | LocalVideoTrackStats & | stats | ) |
| pure virtual

Gets the statistics of the local video track.

Parameters

  [out] | stats | The reference to the statistics of the local video track.

Returns
  - `true`: Success.
  - `false`: Failure.

## ◆ getType()

virtual VideoTrackType agora::rtc::ILocalVideoTrack::getType | ( |  | ) |
| inlinevirtual

Get the track type of the video track

Returns
  - VideoTrackType

Implements agora::rtc::IVideoTrack.