1 /*****************************************************************************
2 * omxil.h: helper functions
3 *****************************************************************************
4 * Copyright (C) 2010 VLC authors and VideoLAN
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 *****************************************************************************/
28 /*****************************************************************************
30 *****************************************************************************/
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"
40 #include "../../video_output/android/utils.h"
45 BUF_STATE_NOT_OWNED = 0,
49 /*****************************************************************************
50 * decoder_sys_t : omxil decoder descriptor
51 *****************************************************************************/
52 typedef struct OmxFifo
57 OMX_BUFFERHEADERTYPE *p_first;
58 OMX_BUFFERHEADERTYPE **pp_last;
64 typedef struct HwBuffer
66 vlc_thread_t dequeue_thread;
69 picture_t** inflight_picture; /**< stores the inflight picture for each output buffer or NULL */
71 unsigned int i_buffers;
74 unsigned int i_max_owned;
80 native_window_api_t native_window;
81 native_window_priv_api_t anwpriv;
82 native_window_priv *window_priv;
87 typedef struct OmxPort
91 OMX_HANDLETYPE omx_handle;
92 OMX_PARAM_PORTDEFINITIONTYPE definition;
95 unsigned int i_frame_size;
96 unsigned int i_frame_stride;
97 unsigned int i_frame_stride_chroma_div;
99 unsigned int i_buffers;
100 OMX_BUFFERHEADERTYPE **pp_buffers;
104 OmxFormatParam format_param;
106 OMX_BOOL b_reconfigure;
107 OMX_BOOL b_update_def;
117 OMX_HANDLETYPE omx_handle;
121 char psz_component[OMX_MAX_STRINGNAME_SIZE];
122 char ppsz_components[MAX_COMPONENTS_LIST_SIZE][OMX_MAX_STRINGNAME_SIZE];
123 unsigned int components;
125 OmxEventQueue event_queue;
134 bool b_aspect_ratio_handled;
138 size_t i_nal_size_length; /* Length of the NAL size field for H264 */