OSDN Git Service

RIO-7067: CPM changes and new player engine unit test cases.
authorPacketVideo CM <engbuild@pv.com>
Thu, 10 Dec 2009 20:40:29 +0000 (12:40 -0800)
committerPacketVideo CM <engbuild@pv.com>
Thu, 10 Dec 2009 20:40:29 +0000 (12:40 -0800)
15 files changed:
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h
engines/player/test/src/test_pv_player_engine.cpp
engines/player/test/src/test_pv_player_engine.h
nodes/common/include/pvmf_license_context_data.h
pvmi/content_policy_manager/plugins/common/Android.mk
pvmi/content_policy_manager/plugins/common/build/make/local.mk
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_domain_interface_types.h
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_license_interface.h
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_license_manager_interface.h
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_metering_interface.h
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_metering_interface_types.h
pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_web_initiator_types.h [new file with mode: 0644]
pvmi/pvmf/include/pvmf_return_codes.h

index eb984e6..d6e1277 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "1122398"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1122691"
 #define PV2WAY_ENGINE_SDKINFO_DATE 0x20091203
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index c9221e6..92146e4 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1122398"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1122691"
 #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091203
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index 560eeab..47f3420 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1122398"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1122691"
 #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091203
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
index fc5b55c..b85c366 100644 (file)
@@ -3613,7 +3613,7 @@ void pvplayer_engine_test::test()
                 fprintf(file, "PlayReady CPM tests not enabled\n");
                 break;
 
-            case DLA_OpenPlayStop_PlayReadyCPMTest_v4_WMA:
+            case DLA_OpenPlayUntilEOS_PlayReadyCPMTest_v4_WMA:
                 fprintf(file, "PlayReady CPM tests not enabled\n");
                 break;
 
@@ -3738,6 +3738,26 @@ void pvplayer_engine_test::test()
                 fprintf(file, "PlayReady CPM tests not enabled\n");
                 break;
 
+            case WebInitiatorParsing_PlayReadyCPMTest:
+                fprintf(file, "PlayReady CPM tests not enabled\n");
+                break;
+
+            case WebInitiatorLicAcq_PlayReadyCPMTest:
+                fprintf(file, "PlayReady CPM tests not enabled\n");
+                break;
+
+            case WebInitiatorLicAcqDomainBound_PlayReadyCPMTest:
+                fprintf(file, "PlayReady CPM tests not enabled\n");
+                break;
+
+            case WebInitiatorMetering_PlayReadyCPMTest:
+                fprintf(file, "PlayReady CPM tests not enabled\n");
+                break;
+
+            case WebInitiatorJoinAndLeaveDomain_PlayReadyCPMTest:
+                fprintf(file, "PlayReady CPM tests not enabled\n");
+                break;
+
             case DLA_OpenPlayStop_PlayReadyCPMTest_v4_WMA_MissingServiceIdInContentHeader:
                 fprintf(file, "PlayReady CPM tests not enabled\n");
                 break;
@@ -6198,25 +6218,25 @@ void pvplayer_engine_test::test()
             }
             break;
 
-            case DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMV:
+            case DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_WMV:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_AAC:
+            case DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_AAC:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264:
+            case DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_H264:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264_AAC:
+            case DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_H264_AAC:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
@@ -6228,25 +6248,25 @@ void pvplayer_engine_test::test()
             }
             break;
 
-            case DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMV:
+            case DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_WMV:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_AAC:
+            case DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_AAC:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264:
+            case DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_H264:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
             break;
 
-            case DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264_AAC:
+            case DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_H264_AAC:
             {
                 fprintf(file, "PlayReady Streaming tests not enabled\n");
             }
index ffc0da5..207a2d1 100644 (file)
@@ -2148,7 +2148,7 @@ class pvplayer_engine_test : public test_case,
             //Multi-media format tests
             DLA_OpenPlayStop_PlayReadyCPMTest_v2_WMA,//1403
             DLA_OpenPlayStop_PlayReadyCPMTest_v2_WMV,//1404
-            DLA_OpenPlayStop_PlayReadyCPMTest_v4_WMA,//1405
+            DLA_OpenPlayUntilEOS_PlayReadyCPMTest_v4_WMA,//1405
             DLA_OpenPlayStop_PlayReadyCPMTest_v4_WMV,//1406
             DLA_OpenPlayStop_PlayReadyCPMTest_v4_AAC,//1407
             DLA_OpenPlayStop_PlayReadyCPMTest_v4_AACP,//1408
