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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
25 #include "gst/gst-i18n-plugin.h"
29 #include <gst/audio/audio.h>
34 static GstElementDetails sfsrc_details = GST_ELEMENT_DETAILS ("Sndfile source",
36 "Read audio streams from disk using libsndfile",
37 "Andy Wingo <wingo at pobox dot com>");
39 static GstElementDetails sfsink_details = GST_ELEMENT_DETAILS ("Sndfile sink",
41 "Write audio streams to disk using libsndfile",
42 "Andy Wingo <wingo at pobox dot com>");
54 static GstStaticPadTemplate sf_src_factory = GST_STATIC_PAD_TEMPLATE ("src%d",
57 GST_STATIC_CAPS (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS)
60 static GstStaticPadTemplate sf_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink%d",
63 GST_STATIC_CAPS (GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS)
66 #define GST_TYPE_SF_MAJOR_TYPES (gst_sf_major_types_get_type())
68 gst_sf_major_types_get_type (void)
70 static GType sf_major_types_type = 0;
71 static GEnumValue *sf_major_types = NULL;
73 if (!sf_major_types_type) {
74 SF_FORMAT_INFO format_info;
77 sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int));
79 sf_major_types = g_new0 (GEnumValue, count + 1);
81 for (k = 0; k < count; k++) {
82 format_info.format = k;
83 sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info,
84 sizeof (format_info));
85 sf_major_types[k].value = format_info.format;
86 sf_major_types[k].value_name = g_strdup (format_info.name);
87 sf_major_types[k].value_nick = g_strdup (format_info.extension);
89 /* Irritatingly enough, there exist major_types with the same extension. Let's
90 just hope that sndfile gives us the list in alphabetical order, as it
93 && strcmp (sf_major_types[k].value_nick,
94 sf_major_types[k - 1].value_nick) == 0) {
95 g_free (sf_major_types[k].value_nick);
96 sf_major_types[k].value_nick =
97 g_strconcat (sf_major_types[k - 1].value_nick, "-",
98 sf_major_types[k].value_name, NULL);
99 g_strcanon (sf_major_types[k].value_nick,
100 G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
104 sf_major_types_type =
105 g_enum_register_static ("GstSndfileMajorTypes", sf_major_types);
107 return sf_major_types_type;
110 #define GST_TYPE_SF_MINOR_TYPES (gst_sf_minor_types_get_type())
112 gst_sf_minor_types_get_type (void)
114 static GType sf_minor_types_type = 0;
115 static GEnumValue *sf_minor_types = NULL;
117 if (!sf_minor_types_type) {
118 SF_FORMAT_INFO format_info;
121 sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int));
123 sf_minor_types = g_new0 (GEnumValue, count + 1);
125 for (k = 0; k < count; k++) {
126 format_info.format = k;
127 sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &format_info,
128 sizeof (format_info));
129 sf_minor_types[k].value = format_info.format;
130 sf_minor_types[k].value_name = g_strdup (format_info.name);
131 sf_minor_types[k].value_nick = g_ascii_strdown (format_info.name, -1);
132 g_strcanon (sf_minor_types[k].value_nick, G_CSET_a_2_z G_CSET_DIGITS "-",
136 sf_minor_types_type =
137 g_enum_register_static ("GstSndfileMinorTypes", sf_minor_types);
139 return sf_minor_types_type;
142 static void gst_sfsrc_base_init (gpointer g_class);
143 static void gst_sfsink_base_init (gpointer g_class);
144 static void gst_sf_class_init (GstSFClass * klass);
145 static void gst_sf_init (GstSF * this);
146 static void gst_sf_dispose (GObject * object);
147 static void gst_sf_set_property (GObject * object, guint prop_id,
148 const GValue * value, GParamSpec * pspec);
149 static void gst_sf_get_property (GObject * object, guint prop_id,
150 GValue * value, GParamSpec * pspec);
152 static GstClock *gst_sf_get_clock (GstElement * element);
153 static void gst_sf_set_clock (GstElement * element, GstClock * clock);
154 static GstPad *gst_sf_request_new_pad (GstElement * element,
155 GstPadTemplate * templ, const gchar * unused);
156 static void gst_sf_release_request_pad (GstElement * element, GstPad * pad);
157 static GstStateChangeReturn gst_sf_change_state (GstElement * element,
158 GstStateChange transition);
160 static GstPadLinkReturn gst_sf_link (GstPad * pad, const GstCaps * caps);
162 static void gst_sf_loop (GstElement * element);
164 static GstClockTime gst_sf_get_time (GstClock * clock, gpointer data);
166 static gboolean gst_sf_open_file (GstSF * this);
167 static void gst_sf_close_file (GstSF * this);
169 static GstElementClass *parent_class = NULL;
171 GST_DEBUG_CATEGORY_STATIC (gstsf_debug);
173 GST_CAT_LEVEL_LOG (gstsf_debug, GST_LEVEL_INFO, NULL, __VA_ARGS__)
174 #define INFO_OBJ(obj,...) \
175 GST_CAT_LEVEL_LOG (gstsf_debug, GST_LEVEL_INFO, obj, __VA_ARGS__)
178 gst_sf_get_type (void)
180 static GType sf_type = 0;
183 static const GTypeInfo sf_info = {
184 sizeof (GstSFClass), NULL,
186 (GClassInitFunc) NULL, /* don't even initialize the class */
191 (GInstanceInitFunc) NULL /* abstract base class */
194 sf_type = g_type_register_static (GST_TYPE_ELEMENT, "GstSF", &sf_info, 0);
200 gst_sfsrc_get_type (void)
202 static GType sfsrc_type = 0;
205 static const GTypeInfo sfsrc_info = {
209 (GClassInitFunc) gst_sf_class_init,
214 (GInstanceInitFunc) gst_sf_init,
218 g_type_register_static (GST_TYPE_SF, "GstSFSrc", &sfsrc_info, 0);
224 gst_sfsink_get_type (void)
226 static GType sfsink_type = 0;
229 static const GTypeInfo sfsink_info = {
231 gst_sfsink_base_init,
233 (GClassInitFunc) gst_sf_class_init,
238 (GInstanceInitFunc) gst_sf_init,
242 g_type_register_static (GST_TYPE_SF, "GstSFSink", &sfsink_info, 0);
248 gst_sfsrc_base_init (gpointer g_class)
250 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
252 gst_element_class_add_pad_template (element_class,
253 gst_static_pad_template_get (&sf_src_factory));
254 gst_element_class_set_details (element_class, &sfsrc_details);
258 gst_sfsink_base_init (gpointer g_class)
260 GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
262 gst_element_class_add_pad_template (element_class,
263 gst_static_pad_template_get (&sf_sink_factory));
264 gst_element_class_set_details (element_class, &sfsink_details);
268 gst_sf_class_init (GstSFClass * klass)
270 GObjectClass *gobject_class;
271 GstElementClass *gstelement_class;
274 gobject_class = (GObjectClass *) klass;
275 gstelement_class = (GstElementClass *) klass;
277 /* although this isn't really the parent class, that's ok; GstSF doesn't
278 override any methods */
279 parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
281 gst_element_class_install_std_props (gstelement_class, "location",
282 ARG_LOCATION, G_PARAM_READWRITE, NULL);
283 pspec = g_param_spec_enum
284 ("major-type", "Major type", "Major output type", GST_TYPE_SF_MAJOR_TYPES,
285 SF_FORMAT_WAV, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
286 g_object_class_install_property (gobject_class, ARG_MAJOR_TYPE, pspec);
287 pspec = g_param_spec_enum
288 ("minor-type", "Minor type", "Minor output type", GST_TYPE_SF_MINOR_TYPES,
289 SF_FORMAT_FLOAT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
290 g_object_class_install_property (gobject_class, ARG_MINOR_TYPE, pspec);
292 if (G_TYPE_FROM_CLASS (klass) == GST_TYPE_SFSRC) {
293 pspec = g_param_spec_boolean ("loop", "Loop?", "Loop the output?",
294 FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
295 g_object_class_install_property (gobject_class, ARG_LOOP, pspec);
297 g_param_spec_boolean ("create-pads", "Create pads?",
298 "Create one pad for each channel in the sound file?", TRUE,
299 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
300 g_object_class_install_property (gobject_class, ARG_CREATE_PADS, pspec);
303 gobject_class->dispose = gst_sf_dispose;
304 gobject_class->set_property = gst_sf_set_property;
305 gobject_class->get_property = gst_sf_get_property;
307 gstelement_class->get_clock = gst_sf_get_clock;
308 gstelement_class->set_clock = gst_sf_set_clock;
309 gstelement_class->change_state = gst_sf_change_state;
310 gstelement_class->request_new_pad = gst_sf_request_new_pad;
311 gstelement_class->release_pad = gst_sf_release_request_pad;
315 gst_sf_init (GstSF * this)
317 gst_element_set_loop_function (GST_ELEMENT (this), gst_sf_loop);
318 this->provided_clock = gst_audio_clock_new ("sfclock", gst_sf_get_time, this);
319 gst_object_set_parent (GST_OBJECT (this->provided_clock), GST_OBJECT (this));
323 gst_sf_dispose (GObject * object)
325 GstSF *this = (GstSF *) object;
327 if (this->provided_clock) {
328 gst_object_unparent (GST_OBJECT (this->provided_clock));
329 this->provided_clock = NULL;
332 G_OBJECT_CLASS (parent_class)->dispose (object);
336 gst_sf_set_property (GObject * object, guint prop_id, const GValue * value,
339 GstSF *this = GST_SF (object);
343 if (GST_OBJECT_FLAG_IS_SET (object, GST_SF_OPEN))
344 gst_sf_close_file (this);
346 g_free (this->filename);
348 if (g_value_get_string (value))
349 this->filename = g_strdup (g_value_get_string (value));
351 this->filename = NULL;
354 gst_sf_open_file (this);
358 this->format_major = g_value_get_enum (value);
362 this->format_subtype = g_value_get_enum (value);
366 this->loop = g_value_get_boolean (value);
369 case ARG_CREATE_PADS:
370 this->create_pads = g_value_get_boolean (value);
371 if (this->file && this->create_pads) {
374 for (i = g_list_length (this->channels); i < this->numchannels; i++)
375 gst_element_get_request_pad ((GstElement *) this, "src%d");
385 gst_sf_get_property (GObject * object, guint prop_id, GValue * value,
388 GstSF *this = GST_SF (object);
392 g_value_set_string (value, this->filename);
396 g_value_set_enum (value, this->format_major);
400 g_value_set_enum (value, this->format_subtype);
404 g_value_set_boolean (value, this->loop);
407 case ARG_CREATE_PADS:
408 g_value_set_boolean (value, this->create_pads);
412 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
418 gst_sf_get_clock (GstElement * element)
420 GstSF *this = GST_SF (element);
422 return this->provided_clock;
426 gst_sf_set_clock (GstElement * element, GstClock * clock)
428 GstSF *this = GST_SF (element);
434 gst_sf_get_time (GstClock * clock, gpointer data)
436 GstSF *this = GST_SF (data);
441 static GstStateChangeReturn
442 gst_sf_change_state (GstElement * element, GstStateChange transition)
444 GstSF *this = GST_SF (element);
446 switch (transition) {
447 case GST_STATE_CHANGE_NULL_TO_READY:
449 case GST_STATE_CHANGE_READY_TO_PAUSED:
451 case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
452 gst_audio_clock_set_active (GST_AUDIO_CLOCK (this->provided_clock), TRUE);
454 case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
455 gst_audio_clock_set_active (GST_AUDIO_CLOCK (this->provided_clock),
458 case GST_STATE_CHANGE_PAUSED_TO_READY:
460 case GST_STATE_CHANGE_READY_TO_NULL:
461 if (GST_OBJECT_FLAG_IS_SET (this, GST_SF_OPEN))
462 gst_sf_close_file (this);
466 if (GST_ELEMENT_CLASS (parent_class)->change_state)
467 return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
469 return GST_STATE_CHANGE_SUCCESS;
473 gst_sf_request_new_pad (GstElement * element, GstPadTemplate * templ,
474 const gchar * unused)
478 GstSFChannel *channel;
480 this = GST_SF (element);
481 channel = g_new0 (GstSFChannel, 1);
483 if (templ->direction == GST_PAD_SINK) {
484 /* we have an SFSink */
485 name = g_strdup_printf ("sink%d", this->channelcount);
488 gst_sf_close_file (this);
489 gst_sf_open_file (this);
492 /* we have an SFSrc */
493 name = g_strdup_printf ("src%d", this->channelcount);
496 channel->pad = gst_pad_new_from_template (templ, name);
497 gst_element_add_pad (GST_ELEMENT (this), channel->pad);
498 gst_pad_set_link_function (channel->pad, gst_sf_link);
500 this->channels = g_list_append (this->channels, channel);
501 this->channelcount++;
503 INFO_OBJ (element, "added pad %s\n", name);
510 gst_sf_release_request_pad (GstElement * element, GstPad * pad)
513 GstSFChannel *channel = NULL;
516 this = GST_SF (element);
518 if (GST_STATE (element) == GST_STATE_PLAYING) {
520 ("You can't release a request pad if the element is PLAYING, sorry.");
524 for (l = this->channels; l; l = l->next) {
525 if (GST_SF_CHANNEL (l)->pad == pad) {
526 channel = GST_SF_CHANNEL (l);
531 g_return_if_fail (channel != NULL);
533 INFO_OBJ (element, "Releasing request pad %s", GST_PAD_NAME (channel->pad));
535 if (GST_OBJECT_FLAG_IS_SET (element, GST_SF_OPEN))
536 gst_sf_close_file (this);
538 gst_element_remove_pad (element, channel->pad);
539 this->channels = g_list_remove (this->channels, channel);
544 static GstPadLinkReturn
545 gst_sf_link (GstPad * pad, const GstCaps * caps)
547 GstSF *this = (GstSF *) GST_OBJECT_PARENT (pad);
548 GstStructure *structure;
550 structure = gst_caps_get_structure (caps, 0);
552 gst_structure_get_int (structure, "rate", &this->rate);
553 gst_structure_get_int (structure, "buffer-frames", &this->buffer_frames);
555 INFO_OBJ (this, "linked pad %s:%s with fixed caps, rate=%d, frames=%d",
556 GST_DEBUG_PAD_NAME (pad), this->rate, this->buffer_frames);
558 if (this->numchannels) {
559 /* we can go ahead and allocate our buffer */
561 g_free (this->buffer);
563 g_malloc (this->numchannels * this->buffer_frames * sizeof (float));
564 memset (this->buffer, 0,
565 this->numchannels * this->buffer_frames * sizeof (float));
567 return GST_PAD_LINK_OK;
571 gst_sf_open_file (GstSF * this)
576 g_return_val_if_fail (!GST_OBJECT_FLAG_IS_SET (this, GST_SF_OPEN), FALSE);
580 if (!this->filename) {
581 GST_ELEMENT_ERROR (this, RESOURCE, NOT_FOUND,
582 (_("No filename specified.")), (NULL));
586 if (GST_IS_SFSRC (this)) {
591 INFO_OBJ (this, "Not opening %s yet because caps are not set",
594 } else if (!this->numchannels) {
595 INFO_OBJ (this, "Not opening %s yet because we have no input channels",
601 this->format = this->format_major | this->format_subtype;
602 info.samplerate = this->rate;
603 info.channels = this->numchannels;
604 info.format = this->format;
606 INFO_OBJ (this, "Opening %s with rate %d, %d channels, format 0x%x",
607 this->filename, info.samplerate, info.channels, info.format);
609 if (!sf_format_check (&info)) {
610 GST_ELEMENT_ERROR (this, STREAM, ENCODE, (NULL),
611 ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid",
612 info.samplerate, info.channels, info.format));
617 this->file = sf_open (this->filename, mode, &info);
620 GST_ELEMENT_ERROR (this, RESOURCE, OPEN_WRITE,
621 (_("Could not open file \"%s\" for writing."), this->filename),
622 ("soundfile error: %s", sf_strerror (NULL)));
626 if (GST_IS_SFSRC (this)) {
629 /* the number of channels in the file can be different than the number of
631 this->numchannels = info.channels;
632 this->rate = info.samplerate;
634 if (this->create_pads) {
637 for (i = g_list_length (this->channels); i < this->numchannels; i++)
638 gst_element_get_request_pad ((GstElement *) this, "src%d");
641 for (l = this->channels; l; l = l->next)
642 /* queue the need to set caps */
643 GST_SF_CHANNEL (l)->caps_set = FALSE;
646 GST_OBJECT_FLAG_SET (this, GST_SF_OPEN);
652 gst_sf_close_file (GstSF * this)
656 g_return_if_fail (GST_OBJECT_FLAG_IS_SET (this, GST_SF_OPEN));
658 INFO_OBJ (this, "Closing file %s", this->filename);
660 if ((err = sf_close (this->file)))
661 GST_ELEMENT_ERROR (this, RESOURCE, CLOSE,
662 ("Could not close file file \"%s\".", this->filename),
663 ("soundfile error: %s", strerror (err)));
665 GST_OBJECT_FLAG_UNSET (this, GST_SF_OPEN);
669 g_free (this->buffer);
674 gst_sf_loop (GstElement * element)
679 this = (GstSF *) element;
681 if (this->channels == NULL) {
682 GST_ELEMENT_ERROR (element, CORE, PAD, (NULL),
683 ("You must connect at least one pad to sndfile elements."));
687 if (GST_IS_SFSRC (this)) {
691 int buffer_frames = this->buffer_frames;
692 int nchannels = this->numchannels;
693 GstSFChannel *channel = NULL;
695 gfloat *buf = this->buffer;
698 if (!GST_OBJECT_FLAG_IS_SET (this, GST_SF_OPEN))
699 if (!gst_sf_open_file (this))
700 return; /* we've already set gst_element_error */
702 if (buffer_frames == 0) {
703 /* we have to set the caps later */
704 buffer_frames = this->buffer_frames = 1024;
708 g_malloc (this->numchannels * this->buffer_frames * sizeof (float));
709 memset (this->buffer, 0,
710 this->numchannels * this->buffer_frames * sizeof (float));
713 read = sf_readf_float (this->file, buf, buffer_frames);
714 if (read < buffer_frames)
718 for (i = 0, l = this->channels; l; l = l->next, i++) {
719 channel = GST_SF_CHANNEL (l);
721 /* don't push on disconnected pads -- useful for ::create-pads=TRUE */
722 if (!GST_PAD_PEER (channel->pad))
725 if (!channel->caps_set) {
727 gst_caps_copy (GST_PAD_CAPS (GST_SF_CHANNEL (l)->pad));
730 (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (GST_SF_CHANNEL
732 gst_caps_set_simple (caps, "rate", G_TYPE_INT, this->rate,
733 "buffer-frames", G_TYPE_INT, this->buffer_frames, NULL);
734 if (!gst_pad_try_set_caps (GST_SF_CHANNEL (l)->pad, caps)) {
735 GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL),
736 ("Opened file with sample rate %d, but could not set caps",
738 gst_sf_close_file (this);
741 channel->caps_set = TRUE;
744 out = gst_buffer_new_and_alloc (read * sizeof (float));
745 data = (gfloat *) GST_BUFFER_DATA (out);
746 for (j = 0; j < read; j++)
747 data[j] = buf[j * nchannels + i % nchannels];
748 gst_pad_push (channel->pad, GST_DATA (out));
751 this->time += read * (GST_SECOND / this->rate);
752 gst_audio_clock_update_time ((GstAudioClock *) this->provided_clock,
757 sf_seek (this->file, (sf_count_t) 0, SEEK_SET);
760 for (l = this->channels; l; l = l->next)
761 gst_pad_push (GST_SF_CHANNEL (l)->pad,
762 GST_DATA (gst_event_new (GST_EVENT_EOS)));
763 gst_element_set_eos (element);
767 sf_count_t written, num_to_write;
769 int buffer_frames = this->buffer_frames;
770 int nchannels = this->numchannels;
771 GstSFChannel *channel = NULL;
773 gfloat *buf = this->buffer;
776 /* the problem: we can't allocate a buffer for pulled data before caps is
777 * set, and we can't open the file without the sample rate from the
780 num_to_write = buffer_frames;
782 INFO_OBJ (this, "looping, buffer_frames=%d, nchannels=%d", buffer_frames,
785 for (i = 0, l = this->channels; l; l = l->next, i++) {
786 channel = GST_SF_CHANNEL (l);
789 in = GST_BUFFER (gst_pad_pull (channel->pad));
791 if (buffer_frames == 0) {
792 /* pulling a buffer from the pad should have caused capsnego to occur,
793 which then would set this->buffer_frames to a new value */
794 buffer_frames = this->buffer_frames;
795 if (buffer_frames == 0) {
796 GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, (NULL),
797 ("format wasn't negotiated before chain function"));
801 num_to_write = buffer_frames;
804 if (!GST_OBJECT_FLAG_IS_SET (this, GST_SF_OPEN))
805 if (!gst_sf_open_file (this))
806 return; /* we've already set gst_element_error */
808 if (GST_IS_EVENT (in)) {
809 switch (GST_EVENT_TYPE (in)) {
811 case GST_EVENT_INTERRUPT:
821 data = (gfloat *) GST_BUFFER_DATA (in);
823 MIN (num_to_write, GST_BUFFER_SIZE (in) / sizeof (gfloat));
824 for (j = 0; j < num_to_write; j++)
825 buf[j * nchannels + i % nchannels] = data[j];
828 gst_data_unref ((GstData *) in);
832 written = sf_writef_float (this->file, buf, num_to_write);
833 if (written != num_to_write)
834 GST_ELEMENT_ERROR (element, RESOURCE, WRITE,
835 (_("Could not write to file \"%s\"."), this->filename),
836 ("soundfile error: %s", sf_strerror (this->file)));
839 this->time += num_to_write * (GST_SECOND / this->rate);
840 gst_audio_clock_update_time ((GstAudioClock *) this->provided_clock,
843 if (num_to_write != buffer_frames)
844 gst_element_set_eos (element);
849 plugin_init (GstPlugin * plugin)
851 if (!gst_library_load ("gstaudio"))
854 GST_DEBUG_CATEGORY_INIT (gstsf_debug, "sf",
855 GST_DEBUG_FG_WHITE | GST_DEBUG_BG_GREEN | GST_DEBUG_BOLD,
856 "libsndfile plugin");
858 if (!gst_element_register (plugin, "sfsrc", GST_RANK_NONE, GST_TYPE_SFSRC))
861 if (!gst_element_register (plugin, "sfsink", GST_RANK_NONE, GST_TYPE_SFSINK))
865 setlocale (LC_ALL, "");
866 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
867 #endif /* ENABLE_NLS */
872 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
875 "use libsndfile to read and write audio from and to files",
876 plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)