Skip to content

Commit

Permalink
Use gst_element_request_pad_simple...
Browse files Browse the repository at this point in the history
Instead of the deprecated gst_element_get_request_pad.
  • Loading branch information
fengalin authored and sdroege committed May 5, 2021
1 parent a77c316 commit ca7a964
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 80 deletions.
3 changes: 2 additions & 1 deletion gst/playback/gstdecodebin2.c
Expand Up @@ -3916,7 +3916,8 @@ gst_decode_group_control_demuxer_pad (GstDecodeGroup * group, GstPad * pad)
if (G_UNLIKELY (!group->multiqueue))
return NULL;

if (!(sinkpad = gst_element_get_request_pad (group->multiqueue, "sink_%u"))) {
if (!(sinkpad =
gst_element_request_pad_simple (group->multiqueue, "sink_%u"))) {
GST_ERROR_OBJECT (dbin, "Couldn't get sinkpad from multiqueue");
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion gst/playback/gstdecodebin3.c
Expand Up @@ -2019,7 +2019,7 @@ create_new_slot (GstDecodebin3 * dbin, GstStreamType type)
slot->id = dbin->slot_id++;

slot->type = type;
slot->sink_pad = gst_element_get_request_pad (dbin->multiqueue, "sink_%u");
slot->sink_pad = gst_element_request_pad_simple (dbin->multiqueue, "sink_%u");
if (slot->sink_pad == NULL)
goto fail;

Expand Down
3 changes: 2 additions & 1 deletion gst/playback/gstplaybin2.c
Expand Up @@ -3515,7 +3515,8 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)

/* get sinkpad for the new stream */
if (combine->combiner) {
if ((sinkpad = gst_element_get_request_pad (combine->combiner, "sink_%u"))) {
if ((sinkpad =
gst_element_request_pad_simple (combine->combiner, "sink_%u"))) {

GST_DEBUG_OBJECT (playbin, "got pad %s:%s from combiner",
GST_DEBUG_PAD_NAME (sinkpad));
Expand Down
2 changes: 1 addition & 1 deletion gst/playback/gstplaybin3.c
Expand Up @@ -2901,7 +2901,7 @@ combiner_control_pad (GstPlayBin3 * playbin, GstSourceCombine * combine,

if (combine->combiner) {
GstPad *sinkpad =
gst_element_get_request_pad (combine->combiner, "sink_%u");
gst_element_request_pad_simple (combine->combiner, "sink_%u");

if (sinkpad == NULL)
goto request_pad_failed;
Expand Down
10 changes: 5 additions & 5 deletions gst/playback/gstplaysink.c
Expand Up @@ -3360,7 +3360,7 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
GstIterator *it;

playsink->video_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
gst_element_request_pad_simple (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->video_sinkpad_stream_synchronizer);
Expand Down Expand Up @@ -3572,7 +3572,7 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
GstIterator *it;

playsink->audio_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
gst_element_request_pad_simple (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->audio_sinkpad_stream_synchronizer);
Expand Down Expand Up @@ -3627,7 +3627,7 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
GST_DEBUG_OBJECT (playsink, "adding audio chain");
if (playsink->audio_tee_asrc == NULL) {
playsink->audio_tee_asrc =
gst_element_get_request_pad (playsink->audio_tee, "src_%u");
gst_element_request_pad_simple (playsink->audio_tee, "src_%u");
}

sinkpad = playsink->audio_ssync_queue_sinkpad;
Expand Down Expand Up @@ -3704,7 +3704,7 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
activate_chain (GST_PLAY_CHAIN (playsink->vischain), TRUE);
if (playsink->audio_tee_vissrc == NULL) {
playsink->audio_tee_vissrc =
gst_element_get_request_pad (playsink->audio_tee, "src_%u");
gst_element_request_pad_simple (playsink->audio_tee, "src_%u");
}
gst_pad_link_full (playsink->audio_tee_vissrc,
playsink->vischain->sinkpad, GST_PAD_LINK_CHECK_NOTHING);
Expand Down Expand Up @@ -3781,7 +3781,7 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
GValue item = { 0, };

playsink->text_sinkpad_stream_synchronizer =
gst_element_get_request_pad (GST_ELEMENT_CAST
gst_element_request_pad_simple (GST_ELEMENT_CAST
(playsink->stream_synchronizer), "sink_%u");
it = gst_pad_iterate_internal_links
(playsink->text_sinkpad_stream_synchronizer);
Expand Down
3 changes: 2 additions & 1 deletion gst/playback/gsturidecodebin3.c
Expand Up @@ -749,7 +749,8 @@ src_pad_added_cb (GstElement * element, GstPad * pad,
}

if (sinkpad == NULL)
sinkpad = gst_element_get_request_pad (uridecodebin->decodebin, "sink_%u");
sinkpad =
gst_element_request_pad_simple (uridecodebin->decodebin, "sink_%u");

if (sinkpad) {
GST_DEBUG_OBJECT (uridecodebin,
Expand Down
4 changes: 2 additions & 2 deletions tests/check/elements/adder.c
Expand Up @@ -687,7 +687,7 @@ GST_START_TEST (test_remove_pad)
fail_unless (res == TRUE, NULL);

/* create an unconnected sinkpad in adder */
pad = gst_element_get_request_pad (adder, "sink_%u");
pad = gst_element_request_pad_simple (adder, "sink_%u");
fail_if (pad == NULL, NULL);

srcpad = gst_element_get_static_pad (adder, "src");
Expand Down Expand Up @@ -783,7 +783,7 @@ GST_START_TEST (test_clip)

/* create an unconnected sinkpad in adder, should also automatically activate
* the pad */
sinkpad = gst_element_get_request_pad (adder, "sink_%u");
sinkpad = gst_element_request_pad_simple (adder, "sink_%u");
fail_if (sinkpad == NULL, NULL);

gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
Expand Down
28 changes: 14 additions & 14 deletions tests/check/elements/audiointerleave.c
Expand Up @@ -72,11 +72,11 @@ GST_START_TEST (test_request_pads)
interleave = gst_element_factory_make ("audiointerleave", NULL);
fail_unless (interleave != NULL);

pad1 = gst_element_get_request_pad (interleave, "sink_%u");
pad1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (pad1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (pad1), "sink_0");

pad2 = gst_element_get_request_pad (interleave, "sink_%u");
pad2 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (pad2 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (pad2), "sink_1");

Expand Down Expand Up @@ -174,11 +174,11 @@ GST_START_TEST (test_audiointerleave_2ch)
queue = gst_element_factory_make ("queue", "queue");
fail_unless (queue != NULL);

sink0 = gst_element_get_request_pad (interleave, "sink_%u");
sink0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sink0 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink_0");

sink1 = gst_element_get_request_pad (interleave, "sink_%u");
sink1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sink1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink_1");

Expand Down Expand Up @@ -314,11 +314,11 @@ GST_START_TEST (test_audiointerleave_2ch_1eos)
queue = gst_element_factory_make ("queue", "queue");
fail_unless (queue != NULL);

sink0 = gst_element_get_request_pad (interleave, "sink_%u");
sink0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sink0 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink0), "sink_0");

sink1 = gst_element_get_request_pad (interleave, "sink_%u");
sink1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sink1 != NULL);
fail_unless_equals_string (GST_OBJECT_NAME (sink1), "sink_1");

Expand Down Expand Up @@ -613,13 +613,13 @@ test_audiointerleave_2ch_pipeline (gboolean interleaved)
fail_unless (interleave != NULL);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));

sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);

sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
Expand Down Expand Up @@ -717,13 +717,13 @@ GST_START_TEST (test_audiointerleave_2ch_pipeline_input_chanpos)
g_object_set (interleave, "channel-positions-from-input", TRUE, NULL);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));

sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);

sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
Expand Down Expand Up @@ -823,13 +823,13 @@ GST_START_TEST (test_audiointerleave_2ch_pipeline_custom_chanpos)
g_value_array_free (arr);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));

sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);

sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
Expand Down Expand Up @@ -915,13 +915,13 @@ GST_START_TEST (test_audiointerleave_2ch_pipeline_no_chanpos)
g_object_set (interleave, "channel-positions-from-input", FALSE, NULL);
gst_bin_add (GST_BIN (pipeline), gst_object_ref (interleave));

sinkpad0 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad0 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad0 != NULL);
tmp = gst_element_get_static_pad (src1, "src");
fail_unless (gst_pad_link (tmp, sinkpad0) == GST_PAD_LINK_OK);
gst_object_unref (tmp);

sinkpad1 = gst_element_get_request_pad (interleave, "sink_%u");
sinkpad1 = gst_element_request_pad_simple (interleave, "sink_%u");
fail_unless (sinkpad1 != NULL);
tmp = gst_element_get_static_pad (src2, "src");
tmp2 = gst_element_get_static_pad (queue, "sink");
Expand Down
18 changes: 9 additions & 9 deletions tests/check/elements/audiomixer.c
Expand Up @@ -738,7 +738,7 @@ GST_START_TEST (test_remove_pad)
fail_unless (res == TRUE, NULL);