@@ -2181,33 +2181,40 @@ class pvplayer_engine_test : public test_case,
             DLA_LicenseUpdateAll_PlayReadyCPMTest,//1431
             DLA_LicenseUpdateExpired_PlayReadyCPMTest,//1432
 
+            //Utility Web-initiator tests
+            WebInitiatorParsing_PlayReadyCPMTest, //1433
+            WebInitiatorLicAcq_PlayReadyCPMTest, //1434
+            WebInitiatorLicAcqDomainBound_PlayReadyCPMTest, //1435
+            WebInitiatorMetering_PlayReadyCPMTest, //1436
+            WebInitiatorJoinAndLeaveDomain_PlayReadyCPMTest, //1437
+
             //PlayReady Cancel tests
-            DLA_CancelAcquireLicense_PlayReadyCPMTest_v2_Content,//1433
-            DLA_CancelJoinDomain_PlayReadyCPMTest, //1434
+            DLA_CancelAcquireLicense_PlayReadyCPMTest_v2_Content,//1438
+            DLA_CancelJoinDomain_PlayReadyCPMTest, //1439
 
             //PlayReady streaming tests.
-            DLA_StreamingOpenPlayUntilEOST_PlayReadyCPMTest,//1435
-            DLA_StreamingOpenPlayPausePlayUntilEOS_PlayReadyCPMTest,//1436
-            DLA_StreamingOpenPlaySeekPlayUntilEOS_PlayReadyCPMTest,//1437
-            DLA_StreamingMultiplePlayUntilEOS_PlayReadyCPMTest,//1438
-            DLA_StreamingCancelAcquireLicense_PlayReadyCPMTest,//1439
-            DLA_StreamingProtocolRollOverTest_PlayReadyCPMTest,//1440
-            DLA_StreamingProtocolRollOverTestWithUnknownURLType_PlayReadyCPMTest,//1441
-            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMA,//1442
-            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMV,//1443
-            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_AAC,//1444
-            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264,//1445
-            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264_AAC,//1446
-
-            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMA,//1447
-            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMV,//1448
-            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_AAC,//1449
-            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264,//1450
-            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_H264_AAC,//1451
+            DLA_StreamingOpenPlayUntilEOST_PlayReadyCPMTest,//1440
+            DLA_StreamingOpenPlayPausePlayUntilEOS_PlayReadyCPMTest,//1441
+            DLA_StreamingOpenPlaySeekPlayUntilEOS_PlayReadyCPMTest,//1442
+            DLA_StreamingMultiplePlayUntilEOS_PlayReadyCPMTest,//1443
+            DLA_StreamingCancelAcquireLicense_PlayReadyCPMTest,//1444
+            DLA_StreamingProtocolRollOverTest_PlayReadyCPMTest,//1445
+            DLA_StreamingProtocolRollOverTestWithUnknownURLType_PlayReadyCPMTest,//1446
+            DLA_PDL_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMA,//1447
+            DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_WMV,//1448
+            DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_AAC,//1449
+            DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_H264,//1450
+            DLA_PDL_OpenPlayStop_PlayreadyCPMTest_v4_H264_AAC,//1451
+
+            DLA_PPB_OpenPlayUntilEOS_PlayreadyCPMTest_v4_WMA,//1452
+            DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_WMV,//1453
+            DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_AAC,//1454
+            DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_H264,//1455
+            DLA_PPB_OpenPlayStop_PlayreadyCPMTest_v4_H264_AAC,//1456
 
             //Miscellaneous tests
-            ContentHeaderRetrieval_PlayReadyCPMTest, //1452
-            LicenseCountVerification_PlayReadyCPMTest, //1453
+            ContentHeaderRetrieval_PlayReadyCPMTest, //1457
+            LicenseCountVerification_PlayReadyCPMTest, //1458
 
             //RESERVED FOR FUTURE PLAYREADY CPM TESTS.
             LastPlayReadyCPMTest = 1599,//placeholder
index 037aee8..e29fa27 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 #define PVMF_LICENSE_CONTEXT_DATA_UUID PVUuid(0x13f2d930,0x8f58,0x11de,0x8a,0x39,0x08,0x00,0x20,0x0c,0x9a,0x66)
 #define PVMF_DOMAIN_LICENSE_CONTEXT_DATA_UUID PVUuid(0x574a8890,0x8f58,0x11de,0x8a,0x39,0x08,0x00,0x20,0x0c,0x9a,0x66)
