diff --git a/gst/gstbin.c b/gst/gstbin.c index 6aa516305a..2243fa0675 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -17,6 +17,8 @@ * Boston, MA 02111-1307, USA. */ +//#define GST_DEBUG_ENABLED + #include #include "config.h" @@ -568,8 +570,18 @@ gst_bin_src_wrapper (int argc,char *argv[]) while (pads) { pad = GST_PAD (pads->data); if (pad->direction == GST_PAD_SRC) { - if (pad->pullfunc == NULL) DEBUG("error, no pullfunc in \"%s\"\n", name); - (pad->pullfunc)(pad); + region_struct *region = cothread_get_data (element->threadstate, "region"); + if (region) { + //gst_src_push_region (GST_SRC (element), region->offset, region->size); + if (pad->pullregionfunc == NULL) + fprintf(stderr,"error, no pullregionfunc in \"%s\"\n", name); + (pad->pullregionfunc)(pad, region->offset, region->size); + } + else { + if (pad->pullfunc == NULL) + fprintf(stderr,"error, no pullfunc in \"%s\"\n", name); + (pad->pullfunc)(pad); + } } pads = g_list_next(pads); } @@ -763,7 +775,7 @@ gst_bin_create_plan_func (GstBin *bin) // set the proxy functions if (!pad->pullfunc) pad->pullfunc = gst_bin_pullfunc_proxy; - if (!pad->pullfunc) + if (!pad->pullregionfunc) pad->pullregionfunc = gst_bin_pullregionfunc_proxy; // ***** check for possible connections outside @@ -909,7 +921,7 @@ gst_bin_iterate_func (GstBin *bin) while (entries) { entry = GST_ELEMENT (entries->data); - if (GST_IS_SRC (entry)) { + if (GST_IS_SRC (entry) || GST_IS_CONNECTION (entry)) { pads = entry->pads; while (pads) { pad = GST_PAD (pads->data); diff --git a/gst/gstdebug.h b/gst/gstdebug.h index 5b5894e682..5f8796c8e8 100644 --- a/gst/gstdebug.h +++ b/gst/gstdebug.h @@ -108,6 +108,8 @@ fprintf(stderr,GST_DEBUG_PREFIX(format": leaving\n" , ## args )) #define DEBUG(format, args...) #define DEBUG_ENTER(format, args...) #define DEBUG_LEAVE(format, args...) +#define DEBUG_SET_STRING(format, args...) +#define DEBUG_ENTER_STRING #endif diff --git a/gst/gstpad.c b/gst/gstpad.c index f9732f2ff7..e2d15be110 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -692,6 +692,41 @@ gst_pad_set_type_id (GstPad *pad, { gst_pad_add_type_id (pad, id); } + +/** + * gst_pad_set_caps: + * @pad: the pad to set the caps to + * @caps: the caps to attach to this pad + * + * set the capabilities of this pad + */ +void +gst_pad_set_caps (GstPad *pad, + GstCaps *caps) +{ + g_return_if_fail (pad != NULL); + g_return_if_fail (GST_IS_PAD (pad)); + g_return_if_fail (caps != NULL); + + pad->caps = caps; +} +/** + * gst_pad_get_caps: + * @pad: the pad to get the capabilities from + * + * get the capabilities of this pad + * + * Return; the capabilities of this pad + */ +GstCaps * +gst_pad_get_caps (GstPad *pad) +{ + g_return_val_if_fail (pad != NULL, NULL); + g_return_val_if_fail (GST_IS_PAD (pad), NULL); + + return pad->caps; +} + /** * gst_pad_set_type_id: * @pad: the pad to set the type id to @@ -783,7 +818,7 @@ gst_pad_load_and_connect (xmlNodePtr parent, targetpad = gst_element_get_pad(target, split[1]); - g_return_if_fail(targetpad != NULL); + if (targetpad == NULL) goto cleanup; gst_pad_connect(pad, targetpad); diff --git a/gst/gstpad.h b/gst/gstpad.h index 13bd9a476b..5f8b59d385 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef __cplusplus @@ -69,6 +70,7 @@ struct _GstPad { gchar *name; GList *types; + GstCaps *caps; GstPadDirection direction; @@ -111,6 +113,9 @@ void gst_pad_set_type_id (GstPad *pad, guint16 id); GList* gst_pad_get_type_ids (GstPad *pad); void gst_pad_add_type_id (GstPad *pad, guint16 id); +void gst_pad_set_caps (GstPad *pad, GstCaps *caps); +GstCaps* gst_pad_get_caps (GstPad *pad); + void gst_pad_set_name (GstPad *pad, const gchar *name); const gchar* gst_pad_get_name (GstPad *pad);