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 /** 19 * @file pvmf_media_input_data_buffer.h 20 * @brief Media buffer to hold source data from Media Input modules and call 21 * writeComplete to release source data memory back to media input modules. 22 */ 23 24 #ifndef PVMF_MEDIA_INPUT_DATA_BUFFER_H_INCLUDED 25 #define PVMF_MEDIA_INPUT_DATA_BUFFER_H_INCLUDED 26 27 #ifndef OSCL_BASE_H_INCLUDED 28 #include "oscl_base.h" 29 #endif 30 #ifndef PVLOGGER_H_INCLUDED 31 #include "pvlogger.h" 32 #endif 33 #ifndef PVMI_MEDIA_TRANSFER_H_INCLUDED 34 #include "pvmi_media_transfer.h" 35 #endif 36 #ifndef PVMF_MEDIA_DATA_IMPL_H_INCLUDED 37 #include "pvmf_media_data_impl.h" 38 #endif 39 #ifndef OSCL_MEM_MEMPOOL_H_INCLUDED 40 #include "oscl_mem_mempool.h" 41 #endif 42 43 class PvmfMediaInputDataBufferCleanup : public OsclDestructDealloc 44 { 45 public: 46 PvmfMediaInputDataBufferCleanup(OsclMemPoolFixedChunkAllocator* in_gen_alloc, PvmiMediaTransfer* aMediaInput, 47 PVMFCommandId aCmdId, OsclAny* aContext = NULL); ~PvmfMediaInputDataBufferCleanup()48 virtual ~PvmfMediaInputDataBufferCleanup() {}; 49 virtual void destruct_and_dealloc(OsclAny* ptr); 50 51 private: 52 OsclMemPoolFixedChunkAllocator* gen_alloc; 53 54 // Variables needed to call writeComplete 55 PvmiMediaTransfer* iMediaInput; 56 PVMFCommandId iCmdId; 57 OsclAny* iContext; 58 59 PVLogger *iLogger; 60 }; 61 62 class PvmfMediaInputDataBufferAlloc 63 { 64 public: 65 PvmfMediaInputDataBufferAlloc(OsclMemPoolFixedChunkAllocator* opt_gen_alloc = 0); 66 virtual OsclSharedPtr<PVMFMediaDataImpl> allocate(PvmiMediaTransfer* aMediaInput, uint8* aData, 67 uint32 aDataLength, PVMFCommandId aCmdId, OsclAny* aContext = NULL); 68 69 private: 70 OsclMemPoolFixedChunkAllocator* gen_alloc; 71 PVLogger* iLogger; 72 }; 73 74 #endif // PVMF_MEDIA_INPUT_DATA_BUFFER_H_INCLUDED 75 76