Backed out changeset 15a8086a2431 (bug 963621) for Android bustage.

This commit is contained in:
Ryan VanderMeulen 2014-01-30 14:01:58 -05:00
Родитель 4aed403139
Коммит bffa8c060d
3 изменённых файлов: 8 добавлений и 51 удалений

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<nsIPropertyBag2> 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

Просмотреть файл

@ -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<IOMX> 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<uint32_t>(flags);
#endif