You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
|
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(4) |
Jun
(1) |
Jul
(11) |
Aug
(31) |
Sep
(2) |
Oct
(21) |
Nov
(16) |
Dec
(56) |
2009 |
Jan
(12) |
Feb
(5) |
Mar
(34) |
Apr
(9) |
May
(5) |
Jun
(7) |
Jul
(18) |
Aug
(5) |
Sep
(2) |
Oct
(6) |
Nov
(50) |
Dec
|
2010 |
Jan
(3) |
Feb
(67) |
Mar
(135) |
Apr
(30) |
May
(2) |
Jun
(11) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(4) |
Nov
(17) |
Dec
(11) |
2011 |
Jan
(14) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Clark, R. <ro...@ti...> - 2010-12-06 16:38:24
|
On Tue, Nov 30, 2010 at 8:11 PM, bard <bar...@co...> wrote: > > Dear All, > > I am work on porting gst-openmax , but I didn't find some document described > more specifically. > Is there a document like porting guide ? or some flowchart available can > make me figure out easily. Probably a better question for gst-openmax list.. AFAIK, some updated documentation on this is still needed. Although with latest master from git, you should be able to port to a new OpenMAX implementation with only config file changes. (Assuming a relatively well behaved OpenMAX implementation.) The config file will have something like: omx_h264dec, type=GstOmxH264Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.avc, sink="video/x-h264, width=(int)[16,4096], height=(int)[16,4096], framerate=(fraction)[0,max];", src="video/x-raw-yuv, format=(fourcc)I420, width=(int)[16,4096], height=(int)[16,4096], framerate=(fraction)[0,max];", rank=256; which gives the component name (and optionally component-role), src/sink caps, and rank. BR, -R > > Thanks, > Bard > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-port-gst-openmax-tp3066588p3066588.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > _______________________________________________ > gstreamer-devel mailing list > gst...@li... > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
From: Kuo. B. (GSM) <Bar...@Co...> - 2010-12-02 10:07:34
|
Dear All, How to port gst-openmax ? Is there some document describing how to use gst-openmax ? How the process going in this plugin like flowchart, and how does it access OpenMax ? I am confused between two architectures. Thanks, bard This message may contain information which is private, privileged or confidential of Compal Communications, Inc. If you are not the intended recipient of this message, please notify the sender and destroy/delete the message. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. CCI 2010 |
From: Clark, R. <ro...@ti...> - 2010-11-18 16:27:31
|
On Wed, Nov 3, 2010 at 8:56 PM, Rob Clark <ro...@ti...> wrote: > Use common submodule and pre-commit hook, and cosemetic gstomx.h whitespace > change. > > Rob Clark (2): > use common submodule > minor formatting cleanup > > .gitignore | 3 + > .gitmodules | 3 + > autogen.sh | 60 ++++++++-- > build-aux/gst-autogen.sh | 294 ---------------------------------------------- > common | 1 + > configure.ac | 17 ++- > omx/gstomx.h | 6 +- > shave-libtool.in | 69 ----------- > shave.in | 79 ------------ > 9 files changed, 74 insertions(+), 458 deletions(-) > create mode 100644 .gitmodules > delete mode 100644 build-aux/gst-autogen.sh > create mode 160000 common > delete mode 100644 shave-libtool.in > delete mode 100644 shave.in > > So I take it that silence means that no one has any objections to this patchset or the tempate caps patchset? BR, -R |
From: Rob C. <ro...@ti...> - 2010-11-04 01:59:12
|
--- omx/gstomx.c | 30 +++++++++++++++ omx/gstomx.conf.in | 89 ++++++++++++++++++++++++++++++++++++++++++++ omx/gstomx.h | 1 + omx/gstomx_aacdec.c | 77 +++----------------------------------- omx/gstomx_aacenc.c | 78 +++----------------------------------- omx/gstomx_adpcmdec.c | 49 +++--------------------- omx/gstomx_adpcmenc.c | 49 +++--------------------- omx/gstomx_amrnbdec.c | 48 +++--------------------- omx/gstomx_amrnbenc.c | 48 +++--------------------- omx/gstomx_amrwbdec.c | 48 +++--------------------- omx/gstomx_amrwbenc.c | 48 +++--------------------- omx/gstomx_audiosink.c | 27 +------------ omx/gstomx_base_videodec.c | 54 -------------------------- omx/gstomx_base_videoenc.c | 54 -------------------------- omx/gstomx_filereadersrc.c | 21 +--------- omx/gstomx_g711dec.c | 58 +++------------------------- omx/gstomx_g711enc.c | 58 +++------------------------- omx/gstomx_g729dec.c | 53 +++----------------------- omx/gstomx_g729enc.c | 55 +++----------------------- omx/gstomx_h263dec.c | 32 +++------------- omx/gstomx_h263enc.c | 27 +++---------- omx/gstomx_h264dec.c | 31 +++------------ omx/gstomx_h264enc.c | 26 +++---------- omx/gstomx_ilbcdec.c | 73 +++--------------------------------- omx/gstomx_ilbcenc.c | 73 +++--------------------------------- omx/gstomx_jpegenc.c | 71 +++-------------------------------- omx/gstomx_mp2dec.c | 53 +++----------------------- omx/gstomx_mp3dec.c | 53 +++----------------------- omx/gstomx_mpeg4dec.c | 55 +++------------------------ omx/gstomx_mpeg4enc.c | 28 +++----------- omx/gstomx_videosink.c | 53 +------------------------ omx/gstomx_volume.c | 54 +++----------------------- omx/gstomx_vorbisdec.c | 47 +++-------------------- omx/gstomx_wmvdec.c | 31 +++------------ 34 files changed, 286 insertions(+), 1366 deletions(-) diff --git a/omx/gstomx.c b/omx/gstomx.c index 8b375c0..c444de5 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -327,6 +327,36 @@ gstomx_core_new (void *object, GType type) return core; } +GstCaps * +gstomx_template_caps (GType type, const gchar * pad_name) +{ + const gchar *element_name; + GstStructure *element; + const gchar *caps_str; + + element_name = g_type_get_qdata (type, element_name_quark); + element = get_element_entry (element_name); + + + /* this shouldn't really happen.. */ + if (!element) + return GST_CAPS_ANY; + + caps_str = gst_structure_get_string (element, pad_name); + + GST_DEBUG ("%s: %s", element_name, caps_str); + + /* default to ANY.. at least for now.. maybe when everything is converted + * over, we should treat missing caps as a more serious condition? + */ + if (!caps_str) { + g_warning ("%s is missing required field: %s", element_name, pad_name); + return GST_CAPS_ANY; + } + + return gst_caps_from_string (caps_str); +} + void gstomx_install_property_helper (GObjectClass * gobject_class) { diff --git a/omx/gstomx.conf.in b/omx/gstomx.conf.in index c22c6d6..2a7f5bd 100644 --- a/omx/gstomx.conf.in +++ b/omx/gstomx.conf.in @@ -20,58 +20,108 @@ omx_dummy_2, component-name=OMX.st.dummy2, rank=256; +/* standard width/height/framerate that applies to video decoders and encoders + * on both src and sink pad: + */ +#define VIDEO_SIZE_RATE \ + "width=(int)[16,4096], " \ + "height=(int)[16,4096], " \ + "framerate=(fraction)[0,max]" + +/* standard raw video caps that applies to all video decoder src pads and + * video encoder sink pads: + */ +#define RAW_VIDEO_CAPS \ + "video/x-raw-yuv, " \ + VIDEO_SIZE_RATE ", " \ + "format=(fourcc){I420, YUY2, UYVY, NV12}; " + + +/* standard raw audio caps that applies to all audio decoder src pads and + * audio encoder sink pads: + */ +#define RAW_AUDIO_CAPS(rate,channels) \ + "audio/x-raw-int, " \ + "endianess=(int)1234, " \ + "width=(int)16, " \ + "depth=(int)16, " \ + "rate=(int)" rate ", " \ + "signed=(boolean)true, " \ + "channels=(int)" channels ";" + omx_mpeg4dec, type=GstOmxMpeg4Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.mpeg4, + sink="video/mpeg, mpegversion=(int)4, systemstream=false, " VIDEO_SIZE_RATE ";" \ + "video/x-divx, divxversion=(int)[4,5], " VIDEO_SIZE_RATE ";" \ + "video/x-xvid, " VIDEO_SIZE_RATE ";" \ + "video/x-3ivx, " VIDEO_SIZE_RATE ";", + src=RAW_VIDEO_CAPS, rank=256; omx_h264dec, type=GstOmxH264Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.avc, + sink="video/x-h264, " VIDEO_SIZE_RATE ";", + src=RAW_VIDEO_CAPS, rank=256; omx_h263dec, type=GstOmxH263Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.h263, + sink="video/x-h263, variant=(string)itu, " VIDEO_SIZE_RATE ";", + src=RAW_VIDEO_CAPS, rank=256; omx_wmvdec, type=GstOmxWmvDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.wmv, + sink="video/x-wmv, " VIDEO_SIZE_RATE ";", + src=RAW_VIDEO_CAPS, rank=256; omx_mpeg4enc, type=GstOmxMpeg4Enc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_encoder.mpeg4, + sink=RAW_VIDEO_CAPS, + src="video/mpeg, mpegversion=(int)4, systemstream=false, " VIDEO_SIZE_RATE ";", rank=256; omx_h264enc, type=GstOmxH264Enc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_encoder.avc, + sink=RAW_VIDEO_CAPS, + src="video/x-h264, " VIDEO_SIZE_RATE ";", rank=256; omx_h263enc, type=GstOmxH263Enc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_encoder.h263, + sink=RAW_VIDEO_CAPS, + src="video/x-h263, variant=(string)itu, " VIDEO_SIZE_RATE ";", rank=256; omx_vorbisdec, type=GstOmxVorbisDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.ogg.single, + sink="application/ogg;", + src=RAW_AUDIO_CAPS("[8000, 96000]", "[1, 256]"), rank=128; omx_mp3dec, type=GstOmxMp3Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.mp3.mad, + sink="audio/mpeg, mpegversion=(int)1, layer=(int)3, rate=(int)[8000, 48000], channels=(int)[1, 8], parsed=true;", + src=RAW_AUDIO_CAPS("[8000, 96000]", "[1, 2]"), rank=256; #ifdef EXPERIMENTAL @@ -80,96 +130,130 @@ omx_mp2dec, type=GstOmxMp2Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.mp3.mad, + sink="audio/mpeg, mpegversion=(int)1, layer=(int)2, rate=(int)[8000, 96000], channels=(int)[1, 2], parsed=true;", + src=RAW_AUDIO_CAPS("[8000, 96000]", "[1, 2]"), rank=256; omx_amrnbdec, type=GstOmxAmrNbDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.amrnb, + sink="audio/AMR, rate=(int)8000, channels=(int)1;", + src=RAW_AUDIO_CAPS("8000", "1"), rank=256; omx_amrnbenc, type=GstOmxAmrNbEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.amrnb, + sink=RAW_AUDIO_CAPS("8000", "1"), + src="audio/AMR, rate=(int)8000, channels=(int)1;", rank=256; omx_amrwbdec, type=GstOmxAmrWbDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.amrwb, + sink="audio/AMR-WB, rate=(int)16000, channels=(int)1;", + src=RAW_AUDIO_CAPS("16000", "1"), rank=256; omx_amrwbenc, type=GstOmxAmrWbEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.amrwb, + sink=RAW_AUDIO_CAPS("16000", "1"), + src="audio/AMR-WB, rate=(int)16000, channels=(int)1;", rank=256; omx_aacdec, type=GstOmxAacDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.aac, + sink="audio/mpeg, mpegversion=(int){2,4}, rate=(int)[8000, 96000], channels=(int)[1, 6];", + src=RAW_AUDIO_CAPS("[8000, 96000]", "[1, 6]"), rank=256; omx_aacenc, type=GstOmxAacEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.aac, + sink=RAW_AUDIO_CAPS("[8000, 96000]", "[1, 6]"), + src="audio/mpeg, mpegversion=(int){2,4}, rate=(int)[8000, 96000], channels=(int)[1, 6];", rank=256; omx_adpcmdec, type=GstOmxAdpcmDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.adpcm, + sink="audio/x-adpcm, layout=dvi, rate=(int)[8000, 96000], channels=(int)1;", + src=RAW_AUDIO_CAPS("[8000, 96000]", "1"), rank=256; omx_adpcmenc, type=GstOmxAdpcmEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.adpcm, + sink=RAW_AUDIO_CAPS("[8000, 96000]", "1"), + src="audio/x-adpcm, layout=dvi, rate=(int)[8000, 96000], channels=(int)1;", rank=256; omx_g711dec, type=GstOmxG711Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.g711, + sink="audio/x-alaw, rate=(int)8000, channels=(int)1;" \ + "audio/x-mulaw, rate=(int)8000, channels=(int)1;", + src=RAW_AUDIO_CAPS("8000", "1"), rank=256; omx_g711enc, type=GstOmxG711Enc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.g711, + sink=RAW_AUDIO_CAPS("8000", "1"), + src="audio/x-alaw, rate=(int)8000, channels=(int)1;" \ + "audio/x-mulaw, rate=(int)8000, channels=(int)1;", rank=256; omx_g729dec, type=GstOmxG729Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.g729, + sink="audio/G729, rate=(int)8000, channels=(int)1;", + src=RAW_AUDIO_CAPS("8000", "1"), rank=256; omx_g729enc, type=GstOmxG729Enc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.g729, + sink=RAW_AUDIO_CAPS("8000", "1"), + src="audio/G729, rate=(int)8000, channels=(int)1;", rank=256; omx_ilbcdec, type=GstOmxIlbcDec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_decoder.ilbc, + sink="audio/x-iLBC, mode=(int){20, 30};", + src=RAW_AUDIO_CAPS("8000", "1"), rank=256; omx_ilbcenc, type=GstOmxIlbcEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_encoder.ilbc, + sink=RAW_AUDIO_CAPS("8000", "1"), + src="audio/x-iLBC, mode=(int){20, 30};", rank=256; omx_jpegenc, type=GstOmxJpegEnc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.image_encoder.jpeg, + sink=RAW_VIDEO_CAPS, + src="image/jpeg, " VIDEO_SIZE_RATE ";", rank=256; #endif /* EXPERIMENTAL */ @@ -178,6 +262,7 @@ omx_audiosink, type=GstOmxAudioSink, library-name=libomxil-bellagio.so.0, component-name=OMX.st.alsa.alsasink, + sink=RAW_AUDIO_CAPS("[8000, 48000]", "[1, 8]"), rank=0; #ifdef EXPERIMENTAL @@ -186,12 +271,14 @@ omx_videosink, type=GstOmxVideoSink, library-name=libomxil-bellagio.so.0, component-name=OMX.st.videosink, + sink=RAW_VIDEO_CAPS, rank=0; omx_filereadersrc, type=GstOmxFilereaderSrc, library-name=libomxil-bellagio.so.0, component-name=OMX.st.audio_filereader, + src="ANY", rank=0; #endif /* EXPERIMENTAL */ @@ -200,4 +287,6 @@ omx_volume, type=GstOmxVolume, library-name=libomxil-bellagio.so.0, component-name=OMX.st.volume.component, + sink=RAW_AUDIO_CAPS("[8000, 48000]", "[1, 8]"), + src=RAW_AUDIO_CAPS("[8000, 48000]", "[1, 8]"), rank=0; diff --git a/omx/gstomx.h b/omx/gstomx.h index f638a8c..7076870 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -43,6 +43,7 @@ enum gboolean gstomx_get_component_info (void *core, GType type); void *gstomx_core_new (void *object, GType type); +GstCaps *gstomx_template_caps (GType type, const gchar * pad_name); void gstomx_install_property_helper (GObjectClass * gobject_class); gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue * value); diff --git a/omx/gstomx_aacdec.c b/omx/gstomx_aacdec.c index ec06de3..70ba3c7 100644 --- a/omx/gstomx_aacdec.c +++ b/omx/gstomx_aacdec.c @@ -25,61 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxAacDec, gst_omx_aacdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, - "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/mpeg", - "mpegversion", G_TYPE_INT, 4, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, G_TYPE_INT); - - g_value_set_int (&val, 2); - gst_value_list_append_value (&list, &val); - - g_value_set_int (&val, 4); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "mpegversion", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -92,23 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in AAC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_aacenc.c b/omx/gstomx_aacenc.c index da741a7..c3118a0 100644 --- a/omx/gstomx_aacenc.c +++ b/omx/gstomx_aacenc.c @@ -99,62 +99,6 @@ gst_omx_aacenc_output_format_get_type (void) return gst_omx_aacenc_output_format_type; } -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/mpeg", - "mpegversion", G_TYPE_INT, 4, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, G_TYPE_INT); - - g_value_set_int (&val, 2); - gst_value_list_append_value (&list, &val); - - g_value_set_int (&val, 4); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "mpegversion", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, - "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -167,23 +111,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in AAC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_adpcmdec.c b/omx/gstomx_adpcmdec.c index 6b39881..f97717a 100644 --- a/omx/gstomx_adpcmdec.c +++ b/omx/gstomx_adpcmdec.c @@ -27,33 +27,6 @@ GSTOMX_BOILERPLATE (GstOmxAdpcmDec, gst_omx_adpcmdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-adpcm", - "layout", G_TYPE_STRING, "dvi", - "rate", GST_TYPE_INT_RANGE, 8000, 96000, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -66,23 +39,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in ADPCM format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_adpcmenc.c b/omx/gstomx_adpcmenc.c index 55d6c93..3085f7a 100644 --- a/omx/gstomx_adpcmenc.c +++ b/omx/gstomx_adpcmenc.c @@ -26,33 +26,6 @@ GSTOMX_BOILERPLATE (GstOmxAdpcmEnc, gst_omx_adpcmenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-adpcm", - "layout", G_TYPE_STRING, "dvi", - "rate", GST_TYPE_INT_RANGE, 8000, 96000, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -65,23 +38,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in ADPCM format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_amrnbdec.c b/omx/gstomx_amrnbdec.c index 99fa45a..c38da05 100644 --- a/omx/gstomx_amrnbdec.c +++ b/omx/gstomx_amrnbdec.c @@ -25,32 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxAmrNbDec, gst_omx_amrnbdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/AMR", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -63,23 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in AMR-NB format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_amrnbenc.c b/omx/gstomx_amrnbenc.c index 491165d..80c8cd0 100644 --- a/omx/gstomx_amrnbenc.c +++ b/omx/gstomx_amrnbenc.c @@ -34,32 +34,6 @@ enum GSTOMX_BOILERPLATE (GstOmxAmrNbEnc, gst_omx_amrnbenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/AMR", - "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 8000, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -72,23 +46,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in AMR-NB format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_amrwbdec.c b/omx/gstomx_amrwbdec.c index e94827d..222ea23 100644 --- a/omx/gstomx_amrwbdec.c +++ b/omx/gstomx_amrwbdec.c @@ -25,32 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxAmrWbDec, gst_omx_amrwbdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 16000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/AMR-WB", - "rate", G_TYPE_INT, 16000, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -63,23 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in AMR-WB format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_amrwbenc.c b/omx/gstomx_amrwbenc.c index 2aad99f..fd5ca61 100644 --- a/omx/gstomx_amrwbenc.c +++ b/omx/gstomx_amrwbenc.c @@ -34,32 +34,6 @@ enum GSTOMX_BOILERPLATE (GstOmxAmrWbEnc, gst_omx_amrwbenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/AMR-WB", - "channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 16000, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 16000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -72,23 +46,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in AMR-WB format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_audiosink.c b/omx/gstomx_audiosink.c index bc6d6ef..5bee433 100644 --- a/omx/gstomx_audiosink.c +++ b/omx/gstomx_audiosink.c @@ -25,22 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxAudioSink, gst_omx_audiosink, GstOmxBaseSink, GST_OMX_BASE_SINK_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", GST_TYPE_INT_RANGE, 8, 32, - "depth", GST_TYPE_INT_RANGE, 8, 32, - "rate", GST_TYPE_INT_RANGE, 8000, 48000, - "signed", G_TYPE_BOOLEAN, TRUE, - "channels", GST_TYPE_INT_RANGE, 1, 8, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -52,14 +36,9 @@ type_base_init (gpointer g_class) "OpenMAX IL audiosink element", "Sink/Audio", "Renders audio", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); } static gboolean diff --git a/omx/gstomx_base_videodec.c b/omx/gstomx_base_videodec.c index de36899..9148dec 100644 --- a/omx/gstomx_base_videodec.c +++ b/omx/gstomx_base_videodec.c @@ -25,63 +25,9 @@ GSTOMX_BOILERPLATE (GstOmxBaseVideoDec, gst_omx_base_videodec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-raw-yuv", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, GST_TYPE_FOURCC); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "format", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { - GstElementClass *element_class; - - element_class = GST_ELEMENT_CLASS (g_class); - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } } static void diff --git a/omx/gstomx_base_videoenc.c b/omx/gstomx_base_videoenc.c index 87a4f1b..0599a25 100644 --- a/omx/gstomx_base_videoenc.c +++ b/omx/gstomx_base_videoenc.c @@ -35,63 +35,9 @@ enum GSTOMX_BOILERPLATE (GstOmxBaseVideoEnc, gst_omx_base_videoenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-raw-yuv", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, GST_TYPE_FOURCC); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "format", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { - GstElementClass *element_class; - - element_class = GST_ELEMENT_CLASS (g_class); - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } } static void diff --git a/omx/gstomx_filereadersrc.c b/omx/gstomx_filereadersrc.c index 3c63ceb..478f189 100644 --- a/omx/gstomx_filereadersrc.c +++ b/omx/gstomx_filereadersrc.c @@ -32,16 +32,6 @@ enum GSTOMX_BOILERPLATE (GstOmxFilereaderSrc, gst_omx_filereadersrc, GstOmxBaseSrc, GST_OMX_BASE_SRC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_any (); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -53,14 +43,9 @@ type_base_init (gpointer g_class) "OpenMAX IL filereader src element", "None", "Does nothing", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static gboolean diff --git a/omx/gstomx_g711dec.c b/omx/gstomx_g711dec.c index 25f97f0..c6711a6 100644 --- a/omx/gstomx_g711dec.c +++ b/omx/gstomx_g711dec.c @@ -29,42 +29,6 @@ GSTOMX_BOILERPLATE (GstOmxG711Dec, gst_omx_g711dec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/x-alaw", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("audio/x-mulaw", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -77,23 +41,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in G.711 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_g711enc.c b/omx/gstomx_g711enc.c index c1aab07..491d4a9 100644 --- a/omx/gstomx_g711enc.c +++ b/omx/gstomx_g711enc.c @@ -28,42 +28,6 @@ GSTOMX_BOILERPLATE (GstOmxG711Enc, gst_omx_g711enc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/x-alaw", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("audio/x-mulaw", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -76,23 +40,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in G.711 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_g729dec.c b/omx/gstomx_g729dec.c index e80310f..e3999fa 100644 --- a/omx/gstomx_g729dec.c +++ b/omx/gstomx_g729dec.c @@ -25,37 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxG729Dec, gst_omx_g729dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/G729", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -68,23 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in G.729 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_g729enc.c b/omx/gstomx_g729enc.c index c589749..d9b6340 100644 --- a/omx/gstomx_g729enc.c +++ b/omx/gstomx_g729enc.c @@ -34,37 +34,6 @@ enum GSTOMX_BOILERPLATE (GstOmxG729Enc, gst_omx_g729enc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/G729", - "rate", G_TYPE_INT, 8000, "channels", G_TYPE_INT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -77,23 +46,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in G.729 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void @@ -173,7 +132,7 @@ sink_setcaps (GstPad * pad, GstCaps * caps) GstCaps *tmp_caps; /* src template are fixed caps */ - tmp_caps = generate_src_template (); + tmp_caps = gstomx_template_caps (G_TYPE_FROM_INSTANCE (omx_base), "src"); ret = gst_pad_set_caps (omx_base->srcpad, tmp_caps); gst_caps_unref (tmp_caps); diff --git a/omx/gstomx_h263dec.c b/omx/gstomx_h263dec.c index 4cd5e38..7a0301d 100644 --- a/omx/gstomx_h263dec.c +++ b/omx/gstomx_h263dec.c @@ -25,25 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxH263Dec, gst_omx_h263dec, GstOmxBaseVideoDec, GST_OMX_BASE_VIDEODEC_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-h263", - "variant", G_TYPE_STRING, "itu", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -56,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Video", "Decodes video in H.263 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_h263enc.c b/omx/gstomx_h263enc.c index 71c5361..a8a7a71 100644 --- a/omx/gstomx_h263enc.c +++ b/omx/gstomx_h263enc.c @@ -25,20 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxH263Enc, gst_omx_h263enc, GstOmxBaseVideoEnc, GST_OMX_BASE_VIDEOENC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("video/x-h263", - "variant", G_TYPE_STRING, "itu", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -51,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Video", "Encodes video in H.263 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_h264dec.c b/omx/gstomx_h264dec.c index 167d9d3..0507952 100644 --- a/omx/gstomx_h264dec.c +++ b/omx/gstomx_h264dec.c @@ -25,24 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxH264Dec, gst_omx_h264dec, GstOmxBaseVideoDec, GST_OMX_BASE_VIDEODEC_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-h264", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -55,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Video", "Decodes video in H.264/AVC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_h264enc.c b/omx/gstomx_h264enc.c index 86585ca..4b2d59c 100644 --- a/omx/gstomx_h264enc.c +++ b/omx/gstomx_h264enc.c @@ -25,19 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxH264Enc, gst_omx_h264enc, GstOmxBaseVideoEnc, GST_OMX_BASE_VIDEOENC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("video/x-h264", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -50,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Video", "Encodes video in H.264/AVC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_ilbcdec.c b/omx/gstomx_ilbcdec.c index 580d658..084960f 100644 --- a/omx/gstomx_ilbcdec.c +++ b/omx/gstomx_ilbcdec.c @@ -27,57 +27,6 @@ GSTOMX_BOILERPLATE (GstOmxIlbcDec, gst_omx_ilbcdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/x-iLBC", NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, G_TYPE_INT); - - g_value_set_int (&val, 20); - gst_value_list_append_value (&list, &val); - - g_value_set_int (&val, 30); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "mode", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -90,23 +39,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in iLBC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_ilbcenc.c b/omx/gstomx_ilbcenc.c index b7bf6af..898418c 100644 --- a/omx/gstomx_ilbcenc.c +++ b/omx/gstomx_ilbcenc.c @@ -26,57 +26,6 @@ GSTOMX_BOILERPLATE (GstOmxIlbcEnc, gst_omx_ilbcenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("audio/x-iLBC", NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, G_TYPE_INT); - - g_value_set_int (&val, 20); - gst_value_list_append_value (&list, &val); - - g_value_set_int (&val, 30); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "mode", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, 8000, - "signed", G_TYPE_BOOLEAN, TRUE, "channels", G_TYPE_INT, 1, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -89,23 +38,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Audio", "Encodes audio in iLBC format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_jpegenc.c b/omx/gstomx_jpegenc.c index 3e83f03..3cbb8ba 100644 --- a/omx/gstomx_jpegenc.c +++ b/omx/gstomx_jpegenc.c @@ -37,55 +37,6 @@ enum GSTOMX_BOILERPLATE (GstOmxJpegEnc, gst_omx_jpegenc, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("image/jpeg", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-raw-yuv", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - { - GValue list = { 0 }; - GValue val = { 0 }; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, GST_TYPE_FOURCC); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "format", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} static void type_base_init (gpointer g_class) @@ -99,23 +50,13 @@ type_base_init (gpointer g_class) "Codec/Encoder/Image", "Encodes image in JPEG format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); - - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_mp2dec.c b/omx/gstomx_mp2dec.c index 0211f08..25f94f6 100644 --- a/omx/gstomx_mp2dec.c +++ b/omx/gstomx_mp2dec.c @@ -26,37 +26,6 @@ GSTOMX_BOILERPLATE (GstOmxMp2Dec, gst_omx_mp2dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, - "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, - "layer", G_TYPE_INT, 2, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "channels", GST_TYPE_INT_RANGE, 1, 2, - "parsed", G_TYPE_BOOLEAN, TRUE, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -69,23 +38,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in MP2 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_mp3dec.c b/omx/gstomx_mp3dec.c index a617771..a5fa69a 100644 --- a/omx/gstomx_mp3dec.c +++ b/omx/gstomx_mp3dec.c @@ -25,37 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxMp3Dec, gst_omx_mp3dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "signed", G_TYPE_BOOLEAN, TRUE, - "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); - - return caps; -} - -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - - caps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, - "layer", G_TYPE_INT, 3, - "rate", GST_TYPE_INT_RANGE, 8000, 48000, - "channels", GST_TYPE_INT_RANGE, 1, 8, - "parsed", G_TYPE_BOOLEAN, TRUE, NULL); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -68,23 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Audio", "Decodes audio in MP3 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void diff --git a/omx/gstomx_mpeg4dec.c b/omx/gstomx_mpeg4dec.c index f112ecb..1286f65 100644 --- a/omx/gstomx_mpeg4dec.c +++ b/omx/gstomx_mpeg4dec.c @@ -25,48 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxMpeg4Dec, gst_omx_m... [truncated message content] |
From: Rob C. <ro...@ti...> - 2010-11-04 01:59:06
|
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 |
From: Rob C. <ro...@ti...> - 2010-11-04 01:59:01
|
First patch has some makefile changes for handling gstomx.conf and default config to make it easier to use macros. And second patch is the one that actually changes all elements to take template caps from config file. Rob Clark (2): Some changes to gstomx.conf handling template caps from config file omx/Makefile.am | 13 ++- omx/gstomx.c | 30 +++++ omx/gstomx.conf | 203 ------------------------------ omx/gstomx.conf.in | 292 ++++++++++++++++++++++++++++++++++++++++++++ omx/gstomx.h | 1 + omx/gstomx_aacdec.c | 77 +----------- omx/gstomx_aacenc.c | 78 +----------- omx/gstomx_adpcmdec.c | 49 +------- omx/gstomx_adpcmenc.c | 49 +------- omx/gstomx_amrnbdec.c | 48 +------- omx/gstomx_amrnbenc.c | 48 +------- omx/gstomx_amrwbdec.c | 48 +------- omx/gstomx_amrwbenc.c | 48 +------- omx/gstomx_audiosink.c | 27 +---- omx/gstomx_base_videodec.c | 54 -------- omx/gstomx_base_videoenc.c | 54 -------- omx/gstomx_filereadersrc.c | 21 +--- omx/gstomx_g711dec.c | 58 +-------- omx/gstomx_g711enc.c | 58 +-------- omx/gstomx_g729dec.c | 53 +------- omx/gstomx_g729enc.c | 55 +------- omx/gstomx_h263dec.c | 32 +---- omx/gstomx_h263enc.c | 27 +--- omx/gstomx_h264dec.c | 31 +---- omx/gstomx_h264enc.c | 26 +--- omx/gstomx_ilbcdec.c | 73 +---------- omx/gstomx_ilbcenc.c | 73 +---------- omx/gstomx_jpegenc.c | 71 +---------- omx/gstomx_mp2dec.c | 53 +------- omx/gstomx_mp3dec.c | 53 +------- omx/gstomx_mpeg4dec.c | 55 +-------- omx/gstomx_mpeg4enc.c | 28 +---- omx/gstomx_videosink.c | 53 +-------- omx/gstomx_volume.c | 54 +------- omx/gstomx_vorbisdec.c | 47 +------ omx/gstomx_wmvdec.c | 31 +---- 36 files changed, 500 insertions(+), 1571 deletions(-) delete mode 100644 omx/gstomx.conf create mode 100644 omx/gstomx.conf.in |
From: Rob C. <ro...@ti...> - 2010-11-04 01:57:23
|
--- omx/gstomx.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/omx/gstomx.h b/omx/gstomx.h index 37027ec..f638a8c 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -24,8 +24,11 @@ #include <gst/gst.h> -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); +G_BEGIN_DECLS + +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); + #define GST_CAT_DEFAULT gstomx_debug enum @@ -44,4 +47,5 @@ void gstomx_install_property_helper (GObjectClass * gobject_class); gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue * value); G_END_DECLS + #endif /* GSTOMX_H */ -- 1.7.1.1 |
From: Rob C. <ro...@ti...> - 2010-11-04 01:57:18
|
Align autogen.sh with other gst trees, including use of the commit-hook. Also, shave no longer seemed to be working AM_SILENT_RULES (as used by other gst trees) does. --- .gitignore | 3 + .gitmodules | 3 + autogen.sh | 60 ++++++++-- build-aux/gst-autogen.sh | 294 ---------------------------------------------- common | 1 + configure.ac | 17 ++- shave-libtool.in | 69 ----------- shave.in | 79 ------------ 8 files changed, 69 insertions(+), 457 deletions(-) create mode 100644 .gitmodules delete mode 100644 build-aux/gst-autogen.sh create mode 160000 common delete mode 100644 shave-libtool.in delete mode 100644 shave.in diff --git a/.gitignore b/.gitignore index dc154e8..7f93004 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ .libs Makefile.in +ABOUT-NLS +po + INSTALL Makefile aclocal.m4 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a6b1eda --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "common"] + path = common + url = git://anongit.freedesktop.org/gstreamer/common diff --git a/autogen.sh b/autogen.sh index 2931a08..e795484 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,9 +1,33 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. +DIE=0 package=gst-openmax +srcfile=omx/gstomx.c -. build-aux/gst-autogen.sh +# Make sure we have common +if test ! -f common/gst-autogen.sh; +then + echo "+ Setting up common submodule" + git submodule init +fi +git submodule update + +# source helper functions +if test ! -f common/gst-autogen.sh; +then + echo There is something wrong with your source tree. + echo You are missing common/gst-autogen.sh + exit 1 +fi +. common/gst-autogen.sh + +# install pre-commit hook for doing clean commits +if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \); +then + rm -f .git/hooks/pre-commit + ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit +fi touch ChangeLog @@ -11,20 +35,21 @@ CONFIGURE_DEF_OPT='--enable-maintainer-mode' autogen_options $@ -echo -n "+ check for build tools" +printf "+ check for build tools" if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi -version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \ -"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1 -version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \ -"ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1 +version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262 autoconf261 autoconf260" \ + "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 60 || DIE=1 +version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10" \ + "ftp://ftp.gnu.org/pub/gnu/automake/" 1 10 || DIE=1 +version_check "autopoint" "autopoint" \ + "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \ -"ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 + "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1 version_check "pkg-config" "" \ -"http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 + "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 die_check $DIE -autoconf_2_52d_check || DIE=1 aclocal_check || DIE=1 autoheader_check || DIE=1 @@ -41,8 +66,19 @@ fi toplevel_check $srcfile -tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS" +# autopoint +# older autopoint (< 0.12) has a tendency to complain about mkinstalldirs +if test -x mkinstalldirs; then rm mkinstalldirs; fi +# first remove patch if necessary, then run autopoint, then reapply +if test -f po/Makefile.in.in; +then + patch -p0 -R < common/gettext.patch +fi +tool_run "$autopoint --force" +patch -p0 < common/gettext.patch + tool_run "$libtoolize" "--copy --force" +tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS" tool_run "$autoheader" # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo @@ -78,8 +114,8 @@ test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CO echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || { - echo " configure failed" - exit 1 + echo " configure failed" + exit 1 } echo "Now type 'make' to compile $package." diff --git a/build-aux/gst-autogen.sh b/build-aux/gst-autogen.sh deleted file mode 100644 index c22108f..0000000 --- a/build-aux/gst-autogen.sh +++ /dev/null @@ -1,294 +0,0 @@ -# a silly hack that generates autoregen.sh but it's handy -# Remove the old autoregen.sh first to create a new file, -# as the current one may be being read by the shell executing -# this script. -if [ -f "autoregen.sh" ]; then - rm autoregen.sh -fi -echo "#!/bin/sh" > autoregen.sh -echo "./autogen.sh $@ \$@" >> autoregen.sh -chmod +x autoregen.sh - -# helper functions for autogen.sh - -debug () -# print out a debug message if DEBUG is a defined variable -{ - if test ! -z "$DEBUG" - then - echo "DEBUG: $1" - fi -} - -version_check () -# check the version of a package -# first argument : package name (executable) -# second argument : optional path where to look for it instead -# third argument : source download url -# rest of arguments : major, minor, micro version -# all consecutive ones : suggestions for binaries to use -# (if not specified in second argument) -{ - PACKAGE=$1 - PKG_PATH=$2 - URL=$3 - MAJOR=$4 - MINOR=$5 - MICRO=$6 - - # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null - if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi - debug "major $MAJOR minor $MINOR micro $MICRO" - VERSION=$MAJOR - if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi - if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi - - debug "major $MAJOR minor $MINOR micro $MICRO" - - for SUGGESTION in $PKG_PATH; do - COMMAND="$SUGGESTION" - - # don't check if asked not to - test -z "$NOCHECK" && { - echo -n " checking for $COMMAND >= $VERSION ... " - } || { - # we set a var with the same name as the package, but stripped of - # unwanted chars - VAR=`echo $PACKAGE | sed 's/-//g'` - debug "setting $VAR" - eval $VAR="$COMMAND" - return 0 - } - - debug "checking version with $COMMAND" - ($COMMAND --version) < /dev/null > /dev/null 2>&1 || - { - echo "not found." - continue - } - # strip everything that's not a digit, then use cut to get the first field - pkg_version=`$COMMAND --version|head -n 1|sed 's/^.*)[^0-9]*//'|cut -d' ' -f1` - debug "pkg_version $pkg_version" - # remove any non-digit characters from the version numbers to permit numeric - # comparison - pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g` - pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g` - pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g` - test -z "$pkg_major" && pkg_major=0 - test -z "$pkg_minor" && pkg_minor=0 - test -z "$pkg_micro" && pkg_micro=0 - debug "found major $pkg_major minor $pkg_minor micro $pkg_micro" - - #start checking the version - debug "version check" - - # reset check - WRONG= - - if [ ! "$pkg_major" -gt "$MAJOR" ]; then - debug "major: $pkg_major <= $MAJOR" - if [ "$pkg_major" -lt "$MAJOR" ]; then - debug "major: $pkg_major < $MAJOR" - WRONG=1 - elif [ ! "$pkg_minor" -gt "$MINOR" ]; then - debug "minor: $pkg_minor <= $MINOR" - if [ "$pkg_minor" -lt "$MINOR" ]; then - debug "minor: $pkg_minor < $MINOR" - WRONG=1 - elif [ "$pkg_micro" -lt "$MICRO" ]; then - debug "micro: $pkg_micro < $MICRO" - WRONG=1 - fi - fi - fi - - if test ! -z "$WRONG"; then - echo "found $pkg_version, not ok !" - continue - else - echo "found $pkg_version, ok." - # we set a var with the same name as the package, but stripped of - # unwanted chars - VAR=`echo $PACKAGE | sed 's/-//g'` - debug "setting $VAR" - eval $VAR="$COMMAND" - return 0 - fi - done - - echo "not found !" - echo "You must have $PACKAGE installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at $URL" - return 1; -} - -aclocal_check () -{ - # normally aclocal is part of automake - # so we expect it to be in the same place as automake - # so if a different automake is supplied, we need to adapt as well - # so how's about replacing automake with aclocal in the set var, - # and saving that in $aclocal ? - # note, this will fail if the actual automake isn't called automake* - # or if part of the path before it contains it - if [ -z "$automake" ]; then - echo "Error: no automake variable set !" - return 1 - else - aclocal=`echo $automake | sed s/automake/aclocal/` - debug "aclocal: $aclocal" - if [ "$aclocal" != "aclocal" ]; - then - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal" - fi - if [ ! -x `which $aclocal` ]; then - echo "Error: cannot execute $aclocal !" - return 1 - fi - fi -} - -autoheader_check () -{ - # same here - autoheader is part of autoconf - # use the same voodoo - if [ -z "$autoconf" ]; then - echo "Error: no autoconf variable set !" - return 1 - else - autoheader=`echo $autoconf | sed s/autoconf/autoheader/` - debug "autoheader: $autoheader" - if [ "$autoheader" != "autoheader" ]; - then - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader" - fi - if [ ! -x `which $autoheader` ]; then - echo "Error: cannot execute $autoheader !" - return 1 - fi - fi - -} - -autoconf_2_52d_check () -{ - # autoconf 2.52d has a weird issue involving a yes:no error - # so don't allow it's use - test -z "$NOCHECK" && { - ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'` - if test "$ac_version" = "2.52d"; then - echo "autoconf 2.52d has an issue with our current build." - echo "We don't know who's to blame however. So until we do, get a" - echo "regular version. RPM's of a working version are on the gstreamer site." - exit 1 - fi - } - return 0 -} - -die_check () -{ - # call with $DIE - # if set to 1, we need to print something helpful then die - DIE=$1 - if test "x$DIE" = "x1"; - then - echo - echo "- Please get the right tools before proceeding." - echo "- Alternatively, if you're sure we're wrong, run with --nocheck." - exit 1 - fi -} - -autogen_options () -{ - if test "x$1" = "x"; then - return 0 - fi - - while test "x$1" != "x" ; do - optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - case "$1" in - --noconfigure) - NOCONFIGURE=defined - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure" - echo "+ configure run disabled" - shift - ;; - --nocheck) - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck" - NOCHECK=defined - echo "+ autotools version check disabled" - shift - ;; - --debug) - DEBUG=defined - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug" - echo "+ debug output enabled" - shift - ;; - -h|--help) - echo "autogen.sh (autogen options) -- (configure options)" - echo "autogen.sh help options: " - echo " --noconfigure don't run the configure script" - echo " --nocheck don't do version checks" - echo " --debug debug the autogen process" - echo - echo " --with-autoconf PATH use autoconf in PATH" - echo " --with-automake PATH use automake in PATH" - echo - echo "Any argument either not in the above list or after a '--' will be " - echo "passed to ./configure." - exit 1 - ;; - --with-automake=*) - AUTOMAKE=$optarg - echo "+ using alternate automake in $optarg" - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE" - shift - ;; - --with-autoconf=*) - AUTOCONF=$optarg - echo "+ using alternate autoconf in $optarg" - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF" - shift - ;; - --) shift ; break ;; - *) - echo "+ passing argument $1 to configure" - CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1" - shift - ;; - esac - done - - for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done - if test ! -z "$CONFIGURE_EXT_OPT" - then - echo "+ options passed to configure: $CONFIGURE_EXT_OPT" - fi -} - -toplevel_check () -{ - srcfile=$1 - test -f $srcfile || { - echo "You must run this script in the top-level $package directory" - exit 1 - } -} - -tool_run () -{ - tool=$1 - options=$2 - run_if_fail=$3 - echo "+ running $tool $options..." - $tool $options || { - echo - echo $tool failed - eval $run_if_fail - exit 1 - } -} diff --git a/common b/common new file mode 160000 index 0000000..011bcc8 --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit 011bcc8a0fc7f798ee874a7ba899123fb2470e22 diff --git a/configure.ac b/configure.ac index b6a1316..85ff1e5 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,14 @@ GST_REQUIRED=0.10.0 dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode AM_MAINTAINER_MODE +dnl sets host_* variables +AC_CANONICAL_HOST + +dnl use pretty build output with automake >= 1.11 +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])], + [AM_DEFAULT_VERBOSITY=1 + AC_SUBST(AM_DEFAULT_VERBOSITY)]) + dnl check for tools AC_PROG_CC AM_PROG_CC_C_O @@ -31,6 +39,12 @@ AG_GST_INIT dnl define an ERROR_CFLAGS Makefile variable AG_GST_SET_ERROR_CFLAGS($GST_CVS) +dnl set up gettext +dnl the version check needs to stay here because autopoint greps for it +AM_GNU_GETTEXT_VERSION([0.17]) +AM_GNU_GETTEXT([external]) +AG_GST_GETTEXT([gst-openmax-$GST_MAJORMINOR]) + dnl add GStreamer arguments AG_GST_ARG_DEBUG AG_GST_ARG_PROFILING @@ -101,9 +115,6 @@ dnl whatevertarget_LIBS and -L flags here affect the rest of the linking GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS" AC_SUBST(GST_PLUGIN_LDFLAGS) -SHAVE_INIT -AC_CONFIG_FILES([shave shave-libtool]) - AC_CONFIG_FILES([Makefile \ omx/Makefile \ util/Makefile \ diff --git a/shave-libtool.in b/shave-libtool.in deleted file mode 100644 index 1f3a720..0000000 --- a/shave-libtool.in +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# we need sed -SED=@SED@ -if test -z "$SED" ; then -SED=sed -fi - -lt_unmangle () -{ - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` -} - -# the real libtool to use -LIBTOOL="$1" -shift - -# if 1, don't print anything, the underlaying wrapper will do it -pass_though=0 - -# scan the arguments, keep the right ones for libtool, and discover the mode -preserved_args= -while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --mode=*) - mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` - preserved_args="$preserved_args $opt" - ;; - -o) - lt_output="$1" - preserved_args="$preserved_args $opt" - ;; - *) - preserved_args="$preserved_args $opt" - ;; - esac -done - -case "$mode" in -compile) - # shave will be called and print the actual CC/CXX/LINK line - preserved_args="$preserved_args --shave-mode=$mode" - pass_though=1 - ;; -link) - preserved_args="$preserved_args --shave-mode=$mode" - Q=" LINK " - ;; -*) - # let's u - # echo "*** libtool: Unimplemented mode: $mode, fill a bug report" - ;; -esac - -lt_unmangle "$lt_output" -output=$last_result - -if test -z $V; then - if test $pass_though -eq 0; then - echo "$Q$output" - fi - $LIBTOOL --silent $preserved_args -else - echo $LIBTOOL $preserved_args - $LIBTOOL $preserved_args -fi diff --git a/shave.in b/shave.in deleted file mode 100644 index 5c16f27..0000000 --- a/shave.in +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -# we need sed -SED=@SED@ -if test -z "$SED" ; then -SED=sed -fi - -lt_unmangle () -{ - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` -} - -# the tool to wrap (cc, cxx, ar, ranlib, ..) -tool="$1" -shift - -# the reel tool (to call) -REEL_TOOL="$1" -shift - -pass_through=0 -preserved_args= -while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --shave-mode=*) - mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` - ;; - -o) - lt_output="$1" - preserved_args="$preserved_args $opt" - ;; - *) - preserved_args="$preserved_args $opt" - ;; - esac -done - -# mode=link is handled in the libtool wrapper -case "$mode,$tool" in -link,*) - pass_through=1 - ;; -*,cxx) - Q=" CXX " - ;; -*,cc) - Q=" CC " - ;; -*,fc) - Q=" FC " - ;; -*,f77) - Q=" F77 " - ;; -*,objc) - Q=" OBJC " - ;; -*,*) - # should not happen - Q=" CC " - ;; -esac - -lt_unmangle "$lt_output" -output=$last_result - -if test -z $V; then - if test $pass_through -eq 0; then - echo "$Q$output" - fi - $REEL_TOOL $preserved_args -else - echo $REEL_TOOL $preserved_args - $REEL_TOOL $preserved_args -fi -- 1.7.1.1 |
From: Rob C. <ro...@ti...> - 2010-11-04 01:57:09
|
Use common submodule and pre-commit hook, and cosemetic gstomx.h whitespace change. Rob Clark (2): use common submodule minor formatting cleanup .gitignore | 3 + .gitmodules | 3 + autogen.sh | 60 ++++++++-- build-aux/gst-autogen.sh | 294 ---------------------------------------------- common | 1 + configure.ac | 17 ++- omx/gstomx.h | 6 +- shave-libtool.in | 69 ----------- shave.in | 79 ------------ 9 files changed, 74 insertions(+), 458 deletions(-) create mode 100644 .gitmodules delete mode 100644 build-aux/gst-autogen.sh create mode 160000 common delete mode 100644 shave-libtool.in delete mode 100644 shave.in |
From: Clark, R. <ro...@ti...> - 2010-11-04 01:55:47
|
On Mon, Nov 1, 2010 at 4:07 PM, Clark, Rob <ro...@ti...> wrote: > On Mon, Nov 1, 2010 at 3:14 PM, Stefan Kost <en...@ho...> wrote: >> Am 01.11.2010 17:53, schrieb Rob Clark: >>> I dislike how gst-indent tries to put something else on the same line with >>> G_BEGIN_DECLS... use a comment as a sneaky way to force it not to do this. >> >> You shouldn't run gst-indent on header files :) >> > > ahh, ok.. then I should replace with a patch to use the common > submodule (and the triggers it contains) rather than manually running > gst-indent ;-) > I'm about to send two patch sets.. the first with some misc cleanup, to use the gst common submodule, autogen.sh, and standard pre-commit trigger (and this small whitespace change). And the second with the changes to use config file for all the template caps. These two patch-sets supersede the previous patches I sent. BR, -R |
From: Clark, R. <ro...@ti...> - 2010-11-01 21:07:58
|
On Mon, Nov 1, 2010 at 3:14 PM, Stefan Kost <en...@ho...> wrote: > Am 01.11.2010 17:53, schrieb Rob Clark: >> I dislike how gst-indent tries to put something else on the same line with >> G_BEGIN_DECLS... use a comment as a sneaky way to force it not to do this. > > You shouldn't run gst-indent on header files :) > ahh, ok.. then I should replace with a patch to use the common submodule (and the triggers it contains) rather than manually running gst-indent ;-) BR, -R > Stefan > >> --- >> omx/gstomx.h | 6 +++++- >> 1 files changed, 5 insertions(+), 1 deletions(-) >> >> diff --git a/omx/gstomx.h b/omx/gstomx.h >> index 37027ec..a2377d3 100644 >> --- a/omx/gstomx.h >> +++ b/omx/gstomx.h >> @@ -24,8 +24,12 @@ >> >> #include <gst/gst.h> >> >> -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); >> +G_BEGIN_DECLS >> +/* gst-openmax debug categories: >> + */ >> +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); >> GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); >> + >> #define GST_CAT_DEFAULT gstomx_debug >> >> enum > > |
From: Stefan K. <en...@ho...> - 2010-11-01 20:12:05
|
Am 01.11.2010 17:53, schrieb Rob Clark: > I dislike how gst-indent tries to put something else on the same line with > G_BEGIN_DECLS... use a comment as a sneaky way to force it not to do this. You shouldn't run gst-indent on header files :) Stefan > --- > omx/gstomx.h | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/omx/gstomx.h b/omx/gstomx.h > index 37027ec..a2377d3 100644 > --- a/omx/gstomx.h > +++ b/omx/gstomx.h > @@ -24,8 +24,12 @@ > > #include <gst/gst.h> > > -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); > +G_BEGIN_DECLS > +/* gst-openmax debug categories: > + */ > +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); > GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); > + > #define GST_CAT_DEFAULT gstomx_debug > > enum |
From: Rob C. <ro...@ti...> - 2010-11-01 15:56:42
|
The omx_mpeg4dec element is converted.. the remaining changes are largly manual (ie. adding caps to config file, removing from individual element class files and adding appropriate calls to gstomx_template_caps()). But I thought I'd send what I have so far so folks could comment before I spend some boring time converting the rest of the elements ;-) --- v2: split out some of the cosmetic changes into a different patchset to simplify this patch omx/gstomx.c | 30 ++++++++++++++++++++++++ omx/gstomx.conf.in | 21 ++++++++++++++++ omx/gstomx.h | 1 + omx/gstomx_base_videodec.c | 54 ------------------------------------------- omx/gstomx_mpeg4dec.c | 55 ++++--------------------------------------- 5 files changed, 58 insertions(+), 103 deletions(-) diff --git a/omx/gstomx.c b/omx/gstomx.c index 8b375c0..c444de5 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -327,6 +327,36 @@ gstomx_core_new (void *object, GType type) return core; } +GstCaps * +gstomx_template_caps (GType type, const gchar * pad_name) +{ + const gchar *element_name; + GstStructure *element; + const gchar *caps_str; + + element_name = g_type_get_qdata (type, element_name_quark); + element = get_element_entry (element_name); + + + /* this shouldn't really happen.. */ + if (!element) + return GST_CAPS_ANY; + + caps_str = gst_structure_get_string (element, pad_name); + + GST_DEBUG ("%s: %s", element_name, caps_str); + + /* default to ANY.. at least for now.. maybe when everything is converted + * over, we should treat missing caps as a more serious condition? + */ + if (!caps_str) { + g_warning ("%s is missing required field: %s", element_name, pad_name); + return GST_CAPS_ANY; + } + + return gst_caps_from_string (caps_str); +} + void gstomx_install_property_helper (GObjectClass * gobject_class) { diff --git a/omx/gstomx.conf.in b/omx/gstomx.conf.in index c22c6d6..ed74ec2 100644 --- a/omx/gstomx.conf.in +++ b/omx/gstomx.conf.in @@ -20,10 +20,31 @@ omx_dummy_2, component-name=OMX.st.dummy2, rank=256; +/* standard width/height/framerate that applies to video decoders and encoders + * on both src and sink pad: + */ +#define VIDEO_SIZE_RATE \ + "width=(int)[16,4096], " \ + "height=(int)[16,4096], " \ + "framerate=(fraction)[0,max]" + +/* standard raw video caps that applies to all video decoder src pads and + * video encoder sink pads: + */ +#define RAW_VIDEO_CAPS \ + "video/x-raw-yuv, " \ + VIDEO_SIZE_RATE ", " \ + "format=(fourcc){I420, YUY2, UYVY, NV12}; " + omx_mpeg4dec, type=GstOmxMpeg4Dec, library-name=libomxil-bellagio.so.0, component-name=OMX.st.video_decoder.mpeg4, + src=RAW_VIDEO_CAPS, + sink="video/mpeg, mpegversion=(int)4, systemstream=false, " VIDEO_SIZE_RATE ";"\ + "video/x-divx, divxversion=(int)[4,5], " VIDEO_SIZE_RATE ";" \ + "video/x-xvid, " VIDEO_SIZE_RATE ";" \ + "video/x-3ivx, " VIDEO_SIZE_RATE ";", rank=256; omx_h264dec, diff --git a/omx/gstomx.h b/omx/gstomx.h index a2377d3..1a9013a 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -44,6 +44,7 @@ enum gboolean gstomx_get_component_info (void *core, GType type); void *gstomx_core_new (void *object, GType type); +GstCaps *gstomx_template_caps (GType type, const gchar * pad_name); void gstomx_install_property_helper (GObjectClass * gobject_class); gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue * value); diff --git a/omx/gstomx_base_videodec.c b/omx/gstomx_base_videodec.c index de36899..9148dec 100644 --- a/omx/gstomx_base_videodec.c +++ b/omx/gstomx_base_videodec.c @@ -25,63 +25,9 @@ GSTOMX_BOILERPLATE (GstOmxBaseVideoDec, gst_omx_base_videodec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-raw-yuv", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, GST_TYPE_FOURCC); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "format", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { - GstElementClass *element_class; - - element_class = GST_ELEMENT_CLASS (g_class); - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } } static void diff --git a/omx/gstomx_mpeg4dec.c b/omx/gstomx_mpeg4dec.c index f112ecb..1286f65 100644 --- a/omx/gstomx_mpeg4dec.c +++ b/omx/gstomx_mpeg4dec.c @@ -25,48 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxMpeg4Dec, gst_omx_mpeg4dec, GstOmxBaseVideoDec, GST_OMX_BASE_VIDEODEC_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/mpeg", - "mpegversion", G_TYPE_INT, 4, - "systemstream", G_TYPE_BOOLEAN, FALSE, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-divx", - "divxversion", GST_TYPE_INT_RANGE, 4, 5, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-xvid", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-3ivx", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -79,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Video", "Decodes video in MPEG-4 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void -- 1.7.1.1 |
From: Rob C. <ro...@ti...> - 2010-11-01 15:53:57
|
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 |
From: Rob C. <ro...@ti...> - 2010-11-01 15:53:56
|
I dislike how gst-indent tries to put something else on the same line with G_BEGIN_DECLS... use a comment as a sneaky way to force it not to do this. --- omx/gstomx.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/omx/gstomx.h b/omx/gstomx.h index 37027ec..a2377d3 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -24,8 +24,12 @@ #include <gst/gst.h> -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); +G_BEGIN_DECLS +/* gst-openmax debug categories: + */ +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); + #define GST_CAT_DEFAULT gstomx_debug enum -- 1.7.1.1 |
From: Rob C. <ro...@ti...> - 2010-11-01 15:53:27
|
Split this out into a patchset preceding changes for template caps from config file. Rob Clark (2): Some changes to gstomx.conf handling minor formatting cleanup omx/Makefile.am | 13 +++- omx/gstomx.conf | 203 ---------------------------------------------------- omx/gstomx.conf.in | 203 ++++++++++++++++++++++++++++++++++++++++++++++++++++ omx/gstomx.h | 6 ++- 4 files changed, 219 insertions(+), 206 deletions(-) delete mode 100644 omx/gstomx.conf create mode 100644 omx/gstomx.conf.in |
From: Felipe C. <fel...@no...> - 2010-11-01 15:47:21
|
ro...@ti... wrote: > The omx_mpeg4dec element is converted.. the remaining changes are largly > manual (ie. adding caps to config file, removing from individual element > class files and adding appropriate calls to gstomx_template_caps()). But I > thought I'd send what I have so far so folks could comment before I spend > some boring time converting the rest of the elements ;-) > > Note that I also move gstomx.conf to gstomx.conf.in and generate the > gstomx.conf as part of the build process, to make it easier to use the > preprocessor to avoid too much cut/paste for all the different caps fields. Looks ok to me. However, I would split the gstomx.conf change in a separate patch first. -- Felipe Contreras |
From: Clark, R. <ro...@ti...> - 2010-11-01 15:39:12
|
hmm.. let me split this into two patches to make the template caps from config file a bit easier to review updated patches in a few minutes BR, -R On Mon, Nov 1, 2010 at 8:53 AM, Rob Clark <ro...@ti...> wrote: > The omx_mpeg4dec element is converted.. the remaining changes are largly > manual (ie. adding caps to config file, removing from individual element > class files and adding appropriate calls to gstomx_template_caps()). But I > thought I'd send what I have so far so folks could comment before I spend > some boring time converting the rest of the elements ;-) > > Note that I also move gstomx.conf to gstomx.conf.in and generate the > gstomx.conf as part of the build process, to make it easier to use the > preprocessor to avoid too much cut/paste for all the different caps fields. > --- > omx/Makefile.am | 12 ++- > omx/gstomx.c | 30 ++++++ > omx/gstomx.conf | 203 --------------------------------------- > omx/gstomx.conf.in | 224 ++++++++++++++++++++++++++++++++++++++++++++ > omx/gstomx.h | 7 +- > omx/gstomx_base_videodec.c | 54 ----------- > omx/gstomx_mpeg4dec.c | 55 +---------- > 7 files changed, 277 insertions(+), 308 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..322695c 100644 > --- a/omx/Makefile.am > +++ b/omx/Makefile.am > @@ -50,7 +50,17 @@ libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) > > EXTRA_DIST = headers gstomx.conf > > +# 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.c b/omx/gstomx.c > index 8b375c0..7428270 100644 > --- a/omx/gstomx.c > +++ b/omx/gstomx.c > @@ -327,6 +327,36 @@ gstomx_core_new (void *object, GType type) > return core; > } > > +GstCaps * > +gstomx_template_caps (GType type, const gchar *pad_name) > +{ > + const gchar *element_name; > + GstStructure *element; > + const gchar *caps_str; > + > + element_name = g_type_get_qdata (type, element_name_quark); > + element = get_element_entry (element_name); > + > + > + /* this shouldn't really happen.. */ > + if (!element) > + return GST_CAPS_ANY; > + > + caps_str = gst_structure_get_string (element, pad_name); > + > + GST_DEBUG ("%s: %s", element_name, caps_str); > + > + /* default to ANY.. at least for now.. maybe when everything is converted > + * over, we should treat missing caps as a more serious condition? > + */ > + if (!caps_str) { > + g_warning ("%s is missing required field: %s", element_name, pad_name); > + return GST_CAPS_ANY; > + } > + > + return gst_caps_from_string (caps_str); > +} > + > void > gstomx_install_property_helper (GObjectClass * gobject_class) > { > 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..ed74ec2 > --- /dev/null > +++ b/omx/gstomx.conf.in > @@ -0,0 +1,224 @@ > +#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; > + > +/* standard width/height/framerate that applies to video decoders and encoders > + * on both src and sink pad: > + */ > +#define VIDEO_SIZE_RATE \ > + "width=(int)[16,4096], " \ > + "height=(int)[16,4096], " \ > + "framerate=(fraction)[0,max]" > + > +/* standard raw video caps that applies to all video decoder src pads and > + * video encoder sink pads: > + */ > +#define RAW_VIDEO_CAPS \ > + "video/x-raw-yuv, " \ > + VIDEO_SIZE_RATE ", " \ > + "format=(fourcc){I420, YUY2, UYVY, NV12}; " > + > +omx_mpeg4dec, > + type=GstOmxMpeg4Dec, > + library-name=libomxil-bellagio.so.0, > + component-name=OMX.st.video_decoder.mpeg4, > + src=RAW_VIDEO_CAPS, > + sink="video/mpeg, mpegversion=(int)4, systemstream=false, " VIDEO_SIZE_RATE ";"\ > + "video/x-divx, divxversion=(int)[4,5], " VIDEO_SIZE_RATE ";" \ > + "video/x-xvid, " VIDEO_SIZE_RATE ";" \ > + "video/x-3ivx, " VIDEO_SIZE_RATE ";", > + 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.h b/omx/gstomx.h > index 37027ec..af527ec 100644 > --- a/omx/gstomx.h > +++ b/omx/gstomx.h > @@ -24,8 +24,11 @@ > > #include <gst/gst.h> > > -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); > +G_BEGIN_DECLS > + > +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); > GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); > + > #define GST_CAT_DEFAULT gstomx_debug > > enum > @@ -40,8 +43,10 @@ enum > gboolean gstomx_get_component_info (void *core, GType type); > > void *gstomx_core_new (void *object, GType type); > +GstCaps * gstomx_template_caps (GType type, const gchar *pad_name); > void gstomx_install_property_helper (GObjectClass * gobject_class); > gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue * value); > > G_END_DECLS > + > #endif /* GSTOMX_H */ > diff --git a/omx/gstomx_base_videodec.c b/omx/gstomx_base_videodec.c > index de36899..9148dec 100644 > --- a/omx/gstomx_base_videodec.c > +++ b/omx/gstomx_base_videodec.c > @@ -25,63 +25,9 @@ > GSTOMX_BOILERPLATE (GstOmxBaseVideoDec, gst_omx_base_videodec, GstOmxBaseFilter, > GST_OMX_BASE_FILTER_TYPE); > > -static GstCaps * > -generate_src_template (void) > -{ > - GstCaps *caps; > - GstStructure *struc; > - > - caps = gst_caps_new_empty (); > - > - struc = gst_structure_new ("video/x-raw-yuv", > - "width", GST_TYPE_INT_RANGE, 16, 4096, > - "height", GST_TYPE_INT_RANGE, 16, 4096, > - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); > - > - { > - GValue list; > - GValue val; > - > - list.g_type = val.g_type = 0; > - > - g_value_init (&list, GST_TYPE_LIST); > - g_value_init (&val, GST_TYPE_FOURCC); > - > - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); > - gst_value_list_append_value (&list, &val); > - > - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')); > - gst_value_list_append_value (&list, &val); > - > - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); > - gst_value_list_append_value (&list, &val); > - > - gst_structure_set_value (struc, "format", &list); > - > - g_value_unset (&val); > - g_value_unset (&list); > - } > - > - gst_caps_append_structure (caps, struc); > - > - return caps; > -} > - > static void > type_base_init (gpointer g_class) > { > - GstElementClass *element_class; > - > - element_class = GST_ELEMENT_CLASS (g_class); > - > - { > - GstPadTemplate *template; > - > - template = gst_pad_template_new ("src", GST_PAD_SRC, > - GST_PAD_ALWAYS, generate_src_template ()); > - > - gst_element_class_add_pad_template (element_class, template); > - } > } > > static void > diff --git a/omx/gstomx_mpeg4dec.c b/omx/gstomx_mpeg4dec.c > index f112ecb..45c7030 100644 > --- a/omx/gstomx_mpeg4dec.c > +++ b/omx/gstomx_mpeg4dec.c > @@ -25,48 +25,6 @@ > GSTOMX_BOILERPLATE (GstOmxMpeg4Dec, gst_omx_mpeg4dec, GstOmxBaseVideoDec, > GST_OMX_BASE_VIDEODEC_TYPE); > > -static GstCaps * > -generate_sink_template (void) > -{ > - GstCaps *caps; > - GstStructure *struc; > - > - caps = gst_caps_new_empty (); > - > - struc = gst_structure_new ("video/mpeg", > - "mpegversion", G_TYPE_INT, 4, > - "systemstream", G_TYPE_BOOLEAN, FALSE, > - "width", GST_TYPE_INT_RANGE, 16, 4096, > - "height", GST_TYPE_INT_RANGE, 16, 4096, > - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); > - > - gst_caps_append_structure (caps, struc); > - > - struc = gst_structure_new ("video/x-divx", > - "divxversion", GST_TYPE_INT_RANGE, 4, 5, > - "width", GST_TYPE_INT_RANGE, 16, 4096, > - "height", GST_TYPE_INT_RANGE, 16, 4096, > - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); > - > - gst_caps_append_structure (caps, struc); > - > - struc = gst_structure_new ("video/x-xvid", > - "width", GST_TYPE_INT_RANGE, 16, 4096, > - "height", GST_TYPE_INT_RANGE, 16, 4096, > - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); > - > - gst_caps_append_structure (caps, struc); > - > - struc = gst_structure_new ("video/x-3ivx", > - "width", GST_TYPE_INT_RANGE, 16, 4096, > - "height", GST_TYPE_INT_RANGE, 16, 4096, > - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); > - > - gst_caps_append_structure (caps, struc); > - > - return caps; > -} > - > static void > type_base_init (gpointer g_class) > { > @@ -79,14 +37,13 @@ type_base_init (gpointer g_class) > "Codec/Decoder/Video", > "Decodes video in MPEG-4 format with OpenMAX IL", "Felipe Contreras"); > > - { > - GstPadTemplate *template; > - > - template = gst_pad_template_new ("sink", GST_PAD_SINK, > - GST_PAD_ALWAYS, generate_sink_template ()); > + gst_element_class_add_pad_template (element_class, > + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, > + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); > > - gst_element_class_add_pad_template (element_class, template); > - } > + gst_element_class_add_pad_template (element_class, > + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, > + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); > } > > static void > -- > 1.7.1.1 > > |
From: Rob C. <ro...@ti...> - 2010-11-01 13:54:02
|
The omx_mpeg4dec element is converted.. the remaining changes are largly manual (ie. adding caps to config file, removing from individual element class files and adding appropriate calls to gstomx_template_caps()). But I thought I'd send what I have so far so folks could comment before I spend some boring time converting the rest of the elements ;-) Note that I also move gstomx.conf to gstomx.conf.in and generate the gstomx.conf as part of the build process, to make it easier to use the preprocessor to avoid too much cut/paste for all the different caps fields. --- omx/Makefile.am | 12 ++- omx/gstomx.c | 30 ++++++ omx/gstomx.conf | 203 --------------------------------------- omx/gstomx.conf.in | 224 ++++++++++++++++++++++++++++++++++++++++++++ omx/gstomx.h | 7 +- omx/gstomx_base_videodec.c | 54 ----------- omx/gstomx_mpeg4dec.c | 55 +---------- 7 files changed, 277 insertions(+), 308 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..322695c 100644 --- a/omx/Makefile.am +++ b/omx/Makefile.am @@ -50,7 +50,17 @@ libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) EXTRA_DIST = headers gstomx.conf +# 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.c b/omx/gstomx.c index 8b375c0..7428270 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -327,6 +327,36 @@ gstomx_core_new (void *object, GType type) return core; } +GstCaps * +gstomx_template_caps (GType type, const gchar *pad_name) +{ + const gchar *element_name; + GstStructure *element; + const gchar *caps_str; + + element_name = g_type_get_qdata (type, element_name_quark); + element = get_element_entry (element_name); + + + /* this shouldn't really happen.. */ + if (!element) + return GST_CAPS_ANY; + + caps_str = gst_structure_get_string (element, pad_name); + + GST_DEBUG ("%s: %s", element_name, caps_str); + + /* default to ANY.. at least for now.. maybe when everything is converted + * over, we should treat missing caps as a more serious condition? + */ + if (!caps_str) { + g_warning ("%s is missing required field: %s", element_name, pad_name); + return GST_CAPS_ANY; + } + + return gst_caps_from_string (caps_str); +} + void gstomx_install_property_helper (GObjectClass * gobject_class) { 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..ed74ec2 --- /dev/null +++ b/omx/gstomx.conf.in @@ -0,0 +1,224 @@ +#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; + +/* standard width/height/framerate that applies to video decoders and encoders + * on both src and sink pad: + */ +#define VIDEO_SIZE_RATE \ + "width=(int)[16,4096], " \ + "height=(int)[16,4096], " \ + "framerate=(fraction)[0,max]" + +/* standard raw video caps that applies to all video decoder src pads and + * video encoder sink pads: + */ +#define RAW_VIDEO_CAPS \ + "video/x-raw-yuv, " \ + VIDEO_SIZE_RATE ", " \ + "format=(fourcc){I420, YUY2, UYVY, NV12}; " + +omx_mpeg4dec, + type=GstOmxMpeg4Dec, + library-name=libomxil-bellagio.so.0, + component-name=OMX.st.video_decoder.mpeg4, + src=RAW_VIDEO_CAPS, + sink="video/mpeg, mpegversion=(int)4, systemstream=false, " VIDEO_SIZE_RATE ";"\ + "video/x-divx, divxversion=(int)[4,5], " VIDEO_SIZE_RATE ";" \ + "video/x-xvid, " VIDEO_SIZE_RATE ";" \ + "video/x-3ivx, " VIDEO_SIZE_RATE ";", + 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.h b/omx/gstomx.h index 37027ec..af527ec 100644 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -24,8 +24,11 @@ #include <gst/gst.h> -G_BEGIN_DECLS GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); +G_BEGIN_DECLS + +GST_DEBUG_CATEGORY_EXTERN (gstomx_debug); GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug); + #define GST_CAT_DEFAULT gstomx_debug enum @@ -40,8 +43,10 @@ enum gboolean gstomx_get_component_info (void *core, GType type); void *gstomx_core_new (void *object, GType type); +GstCaps * gstomx_template_caps (GType type, const gchar *pad_name); void gstomx_install_property_helper (GObjectClass * gobject_class); gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue * value); G_END_DECLS + #endif /* GSTOMX_H */ diff --git a/omx/gstomx_base_videodec.c b/omx/gstomx_base_videodec.c index de36899..9148dec 100644 --- a/omx/gstomx_base_videodec.c +++ b/omx/gstomx_base_videodec.c @@ -25,63 +25,9 @@ GSTOMX_BOILERPLATE (GstOmxBaseVideoDec, gst_omx_base_videodec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE); -static GstCaps * -generate_src_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/x-raw-yuv", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - { - GValue list; - GValue val; - - list.g_type = val.g_type = 0; - - g_value_init (&list, GST_TYPE_LIST); - g_value_init (&val, GST_TYPE_FOURCC); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')); - gst_value_list_append_value (&list, &val); - - gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')); - gst_value_list_append_value (&list, &val); - - gst_structure_set_value (struc, "format", &list); - - g_value_unset (&val); - g_value_unset (&list); - } - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { - GstElementClass *element_class; - - element_class = GST_ELEMENT_CLASS (g_class); - - { - GstPadTemplate *template; - - template = gst_pad_template_new ("src", GST_PAD_SRC, - GST_PAD_ALWAYS, generate_src_template ()); - - gst_element_class_add_pad_template (element_class, template); - } } static void diff --git a/omx/gstomx_mpeg4dec.c b/omx/gstomx_mpeg4dec.c index f112ecb..45c7030 100644 --- a/omx/gstomx_mpeg4dec.c +++ b/omx/gstomx_mpeg4dec.c @@ -25,48 +25,6 @@ GSTOMX_BOILERPLATE (GstOmxMpeg4Dec, gst_omx_mpeg4dec, GstOmxBaseVideoDec, GST_OMX_BASE_VIDEODEC_TYPE); -static GstCaps * -generate_sink_template (void) -{ - GstCaps *caps; - GstStructure *struc; - - caps = gst_caps_new_empty (); - - struc = gst_structure_new ("video/mpeg", - "mpegversion", G_TYPE_INT, 4, - "systemstream", G_TYPE_BOOLEAN, FALSE, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-divx", - "divxversion", GST_TYPE_INT_RANGE, 4, 5, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-xvid", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - struc = gst_structure_new ("video/x-3ivx", - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, - "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL); - - gst_caps_append_structure (caps, struc); - - return caps; -} - static void type_base_init (gpointer g_class) { @@ -79,14 +37,13 @@ type_base_init (gpointer g_class) "Codec/Decoder/Video", "Decodes video in MPEG-4 format with OpenMAX IL", "Felipe Contreras"); - { - GstPadTemplate *template; - - template = gst_pad_template_new ("sink", GST_PAD_SINK, - GST_PAD_ALWAYS, generate_sink_template ()); + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "sink"))); - gst_element_class_add_pad_template (element_class, template); - } + gst_element_class_add_pad_template (element_class, + gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, + gstomx_template_caps (G_TYPE_FROM_CLASS (g_class), "src"))); } static void -- 1.7.1.1 |
From: Felipe C. <fel...@gm...> - 2010-10-04 15:15:04
|
On Mon, Oct 4, 2010 at 6:04 PM, Clark, Rob <ro...@ti...> wrote: > On Mon, Oct 4, 2010 at 9:44 AM, cristiurban <cri...@gm...> > wrote: >> The pipeline I am using is : >> gst-launch -v filesrc location=<path to media file> ! nv_omx_mp3dec ! >> audioconverter ! audioresample ! alsasink (used -v for debug) >> This is a command that you should verify that it is working, for these to >> work you must have the nvidia sound drivers. Of course, my app is in C >> source, and somewhere after I give the playing state I try to extract the >> current time and then I get zero. >> If this doesn't work try the same pipeline but you must replace the >> "nv_omx_decoder" with "mad" and works just fine, but this I know. In time >> I >> had beed looking in OMX API to see if something wrong there, but no result >> yet. > > from filesrc, you will not get timestamps. So things like seek won't work > unless your mp3 decoder is also a parser and generating it's own timestamps > and supporting seeking. My guess is that mad does this, and your OMX > component does not. > Please try putting mp3parse between filesrc and nv_omx_mp3dec Yes, this is exampled in the main page: http://freedesktop.org/wiki/GstOpenMAX -- Felipe Contreras |
From: Clark, R. <ro...@ti...> - 2010-10-04 15:04:38
|
On Mon, Oct 4, 2010 at 9:44 AM, cristiurban <cri...@gm...>wrote: > > The pipeline I am using is : > gst-launch -v filesrc location=<path to media file> ! nv_omx_mp3dec ! > audioconverter ! audioresample ! alsasink (used -v for debug) > This is a command that you should verify that it is working, for these to > work you must have the nvidia sound drivers. Of course, my app is in C > source, and somewhere after I give the playing state I try to extract the > current time and then I get zero. > If this doesn't work try the same pipeline but you must replace the > "nv_omx_decoder" with "mad" and works just fine, but this I know. In time I > had beed looking in OMX API to see if something wrong there, but no result > yet. > > from filesrc, you will not get timestamps. So things like seek won't work unless your mp3 decoder is also a parser and generating it's own timestamps and supporting seeking. My guess is that mad does this, and your OMX component does not. Please try putting mp3parse between filesrc and nv_omx_mp3dec BR, -R |
From: Clark, R. <ro...@ti...> - 2010-10-04 12:04:02
|
On Mon, Oct 4, 2010 at 5:27 AM, cristiurban <cri...@gm...>wrote: > > I had use openmax in some of my applications and I want to see if I am > doing > wrong or indeed it is a bug. > I have two simple applications that decodes mp3 files : in first app I use > the "mad" element for the decoder in my pipeline. Using threads , once I > start the application the thread starts and begins to get the current time > of stream ( I use "gst_element_query_position (pipeline, &fmt, &pos)" then > with printf I display the current time on my output (like this <printf > ("timestamp: %" , GST_TIME_FORMAT, GST_TIME_ARGS (pos));>. It works fine, > but I put a sleep(1) in my thread to display once every 1 second. > The second application, same thing but as a decoder I use "nv_omx_mp3dec" > element. Once I compile (no errors) and start the application, I get the > current time always zero. > If anyone has the same problem or check if this is wrong and it works , > please i would like to know. > > Could you give the pipeline you are using in either case? You may need an mp3parse before the decoder (if you don't already have one). BR, -R |
From: Felipe C. <fel...@gm...> - 2010-10-01 22:13:20
|
Hi, It has been a long time but finally it's here; the first stable release of gst-openmax. Most likely it has been stable for quite some time, but only now the code-style has migrated to GStreamer one, and a bunch of patches from TI have been merged, so it seems like a good time to release. Also, this version now features a configuration mechanism, so you can select pretty much every combination of GStreamer elements you might need, and specify the OpenMAX IL library, component name, role, and even your desired rank. gst-openmax has been tested in multiple OpenMAX IL implementations, such as Bellagio, and Texas Instrument's OMAP. Depending on the implementation some changes might be needed, but ideally it should work straight out-of-the-box. If you find that some changes are needed, please contribute the changes back. Elements supported * MPEG-4 encoder/decoder * H.263 encoder/decoder * H.264 encoder/decoder * WMV decoder * Vorbis decoder * MP3 decoder * Volume filter Experimental elements (should work but not extensively tested) * AMR-NB encoder/decoder * AMR-WB encoder/decoder * AAC encoder/decoder * MP2 decoder * ADPCM encoder/decoder * G.711 encoder/decoder * G.729 encoder/decoder * iLBC encoder/decoder * JPEG encoder * video renderer * file reader Compared to previous pre-releases, this version now features a configuration mechanism, so you can select pretty much every combination of GStreamer elements you might need, and specify the OpenMAX IL library, component name, role, and even your desired rank. Tarballs can be found here: http://gstreamer.freedesktop.org/src/gst-openmax/ Compared to v0.10.0.5: Felipe Contreras (33): Update I420 to PackedPlanar util: trivial cleanup util: improve timeout messages util: cleanup ports when going to loaded util: increase timeout value base_videoenc: use 0 as automatic bitrate videodec: handle empty framerate build: update 'common' stuff util: fix compilation warning base_filter: trivial cleanup base_filter: more proper printf formatting base_sink: remove dead assignment videodec: fallback framerate to 0/1 tests: trivial fix Move component and library name fields to 'util' Reorganize core_new() Reorganize {library,component}-name assigns Make {component,library}-name read-only base: remove unused set_property() base: remove extra code plugin: reorganize code into get_config_path() plugin: add support for system-wide config Add example configuration plugin: reorganize element_table init plugin: make element_table const plugin: add support dependencies plugin: store element_table in plugin cache base-filter: improve EOS handling Fix compilation warnings Change to gst coding-style Generate ChangeLog build: remove patches extra dir build: add missing files to the dist Mark Nauwelaerts (1): base_filter: fix race condition when shutting down Rob Clark (21): Fixes for building for 64bit host Initial support for configuration file Add default configuration tests: update to use config file build: fixes for out-of-tree Use G_PARAM_STATIC_STRINGS basefilter: small fix for compile error Add GSTOMX_BOILERPLATE macros util: thread safety for _get_type() functions Construct GOmxPort objects in element constructor Simplify g_omx_port_setup() Don't hard-code port indexes core: call OMX_GetHandle in g_omx_core_new util: add some debug traces Add G_OMX_INIT_PARAM utility macro Add property helpers Add component-role support base: add input-buffers/output-buffers properties Add some debug traces Add GstOmxBaseAudioDec base class replace deprecated API Total contributions for v0.10.1: 1 David Schleef 2 Edward Hervey 370 Felipe Contreras 2 Frederik Vermelen 1 Frederik Vernelen 4 Jan Schmidt 1 Marco Ballesio 9 Mark Nauwelaerts 1 Olivier Crête 16 René Stadler 21 Rob Clark 4 Sebastian Dröge 1 Sriram Murthy 1 Stefan Kost 1 Tim-Philipp Müller Thanks to all the contributors! Cheers. -- Felipe Contreras |
From: Felipe C. <fel...@gm...> - 2010-09-13 11:10:02
|
Hi Lars, On Mon, Sep 13, 2010 at 1:06 PM, Lars Remes <lar...@sy...> wrote: > What is the preferred way to add support for new OMX types in gst-openmax? > For example, adding support for new audio codecs/formats that do not (yet?) have a param/type > definition in OMX_Audio.h. Well, we haven't had this situation before. I'm thinking perhaps a header in omx/headers, maybe omx_custom.h, or something, but I wouldn't want to discourage any other solution. Anyway, if you send the patches, we can decide what's best in the review process :) -- Felipe Contreras |
From: Felipe C. <fel...@gm...> - 2010-09-13 11:02:24
|
On Mon, Sep 13, 2010 at 1:27 PM, Mickey Kim <jih...@sa...> wrote: > Felipe Contreras<fel...@gm...> wrote: >> That's what my patch is supposed to fix; g_omx_port_release_buffer() >> is called now. > > I'm sorry. > There is my mistake when I apply your patch. > It is woking well now. > I think your approach is also good and more simple. > If there is not any more issue, I think it is good to apply your patch. Excellent, I'll apply the patch then, and add a note that you reviewed/tested it :) -- Felipe Contreras |