|
1 /* GStreamer Multichannel Test |
|
2 * (c) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net> |
|
3 * |
|
4 * This library is free software; you can redistribute it and/or |
|
5 * modify it under the terms of the GNU Library General Public |
|
6 * License as published by the Free Software Foundation; either |
|
7 * version 2 of the License, or (at your option) any later version. |
|
8 * |
|
9 * This library is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 * Library General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Library General Public |
|
15 * License along with this library; if not, write to the |
|
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
17 * Boston, MA 02111-1307, USA. |
|
18 */ |
|
19 |
|
20 #ifdef HAVE_CONFIG_H |
|
21 #include <config.h> |
|
22 #endif |
|
23 |
|
24 #include <gst/gst.h> |
|
25 |
|
26 #include <multichannel.c> |
|
27 #include <multichannel-enumtypes.c> |
|
28 |
|
29 gint |
|
30 main (gint argc, gchar * argv[]) |
|
31 { |
|
32 gchar *str; |
|
33 GstCaps *caps; |
|
34 GstAudioChannelPosition pos[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, |
|
35 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT |
|
36 }; |
|
37 |
|
38 /* register multichannel type */ |
|
39 gst_init (&argc, &argv); |
|
40 gst_audio_channel_position_get_type (); |
|
41 |
|
42 /* test some caps-string conversions */ |
|
43 caps = gst_caps_new_simple ("audio/x-raw-int", |
|
44 "channels", G_TYPE_INT, 2, NULL); |
|
45 str = gst_caps_to_string (caps); |
|
46 g_print ("Test caps #1: %s\n", str); |
|
47 g_free (str); |
|
48 gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos); |
|
49 str = gst_caps_to_string (caps); |
|
50 g_print ("Test caps #2: %s\n", str); |
|
51 g_free (str); |
|
52 gst_caps_unref (caps); |
|
53 |
|
54 return 0; |
|
55 } |