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 739351 - baseparse: parser fixed caps flag issue
baseparse: parser fixed caps flag issue
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.4.3
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-29 12:29 UTC by Nicolas Huet
Modified: 2018-11-03 12:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test stream (828.65 KB, application/octet-stream)
2014-10-29 12:29 UTC, Nicolas Huet
  Details
baseparse patch (926 bytes, patch)
2014-10-29 12:29 UTC, Nicolas Huet
none Details | Review
aacparse patch (744 bytes, patch)
2014-10-29 12:30 UTC, Nicolas Huet
none Details | Review

Description Nicolas Huet 2014-10-29 12:29:28 UTC
Created attachment 289582 [details]
test stream

Using the aacparse with differents caps in a stream starting with 6 channels, then 2 channels, the aacparse tries to get the allowed caps.
As the baseparse is configured with gst_pad_use_fixed_caps (parse->srcpad), the allowed caps on the second negociation is always the current caps. The aacparse therefore tries a "raw" caps instead of adts.

I was wondering if the configuration of the fixed caps should really be done in baseparse or if it should be done in the subclass.
The documentation of baseparse is not clear to me:
"Things that subclass need to take care of:
    Fixate the source pad caps when appropriate "


The provided stream shows the issue.

gst-launch-1.0 -v --gst-debug=*:3,aacparse:6 filesrc location= aac.gdp  ! gdpdepay !  aacparse ! avdec_aac  ! fakesink silent=true

I provide two patches (one in baseparse and one in aacparse) as I am not sure where the fix should be handled


Results:
0:00:01.953332579  2563  0x129acf0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 6
0:00:01.954749635  2563  0x129acf0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 2
0:00:01.955019481  2563  0x129acf0 DEBUG               aacparse gstaacparse.c:172:gst_aac_parse_set_src_caps:<aacparse0> sink caps: (NULL)
0:00:01.955442520  2563  0x129acf0 DEBUG               aacparse gstaacparse.c:210:gst_aac_parse_set_src_caps:<aacparse0:src> Caps can not intersect
0:00:01.955794067  2563  0x129acf0 DEBUG               aacparse gstaacparse.c:213:gst_aac_parse_set_src_caps:<aacparse0:src> Input is ADTS, trying raw
0:00:01.956069992  2563  0x129acf0 DEBUG               aacparse gstaacparse.c:256:gst_aac_parse_set_src_caps:<aacparse0> setting src caps: audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)raw
/GstPipeline:pipeline0/GstAacParse:aacparse0.GstPad:src: caps = audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)raw
/GstPipeline:pipeline0/avdec_aac:avdec_aac0.GstPad:sink: caps = audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)raw
/GstPipeline:pipeline0/avdec_aac:avdec_aac0.GstPad:src: caps = audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:01.989942687  2563  0x129acf0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 2

Expected:
0:00:01.497882759  2548   0xa9aef0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 6
0:00:01.499493903  2548   0xa9aef0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 2
0:00:01.499751062  2548   0xa9aef0 DEBUG               aacparse gstaacparse.c:172:gst_aac_parse_set_src_caps:<aacparse0> sink caps: (NULL)
0:00:01.500215872  2548   0xa9aef0 DEBUG               aacparse gstaacparse.c:256:gst_aac_parse_set_src_caps:<aacparse0> setting src caps: audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)adts
/GstPipeline:pipeline0/GstAacParse:aacparse0.GstPad:src: caps = audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)adts
/GstPipeline:pipeline0/avdec_aac:avdec_aac0.GstPad:sink: caps = audio/mpeg, framed=(boolean)true, mpegversion=(int)2, rate=(int)48000, channels=(int)2, stream-format=(string)adts
/GstPipeline:pipeline0/avdec_aac:avdec_aac0.GstPad:src: caps = audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
0:00:01.535815837  2548   0xa9aef0 LOG                 aacparse gstaacparse.c:1262:gst_aac_parse_handle_frame:<aacparse0> rate: 48000, chans: 2
Comment 1 Nicolas Huet 2014-10-29 12:29:55 UTC
Created attachment 289583 [details] [review]
baseparse patch
Comment 2 Nicolas Huet 2014-10-29 12:30:26 UTC
Created attachment 289584 [details] [review]
aacparse patch
Comment 3 Aurélien Zanelli 2014-10-31 16:32:35 UTC
Correct me if I'm wrong, but since this flag is set in many base class, I'm not sure it's the right way to fix the issue.

Assumimg querying the src pad peer caps will not result in the current negotiated caps, we may do something like this:

diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c
index aee1248..8fe929b 100644
--- a/gst/audioparsers/gstaacparse.c
+++ b/gst/audioparsers/gstaacparse.c
@@ -214,7 +214,7 @@ gst_aac_parse_set_src_caps (GstAacParse * aacparse, GstCaps * sink_caps)
   if (stream_format)
     gst_structure_set (s, "stream-format", G_TYPE_STRING, stream_format, NULL);
 
-  allowed = gst_pad_get_allowed_caps (GST_BASE_PARSE (aacparse)->srcpad);
+  allowed = gst_pad_peer_query_caps (GST_BASE_PARSE (aacparse)->srcpad, NULL);
   if (!gst_caps_can_intersect (src_caps, allowed)) {
     GST_DEBUG_OBJECT (GST_BASE_PARSE (aacparse)->srcpad,
         "Caps can not intersect");

I didn't make a patch because I'm not sure it's right either and I didn't test it.
Comment 4 GStreamer system administrator 2018-11-03 12:23:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/77.