forked from chromium/chromium
-
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.
Implement predicate-based decoder selection
This CL revamps the way a VideoDecoder or AudioDecoder is selected to decode a given VideoDecoderConfig or AudioDecoderConfig, respectively. The goal is to first filter and rank available decoders based on their high-level attributes ("IsPlatformDecoder", "SupportsDecryption"), rather than attempting to initialize them in the order they're submitted. The result is that an initial decoder is selected more efficiently, and the decoding system can gracefully transition between platform and non-platform decoders if the config changes mid-stream. The full design doc is available at: go/predicate-based-decoder-selection Bug: 684792 Change-Id: I8660e7315881b2bea44bf52afb4505f979a43728 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247331 Commit-Queue: Will Cassella <[email protected]> Reviewed-by: Xiaohan Wang <[email protected]> Reviewed-by: Dale Curtis <[email protected]> Reviewed-by: Brian White <[email protected]> Cr-Commit-Position: refs/heads/master@{#784292}
- Loading branch information
1 parent
0d3e446
commit 36a8065
Showing
36 changed files
with
943 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "media/base/decoder.h" | ||
|
||
namespace media { | ||
|
||
Decoder::Decoder() = default; | ||
|
||
Decoder::~Decoder() = default; | ||
|
||
bool Decoder::IsPlatformDecoder() const { | ||
return false; | ||
} | ||
|
||
bool Decoder::SupportsDecryption() const { | ||
return false; | ||
} | ||
|
||
} // namespace media |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef MEDIA_BASE_DECODER_H_ | ||
#define MEDIA_BASE_DECODER_H_ | ||
|
||
#include <string> | ||
|
||
#include "base/macros.h" | ||
#include "media/base/media_export.h" | ||
|
||
namespace media { | ||
|
||
class MEDIA_EXPORT Decoder { | ||
public: | ||
virtual ~Decoder(); | ||
|
||
// Returns true if the implementation is expected to be implemented by the | ||
// platform. The value should be available immediately after construction and | ||
// should not change within the lifetime of a decoder instance. | ||
virtual bool IsPlatformDecoder() const; | ||
|
||
// Returns true if the implementation supports decoding configs with | ||
// encryption. | ||
// TODO(crbug.com/1099488): Sometimes it's not possible to give a definitive | ||
// yes or no answer unless more context is given. While this doesn't pose any | ||
// problems, it does allow incompatible decoders to pass the filtering step in | ||
// |DecoderSelector| potentially slowing down the selection process. | ||
virtual bool SupportsDecryption() const; | ||
|
||
// Returns the name of the decoder for logging and decoder selection purposes. | ||
// This name should be available immediately after construction, and should | ||
// also be stable in the sense that the name does not change across multiple | ||
// constructions. | ||
virtual std::string GetDisplayName() const = 0; | ||
|
||
protected: | ||
Decoder(); | ||
}; | ||
|
||
} // namespace media | ||
|
||
#endif // MEDIA_BASE_DECODER_H_ |
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.