[Gstreamer-openmax] [PATCH v3 2/3] Add default configuration

Felipe Contreras felipe.contreras at nokia.com
Wed Mar 3 14:43:15 PST 2010


From: Rob Clark <rob at ti.com>

A little bit hacky, but works just fine.

Signed-off-by: Felipe Contreras <felipe.contreras at nokia.com>
---
 omx/Makefile.am |    8 ++-
 omx/gstomx.c    |    2 +-
 omx/gstomx.conf |  203 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 211 insertions(+), 2 deletions(-)
 create mode 100644 omx/gstomx.conf

diff --git a/omx/Makefile.am b/omx/Makefile.am
index 4a3fbf9..80e7d9a 100644
--- a/omx/Makefile.am
+++ b/omx/Makefile.am
@@ -18,7 +18,8 @@ libgstomx_la_SOURCES = gstomx.c gstomx.h \
 		       gstomx_vorbisdec.c gstomx_vorbisdec.h \
 		       gstomx_mp3dec.c gstomx_mp3dec.h \
 		       gstomx_base_sink.c gstomx_base_sink.h \
-		       gstomx_audiosink.c gstomx_audiosink.h
+		       gstomx_audiosink.c gstomx_audiosink.h \
+		       gstomx_conf.c
 
 if EXPERIMENTAL
 libgstomx_la_SOURCES += gstomx_amrnbdec.c gstomx_amrnbdec.h \
@@ -47,3 +48,8 @@ libgstomx_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(top_builddir)/util/libutil.
 libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
 
 EXTRA_DIST = headers
+
+gstomx_conf.c: gstomx.conf
+	echo "const char *default_config =" > $@
+	cat $^ | $(CPP) $(CFLAGS) $(libgstomx_la_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) - | grep -v "^#" | sed 's/^.*/\"&\\\n"/' >> $@
+	echo ";" >> $@
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 8b082a2..89c9db5 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -66,7 +66,7 @@ GST_DEBUG_CATEGORY (gstomx_debug);
 static GstStructure *element_table = NULL;
 static GQuark element_name_quark;
 
-const gchar *default_config = NULL;
+extern const gchar *default_config;
 
 static GType (*get_type[]) (void) = {
     gst_omx_dummy_get_type,
diff --git a/omx/gstomx.conf b/omx/gstomx.conf
new file mode 100644
index 0000000..c22c6d6
--- /dev/null
+++ b/omx/gstomx.conf
@@ -0,0 +1,203 @@
+#include "config.h"
+
+/* in case of multiple OMX components mapping to a single gst-openmax element
+ * class, a dynamic subclass can be created by specifying the gst-openmax
+ * type as the 'parent-type' and specifying a new unique type name as the
+ * 'type' parameter:
+ */
+omx_dummy,
+  parent-type=GstOmxDummy,
+  type=GstOmxDummyOne,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.bellagio.dummy,
+  rank=0;
+
+/* for testing: */
+omx_dummy_2,
+  parent-type=GstOmxDummy,
+  type=GstOmxDummyTwo,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.dummy2,
+  rank=256;
+
+omx_mpeg4dec,
+  type=GstOmxMpeg4Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_decoder.mpeg4,
+  rank=256;
+
+omx_h264dec,
+  type=GstOmxH264Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_decoder.avc,
+  rank=256;
+
+omx_h263dec,
+  type=GstOmxH263Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_decoder.h263,
+  rank=256;
+
+omx_wmvdec,
+  type=GstOmxWmvDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_decoder.wmv,
+  rank=256;
+
+omx_mpeg4enc,
+  type=GstOmxMpeg4Enc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_encoder.mpeg4,
+  rank=256;
+
+omx_h264enc,
+  type=GstOmxH264Enc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_encoder.avc,
+  rank=256;
+
+omx_h263enc,
+  type=GstOmxH263Enc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.video_encoder.h263,
+  rank=256;
+
+omx_vorbisdec,
+  type=GstOmxVorbisDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.ogg.single,
+  rank=128;
+
+omx_mp3dec,
+  type=GstOmxMp3Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.mp3.mad,
+  rank=256;
+
+#ifdef EXPERIMENTAL
+
+omx_mp2dec,
+  type=GstOmxMp2Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.mp3.mad,
+  rank=256;
+
+omx_amrnbdec,
+  type=GstOmxAmrNbDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.amrnb,
+  rank=256;
+
+omx_amrnbenc,
+  type=GstOmxAmrNbEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.amrnb,
+  rank=256;
+
+omx_amrwbdec,
+  type=GstOmxAmrWbDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.amrwb,
+  rank=256;
+
+omx_amrwbenc,
+  type=GstOmxAmrWbEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.amrwb,
+  rank=256;
+
+omx_aacdec,
+  type=GstOmxAacDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.aac,
+  rank=256;
+
+omx_aacenc,
+  type=GstOmxAacEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.aac,
+  rank=256;
+
+omx_adpcmdec,
+  type=GstOmxAdpcmDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.adpcm,
+  rank=256;
+
+omx_adpcmenc,
+  type=GstOmxAdpcmEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.adpcm,
+  rank=256;
+
+omx_g711dec,
+  type=GstOmxG711Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.g711,
+  rank=256;
+
+omx_g711enc,
+  type=GstOmxG711Enc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.g711,
+  rank=256;
+
+omx_g729dec,
+  type=GstOmxG729Dec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.g729,
+  rank=256;
+
+omx_g729enc,
+  type=GstOmxG729Enc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.g729,
+  rank=256;
+
+omx_ilbcdec,
+  type=GstOmxIlbcDec,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_decoder.ilbc,
+  rank=256;
+
+omx_ilbcenc,
+  type=GstOmxIlbcEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_encoder.ilbc,
+  rank=256;
+
+omx_jpegenc,
+  type=GstOmxJpegEnc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.image_encoder.jpeg,
+  rank=256;
+
+#endif /* EXPERIMENTAL */
+
+omx_audiosink,
+  type=GstOmxAudioSink,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.alsa.alsasink,
+  rank=0;
+
+#ifdef EXPERIMENTAL
+
+omx_videosink,
+  type=GstOmxVideoSink,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.videosink,
+  rank=0;
+
+omx_filereadersrc,
+  type=GstOmxFilereaderSrc,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.audio_filereader,
+  rank=0;
+
+#endif /* EXPERIMENTAL */
+
+omx_volume,
+  type=GstOmxVolume,
+  library-name=libomxil-bellagio.so.0,
+  component-name=OMX.st.volume.component,
+  rank=0;
-- 
1.7.0.1





More information about the Gstreamer-openmax mailing list