• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OMX_EmptyThisBuffer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OMX_EmptyThisBuffer函数的典型用法代码示例。如果您正苦于以下问题:C++ OMX_EmptyThisBuffer函数的具体用法?C++ OMX_EmptyThisBuffer怎么用?C++ OMX_EmptyThisBuffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了OMX_EmptyThisBuffer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: volcEmptyBufferDone

OMX_ERRORTYPE volcEmptyBufferDone(
  OMX_OUT OMX_HANDLETYPE hComponent,
  OMX_OUT OMX_PTR pAppData,
  OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer) {

  int data_read;
  static int iBufferDropped=0;

  DEBUG(DEB_LEV_FULL_SEQ, "Hi there, I am in the %s callback.\n", __func__);
  data_read = read(fd, pBuffer->pBuffer, BUFFER_IN_SIZE);
  pBuffer->nFilledLen = data_read;
  pBuffer->nOffset = 0;
  filesize -= data_read;
  if (data_read <= 0) {
    DEBUG(DEB_LEV_SIMPLE_SEQ, "In the %s no more input data available\n", __func__);
    iBufferDropped++;
    if(iBufferDropped>=2) {
      tsem_up(appPriv->eofSem);
      return OMX_ErrorNone;
    }
    pBuffer->nFilledLen=0;
    pBuffer->nFlags = OMX_BUFFERFLAG_EOS;
    bEOS=OMX_TRUE;
    err = OMX_EmptyThisBuffer(hComponent, pBuffer);
    return OMX_ErrorNone;
  }
  if(!bEOS) {
    DEBUG(DEB_LEV_FULL_SEQ, "Empty buffer %x\n", (int)pBuffer);
    err = OMX_EmptyThisBuffer(hComponent, pBuffer);
  }else {
    DEBUG(DEB_LEV_FULL_SEQ, "In %s Dropping Empty This buffer to Audio Dec\n", __func__);
  }

  return OMX_ErrorNone;
}
开发者ID:allenk,项目名称:libomxil-bellagio,代码行数:35,代码来源:omxvolcontroltest.c


示例2: EmptyBufferDone

OMX_ERRORTYPE EmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
                              OMX_IN OMX_PTR pAppData,
                              OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
{
    int readBytes =0;

    /* To remove warning for unused variable to keep prototype same */
    (void)pAppData;

    ebd_cnt++;
    used_ip_buf_cnt--;
    pthread_mutex_lock(&etb_lock);
    if(!etb_done)
    {
        DEBUG_PRINT("\n*********************************************\n");
        DEBUG_PRINT("Wait till first set of buffers are given to component\n");
        DEBUG_PRINT("\n*********************************************\n");
        etb_done++;
        pthread_mutex_unlock(&etb_lock);
        etb_wait_for_event();
    }
    else
    {
        pthread_mutex_unlock(&etb_lock);
    }


    if(bInputEosReached)
    {
        DEBUG_PRINT("\n*********************************************\n");
        DEBUG_PRINT("   EBD::EOS on input port\n ");
        DEBUG_PRINT("*********************************************\n");
        return OMX_ErrorNone;
    }else if (bFlushing == true) {
      DEBUG_PRINT("omx_evrc13_adec_test: bFlushing is set to TRUE used_ip_buf_cnt=%d\n",used_ip_buf_cnt);
      if (used_ip_buf_cnt == 0) {
        bFlushing = false;
      } else {
        DEBUG_PRINT("omx_evrc13_adec_test: more buffer to come back used_ip_buf_cnt=%d\n",used_ip_buf_cnt);
        return OMX_ErrorNone;
      }
    }

    if((readBytes = Read_Buffer(pBuffer)) > 0) {
        pBuffer->nFilledLen = readBytes;
        used_ip_buf_cnt++;
        OMX_EmptyThisBuffer(hComponent,pBuffer);
    }
    else{
        pBuffer->nFlags |= OMX_BUFFERFLAG_EOS;
        used_ip_buf_cnt++;
        bInputEosReached = true;
        pBuffer->nFilledLen = 0;
        OMX_EmptyThisBuffer(hComponent,pBuffer);
        DEBUG_PRINT("EBD..Either EOS or Some Error while reading file\n");
    }
    return OMX_ErrorNone;
}
开发者ID:Jasi2169,项目名称:android_device_samsung_delos3geur,代码行数:58,代码来源:omx_evrc_enc_test.c


示例3: audiosrcFillBufferDone

OMX_ERRORTYPE audiosrcFillBufferDone(
    OMX_OUT OMX_HANDLETYPE hComponent,
    OMX_OUT OMX_PTR pAppData,
    OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer) {

    OMX_ERRORTYPE err;
    OMX_STATETYPE eState;

    if(pBuffer != NULL) {
        if(!bEOS) {
            /** if there is volume component component in processing state then send this buffer, in non tunneled case
              * else in non tunneled case, write the output buffer contents in the specified output file
              */
            if(flagIsVolCompRequested && (!flagSetupTunnel)) {
                OMX_GetState(appPriv->volume_handle,&eState);
                if(eState == OMX_StateExecuting || eState == OMX_StatePause) {
                    if(pInBufferVolc[0]->pBuffer == pBuffer->pBuffer) {
                        pInBufferVolc[0]->nFilledLen = pBuffer->nFilledLen;
                        err = OMX_EmptyThisBuffer(appPriv->volume_handle, pInBufferVolc[0]);
                    } else {
                        pInBufferVolc[1]->nFilledLen = pBuffer->nFilledLen;
                        err = OMX_EmptyThisBuffer(appPriv->volume_handle, pInBufferVolc[1]);
                    }
                    if(err != OMX_ErrorNone) {
                        DEBUG(DEB_LEV_ERR, "In %s Error %08x Calling FillThisBuffer\n", __func__,err);
                    }
                } else {
                    err = OMX_FillThisBuffer(hComponent, pBuffer);
                }
            } else if((pBuffer->nFilledLen > 0) && (!flagSetupTunnel)) {
                fwrite(pBuffer->pBuffer, 1,  pBuffer->nFilledLen, outfile);
                pBuffer->nFilledLen = 0;
            }
            if(pBuffer->nFlags == OMX_BUFFERFLAG_EOS) {
                DEBUG(DEB_LEV_ERR, "In %s: eos=%x Calling Empty This Buffer\n", __func__, (int)pBuffer->nFlags);
                bEOS = OMX_TRUE;
            }
            if(!bEOS && !flagIsVolCompRequested && (!flagSetupTunnel)) {
                err = OMX_FillThisBuffer(hComponent, pBuffer);
            }
        } else {
            DEBUG(DEB_LEV_ERR, "In %s: eos=%x Dropping Empty This Buffer\n", __func__,(int)pBuffer->nFlags);
        }
    } else {
        DEBUG(DEB_LEV_ERR, "Ouch! In %s: had NULL buffer to output...\n", __func__);
    }
    return OMX_ErrorNone;
}
开发者ID:commshare,项目名称:testGstOmx,代码行数:48,代码来源:omxaudiocapnplay.c


示例4: PortCommTest_WriteInBuffers

    OMX_ERRORTYPE PortCommTest_WriteInBuffers(PortCommTestCtxt* pContext)
    {
        BufferList * pList;
        OMX_BUFFERHEADERTYPE *pBufHeader;
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPayload;

        pList = pContext->pInBufferList;
        while (pList && pList->pBufHdr)
        {
            pContext->nInBufBusy++;
            LIST_CLEAR_ENTRY(pList, pBufHeader);
            nPayload = (pContext->nBufFactor) ? pBufHeader->nAllocLen / pContext->nBufFactor : 1;
            pBufHeader->nFilledLen = OMX_OSAL_ReadFromInputFile(pBufHeader->pBuffer, nPayload,
                                     pBufHeader->nInputPortIndex);
            if (pBufHeader->nFilledLen != nPayload)
            {
                pBufHeader->nFlags |= OMX_BUFFERFLAG_EOS;
            }
            OMX_CONF_BAIL_IF_ERROR(OMX_EmptyThisBuffer(pContext->hWComp, pBufHeader));
        }

OMX_CONF_TEST_BAIL:
        return eError;
    }
