Home | History | Annotate | Download | only in tests
      1 
      2 /*
      3  *  Copyright 2001-2008 Texas Instruments - http://www.ti.com/
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 /* ==============================================================================
     18 *             Texas Instruments OMAP (TM) Platform Software
     19 *  (c) Copyright Texas Instruments, Incorporated.  All Rights Reserved.
     20 *
     21 *  Use of this software is controlled by the terms and conditions found
     22 *  in the license agreement under which this software has been supplied.
     23 * ============================================================================ */
     24 
     25 /**
     26 * @file OMX_PostProcTest.h
     27 *
     28 * Header file for PostProcessor OMX Component Test application.
     29 *
     30 * @path  $(CSLPATH)\post_proc\tests\OMX_PostProcTest.h
     31 *
     32 * @rev  0.1
     33 */
     34 
     35 /* =================================================================================
     36 *! Revision History
     37 *! ===================================
     38 *!
     39 *!
     40 *! 02-Dec-2005 mf: Revisions appear in reverse chronological order;
     41 *! that is, newest first.  The date format is dd-Mon-yyyy.
     42 * ================================================================================= */
     43 
     44 #ifndef VPP_TEST_H
     45 #define VPP_TEST_H
     46 
     47 /****************************************************************
     48 *  INCLUDE FILES
     49 ****************************************************************/
     50 #include <OMX_Core.h>
     51 #include <OMX_Video.h>
     52 #include <OMX_Types.h>
     53 
     54 #define MAX_FRAME_WIDTH      640
     55 #define MAX_FRAME_HEIGHT     480
     56 #define MAX_422_YUV_BUF_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 2)
     57 #define MAX_420_YUV_BUF_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 1.5)
     58 #define MAX_RGB_565_BUF_SIZE (MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 2)
     59 
     60 #define QQCIF_FRAME_WIDTH       88
     61 #define QQCIF_FRAME_HEIGHT      72
     62 #define QQCIF_422_YUV_BUF_SIZE  (QQCIF_FRAME_WIDTH * QQCIF_FRAME_HEIGHT * 2)
     63 #define QQCIF_420_YUV_BUF_SIZE  (QQCIF_FRAME_WIDTH * QQCIF_FRAME_HEIGHT * 1.5)
     64 #define QQCIF_RGB_565_BUF_SIZE  (QQCIF_FRAME_WIDTH * QQCIF_FRAME_HEIGHT * 2)
     65 
     66 #define QCIF_FRAME_WIDTH       176
     67 #define QCIF_FRAME_HEIGHT      144
     68 #define QCIF_422_YUV_BUF_SIZE  (QCIF_FRAME_WIDTH * QCIF_FRAME_HEIGHT * 2)
     69 #define QCIF_420_YUV_BUF_SIZE  (QCIF_FRAME_WIDTH * QCIF_FRAME_HEIGHT * 1.5)
     70 #define QCIF_RGB_565_BUF_SIZE  (QCIF_FRAME_WIDTH * QCIF_FRAME_HEIGHT * 2)
     71 
     72 #define QQVGA_FRAME_WIDTH       160
     73 #define QQVGA_FRAME_HEIGHT      120
     74 #define QQVGA_422_YUV_BUF_SIZE  (QQVGA_FRAME_WIDTH * QQVGA_FRAME_HEIGHT * 2)
     75 #define QQVGA_420_YUV_BUF_SIZE  (QQVGA_FRAME_WIDTH * QQVGA_FRAME_HEIGHT * 1.5)
     76 #define QQVGA_RGB_565_BUF_SIZE  (QQVGA_FRAME_WIDTH * QQVGA_FRAME_HEIGHT * 2)
     77 
     78 #define QVGA_FRAME_WIDTH       320
     79 #define QVGA_FRAME_HEIGHT      240
     80 #define QVGA_422_YUV_BUF_SIZE  (QVGA_FRAME_WIDTH * QVGA_FRAME_HEIGHT * 2)
     81 #define QVGA_420_YUV_BUF_SIZE  (QVGA_FRAME_WIDTH * QVGA_FRAME_HEIGHT * 1.5)
     82 #define QVGA_RGB_565_BUF_SIZE  (QVGA_FRAME_WIDTH * QVGA_FRAME_HEIGHT * 2)
     83 
     84 #define VGA_FRAME_WIDTH       640
     85 #define VGA_FRAME_HEIGHT      480
     86 #define VGA_422_YUV_BUF_SIZE  (VGA_FRAME_WIDTH * VGA_FRAME_HEIGHT * 2)
     87 #define VGA_420_YUV_BUF_SIZE  (VGA_FRAME_WIDTH * VGA_FRAME_HEIGHT * 1.5)
     88 #define VGA_RGB_565_BUF_SIZE  (VGA_FRAME_WIDTH * VGA_FRAME_HEIGHT * 2)
     89 
     90 #define CIF_FRAME_WIDTH       352
     91 #define CIF_FRAME_HEIGHT      288
     92 #define CIF_422_YUV_BUF_SIZE  (CIF_FRAME_WIDTH * CIF_FRAME_HEIGHT * 2)
     93 #define CIF_420_YUV_BUF_SIZE  (CIF_FRAME_WIDTH * CIF_FRAME_HEIGHT * 1.5)
     94 #define CIF_RGB_565_BUF_SIZE  (CIF_FRAME_WIDTH * CIF_FRAME_HEIGHT * 2)
     95 
     96 #define MAX_POSTPROC_BUFFERS 4
     97 #define MAX_MPEG4D_OUT_BUFFERS 1
     98 #define MAX_VPP_BUFFERS 4
     99 
    100 #define DSP_MMU_FAULT_HANDLING
    101 
    102 #define OMX_CONF_INIT_STRUCT(_s_, _name_)  \
    103 { \
    104     memset((_s_), 0x0, sizeof(_name_));  \
    105     (_s_)->nSize = sizeof(_name_);    \
    106     (_s_)->nVersion.s.nVersionMajor = 1;  \
    107     (_s_)->nVersion.s.nVersionMinor = 0;  \
    108     (_s_)->nVersion.s.nRevision = 0;    \
    109     (_s_)->nVersion.s.nStep = 0; \
    110 }
    111 
    112 #if 1
    113     #define PRINTF(str,args...) printf("\n"str"\n",##args)
    114 #else
    115     #define PRINTF(str,args...)
    116 #endif
    117 
    118 #define EXIT_IF_ERROR(_eError,_string)		\
    119 {						\
    120     if(_eError != OMX_ErrorNone) {		\
    121 	 printf(_string); \
    122         goto EXIT;		\
    123     	}                          \
    124 }
    125 
    126 #define CHK_COND(_predicate,_eError,_eCode,_string) \
    127 { \
    128     if(_predicate) { \
    129 		_eError = _eCode; \
    130 		printf(_string); \
    131 		goto EXIT; \
    132     	} \
    133 }
    134 
    135 #define MALLOC(_ptr,_castType,_type,_eError) \
    136 {                       \
    137   _ptr = (_castType *)malloc(sizeof(_type)); \
    138     if(!_ptr) { \
    139         _eError = OMX_ErrorInsufficientResources; \
    140 	goto EXIT; \
    141     } \
    142 }
    143 
    144 #define MEMSET(_ps,_c,_n,_eError) \
    145 {                                   \
    146   if(memset(_ps,_c,_n) != _ps) {           \
    147   	_eError = OMX_ErrorInsufficientResources; \
    148   	goto EXIT; \
    149   }    \
    150 }
    151 
    152 typedef struct _COMPONENT_PORTINDEX_DEF {
    153 	int input_port;
    154 	int overlay_port;
    155 	int output_port;
    156 	int yuvoutput_port;
    157 	int rgboutput_port;
    158 } COMPONENT_PORTINDEX_DEF;
    159 
    160 #endif /* OMX_POSTPROC_TEST_H */
    161