Skip to content

Commit 076290c

Browse files
committed
fix compile error with ffmpeg 3.4.8
1 parent 4eeaced commit 076290c

File tree

14 files changed

+4
-4
lines changed

14 files changed

+4
-4
lines changed

library/src/main/jni/interface/cgeVideoDecoder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

library/src/main/jni/interface/cgeVideoEncoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ namespace CGE
326326
}
327327

328328
/* allocate and init a re-usable frame */
329-
m_context->pVideoFrame = avcodec_alloc_frame();
329+
m_context->pVideoFrame = av_frame_alloc();
330330
if (!m_context->pVideoFrame) {
331331
//fprintf(stderr, "Could not allocate video frame\n");
332332
return false;
853 KB
Binary file not shown.
259 KB
Binary file not shown.
0 Bytes
Binary file not shown.
583 KB
Binary file not shown.
135 KB
Binary file not shown.
0 Bytes
Binary file not shown.
830 KB
Binary file not shown.
246 KB
Binary file not shown.

0 commit comments

Comments
 (0)