开发者ID:Andproject,项目名称:platform_external_opencore,代码行数:25,代码来源:omx_conf_portcommunicationtest.c


示例5: audio_exec

void* audio_exec(void* udata) {
  float buffer_time_us = (float)(1e6 * NUM_SAMPLES) / SAMPLE_FREQ;
  while(1) {
    /* get a buffer */
    OMX_BUFFERHEADERTYPE *hdr;
    while((hdr = ilclient_get_input_buffer(audio_render, 100, 0)) == NULL) {
      usleep(buffer_time_us / 4); // wait 1/4 of the time to drain a buffer
    }

    // fill the buffer
    audio_fill_buffer((int16_t*)hdr->pBuffer, NUM_SAMPLES * 2);
    hdr->nOffset = 0;
    hdr->nFilledLen = scaled_buffer_size(NUM_SAMPLES);

    // submit the buffer
    OMX_ERRORTYPE error;
    error = OMX_EmptyThisBuffer(ILC_GET_HANDLE(audio_render), hdr);
    assert(error == OMX_ErrorNone);

    // drive down the latency to a buffer's length or less
    uint32_t latency;
    while(audio_get_latency() > NUM_SAMPLES) {
      usleep(buffer_time_us / 2);
    }
  }
}
开发者ID:netguy204,项目名称:gambit-game-lib,代码行数:26,代码来源:audio_rpi.c


示例6: read_into_buffer_and_empty

OMX_ERRORTYPE read_into_buffer_and_empty(FILE *fp,
                                         COMPONENT_T *component,
                                         OMX_BUFFERHEADERTYPE *buff_header,
                                         int *toread)
{
    OMX_ERRORTYPE r;

    int buff_size = buff_header->nAllocLen;
    int nread = fread(buff_header->pBuffer, 1, buff_size, fp);

    buff_header->nFilledLen = nread;
    *toread -= nread;
    printf("Read %d, %d still left\n", nread, *toread);

    if (*toread <= 0)
    {
        printf("Setting EOS on input\n");
        buff_header->nFlags |= OMX_BUFFERFLAG_EOS;
    }
    r = OMX_EmptyThisBuffer(ilclient_get_handle(component),
                            buff_header);
    if (r != OMX_ErrorNone)
    {
        fprintf(stderr, "Empty buffer error %s\n",
                err2str(r));
    }
    return r;
}
开发者ID:bennettpeter,项目名称:mythscripts,代码行数:28,代码来源:il_deinterlace.c


示例7: omxSetAudioExtraData

OMX_ERRORTYPE omxSetAudioExtraData(struct OMX_COMPONENT_T *component, uint8_t *extraData, int extraSize)
{
	OMX_ERRORTYPE omxErr = OMX_ErrorNotReady;

	if ((extraSize <= 0) || (extraData == NULL)) {
		return OMX_ErrorNone;
	}

	OMX_BUFFERHEADERTYPE *omxBuffer = omxGetInputBuffer(component, 0);

	if(omxBuffer == NULL) {
		logInfo(LOG_OMX, "Error getting inputbuffer on component %s\n", component->componentName);
		return omxErr;
	}

	omxBuffer->nOffset = 0;
	omxBuffer->nFilledLen = extraSize;
	if(omxBuffer->nFilledLen > omxBuffer->nAllocLen) {
		logInfo(LOG_OMX, "Error omxBuffer->nFilledLen > omxBuffer->nAllocLen on component %s\n", component->componentName);
		return omxErr;
	}

	memset((unsigned char *)omxBuffer->pBuffer, 0x0, omxBuffer->nAllocLen);
	memcpy((unsigned char *)omxBuffer->pBuffer, extraData, omxBuffer->nFilledLen);
	omxBuffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME;

	omxErr = OMX_EmptyThisBuffer(component->handle, omxBuffer);
	if (omxErr != OMX_ErrorNone) {
		logInfo(LOG_OMX, "Error OMX_EmptyThisBuffer on component %s (Error=0x%08x)\n", component->componentName, omxErr);
		return omxErr;
	}

	return OMX_ErrorNone;

}
开发者ID:1stsetup,项目名称:piMythclient,代码行数:35,代码来源:omxAudio.c


