зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1181204 - Prevent use of the decoder outside the reader's taskqueue. r=cpearce
This fix a potential race when the decoder could be shutting down on the reader's taskqueue while the MediaDecoderStateMachine thread attempts to read it. --HG-- extra : amend_source : d8a7ac55539c22f69d965299010a20b34c8a4c58 extra : transplant_source : %F6%D2z%A2%40%D1%CE%8BX%FB%9E%CA%2B%ABa%7D%F9%7Fl%BF
This commit is contained in:
Родитель
6ac7016595
Коммит
5d0c759bca
|
@ -1024,6 +1024,10 @@ MediaFormatReader::Update(TrackType aTrack)
|
||||||
needOutput = true;
|
needOutput = true;
|
||||||
if (!decoder.mOutput.IsEmpty()) {
|
if (!decoder.mOutput.IsEmpty()) {
|
||||||
// We have a decoded sample ready to be returned.
|
// We have a decoded sample ready to be returned.
|
||||||
|
if (aTrack == TrackType::kVideoTrack) {
|
||||||
|
mVideo.mIsHardwareAccelerated =
|
||||||
|
mVideo.mDecoder && mVideo.mDecoder->IsHardwareAccelerated();
|
||||||
|
}
|
||||||
nsRefPtr<MediaData> output = decoder.mOutput[0];
|
nsRefPtr<MediaData> output = decoder.mOutput[0];
|
||||||
decoder.mOutput.RemoveElementAt(0);
|
decoder.mOutput.RemoveElementAt(0);
|
||||||
decoder.mSizeOfQueue -= 1;
|
decoder.mSizeOfQueue -= 1;
|
||||||
|
@ -1504,7 +1508,7 @@ MediaFormatReader::SetSharedDecoderManager(SharedDecoderManager* aManager)
|
||||||
bool
|
bool
|
||||||
MediaFormatReader::VideoIsHardwareAccelerated() const
|
MediaFormatReader::VideoIsHardwareAccelerated() const
|
||||||
{
|
{
|
||||||
return mVideo.mDecoder && mVideo.mDecoder->IsHardwareAccelerated();
|
return mVideo.mIsHardwareAccelerated;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -203,6 +203,7 @@ private:
|
||||||
, mNumSamplesInput(0)
|
, mNumSamplesInput(0)
|
||||||
, mNumSamplesOutput(0)
|
, mNumSamplesOutput(0)
|
||||||
, mSizeOfQueue(0)
|
, mSizeOfQueue(0)
|
||||||
|
, mIsHardwareAccelerated(false)
|
||||||
, mLastStreamSourceID(UINT32_MAX)
|
, mLastStreamSourceID(UINT32_MAX)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -294,6 +295,9 @@ private:
|
||||||
|
|
||||||
// Used by the MDSM for logging purposes.
|
// Used by the MDSM for logging purposes.
|
||||||
Atomic<size_t> mSizeOfQueue;
|
Atomic<size_t> mSizeOfQueue;
|
||||||
|
// Used by the MDSM to determine if video decoding is hardware accelerated.
|
||||||
|
// This value is updated after a frame is successfully decoded.
|
||||||
|
Atomic<bool> mIsHardwareAccelerated;
|
||||||
// Sample format monitoring.
|
// Sample format monitoring.
|
||||||
uint32_t mLastStreamSourceID;
|
uint32_t mLastStreamSourceID;
|
||||||
Maybe<uint32_t> mNextStreamSourceID;
|
Maybe<uint32_t> mNextStreamSourceID;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче