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
48
libwvdrmengine/src_hidl/service.cpp
Normal file
48
libwvdrmengine/src_hidl/service.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#define LOG_TAG "android.hardware.drm@1.0-service.widevine"
|
||||
|
||||
#include <WVCryptoFactory.h>
|
||||
#include <WVDrmFactory.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
|
||||
using ::android::hardware::configureRpcThreadpool;
|
||||
using ::android::hardware::joinRpcThreadpool;
|
||||
using ::android::sp;
|
||||
|
||||
using android::hardware::drm::V1_0::ICryptoFactory;
|
||||
using android::hardware::drm::V1_0::IDrmFactory;
|
||||
using wvdrm::hardware::drm::V1_0::widevine::WVCryptoFactory;
|
||||
using wvdrm::hardware::drm::V1_0::widevine::WVDrmFactory;
|
||||
|
||||
int main(int /* argc */, char** /* argv */) {
|
||||
ALOGD("android.hardware.drm@1.0-service.widevine starting...");
|
||||
|
||||
sp<IDrmFactory> drmFactory = new WVDrmFactory;
|
||||
sp<ICryptoFactory> cryptoFactory = new WVCryptoFactory;
|
||||
|
||||
configureRpcThreadpool(8, true /* callerWillJoin */);
|
||||
|
||||
// Setup hwbinder service
|
||||
CHECK_EQ(drmFactory->registerAsService("widevine"), android::NO_ERROR)
|
||||
<< "Failed to register Widevine Factory HAL";
|
||||
CHECK_EQ(cryptoFactory->registerAsService("widevine"), android::NO_ERROR)
|
||||
<< "Failed to register Widevine Crypto HAL";
|
||||
|
||||
joinRpcThreadpool();
|
||||
}
|
||||
Reference in New Issue
Block a user