示例8: port_enable

OMX_ERRORTYPE port_enable(HTEST *hTest, OMX_U32 nPortIndex)
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_COMPONENTTYPE *hComponent;
	OMX_U32 i;

	hComponent = hTest->hComponent;
	ret = SendCommand(hTest, OMX_CommandPortEnable, nPortIndex, NULL, OMX_FALSE);
	if(ret != OMX_ErrorNone)
		return ret;

	prepare_port_buffers(hTest, nPortIndex);

	WaitCommand(hTest, OMX_CommandPortEnable, nPortIndex, NULL);

	hTest->bHoldBuffers = OMX_FALSE;
	for(i=0; i<hTest->nBufferHdr[nPortIndex]; i++)
	{
		if(hTest->PortDir[nPortIndex] == OMX_DirInput)
		{
			read_frame(hTest, hTest->pBufferHdr[nPortIndex][i]);
			OMX_EmptyThisBuffer(hTest->hComponent, hTest->pBufferHdr[nPortIndex][i]);
		}
	}

	printf("port enable done.\n");

	return OMX_ErrorNone;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:29,代码来源:vpu_test.cpp


示例9: wait_complition

static void wait_complition(player_ctx_t *ctx)
{
    media_buffer_t *buf;
    OMX_BUFFERHEADERTYPE *hdr;
    OMX_ERRORTYPE err;

    if (ctx->common.stop)
        return; /* Force stop player by user */

    buf = decode_get_free_video_buffer(ctx->common.demux_ctx);
    if (!buf)
    {
        DBG_E("Unable to get free video buffer\n");
        return;
    }
    hdr = (OMX_BUFFERHEADERTYPE *)buf->app_data;
    hdr->pAppPrivate = buf;
    hdr->nOffset = 0;
    hdr->nFilledLen = 0;
    hdr->nTimeStamp = to_omx_time(0);
    hdr->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN;

    err = OMX_EmptyThisBuffer(ilcore_get_handle(ctx->decoder), hdr);
    if (err != OMX_ErrorNone)
    {
        DBG_E("OMX_EmptyThisBuffer failed. err=0x%08x\n", err);
        return;
    }
    DBG_I("Waiting for end of stream\n");
    while (!ctx->eos)
    {
        usleep(100000);
    }
}
开发者ID:Andrewftv,项目名称:lbmc,代码行数:34,代码来源:raspi_video_player.c


示例10: CHECK

