From bffa8c060d5f0054173f457bedc097c202ed3c60 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 30 Jan 2014 14:01:58 -0500 Subject: [PATCH] Backed out changeset 15a8086a2431 (bug 963621) for Android bustage. --- content/media/plugins/MPAPI.h | 1 - content/media/plugins/MediaPluginHost.cpp | 24 +--------------- media/omx-plugin/OmxPlugin.cpp | 34 +++++------------------ 3 files changed, 8 insertions(+), 51 deletions(-) diff --git a/content/media/plugins/MPAPI.h b/content/media/plugins/MPAPI.h index 8394e8ff5872..4ebe642989bb 100644 --- a/content/media/plugins/MPAPI.h +++ b/content/media/plugins/MPAPI.h @@ -135,7 +135,6 @@ struct PluginHost { void (*SetMetaDataReadMode)(Decoder *aDecoder); void (*SetPlaybackReadMode)(Decoder *aDecoder); bool (*GetIntPref)(const char *aPref, int32_t *aResult); - bool (*GetSystemInfoString)(const char *aKey, char *aResult, uint32_t aResultLen); }; struct Decoder { diff --git a/content/media/plugins/MediaPluginHost.cpp b/content/media/plugins/MediaPluginHost.cpp index 58b4ee61eeed..93d58b9268dc 100644 --- a/content/media/plugins/MediaPluginHost.cpp +++ b/content/media/plugins/MediaPluginHost.cpp @@ -67,34 +67,12 @@ static bool GetIntPref(const char* aPref, int32_t* aResult) return NS_SUCCEEDED(NS_DispatchToMainThread(event, NS_DISPATCH_SYNC)); } -static bool -GetSystemInfoString(const char *aKey, char *aResult, size_t aResultLength) -{ - NS_ENSURE_TRUE(aKey, false); - NS_ENSURE_TRUE(aResult, false); - - nsCOMPtr infoService = do_GetService("@mozilla.org/system-info;1"); - NS_ASSERTION(infoService, "Could not find a system info service"); - - nsAutoCString key(aKey); - nsAutoCString info; - nsresult rv = infoService->GetPropertyAsACString(NS_ConvertUTF8toUTF16(key), - info); - - NS_ENSURE_SUCCESS(rv, false); - - strncpy(aResult, info.get(), aResultLength); - - return true; -} - static PluginHost sPluginHost = { nullptr, nullptr, nullptr, nullptr, - GetIntPref, - GetSystemInfoString, + GetIntPref }; // Return true if Omx decoding is supported on the device. This checks the diff --git a/media/omx-plugin/OmxPlugin.cpp b/media/omx-plugin/OmxPlugin.cpp index 158d30fcd45e..0a907521b8ce 100644 --- a/media/omx-plugin/OmxPlugin.cpp +++ b/media/omx-plugin/OmxPlugin.cpp @@ -26,6 +26,12 @@ #define MAX_DECODER_NAME_LEN 256 #define AVC_MIME_TYPE "video/avc" +#if !defined(MOZ_ANDROID_FROYO) +#define DEFAULT_STAGEFRIGHT_FLAGS OMXCodec::kClientNeedsFramebuffer +#else +#define DEFAULT_STAGEFRIGHT_FLAGS 0 +#endif + #undef LOG #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "OmxPlugin" , ## args) @@ -204,32 +210,6 @@ static sp GetOMX() { } #endif -static uint32_t -GetDefaultStagefrightFlags(PluginHost *aPluginHost) -{ - uint32_t flags = 0; - -#if !defined(MOZ_ANDROID_FROYO) - - char hardware[256]; - aPluginHost->GetSystemInfoString("hardware", hardware, sizeof(hardware)); - - if (hardware && strcmp("qcom", hardware)) { - // Qualcomm's OMXCodec implementation interprets this flag to mean that we - // only want a thumbnail and therefore only need one frame. After the first - // frame it returns EOS. - // All other OMXCodec implementations seen so far interpret this flag - // sanely; some do not return full framebuffers unless this flag is passed. - flags |= OMXCodec::kClientNeedsFramebuffer; - } - - LOG("Hardware %s; using default flags %#x\n", hardware, flags); - -#endif - - return flags; -} - static uint32_t GetVideoCreationFlags(PluginHost* aPluginHost) { #ifdef MOZ_WIDGET_GONK @@ -256,7 +236,7 @@ static uint32_t GetVideoCreationFlags(PluginHost* aPluginHost) #endif } - flags |= GetDefaultStagefrightFlags(aPluginHost); + flags |= DEFAULT_STAGEFRIGHT_FLAGS; return static_cast(flags); #endif