Move all Widevine code which have dependency on vendor modules from framework/base to vendor/widevine

Change-Id: I2b43e90c279391436f1bbb18ebd64961bec4f9ee
This commit is contained in:
Gloria Wang
2011-02-18 22:51:13 -08:00
parent 1c53769dc1
commit 0f9922ff77
32 changed files with 2376 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2011 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.
*/
#ifndef ANDROID_HOOKS_H
#define ANDROID_HOOKS_H
typedef void (*AndroidEcmCallout)(char* ecm, unsigned long size);
void AndroidSetEcmCallout(AndroidEcmCallout callout);
void AndroidProcessEcm(char* ecm, unsigned long size);
typedef int (*AndroidDecryptCallout)(char *in, char *out, int length, char *iv);
void AndroidSetDecryptCallout(AndroidDecryptCallout callout);
int AndroidDecrypt(char *in, char *out, int length, char *iv);
bool AndroidHaveKey();
typedef void (*AndroidLogCallout)(const char *msg);
void AndroidSetLogCallout(AndroidLogCallout callout);
void AndroidLogDebug(const char *msg);
#endif // ANDROID_HOOKS_H

View File

@@ -0,0 +1,66 @@
/*
* Copyright (C) 2011 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.
*/
#ifndef __WVMDRMPLUGIN_API_H__
#define __WVMDRMPLUGIN_API_H__
#include <string>
#include "WVStreamControlAPI.h"
class WVDRMPluginAPI {
public:
virtual ~WVDRMPluginAPI() {}
enum {
RIGHTS_VALID,
RIGHTS_INVALID,
RIGHTS_EXPIRED,
RIGHTS_NOT_ACQUIRED
};
enum {
PLAYBACK_START,
PLAYBACK_STOP,
PLAYBACK_PAUSE,
PLAYBACK_INVALID
};
static WVDRMPluginAPI *create();
static void destroy(WVDRMPluginAPI *plugin);
virtual void OpenSession() = 0;
virtual void CloseSession() = 0;
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
std::string &dsPath,
const std::string &assetIdStr, const std::string &systemIdStr,
const std::string &keyIdStr,
uint32_t *assetId, uint32_t *systemId, uint32_t *keyId) = 0;
virtual bool ProcessDrmInfo(std::string &assetPath) = 0;
virtual int CheckRightsStatus(std::string &path) = 0;
virtual bool GetConstraints(std::string &path, uint32_t *timeSincePlayback, uint32_t *timeRemaining, uint32_t *licenseDuration) = 0;
virtual bool SetPlaybackStatus(int playbackStatus, off64_t position) = 0;
virtual bool RemoveRights(std::string &path) = 0;
virtual bool RemoveAllRights() = 0;
virtual bool Prepare(char *data, int len) = 0;
virtual bool Operate(char *in, char *out, int len, char *iv) = 0;
protected:
// use create factory method, don't construct directly
WVDRMPluginAPI() {}
};
#endif

File diff suppressed because it is too large Load Diff