Bug 834172 - Don't export codec functions from DecoderTraits. r=cpearce

All codec-specific code is hidden within DecoderTraits and available
from generic interfaces. This patch removes the codec-specific
functions from DecoderTraits' public interface.
This commit is contained in:
Thomas Zimmermann 2013-03-04 10:24:45 -05:00
parent 81df5828a7
commit 21980a8156
2 changed files with 20 additions and 60 deletions

View File

@ -76,9 +76,8 @@ static const char* gRawCodecs[1] = {
nullptr
};
/* static */
bool
DecoderTraits::IsRawType(const nsACString& aType)
static bool
IsRawType(const nsACString& aType)
{
if (!MediaDecoder::IsRawEnabled()) {
return false;
@ -111,8 +110,8 @@ static char const *const gOggCodecsWithOpus[4] = {
nullptr
};
bool
DecoderTraits::IsOggType(const nsACString& aType)
static bool
IsOggType(const nsACString& aType)
{
if (!MediaDecoder::IsOggEnabled()) {
return false;
@ -139,8 +138,8 @@ static char const *const gWaveCodecs[2] = {
nullptr
};
bool
DecoderTraits::IsWaveType(const nsACString& aType)
static bool
IsWaveType(const nsACString& aType)
{
if (!MediaDecoder::IsWaveEnabled()) {
return false;
@ -164,8 +163,8 @@ static char const *const gWebMCodecs[4] = {
nullptr
};
bool
DecoderTraits::IsWebMType(const nsACString& aType)
static bool
IsWebMType(const nsACString& aType)
{
if (!MediaDecoder::IsWebMEnabled()) {
return false;
@ -183,8 +182,8 @@ static const char* const gH264Types[4] = {
nullptr
};
bool
DecoderTraits::IsGStreamerSupportedType(const nsACString& aMimeType)
static bool
IsGStreamerSupportedType(const nsACString& aMimeType)
{
if (!MediaDecoder::IsGStreamerEnabled())
return false;
@ -203,8 +202,8 @@ DecoderTraits::IsGStreamerSupportedType(const nsACString& aMimeType)
return false;
}
bool
DecoderTraits::IsH264Type(const nsACString& aType)
static bool
IsH264Type(const nsACString& aType)
{
return CodecListContains(gH264Types, aType);
}
@ -220,8 +219,8 @@ static const char* const gOmxTypes[6] = {
nullptr
};
bool
DecoderTraits::IsOmxSupportedType(const nsACString& aType)
static bool
IsOmxSupportedType(const nsACString& aType)
{
if (!MediaDecoder::IsOmxEnabled()) {
return false;
@ -246,8 +245,8 @@ static char const *const gH264Codecs[9] = {
#endif
#ifdef MOZ_MEDIA_PLUGINS
bool
DecoderTraits::IsMediaPluginsType(const nsACString& aType)
static bool
IsMediaPluginsType(const nsACString& aType)
{
if (!MediaDecoder::IsMediaPluginsEnabled()) {
return false;
@ -267,9 +266,8 @@ static const char* const gDASHMPDTypes[2] = {
nullptr
};
/* static */
bool
DecoderTraits::IsDASHMPDType(const nsACString& aType)
static bool
IsDASHMPDType(const nsACString& aType)
{
if (!MediaDecoder::IsDASHEnabled()) {
return false;
@ -280,7 +278,8 @@ DecoderTraits::IsDASHMPDType(const nsACString& aType)
#endif
#ifdef MOZ_WMF
bool DecoderTraits::IsWMFSupportedType(const nsACString& aType)
static bool
IsWMFSupportedType(const nsACString& aType)
{
return WMFDecoder::GetSupportedCodecs(aType, nullptr);
}

View File

@ -41,45 +41,6 @@ public:
// false here even if CanHandleMediaType would return true.
static bool ShouldHandleMediaType(const char* aMIMEType);
#ifdef MOZ_RAW
static bool IsRawType(const nsACString& aType);
#endif
#ifdef MOZ_OGG
static bool IsOggType(const nsACString& aType);
#endif
#ifdef MOZ_WAVE
static bool IsWaveType(const nsACString& aType);
#endif
#ifdef MOZ_WEBM
static bool IsWebMType(const nsACString& aType);
#endif
#ifdef MOZ_GSTREAMER
// When enabled, use GStreamer for H.264, but not for codecs handled by our
// bundled decoders, unless the "media.prefer-gstreamer" pref is set.
static bool IsGStreamerSupportedType(const nsACString& aType);
static bool IsH264Type(const nsACString& aType);
#endif
#ifdef MOZ_WIDGET_GONK
static bool IsOmxSupportedType(const nsACString& aType);
#endif
#ifdef MOZ_MEDIA_PLUGINS
static bool IsMediaPluginsType(const nsACString& aType);
#endif
#ifdef MOZ_DASH
static bool IsDASHMPDType(const nsACString& aType);
#endif
#ifdef MOZ_WMF
static bool IsWMFSupportedType(const nsACString& aType);
#endif
// Create a decoder for the given aType. Returns null if we
// were unable to create the decoder.
static already_AddRefed<MediaDecoder> CreateDecoder(const nsACString& aType,