317 |
319 |
318 # endif /* G_HAVE_ISO_VARARGS */ |
320 # endif /* G_HAVE_ISO_VARARGS */ |
319 |
321 |
320 #endif /* GST_DISABLE_GST_DEBUG */ |
322 #endif /* GST_DISABLE_GST_DEBUG */ |
321 |
323 |
322 #define ADD_MISSING_ELEMENT(graph,name) G_STMT_START { \ |
|
323 if ((graph)->ctx) { \ |
|
324 (graph)->ctx->missing_elements = \ |
|
325 g_list_append ((graph)->ctx->missing_elements, g_strdup (name)); \ |
|
326 } } G_STMT_END |
|
327 |
|
328 #define GST_BIN_MAKE(res, type, chainval, assign, free_string) \ |
324 #define GST_BIN_MAKE(res, type, chainval, assign, free_string) \ |
329 G_STMT_START { \ |
325 G_STMT_START { \ |
330 chain_t *chain = chainval; \ |
326 chain_t *chain = chainval; \ |
331 GSList *walk; \ |
327 GSList *walk; \ |
332 GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \ |
328 GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \ |
333 if (!chain) { \ |
329 if (!chain) { \ |
334 SET_ERROR (graph->error, GST_PARSE_ERROR_EMPTY_BIN, \ |
330 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY_BIN, \ |
335 _("specified empty bin \"%s\", not allowed"), type); \ |
331 _("specified empty bin \"%s\", not allowed"), type); \ |
336 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ |
332 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ |
337 g_slist_free (assign); \ |
333 g_slist_free (assign); \ |
338 gst_object_unref (bin); \ |
334 gst_object_unref (bin); \ |
339 if (free_string) \ |
335 if (free_string) \ |
340 gst_parse_strfree (type); /* Need to clean up the string */ \ |
336 gst_parse_strfree (type); /* Need to clean up the string */ \ |
341 YYERROR; \ |
337 YYERROR; \ |
342 } else if (!bin) { \ |
338 } else if (!bin) { \ |
343 ADD_MISSING_ELEMENT(graph, type); \ |
339 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \ |
344 SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \ |
|
345 _("no bin \"%s\", skipping"), type); \ |
340 _("no bin \"%s\", skipping"), type); \ |
346 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ |
341 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \ |
347 g_slist_free (assign); \ |
342 g_slist_free (assign); \ |
348 res = chain; \ |
343 res = chain; \ |
349 } else { \ |
344 } else { \ |
393 GValue v = { 0, }; |
388 GValue v = { 0, }; |
394 GstObject *target = NULL; |
389 GstObject *target = NULL; |
395 GType value_type; |
390 GType value_type; |
396 |
391 |
397 if (gst_child_proxy_lookup (GST_OBJECT (set->parent), set->name, &target, &pspec)) { |
392 if (gst_child_proxy_lookup (GST_OBJECT (set->parent), set->name, &target, &pspec)) { |
398 gboolean got_value = FALSE; |
|
399 |
|
400 value_type = G_PARAM_SPEC_VALUE_TYPE (pspec); |
393 value_type = G_PARAM_SPEC_VALUE_TYPE (pspec); |
401 |
394 |
402 GST_CAT_LOG (GST_CAT_PIPELINE, "parsing delayed property %s as a %s from %s", pspec->name, |
395 GST_CAT_LOG (GST_CAT_PIPELINE, "parsing delayed property %s as a %s from %s", pspec->name, |
403 g_type_name (value_type), set->value_str); |
396 g_type_name (value_type), set->value_str); |
404 g_value_init (&v, value_type); |
397 g_value_init (&v, value_type); |
405 if (gst_value_deserialize (&v, set->value_str)) |
398 if (gst_value_deserialize (&v, set->value_str)) { |
406 got_value = TRUE; |
399 g_object_set_property (G_OBJECT (target), pspec->name, &v); |
407 else if (g_type_is_a (value_type, GST_TYPE_ELEMENT)) { |
|
408 GstElement *bin; |
|
409 |
|
410 bin = gst_parse_bin_from_description (set->value_str, TRUE, NULL); |
|
411 if (bin) { |
|
412 g_value_set_object (&v, bin); |
|
413 got_value = TRUE; |
|
414 } |
|
415 } |
400 } |
416 g_signal_handler_disconnect (child_proxy, set->signal_id); |
401 g_signal_handler_disconnect (child_proxy, set->signal_id); |
417 g_free(set->name); |
402 g_free(set->name); |
418 g_free(set->value_str); |
403 g_free(set->value_str); |
419 g_free(set); |
404 g_free(set); |
420 if (!got_value) |
|
421 goto error; |
|
422 g_object_set_property (G_OBJECT (target), pspec->name, &v); |
|
423 } |
405 } |
424 |
406 |
425 out: |
|
426 if (G_IS_VALUE (&v)) |
407 if (G_IS_VALUE (&v)) |
427 g_value_unset (&v); |
408 g_value_unset (&v); |
428 if (target) |
409 if (target) |
429 gst_object_unref (target); |
410 gst_object_unref (target); |
430 return; |
411 return; |
431 |
412 } |
432 error: |
413 #ifdef __SYMBIAN32__ |
433 GST_CAT_ERROR (GST_CAT_PIPELINE, "could not set property \"%s\" in element \"%s\"", |
414 #include<glib_global.h> |
434 pspec->name, GST_ELEMENT_NAME (target)); |
415 #endif |
435 goto out; |
|
436 } |
|
437 |
|
438 |
416 |
439 static void |
417 static void |
440 gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) |
418 gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) |
441 { |
419 { |
442 GParamSpec *pspec; |
420 GParamSpec *pspec; |
443 gchar *pos = value; |
421 gchar *pos = value; |
444 GValue v = { 0, }; |
422 GValue v = { 0, }; |
445 GstObject *target = NULL; |
423 GstObject *target = NULL; |
446 GType value_type; |
424 GType value_type; |
447 |
|
448 /* do nothing if assignment is for missing element */ |
|
449 if (element == NULL) |
|
450 goto out; |
|
451 |
425 |
452 /* parse the string, so the property name is null-terminated an pos points |
426 /* parse the string, so the property name is null-terminated an pos points |
453 to the beginning of the value */ |
427 to the beginning of the value */ |
454 while (!g_ascii_isspace (*pos) && (*pos != '=')) pos++; |
428 while (!g_ascii_isspace (*pos) && (*pos != '=')) pos++; |
455 if (*pos == '=') { |
429 if (*pos == '=') { |
1972 |
1932 |
1973 YY_REDUCE_PRINT (yyn); |
1933 YY_REDUCE_PRINT (yyn); |
1974 switch (yyn) |
1934 switch (yyn) |
1975 { |
1935 { |
1976 case 2: |
1936 case 2: |
1977 #line 601 "./grammar.y" |
1937 #line 556 "./grammar.y" |
1978 { (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL); |
1938 { (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL); |
1979 if ((yyval.e) == NULL) { |
1939 if ((yyval.e) == NULL) { |
1980 ADD_MISSING_ELEMENT (graph, (yyvsp[(1) - (1)].s)); |
1940 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), (yyvsp[(1) - (1)].s)); |
1981 SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, _("no element \"%s\""), (yyvsp[(1) - (1)].s)); |
1941 gst_parse_strfree ((yyvsp[(1) - (1)].s)); |
1982 /* if FATAL_ERRORS flag is set, we don't have to worry about backwards |
1942 YYERROR; |
1983 * compatibility and can continue parsing and check for other missing |
|
1984 * elements */ |
|
1985 if ((graph->flags & GST_PARSE_FLAG_FATAL_ERRORS) == 0) { |
|
1986 gst_parse_strfree ((yyvsp[(1) - (1)].s)); |
|
1987 YYERROR; |
|
1988 } |
|
1989 } |
1943 } |
1990 gst_parse_strfree ((yyvsp[(1) - (1)].s)); |
1944 gst_parse_strfree ((yyvsp[(1) - (1)].s)); |
1991 ;} |
1945 ;} |
1992 break; |
1946 break; |
1993 |
1947 |
1994 case 3: |
1948 case 3: |
1995 #line 615 "./grammar.y" |
1949 #line 564 "./grammar.y" |
1996 { gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph); |
1950 { gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph); |
1997 (yyval.e) = (yyvsp[(1) - (2)].e); |
1951 (yyval.e) = (yyvsp[(1) - (2)].e); |
1998 ;} |
1952 ;} |
1999 break; |
1953 break; |
2000 |
1954 |
2001 case 4: |
1955 case 4: |
2002 #line 619 "./grammar.y" |
1956 #line 568 "./grammar.y" |
2003 { (yyval.p) = NULL; ;} |
1957 { (yyval.p) = NULL; ;} |
2004 break; |
1958 break; |
2005 |
1959 |
2006 case 5: |
1960 case 5: |
2007 #line 620 "./grammar.y" |
1961 #line 569 "./grammar.y" |
2008 { (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s)); ;} |
1962 { (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s)); ;} |
2009 break; |
1963 break; |
2010 |
1964 |
2011 case 6: |
1965 case 6: |
2012 #line 622 "./grammar.y" |
1966 #line 571 "./grammar.y" |
2013 { GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), FALSE); ;} |
1967 { GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), FALSE); ;} |
2014 break; |
1968 break; |
2015 |
1969 |
2016 case 7: |
1970 case 7: |
2017 #line 623 "./grammar.y" |
1971 #line 572 "./grammar.y" |
2018 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), TRUE); |
1972 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c), (yyvsp[(2) - (4)].p), TRUE); |
2019 gst_parse_strfree ((yyvsp[(1) - (4)].s)); |
1973 gst_parse_strfree ((yyvsp[(1) - (4)].s)); |
2020 ;} |
1974 ;} |
2021 break; |
1975 break; |
2022 |
1976 |
2023 case 8: |
1977 case 8: |
2024 #line 626 "./grammar.y" |
1978 #line 575 "./grammar.y" |
2025 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL, (yyvsp[(2) - (3)].p), TRUE); |
1979 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL, (yyvsp[(2) - (3)].p), TRUE); |
2026 gst_parse_strfree ((yyvsp[(1) - (3)].s)); |
1980 gst_parse_strfree ((yyvsp[(1) - (3)].s)); |
2027 ;} |
1981 ;} |
2028 break; |
1982 break; |
2029 |
1983 |
2030 case 9: |
1984 case 9: |
2031 #line 629 "./grammar.y" |
1985 #line 578 "./grammar.y" |
2032 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL, (yyvsp[(2) - (4)].p), TRUE); |
1986 { GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL, (yyvsp[(2) - (4)].p), TRUE); |
2033 gst_parse_strfree ((yyvsp[(1) - (4)].s)); |
1987 gst_parse_strfree ((yyvsp[(1) - (4)].s)); |
2034 ;} |
1988 ;} |
2035 break; |
1989 break; |
2036 |
1990 |
2037 case 10: |
1991 case 10: |
2038 #line 634 "./grammar.y" |
1992 #line 583 "./grammar.y" |
2039 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s)); ;} |
1993 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s)); ;} |
2040 break; |
1994 break; |
2041 |
1995 |
2042 case 11: |
1996 case 11: |
2043 #line 635 "./grammar.y" |
1997 #line 584 "./grammar.y" |
2044 { (yyval.p) = (yyvsp[(2) - (2)].p); |
1998 { (yyval.p) = (yyvsp[(2) - (2)].p); |
2045 (yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s)); |
1999 (yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s)); |
2046 ;} |
2000 ;} |
2047 break; |
2001 break; |
2048 |
2002 |
2049 case 12: |
2003 case 12: |
2050 #line 639 "./grammar.y" |
2004 #line 588 "./grammar.y" |
2051 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s)); ;} |
2005 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s)); ;} |
2052 break; |
2006 break; |
2053 |
2007 |
2054 case 13: |
2008 case 13: |
2055 #line 640 "./grammar.y" |
2009 #line 589 "./grammar.y" |
2056 { (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s)); ;} |
2010 { (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s)); ;} |
2057 break; |
2011 break; |
2058 |
2012 |
2059 case 14: |
2013 case 14: |
2060 #line 643 "./grammar.y" |
2014 #line 592 "./grammar.y" |
2061 { MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL); ;} |
2015 { MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL); ;} |
2062 break; |
2016 break; |
2063 |
2017 |
2064 case 15: |
2018 case 15: |
2065 #line 644 "./grammar.y" |
2019 #line 593 "./grammar.y" |
2066 { MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p)); ;} |
2020 { MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p)); ;} |
2067 break; |
2021 break; |
2068 |
2022 |
2069 case 16: |
2023 case 16: |
2070 #line 647 "./grammar.y" |
2024 #line 596 "./grammar.y" |
2071 { (yyval.l) = (yyvsp[(1) - (1)].l); ;} |
2025 { (yyval.l) = (yyvsp[(1) - (1)].l); ;} |
2072 break; |
2026 break; |
2073 |
2027 |
2074 case 17: |
2028 case 17: |
2075 #line 648 "./grammar.y" |
2029 #line 597 "./grammar.y" |
2076 { MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p)); ;} |
2030 { MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p)); ;} |
2077 break; |
2031 break; |
2078 |
2032 |
2079 case 18: |
2033 case 18: |
2080 #line 649 "./grammar.y" |
2034 #line 598 "./grammar.y" |
2081 { MAKE_REF ((yyval.l), NULL, NULL); ;} |
2035 { MAKE_REF ((yyval.l), NULL, NULL); ;} |
2082 break; |
2036 break; |
2083 |
2037 |
2084 case 19: |
2038 case 19: |
2085 #line 652 "./grammar.y" |
2039 #line 601 "./grammar.y" |
2086 { (yyval.l) = (yyvsp[(1) - (3)].l); |
2040 { (yyval.l) = (yyvsp[(1) - (3)].l); |
2087 if ((yyvsp[(2) - (3)].s)) { |
2041 if ((yyvsp[(2) - (3)].s)) { |
2088 (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s)); |
2042 (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s)); |
2089 if ((yyval.l)->caps == NULL) |
2043 if ((yyval.l)->caps == NULL) |
2090 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s)); |
2044 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s)); |
2091 gst_parse_strfree ((yyvsp[(2) - (3)].s)); |
2045 gst_parse_strfree ((yyvsp[(2) - (3)].s)); |
2092 } |
2046 } |
2093 (yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name; |
2047 (yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name; |
2094 (yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads; |
2048 (yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads; |
2095 gst_parse_link_free ((yyvsp[(3) - (3)].l)); |
2049 gst_parse_link_free ((yyvsp[(3) - (3)].l)); |
2096 ;} |
2050 ;} |
2097 break; |
2051 break; |
2098 |
2052 |
2099 case 20: |
2053 case 20: |
2100 #line 665 "./grammar.y" |
2054 #line 614 "./grammar.y" |
2101 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l)); ;} |
2055 { (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l)); ;} |
2102 break; |
2056 break; |
2103 |
2057 |
2104 case 21: |
2058 case 21: |
2105 #line 666 "./grammar.y" |
2059 #line 615 "./grammar.y" |
2106 { (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l)); ;} |
2060 { (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l)); ;} |
2107 break; |
2061 break; |
2108 |
2062 |
2109 case 22: |
2063 case 22: |
2110 #line 667 "./grammar.y" |
2064 #line 616 "./grammar.y" |
2111 { (yyval.p) = (yyvsp[(1) - (2)].p); ;} |
2065 { (yyval.p) = (yyvsp[(1) - (2)].p); ;} |
2112 break; |
2066 break; |
2113 |
2067 |
2114 case 23: |
2068 case 23: |
2115 #line 670 "./grammar.y" |
2069 #line 619 "./grammar.y" |
2116 { (yyval.c) = gst_parse_chain_new (); |
2070 { (yyval.c) = gst_parse_chain_new (); |
2117 (yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e); |
2071 (yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e); |
2118 (yyval.c)->front = (yyval.c)->back = NULL; |
2072 (yyval.c)->front = (yyval.c)->back = NULL; |
2119 (yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e)); |
2073 (yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e)); |
2120 ;} |
2074 ;} |
2121 break; |
2075 break; |
2122 |
2076 |
2123 case 24: |
2077 case 24: |
2124 #line 675 "./grammar.y" |
2078 #line 624 "./grammar.y" |
2125 { (yyval.c) = (yyvsp[(1) - (1)].c); ;} |
2079 { (yyval.c) = (yyvsp[(1) - (1)].c); ;} |
2126 break; |
2080 break; |
2127 |
2081 |
2128 case 25: |
2082 case 25: |
2129 #line 676 "./grammar.y" |
2083 #line 625 "./grammar.y" |
2130 { if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) { |
2084 { if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) { |
2131 if (!(yyvsp[(1) - (2)].c)->back->sink_name) { |
2085 if (!(yyvsp[(1) - (2)].c)->back->sink_name) { |
2132 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element")); |
2086 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element")); |
2133 gst_parse_free_link ((yyvsp[(1) - (2)].c)->back); |
2087 gst_parse_free_link ((yyvsp[(1) - (2)].c)->back); |
2134 } else { |
2088 } else { |
2135 graph->links = g_slist_prepend (graph->links, (yyvsp[(1) - (2)].c)->back); |
2089 ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(1) - (2)].c)->back); |
2136 } |
2090 } |
2137 if (!(yyvsp[(2) - (2)].c)->front->src_name) { |
2091 if (!(yyvsp[(2) - (2)].c)->front->src_name) { |
2138 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without sink element")); |
2092 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without sink element")); |
2139 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front); |
2093 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front); |
2140 } else { |
2094 } else { |
2141 graph->links = g_slist_prepend (graph->links, (yyvsp[(2) - (2)].c)->front); |
2095 ((graph_t *) graph)->links = g_slist_prepend (((graph_t *) graph)->links, (yyvsp[(2) - (2)].c)->front); |
2142 } |
2096 } |
2143 (yyvsp[(1) - (2)].c)->back = NULL; |
2097 (yyvsp[(1) - (2)].c)->back = NULL; |
2144 } else if ((yyvsp[(1) - (2)].c)->back) { |
2098 } else if ((yyvsp[(1) - (2)].c)->back) { |
2145 if (!(yyvsp[(1) - (2)].c)->back->sink_name) { |
2099 if (!(yyvsp[(1) - (2)].c)->back->sink_name) { |
2146 (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first; |
2100 (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first; |
2218 (yyval.c) = (yyvsp[(2) - (2)].c); |
2172 (yyval.c) = (yyvsp[(2) - (2)].c); |
2219 ;} |
2173 ;} |
2220 break; |
2174 break; |
2221 |
2175 |
2222 case 29: |
2176 case 29: |
2223 #line 754 "./grammar.y" |
2177 #line 703 "./grammar.y" |
2224 { (yyval.c) = (yyvsp[(2) - (2)].c); |
2178 { (yyval.c) = (yyvsp[(2) - (2)].c); |
2225 if ((yyval.c)->front) { |
2179 if ((yyval.c)->front) { |
2226 GstElement *element = |
2180 GstElement *element = |
2227 gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL); |
2181 gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL); |
2228 if (!element) { |
2182 if (!element) { |
2229 SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, |
2183 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, |
2230 _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s)); |
2184 _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s)); |
2231 } else { |
2185 } else { |
2232 (yyval.c)->front->src = element; |
2186 (yyval.c)->front->src = element; |
2233 graph->links = g_slist_prepend ( |
2187 ((graph_t *) graph)->links = g_slist_prepend ( |
2234 graph->links, (yyval.c)->front); |
2188 ((graph_t *) graph)->links, (yyval.c)->front); |
2235 (yyval.c)->front = NULL; |
2189 (yyval.c)->front = NULL; |
2236 (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element); |
2190 (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element); |
2237 } |
2191 } |
2238 } else { |
2192 } else { |
2239 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, |
2193 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, |
2240 _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s)); |
2194 _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s)); |
2241 } |
2195 } |
2242 g_free ((yyvsp[(1) - (2)].s)); |
2196 g_free ((yyvsp[(1) - (2)].s)); |
2243 ;} |
2197 ;} |
2244 break; |
2198 break; |
2245 |
2199 |
2246 case 30: |
2200 case 30: |
2247 #line 774 "./grammar.y" |
2201 #line 723 "./grammar.y" |
2248 { GstElement *element = |
2202 { GstElement *element = |
2249 gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL); |
2203 gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL); |
2250 if (!element) { |
2204 if (!element) { |
2251 SET_ERROR (graph->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, |
2205 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, |
2252 _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s)); |
2206 _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s)); |
2253 gst_parse_link_free ((yyvsp[(1) - (2)].l)); |
2207 gst_parse_link_free ((yyvsp[(1) - (2)].l)); |
2254 g_free ((yyvsp[(2) - (2)].s)); |
2208 g_free ((yyvsp[(2) - (2)].s)); |
2255 YYERROR; |
2209 YYERROR; |
2256 } else if ((yyvsp[(1) - (2)].l)->sink_name || (yyvsp[(1) - (2)].l)->sink_pads) { |
2210 } else if ((yyvsp[(1) - (2)].l)->sink_name || (yyvsp[(1) - (2)].l)->sink_pads) { |
2257 gst_object_unref (element); |
2211 gst_object_unref (element); |
2258 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, |
2212 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, |
2259 _("could not link sink element for URI \"%s\""), (yyvsp[(2) - (2)].s)); |
2213 _("could not link sink element for URI \"%s\""), (yyvsp[(2) - (2)].s)); |
2260 gst_parse_link_free ((yyvsp[(1) - (2)].l)); |
2214 gst_parse_link_free ((yyvsp[(1) - (2)].l)); |
2261 g_free ((yyvsp[(2) - (2)].s)); |
2215 g_free ((yyvsp[(2) - (2)].s)); |
2262 YYERROR; |
2216 YYERROR; |
2263 } else { |
2217 } else { |
2270 g_free ((yyvsp[(2) - (2)].s)); |
2224 g_free ((yyvsp[(2) - (2)].s)); |
2271 ;} |
2225 ;} |
2272 break; |
2226 break; |
2273 |
2227 |
2274 case 31: |
2228 case 31: |
2275 #line 799 "./grammar.y" |
2229 #line 748 "./grammar.y" |
2276 { SET_ERROR (graph->error, GST_PARSE_ERROR_EMPTY, _("empty pipeline not allowed")); |
2230 { SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY, _("empty pipeline not allowed")); |
2277 (yyval.g) = graph; |
2231 (yyval.g) = (graph_t *) graph; |
2278 ;} |
2232 ;} |
2279 break; |
2233 break; |
2280 |
2234 |
2281 case 32: |
2235 case 32: |
2282 #line 802 "./grammar.y" |
2236 #line 751 "./grammar.y" |
2283 { (yyval.g) = graph; |
2237 { (yyval.g) = (graph_t *) graph; |
2284 if ((yyvsp[(1) - (1)].c)->front) { |
2238 if ((yyvsp[(1) - (1)].c)->front) { |
2285 if (!(yyvsp[(1) - (1)].c)->front->src_name) { |
2239 if (!(yyvsp[(1) - (1)].c)->front->src_name) { |
2286 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without source element")); |
2240 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without source element")); |
2287 gst_parse_free_link ((yyvsp[(1) - (1)].c)->front); |
2241 gst_parse_free_link ((yyvsp[(1) - (1)].c)->front); |
2288 } else { |
2242 } else { |
2289 (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front); |
2243 (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front); |
2290 } |
2244 } |
2291 (yyvsp[(1) - (1)].c)->front = NULL; |
2245 (yyvsp[(1) - (1)].c)->front = NULL; |
2292 } |
2246 } |
2293 if ((yyvsp[(1) - (1)].c)->back) { |
2247 if ((yyvsp[(1) - (1)].c)->back) { |
2294 if (!(yyvsp[(1) - (1)].c)->back->sink_name) { |
2248 if (!(yyvsp[(1) - (1)].c)->back->sink_name) { |
2295 SET_ERROR (graph->error, GST_PARSE_ERROR_LINK, _("link without sink element")); |
2249 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK, _("link without sink element")); |
2296 gst_parse_free_link ((yyvsp[(1) - (1)].c)->back); |
2250 gst_parse_free_link ((yyvsp[(1) - (1)].c)->back); |
2297 } else { |
2251 } else { |
2298 (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back); |
2252 (yyval.g)->links = g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back); |
2299 } |
2253 } |
2300 (yyvsp[(1) - (1)].c)->back = NULL; |
2254 (yyvsp[(1) - (1)].c)->back = NULL; |