gst/gstghostpad.c: Filter the proxied caps against the padtemplate if we have one.

Original commit message from CVS:
Patch by: mrcgran <mrc.gran at gmail dot com>
* gst/gstghostpad.c: (gst_proxy_pad_do_getcaps):
Filter the proxied caps against the padtemplate if we have one.
* gst/gstquery.c: (gst_query_new_segment):
Add include for gstinfo.h so that compilation with
-DGST_DISABLE_GST_DEBUG works again. Fixes #358436.
This commit is contained in:
mrcgran 2006-10-02 10:06:17 +00:00 committed by Wim Taymans
parent ec3194dc54
commit bae90f5955
3 changed files with 33 additions and 5 deletions

View file

@ -1,3 +1,14 @@
2006-10-02 Wim Taymans <wim@fluendo.com>
Patch by: mrcgran <mrc.gran at gmail dot com>
* gst/gstghostpad.c: (gst_proxy_pad_do_getcaps):
Filter the proxied caps against the padtemplate if we have one.
* gst/gstquery.c: (gst_query_new_segment):
Add include for gstinfo.h so that compilation with
-DGST_DISABLE_GST_DEBUG works again. Fixes #358436.
2006-10-02 Wim Taymans <wim@fluendo.com>
Patch by: Alessandro Decina <alessandro at nnva org>

View file

@ -45,6 +45,7 @@
*/
#include "gst_private.h"
#include "gstinfo.h"
#include "gstghostpad.h"
@ -218,16 +219,30 @@ gst_proxy_pad_do_getcaps (GstPad * pad)
{
GstPad *target = gst_proxy_pad_get_target (pad);
GstCaps *res;
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
if (target) {
/* if we have a real target, proxy the call */
GST_DEBUG_OBJECT (pad, "get caps of target");
res = gst_pad_get_caps (target);
gst_object_unref (target);
} else {
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (pad);
/* else, if we have a template, use that */
GST_DEBUG_OBJECT (pad, "get caps of target: %" GST_PTR_FORMAT, res);
/* filter against the template */
if (templ && res) {
GstCaps *filt, *tmp;
filt = GST_PAD_TEMPLATE_CAPS (templ);
if (filt) {
tmp = gst_caps_intersect (filt, res);
gst_caps_unref (res);
res = tmp;
GST_DEBUG_OBJECT (pad,
"filtered against template gives %" GST_PTR_FORMAT, res);
}
}
} else {
/* else, if we have a template, use its caps. */
if (templ) {
res = GST_PAD_TEMPLATE_CAPS (templ);
GST_DEBUG_OBJECT (pad,

View file

@ -59,8 +59,10 @@
* Last reviewed on 2006-02-14 (0.10.4)
*/
#include "gst_private.h"
#include <string.h>
#include "gst_private.h"
#include "gstinfo.h"
#include "gstquery.h"
#include "gstvalue.h"
#include "gstenumtypes.h"