Commit 1790823e authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

decoder: make gst_vaapi_decoder_get_codec_state() return the original state.

Make gst_vaapi_decoder_get_codec_state() return the original codec state,
i.e. make the GstVaapiDecoder object own the return state so that callers
that want an extra reference to it would just gst_video_codec_state_ref()
it before usage. This aligns the behaviour with what we had before with
gst_vaapi_decoder_get_caps().

This is an ABI incompatible change, library major version was bumped from
previous release (0.5.2).
parent 55b3053b
......@@ -612,9 +612,9 @@ gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder)
* gst_vaapi_decoder_get_codec_state:
* @decoder: a #GstVaapiDecoder
*
* Retrieves the @decoder codec state. The caller owns an extra reference
* to the #GstVideoCodecState, so gst_video_codec_state_unref() shall be
* called after usage.
* Retrieves the @decoder codec state. The decoder owns the returned
* #GstVideoCodecState structure, so use gst_video_codec_state_ref()
* whenever necessary.
*
* Return value: the #GstVideoCodecState object for @decoder
*/
......@@ -630,7 +630,7 @@ gst_vaapi_decoder_get_codec_state(GstVaapiDecoder *decoder)
* gst_vaapi_decoder_get_caps:
* @decoder: a #GstVaapiDecoder
*
* Retrieves the @decoder caps. The deocder owns the returned caps, so
* Retrieves the @decoder caps. The decoder owns the returned caps, so
* use gst_caps_ref() whenever necessary.
*
* Return value: the @decoder caps
......
......@@ -136,13 +136,11 @@ static void
gst_vaapi_decoder_notify_caps(GObject *obj, GParamSpec *pspec, void *user_data)
{
GstVaapiDecode * const decode = GST_VAAPIDECODE(user_data);
GstVideoCodecState *codec_state;
g_assert(decode->decoder == GST_VAAPI_DECODER(obj));
codec_state = gst_vaapi_decoder_get_codec_state(decode->decoder);
gst_vaapidecode_update_src_caps(decode, codec_state);
gst_video_codec_state_unref(codec_state);
gst_vaapidecode_update_src_caps(decode,
gst_vaapi_decoder_get_codec_state(decode->decoder));
}
static inline gboolean
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment