2016-09-21 12:25:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
|
|
|
/* 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/. */
|
|
|
|
#include "VideoDecoderChild.h"
|
|
|
|
#include "VideoDecoderManagerChild.h"
|
|
|
|
#include "mozilla/layers/TextureClient.h"
|
2017-08-29 10:51:22 +03:00
|
|
|
#include "mozilla/Telemetry.h"
|
2016-09-21 12:25:41 +03:00
|
|
|
#include "base/thread.h"
|
|
|
|
#include "MediaInfo.h"
|
|
|
|
#include "ImageContainer.h"
|
|
|
|
#include "GPUVideoImage.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
using base::Thread;
|
|
|
|
using namespace ipc;
|
|
|
|
using namespace layers;
|
|
|
|
using namespace gfx;
|
|
|
|
|
2017-08-29 10:51:22 +03:00
|
|
|
#ifdef XP_WIN
|
2017-09-03 22:28:52 +03:00
|
|
|
static void
|
|
|
|
ReportUnblacklistingTelemetry(bool isGPUProcessCrashed,
|
|
|
|
const nsCString& aD3D11BlacklistedDriver,
|
|
|
|
const nsCString& aD3D9BlacklistedDriver)
|
|
|
|
{
|
|
|
|
const nsCString& blacklistedDLL = !aD3D11BlacklistedDriver.IsEmpty()
|
|
|
|
? aD3D11BlacklistedDriver
|
|
|
|
: aD3D9BlacklistedDriver;
|
|
|
|
|
|
|
|
if (!blacklistedDLL.IsEmpty()) {
|
|
|
|
Telemetry::Accumulate(Telemetry::VIDEO_UNBLACKINGLISTING_DXVA_DRIVER_RUNTIME_STATUS,
|
|
|
|
blacklistedDLL,
|
|
|
|
isGPUProcessCrashed ? 1 : 0);
|
|
|
|
}
|
|
|
|
}
|
2017-08-29 10:51:22 +03:00
|
|
|
#endif // XP_WIN
|
|
|
|
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::VideoDecoderChild()
|
|
|
|
: mThread(VideoDecoderManagerChild::GetManagerThread())
|
2016-11-02 23:55:07 +03:00
|
|
|
, mCanSend(false)
|
2016-10-03 11:20:35 +03:00
|
|
|
, mInitialized(false)
|
2016-10-03 11:21:07 +03:00
|
|
|
, mIsHardwareAccelerated(false)
|
2017-02-18 00:19:55 +03:00
|
|
|
, mConversion(MediaDataDecoder::ConversionRequired::kNeedNone)
|
2017-01-26 15:56:46 +03:00
|
|
|
, mNeedNewDecoder(false)
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
VideoDecoderChild::~VideoDecoderChild()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
|
|
|
mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::RecvOutput(const VideoDataIPDL& aData)
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
|
|
|
|
|
|
|
// The Image here creates a TextureData object that takes ownership
|
|
|
|
// of the SurfaceDescriptor, and is responsible for making sure that
|
|
|
|
// it gets deallocated.
|
2017-02-17 05:01:25 +03:00
|
|
|
RefPtr<Image> image = new GPUVideoImage(GetManager(), aData.sd(), aData.frameSize());
|
2016-09-21 12:25:41 +03:00
|
|
|
|
2017-04-12 12:46:09 +03:00
|
|
|
RefPtr<VideoData> video = VideoData::CreateFromImage(
|
|
|
|
aData.display(),
|
|
|
|
aData.base().offset(),
|
2017-04-24 12:33:05 +03:00
|
|
|
media::TimeUnit::FromMicroseconds(aData.base().time()),
|
2017-04-12 12:46:09 +03:00
|
|
|
media::TimeUnit::FromMicroseconds(aData.base().duration()),
|
|
|
|
image,
|
|
|
|
aData.base().keyframe(),
|
2017-04-24 12:33:05 +03:00
|
|
|
media::TimeUnit::FromMicroseconds(aData.base().timecode()));
|
2017-04-12 12:46:09 +03:00
|
|
|
|
2017-01-26 15:56:46 +03:00
|
|
|
mDecodedData.AppendElement(Move(video));
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::RecvInputExhausted()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
mDecodePromise.ResolveIfExists(mDecodedData, __func__);
|
|
|
|
mDecodedData.Clear();
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::RecvDrainComplete()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
mDrainPromise.ResolveIfExists(mDecodedData, __func__);
|
|
|
|
mDecodedData.Clear();
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::RecvError(const nsresult& aError)
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
mDecodedData.Clear();
|
|
|
|
mDecodePromise.RejectIfExists(aError, __func__);
|
|
|
|
mDrainPromise.RejectIfExists(aError, __func__);
|
|
|
|
mFlushPromise.RejectIfExists(aError, __func__);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2017-09-01 19:22:55 +03:00
|
|
|
VideoDecoderChild::RecvInitComplete(const nsCString& aDecoderDescription,
|
|
|
|
const bool& aHardware,
|
2017-02-18 00:19:55 +03:00
|
|
|
const nsCString& aHardwareReason,
|
|
|
|
const uint32_t& aConversion)
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2016-11-22 11:47:00 +03:00
|
|
|
mInitPromise.ResolveIfExists(TrackInfo::kVideoTrack, __func__);
|
2016-10-03 11:20:35 +03:00
|
|
|
mInitialized = true;
|
2017-09-01 19:22:55 +03:00
|
|
|
mDescription = aDecoderDescription;
|
2016-10-03 11:21:07 +03:00
|
|
|
mIsHardwareAccelerated = aHardware;
|
|
|
|
mHardwareAcceleratedReason = aHardwareReason;
|
2017-02-18 00:19:55 +03:00
|
|
|
mConversion = static_cast<MediaDataDecoder::ConversionRequired>(aConversion);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::RecvInitFailed(const nsresult& aReason)
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2016-11-22 11:47:00 +03:00
|
|
|
mInitPromise.RejectIfExists(aReason, __func__);
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-11-22 05:50:46 +03:00
|
|
|
mozilla::ipc::IPCResult
|
|
|
|
VideoDecoderChild::RecvFlushComplete()
|
|
|
|
{
|
2017-01-26 15:56:46 +03:00
|
|
|
AssertOnManagerThread();
|
|
|
|
mFlushPromise.ResolveIfExists(true, __func__);
|
2016-11-22 05:50:46 +03:00
|
|
|
return IPC_OK();
|
|
|
|
}
|
|
|
|
|
2016-09-21 12:25:41 +03:00
|
|
|
void
|
|
|
|
VideoDecoderChild::ActorDestroy(ActorDestroyReason aWhy)
|
|
|
|
{
|
2016-10-03 11:20:35 +03:00
|
|
|
if (aWhy == AbnormalShutdown) {
|
2017-08-31 12:21:28 +03:00
|
|
|
// GPU process crashed, record the time and send back to MFR for telemetry.
|
|
|
|
mGPUCrashTime = TimeStamp::Now();
|
|
|
|
|
2016-11-08 05:21:35 +03:00
|
|
|
// Defer reporting an error until we've recreated the manager so that
|
|
|
|
// it'll be safe for MediaFormatReader to recreate decoders
|
|
|
|
RefPtr<VideoDecoderChild> ref = this;
|
2017-06-12 22:34:10 +03:00
|
|
|
GetManager()->RunWhenRecreated(
|
|
|
|
NS_NewRunnableFunction("dom::VideoDecoderChild::ActorDestroy", [=]() {
|
2017-09-03 22:28:52 +03:00
|
|
|
MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
|
2017-08-31 12:21:28 +03:00
|
|
|
error.SetGPUCrashTimeStamp(ref->mGPUCrashTime);
|
2017-06-12 22:34:10 +03:00
|
|
|
if (ref->mInitialized) {
|
|
|
|
mDecodedData.Clear();
|
2017-08-31 12:21:28 +03:00
|
|
|
mDecodePromise.RejectIfExists(error, __func__);
|
|
|
|
mDrainPromise.RejectIfExists(error, __func__);
|
|
|
|
mFlushPromise.RejectIfExists(error, __func__);
|
2017-06-12 22:34:10 +03:00
|
|
|
// Make sure the next request will be rejected accordingly if ever
|
|
|
|
// called.
|
|
|
|
mNeedNewDecoder = true;
|
|
|
|
} else {
|
2017-08-31 12:21:28 +03:00
|
|
|
ref->mInitPromise.RejectIfExists(error, __func__);
|
2017-06-12 22:34:10 +03:00
|
|
|
}
|
|
|
|
}));
|
2016-10-03 11:20:35 +03:00
|
|
|
}
|
2016-09-21 12:25:41 +03:00
|
|
|
mCanSend = false;
|
2017-08-29 10:51:22 +03:00
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
ReportUnblacklistingTelemetry(aWhy == AbnormalShutdown,
|
|
|
|
mBlacklistedD3D11Driver,
|
|
|
|
mBlacklistedD3D9Driver);
|
|
|
|
#endif // XP_WIN
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2017-09-13 10:37:24 +03:00
|
|
|
MediaResult
|
2017-01-26 15:56:46 +03:00
|
|
|
VideoDecoderChild::InitIPDL(const VideoInfo& aVideoInfo,
|
2017-09-12 19:29:40 +03:00
|
|
|
float aFramerate,
|
2016-11-13 04:19:02 +03:00
|
|
|
const layers::TextureFactoryIdentifier& aIdentifier)
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
2017-01-26 15:56:46 +03:00
|
|
|
RefPtr<VideoDecoderManagerChild> manager =
|
|
|
|
VideoDecoderManagerChild::GetSingleton();
|
2017-08-14 13:03:12 +03:00
|
|
|
|
|
|
|
// The manager isn't available because VideoDecoderManagerChild has been
|
|
|
|
// initialized with null end points and we don't want to decode video on GPU
|
|
|
|
// process anymore. Return false here so that we can fallback to other PDMs.
|
2017-09-03 22:28:52 +03:00
|
|
|
if (!manager) {
|
2017-09-13 10:37:24 +03:00
|
|
|
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
|
|
|
RESULT_DETAIL("VideoDecoderManager is not available."));
|
2017-08-14 13:03:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// The manager doesn't support sending messages because we've just crashed
|
|
|
|
// and are working on reinitialization. Don't initialize mIPDLSelfRef and
|
2017-01-26 15:56:46 +03:00
|
|
|
// leave us in an error state. We'll then immediately reject the promise when
|
|
|
|
// Init() is called and the caller can try again. Hopefully by then the new
|
|
|
|
// manager is ready, or we've notified the caller of it being no longer
|
|
|
|
// available. If not, then the cycle repeats until we're ready.
|
2017-08-14 13:03:12 +03:00
|
|
|
if (!manager->CanSend()) {
|
2017-09-13 10:37:24 +03:00
|
|
|
return NS_OK;
|
2016-11-02 23:55:07 +03:00
|
|
|
}
|
2016-11-08 05:21:35 +03:00
|
|
|
|
2016-09-21 12:25:41 +03:00
|
|
|
mIPDLSelfRef = this;
|
2016-11-22 05:44:38 +03:00
|
|
|
bool success = false;
|
2017-09-13 10:37:24 +03:00
|
|
|
nsCString errorDescription;
|
2017-09-12 19:29:40 +03:00
|
|
|
if (manager->SendPVideoDecoderConstructor(this,
|
|
|
|
aVideoInfo,
|
|
|
|
aFramerate,
|
|
|
|
aIdentifier,
|
2017-08-29 10:19:05 +03:00
|
|
|
&success,
|
|
|
|
&mBlacklistedD3D11Driver,
|
2017-09-13 10:37:24 +03:00
|
|
|
&mBlacklistedD3D9Driver,
|
|
|
|
&errorDescription)) {
|
2016-11-02 23:55:07 +03:00
|
|
|
mCanSend = true;
|
|
|
|
}
|
2017-09-13 10:37:24 +03:00
|
|
|
|
|
|
|
return success ? MediaResult(NS_OK) :
|
|
|
|
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, errorDescription);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VideoDecoderChild::DestroyIPDL()
|
|
|
|
{
|
|
|
|
if (mCanSend) {
|
|
|
|
PVideoDecoderChild::Send__delete__(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VideoDecoderChild::IPDLActorDestroyed()
|
|
|
|
{
|
|
|
|
mIPDLSelfRef = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
// MediaDataDecoder methods
|
|
|
|
|
|
|
|
RefPtr<MediaDataDecoder::InitPromise>
|
|
|
|
VideoDecoderChild::Init()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2016-11-08 05:21:35 +03:00
|
|
|
|
|
|
|
if (!mIPDLSelfRef) {
|
2016-09-21 12:25:41 +03:00
|
|
|
return MediaDataDecoder::InitPromise::CreateAndReject(
|
2016-11-08 05:21:35 +03:00
|
|
|
NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__);
|
|
|
|
}
|
|
|
|
// If we failed to send this, then we'll still resolve the Init promise
|
|
|
|
// as ActorDestroy handles it.
|
|
|
|
if (mCanSend) {
|
2016-11-22 05:44:38 +03:00
|
|
|
SendInit();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
return mInitPromise.Ensure(__func__);
|
|
|
|
}
|
|
|
|
|
2017-01-26 15:56:46 +03:00
|
|
|
RefPtr<MediaDataDecoder::DecodePromise>
|
|
|
|
VideoDecoderChild::Decode(MediaRawData* aSample)
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
|
|
|
|
if (mNeedNewDecoder) {
|
2017-09-03 22:28:52 +03:00
|
|
|
MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
|
2017-08-31 12:21:28 +03:00
|
|
|
error.SetGPUCrashTimeStamp(mGPUCrashTime);
|
|
|
|
return MediaDataDecoder::DecodePromise::CreateAndReject(error, __func__);
|
2017-01-26 15:56:46 +03:00
|
|
|
}
|
2016-09-21 12:25:41 +03:00
|
|
|
if (!mCanSend) {
|
2017-01-26 15:56:46 +03:00
|
|
|
// We're here if the IPC channel has died but we're still waiting for the
|
|
|
|
// RunWhenRecreated task to complete. The decode promise will be rejected
|
|
|
|
// when that task is run.
|
|
|
|
return mDecodePromise.Ensure(__func__);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: It would be nice to add an allocator method to
|
|
|
|
// MediaDataDecoder so that the demuxer could write directly
|
|
|
|
// into shmem rather than requiring a copy here.
|
|
|
|
Shmem buffer;
|
|
|
|
if (!AllocShmem(aSample->Size(), Shmem::SharedMemory::TYPE_BASIC, &buffer)) {
|
2017-01-26 15:56:46 +03:00
|
|
|
return MediaDataDecoder::DecodePromise::CreateAndReject(
|
|
|
|
NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(buffer.get<uint8_t>(), aSample->Data(), aSample->Size());
|
|
|
|
|
|
|
|
MediaRawDataIPDL sample(MediaDataIPDL(aSample->mOffset,
|
2017-04-14 12:13:36 +03:00
|
|
|
aSample->mTime.ToMicroseconds(),
|
2017-04-14 09:52:14 +03:00
|
|
|
aSample->mTimecode.ToMicroseconds(),
|
2017-04-12 12:27:34 +03:00
|
|
|
aSample->mDuration.ToMicroseconds(),
|
2016-09-21 12:25:41 +03:00
|
|
|
aSample->mFrames,
|
|
|
|
aSample->mKeyframe),
|
|
|
|
buffer);
|
2016-11-08 05:21:35 +03:00
|
|
|
SendInput(sample);
|
2017-01-26 15:56:46 +03:00
|
|
|
return mDecodePromise.Ensure(__func__);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2017-01-26 15:56:46 +03:00
|
|
|
RefPtr<MediaDataDecoder::FlushPromise>
|
|
|
|
VideoDecoderChild::Flush()
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
|
|
|
mDrainPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
|
|
|
if (mNeedNewDecoder) {
|
2017-09-03 22:28:52 +03:00
|
|
|
MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
|
2017-08-31 12:21:28 +03:00
|
|
|
error.SetGPUCrashTimeStamp(mGPUCrashTime);
|
|
|
|
return MediaDataDecoder::FlushPromise::CreateAndReject(error, __func__);
|
2017-01-26 15:56:46 +03:00
|
|
|
}
|
2016-11-08 05:21:35 +03:00
|
|
|
if (mCanSend) {
|
|
|
|
SendFlush();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
2017-01-26 15:56:46 +03:00
|
|
|
return mFlushPromise.Ensure(__func__);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2017-01-26 15:56:46 +03:00
|
|
|
RefPtr<MediaDataDecoder::DecodePromise>
|
2016-09-21 12:25:41 +03:00
|
|
|
VideoDecoderChild::Drain()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2017-01-26 15:56:46 +03:00
|
|
|
if (mNeedNewDecoder) {
|
2017-09-03 22:28:52 +03:00
|
|
|
MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
|
2017-08-31 12:21:28 +03:00
|
|
|
error.SetGPUCrashTimeStamp(mGPUCrashTime);
|
|
|
|
return MediaDataDecoder::DecodePromise::CreateAndReject(error, __func__);
|
2017-01-26 15:56:46 +03:00
|
|
|
}
|
2016-11-08 05:21:35 +03:00
|
|
|
if (mCanSend) {
|
|
|
|
SendDrain();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
2017-01-26 15:56:46 +03:00
|
|
|
return mDrainPromise.Ensure(__func__);
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
VideoDecoderChild::Shutdown()
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2016-11-13 06:09:35 +03:00
|
|
|
mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
2016-11-08 05:21:35 +03:00
|
|
|
if (mCanSend) {
|
|
|
|
SendShutdown();
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
2016-10-03 11:20:35 +03:00
|
|
|
mInitialized = false;
|
2016-09-21 12:25:41 +03:00
|
|
|
}
|
|
|
|
|
2016-10-03 11:21:07 +03:00
|
|
|
bool
|
|
|
|
VideoDecoderChild::IsHardwareAccelerated(nsACString& aFailureReason) const
|
|
|
|
{
|
2017-09-01 23:51:20 +03:00
|
|
|
AssertOnManagerThread();
|
2016-10-03 11:21:07 +03:00
|
|
|
aFailureReason = mHardwareAcceleratedReason;
|
|
|
|
return mIsHardwareAccelerated;
|
|
|
|
}
|
|
|
|
|
2017-09-01 19:22:55 +03:00
|
|
|
nsCString
|
|
|
|
VideoDecoderChild::GetDescriptionName() const
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
|
|
|
return mDescription;
|
|
|
|
}
|
|
|
|
|
2016-10-03 11:20:54 +03:00
|
|
|
void
|
|
|
|
VideoDecoderChild::SetSeekThreshold(const media::TimeUnit& aTime)
|
|
|
|
{
|
|
|
|
AssertOnManagerThread();
|
2016-11-08 05:21:35 +03:00
|
|
|
if (mCanSend) {
|
|
|
|
SendSetSeekThreshold(aTime.ToMicroseconds());
|
2016-10-03 11:20:54 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-18 00:19:55 +03:00
|
|
|
MediaDataDecoder::ConversionRequired
|
|
|
|
VideoDecoderChild::NeedsConversion() const
|
|
|
|
{
|
2017-09-01 23:51:20 +03:00
|
|
|
AssertOnManagerThread();
|
2017-02-18 00:19:55 +03:00
|
|
|
return mConversion;
|
|
|
|
}
|
|
|
|
|
2016-09-21 12:25:41 +03:00
|
|
|
void
|
2017-02-18 00:19:55 +03:00
|
|
|
VideoDecoderChild::AssertOnManagerThread() const
|
2016-09-21 12:25:41 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(NS_GetCurrentThread() == mThread);
|
|
|
|
}
|
|
|
|
|
2016-11-02 23:55:07 +03:00
|
|
|
VideoDecoderManagerChild*
|
|
|
|
VideoDecoderChild::GetManager()
|
|
|
|
{
|
|
|
|
if (!mCanSend) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return static_cast<VideoDecoderManagerChild*>(Manager());
|
|
|
|
}
|
|
|
|
|
2016-09-21 12:25:41 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|