mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1157075: Part1. Rename and make AsyncReadMetadata virtual. r=bholley
This commit is contained in:
parent
9e25ffc9c1
commit
ba36ac0511
@ -179,13 +179,13 @@ MediaDecoderReader::ComputeStartTime(const VideoData* aVideo, const AudioData* a
|
||||
}
|
||||
|
||||
nsRefPtr<MediaDecoderReader::MetadataPromise>
|
||||
MediaDecoderReader::CallReadMetadata()
|
||||
MediaDecoderReader::AsyncReadMetadata()
|
||||
{
|
||||
typedef ReadMetadataFailureReason Reason;
|
||||
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
mDecoder->GetReentrantMonitor().AssertNotCurrentThreadIn();
|
||||
DECODER_LOG("MediaDecoderReader::CallReadMetadata");
|
||||
DECODER_LOG("MediaDecoderReader::AsyncReadMetadata");
|
||||
|
||||
// PreReadMetadata causes us to try to allocate various hardware and OS
|
||||
// resources, which may not be available at the moment.
|
||||
@ -198,8 +198,8 @@ MediaDecoderReader::CallReadMetadata()
|
||||
nsRefPtr<MetadataHolder> metadata = new MetadataHolder();
|
||||
nsresult rv = ReadMetadata(&metadata->mInfo, getter_Transfers(metadata->mTags));
|
||||
|
||||
// Reading metadata can cause us to discover that we need resources (like
|
||||
// encryption keys).
|
||||
// Reading metadata can cause us to discover that we need resources (a hardware
|
||||
// resource initialized but not yet ready for use).
|
||||
if (IsWaitingMediaResources()) {
|
||||
return MetadataPromise::CreateAndReject(Reason::WAITING_FOR_RESOURCES, __func__);
|
||||
}
|
||||
|
@ -167,10 +167,10 @@ public:
|
||||
virtual bool HasAudio() = 0;
|
||||
virtual bool HasVideo() = 0;
|
||||
|
||||
// The ReadMetadata API is unfortunately synchronous. We should fix that at
|
||||
// some point, but for now we can make things a bit better by using a
|
||||
// promise-y API on top of a synchronous call.
|
||||
nsRefPtr<MetadataPromise> CallReadMetadata();
|
||||
// The default implementation of AsyncReadMetadata is implemented in terms of
|
||||
// synchronous PreReadMetadata() / ReadMetadata() calls. Implementations may also
|
||||
// override AsyncReadMetadata to create a more proper async implementation.
|
||||
virtual nsRefPtr<MetadataPromise> AsyncReadMetadata();
|
||||
|
||||
// A function that is called before ReadMetadata() call.
|
||||
virtual void PreReadMetadata() {};
|
||||
|
@ -2615,9 +2615,9 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
|
||||
|
||||
case DECODER_STATE_DECODING_METADATA: {
|
||||
if (!mMetadataRequest.Exists()) {
|
||||
DECODER_LOG("Dispatching CallReadMetadata");
|
||||
DECODER_LOG("Dispatching AsyncReadMetadata");
|
||||
mMetadataRequest.Begin(ProxyMediaCall(DecodeTaskQueue(), mReader.get(), __func__,
|
||||
&MediaDecoderReader::CallReadMetadata)
|
||||
&MediaDecoderReader::AsyncReadMetadata)
|
||||
->RefableThen(TaskQueue(), __func__, this,
|
||||
&MediaDecoderStateMachine::OnMetadataRead,
|
||||
&MediaDecoderStateMachine::OnMetadataNotRead));
|
||||
|
Loading…
Reference in New Issue
Block a user