Bug 1672072 - P3. Remove IRemoteDecoderChild.h class. r=mattwoodrow,padenot,mjf,bryce

There's no longer have a GpuDecoderModule and RemoteGpuDecoder.

So we no longer need the IRemoteDecoderChild abstraction layer.

Differential Revision: https://phabricator.services.mozilla.com/D96359
This commit is contained in:
Jean-Yves Avenard 2020-11-13 04:21:14 +00:00
Родитель 8c9109c7c6
Коммит 98c87940d6
8 изменённых файлов: 27 добавлений и 77 удалений

Просмотреть файл

@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef include_dom_media_ipc_IRemoteDecoderChild_h
#define include_dom_media_ipc_IRemoteDecoderChild_h
#include "PlatformDecoderModule.h"
#include "mozilla/TaskQueue.h"
namespace mozilla {
// This interface mirrors the MediaDataDecoder plus a bit (DestroyIPDL)
// to allow proxying to a remote decoder in RemoteDecoderModule or
// GpuDecoderModule. RemoteAudioDecoderChild, RemoteVideoDecoderChild,
// and VideoDecoderChild (for GPU) implement this interface.
class IRemoteDecoderChild {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(IRemoteDecoderChild);
virtual RefPtr<MediaDataDecoder::InitPromise> Init() = 0;
virtual RefPtr<MediaDataDecoder::DecodePromise> Decode(
const nsTArray<RefPtr<MediaRawData>>& aSamples) = 0;
virtual RefPtr<MediaDataDecoder::DecodePromise> Drain() = 0;
virtual RefPtr<MediaDataDecoder::FlushPromise> Flush() = 0;
virtual RefPtr<ShutdownPromise> Shutdown() = 0;
virtual bool IsHardwareAccelerated(nsACString& aFailureReason) const {
return false;
}
virtual nsCString GetDescriptionName() const = 0;
virtual void SetSeekThreshold(const media::TimeUnit& aTime) {}
virtual MediaDataDecoder::ConversionRequired NeedsConversion() const {
return MediaDataDecoder::ConversionRequired::kNeedNone;
}
virtual void DestroyIPDL() = 0;
protected:
virtual ~IRemoteDecoderChild() = default;
};
} // namespace mozilla
#endif // include_dom_media_ipc_IRemoteDecoderChild_h

Просмотреть файл

