flvmux: push metadata on caps change

The metdata contains tags but also caps dependent info such as the
resolution and the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4730>
This commit is contained in:
Guillaume Desmottes 2023-05-29 15:26:35 +02:00
parent 3ae2904f3d
commit 0fd3c28620
2 changed files with 11 additions and 7 deletions

View file

@ -519,8 +519,10 @@ gst_flv_mux_video_pad_setcaps (GstFlvMuxPad * pad, GstCaps * caps)
pad->info_changed = TRUE;
}
if (pad->info_changed)
if (pad->info_changed) {
mux->state = GST_FLV_MUX_STATE_HEADER;
mux->new_metadata = TRUE;
}
}
if (old_codec_data)
@ -704,8 +706,10 @@ gst_flv_mux_audio_pad_setcaps (GstFlvMuxPad * pad, GstCaps * caps)
pad->info_changed = TRUE;
}
if (pad->info_changed)
if (pad->info_changed) {
mux->state = GST_FLV_MUX_STATE_HEADER;
mux->new_metadata = TRUE;
}
}
if (old_codec_data)

View file

@ -533,7 +533,7 @@ GST_START_TEST (test_video_caps_late)
/* push from flvmux to demux */
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 6));
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 7));
/* verify we got 2x audio and 1x video buffers out of flvdemux */
gst_buffer_unref (gst_harness_pull (a_sink));
@ -630,7 +630,7 @@ GST_START_TEST (test_video_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 3));
/* should accept without the constraint */
while ((event = gst_harness_try_pull_event (v_sink))) {
@ -735,7 +735,7 @@ GST_START_TEST (test_audio_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 3));
/* should accept without the constraint */
while ((event = gst_harness_try_pull_event (a_sink))) {
@ -820,7 +820,7 @@ GST_START_TEST (test_video_caps_change_streamable_single)
duration)));
/* push from flvmux to demux */
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 3));
/* should accept without the constraint */
while ((event = gst_harness_try_pull_event (v_sink))) {
@ -906,7 +906,7 @@ GST_START_TEST (test_audio_caps_change_streamable_single)
base_time + duration, duration)));
/* push from flvmux to demux */
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 3));
/* should accept without the constraint */
while ((event = gst_harness_try_pull_event (a_sink))) {