blob: 726bf971857799bec962ef99b613f881ae3637a5 [file] [log] [blame]
Jeff Tinkerb075caa2016-12-06 23:15:20 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Jeff Tinkerda002fe2017-01-19 14:41:11 -080016#ifndef ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H
17#define ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H
Jeff Tinkerb075caa2016-12-06 23:15:20 -080018
Jeff Tinkerda002fe2017-01-19 14:41:11 -080019#include <android/hardware/drm/1.0/IDrmFactory.h>
Jeff Tinkerb075caa2016-12-06 23:15:20 -080020#include <hidl/Status.h>
21#include <media/drm/DrmAPI.h>
Jiyong Park07770c72017-06-19 22:06:41 +090022#include <PluginLoader.h>
Jeff Tinkerb075caa2016-12-06 23:15:20 -080023#include <media/SharedLibrary.h>
24
25namespace android {
26namespace hardware {
27namespace drm {
Jeff Tinkerb075caa2016-12-06 23:15:20 -080028namespace V1_0 {
29namespace implementation {
30
Jiyong Park07770c72017-06-19 22:06:41 +090031using ::android::hardware::drm::V1_0::helper::PluginLoader;
Jeff Tinkerda002fe2017-01-19 14:41:11 -080032using ::android::hardware::drm::V1_0::IDrmFactory;
33using ::android::hardware::drm::V1_0::IDrmPlugin;
Jeff Tinkerb075caa2016-12-06 23:15:20 -080034using ::android::hardware::hidl_array;
35using ::android::hardware::hidl_string;
36using ::android::hardware::hidl_vec;
37using ::android::hardware::Return;
38using ::android::hardware::Void;
39using ::android::sp;
40
41struct DrmFactory : public IDrmFactory {
42 DrmFactory();
43 virtual ~DrmFactory() {}
44
Jeff Tinkerda002fe2017-01-19 14:41:11 -080045 // Methods from ::android::hardware::drm::V1_0::IDrmFactory follow.
Jeff Tinker9a33bb22017-02-14 21:04:31 +000046
Jeff Tinkerb075caa2016-12-06 23:15:20 -080047 Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
48 override;
49
Jeff Tinker9a33bb22017-02-14 21:04:31 +000050 Return<bool> isContentTypeSupported(const hidl_string &mimeType)
Jeff Tinkerb3a16722016-12-30 19:03:17 -080051 override;
52
Jeff Tinkerb075caa2016-12-06 23:15:20 -080053 Return<void> createPlugin(const hidl_array<uint8_t, 16>& uuid,
Jeff Tinker45548ea2017-01-25 11:46:52 -080054 const hidl_string& appPackageName, createPlugin_cb _hidl_cb) override;
55
Jeff Tinkerb075caa2016-12-06 23:15:20 -080056private:
Jiyong Park07770c72017-06-19 22:06:41 +090057 PluginLoader<android::DrmFactory> loader;
Jeff Tinkerb075caa2016-12-06 23:15:20 -080058
59 DrmFactory(const DrmFactory &) = delete;
60 void operator=(const DrmFactory &) = delete;
61};
62
63extern "C" IDrmFactory* HIDL_FETCH_IDrmFactory(const char* name);
64
65} // namespace implementation
66} // namespace V1_0
67} // namespace drm
Jeff Tinkerb075caa2016-12-06 23:15:20 -080068} // namespace hardware
69} // namespace android
70
Jeff Tinkerda002fe2017-01-19 14:41:11 -080071#endif // ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H