mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Bug 904177 - Add media.omx.async.enabled preference. r=sotaro, r=cpearce
This commit is contained in:
parent
6fa2b606f3
commit
95530384be
@ -42,6 +42,10 @@
|
||||
#include "MediaOmxReader.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#if ANDROID_VERSION >= 16
|
||||
#include "MediaCodecDecoder.h"
|
||||
#include "MediaCodecReader.h"
|
||||
#endif
|
||||
#endif
|
||||
#ifdef NECKO_PROTOCOL_rtsp
|
||||
#include "RtspOmxDecoder.h"
|
||||
@ -537,7 +541,13 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
#if ANDROID_VERSION >= 16
|
||||
decoder = MediaDecoder::IsOmxAsyncEnabled()
|
||||
? static_cast<MediaDecoder*>(new MediaCodecDecoder())
|
||||
: static_cast<MediaDecoder*>(new MediaOmxDecoder());
|
||||
#else
|
||||
decoder = new MediaOmxDecoder();
|
||||
#endif
|
||||
return decoder.forget();
|
||||
}
|
||||
#endif
|
||||
@ -627,7 +637,13 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac
|
||||
#endif
|
||||
#ifdef MOZ_OMX_DECODER
|
||||
if (IsOmxSupportedType(aType)) {
|
||||
#if ANDROID_VERSION >= 16
|
||||
decoderReader = MediaDecoder::IsOmxAsyncEnabled()
|
||||
? static_cast<MediaDecoderReader*>(new MediaCodecReader(aDecoder))
|
||||
: static_cast<MediaDecoderReader*>(new MediaOmxReader(aDecoder));
|
||||
#else
|
||||
decoderReader = new MediaOmxReader(aDecoder);
|
||||
#endif
|
||||
} else
|
||||
#endif
|
||||
#ifdef MOZ_ANDROID_OMX
|
||||
|
@ -1717,6 +1717,16 @@ MediaDecoder::IsOmxEnabled()
|
||||
{
|
||||
return Preferences::GetBool("media.omx.enabled", false);
|
||||
}
|
||||
|
||||
bool
|
||||
MediaDecoder::IsOmxAsyncEnabled()
|
||||
{
|
||||
#if ANDROID_VERSION >= 16
|
||||
return Preferences::GetBool("media.omx.async.enabled", false);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_ANDROID_OMX
|
||||
|
1
content/media/MediaDecoder.h
Executable file → Normal file
1
content/media/MediaDecoder.h
Executable file → Normal file
@ -873,6 +873,7 @@ public:
|
||||
|
||||
#ifdef MOZ_OMX_DECODER
|
||||
static bool IsOmxEnabled();
|
||||
static bool IsOmxAsyncEnabled();
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_ANDROID_OMX
|
||||
|
@ -8,6 +8,7 @@ EXPORTS += [
|
||||
'IMediaResourceManagerClient.h',
|
||||
'IMediaResourceManagerDeathNotifier.h',
|
||||
'IMediaResourceManagerService.h',
|
||||
'MediaResourceHandler.h',
|
||||
'MediaResourceManagerClient.h',
|
||||
'MediaResourceManagerService.h',
|
||||
]
|
||||
|
@ -50,6 +50,7 @@ if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
|
||||
|
||||
if int(CONFIG['ANDROID_VERSION']) >= 16:
|
||||
EXPORTS += [
|
||||
'I420ColorConverterHelper.h',
|
||||
'MediaCodecDecoder.h',
|
||||
'MediaCodecProxy.h',
|
||||
'MediaCodecReader.h',
|
||||
|
Loading…
x
Reference in New Issue
Block a user