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).
This commit is contained in:
Gwenole Beauchesne 2013-04-15 13:58:58 +02:00
parent 55b3053b88
commit 1790823ed4
2 changed files with 6 additions and 8 deletions

View file

@ -612,9 +612,9 @@ gst_vaapi_decoder_get_codec(GstVaapiDecoder *decoder)
* gst_vaapi_decoder_get_codec_state: * gst_vaapi_decoder_get_codec_state:
* @decoder: a #GstVaapiDecoder * @decoder: a #GstVaapiDecoder
* *
* Retrieves the @decoder codec state. The caller owns an extra reference * Retrieves the @decoder codec state. The decoder owns the returned
* to the #GstVideoCodecState, so gst_video_codec_state_unref() shall be * #GstVideoCodecState structure, so use gst_video_codec_state_ref()
* called after usage. * whenever necessary.
* *
* Return value: the #GstVideoCodecState object for @decoder * Return value: the #GstVideoCodecState object for @decoder
*/ */
@ -630,7 +630,7 @@ gst_vaapi_decoder_get_codec_state(GstVaapiDecoder *decoder)
* gst_vaapi_decoder_get_caps: * gst_vaapi_decoder_get_caps:
* @decoder: a #GstVaapiDecoder * @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. * use gst_caps_ref() whenever necessary.
* *
* Return value: the @decoder caps * Return value: the @decoder caps

View file

@ -136,13 +136,11 @@ static void
gst_vaapi_decoder_notify_caps(GObject *obj, GParamSpec *pspec, void *user_data) gst_vaapi_decoder_notify_caps(GObject *obj, GParamSpec *pspec, void *user_data)
{ {
GstVaapiDecode * const decode = GST_VAAPIDECODE(user_data); GstVaapiDecode * const decode = GST_VAAPIDECODE(user_data);
GstVideoCodecState *codec_state;
g_assert(decode->decoder == GST_VAAPI_DECODER(obj)); g_assert(decode->decoder == GST_VAAPI_DECODER(obj));
codec_state = gst_vaapi_decoder_get_codec_state(decode->decoder); gst_vaapidecode_update_src_caps(decode,
gst_vaapidecode_update_src_caps(decode, codec_state); gst_vaapi_decoder_get_codec_state(decode->decoder));
gst_video_codec_state_unref(codec_state);
} }
static inline gboolean static inline gboolean