Data Fields
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_track | A PP_Resource corresponding to a MediaStream video track resource. |
Configures underlying frame buffers for incoming frames.
If the application doesn't want to drop frames, then the PP_MEDIASTREAMVIDEOTRACK_ATTRIB_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 some attributes are not specified, default values will be used for those unspecified attributes. If Configure()
is not called, default settings will be used. Example usage from plugin code:
- Parameters:
-
[in] | video_track | A PP_Resource corresponding to a video resource. |
[in] | attrib_list | A list of attribute name-value pairs in which each attribute is immediately followed by the corresponding desired value. The list is terminated by PP_MEDIASTREAMVIDEOTRACK_ATTRIB_NONE . |
[in] | callback | PP_CompletionCallback to be called upon completion of Configure() . |
- Returns:
- An int32_t containing a result code from
pp_errors.h
. Returns PP_ERROR_INPROGRESS
if there is a pending call of Configure()
or GetFrame()
, or the plugin holds some frames which are not recycled with RecycleFrame()
. If an error is returned, all attributes and the underlying buffer will not be changed.
Gets attribute value for a given attribute name.
- Parameters:
-
[in] | video_track | A PP_Resource corresponding to a video resource. |
[in] | attrib | A PP_MediaStreamVideoTrack_Attrib for querying. |
[out] | value | A int32_t for storing the attribute value on success. Otherwise, the value will not be changed. |
- Returns:
- An int32_t containing a result code from
pp_errors.h
.
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_track | A PP_Resource corresponding to a video resource. |
[out] | frame | A PP_Resource corresponding to a VideoFrame resource. |
[in] | callback | A 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.
Returns the track ID of the underlying MediaStream video track.
- Parameters:
-
[in] | video_track | The 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_track | The 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] | resource | The 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_track | A PP_Resource corresponding to a video resource. |
[in] | frame | A 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: