зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1300677 - Implement SetSeekThreshold for RemoteVideoDecoder. r=dvander
This commit is contained in:
Родитель
50bff87cb2
Коммит
8ea736c85f
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче