зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1259366 - Flush after eos of android::MediaCodec r=jolin
This commit is contained in:
Родитель
f09c1cb32e
Коммит
505c880bbe
|
@ -253,4 +253,13 @@ GonkAudioDecoderManager::ProcessFlush()
|
|||
GonkDecoderManager::ProcessFlush();
|
||||
}
|
||||
|
||||
void
|
||||
GonkAudioDecoderManager::ResetEOS()
|
||||
{
|
||||
GADM_LOG("ResetEOS(<<<");
|
||||
mAudioQueue.Reset();
|
||||
GADM_LOG(">>>ResetEOS(");
|
||||
GonkDecoderManager::ResetEOS();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
RefPtr<MediaData>& aOutput) override;
|
||||
|
||||
void ProcessFlush() override;
|
||||
virtual void ResetEOS() override;
|
||||
|
||||
const char* GetDescriptionName() const override
|
||||
{
|
||||
|
|
|
@ -248,6 +248,7 @@ GonkDecoderManager::ProcessToDo(bool aEndOfStream)
|
|||
MOZ_ASSERT(mWaitOutput.Length() == 1);
|
||||
mWaitOutput.RemoveElementAt(0);
|
||||
mDecodeCallback->DrainComplete();
|
||||
ResetEOS();
|
||||
return;
|
||||
} else if (rv == NS_ERROR_NOT_AVAILABLE) {
|
||||
break;
|
||||
|
@ -273,6 +274,17 @@ GonkDecoderManager::ProcessToDo(bool aEndOfStream)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
GonkDecoderManager::ResetEOS()
|
||||
{
|
||||
// After eos, android::MediaCodec needs to be flushed to receive next input
|
||||
mWaitOutput.Clear();
|
||||
if (mDecoder->flush() != OK) {
|
||||
GMDD_LOG("flush error");
|
||||
mDecodeCallback->Error();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GonkDecoderManager::onMessageReceived(const sp<AMessage> &aMessage)
|
||||
{
|
||||
|
|
|
@ -77,6 +77,7 @@ protected:
|
|||
void ProcessInput(bool aEndOfStream);
|
||||
virtual void ProcessFlush();
|
||||
void ProcessToDo(bool aEndOfStream);
|
||||
virtual void ResetEOS();
|
||||
|
||||
RefPtr<MediaByteBuffer> mCodecSpecificData;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче