summaryrefslogtreecommitdiff
path: root/tests/autoplug3.c
blob: 7d2c3ee2eae889f7eb96035b0bcae9ce31783702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <gst/gst.h>

int
main (int argc, char *argv[])
{
  GstElement *element;
  GstElement *sink1, *sink2;
  GstAutoplug *autoplug;

  gst_init(&argc,&argv);

  sink1 = gst_elementfactory_make ("videosink", "videosink");
  sink2 = gst_elementfactory_make ("audiosink", "audiosink");

  autoplug = gst_autoplugfactory_make ("staticrender");
  
  element = gst_autoplug_to_renderers (autoplug, 
		  g_list_append (NULL, gst_caps_new ("mp3caps", "audio/mp3")), sink2, NULL);
  xmlSaveFile ("autoplug3_1.gst", gst_xml_write (element));

  element = gst_autoplug_to_renderers (autoplug, 
		  g_list_append (NULL, gst_caps_new ("mpeg1caps", "video/mpeg")), sink1, NULL);
  if (element) {
    xmlSaveFile ("autoplug3_2.gst", gst_xml_write (element));
  }

  element = gst_autoplug_to_caps (autoplug,
		  g_list_append (NULL, gst_caps_new_with_props(
			  "testcaps3",
			  "video/mpeg",
			  gst_props_new (
			      "mpegversion",  GST_PROPS_INT (1),
			      "systemstream", GST_PROPS_BOOLEAN (TRUE),
			      NULL))),
		  g_list_append (NULL, gst_caps_new("testcaps4","audio/raw")),
		  NULL);
  if (element) {
    xmlSaveFile ("autoplug3_3.gst", gst_xml_write (element));
  }

  element = gst_autoplug_to_caps (autoplug,
		  g_list_append (NULL, gst_caps_new_with_props(
			  "testcaps5",
			  "video/mpeg",
			  gst_props_new (
			      "mpegversion",  GST_PROPS_INT (1),
			      "systemstream", GST_PROPS_BOOLEAN (FALSE),
			      NULL))),
		  g_list_append (NULL, gst_caps_new("testcaps6", "video/raw")),
		  NULL);
  if (element) {
    xmlSaveFile ("autoplug3_4.gst", gst_xml_write (element));
  }

  element = gst_autoplug_to_caps (autoplug,
		  g_list_append (NULL, gst_caps_new(
			  "testcaps7",
			  "video/avi")),
		  g_list_append (NULL, gst_caps_new("testcaps8", "video/raw")),
		  g_list_append (NULL, gst_caps_new("testcaps9", "audio/raw")),
		  NULL);
  if (element) {
    xmlSaveFile ("autoplug3_5.gst", gst_xml_write (element));
  }

  element = gst_autoplug_to_caps (autoplug,
		  g_list_append (NULL, gst_caps_new_with_props(
			  "testcaps10",
			  "video/mpeg",
			  gst_props_new (
			      "mpegversion",  GST_PROPS_INT (1),
			      "systemstream", GST_PROPS_BOOLEAN (TRUE),
			      NULL))),
		  g_list_append (NULL, gst_caps_new("testcaps10", "video/raw")),
		  g_list_append (NULL, gst_caps_new("testcaps11", "audio/raw")),
		  NULL);
  if (element) {
    xmlSaveFile ("autoplug3_6.gst", gst_xml_write (element));
  }

  sink1 = gst_elementfactory_make ("videosink", "videosink");
  sink2 = gst_elementfactory_make ("audiosink", "audiosink");
  
  element = gst_autoplug_to_renderers (autoplug,
		  g_list_append (NULL, gst_caps_new_with_props(
			  "testcaps10",
			  "video/mpeg",
			  gst_props_new (
			      "mpegversion",  GST_PROPS_INT (1),
			      "systemstream", GST_PROPS_BOOLEAN (TRUE),
			      NULL))),
		  sink1,
		  sink2,
		  NULL);
  if (element) {
    xmlSaveFile ("autoplug3_7.gst", gst_xml_write (element));
  }

  exit (0);
}