codecs: vp9decoder: Pass GstVideoCodecFrame to duplicate_picture()
... and fix picture duplication logic for vavp9dec Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
This commit is contained in:
parent
1f769839c0
commit
6eb9856f59
@ -95,7 +95,7 @@ static GstFlowReturn gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||||||
GstVideoCodecFrame * frame);
|
GstVideoCodecFrame * frame);
|
||||||
|
|
||||||
static GstVp9Picture *gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder *
|
static GstVp9Picture *gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder *
|
||||||
decoder, GstVp9Picture * picture);
|
decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_vp9_decoder_class_init (GstVp9DecoderClass * klass)
|
gst_vp9_decoder_class_init (GstVp9DecoderClass * klass)
|
||||||
@ -247,7 +247,7 @@ gst_vp9_decoder_drain (GstVideoDecoder * decoder)
|
|||||||
|
|
||||||
static GstVp9Picture *
|
static GstVp9Picture *
|
||||||
gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder * decoder,
|
gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder * decoder,
|
||||||
GstVp9Picture * picture)
|
GstVideoCodecFrame * frame, GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
GstVp9Picture *new_picture;
|
GstVp9Picture *new_picture;
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||||||
|
|
||||||
g_assert (klass->duplicate_picture);
|
g_assert (klass->duplicate_picture);
|
||||||
pic_to_dup = priv->dpb->pic_list[frame_hdr.frame_to_show_map_idx];
|
pic_to_dup = priv->dpb->pic_list[frame_hdr.frame_to_show_map_idx];
|
||||||
picture = klass->duplicate_picture (self, pic_to_dup);
|
picture = klass->duplicate_picture (self, frame, pic_to_dup);
|
||||||
|
|
||||||
if (!picture) {
|
if (!picture) {
|
||||||
GST_ERROR_OBJECT (self, "subclass didn't provide duplicated picture");
|
GST_ERROR_OBJECT (self, "subclass didn't provide duplicated picture");
|
||||||
|
@ -100,6 +100,7 @@ struct _GstVp9DecoderClass
|
|||||||
GstVp9Picture * picture);
|
GstVp9Picture * picture);
|
||||||
|
|
||||||
GstVp9Picture * (*duplicate_picture) (GstVp9Decoder * decoder,
|
GstVp9Picture * (*duplicate_picture) (GstVp9Decoder * decoder,
|
||||||
|
GstVideoCodecFrame * frame,
|
||||||
GstVp9Picture * picture);
|
GstVp9Picture * picture);
|
||||||
|
|
||||||
gboolean (*start_picture) (GstVp9Decoder * decoder,
|
gboolean (*start_picture) (GstVp9Decoder * decoder,
|
||||||
|
@ -141,7 +141,7 @@ static gboolean gst_d3d11_vp9_dec_new_sequence (GstVp9Decoder * decoder,
|
|||||||
static gboolean gst_d3d11_vp9_dec_new_picture (GstVp9Decoder * decoder,
|
static gboolean gst_d3d11_vp9_dec_new_picture (GstVp9Decoder * decoder,
|
||||||
GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
static GstVp9Picture *gst_d3d11_vp9_dec_duplicate_picture (GstVp9Decoder *
|
static GstVp9Picture *gst_d3d11_vp9_dec_duplicate_picture (GstVp9Decoder *
|
||||||
decoder, GstVp9Picture * picture);
|
decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
static GstFlowReturn gst_d3d11_vp9_dec_output_picture (GstVp9Decoder *
|
static GstFlowReturn gst_d3d11_vp9_dec_output_picture (GstVp9Decoder *
|
||||||
decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
static gboolean gst_d3d11_vp9_dec_start_picture (GstVp9Decoder * decoder,
|
static gboolean gst_d3d11_vp9_dec_start_picture (GstVp9Decoder * decoder,
|
||||||
@ -418,7 +418,7 @@ gst_d3d11_vp9_dec_new_picture (GstVp9Decoder * decoder,
|
|||||||
|
|
||||||
static GstVp9Picture *
|
static GstVp9Picture *
|
||||||
gst_d3d11_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
gst_d3d11_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
||||||
GstVp9Picture * picture)
|
GstVideoCodecFrame * frame, GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
GstD3D11Vp9Dec *self = GST_D3D11_VP9_DEC (decoder);
|
GstD3D11Vp9Dec *self = GST_D3D11_VP9_DEC (decoder);
|
||||||
GstBuffer *view_buffer;
|
GstBuffer *view_buffer;
|
||||||
|
@ -78,7 +78,7 @@ static gboolean gst_nv_vp9_dec_new_sequence (GstVp9Decoder * decoder,
|
|||||||
static gboolean gst_nv_vp9_dec_new_picture (GstVp9Decoder * decoder,
|
static gboolean gst_nv_vp9_dec_new_picture (GstVp9Decoder * decoder,
|
||||||
GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
static GstVp9Picture *gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder *
|
static GstVp9Picture *gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder *
|
||||||
decoder, GstVp9Picture * picture);
|
decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture);
|
||||||
static gboolean gst_nv_vp9_dec_decode_picture (GstVp9Decoder * decoder,
|
static gboolean gst_nv_vp9_dec_decode_picture (GstVp9Decoder * decoder,
|
||||||
GstVp9Picture * picture, GstVp9Dpb * dpb);
|
GstVp9Picture * picture, GstVp9Dpb * dpb);
|
||||||
static GstFlowReturn gst_nv_vp9_dec_output_picture (GstVp9Decoder *
|
static GstFlowReturn gst_nv_vp9_dec_output_picture (GstVp9Decoder *
|
||||||
@ -315,15 +315,15 @@ gst_nv_vp9_dec_get_decoder_frame_from_picture (GstNvVp9Dec * self,
|
|||||||
|
|
||||||
static GstVp9Picture *
|
static GstVp9Picture *
|
||||||
gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
||||||
GstVp9Picture * picture)
|
GstVideoCodecFrame * frame, GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
GstNvVp9Dec *self = GST_NV_VP9_DEC (decoder);
|
GstNvVp9Dec *self = GST_NV_VP9_DEC (decoder);
|
||||||
GstNvDecoderFrame *frame;
|
GstNvDecoderFrame *nv_frame;
|
||||||
GstVp9Picture *new_picture;
|
GstVp9Picture *new_picture;
|
||||||
|
|
||||||
frame = gst_nv_vp9_dec_get_decoder_frame_from_picture (self, picture);
|
nv_frame = gst_nv_vp9_dec_get_decoder_frame_from_picture (self, picture);
|
||||||
|
|
||||||
if (!frame) {
|
if (!nv_frame) {
|
||||||
GST_ERROR_OBJECT (self, "Parent picture does not have decoder frame");
|
GST_ERROR_OBJECT (self, "Parent picture does not have decoder frame");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@ gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
|||||||
new_picture->frame_hdr = picture->frame_hdr;
|
new_picture->frame_hdr = picture->frame_hdr;
|
||||||
|
|
||||||
gst_vp9_picture_set_user_data (new_picture,
|
gst_vp9_picture_set_user_data (new_picture,
|
||||||
gst_nv_decoder_frame_ref (frame),
|
gst_nv_decoder_frame_ref (nv_frame),
|
||||||
(GDestroyNotify) gst_nv_decoder_frame_unref);
|
(GDestroyNotify) gst_nv_decoder_frame_unref);
|
||||||
|
|
||||||
return new_picture;
|
return new_picture;
|
||||||
|
@ -458,7 +458,7 @@ gst_va_vp9_dec_output_picture (GstVp9Decoder * decoder,
|
|||||||
|
|
||||||
static GstVp9Picture *
|
static GstVp9Picture *
|
||||||
gst_va_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
gst_va_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
||||||
GstVp9Picture * picture)
|
GstVideoCodecFrame * frame, GstVp9Picture * picture)
|
||||||
{
|
{
|
||||||
GstVaDecodePicture *va_pic, *va_dup;
|
GstVaDecodePicture *va_pic, *va_dup;
|
||||||
GstVp9Picture *new_picture;
|
GstVp9Picture *new_picture;
|
||||||
@ -469,6 +469,8 @@ gst_va_vp9_dec_duplicate_picture (GstVp9Decoder * decoder,
|
|||||||
new_picture = gst_vp9_picture_new ();
|
new_picture = gst_vp9_picture_new ();
|
||||||
new_picture->frame_hdr = picture->frame_hdr;
|
new_picture->frame_hdr = picture->frame_hdr;
|
||||||
|
|
||||||
|
frame->output_buffer = gst_buffer_ref (va_dup->gstbuffer);
|
||||||
|
|
||||||
gst_vp9_picture_set_user_data (picture, va_dup,
|
gst_vp9_picture_set_user_data (picture, va_dup,
|
||||||
(GDestroyNotify) gst_va_decode_picture_free);
|
(GDestroyNotify) gst_va_decode_picture_free);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user