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 769389 - aiffparse: Add bitrate and container format tags
aiffparse: Add bitrate and container format tags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-01 16:13 UTC by Carlos Rafael Giani
Modified: 2016-08-02 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Additional bitrate and container tags (1.64 KB, patch)
2016-08-01 16:14 UTC, Carlos Rafael Giani
none Details | Review
Additional bitrate and container tags, v2 (2.70 KB, patch)
2016-08-02 07:48 UTC, Carlos Rafael Giani
none Details | Review
Additional bitrate and container tags, v3 (2.71 KB, patch)
2016-08-02 11:52 UTC, Carlos Rafael Giani
committed Details | Review

Description Carlos Rafael Giani 2016-08-01 16:13:08 UTC
AIFF is a container format for audio data. Inform the application that the data comes from an AIFF container by adding a CONTAINER_FORMAT tag.

Also, add bitrate tags. The birate is essentially bytes_per_second * 8, since the data is uncompressed. This helps downstream elements which use the bitrate to estimate network buffer sizes.
Comment 1 Carlos Rafael Giani 2016-08-01 16:14:53 UTC
Created attachment 332485 [details] [review]
Additional bitrate and container tags
Comment 2 Sebastian Dröge (slomo) 2016-08-02 06:25:01 UTC
Review of attachment 332485 [details] [review]:

::: gst/aiff/aiffparse.c
@@ +1009,3 @@
+
+          /* Since this is uncompressed PCM data, the nominal
+           *, actual, minimum, maximuzm bitrate are the same */

Typo here though.

Should make sure that whenever compressed support is added (aiff can do that, right?), we change this part here...
Comment 3 Sebastian Dröge (slomo) 2016-08-02 06:26:21 UTC
Review of attachment 332485 [details] [review]:

Actually

::: gst/aiff/aiffparse.c
@@ +1001,3 @@
+        gst_tag_list_add (aiff->tags, GST_TAG_MERGE_REPLACE,
+            GST_TAG_CONTAINER_FORMAT, "Audio Interchange File Format (AIFF)",
+            NULL);

Use gst_pb_utils_add_codec_description_to_tag_list() here. That ensures consistent naming
Comment 4 Carlos Rafael Giani 2016-08-02 07:37:16 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Review of attachment 332485 [details] [review] [review]:
> 
> ::: gst/aiff/aiffparse.c
> @@ +1009,3 @@
> +
> +          /* Since this is uncompressed PCM data, the nominal
> +           *, actual, minimum, maximuzm bitrate are the same */
> 
> Typo here though.
> 
> Should make sure that whenever compressed support is added (aiff can do
> that, right?), we change this part here...

Yes, AIFF-C supports compression. However, aiffparse only supports uncompressed PCM data. From gst_aiff_parse_parse_comm():

    /* We only support the 'trivial' uncompressed AIFC, but it can be
     * either big or little endian */

Adding support for alaw/mulaw/adpcm and others would perhaps be better kept in a separate commit. Nevertheless, I'll modify the bitrate comment above to reflect the AIFF-C situation.
Comment 5 Carlos Rafael Giani 2016-08-02 07:48:46 UTC
Created attachment 332508 [details] [review]
Additional bitrate and container tags, v2
Comment 6 Sebastian Dröge (slomo) 2016-08-02 11:29:17 UTC
Review of attachment 332508 [details] [review]:

::: gst/aiff/aiffparse.c
@@ +1004,3 @@
+          gst_pb_utils_add_codec_description_to_tag_list (aiff->tags,
+              GST_TAG_CONTAINER_FORMAT, desccaps);
+          gst_caps_unref (desccaps);

No need to create new caps here, just get the caps from the sinkpad template :) gst_pad_get_pad_template_caps() on the sinkpad
Comment 7 Carlos Rafael Giani 2016-08-02 11:52:54 UTC
Created attachment 332543 [details] [review]
Additional bitrate and container tags, v3
Comment 8 Sebastian Dröge (slomo) 2016-08-02 12:21:56 UTC
commit 9c596d20fe03896eb4817d11c35cfb45c83eaa94
Author: Carlos Rafael Giani <dv@pseudoterminal.org>
Date:   Tue Aug 2 13:48:43 2016 +0200

    aiffparse: Add tags for container format and bitrate
    
    The bitrate is added to help downstream elements (like uridecodebin)
    figure out a proper network buffer size
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769389