-
+#define PVMF_HEADER_LICENSE_CONTEXT_DATA_UUID PVUuid(0x15806e40,0xcfa7,0x11de,0x8a,0x39,0x08,0x00,0x20,0x0c,0x9a,0x66)
 
 class PVMFDomainLicenseDataSource : public PVInterface
 {
@@ -86,17 +86,73 @@ class PVMFDomainLicenseDataSource : public PVInterface
             }
         }
 
-        PVMFCPMDomainJoinData iDomainJoinData;
+        PVMFCPMDomainId iDomainId;
     private:
         void MyCopy(const PVMFDomainLicenseDataSource& aSrc)
         {
-            iDomainJoinData = aSrc.iDomainJoinData;
+            iDomainId = aSrc.iDomainId;
         };
 
         int32 iRefCounter;
 
 };
 
+class PVMFHeaderLicenseDataSource : public PVInterface
+{
+    public:
+        PVMFHeaderLicenseDataSource()
+        {
+            iRefCounter = 0;
+        };
+
+        PVMFHeaderLicenseDataSource(const PVMFHeaderLicenseDataSource& aSrc) : PVInterface(aSrc)
+        {
+            iRefCounter = 0;
+            MyCopy(aSrc);
+        };
+
+        PVMFHeaderLicenseDataSource& operator=(const PVMFHeaderLicenseDataSource& aSrc)
+        {
+            if (&aSrc != this)
+            {
+                MyCopy(aSrc);
+            }
+            return *this;
+        };
+
+        /* From PVInterface */
+        void addRef()
+        {
+            iRefCounter++;
+        }
+        void removeRef()
+        {
+            iRefCounter--;
+        }
+        bool queryInterface(const PVUuid& uuid, PVInterface*& iface)
+        {
+            if (uuid == PVUuid(PVMF_HEADER_LICENSE_CONTEXT_DATA_UUID))
+            {
+                iface = this;
+                return true;
+            }
+            else
+            {
+                iface = NULL;
+                return false;
+            }
+        }
+
+        OSCL_wHeapString<OsclMemAllocator> iHeader;
+    private:
+        void MyCopy(const PVMFHeaderLicenseDataSource& aSrc)
+        {
+            iHeader = aSrc.iHeader;
+        };
+
+        int32 iRefCounter;
+};
+
 class PVMFLicenseContextData : public PVInterface
 {
     public:
@@ -104,6 +160,7 @@ class PVMFLicenseContextData : public PVInterface
         {
             iRefCounter = 0;
             iDomainLicenseContextValid = false;
+            iHeaderLicenseContextValid = false;
         };
 
         PVMFLicenseContextData(const PVMFLicenseContextData& aSrc) : PVInterface(aSrc)
@@ -145,6 +202,14 @@ class PVMFLicenseContextData : public PVInterface
                     return true;
                 }
             }
+            else if (uuid == PVUuid(PVMF_HEADER_LICENSE_CONTEXT_DATA_UUID))
+            {
+                if (iHeaderLicenseContextValid == true)
+                {
+                    iface = &iPVMFHeaderLicenseDataSource;
+                    return true;
+                }
+            }
             iface = NULL;
             return false;
         }
@@ -161,19 +226,35 @@ class PVMFLicenseContextData : public PVInterface
         {
             return iDomainLicenseContextValid ? &iPVMFDomainLicenseDataSource : NULL;
         }
+        void EnableHeaderLicenseContext()
+        {
+            iHeaderLicenseContextValid = true;
+        }
+        void DisableHeaderLicenseContext()
+        {
+            iHeaderLicenseContextValid = false;
+        }
+        PVMFHeaderLicenseDataSource* HeaderLicense()
+        {
+            return iHeaderLicenseContextValid ? &iPVMFHeaderLicenseDataSource : NULL;
+        }
+        OSCL_HeapString<OsclMemAllocator> iCustomData;
     private:
         int32 iRefCounter;
         bool iDomainLicenseContextValid;
+        bool iHeaderLicenseContextValid;
 
         PVMFDomainLicenseDataSource iPVMFDomainLicenseDataSource;
