{{+bindTo:partials.standard_nacl_article}}

PPB_MediaStreamVideoTrack Struct Reference

Data Fields

PP_Bool(* IsMediaStreamVideoTrack )(PP_Resource resource)
int32_t(* Configure )(PP_Resource video_track, uint32_t max_buffered_frames)
struct PP_Var(* GetId )(PP_Resource video_track)
PP_Bool(* HasEnded )(PP_Resource video_track)
int32_t(* GetFrame )(PP_Resource video_track, PP_Resource *frame, struct PP_CompletionCallback callback)
int32_t(* RecycleFrame )(PP_Resource video_track, PP_Resource frame)
void(* Close )(PP_Resource video_track)

Field Documentation

Closes the MediaStream video track and disconnects it from video source.

After calling Close(), no new frames will be received.

Parameters:
[in]video_trackA PP_Resource corresponding to a MediaStream video track resource.
int32_t(* PPB_MediaStreamVideoTrack::Configure)(PP_Resource video_track, uint32_t max_buffered_frames)

Configures underlying frame buffers for incoming frames.

If the application doesn't want to drop frames, then the max_buffered_frames should be chosen such that inter-frame processing time variability won't overrun the input buffer. If the buffer is overfilled, then frames will be dropped. The application can detect this by examining the timestamp on returned frames. If Configure() is not used, default settings will be used.

Parameters:
[in]video_trackA PP_Resource corresponding to a video resource.
[in]max_buffered_framesThe maximum number of video frames to hold in the input buffer.
Returns:
An int32_t containing a result code from pp_errors.h.
int32_t(* PPB_MediaStreamVideoTrack::GetFrame)(PP_Resource video_track, PP_Resource *frame, struct PP_CompletionCallback callback)

Gets the next video frame from the MediaStream track.

If internal processing is slower than the incoming frame rate, new frames will be dropped from the incoming stream. Once the input buffer is full, frames will be dropped until RecycleFrame() is called to free a spot for another frame to be buffered. If there are no frames in the input buffer, PP_OK_COMPLETIONPENDING will be returned immediately and the callback will be called when a new frame is received or an error happens.

Parameters:
[in]video_trackA PP_Resource corresponding to a video resource.
[out]frameA PP_Resource corresponding to a VideoFrame resource.
[in]callbackA PP_CompletionCallback to be called upon completion of GetFrame().
Returns:
An int32_t containing a result code from pp_errors.h. Returns PP_ERROR_NOMEMORY if max_buffered_frames frames buffer was not allocated successfully.
struct PP_Var(* PPB_MediaStreamVideoTrack::GetId)(PP_Resource video_track) [read]

Returns the track ID of the underlying MediaStream video track.

Parameters:
[in]video_trackThe PP_Resource to check.
Returns:
A PP_Var containing the MediaStream track ID as a string.

Checks whether the underlying MediaStream track has ended.

Calls to GetFrame while the track has ended are safe to make and will complete, but will fail.

Parameters:
[in]video_trackThe PP_Resource to check.
Returns:
A PP_Bool with PP_TRUE if the given MediaStream track has ended or PP_FALSE otherwise.

Determines if a resource is a MediaStream video track resource.

Parameters:
[in]resourceThe PP_Resource to test.
Returns:
A PP_Bool with PP_TRUE if the given resource is a Mediastream video track resource or PP_FALSE otherwise.

Recycles a frame returned by GetFrame(), so the track can reuse the underlying buffer of this frame.

And the frame will become invalid. The caller should release all references it holds to frame and not use it anymore.

Parameters:
[in]video_trackA PP_Resource corresponding to a video resource.
[in]frameA PP_Resource corresponding to a VideoFrame resource returned by GetFrame().
Returns:
An int32_t containing a result code from pp_errors.h.

The documentation for this struct was generated from the following file:
{{/partials.standard_nacl_article}}