mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
v4l2videoenc: set GstVideoCodecFrame sync point flag
The V4L2 elements already set the delta unit buffer flag when dequeueing the buffer, but gst_video_encoder_finish_frame overwrites it from the passed codec frame's sync point flag. Set the flag correctly.
This commit is contained in:
parent
d5ce10240a
commit
16e5b32bc1
1 changed files with 9 additions and 0 deletions
|
@ -661,6 +661,15 @@ gst_v4l2_video_enc_loop (GstVideoEncoder * encoder)
|
|||
frame = gst_v4l2_video_enc_get_oldest_frame (encoder);
|
||||
|
||||
if (frame) {
|
||||
/* At this point, the delta unit buffer flag is already correctly set by
|
||||
* gst_v4l2_buffer_pool_process. Since gst_video_encoder_finish_frame
|
||||
* will overwrite it from GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame),
|
||||
* set that here.
|
||||
*/
|
||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT))
|
||||
GST_VIDEO_CODEC_FRAME_UNSET_SYNC_POINT (frame);
|
||||
else
|
||||
GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
|
||||
frame->output_buffer = buffer;
|
||||
buffer = NULL;
|
||||
ret = gst_video_encoder_finish_frame (encoder, frame);
|
||||
|
|
Loading…
Reference in a new issue