sdf

来源:互联网 发布:java泛型 pdf 编辑:程序博客网 时间:2024/06/05 23:07
AVFrame*pFrame,*pFrameYUV;pFrame = avcodec_alloc_frame();pFrameYUV = avcodec_alloc_frame();uint8_t *out_buffer;out_buffer = new uint8_t[avpicture_get_size(PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height)];avpicture_fill((AVPicture *)pFrameYUV, out_buffer, PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);//------------SDL----------------if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {  printf( "Could not initialize SDL - %s\n", SDL_GetError()); return -1;} SDL_Surface *screen; screen = SDL_SetVideoMode(pCodecCtx->width, pCodecCtx->height, 0, 0);if(!screen) {  printf("SDL: could not set video mode - exiting\n");  return -1;}SDL_Overlay *bmp; bmp = SDL_CreateYUVOverlay(pCodecCtx->width, pCodecCtx->height,SDL_YV12_OVERLAY, screen); SDL_Rect rect;//---------------int ret, got_picture;int y_size = pCodecCtx->width * pCodecCtx->height;AVPacket *packet=(AVPacket *)av_malloc(sizeof(AVPacket));

0 0
原创粉丝点击