1 /* GStreamer libsndfile plugin
2 * Copyright (C) 2003 Andy Wingo <wingo at pobox dot com>
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.
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.
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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
25 #include <glib/gi18n-lib.h>
28 #include "gstsfelements.h"
33 gst_sf_create_audio_template_caps (void)
35 GstCaps *caps = gst_caps_new_empty ();
36 SF_FORMAT_INFO format_info;
40 sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (gint));
42 for (k = 0; k < count; k++) {
43 format_info.format = k;
44 sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info));
46 switch (format_info.format) {
47 case SF_FORMAT_IRCAM: /* Berkeley/IRCAM/CARL */
48 fmt = "audio/x-ircam";
50 case SF_FORMAT_NIST: /* Sphere NIST format. */
53 case SF_FORMAT_PAF: /* Ensoniq PARIS file format. */
54 fmt = "audio/x-paris";
56 case SF_FORMAT_SDS: /* Midi Sample Dump Standard */
59 case SF_FORMAT_SVX: /* Amiga IFF / SVX8 / SV16 format. */
62 case SF_FORMAT_VOC: /* VOC files. */
65 case SF_FORMAT_W64: /* Sonic Foundry's 64 bit RIFF/WAV */
68 case SF_FORMAT_XI: /* Fasttracker 2 Extended Instrument */
71 case SF_FORMAT_RF64: /* RF64 WAV file */
74 /* does not make sense to expose that */
75 case SF_FORMAT_RAW: /* RAW PCM data. */
76 /* we have other elements to handle these */
77 case SF_FORMAT_AIFF: /* Apple/SGI AIFF format */
78 case SF_FORMAT_AU: /* Sun/NeXT AU format */
79 case SF_FORMAT_FLAC: /* FLAC lossless file format */
80 case SF_FORMAT_OGG: /* Xiph OGG container */
81 case SF_FORMAT_WAV: /* Microsoft WAV format */
82 case SF_FORMAT_WAVEX: /* MS WAVE with WAVEFORMATEX */
84 GST_LOG ("skipping format '%s'", format_info.name);
86 case SF_FORMAT_MAT4: /* Matlab (tm) V4.2 / GNU Octave 2.0 */
87 case SF_FORMAT_MAT5: /* Matlab (tm) V5.0 / GNU Octave 2.1 */
88 case SF_FORMAT_PVF: /* Portable Voice Format */
89 case SF_FORMAT_HTK: /* HMM Tool Kit format */
90 case SF_FORMAT_AVR: /* Audio Visual Research */
91 case SF_FORMAT_SD2: /* Sound Designer 2 */
92 case SF_FORMAT_CAF: /* Core Audio File format */
93 case SF_FORMAT_WVE: /* Psion WVE format */
94 case SF_FORMAT_MPC2K: /* Akai MPC 2000 sampler */
97 GST_WARNING ("format 0x%x: '%s' is not mapped", format_info.format,
101 gst_caps_append_structure (caps, gst_structure_new_empty (fmt));
104 return gst_caps_simplify (caps);
108 sf_element_init (GstPlugin * plugin)
110 static gsize res = FALSE;
112 if (g_once_init_enter (&res)) {
114 GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
116 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
117 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
118 #endif /* ENABLE_NLS */
119 g_once_init_leave (&res, TRUE);