1 --- blender-2.76/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp~ 2015-10-07 02:09:33.000000000 +0200
2 +++ blender-2.76/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 2016-03-21 12:54:10.943584079 +0100
7 - frame = avcodec_alloc_frame();
8 + frame = av_frame_alloc();
10 - avcodec_get_frame_defaults(frame);
11 + av_frame_unref(frame);
13 read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
15 --- blender-2.76/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp~ 2015-10-07 02:09:33.000000000 +0200
16 +++ blender-2.76/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp 2016-03-21 12:54:54.334128942 +0100
18 m_frame = av_frame_alloc();
20 AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
21 - avcodec_get_frame_defaults(m_frame);
22 + av_frame_unref(m_frame);
23 m_frame->linesize[0] = m_input_size * samplesize;
24 m_frame->format = m_codecCtx->sample_fmt;
25 m_frame->nb_samples = m_input_size;
26 --- blender-2.76/source/blender/blenkernel/intern/writeffmpeg.c.orig 2016-03-21 13:17:27.104210256 +0100
27 +++ blender-2.76/source/blender/blenkernel/intern/writeffmpeg.c 2016-03-21 13:19:51.459372230 +0100
29 context->audio_time += (double) context->audio_input_samples / (double) c->sample_rate;
31 #ifdef FFMPEG_HAVE_ENCODE_AUDIO2
32 - frame = avcodec_alloc_frame();
33 - avcodec_get_frame_defaults(frame);
34 + frame = av_frame_alloc();
35 + av_frame_unref(frame);
36 frame->pts = context->audio_time / av_q2d(c->time_base);
37 frame->nb_samples = context->audio_input_samples;
38 frame->format = c->sample_fmt;
43 - avcodec_free_frame(&frame);
44 + av_frame_free(&frame);
49 if (av_interleaved_write_frame(context->outfile, &pkt) != 0) {
50 fprintf(stderr, "Error writing audio packet!\n");
52 - avcodec_free_frame(&frame);
53 + av_frame_free(&frame);
61 - avcodec_free_frame(&frame);
62 + av_frame_free(&frame);
69 /* allocate space for the struct */
70 - f = avcodec_alloc_frame();
71 + f = av_frame_alloc();
73 size = avpicture_get_size(pix_fmt, width, height);
74 /* allocate the actual picture buffer */
76 int height = c->height;
79 - if (c->pix_fmt != PIX_FMT_BGR32) {
80 - rgb_frame = alloc_picture(PIX_FMT_BGR32, width, height);
81 + if (c->pix_fmt != AV_PIX_FMT_BGR32) {
82 + rgb_frame = alloc_picture(AV_PIX_FMT_BGR32, width, height);
84 BKE_report(reports, RPT_ERROR, "Could not allocate temporary frame");
90 - if (c->pix_fmt != PIX_FMT_BGR32) {
91 + if (c->pix_fmt != AV_PIX_FMT_BGR32) {
92 sws_scale(context->img_convert_ctx, (const uint8_t *const *) rgb_frame->data,
93 rgb_frame->linesize, 0, c->height,
94 context->current_frame->data, context->current_frame->linesize);
95 delete_picture(rgb_frame);
98 - context->current_frame->format = PIX_FMT_BGR32;
99 + context->current_frame->format = AV_PIX_FMT_BGR32;
100 context->current_frame->width = width;
101 context->current_frame->height = height;
103 @@ -586,12 +586,12 @@
106 /* makes HuffYUV happy ... */
107 - c->pix_fmt = PIX_FMT_YUV422P;
108 + c->pix_fmt = AV_PIX_FMT_YUV422P;
111 if (context->ffmpeg_type == FFMPEG_XVID) {
113 - c->pix_fmt = PIX_FMT_YUV420P;
114 + c->pix_fmt = AV_PIX_FMT_YUV420P;
115 c->codec_tag = (('D' << 24) + ('I' << 16) + ('V' << 8) + 'X');
118 @@ -604,26 +604,26 @@
119 /* Keep lossless encodes in the RGB domain. */
120 if (codec_id == AV_CODEC_ID_HUFFYUV) {
121 if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
122 - c->pix_fmt = PIX_FMT_BGRA;
123 + c->pix_fmt = AV_PIX_FMT_BGRA;
126 - c->pix_fmt = PIX_FMT_RGB32;
127 + c->pix_fmt = AV_PIX_FMT_RGB32;
131 if (codec_id == AV_CODEC_ID_FFV1) {
132 - c->pix_fmt = PIX_FMT_RGB32;
133 + c->pix_fmt = AV_PIX_FMT_RGB32;
136 if (codec_id == AV_CODEC_ID_QTRLE) {
137 if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
138 - c->pix_fmt = PIX_FMT_ARGB;
139 + c->pix_fmt = AV_PIX_FMT_ARGB;
143 if (codec_id == AV_CODEC_ID_PNG) {
144 if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
145 - c->pix_fmt = PIX_FMT_RGBA;
146 + c->pix_fmt = AV_PIX_FMT_RGBA;
152 context->current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
154 - context->img_convert_ctx = sws_getContext(c->width, c->height, PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
155 + context->img_convert_ctx = sws_getContext(c->width, c->height, AV_PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
159 --- blender-2.76/source/blender/imbuf/intern/anim_movie.c.orig 2016-03-21 13:22:18.224607392 +0100
160 +++ blender-2.76/source/blender/imbuf/intern/anim_movie.c 2016-03-21 13:34:53.607491392 +0100
161 @@ -562,12 +562,12 @@
163 anim->next_packet.stream_index = -1;
165 - anim->pFrame = avcodec_alloc_frame();
166 + anim->pFrame = av_frame_alloc();
167 anim->pFrameComplete = false;
168 - anim->pFrameDeinterlaced = avcodec_alloc_frame();
169 - anim->pFrameRGB = avcodec_alloc_frame();
170 + anim->pFrameDeinterlaced = av_frame_alloc();
171 + anim->pFrameRGB = av_frame_alloc();
173 - if (avpicture_get_size(PIX_FMT_RGBA, anim->x, anim->y) !=
174 + if (avpicture_get_size(AV_PIX_FMT_RGBA, anim->x, anim->y) !=
175 anim->x * anim->y * 4)
179 anim->pCodecCtx->pix_fmt,
184 SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
189 avpicture_fill((AVPicture *) anim->pFrameRGB,
190 (unsigned char *) ibuf->rect,
191 - PIX_FMT_RGBA, anim->x, anim->y);
192 + AV_PIX_FMT_RGBA, anim->x, anim->y);
194 if (ENDIAN_ORDER == B_ENDIAN) {
195 int *dstStride = anim->pFrameRGB->linesize;
196 --- blender-2.76/source/blender/imbuf/intern/indexer.c~ 2015-10-07 02:09:33.000000000 +0200
197 +++ blender-2.76/source/blender/imbuf/intern/indexer.c 2016-03-21 13:36:25.235302331 +0100
199 rv->c->pix_fmt = rv->codec->pix_fmts[0];
202 - rv->c->pix_fmt = PIX_FMT_YUVJ420P;
203 + rv->c->pix_fmt = AV_PIX_FMT_YUVJ420P;
206 rv->c->sample_aspect_ratio =
208 if (st->codec->width != width || st->codec->height != height ||
209 st->codec->pix_fmt != rv->c->pix_fmt)
211 - rv->frame = avcodec_alloc_frame();
212 + rv->frame = av_frame_alloc();
213 avpicture_fill((AVPicture *) rv->frame,
214 MEM_mallocN(avpicture_get_size(
218 memset(&next_packet, 0, sizeof(AVPacket));
220 - in_frame = avcodec_alloc_frame();
221 + in_frame = av_frame_alloc();
223 stream_size = avio_size(context->iFormatCtx->pb);
225 --- blender-2.76/source/gameengine/VideoTexture/VideoFFmpeg.cpp~ 2015-10-12 00:58:22.000000000 +0200
226 +++ blender-2.76/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2016-03-21 13:38:33.813572152 +0100
227 @@ -140,23 +140,23 @@
228 AVFrame *VideoFFmpeg::allocFrameRGB()
231 - frame = avcodec_alloc_frame();
232 + frame = av_frame_alloc();
233 if (m_format == RGBA32)
235 avpicture_fill((AVPicture*)frame,
236 (uint8_t*)MEM_callocN(avpicture_get_size(
239 m_codecCtx->width, m_codecCtx->height),
241 - PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
242 + AV_PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
245 avpicture_fill((AVPicture*)frame,
246 (uint8_t*)MEM_callocN(avpicture_get_size(
249 m_codecCtx->width, m_codecCtx->height),
251 - PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
252 + AV_PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
257 m_codecCtx = codecCtx;
258 m_formatCtx = formatCtx;
259 m_videoStream = videoStream;
260 - m_frame = avcodec_alloc_frame();
261 - m_frameDeinterlaced = avcodec_alloc_frame();
262 + m_frame = av_frame_alloc();
263 + m_frameDeinterlaced = av_frame_alloc();
265 // allocate buffer if deinterlacing is required
266 avpicture_fill((AVPicture*)m_frameDeinterlaced,
267 @@ -248,10 +248,10 @@
268 m_codecCtx->pix_fmt, m_codecCtx->width, m_codecCtx->height);
270 // check if the pixel format supports Alpha
271 - if (m_codecCtx->pix_fmt == PIX_FMT_RGB32 ||
272 - m_codecCtx->pix_fmt == PIX_FMT_BGR32 ||
273 - m_codecCtx->pix_fmt == PIX_FMT_RGB32_1 ||
274 - m_codecCtx->pix_fmt == PIX_FMT_BGR32_1)
275 + if (m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32 ||
276 + m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32 ||
277 + m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32_1 ||
278 + m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32_1)
280 // allocate buffer to store final decoded frame