| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | #include <gst/gst.h> |
|---|
| 6 | |
|---|
| 7 | void |
|---|
| 8 | test (void) |
|---|
| 9 | { |
|---|
| 10 | GstCaps *c = gst_caps_new_empty (); |
|---|
| 11 | GstStructure *s = gst_structure_empty_new ("video/x-raw-rgb"); |
|---|
| 12 | |
|---|
| 13 | gst_structure_set (s, |
|---|
| 14 | "width", G_TYPE_INT, 640, |
|---|
| 15 | "height", G_TYPE_INT, 480, |
|---|
| 16 | "framerate", GST_TYPE_FRACTION, 10, 1, |
|---|
| 17 | "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), |
|---|
| 18 | NULL); |
|---|
| 19 | gst_caps_append_structure (c, s); |
|---|
| 20 | |
|---|
| 21 | g_print ("structure: %s\n", gst_structure_to_string (s)); |
|---|
| 22 | g_print ("caps: %s\n", gst_caps_to_string (c)); |
|---|
| 23 | |
|---|
| 24 | gst_caps_unref (c); |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | gint |
|---|
| 28 | main (gint argc, |
|---|
| 29 | gchar *argv[]) |
|---|
| 30 | { |
|---|
| 31 | gst_init (&argc, &argv); |
|---|
| 32 | |
|---|
| 33 | test (); |
|---|
| 34 | |
|---|
| 35 | return 0; |
|---|
| 36 | } |
|---|