Files
android/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h
Jeff Tinker bcfe38dcb0 Fix failure to play through the end of wv videos
Properly compute the buffered and remaining time, also properly account
for the different old and new rates at adaptive switch and other
performance tuning related to b/5153227.

Includes Widevine release libs version 4.5.0.4936

Bug 5336777

Change-Id: I997ea353b7c320dca5e3f5c065395dca206d35a6
2011-10-17 15:11:06 -07:00

98 lines
3.2 KiB
C++

/*
* Copyright 2011 Widevine Technologies, Inc., All Rights Reserved
*
* Declarations for Widevine DRM Plugin API
*/
#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 const int PlaybackMode_Default = 0;
static const int PlaybackMode_Streaming = 1;
static const int PlaybackMode_Offline = 2;
static const int PlaybackMode_Any = PlaybackMode_Streaming |
PlaybackMode_Offline;
static WVDRMPluginAPI *create();
static void destroy(WVDRMPluginAPI *plugin);
virtual bool OpenSession(const char *uri) = 0;
virtual void CloseSession() = 0;
virtual bool IsSupportedMediaType(const char *uri) = 0;
virtual bool RegisterDrmInfo(std::string &portal, std::string &dsPath) = 0;
virtual bool UnregisterDrmInfo(std::string &portal, std::string &dsPath) = 0;
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
std::string &dsPath, const std::string &systemIdStr,
const std::string &assetIdStr,
const std::string &keyIdStr,
uint32_t *systemId, uint32_t *assetId,
uint32_t *keyId) = 0;
virtual bool ProcessDrmInfo(std::string &assetPath, int playbackMode) = 0;
virtual int CheckRightsStatus(std::string &path) = 0;
virtual bool GetConstraints(std::string &path, uint32_t *timeSincePlayback,
uint32_t *timeRemaining,
uint32_t *licenseDuration, std::string &lastError,
bool &allowOffline, bool &allowStreaming,
bool &denyHD) = 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;
enum EventType {
EventType_AcquireDrmInfoFailed,
EventType_ProcessDrmInfoFailed,
EventType_RightsInstalled,
EventType_RightsRemoved,
EventType_HeartbeatServer,
EventType_HeartbeatPeriod,
EventType_AssetId,
EventType_DeviceId,
EventType_StreamId,
EventType_UserData
};
enum EventDestination {
EventDestination_JavaAPI,
EventDestination_MediaPlayer
};
// Returns true if event sent, false if no handler
typedef bool (*EventHandler)(EventType type, EventDestination destination,
const std::string &path);
virtual void SetEventHandler(EventHandler handler) = 0;
protected:
// use create factory method, don't construct directly
WVDRMPluginAPI() {}
};
#endif