Home | History | Annotate | Download | only in tangier
      1 /*
      2 // Copyright(c)2014 IntelCorporation
      3 //
      4 // LicensedundertheApacheLicense,Version2.0(the"License");
      5 // youmaynotusethisfileexceptincompliancewiththeLicense.
      6 // YoumayobtainacopyoftheLicenseat
      7 //
      8 // http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unlessrequiredbyapplicablelaworagreedtoinwriting,software
     11 // distributedundertheLicenseisdistributedonan"ASIS"BASIS,
     12 // WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
     13 // SeetheLicenseforthespecificlanguagegoverningpermissionsand
     14 // limitationsundertheLicense.
     15 */
     16 
     17 #include <HwcTrace.h>
     18 #include <DisplayPlane.h>
     19 #include <hal_public.h>
     20 #include <OMX_IVCommon.h>
     21 #include <OMX_IntelVideoExt.h>
     22 #include <DisplayQuery.h>
     23 
     24 
     25 namespace android {
     26 namespace intel {
     27 
     28 bool DisplayQuery::isVideoFormat(uint32_t format)
     29 {
     30     switch (format) {
     31     case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar:
     32     case OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled:
     33     // Expand format to support the case: Software decoder + HW rendering
     34     // Only VP9 use this foramt now
     35     case HAL_PIXEL_FORMAT_YV12:
     36         return true;
     37     default:
     38         return false;
     39     }
     40 }
     41 
     42 int DisplayQuery::getOverlayLumaStrideAlignment(uint32_t format)
     43 {
     44     // both luma and chroma stride need to be 64-byte aligned for overlay
     45     switch (format) {
     46     case HAL_PIXEL_FORMAT_YV12:
     47     case HAL_PIXEL_FORMAT_I420:
     48         // for these two formats, chroma stride is calculated as half of luma stride
     49         // so luma stride needs to be 128-byte aligned.
     50         return 128;
     51     default:
     52         return 64;
     53     }
     54 }
     55 
     56 uint32_t DisplayQuery::queryNV12Format()
     57 {
     58     return HAL_PIXEL_FORMAT_NV12;
     59 }
     60 
     61 } // namespace intel
     62 } // namespace android
     63 
     64