+        PVMFHeaderLicenseDataSource iPVMFHeaderLicenseDataSource;
 
         void MyCopy(const PVMFLicenseContextData& aSrc)
         {
             iDomainLicenseContextValid = aSrc.iDomainLicenseContextValid;
-
+            iHeaderLicenseContextValid = aSrc.iHeaderLicenseContextValid;
             iPVMFDomainLicenseDataSource = aSrc.iPVMFDomainLicenseDataSource;
+            iPVMFHeaderLicenseDataSource = aSrc.iPVMFHeaderLicenseDataSource;
+            iCustomData = aSrc.iCustomData;
         };
 };
 
 #endif //PVMF_LICENSE_CONTEXT_DATA_H_INCLUDED
-
index ce5d48b..91a2bd2 100644 (file)
@@ -31,6 +31,7 @@ LOCAL_COPY_HEADERS := \
        include/pvmf_cpmplugin_license_interface_types.h \
        include/pvmf_cpmplugin_domain_interface_types.h \
        include/pvmf_cpmplugin_interface.h \
-       include/pvmf_cpmplugin_decryption_context.h
+       include/pvmf_cpmplugin_decryption_context.h \
+       include/pvmf_cpmplugin_web_initiator_types.h
 
 include $(BUILD_COPY_HEADERS)
index cd08711..087d604 100644 (file)
@@ -24,7 +24,8 @@ HDRS := pvmf_cpmplugin_access_interface.h \
        pvmf_cpmplugin_license_interface_types.h \
        pvmf_cpmplugin_domain_interface_types.h \
        pvmf_cpmplugin_interface.h \
-       pvmf_cpmplugin_decryption_context.h
+       pvmf_cpmplugin_decryption_context.h \
+       pvmf_cpmplugin_web_initiator_types.h
  
 include $(MK)/library.mk
 install:: headers-install
index ae8b0bf..5562d7e 100644 (file)
@@ -48,6 +48,16 @@ class PVMFCPMDomainId
             iAccountId = aVal.iAccountId;
             iRevision = aVal.iRevision;
         }
+        PVMFCPMDomainId & operator=(const PVMFCPMDomainId& aSrc)
+        {
+            if (&aSrc != this)
+            {
+                iServiceId = aSrc.iServiceId;
+                iAccountId = aSrc.iAccountId;
+                iRevision = aSrc.iRevision;
+            }
+            return *this;
+        };
 
         PVUuid iServiceId;
         PVUuid iAccountId;
@@ -59,11 +69,7 @@ class PVMFCPMDomainJoinData
 {
     public:
         PVMFCPMDomainJoinData()
-                : iDomainUrl(NULL)
-                , iFlags(0)
-                , iFriendlyName(NULL)
-                , iCustomData(NULL)
-                , iCustomDataLen(0)
+                : iFlags(0)
         {}
 
         PVMFCPMDomainJoinData & operator=(const PVMFCPMDomainJoinData& aSrc)
@@ -75,21 +81,21 @@ class PVMFCPMDomainJoinData
                 iDomainId      = aSrc.iDomainId;
                 iFriendlyName  = aSrc.iFriendlyName;
                 iCustomData    = aSrc.iCustomData;
-                iCustomDataLen = aSrc.iCustomDataLen;
             }
             return *this;
         };
 
-        OSCL_String* iDomainUrl;    //the domain server URL
+        OSCL_HeapString<OsclMemAllocator> iDomainUrl;    //the domain server URL
 
         uint32 iFlags;              //Flag that indicates the type of custom data.
 
         PVMFCPMDomainId iDomainId;  //Domain ID to be registered with the server.
 
-        OSCL_String* iFriendlyName; //Pointer to the friendly name. Can be NULL.
+        OSCL_HeapString<OsclMemAllocator> iFriendlyName; //Friendly name.
 
-        uint8* iCustomData;         //Optional custom data.  Can be NULL
-        uint32 iCustomDataLen;      //length of the custom data in bytes.
+        //Custom data to be sent to the server.
+        //The format of the custom data is based on the value of iFlags. It may be blank.
+        OSCL_HeapString<OsclMemAllocator> iCustomData;
 };
 
 //Data associated with a Domain Leave request
