[Bug 669509] [h264parse] caps renegotiation fails due to baseparse calling gst_pad_use_fixed_caps

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Mar 7 09:10:05 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=669509

Aleksander Wabik <awabik at opera.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |awabik at opera.com

--- Comment #3 from Aleksander Wabik <awabik at opera.com> ---
A similar bug is reproducing on GStreamer 1.4.5 and 1.6.3, and probably all
others.

The issue boils down to:
- aacparse used for adaptive streaming AAC
- the first segment uses sample rate 22050 (caps: audio/mpeg,
framed=(boolean)true, mpegversion=(int)4, level=(string)1,
base-profile=(string)lc, profile=(string)lc, rate=(int)22050, channels=(int)2,
stream-format=(string)adts)
- the second segment uses rate 44100
- in gst_aac_parse_set_src_caps(), gst_pad_get_allowed_caps (GST_BASE_PARSE
(aacparse)->srcpad) returns the old negotiated caps, with sample rate 22050,
- new caps can not intersect, we enter a special branch for handling this
problem,
- in that branch, the aacparse simply changes stream format from adts to raw,
and retries,
- needless to say, due to different rate, gst_caps_can_intersect (src_caps,
allowed) fails - so aacparse does not even set "codec_data" caps.

Simply clearing GST_PAD_FLAG_FIXED_CAPS flag does the job - caps are negotiated
correctly and playback works.

Now, the playback works on x86, only because it (due to the same bug) changes
caps *from* raw into adts, so no codec_data is required. See the reproduction
on x86:

Anyway, the testcase is:

export GST_DEBUG=aacparse:5
gst-launch-1.0 playbin
uri=http://yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd

The logs:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.330564508 29657 0x7ff0dc14d280 DEBUG               aacparse
gstaacparse.c:145:gst_aac_parse_init: initialized
0:00:00.330778462 29657 0x7ff0dc14d280 DEBUG               aacparse
gstaacparse.c:1415:gst_aac_parse_start: start
0:00:00.728723676 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:291:gst_aac_parse_sink_setcaps:<aacparse0> setcaps: audio/mpeg,
mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw,
level=(string)1, base-profile=(string)lc, profile=(string)lc,
codec_data=(buffer)1388, rate=(int)22050, channels=(int)1
0:00:00.728763502 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:325:gst_aac_parse_sink_setcaps: codec_data: object_type=2,
sample_rate=22050, channels=1, samples=1024
0:00:00.728778072 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:172:gst_aac_parse_set_src_caps:<aacparse0> sink caps: audio/mpeg,
mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw,
level=(string)1, base-profile=(string)lc, profile=(string)lc,
codec_data=(buffer)1388, rate=(int)22050, channels=(int)1
0:00:00.729981179 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:256:gst_aac_parse_set_src_caps:<aacparse0> setting src caps:
audio/mpeg, mpegversion=(int)4, framed=(boolean)true,
stream-format=(string)raw, level=(string)1, base-profile=(string)lc,
profile=(string)lc, codec_data=(buffer)1388, rate=(int)22050, channels=(int)1
Redistribute latency...
Prerolled, waiting for buffering to finish...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
Redistribute latency...
0:00:10.519105212 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:291:gst_aac_parse_sink_setcaps:<aacparse0> setcaps: audio/mpeg,
mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw,
level=(string)2, base-profile=(string)lc, profile=(string)lc,
codec_data=(buffer)1210, rate=(int)44100, channels=(int)2
0:00:10.519141905 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:325:gst_aac_parse_sink_setcaps: codec_data: object_type=2,
sample_rate=44100, channels=2, samples=1024
0:00:10.519157027 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:172:gst_aac_parse_set_src_caps:<aacparse0> sink caps: audio/mpeg,
mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw,
level=(string)2, base-profile=(string)lc, profile=(string)lc,
codec_data=(buffer)1210, rate=(int)44100, channels=(int)2
0:00:10.520443564 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:221:gst_aac_parse_set_src_caps:<aacparse0:src> Caps can not
intersect
0:00:10.520480456 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:243:gst_aac_parse_set_src_caps:<aacparse0:src> Input is raw,
trying ADTS
0:00:10.520494939 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:256:gst_aac_parse_set_src_caps:<aacparse0> setting src caps:
audio/mpeg, mpegversion=(int)4, framed=(boolean)true,
stream-format=(string)adts, level=(string)2, base-profile=(string)lc,
profile=(string)lc, codec_data=(buffer)1210, rate=(int)44100, channels=(int)2

You can see how intitially the aac stream is configured to be:

audio/mpeg, mpegversion=(int)4, framed=(boolean)true,
stream-format=(string)raw, level=(string)1, base-profile=(string)lc,
profile=(string)lc, codec_data=(buffer)1388, rate=(int)22050, channels=(int)1

And when new caps come, new caps change the level, obviously codec_data, and
rate, but then:

0:00:10.520443564 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:221:gst_aac_parse_set_src_caps:<aacparse0:src> Caps can not
intersect
0:00:10.520480456 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:243:gst_aac_parse_set_src_caps:<aacparse0:src> Input is raw,
trying ADTS
0:00:10.520494939 29657 0x7ff0c80035e0 DEBUG               aacparse
gstaacparse.c:256:gst_aac_parse_set_src_caps:<aacparse0> setting src caps:
audio/mpeg, mpegversion=(int)4, framed=(boolean)true,
stream-format=(string)adts, level=(string)2, base-profile=(string)lc,
profile=(string)lc, codec_data=(buffer)1210, rate=(int)44100, channels=(int)2

Whoopsie, because these caps were not compatible with previous negotiated caps,
and the pad works in fixed mode, aacparse changed stream-format into ADTS!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list