зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1313497 - Use InvokeAsync with Storages in MediaDecoderReaderWrapper - r=jya
Thanks to this, MediaDecoderReader::Seek and overrides can take SeekTarget by const&. MozReview-Commit-ID: C5D26jKrW3p --HG-- extra : rebase_source : 6f6278654ff3c51f6331cbf683c22622223a8cd2
This commit is contained in:
Родитель
038cba7f2e
Коммит
f2a26506fb
|
@ -164,7 +164,7 @@ public:
|
|||
// Moves the decode head to aTime microseconds. aEndTime denotes the end
|
||||
// time of the media in usecs. This is only needed for OggReader, and should
|
||||
// probably be removed somehow.
|
||||
virtual RefPtr<SeekPromise> Seek(SeekTarget aTarget, int64_t aEndTime) = 0;
|
||||
virtual RefPtr<SeekPromise> Seek(const SeekTarget& aTarget, int64_t aEndTime) = 0;
|
||||
|
||||
virtual void SetCDMProxy(CDMProxy* aProxy) {}
|
||||
|
||||
|
|
|
@ -122,13 +122,16 @@ MediaDecoderReaderWrapper::IsWaitingVideoData() const
|
|||
}
|
||||
|
||||
RefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaDecoderReaderWrapper::Seek(SeekTarget aTarget, media::TimeUnit aEndTime)
|
||||
MediaDecoderReaderWrapper::Seek(const SeekTarget& aTarget,
|
||||
const media::TimeUnit& aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
|
||||
aTarget.SetTime(aTarget.GetTime() + StartTime());
|
||||
return InvokeAsync(mReader->OwnerThread(), mReader.get(), __func__,
|
||||
&MediaDecoderReader::Seek, aTarget,
|
||||
aEndTime.ToMicroseconds());
|
||||
SeekTarget adjustedTarget = aTarget;
|
||||
adjustedTarget.SetTime(adjustedTarget.GetTime() + StartTime());
|
||||
return InvokeAsync<SeekTarget&&, int64_t>(
|
||||
mReader->OwnerThread(), mReader.get(), __func__,
|
||||
&MediaDecoderReader::Seek,
|
||||
Move(adjustedTarget), aEndTime.ToMicroseconds());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -68,7 +68,8 @@ public:
|
|||
bool IsWaitingAudioData() const;
|
||||
bool IsWaitingVideoData() const;
|
||||
|
||||
RefPtr<SeekPromise> Seek(SeekTarget aTarget, media::TimeUnit aEndTime);
|
||||
RefPtr<SeekPromise> Seek(const SeekTarget& aTarget,
|
||||
const media::TimeUnit& aEndTime);
|
||||
RefPtr<BufferedUpdatePromise> UpdateBufferedWithPromise();
|
||||
RefPtr<ShutdownPromise> Shutdown();
|
||||
|
||||
|
|
|
@ -1928,7 +1928,7 @@ MediaFormatReader::OnVideoSkipFailed(MediaTrackDemuxer::SkipFailureHolder aFailu
|
|||
}
|
||||
|
||||
RefPtr<MediaDecoderReader::SeekPromise>
|
||||
MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused)
|
||||
MediaFormatReader::Seek(const SeekTarget& aTarget, int64_t aUnused)
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
|
@ -1950,7 +1950,7 @@ MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused)
|
|||
return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
SetSeekTarget(Move(aTarget));
|
||||
SetSeekTarget(aTarget);
|
||||
|
||||
RefPtr<SeekPromise> p = mSeekPromise.Ensure(__func__);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
void ReadUpdatedMetadata(MediaInfo* aInfo) override;
|
||||
|
||||
RefPtr<SeekPromise>
|
||||
Seek(SeekTarget aTarget, int64_t aUnused) override;
|
||||
Seek(const SeekTarget& aTarget, int64_t aUnused) override;
|
||||
|
||||
protected:
|
||||
void NotifyDataArrivedInternal() override;
|
||||
|
|
|
@ -314,7 +314,7 @@ bool AndroidMediaReader::DecodeAudioData()
|
|||
}
|
||||
|
||||
RefPtr<MediaDecoderReader::SeekPromise>
|
||||
AndroidMediaReader::Seek(SeekTarget aTarget, int64_t aEndTime)
|
||||
AndroidMediaReader::Seek(const SeekTarget& aTarget, int64_t aEndTime)
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override;
|
||||
|
||||
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override;
|
||||
RefPtr<SeekPromise> Seek(SeekTarget aTarget, int64_t aEndTime) override;
|
||||
RefPtr<SeekPromise> Seek(const SeekTarget& aTarget, int64_t aEndTime) override;
|
||||
|
||||
RefPtr<ShutdownPromise> Shutdown() override;
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip,
|
|||
}
|
||||
|
||||
RefPtr<MediaDecoderReader::SeekPromise>
|
||||
DirectShowReader::Seek(SeekTarget aTarget, int64_t aEndTime)
|
||||
DirectShowReader::Seek(const SeekTarget& aTarget, int64_t aEndTime)
|
||||
{
|
||||
nsresult res = SeekInternal(aTarget.GetTime().ToMicroseconds());
|
||||
if (NS_FAILED(res)) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
MetadataTags** aTags) override;
|
||||
|
||||
RefPtr<SeekPromise>
|
||||
Seek(SeekTarget aTarget, int64_t aEndTime) override;
|
||||
Seek(const SeekTarget& aTarget, int64_t aEndTime) override;
|
||||
|
||||
static const GUID CLSID_MPEG_LAYER_3_DECODER_FILTER;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче