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 /**
     19  *  @file pvmf_video.h
     20  *  @brief This file defines structures/utilities specific to video
     21  *
     22  */
     23 
     24 #ifndef PVMF_VIDEO_H_INCLUDED
     25 #define PVMF_VIDEO_H_INCLUDED
     26 
     27 #ifndef PV_UUID_H_INCLUDED
     28 #include "pv_uuid.h"
     29 #endif
     30 
     31 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED
     32 #include "pvmf_format_type.h"
     33 #endif
     34 
     35 #define PVMF_VIDEO_INPUT_WIDTH 176
     36 #define PVMF_VIDEO_INPUT_HEIGHT 144
     37 #define PVMF_VIDEO_INPUT_FRAME_RATE 15
     38 //#define VIDEO_INPUT_FORMAT PVMFVEN_INPUT_YUV420
     39 
     40 const PVUid32 PVMFYuvFormatSpecificInfo0_UID = 0x1;
     41 const PVUid32 PVMFEOSFormatSpecificInfo_UID = 0x2;
     42 class PVMFYuvFormatSpecificInfo0
     43 {
     44     public:
     45         PVMFYuvFormatSpecificInfo0()
     46         {
     47             uid = PVMFYuvFormatSpecificInfo0_UID;
     48             video_format = PVMF_MIME_FORMAT_UNKNOWN;
     49             display_width = 0;
     50             display_height = 0;
     51             width = 0;
     52             height = 0;
     53             num_buffers = 0;
     54             buffer_size = 0;
     55         };
     56 
     57         virtual ~PVMFYuvFormatSpecificInfo0() {};
     58 
     59         PVUid32 uid;
     60         PVMFFormatType video_format;
     61         uint32 display_width;
     62         uint32 display_height;
     63         uint32 width;
     64         uint32 height;
     65 
     66         uint32 num_buffers;
     67         uint32 buffer_size;
     68 };
     69 
     70 class PVMFVideoResolution
     71 {
     72     public:
     73         PVMFVideoResolution(uint16 w, uint16 h) : width(w), height(h) {}
     74         uint16 width;
     75         uint16 height;
     76 };
     77 
     78 #define PVMF_RESOLUTION_NULL PVMFVideoResolution(0,0)
     79 #define PVMF_RESOLUTION_SQCIF PVMFVideoResolution(128,96)
     80 #define PVMF_RESOLUTION_QCIF PVMFVideoResolution(176,144)
     81 #define PVMF_RESOLUTION_CIF PVMFVideoResolution(352,288)
     82 #define PVMF_RESOLUTION_4CIF PVMFVideoResolution(704,576)
     83 #define PVMF_RESOLUTION_16CIF PVMFVideoResolution(1408,1152)
     84 
     85 class PVMFVideoResolutionRange
     86 {
     87     public:
     88         PVMFVideoResolutionRange(PVMFVideoResolution first, PVMFVideoResolution last)
     89                 : iFirst(first), iLast(last) {}
     90         bool isFit(PVMFVideoResolution res)
     91         {
     92             return (res.width >= iFirst.width && res.height >= iFirst.height && res.width <= iLast.width && res.height <= iLast.height);
     93         }
     94         PVMFVideoResolution iFirst;
     95         PVMFVideoResolution iLast;
     96 };
     97 #endif
     98