After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740965 - ac3 decoder support in gst-omx 1.2
ac3 decoder support in gst-omx 1.2
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-omx
1.x
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-01 12:12 UTC by kalyan
Modified: 2018-05-07 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for ac3 decoder support (12.07 KB, patch)
2014-12-01 12:12 UTC, kalyan
needs-work Details | Review

Description kalyan 2014-12-01 12:12:05 UTC
Created attachment 291882 [details] [review]
patch for ac3 decoder support 

i  implemented mpeg2 video decoder,AC3 audio   IL using  bellagio core  and ported it on gst-omx 1.2 and tested, so attached patch is wrapper for adding ac3 support in gst-omx 1.2
Comment 1 Sebastian Dröge (slomo) 2014-12-01 12:27:05 UTC
Review of attachment 291882 [details] [review]:

Thanks for the patch, generally looks good... just some comments below :)

::: omx/gstomxac3dec.c
@@ +66,3 @@
+       "channels=(int)[1,6], "
+       "rate=(int)[8000,48000], "
+       "alignment=(string){iec61937,frame}";

Are you sure both are always supported?

@@ +90,3 @@
+  GstOMXAC3Dec *self = GST_OMX_AC3_DEC (dec);
+  OMX_PARAM_PORTDEFINITIONTYPE port_def;
+  OMX_AUDIO_PARAM_AACPROFILETYPE ac3_param;

AAC

@@ +110,3 @@
+
+  err =
+      gst_omx_component_get_parameter (dec->dec, OMX_IndexParamAudioAac,

AAC

@@ +121,3 @@
+  s = gst_caps_get_structure (caps, 0);
+
+  if (/*!gst_structure_get_int (s, "mpegversion", &mpegversion) ||*/

No mpegversion field

@@ +148,3 @@
+{
+  GstOMXAC3Dec *self = GST_OMX_AC3_DEC (dec);
+  OMX_AUDIO_PARAM_AACPROFILETYPE ac3_param;

AAC

@@ +158,3 @@
+
+  err =
+      gst_omx_component_get_parameter (dec->dec, OMX_IndexParamAudioAac,

Should be somethnig with Ac3 instead of AAC

@@ +169,3 @@
+  s = gst_caps_get_structure (caps, 0);
+
+  if (/*!gst_structure_get_int (s, "mpegversion", &mpegversion) ||*/

There is no mpegversion field for AC3

@@ +209,3 @@
+  }
+
+  /* FIXME: Rather arbitrary values here, based on what we do in gstfaac.c */

IIRC the channel positions are fixed in AC3, so we can choose proper values here

::: omx/gstomxac3dec.h
@@ +45,3 @@
+{
+  GstOMXAudioDec parent;
+  gint spf;

No need to have that here as AC3 always has 512 samples per frame (IIRC)

::: omx/gstomxaudiodec.c
@@ +531,3 @@
     nframes = 1;
+    if (self->parent.element.object.name == "omxac3dec-omxac3dec0")
+       spf = 512;

You would implement the get_samples_per_frame() vfunc in gstomxac3dec and return 512 there instead. Like it's done for AAC and MP3 already.
Comment 2 Julien Isorce 2017-05-24 09:05:42 UTC
(In reply to kalyan from comment #0)
> i  implemented AC3 audio and tested

Was it on desktop or an embedded device ? Which omx target ? Strange that it worked using OMX_IndexParamAudioAac.

Note that ac3 is not in the headers provided by Khronos.
For Android and it comes as an extension: https://android.googlesource.com/platform/frameworks/native/+/master/include/media/openmax/OMX_IndexExt.h#60 .
For Rpi/Broadcom it comes like that: https://github.com/raspberrypi/firmware/blob/master/opt/vc/include/IL/OMX_Index.h#L392
Comment 3 Sebastian Dröge (slomo) 2018-05-07 15:45:00 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!