• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
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
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #ifndef PV_PLAYER_LICENSE_ACQUISITION_INTERFACE_H_INCLUDED
19 #define PV_PLAYER_LICENSE_ACQUISITION_INTERFACE_H_INCLUDED
20 
21 #ifndef OSCL_BASE_H_INCLUDED
22 #include "oscl_base.h"
23 #endif
24 #ifndef OSCL_TYPES_H_INCLUDED
25 #include "oscl_types.h"
26 #endif
27 #ifndef OSCL_VECTOR_H_INCLUDED
28 #include "oscl_vector.h"
29 #endif
30 #ifndef OSCL_STRING_H_INCLUDED
31 #include "oscl_string.h"
32 #endif
33 #ifndef PV_UUID_H_INCLUDED
34 #include "pv_uuid.h"
35 #endif
36 #ifndef PV_INTERFACE_H_INCLUDED
37 #include "pv_interface.h"
38 #endif
39 #ifndef PV_ENGINE_TYPES_H_INCLUDED
40 #include "pv_engine_types.h"
41 #endif
42 
43 #define PV_PLAYER_LICENSE_ACQUISITION_INTERFACE_MIMETYPE "pvxxx/pvplayer/license_acquisition_interface"
44 #define PVPlayerLicenseAcquisitionInterfaceUuid PVUuid(0x501302d0,0xd041,0x4fb4,0xad,0x75,0xf0,0x3f,0x90,0x37,0xba,0x42)
45 
46 class PVMFCPMLicenseStatus;
47 
48 /**
49  * License Acquisition interface for pvPlayer
50  */
51 class PVPlayerLicenseAcquisitionInterface : public PVInterface
52 {
53     public:
54 
55         /**
56          * Method to get license. Content name is wide character string
57          *
58          * @param aLicenseData [in] This is any additional data to be used
59          *                          by the DRM agent for license acquisition.
60          *                          It's format is DRM-agent specific.
61          * @param aDataSize [in] Amount of data (in bytes) in the license_data.
62          * @param aTimeoutMsec [in] Timeout for the request, or (-1) to
63          *                          indicate no timeout (infinite wait).
64          * @param aContentName [in] Null terminated Unicode (UCS-2) string containing
65          *                          the content name
66          * @param aContextData [in] Optional opaque data that will be passed back to
67          *                          the user with the command response
68          *
69          * @returns A unique command ID for asynchronous completion.
70          */
71         virtual PVCommandId AcquireLicense(OsclAny* aLicenseData, uint32 aDataSize,
72                                            oscl_wchar *aContentName,
73                                            int32 aTimeoutMsec,
74                                            const OsclAny* aContextData = NULL) = 0;
75 
76         /**
77          * Method to get license.
78          *
79          * @param aLicenseData [in] This is any additional data to be used
80          *                          by the DRM agent for license acquisition.
81          *                          It's format is DRM-agent specific.
82          * @param aDataSize [in] Amount of data (in bytes) in the license_data.
83          * @param aContentName [in] Null terminated UTF-8 string containing
84          *                          the content name
85          * @param aTimeoutMsec [in] Timeout for the request, or (-1) to
86          *                          indicate no timeout (infinite wait).
87          * @param aContextData [in] Optional opaque data that will be passed back to
88          *                          the user with the command response
89          *
90          * @returns A unique command ID for asynchronous completion.
91          */
92         virtual PVCommandId AcquireLicense(OsclAny* aLicenseData, uint32 aDataSize,
93                                            char * aContentName,
94                                            int32 aTimeoutMsec,
95                                            const OsclAny* aContextData = NULL) = 0;
96 
97         /**
98          * Method to cancel AcquireLicense requests.
99          *
100          * @param aContextData [in] Optional opaque data that will be passed back to
101          *                          the user with the command response
102          *
103          * @returns A unique command ID for asynchronous completion.
104          */
105         virtual PVCommandId CancelAcquireLicense(PVMFCommandId aCmdId, const OsclAny* aContextData = NULL) = 0;
106 
107 
108         /**
109          * Method to get detailed status on an ongoing or recently completed
110          * license acquisition.
111          */
112         virtual PVMFStatus GetLicenseStatus(PVMFCPMLicenseStatus& aStatus) = 0;
113 
114 };
115 
116 
117 #endif // PV_PLAYER_LICENSE_ACQUISITION_INTERFACE_H_INCLUDED
118 
119