Bug 1300677 - Implement SetSeekThreshold for RemoteVideoDecoder. r=dvander

This commit is contained in:
Matt Woodrow 2016-10-03 21:20:54 +13:00
Родитель 50bff87cb2
Коммит 8ea736c85f
7 изменённых файлов: 35 добавлений и 0 удалений

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

@ -54,6 +54,8 @@ parent:
async Drain();
async Shutdown();
async SetSeekThreshold(int64_t time);
async __delete__();
child:

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

@ -102,6 +102,19 @@ RemoteVideoDecoder::Shutdown()
}), NS_DISPATCH_NORMAL);
}
void
RemoteVideoDecoder::SetSeekThreshold(const media::TimeUnit& aTime)
{
MOZ_ASSERT(mCallback->OnReaderTaskQueue());
RefPtr<RemoteVideoDecoder> self = this;
media::TimeUnit time = aTime;
VideoDecoderManagerChild::GetManagerThread()->Dispatch(NS_NewRunnableFunction([=]() {
MOZ_ASSERT(self->mActor);
self->mActor->SetSeekThreshold(time);
}), NS_DISPATCH_NORMAL);
}
nsresult
RemoteDecoderModule::Startup()
{

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

@ -32,6 +32,7 @@ public:
void Flush() override;
void Drain() override;
void Shutdown() override;
void SetSeekThreshold(const media::TimeUnit& aTime) override;
const char* GetDescriptionName() const override { return "RemoteVideoDecoder"; }

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

@ -209,6 +209,15 @@ VideoDecoderChild::Shutdown()
mInitialized = false;
}
void
VideoDecoderChild::SetSeekThreshold(const media::TimeUnit& aTime)
{
AssertOnManagerThread();
if (!mCanSend || !SendSetSeekThreshold(aTime.ToMicroseconds())) {
mCallback->Error(NS_ERROR_DOM_MEDIA_FATAL_ERR);
}
}
void
VideoDecoderChild::AssertOnManagerThread()
{

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

@ -39,6 +39,7 @@ public:
void Flush();
void Drain();
void Shutdown();
void SetSeekThreshold(const media::TimeUnit& aTime);
MOZ_IS_CLASS_INIT
void InitIPDL(MediaDataDecoderCallback* aCallback,

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

@ -135,6 +135,14 @@ VideoDecoderParent::RecvShutdown()
return true;
}
bool
VideoDecoderParent::RecvSetSeekThreshold(const int64_t& aTime)
{
MOZ_ASSERT(!mDestroyed);
mDecoder->SetSeekThreshold(media::TimeUnit::FromMicroseconds(aTime));
return true;
}
void
VideoDecoderParent::ActorDestroy(ActorDestroyReason aWhy)
{

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

@ -35,6 +35,7 @@ public:
bool RecvFlush() override;
bool RecvDrain() override;
bool RecvShutdown() override;
bool RecvSetSeekThreshold(const int64_t& aTime) override;
void ActorDestroy(ActorDestroyReason aWhy) override;