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, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #include <sys/ioctl.h>
30 #include <EGL/eglext.h>
33 #include "osdvector.h"
37 class EGLPictureCreator {
39 virtual bool getEGLPicture(struct OsdVector::PictureInfo & info, EGLDisplay * display ) = 0;
44 class ImageOMX : public OsdVector::PictureDecoder
46 friend class VideoOMX;
48 ImageOMX(OsdVector::PictureReader * treader);
54 bool decodePicture(LoadIndex index, unsigned char * buffer, unsigned int length);
55 bool getDecodedPicture(struct OsdVector::PictureInfo& pict_inf);
56 void freeReference(void * ref);
60 static OMX_ERRORTYPE EmptyBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp,OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
61 static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
64 void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver);
65 void ReturnFillOMXBuffer(OMX_BUFFERHEADERTYPE* buffer);
68 OMX_HANDLETYPE omx_imag_decode;
69 OMX_HANDLETYPE omx_egl_render;
71 OMX_U32 omx_image_input_port;
72 OMX_U32 omx_image_output_port;
74 OMX_U32 omx_egl_input_port;
75 OMX_U32 omx_egl_output_port;
78 int AllocateCodecsOMX();
79 int DeAllocateCodecsOMX();
81 int PrepareInputBufsOMX(bool setportdef);
82 int DestroyInputBufsOMX();
83 int DestroyInputBufsOMXwhilePlaying();
87 vector<OMX_BUFFERHEADERTYPE*> input_bufs_omx_all;
88 list<OMX_BUFFERHEADERTYPE*> input_bufs_omx_free;
89 //list<OMX_BUFFERHEADERTYPE*> output_bufs_omx_full;
90 Mutex input_bufs_omx_mutex;
99 OsdVector::PictureInfo pictInf;