Files
android/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h
Gloria Wang 7e8c3b616e - Support streaming of content without .wvm extension.
If the .wvm extension is not present, the file header
  is parsed to determine if it is Widevine content.
- Fixed a missing call to OpenSession.
- Fixed unit test build.
- Fixed x86-eng build.
- This is cherry-picked from master to hc-mr1 branch
  "DO NOT MERGE"
Change-Id: Ied0579325d3c11a91f6f182fe59cd978eca68368
2011-03-03 22:04:09 -08:00

68 lines
2.2 KiB
C++

/*
* 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 IsSupportedMediaType(const char *uri) = 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