@ -19,6 +19,8 @@ RemoteDecoderChild::RemoteDecoderChild(bool aRecreatedOnCrash)
"Must be created on the manager thread");
}
RemoteDecoderChild::~RemoteDecoderChild() = default;
void RemoteDecoderChild::HandleRejectionError(
const ipc::ResponseRejectReason& aReason,
std::function<void(const MediaResult&)>&& aCallback) {

Просмотреть файл

@ -8,7 +8,6 @@
#include <functional>
#include "IRemoteDecoderChild.h"
#include "mozilla/PRemoteDecoderChild.h"
#include "mozilla/ShmemRecycleAllocator.h"
@ -19,27 +18,29 @@ using mozilla::MediaDataDecoder;
using mozilla::ipc::IPCResult;
class RemoteDecoderChild : public ShmemRecycleAllocator<RemoteDecoderChild>,
public PRemoteDecoderChild,
public IRemoteDecoderChild {
public PRemoteDecoderChild {
friend class PRemoteDecoderChild;
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RemoteDecoderChild);
explicit RemoteDecoderChild(bool aRecreatedOnCrash = false);
void ActorDestroy(ActorDestroyReason aWhy) override;
// IRemoteDecoderChild
RefPtr<MediaDataDecoder::InitPromise> Init() override;
// This interface closely mirrors the MediaDataDecoder plus a bit
// (DestroyIPDL) to allow proxying to a remote decoder in RemoteDecoderModule.
RefPtr<MediaDataDecoder::InitPromise> Init();
RefPtr<MediaDataDecoder::DecodePromise> Decode(
const nsTArray<RefPtr<MediaRawData>>& aSamples) override;
RefPtr<MediaDataDecoder::DecodePromise> Drain() override;
RefPtr<MediaDataDecoder::FlushPromise> Flush() override;
RefPtr<mozilla::ShutdownPromise> Shutdown() override;
bool IsHardwareAccelerated(nsACString& aFailureReason) const override;
nsCString GetDescriptionName() const override;
void SetSeekThreshold(const media::TimeUnit& aTime) override;
MediaDataDecoder::ConversionRequired NeedsConversion() const override;
void DestroyIPDL() override;
const nsTArray<RefPtr<MediaRawData>>& aSamples);
RefPtr<MediaDataDecoder::DecodePromise> Drain();
RefPtr<MediaDataDecoder::FlushPromise> Flush();
RefPtr<mozilla::ShutdownPromise> Shutdown();
bool IsHardwareAccelerated(nsACString& aFailureReason) const;
nsCString GetDescriptionName() const;
void SetSeekThreshold(const media::TimeUnit& aTime);
MediaDataDecoder::ConversionRequired NeedsConversion() const;
void DestroyIPDL();
// Called from IPDL when our actor has been destroyed
void IPDLActorDestroyed();
@ -47,7 +48,7 @@ class RemoteDecoderChild : public ShmemRecycleAllocator<RemoteDecoderChild>,
RemoteDecoderManagerChild* GetManager();
protected:
virtual ~RemoteDecoderChild() = default;
virtual ~RemoteDecoderChild();
void AssertOnManagerThread() const;
virtual MediaResult ProcessOutput(DecodedOutputIPDL&& aDecodedData) = 0;

Просмотреть файл

@ -6,7 +6,6 @@
#include "RemoteDecoderManagerChild.h"
#include "RemoteAudioDecoder.h"
#include "RemoteDecoderChild.h"
#include "RemoteMediaDataDecoder.h"
#include "RemoteVideoDecoder.h"
#include "VideoUtils.h"
@ -70,10 +69,10 @@ void RemoteDecoderManagerChild::Init() {
auto remoteDecoderManagerThread = sRemoteDecoderManagerChildThread.Lock();
if (!*remoteDecoderManagerThread) {
// We can't use a MediaThreadType::CONTROLLER as the GpuDecoderModule and
// RemoteDecoderModule runs on it and dispatch synchronous tasks to the
// manager thread, should more than 4 concurrent videos being instantiated
// at the same time, we could end up in a deadlock.
// We can't use a MediaThreadType::SUPERVISOR as the RemoteDecoderModule
// runs on it and dispatch synchronous tasks to the manager thread, should
// more than 4 concurrent videos being instantiated at the same time, we
// could end up in a deadlock.
RefPtr<nsIThread> childThread;
nsresult rv = NS_NewNamedThread(
"RemVidChild", getter_AddRefs(childThread),

Просмотреть файл

@ -5,14 +5,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "RemoteMediaDataDecoder.h"
#include "base/thread.h"
#include "IRemoteDecoderChild.h"
#include "RemoteDecoderChild.h"
#include "RemoteDecoderManagerChild.h"
namespace mozilla {
RemoteMediaDataDecoder::RemoteMediaDataDecoder(IRemoteDecoderChild* aChild)
RemoteMediaDataDecoder::RemoteMediaDataDecoder(RemoteDecoderChild* aChild)
: mChild(aChild) {}
RemoteMediaDataDecoder::~RemoteMediaDataDecoder() {

Просмотреть файл

@ -11,8 +11,7 @@
namespace mozilla {
class GpuDecoderModule;
class IRemoteDecoderChild;
class RemoteDecoderChild;
class RemoteDecoderManagerChild;
class RemoteMediaDataDecoder;
@ -27,7 +26,6 @@ class RemoteMediaDataDecoder
: public MediaDataDecoder,
public DecoderDoctorLifeLogger<RemoteMediaDataDecoder> {
public:
friend class GpuDecoderModule;
friend class RemoteDecoderManagerChild;
// MediaDataDecoder
@ -45,13 +43,13 @@ class RemoteMediaDataDecoder
ConversionRequired NeedsConversion() const override;
private:
explicit RemoteMediaDataDecoder(IRemoteDecoderChild* aChild);
explicit RemoteMediaDataDecoder(RemoteDecoderChild* aChild);
~RemoteMediaDataDecoder();
// Only ever written to from the reader task queue (during the constructor and
// destructor when we can guarantee no other threads are accessing it). Only
// read from the manager thread.
RefPtr<IRemoteDecoderChild> mChild;
RefPtr<RemoteDecoderChild> mChild;
// Only ever written/modified during decoder initialisation.
// As such can be accessed from any threads after that.
nsCString mDescription = "RemoteMediaDataDecoder"_ns;

Просмотреть файл

@ -13,7 +13,6 @@ IPDL_SOURCES += [
]
EXPORTS.mozilla += [
"IRemoteDecoderChild.h",
"RDDChild.h",
"RDDParent.h",
"RDDProcessHost.h",

Просмотреть файл

@ -34,7 +34,6 @@ namespace layers {
class ImageContainer;
} // namespace layers
class GpuDecoderModule;
class MediaDataDecoder;
class RemoteDecoderModule;
class CDMProxy;
@ -275,7 +274,6 @@ class PlatformDecoderModule {
friend class MediaChangeMonitor;
friend class PDMFactory;
friend class GpuDecoderModule;
friend class EMEDecoderModule;
friend class RemoteDecoderModule;