input: add an input_item_t arg to input_CreateFilename()
[vlc.git] / modules / codec / omxil / omxil.h
blob616299db6f341a6f7a1fdf02d21045b7047576b7
1 /*****************************************************************************
2 * omxil.h: helper functions
3 *****************************************************************************
4 * Copyright (C) 2010 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Gildas Bazin <gbazin@videolan.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifdef RPI_OMX
25 #define OMX_SKIP64BIT
26 #endif
28 /*****************************************************************************
29 * Includes
30 *****************************************************************************/
31 #include "OMX_Core.h"
32 #include "OMX_Index.h"
33 #include "OMX_Component.h"
34 #include "OMX_Video.h"
36 #include "omxil_utils.h"
37 #include "omxil_core.h"
39 enum
41 BUF_STATE_NOT_OWNED = 0,
42 BUF_STATE_OWNED,
45 /*****************************************************************************
46 * decoder_sys_t : omxil decoder descriptor
47 *****************************************************************************/
48 typedef struct OmxFifo
50 vlc_mutex_t lock;
51 vlc_cond_t wait;
53 OMX_BUFFERHEADERTYPE *p_first;
54 OMX_BUFFERHEADERTYPE **pp_last;
56 int offset;
58 } OmxFifo;
60 typedef struct OmxPort
62 bool b_valid;
63 OMX_U32 i_port_index;
64 OMX_HANDLETYPE omx_handle;
65 OMX_PARAM_PORTDEFINITIONTYPE definition;
66 es_format_t *p_fmt;
68 unsigned int i_frame_size;
69 unsigned int i_frame_stride;
70 unsigned int i_frame_stride_chroma_div;
72 unsigned int i_buffers;
73 OMX_BUFFERHEADERTYPE **pp_buffers;
75 OmxFifo fifo;
77 OmxFormatParam format_param;
79 OMX_BOOL b_reconfigure;
80 OMX_BOOL b_update_def;
81 OMX_BOOL b_direct;
82 OMX_BOOL b_flushed;
83 } OmxPort;
85 typedef struct
87 OMX_HANDLETYPE omx_handle;
89 bool b_enc;
91 char psz_component[OMX_MAX_STRINGNAME_SIZE];
92 char ppsz_components[MAX_COMPONENTS_LIST_SIZE][OMX_MAX_STRINGNAME_SIZE];
93 unsigned int components;
94 int i_quirks;
96 OmxEventQueue event_queue;
98 OmxPort *p_ports;
99 unsigned int ports;
100 OmxPort in;
101 OmxPort out;
103 bool b_error;
105 bool b_aspect_ratio_handled;
107 date_t end_date;
109 uint8_t i_nal_size_length; /* Length of the NAL size field for H264 */
110 int b_use_pts;
112 } decoder_sys_t;