Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with FFMPEG #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/film.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,22 +374,22 @@ int film::process() {
/*
* Allocate current and previous video frames
*/
pFrame = avcodec_alloc_frame();
pFrame = av_frame_alloc();
// RGB:
pFrameRGB = avcodec_alloc_frame(); // current frame
pFrameRGBprev = avcodec_alloc_frame(); // previous frame
pFrameRGB = av_frame_alloc(); // current frame
pFrameRGBprev = av_frame_alloc(); // previous frame
// YUV:
pFrameYUV = avcodec_alloc_frame(); // current frame
pFrameYUV = av_frame_alloc(); // current frame

/*
* Allocate memory for the pixels of a picture and setup the AVPicture
* fields for it
*/
// RGB:
avpicture_alloc((AVPicture *)pFrameRGB, PIX_FMT_RGB24, width, height);
avpicture_alloc((AVPicture *)pFrameRGBprev, PIX_FMT_RGB24, width, height);
avpicture_alloc((AVPicture *)pFrameRGB, AV_PIX_FMT_RGB24, width, height);
avpicture_alloc((AVPicture *)pFrameRGBprev, AV_PIX_FMT_RGB24, width, height);
// YUV:
avpicture_alloc((AVPicture *)pFrameYUV, PIX_FMT_YUV444P, width, height);
avpicture_alloc((AVPicture *)pFrameYUV, AV_PIX_FMT_YUV444P, width, height);

/*
* Mise en place du premier plan
Expand Down Expand Up @@ -428,7 +428,7 @@ int film::process() {
if (!img_ctx) {
img_ctx =
sws_getContext(width, height, pCodecCtx->pix_fmt, width, height,
PIX_FMT_YUV444P, SWS_BICUBIC, NULL, NULL, NULL);
AV_PIX_FMT_YUV444P, SWS_BICUBIC, NULL, NULL, NULL);
if (!img_ctx) {
fprintf(stderr,
"Cannot initialize the converted YUV image context!\n");
Expand All @@ -440,7 +440,7 @@ int film::process() {
if (!img_convert_ctx) {
img_convert_ctx =
sws_getContext(width, height, pCodecCtx->pix_fmt, width, height,
PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
AV_PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
if (!img_convert_ctx) {
fprintf(stderr,
"Cannot initialize the converted RGB image context!\n");
Expand Down Expand Up @@ -492,7 +492,7 @@ int film::process() {
}
/* Copy current frame as "previous" for next round */
av_picture_copy((AVPicture *)pFrameRGBprev, (AVPicture *)pFrameRGB,
PIX_FMT_RGB24, width, height);
AV_PIX_FMT_RGB24, width, height);

if (display) do_stats(pCodecCtx->frame_number);
}
Expand Down Expand Up @@ -589,7 +589,7 @@ void film::process_audio() {
len = packet.size;

while (len > 0) {
this->audio_buf = avcodec_alloc_frame();
this->audio_buf = av_frame_alloc();
// (short *) av_fast_realloc (this->audio_buf, &samples_size, FFMAX
// (packet.size, AVCODEC_MAX_AUDIO_FRAME_SIZE));
data_size = samples_size;
Expand Down