forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media: Support better decoder switching
Today on reinitialization error, or decode error of the first buffer, DecoderStream will fall back to decoders left in the DecoderSelector. Since we will have less and less decoders in the DecoderSelector, the ability to switch decoders is limited. This CL updates DecoderSelector so that it takes a callback to create a list of decoders, instead of taking the list of decoders directly. This allows the DecoderSelector to select a decoder that has been tried or selected before, such that upon decoder reinitialization error (e.g. switching from clear to encrypted config), or upon decode error of the first buffer, we always have the full list of decoders to select from. Two mechanisms are added to avoid trying the same failing decoder again: 1. Blacklist When SelectDecoder() is called due to reinitialization failure, or decoding failure of the first buffer, the existing decoder is listed as the "blacklisted decoder" such that DecoderSelector will not even try it. There is one exception though. When DecryptingDemuxerStream is selected, since the input steam is changed (encrypted -> clear), the blacklisted decoder is ignored. For example, FFmpegVideoDecoder is slected first for a clear stream. Then on a config change, the stream becomes encrypted so FFmpegVideoDecoder fails to reinitialize and we need to select a new decoder. After DecryptingDemuxerStream is selected, we should still be able to use FFmpegVideoDecoder to decode the decrypted stream. 2. Fall back at most once If fallback has already happened and decode of the first buffer failed again, we don't try to fallback again. This is to avoid the infinite loop of "select decoder 1 -> decode error -> select decoder 2 -> decode error -> select decoder 1". BUG=695595 TEST=Updated/Added unittests. Review-Url: https://codereview.chromium.org/2837613004 Cr-Commit-Position: refs/heads/master@{#469579}
- Loading branch information
1 parent
6815aef
commit 1492be9
Showing
17 changed files
with
482 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.