@@ -97,24 +103,18 @@ class PVMFCPMDomainLeaveData
 {
     public:
         PVMFCPMDomainLeaveData()
-                : iDomainUrl(NULL)
-                , iFlags(0)
-                , iCustomData(NULL)
-                , iCustomDataLen(0)
+                : iFlags(0)
         {}
 
-        OSCL_String* iDomainUrl;    //Domain URL.
+        OSCL_HeapString<OsclMemAllocator> iDomainUrl;    //Domain URL.
 
         uint32 iFlags;              //Flag that indicates the type of custom data.
 
         PVMFCPMDomainId iDomainId;  //Domain ID to be unregistered with the server.
 
-        uint8* iCustomData;         //Pointer to a buffer that contains the custom data
-        //sent to the server. The format of the custom data
-        //is based on the value of iFlags. It may be NULL.
-
-        uint32 iCustomDataLen;      //Size (in bytes) of the custom data buffer.
-        //It must be 0 if iCustomData is NULL.
+        //Custom data to be sent to the server.
+        //The format of the custom data is based on the value of iFlags. It may be blank.
+        OSCL_HeapString<OsclMemAllocator> iCustomData;
 };
 
 //Data output by GetDomain request.
index 607bc8d..d08ee75 100644 (file)
@@ -139,7 +139,6 @@ class PVMFCPMPluginLicenseInterface : public PVInterface
                                          uint32 aDataSize = 0,
                                          int32 aTimeoutMsec = (-1),
                                          OsclAny* aContext = NULL) = 0;
