omxil.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * omxil_utils.h: helper functions
00003  *****************************************************************************
00004  * Copyright (C) 2010 the VideoLAN team
00005  * $Id: e4aad8d72eacb590360b4f0ebb63fcc3758485ad $
00006  *
00007  * Authors: Gildas Bazin <gbazin@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /*****************************************************************************
00025  * Includes
00026  *****************************************************************************/
00027 #include "OMX_Core.h"
00028 #include "OMX_Index.h"
00029 #include "OMX_Component.h"
00030 #include "OMX_Video.h"
00031 
00032 #include "omxil_utils.h"
00033 
00034 /*****************************************************************************
00035  * defines
00036  *****************************************************************************/
00037 #define MAX_COMPONENTS_LIST_SIZE 32
00038 
00039 /*****************************************************************************
00040  * decoder_sys_t : omxil decoder descriptor
00041  *****************************************************************************/
00042 typedef struct OmxPort
00043 {
00044     bool b_valid;
00045     OMX_U32 i_port_index;
00046     OMX_HANDLETYPE omx_handle;
00047     OMX_PARAM_PORTDEFINITIONTYPE definition;
00048     es_format_t *p_fmt;
00049 
00050     unsigned int i_frame_size;
00051     unsigned int i_frame_stride;
00052     unsigned int i_frame_stride_chroma_div;
00053 
00054     unsigned int i_buffers;
00055     OMX_BUFFERHEADERTYPE **pp_buffers;
00056 
00057     struct fifo_t
00058     {
00059       vlc_mutex_t         lock;
00060       vlc_cond_t          wait;
00061 
00062       OMX_BUFFERHEADERTYPE *p_first;
00063       OMX_BUFFERHEADERTYPE **pp_last;
00064 
00065       int offset;
00066 
00067     } fifo;
00068 
00069     OmxFormatParam format_param;
00070 
00071     OMX_BOOL b_reconfigure;
00072     OMX_BOOL b_direct;
00073     OMX_BOOL b_flushed;
00074 
00075 } OmxPort;
00076 
00077 struct decoder_sys_t
00078 {
00079     void *dll_handle;
00080     OMX_HANDLETYPE omx_handle;
00081 
00082     OMX_ERRORTYPE (*pf_init) (void);
00083     OMX_ERRORTYPE (*pf_deinit) (void);
00084     OMX_ERRORTYPE (*pf_get_handle) (OMX_HANDLETYPE *, OMX_STRING,
00085                                     OMX_PTR, OMX_CALLBACKTYPE *);
00086     OMX_ERRORTYPE (*pf_free_handle) (OMX_HANDLETYPE);
00087     OMX_ERRORTYPE (*pf_component_enum)(OMX_STRING, OMX_U32, OMX_U32);
00088     OMX_ERRORTYPE (*pf_get_roles_of_component)(OMX_STRING, OMX_U32 *, OMX_U8 **);
00089 
00090     bool b_enc;
00091     bool b_init;
00092     vlc_mutex_t lock;
00093 
00094     char psz_component[OMX_MAX_STRINGNAME_SIZE];
00095     char ppsz_components[MAX_COMPONENTS_LIST_SIZE][OMX_MAX_STRINGNAME_SIZE];
00096     unsigned int components;
00097 
00098     struct OmxEvent *p_events;
00099     struct OmxEvent **pp_last_event;
00100 
00101     vlc_mutex_t mutex;
00102     vlc_cond_t cond;
00103 
00104     OmxPort *p_ports;
00105     unsigned int ports;
00106     OmxPort in;
00107     OmxPort out;
00108 
00109     bool b_error;
00110 
00111     date_t end_date;
00112 
00113     int i_nal_size_length; /* Length of the NAL size field for H264 */
00114 };

Generated on Tue May 25 08:04:54 2010 for VLC by  doxygen 1.5.6