Guest User

Untitled

a guest
Nov 16th, 2011
143
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. decode_h264(const uint8_t* in_buf, int in_buf_size, uint8_t** out_buf, int* out_buf_size,UserRenderInfo &userInfo)
  2. {
  3. while(in_buf_size > 0)
  4. {
  5. int len = 0;
  6. len = av_parser_parse2(userInfo.pDecoderParserContext,userInfo.pCodecCtx, &m_avpkt.data, &m_avpkt.size, in_buf, in_buf_size, 0, 0, 0);
  7.  
  8. in_buf += len;
  9. in_buf_size -= len;
  10.  
  11. if(m_avpkt.size > 0)
  12. {
  13. int res;
  14. res = avcodec_decode_video2(userInfo.pCodecCtx, userInfo.pFrame,&got_picture,&m_avpkt);
  15.  
  16. av_free_packet(&m_avpkt);
  17. if (got_picture)
  18. {
  19. sws_scale(userInfo.decoderConvertCtx, userInfo.pFrame->data, userInfo.pFrame- >linesize , 0, userInfo.pFrame->height, userInfo.pOutFrame->data, userInfo.pOutFrame->linesize);
  20.  
  21. *out_buf_size = userInfo.pOutFrame->linesize[0];
  22. *out_buf = userInfo.pOutFrame->data[0];
  23. }
  24. }
  25. break;
  26. }
  27. }
  28.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×