@@ -185,11 +185,11 @@ namespace CGE
185185 return false ; // 申请frame 失败.
186186 }
187187
188- int numBytes = avpicture_get_size (PIX_FMT_RGBA , m_context->pVideoCodecCtx ->width ,
188+ int numBytes = avpicture_get_size (AV_PIX_FMT_RGBA , m_context->pVideoCodecCtx ->width ,
189189 m_context->pVideoCodecCtx ->height );
190190 m_bufferPtr = (uint8_t *)av_malloc (numBytes * sizeof (uint8_t ));
191191
192- avpicture_fill ((AVPicture *)m_context->pVideoFrameRGB , m_bufferPtr, PIX_FMT_RGBA , m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height );
192+ avpicture_fill ((AVPicture *)m_context->pVideoFrameRGB , m_bufferPtr, AV_PIX_FMT_RGBA , m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height );
193193 return true ;
194194 }
195195
@@ -381,7 +381,7 @@ namespace CGE
381381 CGEVideoFrameBufferData CGEVideoDecodeHandler::getCurrentVideoFrameRGB ()
382382 {
383383
384- SwsContext* img_convert_ctx = sws_getContext (m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height , m_context->pVideoCodecCtx ->pix_fmt , m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height , PIX_FMT_RGBA , m_samplingStyle, nullptr , nullptr , nullptr );
384+ SwsContext* img_convert_ctx = sws_getContext (m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height , m_context->pVideoCodecCtx ->pix_fmt , m_context->pVideoCodecCtx ->width , m_context->pVideoCodecCtx ->height , AV_PIX_FMT_RGBA , m_samplingStyle, nullptr , nullptr , nullptr );
385385 // Convert the image from its native format to RGB
386386 sws_scale (img_convert_ctx, m_context->pVideoFrame ->data , m_context->pVideoFrame ->linesize , 0 , m_height, m_context->pVideoFrameRGB ->data , m_context->pVideoFrameRGB ->linesize );
387387
0 commit comments