OMX_ERRORTYPE AnatomyOMXClient::OnEmptyBufferDone(
	    OMX_IN OMX_HANDLETYPE hComponent,
	    OMX_IN OMX_PTR pAppData,
	    OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) {

	AnatomyOMXClient* omxclient = reinterpret_cast<AnatomyOMXClient*>(pAppData);
	int nSize = 0;
	omxclient->addOMXBufferInfo(kPortIndexInput, pBuffer);
	CHECK(NULL != omxclient);
	CHECK( NULL != pBuffer );

	if( pBuffer->nFlags & OMX_BUFFERFLAG_EOS )
	{
		return OMX_ErrorNone;
	}

	omxclient->read(pBuffer->pBuffer, &nSize);

	if( nSize <= 0 ) {
		pBuffer->nSize = 0;
		pBuffer->nFlags |= OMX_BUFFERFLAG_EOS;
	}
	else {
		pBuffer->nSize = nSize;
	}

	OMX_EmptyThisBuffer(hComponent, pBuffer);
	omxclient->removeOMXBufferInfo(kPortIndexInput, pBuffer);
	return OMX_ErrorNone;
}
开发者ID:ioacademy-jikim,项目名称:multimedia,代码行数:30,代码来源:AnatomyOMXClient.cpp


示例11: renderImage

int
renderImage(OPENMAX_JPEG_DECODER * decoder) {
    int ret;

    printf("Rendering image\n");
    printState(decoder->imageDecoder->handle);

    // setup render buffer
    decoder->ppRenderInputBufferHeader[0]->nFilledLen =
	decoder->pOutputBufferHeader->nFilledLen;
    decoder->ppRenderInputBufferHeader[0]->nFlags = OMX_BUFFERFLAG_EOS;

    printf("Render buffer has %d\n",
	   decoder->ppRenderInputBufferHeader[0]->nFilledLen);
    ret = OMX_EmptyThisBuffer(decoder->imageRender->handle,
			     decoder->ppRenderInputBufferHeader[0]);
    if (ret != OMX_ErrorNone) {
	perror("Emptying render input buffer");
	fprintf(stderr, "Error code %s\n", err2str(ret));
	return OMXJPEG_ERROR_MEMORY;
    } else {
	printf("Called to empty render input buffer\n");
    }

    return OMXJPEG_OK;
}
开发者ID:wyongfei,项目名称:LinuxSound-HTMLSource,代码行数:26,代码来源:renderjpeg-notunnel.c


示例12: process_thread

void * process_thread(void *ptr)
{
	HTEST *hTest = (HTEST*)ptr;
	OMX_BUFFERHEADERTYPE *pBufferHdr = NULL;
	MSG sMsg;

	while(1)
	{
		hTest->pMsgQ->Get(&sMsg);
		if(sMsg.type == EVENT)
		{
			process_event(hTest, &sMsg);
		}
		else if(sMsg.type == EMPTY_DONE)
		{
			pBufferHdr = sMsg.data.buffer.pBuffer;
			if(hTest->bHoldBuffers != OMX_TRUE)
			{
				read_data(hTest, pBufferHdr);
				OMX_EmptyThisBuffer(sMsg.hComponent, pBufferHdr);
			}
		}
		else if(sMsg.type == FILL_DONE)
		{
			pBufferHdr = sMsg.data.buffer.pBuffer;
			if(hTest->bHoldBuffers != OMX_TRUE)
				OMX_FillThisBuffer(sMsg.hComponent, pBufferHdr);
		}

		if(hTest->bStop == OMX_TRUE)
			break;
	}

	return NULL;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:35,代码来源:tunnel_test.cpp


示例13: rpi_codec_decode

static void
rpi_codec_decode(struct media_codec *mc, struct video_decoder *vd,
		 struct media_queue *mq, struct media_buf *mb, int reqsize)
{
  media_pipe_t *mp = vd->vd_mp;
  rpi_video_codec_t *rvc = mc->opaque;
  const void *data = mb->mb_data;
  size_t len       = mb->mb_size;

  while(len > 0) {
    OMX_BUFFERHEADERTYPE *buf = omx_get_buffer(rvc->rvc_decoder);
    buf->nOffset = 0;
    buf->nFilledLen = MIN(len, buf->nAllocLen);
    memcpy(buf->pBuffer, data, buf->nFilledLen);
    buf->nFlags = 0;


    if(rvc->rvc_last_epoch != mb->mb_epoch) {
      buf->nFlags |= OMX_BUFFERFLAG_DISCONTINUITY;
      rvc->rvc_last_epoch = mb->mb_epoch;
    }

    if(len <= buf->nAllocLen)
      buf->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;

    data += buf->nFilledLen;
    len  -= buf->nFilledLen;

    if(mb->mb_pts != PTS_UNSET)
      buf->nTimeStamp = omx_ticks_from_s64(mb->mb_pts);
    else {
      buf->nFlags |= OMX_BUFFERFLAG_TIME_UNKNOWN;
      buf->nTimeStamp = omx_ticks_from_s64(0);
    }

    if(mb->mb_skip)
      buf->nFlags |= OMX_BUFFERFLAG_DECODEONLY;

    if(rvc->rvc_decoder->oc_port_settings_changed) {
      rvc->rvc_decoder->oc_port_settings_changed = 0;
      frame_info_t fi;
      memset(&fi, 0, sizeof(fi));
      fi.fi_type        = 'omx';
      fi.fi_data[0]     = (void *)rvc->rvc_decoder;
      mp->mp_video_frame_deliver(&fi, mp->mp_video_frame_opaque);
    }

    omxchk(OMX_EmptyThisBuffer(rvc->rvc_decoder->oc_handle, buf));
  }  

  frame_info_t fi;
  memset(&fi, 0, sizeof(fi));
  fi.fi_drive_clock = mb->mb_drive_clock;
  fi.fi_epoch       = mb->mb_epoch;
  fi.fi_pts         = PTS_UNSET;
  fi.fi_delta       = mb->mb_delta;
  fi.fi_type        = 'omx';
  mp->mp_video_frame_deliver(&fi, mp->mp_video_frame_opaque);
}
开发者ID:dev-life,项目名称:showtime,代码行数:59,代码来源:rpi_video.c


示例14: SampleTest_WriteInBuffers

/*========================================================*/
OMX_ERRORTYPE SampleTest_WriteInBuffers(SampleCompTestCtxt * pContext)
{

	OMX_ERRORTYPE eError = OMX_ErrorNone;
	BufferList *pList;
	OMX_BUFFERHEADERTYPE *pBufHeader;
#ifdef OMX_SAMPLE_TILER_TEST
	OMX_U8 *pTmpBuffer = NULL, *pOrigTmpBuffer = NULL;
#endif
	pList = pContext->pInBufferList;
	while (pList && pList->pBufHdr)
	{
		BUFFERLIST_CLEAR_ENTRY(pList, pBufHeader);
		printf("\nAbout to read from input file\n");
#if defined(OMX_SAMPLE_TILER_TEST)

		//OMX_SAMPLE_BUFFER_SIZE is the total amt of data to be sent in the buffer
		pTmpBuffer =
		    TIMM_OSAL_Malloc(OMX_SAMPLE_BUFFER_SIZE, 0, 0, 0);
		if (pTmpBuffer == NULL)
			OMX_TEST_SET_ERROR_BAIL
			    (OMX_ErrorInsufficientResources,
			    "malloc failed \n");
		pOrigTmpBuffer = pTmpBuffer;

		SampleTest_ReadInputFile(pContext, pTmpBuffer,
		    OMX_SAMPLE_BUFFER_SIZE, pContext->pInputfile);

		Test_Util_Memcpy_1Dto2D(pBufHeader->pBuffer, pTmpBuffer,
		    OMX_SAMPLE_BUFFER_SIZE, OMX_SAMPLE_IN_HEIGHT,
		    OMX_SAMPLE_IN_WIDTH, STRIDE_LINUX);
		pBufHeader->nFilledLen = OMX_SAMPLE_BUFFER_SIZE;

		printf("\nBefore ETB pBufHeader->nInputPortIndex = %d\n",
		    pBufHeader->nInputPortIndex);

		TIMM_OSAL_Free(pOrigTmpBuffer);

#else
		SampleTest_ReadInputFile(pContext, pBufHeader->pBuffer,
		    pBufHeader->nAllocLen, pContext->pInputfile);
		pBufHeader->nFilledLen = pBufHeader->nAllocLen;

#endif
		if (pContext->bEOS == OMX_TRUE)
		{
			pBufHeader->nFlags |= OMX_BUFFERFLAG_EOS;
		}

		eError = OMX_EmptyThisBuffer(pContext->hComp, pBufHeader);

		OMX_TEST_BAIL_IF_ERROR(eError);
	}

      OMX_TEST_BAIL:
	return eError;

}
开发者ID:0xD34D,项目名称:android_device_amazon_tate,代码行数:59,代码来源:test_sample_proxy.c


示例15: OMX_EmptyThisBuffer

OMX_ERRORTYPE omxil_comp::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer)
{
	OMX_ERRORTYPE result;

	result = OMX_EmptyThisBuffer(comp, pBuffer);
	if (result != OMX_ErrorNone) {
		fprintf(stderr, "OMX_EmptyThisBuffer failed.\n");
	}

	return result;
}
开发者ID:katsuster,项目名称:omxil-mf,代码行数:11,代码来源:omxil_comp.cpp


