[Gstreamer-openmax] [PATCH 1/2] Some changes to gstomx.conf handling
Rob Clark
rob at ti.com
Mon Nov 1 08:53:01 PDT 2010
A few tweaks to the sed rules to make more friendly for using macros (for
example, "foo" "bar" becomes "foobar", which is normally done by the C
compiler and not the pre-processor). Also, the result of the preprocessor,
before generating gstomx_conf.c, is now also a generated file, to ease
debugging and to use as a starting point for a customized config file.
---
omx/Makefile.am | 13 +++-
omx/gstomx.conf | 203 ----------------------------------------------------
omx/gstomx.conf.in | 203 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 214 insertions(+), 205 deletions(-)
delete mode 100644 omx/gstomx.conf
create mode 100644 omx/gstomx.conf.in
diff --git a/omx/Makefile.am b/omx/Makefile.am
index 915b562..e8804ee 100644
--- a/omx/Makefile.am
+++ b/omx/Makefile.am
@@ -48,9 +48,18 @@ libgstomx_la_CFLAGS = -I$(srcdir)/headers $(GST_CFLAGS) $(GST_BASE_CFLAGS) -I$(t
libgstomx_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(top_builddir)/util/libutil.la
libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-EXTRA_DIST = headers gstomx.conf
+EXTRA_DIST = headers gstomx.conf gstomx_conf.c
+# Run the C-preprocessor plus some sed voodoo to clean up adjacent strings
+# (ie. "foo" "bar" becomes "foobar") so they are handled similar to what the
+# C compiler does itself
+gstomx.conf: gstomx.conf.in
+ cat $^ | $(CPP) $(CFLAGS) $(libgstomx_la_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) - | grep -v "^#" | sed 's/\"\ *\"//g' >> $@
+
+# more sed magic to convert the pre-processed config file into a C file
+# containing one big string. This is linked in and used as the default
+# config
gstomx_conf.c: gstomx.conf
echo "const char *default_config =" > $@
- cat $^ | $(CPP) $(CFLAGS) $(libgstomx_la_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) - | grep -v "^#" | sed 's/^.*/\"&\\\n"/' >> $@
+ cat $^ | sed 's/\"/\\\"/g' | sed 's/^.*/\"&\\\n"/' >> $@
echo ";" >> $@
diff --git a/omx/gstomx.conf b/omx/gstomx.conf
deleted file mode 100644
index c22c6d6..0000000
--- a/omx/gstomx.conf
+++ /dev/null
@@ -1,203 +0,0 @@
-#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;
diff --git a/omx/gstomx.conf.in b/omx/gstomx.conf.in
new file mode 100644
index 0000000..c22c6d6
--- /dev/null
+++ b/omx/gstomx.conf.in
@@ -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.1.1
More information about the Gstreamer-openmax
mailing list