Backed out changeset cb9c0ddc2e22 (bug 1159495)

This commit is contained in:
Carsten "Tomcat" Book 2015-04-29 16:41:03 +02:00
parent 791767ce56
commit 30e97ddfc3
4 changed files with 10 additions and 40 deletions

View File

@ -5,9 +5,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/EMEUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsCOMPtr.h"
namespace mozilla {
@ -116,28 +113,4 @@ ParseKeySystem(const nsAString& aInputKeySystem,
return false;
}
bool
GetEMEVoucherPath(nsIFile** aPath)
{
nsCOMPtr<nsIFile> path;
NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(path));
if (!path) {
NS_WARNING("GetEMEVoucherPath can't get NS_GRE_DIR!");
return false;
}
path->AppendNative(NS_LITERAL_CSTRING("voucher.bin"));
path.forget(aPath);
return true;
}
bool
EMEVoucherFileExists()
{
nsCOMPtr<nsIFile> path;
bool exists;
return GetEMEVoucherPath(getter_AddRefs(path)) &&
NS_SUCCEEDED(path->Exists(&exists)) &&
exists;
}
} // namespace mozilla

View File

@ -64,10 +64,6 @@ bool ParseKeySystem(const nsAString& aKeySystem,
nsAString& aOutKeySystem,
int32_t& aOutMinCDMVersion);
bool GetEMEVoucherPath(nsIFile** aPath);
bool EMEVoucherFileExists();
} // namespace mozilla
#endif // EME_LOG_H_

View File

@ -160,11 +160,9 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
return MediaKeySystemStatus::Cdm_disabled;
}
if ((!WMFDecoderModule::HasH264() || !WMFDecoderModule::HasAAC()) ||
!EMEVoucherFileExists()) {
if (!WMFDecoderModule::HasH264() || !WMFDecoderModule::HasAAC()) {
// The system doesn't have the codecs that Adobe EME relies
// on installed, or doesn't have a voucher for the plugin-container.
// Adobe EME isn't going to work, so don't advertise that it will.
// on installed.
return MediaKeySystemStatus::Cdm_not_supported;
}
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, true);

View File

@ -5,7 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GMPProcessParent.h"
#include "mozilla/EMEUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "base/string_util.h"
#include "base/process_util.h"
@ -44,13 +45,15 @@ GMPProcessParent::~GMPProcessParent()
bool
GMPProcessParent::Launch(int32_t aTimeoutMs)
{
nsCOMPtr<nsIFile> path;
if (!GetEMEVoucherPath(getter_AddRefs(path))) {
NS_WARNING("GMPProcessParent can't get EME voucher path!");
nsCOMPtr<nsIFile> greDir;
NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greDir));
if (!greDir) {
NS_WARNING("GMPProcessParent can't get NS_GRE_DIR");
return false;
}
greDir->AppendNative(NS_LITERAL_CSTRING("voucher.bin"));
nsAutoCString voucherPath;
path->GetNativePath(voucherPath);
greDir->GetNativePath(voucherPath);
vector<string> args;
args.push_back(mGMPPath);