mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
gst/gstpad.c: throw an error if the getcaps function does not return a subset of the template caps.
Original commit message from CVS: * gst/gstpad.c: (gst_pad_get_caps): throw an error if the getcaps function does not return a subset of the template caps. * libs/gst/bytestream/filepad.c: (gst_file_pad_chain): make disconts without position info an error in debugging * tests/spidey_bench.c: (handoff), (main): don't count first try when averaging
This commit is contained in:
parent
f683e73dc6
commit
968c817c26
4 changed files with 42 additions and 9 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2004-06-28 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||
|
||||
* gst/gstpad.c: (gst_pad_get_caps):
|
||||
throw an error if the getcaps function does not return a subset of
|
||||
the template caps.
|
||||
* libs/gst/bytestream/filepad.c: (gst_file_pad_chain):
|
||||
make disconts without position info an error in debugging
|
||||
* tests/spidey_bench.c: (handoff), (main):
|
||||
don't count first try when averaging
|
||||
|
||||
2004-06-26 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* docs/gst/Makefile.am:
|
||||
|
|
30
gst/gstpad.c
30
gst/gstpad.c
|
@ -2625,13 +2625,33 @@ gst_pad_get_caps (GstPad * pad)
|
|||
|
||||
if (caps == NULL) {
|
||||
g_critical ("pad %s:%s returned NULL caps from getcaps function\n",
|
||||
GST_ELEMENT_NAME (GST_PAD_PARENT (GST_PAD (realpad))),
|
||||
GST_PAD_NAME (realpad));
|
||||
caps = gst_caps_new_any ();
|
||||
}
|
||||
GST_DEBUG_PAD_NAME (realpad));
|
||||
} else {
|
||||
#ifndef G_DISABLE_ASSERT
|
||||
/* check that the returned caps are a real subset of the template caps */
|
||||
if (GST_PAD_PAD_TEMPLATE (realpad)) {
|
||||
const GstCaps *templ_caps =
|
||||
GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (realpad));
|
||||
if (!gst_caps_is_subset (caps, templ_caps)) {
|
||||
GstCaps *temp;
|
||||
|
||||
GST_CAT_ERROR_OBJECT (GST_CAT_CAPS, pad,
|
||||
"pad returned caps %" GST_PTR_FORMAT
|
||||
" which are not a real subset of its template caps %"
|
||||
GST_PTR_FORMAT, caps, templ_caps);
|
||||
g_warning
|
||||
("pad %s:%s returned caps that are not a real subset of its template caps",
|
||||
GST_DEBUG_PAD_NAME (realpad));
|
||||
temp = gst_caps_intersect (templ_caps, caps);
|
||||
gst_caps_free (caps);
|
||||
caps = temp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return caps;
|
||||
} else if (GST_PAD_PAD_TEMPLATE (realpad)) {
|
||||
}
|
||||
}
|
||||
if (GST_PAD_PAD_TEMPLATE (realpad)) {
|
||||
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);
|
||||
const GstCaps *caps;
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ gst_file_pad_chain (GstPad * gst_pad, GstData * data)
|
|||
GST_INFO_OBJECT (pad, "got discont to %" G_GINT64_FORMAT, value);
|
||||
pad->position = value;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (pad, "got discont without position");
|
||||
GST_ERROR_OBJECT (pad, "got discont without position");
|
||||
if (pad->position == -1) {
|
||||
GST_WARNING_OBJECT (pad,
|
||||
"need to reset position to 0 because we have no position info");
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
static GTimeVal start_time;
|
||||
gboolean done = FALSE;
|
||||
GstClockTime total = 0;
|
||||
guint counted = 0;
|
||||
|
||||
static void
|
||||
handoff (GstElement * fakesink, GstBuffer * data)
|
||||
|
@ -37,6 +38,8 @@ handoff (GstElement * fakesink, GstBuffer * data)
|
|||
g_print ("time to launch spider pipeline: %" GST_TIME_FORMAT "\n",
|
||||
GST_TIME_ARGS (diff));
|
||||
done = TRUE;
|
||||
/* don't count first try, it loads the plugins */
|
||||
if (counted++)
|
||||
total += diff;
|
||||
}
|
||||
|
||||
|
@ -61,7 +64,7 @@ main (gint argc, gchar * argv[])
|
|||
("filesrc location=\"%s\" ! spider ! audio/x-raw-int ! fakesink name = sink",
|
||||
file);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
for (i = 0; i <= count; i++) {
|
||||
GstElement *sink;
|
||||
|
||||
g_get_current_time (&start_time);
|
||||
|
|
Loading…
Reference in a new issue