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 PVVIDEODECODERINTERFACE_H_INCLUDED 19 #define PVVIDEODECODERINTERFACE_H_INCLUDED 20 21 // includes 22 #ifndef OSCL_BASE_H_INCLUDED 23 #include "oscl_base.h" 24 #endif 25 26 #ifndef VISUAL_HEADER_H_INCLUDED 27 #include "visual_header.h" 28 #endif 29 30 #include "oscl_aostatus.h" 31 32 // PVVideoDecoderInterface pure virtual interface class 33 class PVVideoDecoderInterface 34 { 35 public: ~PVVideoDecoderInterface()36 virtual ~PVVideoDecoderInterface() {}; 37 virtual bool InitVideoDecoder(uint8 *volbuf[], int32 *volbuf_size, int32 nLayers, int32* iWidth, int32* iHeight, int *mode) = 0; 38 virtual void CleanUpVideoDecoder(void) = 0; 39 virtual bool DecodeVideoFrame(uint8 *bitstream[], uint32 *timestamp, int32 *buffer_size, uint *use_ext_ts, uint8 *yuv) = 0; 40 41 // decode for dual core asynchronous operation DecodeVideoFrame(uint8 * bitstream[],uint32 * timestamp,int32 * buffer_size,uint * use_ext_ts,uint8 * yuv,OsclAOStatus * asynch)42 virtual bool DecodeVideoFrame(uint8 *bitstream[], uint32 *timestamp, int32 *buffer_size, uint *use_ext_ts, uint8 *yuv, OsclAOStatus *asynch) 43 { 44 OSCL_UNUSED_ARG(bitstream); 45 OSCL_UNUSED_ARG(timestamp); 46 OSCL_UNUSED_ARG(buffer_size); 47 OSCL_UNUSED_ARG(use_ext_ts); 48 OSCL_UNUSED_ARG(yuv); 49 OSCL_UNUSED_ARG(asynch); 50 return true; 51 }; DecodeVideoFrameAsyncResp(uint32 timestamp[],int32 buffer_size[])52 virtual bool DecodeVideoFrameAsyncResp(uint32 timestamp[], int32 buffer_size[]) 53 { 54 OSCL_UNUSED_ARG(timestamp); 55 OSCL_UNUSED_ARG(buffer_size); 56 return true; 57 }; 58 // virtual uint8* GetDecOutputFrame(void) {}; GetDecOutputFrame(uint8 *)59 virtual void GetDecOutputFrame(uint8*) {}; getSynchResponse(uint32 timestamp[],int32 buffer_size[])60 virtual bool getSynchResponse(uint32 timestamp[], int32 buffer_size[]) 61 { 62 OSCL_UNUSED_ARG(timestamp); 63 OSCL_UNUSED_ARG(buffer_size); 64 return true; 65 }; DSPDecoderBusy()66 virtual bool DSPDecoderBusy() 67 { 68 return true; 69 }; 70 71 virtual void SetReferenceYUV(uint8 *YUV) = 0; 72 virtual void GetVideoDimensions(int32 *display_width, int32 *display_height) = 0; 73 virtual void SetPostProcType(int32 mode) = 0; 74 virtual uint32 GetVideoTimestamp(void) = 0; 75 virtual bool GetVolInfo(VolInfo* pVolInfo) = 0; 76 virtual bool IsIFrame(void) = 0; 77 virtual void DecPostProcess(uint8 *YUV) = 0; 78 virtual uint8* GetDecOutputFrame(void) = 0; 79 virtual bool ResetVideoDecoder(void) = 0; 80 virtual void DecSetReference(uint8 *refYUV, uint32 timestamp) = 0; 81 virtual void DecSetEnhReference(uint8 *refYUV, uint32 timestamp) = 0; 82 virtual uint32 GetProfileAndLevel(void) = 0; 83 virtual uint32 GetDecBitrate(void) = 0; // This function returns the average bits per second. 84 }; 85 86 #endif // PVVIDEODECODERINTERFACE_H_INCLUDED 87 88 89