-
         /**
          * Method to join a domain
          *
index 524530b..24bb15b 100644 (file)
@@ -114,7 +114,7 @@ class PVMFCPMPluginLicenseManagerInterface : public PVInterface
          * @param [in] aCountRemaining: For counted licenses, update only those that have
          *    less than the specified number of play counts remaining.  To update all counted
          *    licenses regardless of the counts remaining, use (-1).
-         * @param [in] aCustomData, aCustomDataSize: Optional opaque data for additional inputs.
+         * @param [in] aCustomData: Opaque data for additional inputs. Can be blank.
          * @param [in] aTimeoutMsec: Optional timeout in milliseconds
          *    for each server communication.  Use -1 to indicate infinite wait.
          * @param [in] aContextData: Optional caller data to accompany the
@@ -123,16 +123,15 @@ class PVMFCPMPluginLicenseManagerInterface : public PVInterface
          * @returns A unique command id for asynchronous completion.
          */
         virtual PVMFCommandId UpdateLicenses(
-            PVMFSessionId aSessionId
-            , int32& aLastLicenseProcessed
-            , uint32 aStartingIndex = 0
-                                      , int32 aMaxNumberOfLicenses = (-1)
-                                                                     , int32 aHoursRemaining = (-1)
-                                                                                               , int32 aCountRemaining = (-1)
-                                                                                                                         , OsclAny* aCustomData = NULL
-                                                                                                                                                  , uint32 aCustomDataSize = 0
-                                                                                                                                                                             , int32 aTimeoutMsec = (-1)
-                                                                                                                                                                                                    , OsclAny* aContext = NULL) = 0;
+            PVMFSessionId aSessionId,
+            const OSCL_String& aCustomData,
+            int32& aLastLicenseProcessed,
+            uint32 aStartingIndex = 0,
+            int32 aMaxNumberOfLicenses = (-1),
+            int32 aHoursRemaining = (-1),
+            int32 aCountRemaining = (-1),
+            int32 aTimeoutMsec = (-1),
+            OsclAny* aContext = NULL) = 0;
 
         /**
          * Method to get the status of an ongoing or recently completed
index 258b585..e3f58c7 100644 (file)
@@ -67,11 +67,11 @@ class PVMFCPMPluginMeteringInterface : public PVInterface
          * @returns A unique command id for asynchronous completion.
          */
         virtual PVMFCommandId UpdateMeterCertificate(
-            PVMFSessionId aSessionId
-            , OSCL_wString& aMeterCert
-            , PVMFCPMMeterId* aMeterId = NULL
-                                         , int32 aTimeoutMsec = (-1)
-                                                                , OsclAny* aContextData = NULL) = 0;
+            PVMFSessionId aSessionId,
+            OSCL_wString& aMeterCert,
+            PVMFCPMMeterId* aMeterId = NULL,
+            int32 aTimeoutMsec = (-1),
+            OsclAny* aContextData = NULL) = 0;
 
         /**
          * Method to report metering data for a specific Meter ID.
@@ -85,14 +85,8 @@ class PVMFCPMPluginMeteringInterface : public PVInterface
          * To interrupt and cancel metering, use the plugin CancelCommand.
          *
          * @param [in] aSessionId: The observer session Id.
-         * @param [in] aMaxDataSize: The maximum data size for
-         *    each metering data buffer to be sent to the server.
-         *    If there is more data than this size, then multiple
-         *    server transactions will be done automatically.
-         * @param [in] aMeterId: The metering Id.
-         * @param [in] aMeterCertUrl: Optional input URL to be used
-         *    to acquire the meter certificate.
-         * @param [out] aStatus: Optional meter status output
+         * @param [in] aMeteringData: PVMFCPMMeteringData structure containing
+         *    data related to this metering request.
          * @param [in] aTimeoutMsec: Optional timeout in milliseconds
          *    for each server communication.  Use -1 to indicate infinite wait.
          * @param [in] aContextData: Optional user data that will be returned
@@ -101,12 +95,10 @@ class PVMFCPMPluginMeteringInterface : public PVInterface
          * @returns A unique command id for asynchronous completion.
          */
         virtual PVMFCommandId ReportMeteringData(
-            PVMFSessionId aSessionId
-            , uint32 aMaxDataSize
-            , const PVMFCPMMeterId& aMeterId
-            , OSCL_String* aMeterCertUrl = NULL
-                                           , int32 aTimeoutMsec = (-1)
-                                                                  , OsclAny* aContextData = NULL) = 0;
+            PVMFSessionId aSessionId,
+            const PVMFCPMMeteringData& aMeteringData,
+            int32 aTimeoutMsec = (-1),
+            OsclAny* aContextData = NULL) = 0;
 
         /**
          * Method to get a list of all MIDs in the current meter cert store.
index dc0581b..aeca65d 100644 (file)
 #include "oscl_types.h"
 #endif
 
+#define PVMF_CPM_METER_ID_SIZE  16
+
 //A class to hold a metering ID.
 class PVMFCPMMeterId
 {
     public:
-        PVMFCPMMeterId(): iData(NULL), iDataLen(0)
-        {}
-
-        PVMFCPMMeterId(const PVMFCPMMeterId& aVal)
+        PVMFCPMMeterId()
+        {
+            oscl_memset(data, NULL, PVMF_CPM_METER_ID_SIZE);
+        }
+        PVMFCPMMeterId(const PVMFCPMMeterId &aId)
         {
-            iData = NULL;
-            iDataLen = 0;
-            Set(aVal);
+            Set((uint8*)aId.data);
         }
 
-        ~PVMFCPMMeterId()
+        PVMFCPMMeterId operator=(const PVMFCPMMeterId &aId)
         {
-            if (iData)
-                OSCL_FREE(iData);
-            iData = NULL;
+            Set((uint8*)aId.data);
+            return *this;
         }
 
-        void Set(uint8* aData, uint32 aDataLen)
+        void Set(uint8 *aData)
         {
-            if (iData)
-                OSCL_FREE(iData);
-            iData = NULL;
-            if (aDataLen)
+            if (aData)
             {
-                iData = (uint8*)OSCL_MALLOC(aDataLen);
-                if (iData)
-                    oscl_memcpy(iData, aData, aDataLen);
-                iDataLen = aDataLen;
+                oscl_memcpy(data, aData, PVMF_CPM_METER_ID_SIZE);
             }
         }
-        void Set(const PVMFCPMMeterId& aId)
-        {
-            Set(aId.iData, aId.iDataLen);
-        }
 
-        uint8* iData;
-        uint32 iDataLen;
+        uint8 data [PVMF_CPM_METER_ID_SIZE];
 };
 
 //A class to hold information about a metering certificate
@@ -90,15 +79,16 @@ class PVMFCPMMeterCertInfo
         void Clear()
         {
             iValid = false;
-            iMeterId.Set(NULL, 0);
             iIsV2 = false;
+            iURL = _STRLIT_WCHAR("");
+            oscl_memset(iMeterId.data, NULL, sizeof(iMeterId.data));
         }
         void Set(const PVMFCPMMeterCertInfo& aInfo)
         {
             iValid = aInfo.iValid;
             if (iValid)
             {
-                iMeterId.Set(aInfo.iMeterId);
+                iMeterId = aInfo.iMeterId;
                 iURL = aInfo.iURL;
                 iIsV2 = aInfo.iIsV2;
             }
@@ -168,6 +158,33 @@ class PVMFCPMMeterStatus
         }
 };
 
+class PVMFCPMMeteringData
+{
+    public:
+        PVMFCPMMeteringData()
+        {
+            /*
+            ** Default value of iMaxDataSize is zero, which instructs client to submit entire metering
+            ** data in one http message.
+            */
+            iMaxDataSize = 0;
+        }
+
+        //URL from where metering certificate can be obtained
+        OSCL_HeapString<OsclMemAllocator> iMeteringCertServerUrl;
+
+        //Metering ID of the service
+        PVMFCPMMeterId iMID;
+
+        //Maximum size of metering packets that the client should send to the server.
+        uint32 iMaxDataSize;
+
+        //CustomData string to be sent to the server with Metering challenge. It may be blank.
+        OSCL_HeapString<OsclMemAllocator> iMeteringCustomData;
+
+        //CustomData string to be sent to the server with Meter Cert challenge. It may be blank.
+        OSCL_HeapString<OsclMemAllocator> iMeterCertCustomData;
+};
 
 #endif //PVMF_CPMPLUGIN_METERING_INTERFACE_TYPES_H_INCLUDED
 
