2000-12-19 16:38:16 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
static GstProps* mpeg2dec_sink_props_register (void) {
|
|
|
|
return gst_props_new (
|
|
|
|
"mpegtype", GST_PROPS_LIST (
|
2000-12-19 16:38:16 +00:00
|
|
|
GST_PROPS_INT(1),
|
|
|
|
GST_PROPS_INT(2)
|
|
|
|
),
|
2001-04-14 18:56:37 +00:00
|
|
|
NULL);
|
|
|
|
}
|
2000-12-19 16:38:16 +00:00
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
static GstProps* mpeg2dec_src_props_register (void) {
|
|
|
|
return gst_props_new (
|
|
|
|
"fourcc", GST_PROPS_LIST (
|
2001-03-31 00:13:51 +00:00
|
|
|
GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
|
|
|
|
GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2'))
|
2000-12-19 16:38:16 +00:00
|
|
|
),
|
2001-04-14 18:56:37 +00:00
|
|
|
"width", GST_PROPS_INT_RANGE (16, 4096),
|
|
|
|
"height", GST_PROPS_INT_RANGE (16, 4096),
|
|
|
|
NULL);
|
|
|
|
}
|
2000-12-19 16:38:16 +00:00
|
|
|
|
2001-01-19 22:15:21 +00:00
|
|
|
static GstProps *sinkprops = NULL,
|
2000-12-19 16:38:16 +00:00
|
|
|
*rawprops = NULL,
|
|
|
|
*testprops = NULL;
|
|
|
|
|
2001-01-19 22:15:21 +00:00
|
|
|
int main(int argc,char *argv[])
|
2000-12-19 16:38:16 +00:00
|
|
|
{
|
|
|
|
xmlDocPtr doc;
|
|
|
|
xmlNodePtr parent;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
doc = xmlNewDoc ("1.0");
|
2001-01-18 15:29:46 +00:00
|
|
|
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Properties", NULL);
|
2000-12-19 16:38:16 +00:00
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
g_thread_init (NULL);
|
|
|
|
_gst_props_initialize ();
|
2000-12-19 16:38:16 +00:00
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
sinkprops = mpeg2dec_sink_props_register ();
|
2001-01-18 15:29:46 +00:00
|
|
|
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props1", NULL);
|
2000-12-19 16:38:16 +00:00
|
|
|
gst_props_save_thyself (sinkprops, parent);
|
|
|
|
|
2001-04-14 18:56:37 +00:00
|
|
|
rawprops = mpeg2dec_src_props_register ();
|
2001-01-18 15:29:46 +00:00
|
|
|
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props2", NULL);
|
2000-12-19 16:38:16 +00:00
|
|
|
gst_props_save_thyself (rawprops, parent);
|
|
|
|
|
|
|
|
i=argc;
|
|
|
|
|
2001-01-19 22:15:21 +00:00
|
|
|
testprops = gst_props_new ("layer", GST_PROPS_INT (i),
|
2000-12-19 16:38:16 +00:00
|
|
|
"bitrate", GST_PROPS_INT_RANGE (i*300, i*10000),
|
|
|
|
NULL);
|
|
|
|
if (i==3) {
|
|
|
|
testprops = gst_props_merge (testprops,
|
2001-01-19 22:15:21 +00:00
|
|
|
gst_props_new ("framed", GST_PROPS_BOOLEAN (TRUE),
|
|
|
|
"mpegtest", GST_PROPS_BOOLEAN (FALSE),
|
|
|
|
"hello", GST_PROPS_LIST (
|
2001-03-31 00:13:51 +00:00
|
|
|
GST_PROPS_FOURCC (GST_MAKE_FOURCC (0,0,0x55,0x55)),
|
|
|
|
GST_PROPS_FOURCC (GST_MAKE_FOURCC (0,0,0x66,0x66))
|
2000-12-29 18:31:06 +00:00
|
|
|
),
|
2000-12-19 16:38:16 +00:00
|
|
|
NULL));
|
|
|
|
}
|
|
|
|
|
2001-01-18 15:29:46 +00:00
|
|
|
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props3", NULL);
|
2000-12-19 16:38:16 +00:00
|
|
|
gst_props_save_thyself (testprops, parent);
|
|
|
|
|
2001-03-18 02:42:30 +00:00
|
|
|
sinkprops = gst_props_set (sinkprops, "mpegtype", GST_PROPS_INT (1));
|
2001-03-31 00:13:51 +00:00
|
|
|
sinkprops = gst_props_set (sinkprops, "foobar", GST_PROPS_FOURCC (GST_MAKE_FOURCC (0x56, 0x56,0x56,0x56)));
|
2001-03-18 02:42:30 +00:00
|
|
|
|
|
|
|
g_print ("%08lx\n", gst_props_get_fourcc_int (sinkprops, "foobar"));
|
|
|
|
g_print ("%d\n", gst_props_get_int (sinkprops, "mpegtype"));
|
|
|
|
|
|
|
|
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props4", NULL);
|
|
|
|
gst_props_save_thyself (sinkprops, parent);
|
|
|
|
|
2000-12-19 16:38:16 +00:00
|
|
|
xmlDocDump(stdout, doc);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|