#include "omx.h"
-static const char* TAG = "OMX";
+//static const char* TAG = "OMX";
// Static variable storage
pdt.nSize = sizeof(pdt);
pdt.nVersion.nVersion = OMX_VERSION;
pdt.nPortIndex = port;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &pdt);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX::enablePort()", error);
if (pdt.bEnabled == enable) return; // already in requested state
OMX_COMMANDTYPE command = enable ? OMX_CommandPortEnable : OMX_CommandPortDisable;
// log->debug(TAG, "en/disablePort: port: {:#x}, command: {:#x}", port, command);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_SendCommand(componentHandle, command, port, 0);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SendCommand in OMX::enablePort()", error);
// log->debug(TAG, "en/disablePort: port: {:#x}, command: {:#x} done", port, command);
void OMX::changeState(OMX_STATETYPE reqState, bool wait)
{
OMX_STATETYPE currentState;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_GetState(componentHandle, ¤tState);
+ #pragma GCC diagnostic pop
// log->debug(TAG, "Current state: {}", currentState);
if (currentState == reqState)
{
}
std::unique_lock<std::mutex> ul(eventWaitersMutex);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_SendCommand(componentHandle, OMX_CommandStateSet, reqState, 0);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SendCommand in OMX::changeState()", error);
EventWaiter* eventWaiter = new EventWaiter();
{
std::unique_lock<std::mutex> ul(eventWaitersMutex);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_SendCommand(componentHandle, OMX_CommandFlush, port, NULL);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SendCommand in OMX::flushCommands()", error);
EventWaiter* eventWaiter = new EventWaiter();
p_param.nSize = sizeof(p_param);
p_param.nVersion.nVersion = OMX_VERSION;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_GetParameter(componentHandle, OMX_IndexParamVideoInit, &p_param);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) return false;
inputPort = p_param.nStartPortNumber;
portConfig.nVersion.nVersion = OMX_VERSION;
portConfig.nPortIndex = inputPort;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &portConfig);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX_EGL_Render::prepareInputPort()", error);
/*
// log->debug(TAG, "calling setParameter: w {} h {} str {} sli {}", portConfig.format.video.nFrameWidth, portConfig.format.video.nFrameHeight,
// portConfig.format.video.nStride, portConfig.format.video.nSliceHeight);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_SetParameter(componentHandle, OMX_IndexParamPortDefinition, &portConfig);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SetParameter in OMX_EGL_Render::prepareInputPort()", error);
// printPortSettings(false);
port_def_type.nVersion.nVersion = OMX_VERSION;
port_def_type.nPortIndex = outputPort;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &port_def_type);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX_EGL_Render::prep()", error);
port_def_type.nBufferCountActual = 1;
port_def_type.format.video.pNativeWindow = egldisplay;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_SetParameter(componentHandle, OMX_IndexParamPortDefinition, &port_def_type); // set port def: buffer count actual = 1
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SetParameter in OMX_EGL_Render::prep()", error);
}
inBuffer1 = NULL;
// log->debug(TAG, "Calling OMX_UseBuffer with data = {}", static_cast<void*>(data));
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_UseBuffer(componentHandle, &inBuffer1, inputPort, static_cast<OMX_PTR>(0), inputPortBufferSize, reinterpret_cast<OMX_U8*>(data));
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_UseBuffer in OMX_EGL_Render::allocateInputBuffers()", error);
/*
void OMX_EGL_Render::allocateEGLImageKHR(EGLImageKHR eglimagekhr)
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_UseEGLImage(componentHandle, &eglRenderOutputBufferHeader, outputPort, this, static_cast<void*>(eglimagekhr));
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_UseEGLImage in OMX_EGL_Render::allocateEGLImageKHR()", error);
// printPortSettings(true);
void OMX_EGL_Render::deallocateInputBuffers()
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_FreeBuffer(componentHandle, inputPort, inBuffer1);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FreeBuffer in OMX_EGL_Render::deallocateInputBuffers()", error);
inBuffer1 = NULL;
void OMX_EGL_Render::deallocateEGLImageKHR()
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_FreeBuffer(componentHandle, outputPort, eglRenderOutputBufferHeader);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FreeBuffer in OMX_EGL_Render::deallocateEGLImageKHR()", error);
eglRenderOutputBufferHeader = NULL;
inBuffer1->pBuffer = reinterpret_cast<OMX_U8*>(data);
// log->debug(TAG, "calling emptythisbuffer");
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_EmptyThisBuffer(componentHandle, inBuffer1);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_EmptyThisBuffer in OMX_EGL_Render::sendToInput()", error);
// log->debug(TAG, "sendToInput done");
}
// log->debug(TAG, "calling fillthisbuffer. bufhead: {}, BufferWithOutput: {}", static_cast<void*>(eglRenderOutputBufferHeader), static_cast<void*>(bufferWithOutputPort));
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_FillThisBuffer(componentHandle, eglRenderOutputBufferHeader);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FillThisBuffer in OMX_EGL_Render::render()", error);
// log->debug(TAG, "done fillthisbuffer. bufhead: {}, BufferWithOutput: {}", static_cast<void*>(eglRenderOutputBufferHeader), static_cast<void*>(bufferWithOutputPort));
portSettings.nPortIndex = inputPort;
}
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &portSettings);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX_EGL_Render::printPortSettings()", error);
log->debug(TAG, " nPortIndex: {}", portSettings.nPortIndex);
log->debug(TAG, " eColorFormat: {:#x}", portSettings.format.video.eColorFormat);
}
-OMX_ERRORTYPE OMX_EGL_Render::cb_EmptyBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+OMX_ERRORTYPE OMX_EGL_Render::cb_EmptyBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* /*buffer*/)
{
/*
log->debug(TAG, "CB: EmptyBufferDone");
return OMX_ErrorNone;
}
-OMX_ERRORTYPE OMX_EGL_Render::cb_FillBufferDone(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+OMX_ERRORTYPE OMX_EGL_Render::cb_FillBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
// log->debug(TAG, "CB: FillBufferDone, handle: {}, appdata: {}, buffer: {}", static_cast<void*>(hcomp), static_cast<void*>(appdata), static_cast<void*>(buffer));
#include "omximagedecode.h"
-static const char* TAG = "OMX_Image_Decode";
+// static const char* TAG = "OMX_Image_Decode";
OMX_Image_Decode::OMX_Image_Decode()
{
p_param.nSize = sizeof(p_param);
p_param.nVersion.nVersion = OMX_VERSION;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_GetParameter(componentHandle, OMX_IndexParamImageInit, &p_param);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) return false;
inputPort = p_param.nStartPortNumber;
port_def_type.nVersion.nVersion = OMX_VERSION;
port_def_type.nPortIndex = inputPort;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &port_def_type);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX_Image_Decode::prepareInputBuffers()", error);
// log->debug(TAG, "Defaults: bufferCountActual: {}, bufferCountMin: {}, nBufferSize: {}",
// log->debug(TAG, "Setting buf count actual: {}, buf size: {}",
// port_def_type.nBufferCountActual, port_def_type.nBufferSize);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_SetParameter(componentHandle, OMX_IndexParamPortDefinition, &port_def_type);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SetParameter in OMX_Image_Decode::prepareInputBuffers()", error);
}
// only outputs JPEG decoded images in YUV420, because of course it does.
// ft_type.eCompressionFormat = OMX_IMAGE_CodingJPEG;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_SetParameter(componentHandle, OMX_IndexParamImagePortFormat, &ft_type);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SetParameter in OMX_Image_Decode::setFormat()", error);
// log->debug(TAG, "setFormat OK");
}
outputPortSettings.format.image.nSliceHeight = newSliceHeight;
// log->debug(TAG, "nSliceHeight: {}", outputPortSettings.format.image.nSliceHeight);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_SetParameter(componentHandle, OMX_IndexParamPortDefinition, &outputPortSettings);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_SetParameter in OMX_Image_Decode::setSliceHeight()", error);
/*
inBuffer2 = NULL;
// log->debug(TAG, "Calling OMX_UseBuffer");
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_UseBuffer(componentHandle, &inBuffer1, inputPort, static_cast<OMX_PTR>(0), dataSize, reinterpret_cast<OMX_U8*>(data));
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_UseBuffer 1 in OMX_Image_Decode::allocateInputBuffers()", error);
// Hardcoded assumption - image_decode has min 2 input buffers
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_UseBuffer(componentHandle, &inBuffer2, inputPort, static_cast<OMX_PTR>(0), 0, NULL);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_UseBuffer 2 in OMX_Image_Decode::allocateInputBuffers()", error);
}
void OMX_Image_Decode::allocateOutputBuffer()
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_UseBuffer(componentHandle, &outputBufferHeader, outputPort, static_cast<OMX_PTR>(0), outputPortSettings.nBufferSize, (OMX_U8*)NULL);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_UseBuffer in OMX_Image_Decode::allocateOutputBuffer()", error);
}
void OMX_Image_Decode::deallocateInputBuffers()
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_FreeBuffer(componentHandle, inputPort, inBuffer1);
+ #pragma GCC diagnostic pop
inBuffer1 = NULL;
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FreeBuffer 1 in OMX_Image_Decode::deallocateInputBuffers()", error);
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_FreeBuffer(componentHandle, inputPort, inBuffer2);
+ #pragma GCC diagnostic pop
inBuffer2 = NULL;
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FreeBuffer 2 in OMX_Image_Decode::deallocateInputBuffers()", error);
}
void OMX_Image_Decode::deallocateOutputBuffer()
{
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_FreeBuffer(componentHandle, outputPort, outputBufferHeader);
+ #pragma GCC diagnostic pop
outputBufferHeader = NULL;
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FreeBuffer in OMX_Image_Decode::deallocateOutputBuffer()", error);
}
inBuffer1->nFlags |= OMX_BUFFERFLAG_EOS;
// log->debug(TAG, "calling emptythisbuffer");
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_EmptyThisBuffer(componentHandle, inBuffer1);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_EmptyThisBuffer in OMX_Image_Decode::sendToInput()", error);
// log->debug(TAG, "sendToInput done");
}
outputPortSettings.nSize = sizeof(outputPortSettings);
outputPortSettings.nVersion.nVersion = OMX_VERSION;
outputPortSettings.nPortIndex = outputPort;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
OMX_ERRORTYPE error = OMX_GetParameter(componentHandle, OMX_IndexParamPortDefinition, &outputPortSettings);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_GetParameter in OMX_Image_Decode::waitForOutputPortSettingsChange()", error);
/*
OMX_ERRORTYPE error;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wold-style-cast"
error = OMX_FillThisBuffer(componentHandle, outputBufferHeader);
+ #pragma GCC diagnostic pop
if (error != OMX_ErrorNone) throw OMX_Exception("OMX_FillThisBuffer in OMX_Image_Decode::receiveFromOutput()", error);
// log->debug(TAG, "called fillthisbuffer. bufsize = {}", outputPortSettings.nBufferSize);
*sliceHeight = outputPortSettings.format.image.nSliceHeight;
}
-OMX_ERRORTYPE OMX_Image_Decode::cb_EmptyBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+OMX_ERRORTYPE OMX_Image_Decode::cb_EmptyBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* /*buffer*/)
{
/*
log->debug(TAG, "CB: EmptyBufferDone");
return OMX_ErrorNone;
}
-OMX_ERRORTYPE OMX_Image_Decode::cb_FillBufferDone(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+OMX_ERRORTYPE OMX_Image_Decode::cb_FillBufferDone(OMX_IN OMX_HANDLETYPE /*hcomp*/, OMX_IN OMX_PTR /*appdata*/, OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
// log->debug(TAG, "CB: FillBufferDone, handle: {}, appdata: {}, buffer: {}", static_cast<void*>(hcomp), static_cast<void*>(appdata), static_cast<void*>(buffer));
class PictureDecoder
{
public:
- PictureDecoder(PictureReader* treader) {/* reader = treader; */};
+ PictureDecoder(PictureReader* /*treader*/) {/* reader = treader; */};
virtual ~PictureDecoder() {};
// its is always guaranted, that after getDecodedPicture a call to decodePicture follows, if the return value was true;