omxvideodec: support interlace-mode=interleaved input
[platform/upstream/gstreamer.git] / omx / gstomxvideo.h
1 /*
2  * Copyright 2014 Advanced Micro Devices, Inc.
3  *   Author: Christian König <christian.koenig@amd.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation
8  * version 2.1 of the License.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
18  *
19  */
20
21 #ifndef __GST_OMX_VIDEO_H__
22 #define __GST_OMX_VIDEO_H__
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #include <gst/gst.h>
29 #include <gst/video/video.h>
30 #include <gst/video/gstvideodecoder.h>
31 #include <gst/video/gstvideoencoder.h>
32
33 #include "gstomx.h"
34
35 G_BEGIN_DECLS
36
37 /* Keep synced with gst_omx_video_get_format_from_omx(). Sort by decreasing quality */
38 #define GST_OMX_VIDEO_DEC_SUPPORTED_FORMATS "{ NV16_10LE32, NV12_10LE32, " \
39   "NV16, YUY2, YVYU, UYVY, NV12, I420, RGB16, BGR16, ABGR, ARGB, GRAY8 }"
40
41 #define GST_OMX_VIDEO_ENC_SUPPORTED_FORMATS "{ NV16_10LE32, NV12_10LE32, " \
42   "NV16, NV12, I420, GRAY8 }"
43
44 typedef struct
45 {
46   GstVideoFormat format;
47   OMX_COLOR_FORMATTYPE type;
48 } GstOMXVideoNegotiationMap;
49
50 GstVideoFormat
51 gst_omx_video_get_format_from_omx (OMX_COLOR_FORMATTYPE omx_colorformat);
52
53 GList *
54 gst_omx_video_get_supported_colorformats (GstOMXPort * port,
55     GstVideoCodecState * state);
56
57 GstCaps * gst_omx_video_get_caps_for_map(GList * map);
58
59 void
60 gst_omx_video_negotiation_map_free (GstOMXVideoNegotiationMap * m);
61
62 GstVideoCodecFrame *
63 gst_omx_video_find_nearest_frame (GstElement * element, GstOMXBuffer * buf, GList * frames);
64
65 OMX_U32 gst_omx_video_calculate_framerate_q16 (GstVideoInfo * info);
66
67 gboolean gst_omx_video_is_equal_framerate_q16 (OMX_U32 q16_a, OMX_U32 q16_b);
68
69 gboolean gst_omx_video_get_port_padding (GstOMXPort * port, GstVideoInfo * info_orig,
70     GstVideoAlignment * align);
71
72 G_END_DECLS
73
74 #endif /* __GST_OMX_VIDEO_H__ */