![]() |
![]() |
![]() |
GStreamer VA-API Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum GstVaapiDecoderStatus; GstVaapiDecoder; GstCaps * gst_vaapi_decoder_get_caps (GstVaapiDecoder *decoder
); GstVaapiCodec gst_vaapi_decoder_get_codec (GstVaapiDecoder *decoder
); GstVideoCodecState * gst_vaapi_decoder_get_codec_state (GstVaapiDecoder *decoder
); gboolean gst_vaapi_decoder_put_buffer (GstVaapiDecoder *decoder
,GstBuffer *buf
); GstVaapiDecoderStatus gst_vaapi_decoder_get_surface (GstVaapiDecoder *decoder
,GstVaapiSurfaceProxy **out_proxy_ptr
); GstVaapiDecoderStatus gst_vaapi_decoder_get_frame (GstVaapiDecoder *decoder
,GstVideoCodecFrame **out_frame_ptr
); GstVaapiDecoderStatus gst_vaapi_decoder_get_frame_with_timeout (GstVaapiDecoder *decoder
,GstVideoCodecFrame **out_frame_ptr
,guint64 timeout
); GstVaapiDecoderStatus gst_vaapi_decoder_parse (GstVaapiDecoder *decoder
,GstVideoCodecFrame *frame
,GstAdapter *adapter
,gboolean at_eos
,guint *got_unit_size_ptr
,gboolean *got_frame_ptr
); GstVaapiDecoderStatus gst_vaapi_decoder_decode (GstVaapiDecoder *decoder
,GstVideoCodecFrame *frame
);
typedef enum { GST_VAAPI_DECODER_STATUS_SUCCESS = 0, GST_VAAPI_DECODER_STATUS_END_OF_STREAM, GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED, GST_VAAPI_DECODER_STATUS_ERROR_INIT_FAILED, GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC, GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA, GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE, GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER, GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE, GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT, GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER, GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN = -1 } GstVaapiDecoderStatus;
Decoder status for gst_vaapi_decoder_get_surface()
.
Success. | |
End-Of-Stream. | |
No memory left. | |
Decoder initialization failure. | |
Unsupported codec. | |
Not enough input data to decode. | |
No surface left to hold the decoded picture. | |
Invalid surface. | |
Invalid or unsupported bitstream data. | |
Unsupported codec profile. | |
Unsupported chroma format. | |
Unsupported parameter. | |
Unknown error. |
GstCaps * gst_vaapi_decoder_get_caps (GstVaapiDecoder *decoder
);
Retrieves the decoder
caps. The decoder owns the returned caps, so
use gst_caps_ref()
whenever necessary.
|
a GstVaapiDecoder |
Returns : |
the decoder caps |
GstVaapiCodec gst_vaapi_decoder_get_codec (GstVaapiDecoder *decoder
);
Retrieves the decoder
codec type.
|
a GstVaapiDecoder |
Returns : |
the GstVaapiCodec type for decoder
|
GstVideoCodecState * gst_vaapi_decoder_get_codec_state (GstVaapiDecoder *decoder
);
Retrieves the decoder
codec state. The decoder owns the returned
GstVideoCodecState structure, so use gst_video_codec_state_ref()
whenever necessary.
|
a GstVaapiDecoder |
Returns : |
the GstVideoCodecState object for decoder
|
gboolean gst_vaapi_decoder_put_buffer (GstVaapiDecoder *decoder
,GstBuffer *buf
);
Queues a GstBuffer to the HW decoder. The decoder holds a
reference to buf
.
Caller can notify an End-Of-Stream with buf
set to NULL
. However,
if an empty buffer is passed, i.e. a buffer with NULL
data pointer
or size equals to zero, then the function ignores this buffer and
returns TRUE
.
|
a GstVaapiDecoder |
|
a GstBuffer |
Returns : |
TRUE on success |
GstVaapiDecoderStatus gst_vaapi_decoder_get_surface (GstVaapiDecoder *decoder
,GstVaapiSurfaceProxy **out_proxy_ptr
);
Flushes encoded buffers to the decoder and returns a decoded surface, if any.
On successful return, *out_proxy_ptr
contains the decoded surface
as a GstVaapiSurfaceProxy. The caller owns this object, so
gst_vaapi_surface_proxy_unref()
shall be called after usage.
|
a GstVaapiDecoder |
|
the next decoded surface as a GstVaapiSurfaceProxy |
Returns : |
a GstVaapiDecoderStatus |
GstVaapiDecoderStatus gst_vaapi_decoder_get_frame (GstVaapiDecoder *decoder
,GstVideoCodecFrame **out_frame_ptr
);
On successful return, *out_frame_ptr
contains the next decoded
frame available as a GstVideoCodecFrame. The caller owns this
object, so gst_video_codec_frame_unref()
shall be called after
usage. Otherwise, GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA
is
returned if no decoded frame is available.
The actual surface is available as a GstVaapiSurfaceProxy attached to the user-data anchor of the output frame. Ownership of the proxy is transferred to the frame.
This is equivalent to gst_vaapi_decoder_get_frame_with_timeout()
with a timeout value of zero.
|
a GstVaapiDecoder |
|
the next decoded frame as a GstVideoCodecFrame |
Returns : |
a GstVaapiDecoderStatus |
GstVaapiDecoderStatus gst_vaapi_decoder_get_frame_with_timeout (GstVaapiDecoder *decoder
,GstVideoCodecFrame **out_frame_ptr
,guint64 timeout
);
On successful return, *out_frame_ptr
contains the next decoded
frame available as a GstVideoCodecFrame. The caller owns this
object, so gst_video_codec_frame_unref()
shall be called after
usage. Otherwise, GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA
is
returned if no decoded frame is available.
The actual surface is available as a GstVaapiSurfaceProxy attached to the user-data anchor of the output frame. Ownership of the proxy is transferred to the frame.
|
a GstVaapiDecoder |
|
the next decoded frame as a GstVideoCodecFrame |
|
the number of microseconds to wait for the frame, at most |
Returns : |
a GstVaapiDecoderStatus |
GstVaapiDecoderStatus gst_vaapi_decoder_parse (GstVaapiDecoder *decoder
,GstVideoCodecFrame *frame
,GstAdapter *adapter
,gboolean at_eos
,guint *got_unit_size_ptr
,gboolean *got_frame_ptr
);
GstVaapiDecoderStatus gst_vaapi_decoder_decode (GstVaapiDecoder *decoder
,GstVideoCodecFrame *frame
);