/* create an unconnected sinkpad in audiomixer */
pad = gst_element_get_request_pad (audiomixer, "sink_%u");
pad = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (pad == NULL, NULL);

srcpad = gst_element_get_static_pad (audiomixer, "src");
Expand Down Expand Up @@ -842,7 +842,7 @@ GST_START_TEST (test_clip)

/* create an unconnected sinkpad in audiomixer, should also automatically activate
* the pad */
sinkpad = gst_element_get_request_pad (audiomixer, "sink_%u");
sinkpad = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (sinkpad == NULL, NULL);

gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
Expand Down Expand Up @@ -1226,15 +1226,15 @@ run_sync_test (SendBuffersFunction send_buffers,

/* create an unconnected sinkpad in audiomixer, should also automatically activate
* the pad */
sinkpad1 = gst_element_get_request_pad (audiomixer, "sink_%u");
sinkpad1 = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (sinkpad1 == NULL, NULL);

queue1_sinkpad = gst_element_get_static_pad (queue1, "sink");
pad = gst_element_get_static_pad (queue1, "src");
fail_unless (gst_pad_link (pad, sinkpad1) == GST_PAD_LINK_OK);
gst_object_unref (pad);

sinkpad2 = gst_element_get_request_pad (audiomixer, "sink_%u");
sinkpad2 = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (sinkpad2 == NULL, NULL);

queue2_sinkpad = gst_element_get_static_pad (queue2, "sink");
Expand Down Expand Up @@ -1573,13 +1573,13 @@ GST_START_TEST (test_segment_base_handling)
fail_unless (gst_element_link (mix, sink));

srcpad = gst_element_get_static_pad (src1, "src");
sinkpad = gst_element_get_request_pad (mix, "sink_1");
sinkpad = gst_element_request_pad_simple (mix, "sink_1");
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK);
gst_object_unref (sinkpad);
gst_object_unref (srcpad);

srcpad = gst_element_get_static_pad (src2, "src");
sinkpad = gst_element_get_request_pad (mix, "sink_2");
sinkpad = gst_element_request_pad_simple (mix, "sink_2");
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK);
/* set a pad offset of another 5 seconds */
gst_pad_set_offset (sinkpad, 5 * GST_SECOND);
Expand Down Expand Up @@ -1647,7 +1647,7 @@ GST_START_TEST (test_sinkpad_property_controller)
fail_unless (gst_element_link (mix, sink));

srcpad = gst_element_get_static_pad (src1, "src");
sinkpad = gst_element_get_request_pad (mix, "sink_0");
sinkpad = gst_element_request_pad_simple (mix, "sink_0");
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK);
set_pad_volume_fade (sinkpad, 0, 0, 1.0, 2.0);
gst_object_unref (sinkpad);
Expand Down Expand Up @@ -1748,7 +1748,7 @@ GST_START_TEST (test_change_output_caps)
state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);

sinkpad = gst_element_get_request_pad (audiomixer, "sink_%u");
sinkpad = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (sinkpad == NULL, NULL);

gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
Expand Down Expand Up @@ -1857,7 +1857,7 @@ GST_START_TEST (test_change_output_caps_mid_output_buffer)
state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);

sinkpad = gst_element_get_request_pad (audiomixer, "sink_%u");
sinkpad = gst_element_request_pad_simple (audiomixer, "sink_%u");
fail_if (sinkpad == NULL, NULL);

gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
Expand Down

0 comments on commit ca7a964

Please sign in to comment.