зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1145926: Part2. Make SDM::Recreate re-use original arguments. r=cpearce
This commit is contained in:
Родитель
c74f6b186a
Коммит
3daebe5323
|
@ -603,7 +603,7 @@ MP4Reader::DisableHardwareAcceleration()
|
|||
mSharedDecoderManager->DisableHardwareAcceleration();
|
||||
|
||||
const VideoDecoderConfig& video = mDemuxer->VideoConfig();
|
||||
if (!mSharedDecoderManager->Recreate(video, mLayersBackendType, mDecoder->GetImageContainer())) {
|
||||
if (!mSharedDecoderManager->Recreate(video)) {
|
||||
MonitorAutoLock mon(mVideo.mMonitor);
|
||||
mVideo.mError = true;
|
||||
if (mVideo.HasPromise()) {
|
||||
|
|
|
@ -83,6 +83,8 @@ SharedDecoderManager::CreateVideoDecoder(
|
|||
MediaDataDecoderCallback* aCallback)
|
||||
{
|
||||
if (!mDecoder) {
|
||||
mLayersBackend = aLayersBackend;
|
||||
mImageContainer = aImageContainer;
|
||||
// We use the manager's task queue for the decoder, rather than the one
|
||||
// passed in, so that none of the objects sharing the decoder can shutdown
|
||||
// the task queue while we're potentially still using it for a *different*
|
||||
|
@ -91,8 +93,8 @@ SharedDecoderManager::CreateVideoDecoder(
|
|||
aPDM->CreateDecoder(aConfig,
|
||||
mTaskQueue,
|
||||
mCallback,
|
||||
aLayersBackend,
|
||||
aImageContainer);
|
||||
mLayersBackend,
|
||||
mImageContainer);
|
||||
if (!mDecoder) {
|
||||
mPDM = nullptr;
|
||||
return nullptr;
|
||||
|
@ -114,17 +116,15 @@ SharedDecoderManager::DisableHardwareAcceleration()
|
|||
}
|
||||
|
||||
bool
|
||||
SharedDecoderManager::Recreate(const mp4_demuxer::VideoDecoderConfig& aConfig,
|
||||
layers::LayersBackend aLayersBackend,
|
||||
layers::ImageContainer* aImageContainer)
|
||||
SharedDecoderManager::Recreate(const mp4_demuxer::VideoDecoderConfig& aConfig)
|
||||
{
|
||||
mDecoder->Flush();
|
||||
mDecoder->Shutdown();
|
||||
mDecoder = mPDM->CreateDecoder(aConfig,
|
||||
mTaskQueue,
|
||||
mCallback,
|
||||
aLayersBackend,
|
||||
aImageContainer);
|
||||
mLayersBackend,
|
||||
mImageContainer);
|
||||
if (!mDecoder) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -42,9 +42,7 @@ public:
|
|||
friend class SharedDecoderCallback;
|
||||
|
||||
void DisableHardwareAcceleration();
|
||||
bool Recreate(const mp4_demuxer::VideoDecoderConfig& aConfig,
|
||||
layers::LayersBackend aLayersBackend,
|
||||
layers::ImageContainer* aImageContainer);
|
||||
bool Recreate(const mp4_demuxer::VideoDecoderConfig& aConfig);
|
||||
|
||||
private:
|
||||
virtual ~SharedDecoderManager();
|
||||
|
@ -52,6 +50,8 @@ private:
|
|||
|
||||
nsRefPtr<PlatformDecoderModule> mPDM;
|
||||
nsRefPtr<MediaDataDecoder> mDecoder;
|
||||
layers::LayersBackend mLayersBackend;
|
||||
nsRefPtr<layers::ImageContainer> mImageContainer;
|
||||
nsRefPtr<FlushableMediaTaskQueue> mTaskQueue;
|
||||
SharedDecoderProxy* mActiveProxy;
|
||||
MediaDataDecoderCallback* mActiveCallback;
|
||||
|
|
Загрузка…
Ссылка в новой задаче