mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-21 14:48:14 +00:00
adaptivedemux: tests: corrected access to fakeHTTPsrc element
The src element for adaptivedemux is now a bin. Updated the tests to correctly reach into the bin and get the fakeHTTPsrc element https://bugzilla.gnome.org/show_bug.cgi?id=757776
This commit is contained in:
parent
7f3d47deb3
commit
665eb6fcca
1 changed files with 22 additions and 7 deletions
|
@ -1099,11 +1099,20 @@ testSeekOnStateChanged (GstBus * bus, GstMessage * msg, gpointer data)
|
||||||
if (strstr (srcName, "fakesouphttpsrc") == srcName &&
|
if (strstr (srcName, "fakesouphttpsrc") == srcName &&
|
||||||
old_state == GST_STATE_PLAYING && new_state == GST_STATE_PAUSED) {
|
old_state == GST_STATE_PLAYING && new_state == GST_STATE_PAUSED) {
|
||||||
GList *pads = GST_ELEMENT_PADS (msg->src);
|
GList *pads = GST_ELEMENT_PADS (msg->src);
|
||||||
|
GstObject *srcBin;
|
||||||
|
|
||||||
/* src is a fake http src element. It should have only 1 pad */
|
/* src is a fake http src element. It should have only 1 pad */
|
||||||
fail_unless (pads != NULL);
|
fail_unless (pads != NULL);
|
||||||
fail_unless (g_list_length (pads) == 1);
|
fail_unless (g_list_length (pads) == 1);
|
||||||
|
|
||||||
|
/* fakeHTTPsrc element is placed inside a bin. Get the bin */
|
||||||
|
srcBin = gst_object_get_parent (msg->src);
|
||||||
|
|
||||||
|
/* the bin should have only 1 output pad */
|
||||||
|
pads = GST_ELEMENT_PADS (srcBin);
|
||||||
|
fail_unless (pads != NULL);
|
||||||
|
fail_unless (g_list_length (pads) == 1);
|
||||||
|
|
||||||
internalPad = gst_pad_get_peer (GST_PAD (pads->data));
|
internalPad = gst_pad_get_peer (GST_PAD (pads->data));
|
||||||
testOutputStreamData = getTestOutputDataByPad (testData, internalPad);
|
testOutputStreamData = getTestOutputDataByPad (testData, internalPad);
|
||||||
gst_object_unref (internalPad);
|
gst_object_unref (internalPad);
|
||||||
|
@ -1118,6 +1127,7 @@ testSeekOnStateChanged (GstBus * bus, GstMessage * msg, gpointer data)
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&testData->scratchData->seekTaskStateLock);
|
g_mutex_unlock (&testData->scratchData->seekTaskStateLock);
|
||||||
}
|
}
|
||||||
|
gst_object_unref (srcBin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1289,18 +1299,23 @@ testFragmentDownloadErrorCheckDataReceived (GstDashDemuxTestData * testData,
|
||||||
checkDataReceived (testData, testOutputStreamData, buffer);
|
checkDataReceived (testData, testOutputStreamData, buffer);
|
||||||
|
|
||||||
if (testOutputStreamData->scratchData->segmentReceivedSize > 2000) {
|
if (testOutputStreamData->scratchData->segmentReceivedSize > 2000) {
|
||||||
GstPad *fakeHttpSrcPad;
|
GstPad *srcBinPad;
|
||||||
GstObject *fakeHttpSrcElement;
|
GstObject *srcBin;
|
||||||
|
GstElement *fakeHttpSrcElement;
|
||||||
|
|
||||||
|
srcBinPad =
|
||||||
|
gst_pad_get_peer (testOutputStreamData->scratchData->internalPad);
|
||||||
|
srcBin = gst_pad_get_parent (srcBinPad);
|
||||||
|
|
||||||
|
fakeHttpSrcElement = gst_bin_get_by_interface (GST_BIN (srcBin),
|
||||||
|
GST_TYPE_URI_HANDLER);
|
||||||
|
|
||||||
/* tell fake soup http src to post an error on the adaptive demux bus */
|
/* tell fake soup http src to post an error on the adaptive demux bus */
|
||||||
fakeHttpSrcPad =
|
|
||||||
gst_pad_get_peer (testOutputStreamData->scratchData->internalPad);
|
|
||||||
fakeHttpSrcElement = gst_pad_get_parent (fakeHttpSrcPad);
|
|
||||||
|
|
||||||
gst_fake_soup_http_src_simulate_download_error ((GstFakeSoupHTTPSrc *)
|
gst_fake_soup_http_src_simulate_download_error ((GstFakeSoupHTTPSrc *)
|
||||||
fakeHttpSrcElement, 404);
|
fakeHttpSrcElement, 404);
|
||||||
|
|
||||||
gst_object_unref (fakeHttpSrcPad);
|
gst_object_unref (srcBinPad);
|
||||||
|
gst_object_unref (srcBin);
|
||||||
gst_object_unref (fakeHttpSrcElement);
|
gst_object_unref (fakeHttpSrcElement);
|
||||||
|
|
||||||
testData->expectError = TRUE;
|
testData->expectError = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue