DrmEngineBase.cpp revision 3473846f64f5b28e1cbeb70ef5867073fc93159e
1/*
2 * Copyright (C) 2010 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 */
16
17#include "DrmEngineBase.h"
18
19using namespace android;
20
21DrmEngineBase::DrmEngineBase() {
22
23}
24
25DrmEngineBase::~DrmEngineBase() {
26
27}
28
29DrmConstraints* DrmEngineBase::getConstraints(
30    int uniqueId, const String8* path, int action) {
31    return onGetConstraints(uniqueId, path, action);
32}
33
34DrmMetadata* DrmEngineBase::getMetadata(int uniqueId, const String8* path) {
35    return onGetMetadata(uniqueId, path);
36}
37
38status_t DrmEngineBase::initialize(int uniqueId) {
39    return onInitialize(uniqueId);
40}
41
42status_t DrmEngineBase::setOnInfoListener(
43    int uniqueId, const IDrmEngine::OnInfoListener* infoListener) {
44    return onSetOnInfoListener(uniqueId, infoListener);
45}
46
47status_t DrmEngineBase::terminate(int uniqueId) {
48    return onTerminate(uniqueId);
49}
50
51bool DrmEngineBase::canHandle(int uniqueId, const String8& path) {
52    return onCanHandle(uniqueId, path);
53}
54
55DrmInfoStatus* DrmEngineBase::processDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
56    return onProcessDrmInfo(uniqueId, drmInfo);
57}
58
59status_t DrmEngineBase::saveRights(
60            int uniqueId, const DrmRights& drmRights,
61            const String8& rightsPath, const String8& contentPath) {
62    return onSaveRights(uniqueId, drmRights, rightsPath, contentPath);
63}
64
65DrmInfo* DrmEngineBase::acquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
66    return onAcquireDrmInfo(uniqueId, drmInfoRequest);
67}
68
69String8 DrmEngineBase::getOriginalMimeType(int uniqueId, const String8& path) {
70    return onGetOriginalMimeType(uniqueId, path);
71}
72
73int DrmEngineBase::getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType) {
74    return onGetDrmObjectType(uniqueId, path, mimeType);
75}
76
77int DrmEngineBase::checkRightsStatus(int uniqueId, const String8& path, int action) {
78    return onCheckRightsStatus(uniqueId, path, action);
79}
80
81status_t DrmEngineBase::consumeRights(
82    int uniqueId, DecryptHandle* decryptHandle, int action, bool reserve) {
83    return onConsumeRights(uniqueId, decryptHandle, action, reserve);
84}
85
86status_t DrmEngineBase::setPlaybackStatus(
87    int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int position) {
88    return onSetPlaybackStatus(uniqueId, decryptHandle, playbackStatus, position);
89}
90
91bool DrmEngineBase::validateAction(
92    int uniqueId, const String8& path,
93    int action, const ActionDescription& description) {
94    return onValidateAction(uniqueId, path, action, description);
95}
96
97status_t DrmEngineBase::removeRights(int uniqueId, const String8& path) {
98    return onRemoveRights(uniqueId, path);
99}
100
101status_t DrmEngineBase::removeAllRights(int uniqueId) {
102    return onRemoveAllRights(uniqueId);
103}
104
105status_t DrmEngineBase::openConvertSession(int uniqueId, int convertId) {
106    return onOpenConvertSession(uniqueId, convertId);
107}
108
109DrmConvertedStatus* DrmEngineBase::convertData(
110    int uniqueId, int convertId, const DrmBuffer* inputData) {
111    return onConvertData(uniqueId, convertId, inputData);
112}
113
114DrmConvertedStatus* DrmEngineBase::closeConvertSession(int uniqueId, int convertId) {
115    return onCloseConvertSession(uniqueId, convertId);
116}
117
118DrmSupportInfo* DrmEngineBase::getSupportInfo(int uniqueId) {
119    return onGetSupportInfo(uniqueId);
120}
121
122status_t DrmEngineBase::openDecryptSession(
123    int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length) {
124    return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length);
125}
126
127status_t DrmEngineBase::openDecryptSession(
128    int uniqueId, DecryptHandle* decryptHandle, const char* uri) {
129    return onOpenDecryptSession(uniqueId, decryptHandle, uri);
130}
131
132status_t DrmEngineBase::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
133    return onCloseDecryptSession(uniqueId, decryptHandle);
134}
135
136status_t DrmEngineBase::initializeDecryptUnit(
137    int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo) {
138    return onInitializeDecryptUnit(uniqueId, decryptHandle, decryptUnitId, headerInfo);
139}
140
141status_t DrmEngineBase::decrypt(
142    int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId,
143    const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
144    return onDecrypt(uniqueId, decryptHandle, decryptUnitId, encBuffer, decBuffer, IV);
145}
146
147status_t DrmEngineBase::finalizeDecryptUnit(
148    int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
149    return onFinalizeDecryptUnit(uniqueId, decryptHandle, decryptUnitId);
150}
151
152ssize_t DrmEngineBase::pread(
153    int uniqueId, DecryptHandle* decryptHandle, void* buffer, ssize_t numBytes, off_t offset) {
154    return onPread(uniqueId, decryptHandle, buffer, numBytes, offset);
155}
156
157