mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1113527 - Change isDormantNeeded() behavior. r=sotaro. r=cpearce.
From 8bf5259ba58ae5b37eaceece04a7f217c3ad4284 Mon Sep 17 00:00:00 2001
This commit is contained in:
parent
1248c3e7ef
commit
3f18c2cc36
@ -247,12 +247,6 @@ GonkMediaDataDecoder::IsWaitingMediaResources() {
|
||||
return mDecoder->IsWaitingResources();
|
||||
}
|
||||
|
||||
bool
|
||||
GonkMediaDataDecoder::IsDormantNeeded()
|
||||
{
|
||||
return mDecoder.get() ? true : false;
|
||||
}
|
||||
|
||||
void
|
||||
GonkMediaDataDecoder::AllocateMediaResources()
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
|
||||
virtual bool IsWaitingMediaResources() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsDormantNeeded() MOZ_OVERRIDE;
|
||||
virtual bool IsDormantNeeded() { return true;}
|
||||
|
||||
virtual void AllocateMediaResources() MOZ_OVERRIDE;
|
||||
|
||||
|
@ -656,6 +656,9 @@ void GonkVideoDecoderManager::ReleaseAllPendingVideoBuffers()
|
||||
|
||||
void GonkVideoDecoderManager::ReleaseMediaResources() {
|
||||
GVDM_LOG("ReleseMediaResources");
|
||||
if (mDecoder == nullptr) {
|
||||
return;
|
||||
}
|
||||
ReleaseAllPendingVideoBuffers();
|
||||
mDecoder->ReleaseMediaResources();
|
||||
}
|
||||
|
@ -327,12 +327,6 @@ MediaCodecReader::UpdateIsWaitingMediaResources()
|
||||
(!mVideoTrack.mCodec->allocated());
|
||||
}
|
||||
|
||||
bool
|
||||
MediaCodecReader::IsDormantNeeded()
|
||||
{
|
||||
return mVideoTrack.mSource != nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
MediaCodecReader::ReleaseMediaResources()
|
||||
{
|
||||
@ -1263,7 +1257,8 @@ MediaCodecReader::CreateMediaSources()
|
||||
mAudioOffloadTrack.mSource = mExtractor->getTrack(audioTrackIndex);
|
||||
}
|
||||
|
||||
if (videoTrackIndex != invalidTrackIndex && mVideoTrack.mSource == nullptr) {
|
||||
if (videoTrackIndex != invalidTrackIndex && mVideoTrack.mSource == nullptr &&
|
||||
mDecoder->GetImageContainer()) {
|
||||
sp<MediaSource> videoSource = mExtractor->getTrack(videoTrackIndex);
|
||||
if (videoSource != nullptr && videoSource->start() == OK) {
|
||||
mVideoTrack.mSource = videoSource;
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
virtual bool IsWaitingMediaResources();
|
||||
|
||||
// True when this reader need to become dormant state
|
||||
virtual bool IsDormantNeeded();
|
||||
virtual bool IsDormantNeeded() { return true;}
|
||||
|
||||
// Release media resources they should be released in dormant state
|
||||
virtual void ReleaseMediaResources();
|
||||
|
@ -207,14 +207,6 @@ void MediaOmxReader::UpdateIsWaitingMediaResources()
|
||||
}
|
||||
}
|
||||
|
||||
bool MediaOmxReader::IsDormantNeeded()
|
||||
{
|
||||
if (!mOmxDecoder.get()) {
|
||||
return false;
|
||||
}
|
||||
return mOmxDecoder->IsDormantNeeded();
|
||||
}
|
||||
|
||||
void MediaOmxReader::ReleaseMediaResources()
|
||||
{
|
||||
ResetDecode();
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
// Return mIsWaitingResources.
|
||||
virtual bool IsWaitingMediaResources() MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsDormantNeeded();
|
||||
virtual bool IsDormantNeeded() { return true;}
|
||||
virtual void ReleaseMediaResources();
|
||||
|
||||
virtual void PreReadMetadata() MOZ_OVERRIDE;
|
||||
|
@ -150,7 +150,7 @@ bool OmxDecoder::Init(sp<MediaExtractor>& extractor) {
|
||||
|
||||
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
|
||||
|
||||
if (videoTrackIndex != -1) {
|
||||
if (videoTrackIndex != -1 && mDecoder->GetImageContainer()) {
|
||||
mVideoTrack = extractor->getTrack(videoTrackIndex);
|
||||
}
|
||||
|
||||
@ -219,14 +219,6 @@ bool OmxDecoder::EnsureMetadata() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OmxDecoder::IsDormantNeeded()
|
||||
{
|
||||
if (mVideoTrack.get()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OmxDecoder::IsWaitingMediaResources()
|
||||
{
|
||||
if (mVideoSource.get()) {
|
||||
|
@ -154,8 +154,6 @@ public:
|
||||
// Note: RTSP requires a custom extractor because it doesn't have a container.
|
||||
bool Init(sp<MediaExtractor>& extractor);
|
||||
|
||||
bool IsDormantNeeded();
|
||||
|
||||
// Called after resources(video/audio codec) are allocated, set the
|
||||
// mDurationUs and video/audio metadata.
|
||||
bool EnsureMetadata();
|
||||
|
Loading…
Reference in New Issue
Block a user