2 Copyright 2004-2005 Chris Tallon, 2009,2012, 2014 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
26 #include <sys/ioctl.h>
30 #include <EGL/eglext.h>
33 #include "osdvector.h"
36 #include "eglpicturecreator.h"
40 class ImageOMX : public PictureDecoder
42 friend class VideoOMX;
50 unsigned char* decodePicture(LoadingIndex index, unsigned char * buffer, unsigned int length, bool freemem);
51 bool getDecodedPicture(struct PictureInfo& pict_inf);
52 void freeReference(void * ref);
56 static OMX_ERRORTYPE EmptyBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp,OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
57 static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
60 bool intDecodePicture(LoadingIndex index, unsigned char * buffer, unsigned int length, EGLPictureCreator* egl_pict, VideoOMX *video);
62 void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver);
63 void ReturnFillOMXBuffer(OMX_BUFFERHEADERTYPE* buffer);
66 OMX_HANDLETYPE omx_imag_decode;
67 OMX_HANDLETYPE omx_egl_render;
69 OMX_U32 omx_image_input_port;
70 OMX_U32 omx_image_output_port;
72 OMX_U32 omx_egl_input_port;
73 OMX_U32 omx_egl_output_port;
76 int AllocateCodecsOMX( unsigned char * buffer, unsigned int length);
77 int DeAllocateCodecsOMX();
79 int PrepareInputBufsOMX(bool setportdef, unsigned char * buffer, unsigned int length);
80 int DestroyInputBufsOMX();
81 int DestroyInputBufsOMXwhilePlaying();
89 enum ImageFormats curformat;
93 std::vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
94 std::list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
95 //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
96 std::mutex input_bufs_omx_mutex;
102 OMX_BUFFERHEADERTYPE *buf_head_egl;
106 char L_VPE_OMX_IMAGE_DECODER[128];
107 char L_VPE_OMX_EGL_REND[128];