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 650313 - ac3parse: Add support for iec61937 alignment
ac3parse: Add support for iec61937 alignment
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-16 13:15 UTC by Arun Raghavan
Modified: 2011-07-27 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ac3parse: Add support for IEC 61937 alignment (9.33 KB, patch)
2011-05-16 13:15 UTC, Arun Raghavan
committed Details | Review
ac3parse: Support switching alignment on-the-fly (6.44 KB, patch)
2011-05-16 13:15 UTC, Arun Raghavan
needs-work Details | Review

Description Arun Raghavan 2011-05-16 13:15:19 UTC
Attaching a couple of patches that allow us to configure ac3parse to send buffers in units that are directly usable for iec61937 payloading (namely 6 audio blocks per substream). The first patch merely accepts configuring in caps at runtime, and the second adds the ability for downstream elements to request reconfiguration.
Comment 1 Arun Raghavan 2011-05-16 13:15:24 UTC
Created attachment 187911 [details] [review]
ac3parse: Add support for IEC 61937 alignment

When pushing out buffers over S/PDIF or HDMI, IEC 61937 payloading
requires each buffer to contain 6 blocks from each substream. This adds
code to collect all the frames needed to meet this requirement before
pushing out a buffer.
Comment 2 Arun Raghavan 2011-05-16 13:15:29 UTC
Created attachment 187912 [details] [review]
ac3parse: Support switching alignment on-the-fly

This allows switching of alignment for E-AC3 streams at run-time. This
is requested by downstream elements via a custom event.
Comment 3 Sebastian Dröge (slomo) 2011-05-17 07:52:04 UTC
Comment on attachment 187911 [details] [review]
ac3parse: Add support for IEC 61937 alignment

Looks good
Comment 4 Sebastian Dröge (slomo) 2011-05-17 07:55:12 UTC
Review of attachment 187912 [details] [review]:

::: gst/audioparsers/gstac3parse.c
@@ +202,3 @@
+
+  klass->baseparse_src_event = parse_class->src_event;
+  parse_class->src_event = GST_DEBUG_FUNCPTR (gst_ac3_parse_src_event);

Just override ->src_event and then chain up in the event function via GST_BASE_PARSE_CLASS(parent_class)->src_event(bparse, event);

@@ +597,3 @@
     gst_caps_set_simple (caps, "alignment", G_TYPE_STRING,
+        g_atomic_int_get (&ac3parse->align) == GST_AC3_PARSE_ALIGN_IEC61937 ?
+        "iec61937" : "frame", NULL);

You should check if the alignment has changed here and only create new caps if the caps actually changed, otherwise just set GST_PAD_CAPS() on the buffers

::: gst/audioparsers/gstac3parse.h
@@ +72,3 @@
 struct _GstAc3ParseClass {
   GstBaseParseClass baseparse_class;
+  gboolean (*baseparse_src_event) (GstBaseParse * parse, GstEvent * event);

Not needed
Comment 5 Arun Raghavan 2011-06-21 23:26:48 UTC
Thank you for the reviews, Sebastian! (and sorry for taking so long to get back)

(In reply to comment #4)
> Review of attachment 187912 [details] [review]:
> 
> ::: gst/audioparsers/gstac3parse.c
> @@ +202,3 @@
> +
> +  klass->baseparse_src_event = parse_class->src_event;
> +  parse_class->src_event = GST_DEBUG_FUNCPTR (gst_ac3_parse_src_event);
> 
> Just override ->src_event and then chain up in the event function via
> GST_BASE_PARSE_CLASS(parent_class)->src_event(bparse, event);

Ack.

> @@ +597,3 @@
>      gst_caps_set_simple (caps, "alignment", G_TYPE_STRING,
> +        g_atomic_int_get (&ac3parse->align) == GST_AC3_PARSE_ALIGN_IEC61937 ?
> +        "iec61937" : "frame", NULL);
> 
> You should check if the alignment has changed here and only create new caps if
> the caps actually changed, otherwise just set GST_PAD_CAPS() on the buffers

We're actually only setting all this if some other parameters changed, so new caps would be needed anyway. Or are you saying that the way it was originally done should be fixed (which makes more sense, I suppose).

> ::: gst/audioparsers/gstac3parse.h
> @@ +72,3 @@
>  struct _GstAc3ParseClass {
>    GstBaseParseClass baseparse_class;
> +  gboolean (*baseparse_src_event) (GstBaseParse * parse, GstEvent * event);
> 
> Not needed

Ack.
Comment 6 Arun Raghavan 2011-07-27 15:49:00 UTC
Committed after making changes based on review  -- thanks!
Comment 7 Arun Raghavan 2011-07-27 15:59:15 UTC
commit 89564fcb69b481050f8064f0ba232a86cd9c5f51
Author: Arun Raghavan <arun.raghavan@collabora.co.uk>
Date:   Tue Apr 12 17:01:47 2011 +0530

    ac3parse: Support switching alignment on-the-fly
    
    This allows switching of alignment for E-AC3 streams at run-time. This
    is requested by downstream elements via a custom event.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650313

commit 96972eb462cc672d73c82cb2312f2116df1ced7c
Author: Arun Raghavan <arun.raghavan@collabora.co.uk>
Date:   Sat Apr 9 12:26:56 2011 +0530

    ac3parse: Add support for IEC 61937 alignment
    
    When pushing out buffers over S/PDIF or HDMI, IEC 61937 payloading
    requires each buffer to contain 6 blocks from each substream. This adds
    code to collect all the frames needed to meet this requirement before
    pushing out a buffer.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650313