Home | History | Annotate | Download | only in libopencorehw
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 2009 Android Open Source Project
      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 #ifndef ANDROID_SURFACE_OUTPUT_MSM72XXH_INCLUDED
     20 #define ANDROID_SURFACE_OUTPUT_MSM72XXH_INCLUDED
     21 
     22 #include "android_surface_output.h"
     23 
     24 // support for shared contiguous physical memory
     25 #include <binder/MemoryHeapPmem.h>
     26 
     27 // data structures for tunneling buffers
     28 typedef struct PLATFORM_PRIVATE_PMEM_INFO
     29 {
     30     /* pmem file descriptor */
     31     uint32 pmem_fd;
     32     uint32 offset;
     33 } PLATFORM_PRIVATE_PMEM_INFO;
     34 
     35 typedef struct PLATFORM_PRIVATE_ENTRY
     36 {
     37     /* Entry type */
     38     uint32 type;
     39 
     40     /* Pointer to platform specific entry */
     41     OsclAny* entry;
     42 } PLATFORM_PRIVATE_ENTRY;
     43 
     44 typedef struct PLATFORM_PRIVATE_LIST
     45 {
     46     /* Number of entries */
     47     uint32 nEntries;
     48 
     49     /* Pointer to array of platform specific entries *
     50      * Contiguous block of PLATFORM_PRIVATE_ENTRY elements */
     51     PLATFORM_PRIVATE_ENTRY* entryList;
     52 } PLATFORM_PRIVATE_LIST;
     53 
     54 
     55 class AndroidSurfaceOutputMsm72xx : public AndroidSurfaceOutput
     56 {
     57 public:
     58     AndroidSurfaceOutputMsm72xx();
     59 
     60     // frame buffer interface
     61     virtual bool initCheck();
     62     virtual PVMFStatus writeFrameBuf(uint8* aData, uint32 aDataLen, const PvmiMediaXferHeader& data_header_info);
     63     virtual void postLastFrame();
     64 
     65     OSCL_IMPORT_REF ~AndroidSurfaceOutputMsm72xx();
     66 
     67 private:
     68     bool getPmemFd(OsclAny *private_data_ptr, uint32 *pmemFD);
     69     bool getOffset(OsclAny *private_data_ptr, uint32 *offset);
     70     void convertFrame(void* src, void* dst, size_t len);
     71 
     72     // hardware frame buffer support
     73     bool                        mHardwareCodec;
     74     uint32                      mOffset;
     75 };
     76 
     77 #endif // ANDROID_SURFACE_OUTPUT_MSM72XX_H_INCLUDED
     78