示例16: UnlockSurface

static void UnlockSurface(picture_t *picture)
{
    picture_sys_t *picsys = picture->p_sys;
    vout_display_sys_t *p_sys = picsys->sys;
    OMX_BUFFERHEADERTYPE *p_buffer = picsys->buf;

    if (!p_buffer->nFilledLen)
        OMX_FIFO_PUT(&p_sys->port.fifo, p_buffer);
    else
        OMX_EmptyThisBuffer(p_sys->omx_handle, p_buffer);
}
开发者ID:9034725985,项目名称:vlc,代码行数:11,代码来源:vout.c


示例17: volumeFillBufferDone

OMX_ERRORTYPE volumeFillBufferDone(
    OMX_OUT OMX_HANDLETYPE hComponent,
    OMX_OUT OMX_PTR pAppData,
    OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer) {

    OMX_ERRORTYPE err;
    if(pBuffer != NULL) {
        if(!bEOS) {
            /** if there is no sink component then write buffer content in output file, in non tunneled case
              * else in non tunneled case, call the sink comp handle to process this buffer as its input buffer
              */
            if(flagIsSinkRequested && (!flagSetupTunnel)) {
                if(pInBufferSink[0]->pBuffer == pBuffer->pBuffer) {
                    pInBufferSink[0]->nFilledLen = pBuffer->nFilledLen;
                    err = OMX_EmptyThisBuffer(appPriv->alsasink_handle, pInBufferSink[0]);
                } else {
                    pInBufferSink[1]->nFilledLen = pBuffer->nFilledLen;
                    err = OMX_EmptyThisBuffer(appPriv->alsasink_handle, pInBufferSink[1]);
                }
                if(err != OMX_ErrorNone) {
                    DEBUG(DEB_LEV_ERR, "In %s Error %08x Calling FillThisBuffer\n", __func__,err);
                }
            } else if((pBuffer->nFilledLen > 0) && (!flagSetupTunnel)) {
                fwrite(pBuffer->pBuffer, 1,  pBuffer->nFilledLen, outfile);
                pBuffer->nFilledLen = 0;
            }
            if(pBuffer->nFlags == OMX_BUFFERFLAG_EOS) {
                DEBUG(DEB_LEV_ERR, "In %s: eos=%x Calling Empty This Buffer\n", __func__, (int)pBuffer->nFlags);
                bEOS = OMX_TRUE;
            }
            if(!bEOS && !flagIsSinkRequested && (!flagSetupTunnel)) {
                err = OMX_FillThisBuffer(hComponent, pBuffer);
            }
        } else {
            DEBUG(DEB_LEV_ERR, "In %s: eos=%x Dropping Empty This Buffer\n", __func__,(int)pBuffer->nFlags);
        }
    } else {
        DEBUG(DEB_LEV_ERR, "Ouch! In %s: had NULL buffer to output...\n", __func__);
    }
    return OMX_ErrorNone;
}
开发者ID:commshare,项目名称:testGstOmx,代码行数:41,代码来源:omxaudiocapnplay.c


