Chromium Code Reviews
DescriptionFFmpegDemuxer: Clear |extra_data| when enabling bitstream conversion.
After this change, fallback from GpuVideoDecoder to FFmpegVideoDecoder
should work. The exact mechanism is perhaps surprising:
- After successfully initializing GpuVideoDecoder, bitstream
conversion is enabled. We can't easily turn it off again when we
fall back.
- FFmpegVideoDecoder can decode a converted bitstream, but only if it
knows the conversion has occurred. It checks for the presence of an
AVCC record in |extra_data| to deduce the bitstream format.
- Clearing |extra_data| is reasonable, because the AVCC record serves
no purpose for an Annex B stream. (Note: the MSE path doesn't
provide |exta_data| at all.)
- Converting |extra_data| into a different format (eg. SPS + PPS
concatenated in Annex B format) would be logical, but currently
would serve no purpose (in particular because the conversion would
happen after Initialize()).
- The result then is that |extra_data| is cleared after initializing
GpuVideoDecoder. Upon fallback, FFmpegVideoDecoder will interpret
the alread-converted bitstream correctly. GpuVideoDecoder still
receives |extra_data|, and on Android actually makes uses of it.
- Note that if GpuVideoDecoder is not initialized successfully, then
bitstream conversion is never enabled and FFmpegVideoDecoder works
exactly as it did before (with |extra_data| passed in the codec
context).
BUG=605790
Committed: https://crrev.com/e4041392035ece38d99818ea1bbe8f912a27a19e
Cr-Commit-Position: refs/heads/master@{#427781}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Add test. #Patch Set 3 : Default parameters. #Patch Set 4 : Remove useless default. #Patch Set 5 : Rebase. #Patch Set 6 : Restore variant used by fuzzertest. #
Messages
Total messages: 22 (10 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||