IVideoFrameObserver

更新时间:
复制 MD 格式

This topic describes the methods of the IVideoFrameObserver class provided by Real-Time Communication (RTC) SDK for Windows.

List of methods

Method Description Supported earliest version
OnCaptureVideoSample The callback that is invoked when the local video data is collected. V2.1
OnPreEncodeVideoSample The callback that is invoked before the local video data is encoded. V2.1
OnRemoteVideoSample The callback that is invoked when the remote video data is collected. V2.1
GetVideoFormatPreference The callback that is invoked when the remote video data in the specified format is collected. You can specify the format of the video data that is returned to the SDK. By default, the format is I420. V2.1
GetObservedFramePosition The callback that is invoked to process the output video data. For more information, see AliEngineVideoObserPosition. V2.1

Details of methods

  • OnCaptureVideoSample: the callback that is invoked when the local video data is collected. If a value of true is returned, the SDK obtains the video data. This takes effect only for the video data in the I420 format and for RTC SDK for iOS and macOS. If a value of false is returned, the SDK does not obtain the video data.
    bool OnCaptureVideoSample(AliEngineVideoSource videoSource, AliEngineVideoRawData &videoRawData);
    Parameter Type Description
    videoSource AliEngineVideoSource The type of the video source.
    videoRawData AliEngineVideoRawData & The raw video data.
  • OnPreEncodeVideoSample: the callback that is invoked when the local video data is prepared for encoding. If a value of true is returned, the SDK obtains the video data. This takes effect only for the video data in the I420 format and for RTC SDK for iOS and macOS. If a value of false is returned, the SDK does not obtain the video data.
    bool OnPreEncodeVideoSample(AliEngineVideoSource videoSource, AliEngineVideoRawData &videoRawData);
    Parameter Type Description
    videoSource AliEngineVideoSource The type of the video source.
    videoRawData AliEngineVideoRawData & The raw video data.
  • OnRemoteVideoSample: the callback that is invoked when the remote video data is collected. If a value of true is returned, the SDK obtains the video data. This takes effect only for the video data in the I420 format and for RTC SDK for iOS and macOS. If a value of false is returned, the SDK does not obtain the video data.
    bool OnRemoteVideoSample(const char *uid, AliEngineVideoSource videoSource, AliEngineVideoRawData &videoRawData);
    Parameter Type Description
    uid const char * The ID of the remote user.
    videoSource AliEngineVideoSource The type of the video source.
    videoSample AliEngineVideoRawData & The raw video data.
  • GetVideoFormatPreference: the callback that is invoked when the remote video data in the specified format is collected. You can specify the format of the video data that is returned to the SDK. By default, the format is I420.
    AliEngineVideoFormat GetVideoFormatPreference() { return AliEngineVideoFormatI420; };
  • GetObservedFramePosition: the callback that is invoked to process the output video data. For more information, see AliEngineVideoObserPosition.
    uint32_t GetObservedFramePosition() { return static_cast<uint32_t>(AliEnginePositionPostCapture  AliEnginePositionPreRender); };