2000-12-19 16:38:16 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
static GstPropsFactory mpeg2dec_sink_props = {
|
|
|
|
"mpegtype", GST_PROPS_LIST (
|
|
|
|
GST_PROPS_INT(1),
|
|
|
|
GST_PROPS_INT(2)
|
|
|
|
),
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstPropsFactory mpeg2dec_src_props = {
|
2001-01-19 22:15:21 +00:00
|
|
|
"fourcc", GST_PROPS_LIST (
|
|
|
|
GST_PROPS_FOURCC ('Y','V','1','2'),
|
|
|
|
GST_PROPS_FOURCC_INT (0x56595559)
|
2000-12-19 16:38:16 +00:00
|
|
|
),
|
|
|
|
"width", GST_PROPS_INT_RANGE (16, 4096),
|
|
|
|
"height", GST_PROPS_INT_RANGE (16, 4096),
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
|
|
|
_gst_type_initialize ();
|
|
|
|
|
|
|
|
sinkprops = gst_props_register (mpeg2dec_sink_props);
|
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);
|
|
|
|
|
|
|
|
rawprops = gst_props_register (mpeg2dec_src_props);
|
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 (
|
2000-12-29 18:31:06 +00:00
|
|
|
GST_PROPS_FOURCC_INT (0X5555),
|
|
|
|
GST_PROPS_FOURCC_INT (0X6666)
|
|
|
|
),
|
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);
|
|
|
|
|
|
|
|
xmlDocDump(stdout, doc);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|