summaryrefslogtreecommitdiff
path: root/omx/gstomxanalogaudiosink.c
diff options
context:
space:
mode:
authorJosep Torra <n770galaxy@gmail.com>2014-04-04 14:11:58 +0200
committerJosep Torra <n770galaxy@gmail.com>2014-05-09 13:15:18 +0200
commitb3eb4d897d83713d858839ebd8b01bad510e13b0 (patch)
treece1e598c13dd0e99260e606ebacddee66679dd65 /omx/gstomxanalogaudiosink.c
parent893587f69c64f17bb29605bfcb868d2f20a9a4d2 (diff)
downloadgst-omx-b3eb4d897d83713d858839ebd8b01bad510e13b0.tar.gz
omxaudiosink: Implements OpenMAX based audio sinks
Provides omxanalogaudiosink and omxhdmiaudiosink elements on the Raspberry PI. - omxanalogaudiosink is capable to render raw mono or stereo audio through the jack output. - omxhdmiaudiosink is capable to render raw audio up to 8 channels and transmit ac3/dts(IEC 61937) through the HDMI output. - sinks provide a clock derived from rendered samples - sinks support the GstStreamVolume interface by implementing the volume and mute properties. https://bugzilla.gnome.org/show_bug.cgi?id=728962
Diffstat (limited to 'omx/gstomxanalogaudiosink.c')
-rw-r--r--omx/gstomxanalogaudiosink.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/omx/gstomxanalogaudiosink.c b/omx/gstomxanalogaudiosink.c
new file mode 100644
index 0000000..7c8c885
--- /dev/null
+++ b/omx/gstomxanalogaudiosink.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2014, Fluendo, S.A.
+ * Copyright (C) 2014, Metrological Media Innovations B.V.
+ * Author: Josep Torra <josep@fluendo.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include "gstomxanalogaudiosink.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_omx_analog_audio_sink_debug_category);
+#define GST_CAT_DEFAULT gst_omx_analog_audio_sink_debug_category
+
+/* class initialization */
+
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_omx_analog_audio_sink_debug_category, \
+ "omxanalogaudiosink", 0, "debug category for gst-omx analog audio sink");
+
+G_DEFINE_TYPE_WITH_CODE (GstOMXAnalogAudioSink, gst_omx_analog_audio_sink,
+ GST_TYPE_OMX_AUDIO_SINK, DEBUG_INIT);
+
+static void
+gst_omx_analog_audio_sink_class_init (GstOMXAnalogAudioSinkClass * klass)
+{
+ GstOMXAudioSinkClass *audiosink_class = GST_OMX_AUDIO_SINK_CLASS (klass);
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
+ audiosink_class->cdata.default_sink_template_caps = "audio/x-raw, "
+ "format = (string) " GST_AUDIO_FORMATS_ALL ", "
+ "layout = (string) interleaved, "
+ "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ] ";
+ audiosink_class->destination = "local";
+
+ gst_element_class_set_static_metadata (element_class,
+ "OpenMAX Analog Audio Sink",
+ "Sink/Audio", "Output analog audio", "Josep Torra <josep@fluendo.com>");
+
+ gst_omx_set_default_role (&audiosink_class->cdata, "audio_render.local");
+}
+
+static void
+gst_omx_analog_audio_sink_init (GstOMXAnalogAudioSink * self)
+{
+}