Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraRtcMediaPlayerVideoFrameDelegate> Protocol Reference

Inherits <NSObject>.

Instance Methods

(void) - AgoraRtcMediaPlayer:didReceiveVideoFrame:
 
(void) - AgoraRtcMediaPlayer:didReceivePixelBuffer:
 
(AgoraVideoFormat- AgoraRtcMediaPlayerGetVideoPixelFormat
 

Method Documentation

◆ AgoraRtcMediaPlayer:didReceiveVideoFrame:

- (void) AgoraRtcMediaPlayer: (id< AgoraRtcMediaPlayerProtocol > _Nonnull)  playerKit
didReceiveVideoFrame: (AgoraOutputVideoFrame *_Nonnull)  videoFrame 
optional

Occurs each time the player receives a video frame.

After registering the video frame observer, the callback occurs every time the player receives a video frame, reporting the detailed information of the video frame.

Parameters
playerKitSee AgoraRtcMediaPlayerProtocol.
videoFrameVideo frame information. See AgoraOutputVideoFrame.

◆ AgoraRtcMediaPlayer:didReceivePixelBuffer:

- (void) AgoraRtcMediaPlayer: (id< AgoraRtcMediaPlayerProtocol > _Nonnull)  playerKit
didReceivePixelBuffer: (CVPixelBufferRef _Nonnull)  pixelBuffer 
optional

Occurs when the SDK gets the pixel buffer of the video source.

When the media player receives the pixel buffer of the video source, this callback is triggered to report the detailed information about the pixel buffer of type CVPixelBufferRef. You can use this information for image processing and analysis, custom rendering, etc.

Parameters
playerKitThe AgoraRtcMediaPlayerProtocol instance.
pixelBufferA CVPixelBufferRef object that contains detailed information about the pixel buffer.

◆ AgoraRtcMediaPlayerGetVideoPixelFormat

- (AgoraVideoFormat) AgoraRtcMediaPlayerGetVideoPixelFormat
optional

Sets the format of raw video data.

You need to register the callback when calling the setVideoFrameDelegate: method. This callback is triggered when the media player receives every video frame. You can set the desired video data format in the return value of this callback.

Returns
The desired format you set for the raw video data. See AgoraVideoFormat. By default, the original video pixel format ( AgoraVideoFormatDefault ) may be I420 or CVPixelBufferRef.