• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**************************************************************************
2  *
3  * Copyright 2013 Advanced Micro Devices, Inc.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sub license, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial portions
16  * of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21  * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
22  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  **************************************************************************/
27 
28 /*
29  * Authors:
30  *      Christian König <christian.koenig@amd.com>
31  *
32  */
33 
34 #ifndef OMX_VID_DEC_H
35 #define OMX_VID_DEC_H
36 
37 #include <string.h>
38 
39 #include <OMX_Types.h>
40 #include <OMX_Component.h>
41 
42 #include "os/os_thread.h"
43 
44 #include "vid_dec_common.h"
45 
46 #define OMX_VID_DEC_BASE_NAME "OMX.mesa.video_decoder"
47 
48 #define OMX_VID_DEC_MPEG2_NAME "OMX.mesa.video_decoder.mpeg2"
49 #define OMX_VID_DEC_MPEG2_ROLE "video_decoder.mpeg2"
50 
51 #define OMX_VID_DEC_AVC_NAME "OMX.mesa.video_decoder.avc"
52 #define OMX_VID_DEC_AVC_ROLE "video_decoder.avc"
53 
54 #define OMX_VID_DEC_HEVC_NAME "OMX.mesa.video_decoder.hevc"
55 #define OMX_VID_DEC_HEVC_ROLE "video_decoder.hevc"
56 
57 #define OMX_VID_DEC_AV1_NAME "OMX.mesa.video_decoder.av1"
58 #define OMX_VID_DEC_AV1_ROLE "video_decoder.av1"
59 
60 #define OMX_VID_DEC_TIMESTAMP_INVALID ((OMX_TICKS) -1)
61 
62 OMX_ERRORTYPE vid_dec_LoaderComponent(stLoaderComponentType *comp);
63 
64 /* vid_dec_mpeg12.c */
65 void vid_dec_mpeg12_Init(vid_dec_PrivateType *priv);
66 
67 /* vid_dec_h264.c */
68 void vid_dec_h264_Init(vid_dec_PrivateType *priv);
69 
70 /* vid_dec_h265.c */
71 void vid_dec_h265_Init(vid_dec_PrivateType *priv);
72 
73 /* vid_dec_av1.c */
74 void vid_dec_av1_Init(vid_dec_PrivateType *priv);
75 
76 OMX_ERRORTYPE vid_dec_av1_AllocateInBuffer(omx_base_PortType *port,
77                                            OMX_INOUT OMX_BUFFERHEADERTYPE **buf,
78                                            OMX_IN OMX_U32 idx, OMX_IN OMX_PTR private,
79                                            OMX_IN OMX_U32 size);
80 
81 OMX_ERRORTYPE vid_dec_av1_UseInBuffer(omx_base_PortType *port, OMX_BUFFERHEADERTYPE **buf,
82                                       OMX_U32 idx, OMX_PTR private, OMX_U32 size, OMX_U8 *mem);
83 
84 void vid_dec_av1_FrameDecoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE* input,
85                               OMX_BUFFERHEADERTYPE* output);
86 
87 void vid_dec_av1_ReleaseTasks(vid_dec_PrivateType *priv);
88 
89 void vid_dec_av1_FreeInputPortPrivate(vid_dec_PrivateType *priv, OMX_BUFFERHEADERTYPE *buf);
90 
91 #endif
92