Implement Widevine drm HIDL HAL service.
Modify Android mediadrm and mediacrypto glue layer to use HIDL interface. Test: Play Movies (streaming and offline playback) Test: ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases Test: adb shell /system/bin/libwvdrmengine_hidl_test Test: adb shell /system/bin/libwvdrmmediacrypto_hidl_test Test: adb shell /system/bin/libwvdrmdrmplugin_hidl_test bug: 34628973 Change-Id: Icd5f2dd556acb9874697963b4d7d62cb7c943e74
This commit is contained in:
committed by
John W. Bruce
parent
a4506542df
commit
2dc53442e7
50
libwvdrmengine/src_hidl/WVCryptoFactory.cpp
Normal file
50
libwvdrmengine/src_hidl/WVCryptoFactory.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// 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_0 {
|
||||
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_0
|
||||
} // namespace drm
|
||||
} // namespace hardware
|
||||
} // namespace wvdrm
|
||||
Reference in New Issue
Block a user