| 118 | } |
| 119 | |
| 120 | bool COMXVideo::SendDecoderConfig() |
| 121 | { |
| 122 | CSingleLock lock (m_critSection); |
| 123 | OMX_ERRORTYPE omx_err = OMX_ErrorNone; |
| 124 | |
| 125 | /* send decoder config */ |
| 126 | if(m_config.hints.extrasize > 0 && m_config.hints.extradata != NULL) |
| 127 | { |
| 128 | OMX_BUFFERHEADERTYPE *omx_buffer = m_omx_decoder.GetInputBuffer(); |
| 129 | |
| 130 | if(omx_buffer == NULL) |
| 131 | { |
| 132 | CLog::Log(LOGERROR, "%s::%s - buffer error 0x%08x", CLASSNAME, __func__, omx_err); |
| 133 | return false; |
| 134 | } |
| 135 | |
| 136 | omx_buffer->nOffset = 0; |
| 137 | omx_buffer->nFilledLen = std::min((OMX_U32)m_config.hints.extrasize, omx_buffer->nAllocLen); |
| 138 | |
| 139 | memset((unsigned char *)omx_buffer->pBuffer, 0x0, omx_buffer->nAllocLen); |
| 140 | memcpy((unsigned char *)omx_buffer->pBuffer, m_config.hints.extradata, omx_buffer->nFilledLen); |
| 141 | omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; |
| 142 | |
| 143 | omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); |
| 144 | if (omx_err != OMX_ErrorNone) |
| 145 | { |
| 146 | CLog::Log(LOGERROR, "%s::%s - OMX_EmptyThisBuffer() failed with result(0x%x)\n", CLASSNAME, __func__, omx_err); |
| 147 | m_omx_decoder.DecoderEmptyBufferDone(m_omx_decoder.GetComponent(), omx_buffer); |
| 148 | return false; |
| 149 | } |
| 150 | } |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | bool COMXVideo::NaluFormatStartCodes(enum AVCodecID codec, uint8_t *in_extradata, int in_extrasize) |
| 155 | { |
nothing calls this directly
no test coverage detected