gst_plugins_base/gst-libs/gst/audio/testchannels.c
changeset 0 0e761a78d257
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /* GStreamer Multichannel Test
       
    18  * (c) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
       
    19  *
       
    20  * This library is free software; you can redistribute it and/or
       
    21  * modify it under the terms of the GNU Library General Public
       
    22  * License as published by the Free Software Foundation; either
       
    23  * version 2 of the License, or (at your option) any later version.
       
    24  *
       
    25  * This library is distributed in the hope that it will be useful,
       
    26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    28  * Library General Public License for more details.
       
    29  *
       
    30  * You should have received a copy of the GNU Library General Public
       
    31  * License along with this library; if not, write to the
       
    32  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    33  * Boston, MA 02111-1307, USA.
       
    34  */
       
    35 
       
    36 #ifdef HAVE_CONFIG_H
       
    37 #include <config.h>
       
    38 #endif
       
    39 
       
    40 #include <gst/gst.h>
       
    41 
       
    42 #include <multichannel.c>
       
    43 #include <multichannel-enumtypes.c>
       
    44 
       
    45 gint
       
    46 main (gint argc, gchar * argv[])
       
    47 {
       
    48   gchar *str;
       
    49   GstCaps *caps;
       
    50   GstAudioChannelPosition pos[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
       
    51     GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
       
    52   };
       
    53 
       
    54   /* register multichannel type */
       
    55   gst_init (&argc, &argv);
       
    56   gst_audio_channel_position_get_type ();
       
    57 
       
    58   /* test some caps-string conversions */
       
    59   caps = gst_caps_new_simple ("audio/x-raw-int",
       
    60       "channels", G_TYPE_INT, 2, NULL);
       
    61   str = gst_caps_to_string (caps);
       
    62   g_print ("Test caps #1: %s\n", str);
       
    63   g_free (str);
       
    64   gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
       
    65   str = gst_caps_to_string (caps);
       
    66   g_print ("Test caps #2: %s\n", str);
       
    67   g_free (str);
       
    68   gst_caps_unref (caps);
       
    69 
       
    70   return 0;
       
    71 }