if a named pad doesn't exist, try creating a new pad using the padtemplate name....
authorSteve Baker <steve@stevebaker.org>
Sat, 9 Jun 2001 10:16:12 +0000 (10:16 +0000)
committerSteve Baker <steve@stevebaker.org>
Sat, 9 Jun 2001 10:16:12 +0000 (10:16 +0000)
Original commit message from CVS:
if a named pad doesn't exist, try creating a new pad using the padtemplate name. eg int2float src%d!sink%d float2int

gst/gstparse.c

index 75dc668..00a9e09 100644 (file)
@@ -170,8 +170,11 @@ gst_parse_launch_cmdline(int argc,char *argv[],GstBin *parent,gst_parse_priv *pr
         if (srcpadname != NULL) {
           srcpad = gst_element_get_pad(previous,srcpadname);
           if (!srcpad) {
+            srcpad = gst_element_request_pad_by_name(previous,srcpadname);
+          }
+          if (!srcpad) {
             GST_DEBUG(0,"NO SUCH pad %s in element %s\n",srcpadname,GST_ELEMENT_NAME(previous));
-         }
+          }
         }
        else if (srcpad == NULL) {
           // check through the list to find the first sink pad
@@ -252,9 +255,14 @@ if (GST_IS_GHOST_PAD(srcpad)) GST_DEBUG(0,"it's a ghost pad\n");
 
         sinkpad = NULL;
 
-        if (sinkpadname != NULL)
-          sinkpad = gst_element_get_pad(previous,sinkpadname);
-
+        if (sinkpadname != NULL){
+          sinkpad = gst_element_get_pad(element,sinkpadname);
+          
+          if (!sinkpad) {
+            sinkpad = gst_element_request_pad_by_name(element,sinkpadname);
+          }
+        }
+        
         if (!sinkpad) {
           // check through the list to find the first sink pad
           pads = gst_element_get_pad_list(element);