decoder: fix semantics of SKIPPED pictures.

If GstVaapiPicture has flag SKIPPED set, this means gst_vaapi_picture_output()
will not push the underlying surface for rendering. Besides, VC-1 skipped P-frame
has nothing to do with rendering. This only means that the currently decoded
picture is just a copy of its reference picture.
This commit is contained in:
Gwenole Beauchesne 2012-03-28 14:24:40 +02:00
parent b98d334dce
commit a7ec623279
3 changed files with 8 additions and 5 deletions

View file

@ -250,9 +250,11 @@ gst_vaapi_picture_output(GstVaapiPicture *picture)
if (!picture->proxy)
return FALSE;
proxy = g_object_ref(picture->proxy);
gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts);
gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), proxy);
if (!GST_VAAPI_PICTURE_IS_SKIPPED(picture)) {
proxy = g_object_ref(picture->proxy);
gst_vaapi_surface_proxy_set_timestamp(proxy, picture->pts);
gst_vaapi_decoder_push_surface_proxy(GET_DECODER(picture), proxy);
}
return TRUE;
}

View file

@ -101,6 +101,9 @@ enum {
#define GST_VAAPI_PICTURE_FLAG_SET GST_MINI_OBJECT_FLAG_SET
#define GST_VAAPI_PICTURE_FLAG_UNSET GST_MINI_OBJECT_FLAG_UNSET
#define GST_VAAPI_PICTURE_IS_SKIPPED(picture) \
GST_VAAPI_PICTURE_FLAG_IS_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED)
#define GST_VAAPI_PICTURE_IS_REFERENCE(picture) \
GST_VAAPI_PICTURE_FLAG_IS_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE)

View file

@ -933,8 +933,6 @@ decode_frame(GstVaapiDecoderVC1 *decoder, GstVC1BDU *rbdu, GstVC1BDU *ebdu)
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE);
break;
case GST_VC1_PICTURE_TYPE_SKIPPED:
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_SKIPPED);
// fall-through
case GST_VC1_PICTURE_TYPE_P:
picture->type = GST_VAAPI_PICTURE_TYPE_P;
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_REFERENCE);