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_BUFFER_DATA_SINK_H_INCLUDED
     19 #define PVMF_BUFFER_DATA_SINK_H_INCLUDED
     20 
     21 #ifndef OSCL_MEM_H_INCLUDED
     22 #include "oscl_mem.h"
     23 #endif
     24 
     25 #ifndef PVMF_NODE_INTERFACE_H_INCLUDED
     26 #include "pvmf_node_interface.h"
     27 #endif
     28 
     29 #ifndef PVMF_PORT_BASE_IMPL_H_INCLUDED
     30 #include "pvmf_port_base_impl.h"
     31 #endif
     32 
     33 #ifndef PVMF_SIMPLE_MEDIA_BUFFER_H_INCLUDED
     34 #include "pvmf_simple_media_buffer.h"
     35 #endif
     36 
     37 #ifndef PVMF_MEDIA_DATA_H_INCLUDED
     38 #include "pvmf_media_data.h"
     39 #endif
     40 
     41 #ifndef PVMI_CONFIG_AND_CAPABILITY_H_INCLUDED
     42 #include "pvmi_config_and_capability_utils.h"
     43 #endif
     44 
     45 
     46 class PVMFBufferDataSink : public PvmfPortBaseImpl,
     47         public PVMFPortActivityHandler,
     48         public PvmiCapabilityAndConfig
     49 {
     50     public:
     51         OSCL_IMPORT_REF PVMFBufferDataSink(int32 aPortTag);
     52         OSCL_IMPORT_REF virtual ~PVMFBufferDataSink();
     53 
     54         void HandlePortActivity(const PVMFPortActivity &);
     55 
     56         OSCL_IMPORT_REF unsigned GetNumBytesReceived();
     57         OSCL_IMPORT_REF unsigned GetNumPktsReceived();
     58         OSCL_IMPORT_REF unsigned GetNumPktErrorsReceived();
     59 
     60         // PVMFPortInterface virtuals
     61         virtual PVMFStatus PutData(PVMFSharedMediaMsgPtr aMsg);
     62         PVMFStatus GetData(PVMFSharedMediaMsgPtr aMsg);
     63 
     64         OSCL_IMPORT_REF void QueryInterface(const PVUuid& aUuid, OsclAny*& aPtr);
     65 
     66         // Implement pure virtuals from PvmiCapabilityAndConfig interface
     67         OSCL_IMPORT_REF void setObserver(PvmiConfigAndCapabilityCmdObserver* aObserver);
     68         OSCL_IMPORT_REF PVMFStatus getParametersSync(PvmiMIOSession aSession, PvmiKeyType aIdentifier,
     69                 PvmiKvp*& aParameters, int& num_parameter_elements,
     70                 PvmiCapabilityContext aContext);
     71         OSCL_IMPORT_REF PVMFStatus releaseParameters(PvmiMIOSession aSession, PvmiKvp* aParameters, int num_elements);
     72         OSCL_IMPORT_REF void createContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
     73         OSCL_IMPORT_REF void setContextParameters(PvmiMIOSession aSession, PvmiCapabilityContext& aContext,
     74                 PvmiKvp* aParameters, int num_parameter_elements);
     75         OSCL_IMPORT_REF void DeleteContext(PvmiMIOSession aSession, PvmiCapabilityContext& aContext);
     76         OSCL_IMPORT_REF void setParametersSync(PvmiMIOSession aSession, PvmiKvp* aParameters,
     77                                                int num_elements, PvmiKvp * & aRet_kvp);
     78         OSCL_IMPORT_REF PVMFCommandId setParametersAsync(PvmiMIOSession aSession, PvmiKvp* aParameters,
     79                 int num_elements, PvmiKvp*& aRet_kvp, OsclAny* context = NULL);
     80         OSCL_IMPORT_REF uint32 getCapabilityMetric(PvmiMIOSession aSession);
     81         OSCL_IMPORT_REF PVMFStatus verifyParametersSync(PvmiMIOSession aSession, PvmiKvp* aParameters, int num_elements);
     82     protected:
     83         PVMFSimpleMediaBufferCombinedAlloc* iMediaDataAlloc;
     84         unsigned iNumBytesReceived;
     85         unsigned iNumPktsReceived;
     86         unsigned iNumPktErrorsReceived;
     87 };
     88 #endif
     89