示例18: OMX_EmptyThisBuffer

OMX_ERRORTYPE COMXCoreComponent::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer)
{
    OMX_ERRORTYPE omx_err = OMX_ErrorNone;

    if(!m_handle || !omx_buffer)
        return OMX_ErrorUndefined;

    omx_err = OMX_EmptyThisBuffer(m_handle, omx_buffer);
    if (omx_err != OMX_ErrorNone) {
        Logger::LogOut(LOG_LEVEL_ERROR, "COMXCoreComponent::EmptyThisBuffer component(%s) - failed with result(0x%x)",
                m_componentName.c_str(), omx_err);
    }

    return omx_err;
}
开发者ID:dlxqlig,项目名称:xmbc_audio_engine,代码行数:15,代码来源:OMXCore.cpp


示例19: ilctts_send_audio

int32_t ilctts_send_audio(TTSRENDER_STATE_T *st, uint8_t *buffer, uint32_t length) {
	OMX_BUFFERHEADERTYPE *hdr = NULL, *prev = NULL;
	int32_t ret = -1;

	if(length % st->bytes_per_sample) {
		ERROR("length invalid in ilctts_send_audio: %d", length);
		return -1;
	}

	if (length > st->buffer_size) {
		ERROR("length exceeds component buffer size in ilctts_send_audio: %d, buffer size: %d", length, st->buffer_size); 
		return -1;
	}

	sem_wait(&st->buffer_list_sema);

	// search through user list for the right buffer header
	hdr = st->user_buffer_list;
	while(hdr != NULL && hdr->pBuffer != buffer && hdr->nAllocLen < length) {
		prev = hdr;
		hdr = hdr->pAppPrivate;
	}

	if(hdr) {
		// we found it, remove from list
		ret = 0;
		if(prev)
			prev->pAppPrivate = hdr->pAppPrivate;
		else
			st->user_buffer_list = hdr->pAppPrivate;
	}

	sem_post(&st->buffer_list_sema);

	if(hdr) {
		OMX_ERRORTYPE omx_err;
		hdr->pAppPrivate = NULL;
		hdr->nOffset = 0;
		hdr->nFilledLen = length;
		INFO(LOGLEVEL_5, "Calling empty_this_buffer");
		omx_err = OMX_EmptyThisBuffer(ILC_GET_HANDLE(st->audio_render), hdr);
		if (omx_err != OMX_ErrorNone) {
			ERROR("OMX_EmptyThisBuffer returned error in ilctts_send_audio: %d", omx_err);
			return -1;
		}
	}
	return ret;
} // end ilctts_send_audio
开发者ID:cromarty,项目名称:ttsprojects,代码行数:48,代码来源:core.c


示例20: g_omx_port_release_buffer

void
g_omx_port_release_buffer (GOmxPort *port,
                           OMX_BUFFERHEADERTYPE *omx_buffer)
{
    switch (port->type)
    {
        case GOMX_PORT_INPUT:
            OMX_EmptyThisBuffer (port->core->omx_handle, omx_buffer);
            break;
        case GOMX_PORT_OUTPUT:
            OMX_FillThisBuffer (port->core->omx_handle, omx_buffer);
            break;
        default:
            break;
    }
}
开发者ID:lhzhang,项目名称:gst-openmax,代码行数:16,代码来源:gstomx_util.c



注:本文中的OMX_EmptyThisBuffer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OMX_FillThisBuffer函数代码示例发布时间:2022-05-30
下一篇:
C++ OMRPORT_ACCESS_FROM_OMRPORT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap