Merged from http://go/wvgerrit/44803. Upgrade HIDL service to v1.1 and implements new 1.1 media API. Test: Netflix and Play Movies & TV streaming and offline playback Test: GTS WidevineH264PlaybackTests test e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases --test com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P30 Test: GTS MediaDrmTest tests e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases --test com.google.android.media.gts.MediaDrmTest#testWidevineApi28 Test: unit tests bug: 69674645 Change-Id: I91e7e43f9178b61a531e846beffb5f5c17050a3c
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
//
|
|
// Copyright 2017 Google Inc. All Rights Reserved.
|
|
//
|
|
|
|
//#define LOG_NDEBUG 0
|
|
#define LOG_TAG "WVCdm"
|
|
#include <utils/Log.h>
|
|
|
|
#include "WVCryptoFactory.h"
|
|
#include "WVCDMSingleton.h"
|
|
#include "WVCryptoPlugin.h"
|
|
#include "WVUUID.h"
|
|
|
|
namespace wvdrm {
|
|
namespace hardware {
|
|
namespace drm {
|
|
namespace V1_1 {
|
|
namespace widevine {
|
|
|
|
using ::android::hardware::drm::V1_0::Status;
|
|
using ::android::hardware::Void;
|
|
|
|
Return<bool> WVCryptoFactory::isCryptoSchemeSupported(
|
|
const hidl_array<uint8_t, 16>& uuid) {
|
|
return isWidevineUUID(uuid.data());
|
|
}
|
|
|
|
Return<void> WVCryptoFactory::createPlugin(
|
|
const hidl_array<uint8_t, 16>& uuid,
|
|
const hidl_vec<uint8_t>& initData,
|
|
createPlugin_cb _hidl_cb) {
|
|
|
|
WVCryptoPlugin *plugin = NULL;
|
|
if (!isCryptoSchemeSupported(uuid.data())) {
|
|
ALOGE("Widevine Drm HAL: failed to create crypto plugin, " \
|
|
"invalid crypto scheme");
|
|
_hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, plugin);
|
|
return Void();
|
|
}
|
|
|
|
plugin = new WVCryptoPlugin(initData.data(), initData.size(), getCDM());
|
|
_hidl_cb(Status::OK, plugin);
|
|
return Void();
|
|
}
|
|
|
|
} // namespace widevine
|
|
} // namespace V1_1
|
|
} // namespace drm
|
|
} // namespace hardware
|
|
} // namespace wvdrm
|