diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index 207d99a6c7..6391c9da97 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -238,6 +238,7 @@ gst_vaapi_picture_h264_create( if (!gst_vaapi_picture_create(GST_VAAPI_PICTURE(picture), args)) return FALSE; + picture->structure = picture->base.structure; picture->field_poc[0] = G_MAXINT32; picture->field_poc[1] = G_MAXINT32; picture->output_needed = FALSE; diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index 11dca0047c..25d0ebe310 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -244,6 +244,7 @@ gst_vaapi_picture_h265_create (GstVaapiPictureH265 * picture, if (!gst_vaapi_picture_create (GST_VAAPI_PICTURE (picture), args)) return FALSE; + picture->structure = picture->base.structure; picture->poc = G_MAXINT32; picture->output_needed = FALSE; return TRUE; diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c index c8cbfbe31a..eb773b039a 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ -114,6 +114,7 @@ gst_vaapi_picture_create (GstVaapiPicture * picture, GST_VAAPI_PICTURE_FLAG_REFERENCE | GST_VAAPI_PICTURE_FLAG_INTERLACED | GST_VAAPI_PICTURE_FLAG_FF | GST_VAAPI_PICTURE_FLAG_TFF | + GST_VAAPI_PICTURE_FLAG_ONEFIELD | GST_VAAPI_PICTURE_FLAG_RFF | GST_VAAPI_PICTURE_FLAG_MVC)); picture->structure = parent_picture->structure; @@ -196,6 +197,21 @@ gst_vaapi_picture_new_field (GstVaapiPicture * picture) return GST_VAAPI_PICTURE_CAST (object); } +GstVaapiPicture * +gst_vaapi_picture_new_clone (GstVaapiPicture * picture) +{ + GstVaapiDecoder *const decoder = GET_DECODER (picture); + GstVaapiCodecObject *object; + + object = gst_vaapi_codec_object_new (gst_vaapi_codec_object_get_class + (&picture->parent_instance), GST_VAAPI_CODEC_BASE (decoder), NULL, + picture->param_size, picture, 0, + GST_VAAPI_CREATE_PICTURE_FLAG_CLONE); + if (!object) + return NULL; + return GST_VAAPI_PICTURE_CAST (object); +} + void gst_vaapi_picture_add_slice (GstVaapiPicture * picture, GstVaapiSlice * slice) { diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h index 9edb449634..c9b0dfd48c 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_objects.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_objects.h @@ -178,6 +178,10 @@ G_GNUC_INTERNAL GstVaapiPicture * gst_vaapi_picture_new_field (GstVaapiPicture * picture); +G_GNUC_INTERNAL +GstVaapiPicture * +gst_vaapi_picture_new_clone (GstVaapiPicture * picture); + G_GNUC_INTERNAL void gst_vaapi_picture_add_slice (GstVaapiPicture * picture, GstVaapiSlice * slice);