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: Rob C. <ro...@ti...> - 2010-04-19 07:33:11
|
On 04/19/2010 02:23 AM, Felipe Contreras wrote:
> On Mon, Apr 19, 2010 at 10:13 AM, Stefan Kost<en...@ho...> wrote:
>
>> It has been deprecated to highlight that we suggest to use the newer
>> one. The old one is still there and the new one is there for quite some
>> time, so there is most probably no need to bump any core requirement.
>>
> Yeah, but that's code-style patronizing. So what if I prefer a C99 style like:
>
> GstElementDetails details = {
> .longname = "OpenMAX IL AAC audio decoder",
> .klass = "Codec/Decoder/Audio",
> .description = "Decodes audio in AAC format with OpenMAX IL",
> .author = "Felipe Contreras",
> };
>
> gst_element_class_set_details(element_class,&details);
>
> At some point that won't work? Why?
>
>
IIRC it was some brokenness of GstElementDetails which showed when
-Wwrite-strings (or similar) was enabled.. because the fields in that
struct were not const. I think the only wait to fix that would be have
some new GstElementDetailsConst struct, which isn't any better..
honestly, I don't have a preference either way.. the only reason I
changed this was I didn't want to have to remove GST_DISABLE_DEPRECATED
BR,
-R
|
|
From: Stefan K. <en...@ho...> - 2010-04-19 07:28:58
|
Felipe Contreras wrote:
> On Mon, Apr 19, 2010 at 10:13 AM, Stefan Kost <en...@ho...> wrote:
>
>> It has been deprecated to highlight that we suggest to use the newer
>> one. The old one is still there and the new one is there for quite some
>> time, so there is most probably no need to bump any core requirement.
>>
>
> Yeah, but that's code-style patronizing. So what if I prefer a C99 style like:
>
> GstElementDetails details = {
> .longname = "OpenMAX IL AAC audio decoder",
> .klass = "Codec/Decoder/Audio",
> .description = "Decodes audio in AAC format with OpenMAX IL",
> .author = "Felipe Contreras",
> };
>
> gst_element_class_set_details(element_class, &details);
>
> At some point that won't work? Why?
>
>
It is causing a extra reloc and pointer copying. What I would like to
see instead is to use GstStructure for plugin and element details. Then
we would have:
gst_element_class_set_info(element_class,...)
this could be either a varargs function that takes the args and/or one that takes the structure. Right now using a non extensible intermediate structure is not so useful.
Stefan
|
|
From: Felipe C. <fel...@gm...> - 2010-04-19 07:23:12
|
On Mon, Apr 19, 2010 at 10:13 AM, Stefan Kost <en...@ho...> wrote:
> It has been deprecated to highlight that we suggest to use the newer
> one. The old one is still there and the new one is there for quite some
> time, so there is most probably no need to bump any core requirement.
Yeah, but that's code-style patronizing. So what if I prefer a C99 style like:
GstElementDetails details = {
.longname = "OpenMAX IL AAC audio decoder",
.klass = "Codec/Decoder/Audio",
.description = "Decodes audio in AAC format with OpenMAX IL",
.author = "Felipe Contreras",
};
gst_element_class_set_details(element_class, &details);
At some point that won't work? Why?
--
Felipe Contreras
|
|
From: Stefan K. <en...@ho...> - 2010-04-19 07:13:56
|
Felipe Contreras wrote: > 2010/4/19 Rob Clark <ro...@ti...>: > >> gst_element_class_set_details() is now deprecated. Replace with gst_element_class_set_details_simple() instead. >> > > Agh. I don't see the point of that deprecation, I will contend that. > > It has been deprecated to highlight that we suggest to use the newer one. The old one is still there and the new one is there for quite some time, so there is most probably no need to bump any core requirement. Stefan |
|
From: Felipe C. <fel...@gm...> - 2010-04-19 07:05:36
|
2010/4/19 Rob Clark <ro...@ti...>: > gst_element_class_set_details() is now deprecated. Replace with gst_element_class_set_details_simple() instead. Agh. I don't see the point of that deprecation, I will contend that. -- Felipe Contreras |
|
From: Rob C. <ro...@ti...> - 2010-04-19 04:33:18
|
gst_element_class_set_details() is now deprecated. Replace with gst_element_class_set_details_simple() instead.
---
omx/gstomx_aacdec.c | 15 +++++----------
omx/gstomx_aacenc.c | 15 +++++----------
omx/gstomx_adpcmdec.c | 15 +++++----------
omx/gstomx_adpcmenc.c | 15 +++++----------
omx/gstomx_amrnbdec.c | 15 +++++----------
omx/gstomx_amrnbenc.c | 15 +++++----------
omx/gstomx_amrwbdec.c | 15 +++++----------
omx/gstomx_amrwbenc.c | 15 +++++----------
omx/gstomx_audiosink.c | 15 +++++----------
omx/gstomx_dummy.c | 15 +++++----------
omx/gstomx_filereadersrc.c | 15 +++++----------
omx/gstomx_g711dec.c | 15 +++++----------
omx/gstomx_g711enc.c | 15 +++++----------
omx/gstomx_g729dec.c | 15 +++++----------
omx/gstomx_g729enc.c | 15 +++++----------
omx/gstomx_h263dec.c | 15 +++++----------
omx/gstomx_h263enc.c | 15 +++++----------
omx/gstomx_h264dec.c | 15 +++++----------
omx/gstomx_h264enc.c | 15 +++++----------
omx/gstomx_ilbcdec.c | 15 +++++----------
omx/gstomx_ilbcenc.c | 15 +++++----------
omx/gstomx_jpegenc.c | 15 +++++----------
omx/gstomx_mp2dec.c | 15 +++++----------
omx/gstomx_mp3dec.c | 15 +++++----------
omx/gstomx_mpeg4dec.c | 15 +++++----------
omx/gstomx_mpeg4enc.c | 15 +++++----------
omx/gstomx_videosink.c | 15 +++++----------
omx/gstomx_volume.c | 15 +++++----------
omx/gstomx_vorbisdec.c | 15 +++++----------
omx/gstomx_wmvdec.c | 15 +++++----------
30 files changed, 150 insertions(+), 300 deletions(-)
diff --git a/omx/gstomx_aacdec.c b/omx/gstomx_aacdec.c
index 1916216..ddad4ca 100644
--- a/omx/gstomx_aacdec.c
+++ b/omx/gstomx_aacdec.c
@@ -88,16 +88,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AAC audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in AAC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AAC audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in AAC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_aacenc.c b/omx/gstomx_aacenc.c
index 2eb0e96..e038791 100644
--- a/omx/gstomx_aacenc.c
+++ b/omx/gstomx_aacenc.c
@@ -154,16 +154,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AAC audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in AAC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AAC audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in AAC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_adpcmdec.c b/omx/gstomx_adpcmdec.c
index d33de1a..6969937 100644
--- a/omx/gstomx_adpcmdec.c
+++ b/omx/gstomx_adpcmdec.c
@@ -64,16 +64,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL ADPCM audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in ADPCM format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL ADPCM audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in ADPCM format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_adpcmenc.c b/omx/gstomx_adpcmenc.c
index fabb4bd..4e82f56 100644
--- a/omx/gstomx_adpcmenc.c
+++ b/omx/gstomx_adpcmenc.c
@@ -63,16 +63,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL ADPCM audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in ADPCM format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL ADPCM audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in ADPCM format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_amrnbdec.c b/omx/gstomx_amrnbdec.c
index 0362731..7b8f707 100644
--- a/omx/gstomx_amrnbdec.c
+++ b/omx/gstomx_amrnbdec.c
@@ -61,16 +61,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AMR-NB audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in AMR-NB format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AMR-NB audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in AMR-NB format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_amrnbenc.c b/omx/gstomx_amrnbenc.c
index 5e1ccff..8e61716 100644
--- a/omx/gstomx_amrnbenc.c
+++ b/omx/gstomx_amrnbenc.c
@@ -70,16 +70,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AMR-NB audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in AMR-NB format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AMR-NB audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in AMR-NB format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_amrwbdec.c b/omx/gstomx_amrwbdec.c
index 581b3da..67d7b0f 100644
--- a/omx/gstomx_amrwbdec.c
+++ b/omx/gstomx_amrwbdec.c
@@ -61,16 +61,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AMR-WB audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in AMR-WB format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AMR-WB audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in AMR-WB format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_amrwbenc.c b/omx/gstomx_amrwbenc.c
index 352b93f..7eaef10 100644
--- a/omx/gstomx_amrwbenc.c
+++ b/omx/gstomx_amrwbenc.c
@@ -70,16 +70,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL AMR-WB audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in AMR-WB format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL AMR-WB audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in AMR-WB format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_audiosink.c b/omx/gstomx_audiosink.c
index 5f63d4c..3974034 100644
--- a/omx/gstomx_audiosink.c
+++ b/omx/gstomx_audiosink.c
@@ -48,16 +48,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL audiosink element";
- details.klass = "Sink/Audio";
- details.description = "Renders audio";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL audiosink element",
+ "Sink/Audio",
+ "Renders audio",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_dummy.c b/omx/gstomx_dummy.c
index 03ebc41..cc43c28 100644
--- a/omx/gstomx_dummy.c
+++ b/omx/gstomx_dummy.c
@@ -52,16 +52,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL dummy element";
- details.klass = "None";
- details.description = "Does nothing";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL dummy element",
+ "None",
+ "Does nothing",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_filereadersrc.c b/omx/gstomx_filereadersrc.c
index f6c8dd1..76a17fa 100644
--- a/omx/gstomx_filereadersrc.c
+++ b/omx/gstomx_filereadersrc.c
@@ -48,16 +48,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL filereader src element";
- details.klass = "None";
- details.description = "Does nothing";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL filereader src element",
+ "None",
+ "Does nothing",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_g711dec.c b/omx/gstomx_g711dec.c
index 2067953..87a1123 100644
--- a/omx/gstomx_g711dec.c
+++ b/omx/gstomx_g711dec.c
@@ -77,16 +77,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL G.711 audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in G.711 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL G.711 audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in G.711 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_g711enc.c b/omx/gstomx_g711enc.c
index 003058e..550e435 100644
--- a/omx/gstomx_g711enc.c
+++ b/omx/gstomx_g711enc.c
@@ -76,16 +76,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL G.711 audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in G.711 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL G.711 audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in G.711 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_g729dec.c b/omx/gstomx_g729dec.c
index a558011..917ea2f 100644
--- a/omx/gstomx_g729dec.c
+++ b/omx/gstomx_g729dec.c
@@ -66,16 +66,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL G.729 audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in G.729 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL G.729 audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in G.729 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_g729enc.c b/omx/gstomx_g729enc.c
index 89d58db..64d93f7 100644
--- a/omx/gstomx_g729enc.c
+++ b/omx/gstomx_g729enc.c
@@ -75,16 +75,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL G.729 audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in G.729 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL G.729 audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in G.729 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_h263dec.c b/omx/gstomx_h263dec.c
index 233e041..6c1e1d1 100644
--- a/omx/gstomx_h263dec.c
+++ b/omx/gstomx_h263dec.c
@@ -51,16 +51,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL H.263 video decoder";
- details.klass = "Codec/Decoder/Video";
- details.description = "Decodes video in H.263 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL H.263 video decoder",
+ "Codec/Decoder/Video",
+ "Decodes video in H.263 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_h263enc.c b/omx/gstomx_h263enc.c
index 9caaff7..4ec12b7 100644
--- a/omx/gstomx_h263enc.c
+++ b/omx/gstomx_h263enc.c
@@ -46,16 +46,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL H.263 video encoder";
- details.klass = "Codec/Encoder/Video";
- details.description = "Encodes video in H.263 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL H.263 video encoder",
+ "Codec/Encoder/Video",
+ "Encodes video in H.263 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_h264dec.c b/omx/gstomx_h264dec.c
index 4f950df..7815f98 100644
--- a/omx/gstomx_h264dec.c
+++ b/omx/gstomx_h264dec.c
@@ -50,16 +50,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL H.264/AVC video decoder";
- details.klass = "Codec/Decoder/Video";
- details.description = "Decodes video in H.264/AVC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL H.264/AVC video decoder",
+ "Codec/Decoder/Video",
+ "Decodes video in H.264/AVC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_h264enc.c b/omx/gstomx_h264enc.c
index efc4092..adf4c9a 100644
--- a/omx/gstomx_h264enc.c
+++ b/omx/gstomx_h264enc.c
@@ -45,16 +45,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL H.264/AVC video encoder";
- details.klass = "Codec/Encoder/Video";
- details.description = "Encodes video in H.264/AVC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL H.264/AVC video encoder",
+ "Codec/Encoder/Video",
+ "Encodes video in H.264/AVC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_ilbcdec.c b/omx/gstomx_ilbcdec.c
index ff899ac..69ce9ad 100644
--- a/omx/gstomx_ilbcdec.c
+++ b/omx/gstomx_ilbcdec.c
@@ -87,16 +87,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL iLBC audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in iLBC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL iLBC audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in iLBC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_ilbcenc.c b/omx/gstomx_ilbcenc.c
index 1da2c53..5ecfbf7 100644
--- a/omx/gstomx_ilbcenc.c
+++ b/omx/gstomx_ilbcenc.c
@@ -86,16 +86,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL iLBC audio encoder";
- details.klass = "Codec/Encoder/Audio";
- details.description = "Encodes audio in iLBC format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL iLBC audio encoder",
+ "Codec/Encoder/Audio",
+ "Encodes audio in iLBC format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_jpegenc.c b/omx/gstomx_jpegenc.c
index e34c3fc..0ca4f8e 100644
--- a/omx/gstomx_jpegenc.c
+++ b/omx/gstomx_jpegenc.c
@@ -95,16 +95,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL JPEG image encoder";
- details.klass = "Codec/Encoder/Image";
- details.description = "Encodes image in JPEG format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL JPEG image encoder",
+ "Codec/Encoder/Image",
+ "Encodes image in JPEG format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_mp2dec.c b/omx/gstomx_mp2dec.c
index 319ef8e..9168d98 100644
--- a/omx/gstomx_mp2dec.c
+++ b/omx/gstomx_mp2dec.c
@@ -65,16 +65,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL MP2 audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in MP2 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL MP2 audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in MP2 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_mp3dec.c b/omx/gstomx_mp3dec.c
index 8a1f465..19c217d 100644
--- a/omx/gstomx_mp3dec.c
+++ b/omx/gstomx_mp3dec.c
@@ -64,16 +64,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL MP3 audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in MP3 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL MP3 audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in MP3 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_mpeg4dec.c b/omx/gstomx_mpeg4dec.c
index a23fef0..59b04a9 100644
--- a/omx/gstomx_mpeg4dec.c
+++ b/omx/gstomx_mpeg4dec.c
@@ -77,16 +77,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL MPEG-4 video decoder";
- details.klass = "Codec/Decoder/Video";
- details.description = "Decodes video in MPEG-4 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL MPEG-4 video decoder",
+ "Codec/Decoder/Video",
+ "Decodes video in MPEG-4 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_mpeg4enc.c b/omx/gstomx_mpeg4enc.c
index 3f97fb0..b715fc2 100644
--- a/omx/gstomx_mpeg4enc.c
+++ b/omx/gstomx_mpeg4enc.c
@@ -47,16 +47,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL MPEG-4 video encoder";
- details.klass = "Codec/Encoder/Video";
- details.description = "Encodes video in MPEG-4 format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL MPEG-4 video encoder",
+ "Codec/Encoder/Video",
+ "Encodes video in MPEG-4 format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_videosink.c b/omx/gstomx_videosink.c
index 4cfc300..d6f6938 100644
--- a/omx/gstomx_videosink.c
+++ b/omx/gstomx_videosink.c
@@ -85,16 +85,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL videosink element";
- details.klass = "Video/Sink";
- details.description = "Renders video";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL videosink element",
+ "Video/Sink",
+ "Renders video",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_volume.c b/omx/gstomx_volume.c
index 61c7f79..6ca8cf0 100644
--- a/omx/gstomx_volume.c
+++ b/omx/gstomx_volume.c
@@ -67,16 +67,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL Volume component";
- details.klass = "Filter/Effect/Audio";
- details.description = "Changes the volume with OpenMAX IL";
- details.author = "Frederik Vernelen";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL Volume component",
+ "Filter/Effect/Audio",
+ "Changes the volume with OpenMAX IL",
+ "Frederik Vernelen");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_vorbisdec.c b/omx/gstomx_vorbisdec.c
index afd53fd..51145f6 100644
--- a/omx/gstomx_vorbisdec.c
+++ b/omx/gstomx_vorbisdec.c
@@ -59,16 +59,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL Vorbis audio decoder";
- details.klass = "Codec/Decoder/Audio";
- details.description = "Decodes audio in Vorbis format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL Vorbis audio decoder",
+ "Codec/Decoder/Audio",
+ "Decodes audio in Vorbis format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
diff --git a/omx/gstomx_wmvdec.c b/omx/gstomx_wmvdec.c
index b16fd88..eb05a40 100644
--- a/omx/gstomx_wmvdec.c
+++ b/omx/gstomx_wmvdec.c
@@ -50,16 +50,11 @@ type_base_init (gpointer g_class)
element_class = GST_ELEMENT_CLASS (g_class);
- {
- GstElementDetails details;
-
- details.longname = "OpenMAX IL WMV video decoder";
- details.klass = "Codec/Decoder/Video";
- details.description = "Decodes video in WMV format with OpenMAX IL";
- details.author = "Felipe Contreras";
-
- gst_element_class_set_details (element_class, &details);
- }
+ gst_element_class_set_details_simple (element_class,
+ "OpenMAX IL WMV video decoder",
+ "Codec/Decoder/Video",
+ "Decodes video in WMV format with OpenMAX IL",
+ "Felipe Contreras");
{
GstPadTemplate *template;
--
1.7.0
|
|
From: Rob C. <ro...@ti...> - 2010-04-19 04:32:35
|
Refactor some common functionality, in particular the settings_changed_cb,
into an abstract base class.
---
omx/Makefile.am | 1 +
omx/gstomx_aacdec.c | 45 +--------------------
omx/gstomx_aacdec.h | 6 +-
omx/gstomx_adpcmdec.c | 1 +
omx/gstomx_amrnbdec.c | 48 +----------------------
omx/gstomx_amrnbdec.h | 6 +-
omx/gstomx_amrwbdec.c | 48 +----------------------
omx/gstomx_amrwbdec.h | 6 +-
omx/gstomx_base_audiodec.c | 95 ++++++++++++++++++++++++++++++++++++++++++++
omx/gstomx_base_audiodec.h | 51 +++++++++++++++++++++++
omx/gstomx_g711dec.c | 1 +
omx/gstomx_g729dec.c | 4 +-
omx/gstomx_g729dec.h | 6 +-
omx/gstomx_ilbcdec.c | 1 +
omx/gstomx_mp2dec.c | 55 +-------------------------
omx/gstomx_mp2dec.h | 6 +-
omx/gstomx_mp3dec.c | 56 +-------------------------
omx/gstomx_mp3dec.h | 6 +-
omx/gstomx_vorbisdec.c | 45 +--------------------
omx/gstomx_vorbisdec.h | 6 +-
20 files changed, 179 insertions(+), 314 deletions(-)
create mode 100644 omx/gstomx_base_audiodec.c
create mode 100644 omx/gstomx_base_audiodec.h
diff --git a/omx/Makefile.am b/omx/Makefile.am
index 80e7d9a..7e9f81f 100644
--- a/omx/Makefile.am
+++ b/omx/Makefile.am
@@ -6,6 +6,7 @@ libgstomx_la_SOURCES = gstomx.c gstomx.h \
gstomx_base_filter.c gstomx_base_filter.h \
gstomx_base_videodec.c gstomx_base_videodec.h \
gstomx_base_videoenc.c gstomx_base_videoenc.h \
+ gstomx_base_audiodec.c gstomx_base_audiodec.h \
gstomx_dummy.c gstomx_dummy.h \
gstomx_volume.c gstomx_volume.h \
gstomx_mpeg4dec.c gstomx_mpeg4dec.h \
diff --git a/omx/gstomx_aacdec.c b/omx/gstomx_aacdec.c
index b8f0fb2..1916216 100644
--- a/omx/gstomx_aacdec.c
+++ b/omx/gstomx_aacdec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_aacdec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxAacDec, gst_omx_aacdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxAacDec, gst_omx_aacdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -127,46 +126,6 @@ type_class_init (gpointer g_class,
{
}
-static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "channels", G_TYPE_INT, channels,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
static gboolean
sink_setcaps (GstPad *pad,
GstCaps *caps)
@@ -204,7 +163,5 @@ type_instance_init (GTypeInstance *instance,
omx_base = GST_OMX_BASE_FILTER (instance);
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
-
gst_pad_set_setcaps_function (omx_base->sinkpad, sink_setcaps);
}
diff --git a/omx/gstomx_aacdec.h b/omx/gstomx_aacdec.h
index b53b030..1b431fd 100644
--- a/omx/gstomx_aacdec.h
+++ b/omx/gstomx_aacdec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxAacDec GstOmxAacDec;
typedef struct GstOmxAacDecClass GstOmxAacDecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxAacDec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxAacDecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_aacdec_get_type (void);
diff --git a/omx/gstomx_adpcmdec.c b/omx/gstomx_adpcmdec.c
index 63151d9..d33de1a 100644
--- a/omx/gstomx_adpcmdec.c
+++ b/omx/gstomx_adpcmdec.c
@@ -23,6 +23,7 @@
#include "gstomx_base_filter.h"
#include "gstomx.h"
+/* should this class extend GstOmxBaseAudioDec? */
GSTOMX_BOILERPLATE (GstOmxAdpcmDec, gst_omx_adpcmdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
static GstCaps *
diff --git a/omx/gstomx_amrnbdec.c b/omx/gstomx_amrnbdec.c
index 6d0cbaf..0362731 100644
--- a/omx/gstomx_amrnbdec.c
+++ b/omx/gstomx_amrnbdec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_amrnbdec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxAmrNbDec, gst_omx_amrnbdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxAmrNbDec, gst_omx_amrnbdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -101,52 +100,7 @@ type_class_init (gpointer g_class,
}
static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "channels", G_TYPE_INT, channels,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
-static void
type_instance_init (GTypeInstance *instance,
gpointer g_class)
{
- GstOmxBaseFilter *omx_base;
-
- omx_base = GST_OMX_BASE_FILTER (instance);
-
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
}
diff --git a/omx/gstomx_amrnbdec.h b/omx/gstomx_amrnbdec.h
index 3ec66c2..781e4ed 100644
--- a/omx/gstomx_amrnbdec.h
+++ b/omx/gstomx_amrnbdec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxAmrNbDec GstOmxAmrNbDec;
typedef struct GstOmxAmrNbDecClass GstOmxAmrNbDecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxAmrNbDec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxAmrNbDecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_amrnbdec_get_type (void);
diff --git a/omx/gstomx_amrwbdec.c b/omx/gstomx_amrwbdec.c
index cb41789..581b3da 100644
--- a/omx/gstomx_amrwbdec.c
+++ b/omx/gstomx_amrwbdec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_amrwbdec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxAmrWbDec, gst_omx_amrwbdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxAmrWbDec, gst_omx_amrwbdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -101,52 +100,7 @@ type_class_init (gpointer g_class,
}
static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "channels", G_TYPE_INT, channels,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
-static void
type_instance_init (GTypeInstance *instance,
gpointer g_class)
{
- GstOmxBaseFilter *omx_base;
-
- omx_base = GST_OMX_BASE_FILTER (instance);
-
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
}
diff --git a/omx/gstomx_amrwbdec.h b/omx/gstomx_amrwbdec.h
index ae0a2cf..61870b8 100644
--- a/omx/gstomx_amrwbdec.h
+++ b/omx/gstomx_amrwbdec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxAmrWbDec GstOmxAmrWbDec;
typedef struct GstOmxAmrWbDecClass GstOmxAmrWbDecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxAmrWbDec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxAmrWbDecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_amrwbdec_get_type (void);
diff --git a/omx/gstomx_base_audiodec.c b/omx/gstomx_base_audiodec.c
new file mode 100644
index 0000000..25f19cb
--- /dev/null
+++ b/omx/gstomx_base_audiodec.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2009 Texas Instruments, Inc.
+ *
+ * Author: Rob Clark <ro...@ti...>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "gstomx_base_audiodec.h"
+#include "gstomx.h"
+
+GSTOMX_BOILERPLATE (GstOmxBaseAudioDec, gst_omx_base_audiodec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+
+static void
+type_base_init (gpointer g_class)
+{
+}
+
+static void
+type_class_init (gpointer g_class,
+ gpointer class_data)
+{
+}
+
+static void
+settings_changed_cb (GOmxCore *core)
+{
+ GstOmxBaseFilter *omx_base;
+ guint rate;
+ guint channels;
+
+ omx_base = core->object;
+
+ GST_DEBUG_OBJECT (omx_base, "settings changed");
+
+ {
+ OMX_AUDIO_PARAM_PCMMODETYPE param;
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = omx_base->out_port->port_index;
+ OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
+
+ rate = param.nSamplingRate;
+ channels = param.nChannels;
+ if (rate == 0)
+ {
+ /** @todo: this shouldn't happen. */
+ GST_WARNING_OBJECT (omx_base, "Bad samplerate");
+ rate = 44100;
+ }
+ }
+
+ {
+ GstCaps *new_caps;
+
+ new_caps = gst_caps_new_simple ("audio/x-raw-int",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "rate", G_TYPE_INT, rate,
+ "signed", G_TYPE_BOOLEAN, TRUE,
+ "endianness", G_TYPE_INT, G_BYTE_ORDER,
+ "channels", G_TYPE_INT, channels,
+ NULL);
+
+ GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
+ gst_pad_set_caps (omx_base->srcpad, new_caps);
+ }
+}
+
+static void
+type_instance_init (GTypeInstance *instance,
+ gpointer g_class)
+{
+ GstOmxBaseFilter *omx_base;
+
+ omx_base = GST_OMX_BASE_FILTER (instance);
+
+ GST_DEBUG_OBJECT (omx_base, "start");
+
+ omx_base->gomx->settings_changed_cb = settings_changed_cb;
+}
diff --git a/omx/gstomx_base_audiodec.h b/omx/gstomx_base_audiodec.h
new file mode 100644
index 0000000..a5f924e
--- /dev/null
+++ b/omx/gstomx_base_audiodec.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 Texas Instruments, Inc.
+ *
+ * Author: Rob Clark <ro...@ti...>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef GSTOMX_BASE_AUDIODEC_H
+#define GSTOMX_BASE_AUDIODEC_H
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_OMX_BASE_AUDIODEC(obj) (GstOmxBaseAudioDec *) (obj)
+#define GST_OMX_BASE_AUDIODEC_TYPE (gst_omx_base_audiodec_get_type ())
+
+typedef struct GstOmxBaseAudioDec GstOmxBaseAudioDec;
+typedef struct GstOmxBaseAudioDecClass GstOmxBaseAudioDecClass;
+
+#include "gstomx_base_filter.h"
+
+struct GstOmxBaseAudioDec
+{
+ GstOmxBaseFilter omx_base;
+};
+
+struct GstOmxBaseAudioDecClass
+{
+ GstOmxBaseFilterClass parent_class;
+};
+
+GType gst_omx_base_audiodec_get_type (void);
+
+G_END_DECLS
+
+#endif /* GSTOMX_BASE_AUDIODEC_H */
diff --git a/omx/gstomx_g711dec.c b/omx/gstomx_g711dec.c
index 623101e..2067953 100644
--- a/omx/gstomx_g711dec.c
+++ b/omx/gstomx_g711dec.c
@@ -25,6 +25,7 @@
#include <string.h> /* for strcmp */
+/* should this class extend GstOmxBaseAudioDec? */
GSTOMX_BOILERPLATE (GstOmxG711Dec, gst_omx_g711dec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
static GstCaps *
diff --git a/omx/gstomx_g729dec.c b/omx/gstomx_g729dec.c
index 666d5ab..a558011 100644
--- a/omx/gstomx_g729dec.c
+++ b/omx/gstomx_g729dec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_g729dec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxG729Dec, gst_omx_g729dec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxG729Dec, gst_omx_g729dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -105,6 +104,7 @@ type_class_init (gpointer g_class,
{
}
+/* should we be overriding the settings_changed_cb from parent class like this?? */
static void
settings_changed_cb (GOmxCore *core)
{
diff --git a/omx/gstomx_g729dec.h b/omx/gstomx_g729dec.h
index abe5504..49e525f 100644
--- a/omx/gstomx_g729dec.h
+++ b/omx/gstomx_g729dec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxG729Dec GstOmxG729Dec;
typedef struct GstOmxG729DecClass GstOmxG729DecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxG729Dec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxG729DecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_g729dec_get_type (void);
diff --git a/omx/gstomx_ilbcdec.c b/omx/gstomx_ilbcdec.c
index 9d03f01..ff899ac 100644
--- a/omx/gstomx_ilbcdec.c
+++ b/omx/gstomx_ilbcdec.c
@@ -23,6 +23,7 @@
#include "gstomx_base_filter.h"
#include "gstomx.h"
+/* should this class extend GstOmxBaseAudioDec? */
GSTOMX_BOILERPLATE (GstOmxIlbcDec, gst_omx_ilbcdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
static GstCaps *
diff --git a/omx/gstomx_mp2dec.c b/omx/gstomx_mp2dec.c
index 564e14c..319ef8e 100644
--- a/omx/gstomx_mp2dec.c
+++ b/omx/gstomx_mp2dec.c
@@ -23,7 +23,7 @@
#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxMp2Dec, gst_omx_mp2dec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxMp2Dec, gst_omx_mp2dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -104,60 +104,7 @@ type_class_init (gpointer g_class,
}
static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- if (rate == 0)
- {
- /** @todo: this shouldn't happen. */
- GST_WARNING_OBJECT (omx_base, "Bad samplerate");
- rate = 44100;
- }
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "channels", G_TYPE_INT, channels,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
-static void
type_instance_init (GTypeInstance *instance,
gpointer g_class)
{
- GstOmxBaseFilter *omx_base;
-
- omx_base = GST_OMX_BASE_FILTER (instance);
-
- GST_DEBUG_OBJECT (omx_base, "start");
-
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
}
diff --git a/omx/gstomx_mp2dec.h b/omx/gstomx_mp2dec.h
index 877d3c5..c6c517e 100644
--- a/omx/gstomx_mp2dec.h
+++ b/omx/gstomx_mp2dec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxMp2Dec GstOmxMp2Dec;
typedef struct GstOmxMp2DecClass GstOmxMp2DecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxMp2Dec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxMp2DecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_mp2dec_get_type (void);
diff --git a/omx/gstomx_mp3dec.c b/omx/gstomx_mp3dec.c
index a766689..8a1f465 100644
--- a/omx/gstomx_mp3dec.c
+++ b/omx/gstomx_mp3dec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_mp3dec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxMp3Dec, gst_omx_mp3dec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxMp3Dec, gst_omx_mp3dec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -104,60 +103,7 @@ type_class_init (gpointer g_class,
}
static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- if (rate == 0)
- {
- /** @todo: this shouldn't happen. */
- GST_WARNING_OBJECT (omx_base, "Bad samplerate");
- rate = 44100;
- }
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "channels", G_TYPE_INT, channels,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
-static void
type_instance_init (GTypeInstance *instance,
gpointer g_class)
{
- GstOmxBaseFilter *omx_base;
-
- omx_base = GST_OMX_BASE_FILTER (instance);
-
- GST_DEBUG_OBJECT (omx_base, "start");
-
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
}
diff --git a/omx/gstomx_mp3dec.h b/omx/gstomx_mp3dec.h
index f353ee5..c0a7d78 100644
--- a/omx/gstomx_mp3dec.h
+++ b/omx/gstomx_mp3dec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxMp3Dec GstOmxMp3Dec;
typedef struct GstOmxMp3DecClass GstOmxMp3DecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxMp3Dec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxMp3DecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_mp3dec_get_type (void);
diff --git a/omx/gstomx_vorbisdec.c b/omx/gstomx_vorbisdec.c
index fa532df..afd53fd 100644
--- a/omx/gstomx_vorbisdec.c
+++ b/omx/gstomx_vorbisdec.c
@@ -20,10 +20,9 @@
*/
#include "gstomx_vorbisdec.h"
-#include "gstomx_base_filter.h"
#include "gstomx.h"
-GSTOMX_BOILERPLATE (GstOmxVorbisDec, gst_omx_vorbisdec, GstOmxBaseFilter, GST_OMX_BASE_FILTER_TYPE);
+GSTOMX_BOILERPLATE (GstOmxVorbisDec, gst_omx_vorbisdec, GstOmxBaseAudioDec, GST_OMX_BASE_AUDIODEC_TYPE);
static GstCaps *
generate_src_template (void)
@@ -99,46 +98,6 @@ type_class_init (gpointer g_class,
}
static void
-settings_changed_cb (GOmxCore *core)
-{
- GstOmxBaseFilter *omx_base;
- guint rate;
- guint channels;
-
- omx_base = core->object;
-
- GST_DEBUG_OBJECT (omx_base, "settings changed");
-
- {
- OMX_AUDIO_PARAM_PCMMODETYPE param;
-
- G_OMX_INIT_PARAM (param);
-
- param.nPortIndex = omx_base->out_port->port_index;
- OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioPcm, ¶m);
-
- rate = param.nSamplingRate;
- channels = param.nChannels;
- }
-
- {
- GstCaps *new_caps;
-
- new_caps = gst_caps_new_simple ("audio/x-raw-int",
- "rate", G_TYPE_INT, rate,
- "signed", G_TYPE_BOOLEAN, TRUE,
- "channels", G_TYPE_INT, channels,
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "width", G_TYPE_INT, 16,
- "depth", G_TYPE_INT, 16,
- NULL);
-
- GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
- gst_pad_set_caps (omx_base->srcpad, new_caps);
- }
-}
-
-static void
type_instance_init (GTypeInstance *instance,
gpointer g_class)
{
@@ -149,6 +108,4 @@ type_instance_init (GTypeInstance *instance,
GST_DEBUG_OBJECT (omx_base, "start");
omx_base->use_timestamps = FALSE;
-
- omx_base->gomx->settings_changed_cb = settings_changed_cb;
}
diff --git a/omx/gstomx_vorbisdec.h b/omx/gstomx_vorbisdec.h
index 05ce070..c7737a3 100644
--- a/omx/gstomx_vorbisdec.h
+++ b/omx/gstomx_vorbisdec.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
typedef struct GstOmxVorbisDec GstOmxVorbisDec;
typedef struct GstOmxVorbisDecClass GstOmxVorbisDecClass;
-#include "gstomx_base_filter.h"
+#include "gstomx_base_audiodec.h"
struct GstOmxVorbisDec
{
- GstOmxBaseFilter omx_base;
+ GstOmxBaseAudioDec omx_base;
};
struct GstOmxVorbisDecClass
{
- GstOmxBaseFilterClass parent_class;
+ GstOmxBaseAudioDecClass parent_class;
};
GType gst_omx_vorbisdec_get_type (void);
--
1.7.0
|
|
From: Felipe C. <fel...@gm...> - 2010-04-16 15:21:55
|
On Thu, Mar 18, 2010 at 2:58 AM, Rob Clark <ro...@ti...> wrote:
> Rebased on top of 'port cleanups' patchset.
>
> Now, OMX component is instantiated when GOmxCore is constructed. So the
> patchset no longer includes the g_omx_core_{get,set}_{config,param} helper
> functions as these were not needed as much anymore. (Although it might be
> nice to add them later, so at least there is a common place to put an error
> traces if any of the OMX_{Get,Set}{Config,Param}() calls returns an error.)
>
> Rob Clark (8):
> core: call OMX_GetHandle in g_omx_core_new
> Add some debug traces
> Add G_OMX_INIT_PARAM utility macro
> Handle properties common to all gstomx base classes with helper
> functions
> Add component-role support
> Add input-buffers/output-buffers properties to the base classes
> Add some debug traces
> Add GstOmxBaseAudioDec base class
I've pushed all of these (as well as previous patch-sets) except the
base audio dec one.
I think you should ask for permission to commit directly to the repo.
I think important changes still should go through the mailing list
though.
Thanks!
--
Felipe Contreras
|
|
From: Felipe C. <fel...@gm...> - 2010-04-16 15:10:33
|
On Thu, Mar 18, 2010 at 2:59 AM, Rob Clark <ro...@ti...> wrote: > Refactor some common functionality, in particular the settings_changed_cb, > into an abstract base class. > --- > omx/Makefile.am | 1 + > omx/gstomx_aacdec.c | 45 +-------------------- > omx/gstomx_aacdec.h | 6 +- > omx/gstomx_adpcmdec.c | 1 + > omx/gstomx_amrnbdec.c | 48 +--------------------- > omx/gstomx_amrnbdec.h | 6 +- > omx/gstomx_amrwbdec.c | 48 +--------------------- > omx/gstomx_amrwbdec.h | 6 +- > omx/gstomx_base_audiodec.c | 97 ++++++++++++++++++++++++++++++++++++++++++++ > omx/gstomx_base_audiodec.h | 53 ++++++++++++++++++++++++ > omx/gstomx_g711dec.c | 1 + > omx/gstomx_g729dec.c | 4 +- > omx/gstomx_g729dec.h | 6 +- > omx/gstomx_ilbcdec.c | 1 + > omx/gstomx_mp2dec.c | 55 +------------------------ > omx/gstomx_mp2dec.h | 6 +- > omx/gstomx_mp3dec.c | 56 +------------------------- > omx/gstomx_mp3dec.h | 6 +- > omx/gstomx_vorbisdec.c | 45 +-------------------- > omx/gstomx_vorbisdec.h | 6 +- > 20 files changed, 183 insertions(+), 314 deletions(-) > create mode 100644 omx/gstomx_base_audiodec.c > create mode 100644 omx/gstomx_base_audiodec.h > diff --git a/omx/gstomx_base_audiodec.c b/omx/gstomx_base_audiodec.c > new file mode 100644 > index 0000000..8dc37d7 > --- /dev/null > +++ b/omx/gstomx_base_audiodec.c > @@ -0,0 +1,97 @@ > +/* > + * Copyright (C) 2009 Texas Instruments, Inc - http://www.ti.com/ Why the web url? I don't think that's customary. > + * Description: Base audio decoder element > + * Created on: Aug 2, 2009 > + * Author: Rob Clark <ro...@ti...> I don't see the point of this. Author, yes, but date and description? Perhaps the description would make sense if it's picked by the automatic doc generator. > + * This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Library General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Library General Public License for more details. > + * > + * You should have received a copy of the GNU Library General Public > + * License along with this library; if not, write to the > + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, > + * Boston, MA 02111-1307, USA. > + */ This copyright notice is not only outdated but doesn't match the rest of the notices (not to mention that it's LGPL 2.1+ and not LGPL 2.1). -- Felipe Contreras |
|
From: Felipe C. <fel...@gm...> - 2010-04-16 14:58:32
|
On Mon, Mar 29, 2010 at 4:09 PM, Rob Clark <ro...@ti...> wrote: > --- > v2: update with changes suggested by Felipe to reduce nesting > > omx/gstomx_base_filter.c | 68 +++++++++++++++++++++++++++++++++++++++ > omx/gstomx_base_sink.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++ > omx/gstomx_base_src.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 228 insertions(+), 0 deletions(-) ACK. -- Felipe Contreras |
|
From: Felipe C. <fel...@gm...> - 2010-04-16 14:55:40
|
On Mon, Mar 29, 2010 at 7:00 PM, Rob Clark <ro...@ti...> wrote: > --- > v2: use strncpy since now component-role is coming from a config file > rather than a built in table > v3: remove .orig files that were not supposed to be committed > > omx/gstomx.c | 14 +++++++++++++- > omx/gstomx.h | 1 + > omx/gstomx_util.c | 23 +++++++++++++++++++++-- > omx/gstomx_util.h | 1 + > 4 files changed, 36 insertions(+), 3 deletions(-) Applied with minor changes, please check the diff. -- Felipe Contreras |
|
From: Felipe C. <fel...@gm...> - 2010-04-16 14:49:30
|
On Mon, Mar 29, 2010 at 4:07 PM, Rob Clark <ro...@ti...> wrote: > This removes some common code from all base classes, and makes it easier to > add new common properties. > > For now (and the foreseeable future) all common properties are read-only, > but a gstomx_set_property_helper() could be added later if needed. Please try to keep the commit summary short: < 50 characters. -- Felipe Contreras |
|
From: Felipe C. <fel...@no...> - 2010-04-16 14:44:11
|
On Thu, Mar 18, 2010 at 12:58:55AM +0100, Rob Clark wrote: > --- > omx/gstomx_util.c | 29 +++++++++++++++++++++++++++++ > 1 files changed, 29 insertions(+), 0 deletions(-) There was a small conflict due to changes on the previous patch. Also, I changed a bit some whitespaces. Thanks. -- Felipe Contreras |
|
From: Felipe C. <fel...@no...> - 2010-04-16 14:38:45
|
On Mon, Mar 29, 2010 at 03:05:39PM +0200, Rob Clark wrote:
> This way omx_handle is always valid, and can be used in get/set_property
> methods.
> ---
I applied this with some changes; I think when future reorganizations
are made what code can be made static would be obvious.
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -333,10 +333,6 @@ gstomx_get_component_info (void *core,
return TRUE;
}
-/* for now, to keep gst out of g_omx.. if later g_omx becomes gstomx
- * then this could be combined with the existing g_omx_core_new()
- * and g_omx_core_init() could be made static/private
- */
void *
gstomx_core_new (void *object, GType type)
{
diff --git a/omx/gstomx.h b/omx/gstomx.h
index 4f07fd6..e646300 100644
--- a/omx/gstomx.h
+++ b/omx/gstomx.h
@@ -33,7 +33,7 @@ GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug);
gboolean gstomx_get_component_info (void *core,
GType type);
-void * gstomx_core_new (void *object, GType type);
+void *gstomx_core_new (void *object, GType type);
G_END_DECLS
--
Felipe Contreras
|
|
From: Rob C. <ro...@ti...> - 2010-04-09 11:11:34
|
On 04/09/2010 06:05 AM, Nitin PAI wrote: > Hi Rob, > > Thanks for your input. I enabled the share_input_buffer and > share_output_buffer and could see the CPU usage coming down. > I was still wondering if Gstreamer is zerocopy considering elements > like videobalance/ffmpegcolorspace/videoscale and the queues elements ? well, I guess I should say GStreamer *can* be a zero copy framework.. the framework itself introduces no copies. But if your display requires RGB and the output of your decoder is YUV, then there is no choice but to copy (and do a few calculations along the way). And likewise for scaling. But if the sinkpad and srcpad caps are compatible in the transform elements, they will act as just a pass through, so the overhead is basically just a couple extra function calls. (Note that you might also want to look at the flags property on playbin2... native-video bit will bypass the video transform elements after the decoder before the sink. If your display hardware supports scaling and colorspace conversion, you can optimize your pipeline slightly with native-video) BR, -R > > > Thanks, > Nitin > > > > > > On Fri, Apr 9, 2010 at 3:37 PM, Rob Clark <ro...@ti... > <mailto:ro...@ti...>> wrote: > > On 04/09/2010 03:50 AM, Nitin PAI wrote: > > Hi Rob, > > I see that there are variables like > share_input_buffer,share_output_buffer which avoid copying > within the gst-openmax wrapper. > > My question was for the entire gstreamer stack. Considering an > application that uses Phonon over Gstreamer (over may be > openmax). Are there any optimizations possbile there? > Running QT over Phonon, Gstreamer on Embedded devices can kill > the cpu for D1 resolutions. > > > I'm not too familiar w/ phonon but GStreamer itself is generally > zero copy.. I'm not sure how phonon would introduce a memcpy > (assuming it is still using normal gst video sink elements) > > Take your typical video playback scenario.. gst-openmax will use > pad_alloc to allocate a buffer from the display. If > share_output_buffer is enabled, this buffer will be passed in to > decoder element to decode frame. Zero copies. (Well, assuming > you aren't going through xv which introduces a copy no matter what > framework you are.. but, for example, omapfbsink or v4l2sink will > be zero copy all the way to the display.) I can play 1080p quite > nicely through gst-openmax+v4l2sink with low CPU and no memcpy on > my little dev board here. > > > BR, > -R > > > > > Thanks, > Nitin > > > On Fri, Apr 9, 2010 at 1:29 PM, Rob Clark <ro...@ti... > <mailto:ro...@ti...> <mailto:ro...@ti... <mailto:ro...@ti...>>> > wrote: > > On 04/09/2010 01:52 AM, Nitin PAI wrote: > > > Hi, > > Currently, a typical gstreamer pipeline looks like > > >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! > ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. > > The movement of data accross is enormous for a D1 or HD > resolution as the pipeline passes YUV/RGB data which is > very huge. > > Is there any optimization possible or used which uses > *pointers* to pass rather than the huge mem-copies > involved? > > > > Hi Nitin, > > search for share_buffer > > For this to work, it depends on your OpenMAX implementation to > support 'non-pre-announced' buffers (which was a recent > proposal > from Nokia to Khronos standards group) > > BR, > -R > > > > > -- > “Karmanya vadhikaraste ma phaleshu kadachana Ma > karma-phala-hetur bhu ma te sango stav karmani” - > Krishna > > > > > > -- > “Karmanya vadhikaraste ma phaleshu kadachana Ma karma-phala-hetur bhu > ma te sango stav karmani” - Krishna |
|
From: Nitin P. <nit...@gm...> - 2010-04-09 11:05:27
|
Hi Rob, Thanks for your input. I enabled the share_input_buffer and share_output_buffer and could see the CPU usage coming down. I was still wondering if Gstreamer is zerocopy considering elements like videobalance/ffmpegcolorspace/videoscale and the queues elements ? Thanks, Nitin On Fri, Apr 9, 2010 at 3:37 PM, Rob Clark <ro...@ti...> wrote: > On 04/09/2010 03:50 AM, Nitin PAI wrote: > >> Hi Rob, >> >> I see that there are variables like share_input_buffer,share_output_buffer >> which avoid copying within the gst-openmax wrapper. >> >> My question was for the entire gstreamer stack. Considering an application >> that uses Phonon over Gstreamer (over may be openmax). Are there any >> optimizations possbile there? >> Running QT over Phonon, Gstreamer on Embedded devices can kill the cpu for >> D1 resolutions. >> > > I'm not too familiar w/ phonon but GStreamer itself is generally zero > copy.. I'm not sure how phonon would introduce a memcpy (assuming it is > still using normal gst video sink elements) > > Take your typical video playback scenario.. gst-openmax will use pad_alloc > to allocate a buffer from the display. If share_output_buffer is enabled, > this buffer will be passed in to decoder element to decode frame. Zero > copies. (Well, assuming you aren't going through xv which introduces a copy > no matter what framework you are.. but, for example, omapfbsink or v4l2sink > will be zero copy all the way to the display.) I can play 1080p quite > nicely through gst-openmax+v4l2sink with low CPU and no memcpy on my little > dev board here. > > > BR, > -R > > > >> >> Thanks, >> Nitin >> >> >> On Fri, Apr 9, 2010 at 1:29 PM, Rob Clark <ro...@ti... <mailto:ro...@ti...>> >> wrote: >> >> On 04/09/2010 01:52 AM, Nitin PAI wrote: >> >> >> Hi, >> >> Currently, a typical gstreamer pipeline looks like >> >> >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! >> ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. >> >> The movement of data accross is enormous for a D1 or HD >> resolution as the pipeline passes YUV/RGB data which is very huge. >> >> Is there any optimization possible or used which uses >> *pointers* to pass rather than the huge mem-copies involved? >> >> >> >> Hi Nitin, >> >> search for share_buffer >> >> For this to work, it depends on your OpenMAX implementation to >> support 'non-pre-announced' buffers (which was a recent proposal >> from Nokia to Khronos standards group) >> >> BR, >> -R >> >> >> >> >> -- >> “Karmanya vadhikaraste ma phaleshu kadachana Ma karma-phala-hetur bhu ma >> te sango stav karmani” - Krishna >> > > -- “Karmanya vadhikaraste ma phaleshu kadachana Ma karma-phala-hetur bhu ma te sango stav karmani” - Krishna |
|
From: Rob C. <ro...@ti...> - 2010-04-09 10:07:34
|
On 04/09/2010 03:50 AM, Nitin PAI wrote: > Hi Rob, > > I see that there are variables like > share_input_buffer,share_output_buffer which avoid copying within the > gst-openmax wrapper. > > My question was for the entire gstreamer stack. Considering an > application that uses Phonon over Gstreamer (over may be openmax). Are > there any optimizations possbile there? > Running QT over Phonon, Gstreamer on Embedded devices can kill the cpu > for D1 resolutions. I'm not too familiar w/ phonon but GStreamer itself is generally zero copy.. I'm not sure how phonon would introduce a memcpy (assuming it is still using normal gst video sink elements) Take your typical video playback scenario.. gst-openmax will use pad_alloc to allocate a buffer from the display. If share_output_buffer is enabled, this buffer will be passed in to decoder element to decode frame. Zero copies. (Well, assuming you aren't going through xv which introduces a copy no matter what framework you are.. but, for example, omapfbsink or v4l2sink will be zero copy all the way to the display.) I can play 1080p quite nicely through gst-openmax+v4l2sink with low CPU and no memcpy on my little dev board here. BR, -R > > > Thanks, > Nitin > > On Fri, Apr 9, 2010 at 1:29 PM, Rob Clark <ro...@ti... > <mailto:ro...@ti...>> wrote: > > On 04/09/2010 01:52 AM, Nitin PAI wrote: > > > Hi, > > Currently, a typical gstreamer pipeline looks like > > >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! > ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. > > The movement of data accross is enormous for a D1 or HD > resolution as the pipeline passes YUV/RGB data which is very huge. > > Is there any optimization possible or used which uses > *pointers* to pass rather than the huge mem-copies involved? > > > > Hi Nitin, > > search for share_buffer > > For this to work, it depends on your OpenMAX implementation to > support 'non-pre-announced' buffers (which was a recent proposal > from Nokia to Khronos standards group) > > BR, > -R > > > > > -- > “Karmanya vadhikaraste ma phaleshu kadachana Ma karma-phala-hetur bhu > ma te sango stav karmani” - Krishna |
|
From: Nitin P. <nit...@gm...> - 2010-04-09 08:50:35
|
Hi Rob, I see that there are variables like share_input_buffer,share_output_buffer which avoid copying within the gst-openmax wrapper. My question was for the entire gstreamer stack. Considering an application that uses Phonon over Gstreamer (over may be openmax). Are there any optimizations possbile there? Running QT over Phonon, Gstreamer on Embedded devices can kill the cpu for D1 resolutions. Thanks, Nitin On Fri, Apr 9, 2010 at 1:29 PM, Rob Clark <ro...@ti...> wrote: > On 04/09/2010 01:52 AM, Nitin PAI wrote: > >> >> Hi, >> >> Currently, a typical gstreamer pipeline looks like >> >> >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! >> ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. >> >> The movement of data accross is enormous for a D1 or HD resolution as the >> pipeline passes YUV/RGB data which is very huge. >> >> Is there any optimization possible or used which uses *pointers* to pass >> rather than the huge mem-copies involved? >> > > > Hi Nitin, > > search for share_buffer > > For this to work, it depends on your OpenMAX implementation to support > 'non-pre-announced' buffers (which was a recent proposal from Nokia to > Khronos standards group) > > BR, > -R > > -- “Karmanya vadhikaraste ma phaleshu kadachana Ma karma-phala-hetur bhu ma te sango stav karmani” - Krishna |
|
From: Rob C. <ro...@ti...> - 2010-04-09 07:59:41
|
On 04/09/2010 01:52 AM, Nitin PAI wrote: > > Hi, > > Currently, a typical gstreamer pipeline looks like > > >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! > ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. > > The movement of data accross is enormous for a D1 or HD resolution as > the pipeline passes YUV/RGB data which is very huge. > > Is there any optimization possible or used which uses *pointers* to > pass rather than the huge mem-copies involved? Hi Nitin, search for share_buffer For this to work, it depends on your OpenMAX implementation to support 'non-pre-announced' buffers (which was a recent proposal from Nokia to Khronos standards group) BR, -R |
|
From: Nitin P. <nit...@gm...> - 2010-04-09 06:52:58
|
Hi, Currently, a typical gstreamer pipeline looks like >gst-launch filesrc location=XYZ ! demuxer ! decodebin ! ffmpegcolorspace ! videobalance ! videoscale ! ximagesink. The movement of data accross is enormous for a D1 or HD resolution as the pipeline passes YUV/RGB data which is very huge. Is there any optimization possible or used which uses *pointers* to pass rather than the huge mem-copies involved? Thanks, Nitin |
|
From: Rob C. <ro...@ti...> - 2010-03-29 16:00:26
|
---
v2: use strncpy since now component-role is coming from a config file
rather than a built in table
v3: remove .orig files that were not supposed to be committed
omx/gstomx.c | 14 +++++++++++++-
omx/gstomx.h | 1 +
omx/gstomx_util.c | 23 +++++++++++++++++++++--
omx/gstomx_util.h | 1 +
4 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 6871e98..8f4cdf0 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -247,7 +247,7 @@ plugin_init (GstPlugin *plugin)
const gchar *element_name = gst_structure_nth_field_name (element_table, i);
GstStructure *element = get_element_entry (element_name);
const gchar *type_name, *parent_type_name;
- const gchar *component_name, *library_name;
+ const gchar *component_name, *component_role, *library_name;
GType type;
gint rank;
@@ -256,6 +256,7 @@ plugin_init (GstPlugin *plugin)
parent_type_name = gst_structure_get_string (element, "parent-type");
type_name = gst_structure_get_string (element, "type");
component_name = gst_structure_get_string (element, "component-name");
+ component_role = gst_structure_get_string (element, "component-role");
library_name = gst_structure_get_string (element, "library-name");
if (!type_name || !component_name || !library_name)
@@ -330,6 +331,9 @@ gstomx_get_component_info (void *core,
str = gst_structure_get_string (element, "component-name");
rcore->component_name = g_strdup (str);
+ str = gst_structure_get_string (element, "component-role");
+ rcore->component_role = g_strdup (str);
+
return TRUE;
}
@@ -355,6 +359,11 @@ gstomx_install_property_helper (GObjectClass *gobject_class)
"Name of the OpenMAX IL component to use",
NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, ARG_COMPONENT_ROLE,
+ g_param_spec_string ("component-role", "Component role",
+ "Role of the OpenMAX IL component",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
g_param_spec_string ("library-name", "Library name",
"Name of the OpenMAX IL implementation library to use",
@@ -370,6 +379,9 @@ gstomx_get_property_helper (void *core, guint prop_id, GValue *value)
case ARG_COMPONENT_NAME:
g_value_set_string (value, gomx->component_name);
return TRUE;
+ case ARG_COMPONENT_ROLE:
+ g_value_set_string (value, gomx->component_role);
+ return TRUE;
case ARG_LIBRARY_NAME:
g_value_set_string (value, gomx->library_name);
return TRUE;
diff --git a/omx/gstomx.h b/omx/gstomx.h
index 00888d6..eb163ab 100644
--- a/omx/gstomx.h
+++ b/omx/gstomx.h
@@ -34,6 +34,7 @@ enum
{
GSTOMX_ARG_0,
ARG_COMPONENT_NAME,
+ ARG_COMPONENT_ROLE,
ARG_LIBRARY_NAME,
GSTOMX_NUM_COMMON_PROP
};
diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index 4d91b6b..aae2c02 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -311,8 +311,10 @@ g_omx_core_free (GOmxCore *core)
void
g_omx_core_init (GOmxCore *core)
{
- GST_DEBUG_OBJECT (core->object, "loading: %s (%s)",
- core->component_name, core->library_name);
+ GST_DEBUG_OBJECT (core->object, "loading: %s %s (%s)",
+ core->component_name,
+ core->component_role ? core->component_role : "",
+ core->library_name);
core->imp = request_imp (core->library_name);
@@ -328,7 +330,23 @@ g_omx_core_init (GOmxCore *core)
core->omx_handle, core->omx_error);
if (!core->omx_error)
+ {
core->omx_state = OMX_StateLoaded;
+
+ if (core->component_role)
+ {
+ OMX_PARAM_COMPONENTROLETYPE param;
+
+ GST_DEBUG_OBJECT (core->object, "setting component role: %s",
+ core->component_role);
+
+ G_OMX_INIT_PARAM (param);
+
+ strncpy((char*)param.cRole, core->component_role, OMX_MAX_STRINGNAME_SIZE);
+
+ OMX_SetParameter (core->omx_handle, OMX_IndexParamStandardComponentRole, ¶m);
+ }
+ }
}
static void
@@ -355,6 +373,7 @@ core_deinit (GOmxCore *core)
g_free (core->library_name);
g_free (core->component_name);
+ g_free (core->component_role);
release_imp (core->imp);
core->imp = NULL;
diff --git a/omx/gstomx_util.h b/omx/gstomx_util.h
index fefdbfd..68832d3 100644
--- a/omx/gstomx_util.h
+++ b/omx/gstomx_util.h
@@ -94,6 +94,7 @@ struct GOmxCore
gchar *library_name;
gchar *component_name;
+ gchar *component_role;
};
struct GOmxPort
--
1.6.6
|
|
From: Felipe C. <fel...@gm...> - 2010-03-29 14:57:10
|
On Mon, Mar 29, 2010 at 4:08 PM, Rob Clark <ro...@ti...> wrote:
> ---
> v2: use strncpy since now component-role is coming from a config file
> rather than a built in table
> +<<<<<<< HEAD
> +/* for now, to keep gst out of g_omx.. if later g_omx becomes gstomx
> + * then this could be combined with the existing g_omx_core_new()
> + * and g_omx_core_init() could be made static/private
> + */
> +void *
> +gstomx_core_new (void *object, GType type)
> +{
> + GOmxCore *core = g_omx_core_new (object);
> + gstomx_get_component_info (core, type);
> + g_omx_core_init (core);
> + return core;
> +=======
Looks like there are some unresolved conflicts.
--
Felipe Contreras
|
|
From: Rob C. <ro...@ti...> - 2010-03-29 13:09:37
|
---
v2: update with changes suggested by Felipe to reduce nesting
omx/gstomx_base_filter.c | 68 +++++++++++++++++++++++++++++++++++++++
omx/gstomx_base_sink.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++
omx/gstomx_base_src.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 228 insertions(+), 0 deletions(-)
diff --git a/omx/gstomx_base_filter.c b/omx/gstomx_base_filter.c
index 2dbf850..4821f3b 100644
--- a/omx/gstomx_base_filter.c
+++ b/omx/gstomx_base_filter.c
@@ -28,6 +28,8 @@
enum
{
ARG_USE_TIMESTAMPS = GSTOMX_NUM_COMMON_PROP,
+ ARG_NUM_INPUT_BUFFERS,
+ ARG_NUM_OUTPUT_BUFFERS,
};
static void init_interfaces (GType type);
@@ -182,6 +184,40 @@ set_property (GObject *obj,
case ARG_USE_TIMESTAMPS:
self->use_timestamps = g_value_get_boolean (value);
break;
+ case ARG_NUM_INPUT_BUFFERS:
+ case ARG_NUM_OUTPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+ OMX_U32 nBufferCountActual;
+ GOmxPort *port = (prop_id == ARG_NUM_INPUT_BUFFERS) ?
+ self->in_port : self->out_port;
+
+ if (G_UNLIKELY (!omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ break;
+ }
+
+ nBufferCountActual = g_value_get_uint (value);
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ if (nBufferCountActual < param.nBufferCountMin)
+ {
+ GST_ERROR_OBJECT (self, "buffer count %lu is less than minimum %lu",
+ nBufferCountActual, param.nBufferCountMin);
+ return;
+ }
+
+ param.nBufferCountActual = nBufferCountActual;
+
+ OMX_SetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -206,6 +242,29 @@ get_property (GObject *obj,
case ARG_USE_TIMESTAMPS:
g_value_set_boolean (value, self->use_timestamps);
break;
+ case ARG_NUM_INPUT_BUFFERS:
+ case ARG_NUM_OUTPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+ GOmxPort *port = (prop_id == ARG_NUM_INPUT_BUFFERS) ?
+ self->in_port : self->out_port;
+
+ if (G_UNLIKELY (!omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ g_value_set_uint (value, 0);
+ break;
+ }
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ g_value_set_uint (value, param.nBufferCountActual);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -241,6 +300,15 @@ type_class_init (gpointer g_class,
g_param_spec_boolean ("use-timestamps", "Use timestamps",
"Whether or not to use timestamps",
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, ARG_NUM_INPUT_BUFFERS,
+ g_param_spec_uint ("input-buffers", "Input buffers",
+ "The number of OMX input buffers",
+ 1, 10, 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, ARG_NUM_OUTPUT_BUFFERS,
+ g_param_spec_uint ("output-buffers", "Output buffers",
+ "The number of OMX output buffers",
+ 1, 10, 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
}
diff --git a/omx/gstomx_base_sink.c b/omx/gstomx_base_sink.c
index 3cc5f99..66e32d6 100644
--- a/omx/gstomx_base_sink.c
+++ b/omx/gstomx_base_sink.c
@@ -28,6 +28,11 @@
#include <string.h> /* for memcpy */
+enum
+{
+ ARG_NUM_INPUT_BUFFERS = GSTOMX_NUM_COMMON_PROP,
+};
+
static gboolean share_input_buffer;
static inline gboolean omx_init (GstOmxBaseSink *self);
@@ -265,6 +270,55 @@ handle_event (GstBaseSink *gst_base,
}
static void
+set_property (GObject *obj,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GstOmxBaseSink *self;
+
+ self = GST_OMX_BASE_SINK (obj);
+
+ switch (prop_id)
+ {
+ case ARG_NUM_INPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+ OMX_U32 nBufferCountActual;
+
+ if (G_UNLIKELY (!omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ break;
+ }
+
+ nBufferCountActual = g_value_get_uint (value);
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = self->in_port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ if (nBufferCountActual < param.nBufferCountMin)
+ {
+ GST_ERROR_OBJECT (self, "buffer count %lu is less than minimum %lu",
+ nBufferCountActual, param.nBufferCountMin);
+ return;
+ }
+
+ param.nBufferCountActual = nBufferCountActual;
+
+ OMX_SetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
get_property (GObject *obj,
guint prop_id,
GValue *value,
@@ -279,6 +333,26 @@ get_property (GObject *obj,
switch (prop_id)
{
+ case ARG_NUM_INPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+
+ if (G_UNLIKELY (!omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ g_value_set_uint (value, 0);
+ break;
+ }
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = self->in_port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ g_value_set_uint (value, param.nBufferCountActual);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -312,9 +386,15 @@ type_class_init (gpointer g_class,
/* Properties stuff */
{
+ gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
gstomx_install_property_helper (gobject_class);
+
+ g_object_class_install_property (gobject_class, ARG_NUM_INPUT_BUFFERS,
+ g_param_spec_uint ("input-buffers", "Input buffers",
+ "The number of OMX input buffers",
+ 1, 10, 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
}
diff --git a/omx/gstomx_base_src.c b/omx/gstomx_base_src.c
index af0bd01..37b29f9 100644
--- a/omx/gstomx_base_src.c
+++ b/omx/gstomx_base_src.c
@@ -24,6 +24,11 @@
#include <string.h> /* for memcpy */
+enum
+{
+ ARG_NUM_OUTPUT_BUFFERS = GSTOMX_NUM_COMMON_PROP,
+};
+
GSTOMX_BOILERPLATE (GstOmxBaseSrc, gst_omx_base_src, GstBaseSrc, GST_TYPE_BASE_SRC);
static void
@@ -326,6 +331,55 @@ handle_event (GstBaseSrc *gst_base,
}
static void
+set_property (GObject *obj,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GstOmxBaseSrc *self;
+
+ self = GST_OMX_BASE_SRC (obj);
+
+ switch (prop_id)
+ {
+ case ARG_NUM_OUTPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+ OMX_U32 nBufferCountActual;
+
+ if (G_UNLIKELY (omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ break;
+ }
+
+ nBufferCountActual = g_value_get_uint (value);
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = self->out_port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ if (nBufferCountActual < param.nBufferCountMin)
+ {
+ GST_ERROR_OBJECT (self, "buffer count %lu is less than minimum %lu",
+ nBufferCountActual, param.nBufferCountMin);
+ return;
+ }
+
+ param.nBufferCountActual = nBufferCountActual;
+
+ OMX_SetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
+ }
+}
+
+static void
get_property (GObject *obj,
guint prop_id,
GValue *value,
@@ -340,6 +394,26 @@ get_property (GObject *obj,
switch (prop_id)
{
+ case ARG_NUM_OUTPUT_BUFFERS:
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE param;
+ OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;
+
+ if (G_UNLIKELY (!omx_handle))
+ {
+ GST_WARNING_OBJECT (self, "no component");
+ g_value_set_uint (value, 0);
+ break;
+ }
+
+ G_OMX_INIT_PARAM (param);
+
+ param.nPortIndex = self->out_port->port_index;
+ OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, ¶m);
+
+ g_value_set_uint (value, param.nBufferCountActual);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -370,9 +444,15 @@ type_class_init (gpointer g_class,
/* Properties stuff */
{
+ gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
gstomx_install_property_helper (gobject_class);
+
+ g_object_class_install_property (gobject_class, ARG_NUM_OUTPUT_BUFFERS,
+ g_param_spec_uint ("output-buffers", "Output buffers",
+ "The number of OMX output buffers",
+ 1, 10, 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
}
--
1.6.6
|
|
From: Rob C. <ro...@ti...> - 2010-03-29 13:08:28
|
---
v2: use strncpy since now component-role is coming from a config file
rather than a built in table
omx/gstomx.c | 14 ++-
omx/gstomx.c.orig | 390 +++++++++++++++++++++++++++++++++++++++++++++++++++++
omx/gstomx.h | 1 +
omx/gstomx.h.orig | 53 +++++++
omx/gstomx_util.c | 23 +++-
omx/gstomx_util.h | 1 +
6 files changed, 479 insertions(+), 3 deletions(-)
create mode 100644 omx/gstomx.c.orig
create mode 100644 omx/gstomx.h.orig
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 6871e98..8f4cdf0 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -247,7 +247,7 @@ plugin_init (GstPlugin *plugin)
const gchar *element_name = gst_structure_nth_field_name (element_table, i);
GstStructure *element = get_element_entry (element_name);
const gchar *type_name, *parent_type_name;
- const gchar *component_name, *library_name;
+ const gchar *component_name, *component_role, *library_name;
GType type;
gint rank;
@@ -256,6 +256,7 @@ plugin_init (GstPlugin *plugin)
parent_type_name = gst_structure_get_string (element, "parent-type");
type_name = gst_structure_get_string (element, "type");
component_name = gst_structure_get_string (element, "component-name");
+ component_role = gst_structure_get_string (element, "component-role");
library_name = gst_structure_get_string (element, "library-name");
if (!type_name || !component_name || !library_name)
@@ -330,6 +331,9 @@ gstomx_get_component_info (void *core,
str = gst_structure_get_string (element, "component-name");
rcore->component_name = g_strdup (str);
+ str = gst_structure_get_string (element, "component-role");
+ rcore->component_role = g_strdup (str);
+
return TRUE;
}
@@ -355,6 +359,11 @@ gstomx_install_property_helper (GObjectClass *gobject_class)
"Name of the OpenMAX IL component to use",
NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, ARG_COMPONENT_ROLE,
+ g_param_spec_string ("component-role", "Component role",
+ "Role of the OpenMAX IL component",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
g_param_spec_string ("library-name", "Library name",
"Name of the OpenMAX IL implementation library to use",
@@ -370,6 +379,9 @@ gstomx_get_property_helper (void *core, guint prop_id, GValue *value)
case ARG_COMPONENT_NAME:
g_value_set_string (value, gomx->component_name);
return TRUE;
+ case ARG_COMPONENT_ROLE:
+ g_value_set_string (value, gomx->component_role);
+ return TRUE;
case ARG_LIBRARY_NAME:
g_value_set_string (value, gomx->library_name);
return TRUE;
diff --git a/omx/gstomx.c.orig b/omx/gstomx.c.orig
new file mode 100644
index 0000000..cf08245
--- /dev/null
+++ b/omx/gstomx.c.orig
@@ -0,0 +1,390 @@
+/*
+ * Copyright (C) 2007-2009 Nokia Corporation.
+ *
+ * Author: Felipe Contreras <fel...@no...>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <gst/gststructure.h>
+
+#include "gstomx.h"
+#include "gstomx_dummy.h"
+#include "gstomx_mpeg4dec.h"
+#include "gstomx_h263dec.h"
+#include "gstomx_h264dec.h"
+#include "gstomx_wmvdec.h"
+#include "gstomx_mpeg4enc.h"
+#include "gstomx_h264enc.h"
+#include "gstomx_h263enc.h"
+#include "gstomx_vorbisdec.h"
+#include "gstomx_mp3dec.h"
+#ifdef EXPERIMENTAL
+#include "gstomx_mp2dec.h"
+#include "gstomx_aacdec.h"
+#include "gstomx_aacenc.h"
+#include "gstomx_amrnbdec.h"
+#include "gstomx_amrnbenc.h"
+#include "gstomx_amrwbdec.h"
+#include "gstomx_amrwbenc.h"
+#include "gstomx_adpcmdec.h"
+#include "gstomx_adpcmenc.h"
+#include "gstomx_g711dec.h"
+#include "gstomx_g711enc.h"
+#include "gstomx_g729dec.h"
+#include "gstomx_g729enc.h"
+#include "gstomx_ilbcdec.h"
+#include "gstomx_ilbcenc.h"
+#include "gstomx_jpegenc.h"
+#endif /* EXPERIMENTAL */
+#include "gstomx_audiosink.h"
+#ifdef EXPERIMENTAL
+#include "gstomx_videosink.h"
+#include "gstomx_filereadersrc.h"
+#endif /* EXPERIMENTAL */
+#include "gstomx_volume.h"
+
+GST_DEBUG_CATEGORY (gstomx_debug);
+
+const static GstStructure *element_table;
+static GQuark element_name_quark;
+
+extern const gchar *default_config;
+
+static GType (*get_type[]) (void) = {
+ gst_omx_dummy_get_type,
+ gst_omx_mpeg4dec_get_type,
+ gst_omx_h264dec_get_type,
+ gst_omx_h263dec_get_type,
+ gst_omx_wmvdec_get_type,
+ gst_omx_mpeg4enc_get_type,
+ gst_omx_h264enc_get_type,
+ gst_omx_h263enc_get_type,
+ gst_omx_vorbisdec_get_type,
+ gst_omx_mp3dec_get_type,
+#ifdef EXPERIMENTAL
+ gst_omx_mp2dec_get_type,
+ gst_omx_amrnbdec_get_type,
+ gst_omx_amrnbenc_get_type,
+ gst_omx_amrwbdec_get_type,
+ gst_omx_amrwbenc_get_type,
+ gst_omx_aacdec_get_type,
+ gst_omx_aacenc_get_type,
+ gst_omx_adpcmdec_get_type,
+ gst_omx_adpcmenc_get_type,
+ gst_omx_g711dec_get_type,
+ gst_omx_g711enc_get_type,
+ gst_omx_g729dec_get_type,
+ gst_omx_g729enc_get_type,
+ gst_omx_ilbcdec_get_type,
+ gst_omx_ilbcenc_get_type,
+ gst_omx_jpegenc_get_type,
+#endif /* EXPERIMENTAL */
+ gst_omx_audiosink_get_type,
+#ifdef EXPERIMENTAL
+ gst_omx_videosink_get_type,
+ gst_omx_filereadersrc_get_type,
+#endif /* EXPERIMENTAL */
+ gst_omx_volume_get_type,
+};
+
+static gchar *
+get_config_path (void)
+{
+ gchar *path;
+ const gchar *const *dirs;
+ int i;
+
+ path = g_strdup (g_getenv ("OMX_CONFIG"));
+
+ if (path)
+ return path;
+
+ dirs = g_get_system_config_dirs ();
+ for (i = 0; dirs[i]; i++)
+ {
+ path = g_build_filename (dirs[i], "gstreamer-0.10", "gst-openmax.conf", NULL);
+ if (g_file_test (path, G_FILE_TEST_IS_REGULAR))
+ return path;
+ g_free (path);
+ }
+
+ return g_build_filename (g_get_user_config_dir (),
+ "gst-openmax.conf", NULL);
+}
+
+static void
+fetch_element_table (GstPlugin *plugin)
+{
+ gchar *path;
+ gchar *config, *s;
+ GstStructure *tmp, *element;
+
+ element_table = gst_plugin_get_cache_data (plugin);
+
+ if (element_table)
+ return;
+
+ path = get_config_path ();
+
+ if (!g_file_get_contents (path, &config, NULL, NULL))
+ {
+ g_warning ("could not find config file '%s'.. using defaults!", path);
+ config = (gchar *) default_config;
+ }
+
+ gst_plugin_add_dependency_simple (plugin, "ONX_CONFIG", path, NULL,
+ GST_PLUGIN_DEPENDENCY_FLAG_NONE);
+
+ g_free (path);
+
+ GST_DEBUG ("parsing config:\n%s", config);
+
+ tmp = gst_structure_empty_new ("element_table");
+
+ s = config;
+
+ while ((element = gst_structure_from_string (s, &s)))
+ {
+ const gchar *element_name = gst_structure_get_name (element);
+ gst_structure_set (tmp,
+ element_name, GST_TYPE_STRUCTURE, element, NULL);
+ }
+
+ if (config != default_config)
+ g_free (config);
+
+ GST_DEBUG ("element_table=%" GST_PTR_FORMAT, tmp);
+
+ gst_plugin_set_cache_data (plugin, tmp);
+
+ element_table = tmp;
+}
+
+static GstStructure *
+get_element_entry (const gchar *element_name)
+{
+ GstStructure *element;
+
+ if (!gst_structure_get ((GstStructure *) element_table, element_name,
+ GST_TYPE_STRUCTURE, &element, NULL))
+ {
+ element = NULL;
+ }
+
+ /* This assert should never fail, because plugin elements are registered
+ * based on the entries in this table. Someone would have to manually
+ * override the type qdata for this to fail.
+ */
+ g_assert (element);
+
+ return element;
+}
+
+/* register a new dynamic sub-class with the name 'type_name'.. this gives us
+ * a way to use the same (for example) GstOmxMp3Dec element mapping to
+ * multiple different element names with different OMX library implementations
+ * and/or component names
+ */
+static GType
+create_subtype (GType parent_type, const gchar *type_name)
+{
+ GTypeQuery q;
+ GTypeInfo i = {0};
+
+ if (!type_name)
+ return 0;
+
+ g_type_query (parent_type, &q);
+
+ i.class_size = q.class_size;
+ i.instance_size = q.instance_size;
+
+ return g_type_register_static (parent_type, type_name, &i, 0);
+}
+
+static gboolean
+plugin_init (GstPlugin *plugin)
+{
+ gint i, cnt;
+
+ GST_DEBUG_CATEGORY_INIT (gstomx_debug, "omx", 0, "gst-openmax");
+ GST_DEBUG_CATEGORY_INIT (gstomx_util_debug, "omx_util", 0, "gst-openmax utility");
+
+ element_name_quark = g_quark_from_static_string ("element-name");
+
+ /*
+ * First, call all the _get_type() functions to ensure the types are
+ * registered.
+ */
+ for (i = 0; i < G_N_ELEMENTS (get_type); i++)
+ get_type[i] ();
+
+ fetch_element_table (plugin);
+
+ g_omx_init ();
+
+ cnt = gst_structure_n_fields (element_table);
+ for (i = 0; i < cnt; i++)
+ {
+ const gchar *element_name = gst_structure_nth_field_name (element_table, i);
+ GstStructure *element = get_element_entry (element_name);
+ const gchar *type_name, *parent_type_name;
+ const gchar *component_name, *library_name;
+ GType type;
+ gint rank;
+
+ GST_DEBUG ("element_name=%s, element=%" GST_PTR_FORMAT, element_name, element);
+
+ parent_type_name = gst_structure_get_string (element, "parent-type");
+ type_name = gst_structure_get_string (element, "type");
+ component_name = gst_structure_get_string (element, "component-name");
+ library_name = gst_structure_get_string (element, "library-name");
+
+ if (!type_name || !component_name || !library_name)
+ {
+ g_warning ("malformed config file: missing required fields for %s",
+ element_name);
+ return FALSE;
+ }
+
+ if (parent_type_name)
+ {
+ type = g_type_from_name (parent_type_name);
+ if (type)
+ {
+ type = create_subtype (type, type_name);
+ }
+ else
+ {
+ g_warning ("malformed config file: invalid parent-type '%s' for %s",
+ parent_type_name, element_name);
+ return FALSE;
+ }
+ }
+ else
+ {
+ type = g_type_from_name (type_name);
+ }
+
+ if (!type)
+ {
+ g_warning ("malformed config file: invalid type '%s' for %s",
+ type_name, element_name);
+ return FALSE;
+ }
+
+ g_type_set_qdata (type, element_name_quark, (gpointer) element_name);
+
+ if (!gst_structure_get_int (element, "rank", &rank))
+ {
+ /* use default rank: */
+ rank = GST_RANK_NONE;
+ }
+
+ if (!gst_element_register (plugin, element_name, rank, type))
+ {
+ g_warning ("failed registering '%s'", element_name);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+gboolean
+gstomx_get_component_info (void *core,
+ GType type)
+{
+ GOmxCore *rcore = core;
+ const gchar *element_name;
+ GstStructure *element;
+ const gchar *str;
+
+ element_name = g_type_get_qdata (type, element_name_quark);
+ element = get_element_entry (element_name);
+
+ if (!element)
+ return FALSE;
+
+ str = gst_structure_get_string (element, "library-name");
+ rcore->library_name = g_strdup (str);
+
+ str = gst_structure_get_string (element, "component-name");
+ rcore->component_name = g_strdup (str);
+
+ return TRUE;
+}
+
+<<<<<<< HEAD
+/* for now, to keep gst out of g_omx.. if later g_omx becomes gstomx
+ * then this could be combined with the existing g_omx_core_new()
+ * and g_omx_core_init() could be made static/private
+ */
+void *
+gstomx_core_new (void *object, GType type)
+{
+ GOmxCore *core = g_omx_core_new (object);
+ gstomx_get_component_info (core, type);
+ g_omx_core_init (core);
+ return core;
+=======
+void
+gstomx_install_property_helper (GObjectClass *gobject_class)
+{
+
+ g_object_class_install_property (gobject_class, ARG_COMPONENT_NAME,
+ g_param_spec_string ("component-name", "Component name",
+ "Name of the OpenMAX IL component to use",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
+ g_param_spec_string ("library-name", "Library name",
+ "Name of the OpenMAX IL implementation library to use",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+}
+
+gboolean
+gstomx_get_property_helper (void *core, guint prop_id, GValue *value)
+{
+ GOmxCore *gomx = core;
+ switch (prop_id)
+ {
+ case ARG_COMPONENT_NAME:
+ g_value_set_string (value, gomx->component_name);
+ return TRUE;
+ case ARG_LIBRARY_NAME:
+ g_value_set_string (value, gomx->library_name);
+ return TRUE;
+ default:
+ return FALSE;
+ }
+>>>>>>> abd4b5d... Handle properties common to all gstomx base classes with helper functions
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "omx",
+ "OpenMAX IL",
+ plugin_init,
+ PACKAGE_VERSION,
+ GST_LICENSE,
+ GST_PACKAGE_NAME,
+ GST_PACKAGE_ORIGIN)
diff --git a/omx/gstomx.h b/omx/gstomx.h
index 00888d6..eb163ab 100644
--- a/omx/gstomx.h
+++ b/omx/gstomx.h
@@ -34,6 +34,7 @@ enum
{
GSTOMX_ARG_0,
ARG_COMPONENT_NAME,
+ ARG_COMPONENT_ROLE,
ARG_LIBRARY_NAME,
GSTOMX_NUM_COMMON_PROP
};
diff --git a/omx/gstomx.h.orig b/omx/gstomx.h.orig
new file mode 100644
index 0000000..b1e2ce9
--- /dev/null
+++ b/omx/gstomx.h.orig
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2007-2009 Nokia Corporation.
+ *
+ * Author: Felipe Contreras <fel...@no...>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef GSTOMX_H
+#define GSTOMX_H
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+GST_DEBUG_CATEGORY_EXTERN (gstomx_debug);
+GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug);
+#define GST_CAT_DEFAULT gstomx_debug
+
+enum
+{
+ GSTOMX_ARG_0,
+ ARG_COMPONENT_NAME,
+ ARG_LIBRARY_NAME,
+ GSTOMX_NUM_COMMON_PROP
+};
+
+gboolean gstomx_get_component_info (void *core,
+ GType type);
+
+<<<<<<< HEAD
+void * gstomx_core_new (void *object, GType type);
+=======
+void gstomx_install_property_helper (GObjectClass *gobject_class);
+gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue *value);
+>>>>>>> abd4b5d... Handle properties common to all gstomx base classes with helper functions
+
+G_END_DECLS
+
+#endif /* GSTOMX_H */
diff --git a/omx/gstomx_util.c b/omx/gstomx_util.c
index 4d91b6b..aae2c02 100644
--- a/omx/gstomx_util.c
+++ b/omx/gstomx_util.c
@@ -311,8 +311,10 @@ g_omx_core_free (GOmxCore *core)
void
g_omx_core_init (GOmxCore *core)
{
- GST_DEBUG_OBJECT (core->object, "loading: %s (%s)",
- core->component_name, core->library_name);
+ GST_DEBUG_OBJECT (core->object, "loading: %s %s (%s)",
+ core->component_name,
+ core->component_role ? core->component_role : "",
+ core->library_name);
core->imp = request_imp (core->library_name);
@@ -328,7 +330,23 @@ g_omx_core_init (GOmxCore *core)
core->omx_handle, core->omx_error);
if (!core->omx_error)
+ {
core->omx_state = OMX_StateLoaded;
+
+ if (core->component_role)
+ {
+ OMX_PARAM_COMPONENTROLETYPE param;
+
+ GST_DEBUG_OBJECT (core->object, "setting component role: %s",
+ core->component_role);
+
+ G_OMX_INIT_PARAM (param);
+
+ strncpy((char*)param.cRole, core->component_role, OMX_MAX_STRINGNAME_SIZE);
+
+ OMX_SetParameter (core->omx_handle, OMX_IndexParamStandardComponentRole, ¶m);
+ }
+ }
}
static void
@@ -355,6 +373,7 @@ core_deinit (GOmxCore *core)
g_free (core->library_name);
g_free (core->component_name);
+ g_free (core->component_role);
release_imp (core->imp);
core->imp = NULL;
diff --git a/omx/gstomx_util.h b/omx/gstomx_util.h
index fefdbfd..68832d3 100644
--- a/omx/gstomx_util.h
+++ b/omx/gstomx_util.h
@@ -94,6 +94,7 @@ struct GOmxCore
gchar *library_name;
gchar *component_name;
+ gchar *component_role;
};
struct GOmxPort
--
1.6.6
|
|
From: Rob C. <ro...@ti...> - 2010-03-29 13:07:32
|
This removes some common code from all base classes, and makes it easier to
add new common properties.
For now (and the foreseeable future) all common properties are read-only,
but a gstomx_set_property_helper() could be added later if needed.
---
v2: resolve conflicts after changes to previous patch
omx/gstomx.c | 32 ++++++++++++++++++++++++++++++++
omx/gstomx.h | 10 ++++++++++
omx/gstomx_base_filter.c | 24 +++++-------------------
omx/gstomx_base_sink.c | 26 ++++----------------------
omx/gstomx_base_src.c | 26 ++++----------------------
5 files changed, 55 insertions(+), 63 deletions(-)
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 2a3a0b7..6871e98 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -346,6 +346,38 @@ gstomx_core_new (void *object, GType type)
return core;
}
+void
+gstomx_install_property_helper (GObjectClass *gobject_class)
+{
+
+ g_object_class_install_property (gobject_class, ARG_COMPONENT_NAME,
+ g_param_spec_string ("component-name", "Component name",
+ "Name of the OpenMAX IL component to use",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
+ g_param_spec_string ("library-name", "Library name",
+ "Name of the OpenMAX IL implementation library to use",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+}
+
+gboolean
+gstomx_get_property_helper (void *core, guint prop_id, GValue *value)
+{
+ GOmxCore *gomx = core;
+ switch (prop_id)
+ {
+ case ARG_COMPONENT_NAME:
+ g_value_set_string (value, gomx->component_name);
+ return TRUE;
+ case ARG_LIBRARY_NAME:
+ g_value_set_string (value, gomx->library_name);
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"omx",
diff --git a/omx/gstomx.h b/omx/gstomx.h
index 4f07fd6..00888d6 100644
--- a/omx/gstomx.h
+++ b/omx/gstomx.h
@@ -30,10 +30,20 @@ GST_DEBUG_CATEGORY_EXTERN (gstomx_debug);
GST_DEBUG_CATEGORY_EXTERN (gstomx_util_debug);
#define GST_CAT_DEFAULT gstomx_debug
+enum
+{
+ GSTOMX_ARG_0,
+ ARG_COMPONENT_NAME,
+ ARG_LIBRARY_NAME,
+ GSTOMX_NUM_COMMON_PROP
+};
+
gboolean gstomx_get_component_info (void *core,
GType type);
void * gstomx_core_new (void *object, GType type);
+void gstomx_install_property_helper (GObjectClass *gobject_class);
+gboolean gstomx_get_property_helper (void *core, guint prop_id, GValue *value);
G_END_DECLS
diff --git a/omx/gstomx_base_filter.c b/omx/gstomx_base_filter.c
index 4e7fb28..2dbf850 100644
--- a/omx/gstomx_base_filter.c
+++ b/omx/gstomx_base_filter.c
@@ -27,10 +27,7 @@
enum
{
- ARG_0,
- ARG_COMPONENT_NAME,
- ARG_LIBRARY_NAME,
- ARG_USE_TIMESTAMPS,
+ ARG_USE_TIMESTAMPS = GSTOMX_NUM_COMMON_PROP,
};
static void init_interfaces (GType type);
@@ -201,14 +198,11 @@ get_property (GObject *obj,
self = GST_OMX_BASE_FILTER (obj);
+ if (gstomx_get_property_helper (self->gomx, prop_id, value))
+ return;
+
switch (prop_id)
{
- case ARG_COMPONENT_NAME:
- g_value_set_string (value, self->gomx->component_name);
- break;
- case ARG_LIBRARY_NAME:
- g_value_set_string (value, self->gomx->library_name);
- break;
case ARG_USE_TIMESTAMPS:
g_value_set_boolean (value, self->use_timestamps);
break;
@@ -241,15 +235,7 @@ type_class_init (gpointer g_class,
gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
- g_object_class_install_property (gobject_class, ARG_COMPONENT_NAME,
- g_param_spec_string ("component-name", "Component name",
- "Name of the OpenMAX IL component to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
- g_param_spec_string ("library-name", "Library name",
- "Name of the OpenMAX IL implementation library to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ gstomx_install_property_helper (gobject_class);
g_object_class_install_property (gobject_class, ARG_USE_TIMESTAMPS,
g_param_spec_boolean ("use-timestamps", "Use timestamps",
diff --git a/omx/gstomx_base_sink.c b/omx/gstomx_base_sink.c
index a6ede59..3cc5f99 100644
--- a/omx/gstomx_base_sink.c
+++ b/omx/gstomx_base_sink.c
@@ -32,13 +32,6 @@ static gboolean share_input_buffer;
static inline gboolean omx_init (GstOmxBaseSink *self);
-enum
-{
- ARG_0,
- ARG_COMPONENT_NAME,
- ARG_LIBRARY_NAME,
-};
-
static void init_interfaces (GType type);
GSTOMX_BOILERPLATE_FULL (GstOmxBaseSink, gst_omx_base_sink, GstBaseSink, GST_TYPE_BASE_SINK, init_interfaces);
@@ -281,14 +274,11 @@ get_property (GObject *obj,
self = GST_OMX_BASE_SINK (obj);
+ if (gstomx_get_property_helper (self->gomx, prop_id, value))
+ return;
+
switch (prop_id)
{
- case ARG_COMPONENT_NAME:
- g_value_set_string (value, self->gomx->component_name);
- break;
- case ARG_LIBRARY_NAME:
- g_value_set_string (value, self->gomx->library_name);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -324,15 +314,7 @@ type_class_init (gpointer g_class,
{
gobject_class->get_property = get_property;
- g_object_class_install_property (gobject_class, ARG_COMPONENT_NAME,
- g_param_spec_string ("component-name", "Component name",
- "Name of the OpenMAX IL component to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
- g_param_spec_string ("library-name", "Library name",
- "Name of the OpenMAX IL implementation library to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ gstomx_install_property_helper (gobject_class);
}
}
diff --git a/omx/gstomx_base_src.c b/omx/gstomx_base_src.c
index b61b6fb..af0bd01 100644
--- a/omx/gstomx_base_src.c
+++ b/omx/gstomx_base_src.c
@@ -24,13 +24,6 @@
#include <string.h> /* for memcpy */
-enum
-{
- ARG_0,
- ARG_COMPONENT_NAME,
- ARG_LIBRARY_NAME,
-};
-
GSTOMX_BOILERPLATE (GstOmxBaseSrc, gst_omx_base_src, GstBaseSrc, GST_TYPE_BASE_SRC);
static void
@@ -342,14 +335,11 @@ get_property (GObject *obj,
self = GST_OMX_BASE_SRC (obj);
+ if (gstomx_get_property_helper (self->gomx, prop_id, value))
+ return;
+
switch (prop_id)
{
- case ARG_COMPONENT_NAME:
- g_value_set_string (value, self->gomx->component_name);
- break;
- case ARG_LIBRARY_NAME:
- g_value_set_string (value, self->gomx->library_name);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -382,15 +372,7 @@ type_class_init (gpointer g_class,
{
gobject_class->get_property = get_property;
- g_object_class_install_property (gobject_class, ARG_COMPONENT_NAME,
- g_param_spec_string ("component-name", "Component name",
- "Name of the OpenMAX IL component to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
- g_object_class_install_property (gobject_class, ARG_LIBRARY_NAME,
- g_param_spec_string ("library-name", "Library name",
- "Name of the OpenMAX IL implementation library to use",
- NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+ gstomx_install_property_helper (gobject_class);
}
}
--
1.6.6
|