Home | History | Annotate | Download | only in include
      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 PVMF_CPMPLUGIN_ACCESS_INTERFACE_FACTORY_H_INCLUDED
     19 #define PVMF_CPMPLUGIN_ACCESS_INTERFACE_FACTORY_H_INCLUDED
     20 
     21 #ifndef OSCL_BASE_H_INCLUDED
     22 #include "oscl_base.h"
     23 #endif
     24 #ifndef OSCL_MEM_H_INCLUDED
     25 #include "oscl_mem.h"
     26 #endif
     27 #ifndef OSCL_TYPES_H_INCLUDED
     28 #include "oscl_types.h"
     29 #endif
     30 #ifndef OSCL_VECTOR_H_INCLUDED
     31 #include "oscl_vector.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 PVMF_RETURN_CODES_H_INCLUDED
     40 #include"pvmf_return_codes.h"
     41 #endif
     42 
     43 #define PVMF_CPMPLUGIN_ACCESS_INTERFACE_FACTORY_MIMETYPE "pvxxx/pvmf/cpm/plugin/access_interface_factory"
     44 #define PVMFCPMPluginAccessInterfaceFactoryUuid PVUuid(0x8b0ccfbb,0x48d6,0x4f1d,0xa9,0x9f,0x41,0xb8,0xdb,0xe8,0xf9,0x1c)
     45 
     46 class PVMFCPMPluginAccessInterface;
     47 class PVMFDataStreamReadCapacityObserver;
     48 
     49 /**
     50  * Base Content Access Interface for all Content Policy Manager Plugins
     51  */
     52 class PVMFCPMPluginAccessInterfaceFactory : public PVInterface
     53 {
     54     public:
     55         virtual PVMFStatus QueryAccessInterfaceUUIDs(Oscl_Vector<PVUuid, OsclMemAllocator>& aUuids) = 0;
     56         virtual PVInterface* CreatePVMFCPMPluginAccessInterface(PVUuid& aUuid) = 0;
     57         virtual void DestroyPVMFCPMPluginAccessInterface(PVUuid& aUuid,
     58                 PVInterface* aPtr) = 0;
     59         /**
     60         * Sometimes datastream implementations need to rely on an external source
     61         * to provide them with updated stream size (take a case of progressive dowmnload
     62         * where in module A is doing the download and module B is doing the reads). This
     63         * API is one way to make these datastreams connect with each other.
     64         */
     65         virtual void SetStreamReadCapacityObserver(PVMFDataStreamReadCapacityObserver* aObs)
     66         {
     67             OSCL_UNUSED_ARG(aObs);
     68             OSCL_LEAVE(OsclErrNotSupported);
     69         }
     70 };
     71 
     72 #endif //PVMF_CPMPLUGIN_ACCESS_INTERFACE_FACTORY_H_INCLUDED
     73 
     74