diff --git a/pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_web_initiator_types.h b/pvmi/content_policy_manager/plugins/common/include/pvmf_cpmplugin_web_initiator_types.h
new file mode 100644 (file)
index 0000000..58f685d
--- /dev/null
@@ -0,0 +1,66 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * 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 PVMF_CPMPLUGIN_LICENSE_ACQUIRE_INITIATOR_TYPES_H_INCLUDED
+#define PVMF_CPMPLUGIN_LICENSE_ACQUIRE_INITIATOR_TYPES_H_INCLUDED
+
+//Web-initiator types
+enum PVMFCpmInitiatorType
+{
+    PVMF_CPM_INITIATOR_UNKNOWN            = 0,
+    PVMF_CPM_INITIATOR_JOINDOMAIN         = 1,
+    PVMF_CPM_INITIATOR_LEAVEDOMAIN        = 2,
+    PVMF_CPM_INITIATOR_LICENSEACQUISITION = 3,
+    PVMF_CPM_INITIATOR_METERING           = 4
+};
+
+/* This class holds data parsed from a lic-acquire web initiator. This data can be
+** used for license acquisition.
+*/
+class PVMFCPMAcquireLicenseWebInitiatorData
+{
+    public:
+        PVMFCPMAcquireLicenseWebInitiatorData():
+                iIsWMConvertAvailable(false)
+        {}
+
+        //Content header
+        OSCL_wHeapString<OsclMemAllocator>  iHeader;
+
+        //Custom data to be sent to the server.
+        OSCL_HeapString<OsclMemAllocator> iCustomData;
+
+        //URL from where the content can be downloaded
+        OSCL_HeapString<OsclMemAllocator> iStrContentURL;
+
+        // Point to the content of <WMConvert> node.
+        OSCL_HeapString<OsclMemAllocator> iStrWMConvert;
+
+        // Flag inidicating whether the <WMConvert> node is available.
+        bool iIsWMConvertAvailable;
+
+        // <LA_URL> node in the content header.
+        OSCL_wHeapString<OsclMemAllocator> iStrLAURL;
+
+        // <LUI_URL> node (if exists) in the content header.
+        OSCL_wHeapString<OsclMemAllocator> iStrLUIURL;
+
+        // <DS_ID> node (if exists) in the content header.
+        OSCL_wHeapString<OsclMemAllocator> iStrDSID;
+};
+
+#endif //PVMF_CPMPLUGIN_LICENSE_ACQUIRE_INITIATOR_TYPES_H_INCLUDED
index b0b5d1c..e076965 100644 (file)
@@ -265,18 +265,16 @@ Error when a license server reports that the device is not part of the domain.
 */
 const PVMFStatus PVMFErrDrmDomainNotAMember = (-51);
 /*
-... this range reserved for future DRM-related errors
-*/
-/*
 Error due to device currently not activated for drm-protected content playback
 */
 const PVMFStatus PVMFErrDrmDeviceNotActivated = (-52);
-
+/*
+... this range reserved for future DRM-related errors
+*/
 /*
 DRM Operational Error not otherwise specified
 */
 const PVMFStatus PVMFErrDrmOperationFailed = (-81);
-
 /*
 Error returned when the video container is not valid for progressive playback.
 */