h264picture: Add system_frame_num
This allow cross-referencing GstH264Picture and GstVideoCodecFrame.
This commit is contained in:
parent
2b9ffa8f54
commit
56c3b40c30
@ -661,6 +661,8 @@ gst_h264_decoder_parse_slice (GstH264Decoder * self, GstH264NalUnit * nalu,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This allows accessing the frame from the picture. */
|
||||||
|
picture->system_frame_number = priv->current_frame->system_frame_number;
|
||||||
priv->current_picture = picture;
|
priv->current_picture = picture;
|
||||||
gst_video_codec_frame_set_user_data (priv->current_frame,
|
gst_video_codec_frame_set_user_data (priv->current_frame,
|
||||||
gst_h264_picture_ref (priv->current_picture),
|
gst_h264_picture_ref (priv->current_picture),
|
||||||
|
@ -58,6 +58,8 @@ struct _GstH264Picture
|
|||||||
GstH264SliceType type;
|
GstH264SliceType type;
|
||||||
|
|
||||||
GstClockTime pts;
|
GstClockTime pts;
|
||||||
|
/* From GstVideoCodecFrame */
|
||||||
|
guint32 system_frame_number;
|
||||||
|
|
||||||
guint8 pic_order_cnt_type; /* SPS */
|
guint8 pic_order_cnt_type; /* SPS */
|
||||||
gint32 top_field_order_cnt;
|
gint32 top_field_order_cnt;
|
||||||
|
@ -392,6 +392,8 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This allows accessing the frame from the picture. */
|
||||||
|
picture->system_frame_number = priv->current_frame->system_frame_number;
|
||||||
priv->current_picture = picture;
|
priv->current_picture = picture;
|
||||||
gst_video_codec_frame_set_user_data (priv->current_frame,
|
gst_video_codec_frame_set_user_data (priv->current_frame,
|
||||||
gst_h265_picture_ref (priv->current_picture),
|
gst_h265_picture_ref (priv->current_picture),
|
||||||
|
@ -64,6 +64,8 @@ struct _GstH265Picture
|
|||||||
GstH265SliceType type;
|
GstH265SliceType type;
|
||||||
|
|
||||||
GstClockTime pts;
|
GstClockTime pts;
|
||||||
|
/* From GstVideoCodecFrame */
|
||||||
|
guint32 system_frame_number;
|
||||||
|
|
||||||
gint pic_order_cnt;
|
gint pic_order_cnt;
|
||||||
gint pic_order_cnt_msb;
|
gint pic_order_cnt_msb;
|
||||||
|
@ -396,6 +396,15 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||||||
picture->subsampling_y = priv->parser->subsampling_y;
|
picture->subsampling_y = priv->parser->subsampling_y;
|
||||||
picture->bit_depth = priv->parser->bit_depth;
|
picture->bit_depth = priv->parser->bit_depth;
|
||||||
|
|
||||||
|
if (i == frame_idx_to_consume) {
|
||||||
|
/* This allows accessing the frame from the picture. */
|
||||||
|
picture->system_frame_number = frame->system_frame_number;
|
||||||
|
gst_video_codec_frame_set_user_data (frame,
|
||||||
|
gst_vp9_picture_ref (picture),
|
||||||
|
(GDestroyNotify) gst_vp9_picture_unref);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (klass->new_picture) {
|
if (klass->new_picture) {
|
||||||
if (!klass->new_picture (self, picture)) {
|
if (!klass->new_picture (self, picture)) {
|
||||||
GST_ERROR_OBJECT (self, "new picture error");
|
GST_ERROR_OBJECT (self, "new picture error");
|
||||||
@ -424,12 +433,6 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == frame_idx_to_consume) {
|
|
||||||
gst_video_codec_frame_set_user_data (frame,
|
|
||||||
gst_vp9_picture_ref (picture),
|
|
||||||
(GDestroyNotify) gst_vp9_picture_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (klass->output_picture)
|
if (klass->output_picture)
|
||||||
ret = klass->output_picture (self, picture);
|
ret = klass->output_picture (self, picture);
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ struct _GstVp9Picture
|
|||||||
GstMiniObject parent;
|
GstMiniObject parent;
|
||||||
|
|
||||||
GstClockTime pts;
|
GstClockTime pts;
|
||||||
|
/* From GstVideoCodecFrame */
|
||||||
|
guint32 system_frame_number;
|
||||||
|
|
||||||
GstVp9FrameHdr frame_hdr;
|
GstVp9FrameHdr frame_hdr;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user