mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1161742 - Use lambdas for WaitForData. r=jww
This commit is contained in:
parent
55bc102e4c
commit
2d85ff9631
@ -934,11 +934,20 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
|
||||
if (aReason == MediaDecoderReader::WAITING_FOR_DATA) {
|
||||
MOZ_ASSERT(mReader->IsWaitForDataSupported(),
|
||||
"Readers that send WAITING_FOR_DATA need to implement WaitForData");
|
||||
nsRefPtr<MediaDecoderStateMachine> self = this;
|
||||
WaitRequestRef(aType).Begin(ProxyMediaCall(DecodeTaskQueue(), mReader.get(), __func__,
|
||||
&MediaDecoderReader::WaitForData, aType)
|
||||
->RefableThen(TaskQueue(), __func__, this,
|
||||
&MediaDecoderStateMachine::OnWaitForDataResolved,
|
||||
&MediaDecoderStateMachine::OnWaitForDataRejected));
|
||||
->RefableThen(TaskQueue(), __func__,
|
||||
[self] (MediaData::Type aType) -> void {
|
||||
ReentrantMonitorAutoEnter mon(self->mDecoder->GetReentrantMonitor());
|
||||
self->WaitRequestRef(aType).Complete();
|
||||
self->DispatchDecodeTasksIfNeeded();
|
||||
},
|
||||
[self] (WaitForDataRejectValue aRejection) -> void {
|
||||
ReentrantMonitorAutoEnter mon(self->mDecoder->GetReentrantMonitor());
|
||||
self->WaitRequestRef(aRejection.mType).Complete();
|
||||
}));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -430,19 +430,6 @@ public:
|
||||
void OnSeekCompleted(int64_t aTime);
|
||||
void OnSeekFailed(nsresult aResult);
|
||||
|
||||
void OnWaitForDataResolved(MediaData::Type aType)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
WaitRequestRef(aType).Complete();
|
||||
DispatchDecodeTasksIfNeeded();
|
||||
}
|
||||
|
||||
void OnWaitForDataRejected(WaitForDataRejectValue aRejection)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
WaitRequestRef(aRejection.mType).Complete();
|
||||
}
|
||||
|
||||
// Resets all state related to decoding and playback, emptying all buffers
|
||||
// and aborting all pending operations on the decode task queue.
|
||||
void Reset();
|
||||
|
Loading…
Reference in New Issue
Block a user