]> git.pld-linux.org Git - packages/blender.git/blob - ffmpeg3.patch
- partial fix for ffmpeg 3
[packages/blender.git] / ffmpeg3.patch
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
3 @@ -58,9 +58,9 @@
4                 got_frame = 0;
5  
6                 if(!frame)
7 -                       frame = avcodec_alloc_frame();
8 +                       frame = av_frame_alloc();
9                 else
10 -                       avcodec_get_frame_defaults(frame);
11 +                       av_frame_unref(frame);
12  
13                 read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
14                 if(read_length < 0)
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
17 @@ -202,7 +202,7 @@
18                         m_frame = av_frame_alloc();
19                         if (!m_frame)
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
28 @@ -138,8 +138,8 @@
29         context->audio_time += (double) context->audio_input_samples / (double) c->sample_rate;
30  
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;
39 @@ -172,7 +172,7 @@
40         }
41  
42         if (!got_output) {
43 -               avcodec_free_frame(&frame);
44 +               av_frame_free(&frame);
45                 return 0;
46         }
47  #else
48 @@ -202,7 +202,7 @@
49                 if (av_interleaved_write_frame(context->outfile, &pkt) != 0) {
50                         fprintf(stderr, "Error writing audio packet!\n");
51                         if (frame)
52 -                               avcodec_free_frame(&frame);
53 +                               av_frame_free(&frame);
54                         return -1;
55                 }
56  
57 @@ -210,7 +210,7 @@
58         }
59  
60         if (frame)
61 -               avcodec_free_frame(&frame);
62 +               av_frame_free(&frame);
63  
64         return 0;
65  }
66 @@ -224,7 +224,7 @@
67         int size;
68         
69         /* allocate space for the struct */
70 -       f = avcodec_alloc_frame();
71 +       f = av_frame_alloc();
72         if (!f) return NULL;
73         size = avpicture_get_size(pix_fmt, width, height);
74         /* allocate the actual picture buffer */
75 @@ -363,8 +363,8 @@
76         int height = c->height;
77         AVFrame *rgb_frame;
78  
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);
83                 if (!rgb_frame) {
84                         BKE_report(reports, RPT_ERROR, "Could not allocate temporary frame");
85                         return NULL;
86 @@ -414,14 +414,14 @@
87                 }
88         }
89  
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);
96         }
97  
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;
102  
103 @@ -586,12 +586,12 @@
104         }
105         else {
106                 /* makes HuffYUV happy ... */
107 -               c->pix_fmt = PIX_FMT_YUV422P;
108 +               c->pix_fmt = AV_PIX_FMT_YUV422P;
109         }
110  
111         if (context->ffmpeg_type == FFMPEG_XVID) {
112                 /* arghhhh ... */
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');
116         }
117  
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;
124                 }
125                 else {
126 -                       c->pix_fmt = PIX_FMT_RGB32;
127 +                       c->pix_fmt = AV_PIX_FMT_RGB32;
128                 }
129         }
130  
131         if (codec_id == AV_CODEC_ID_FFV1) {
132 -               c->pix_fmt = PIX_FMT_RGB32;
133 +               c->pix_fmt = AV_PIX_FMT_RGB32;
134         }
135  
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;
140                 }
141         }
142  
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;
147                 }
148         }
149  
150 @@ -661,7 +661,7 @@
151  
152         context->current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
153  
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,
156                                          NULL, NULL, NULL);
157         return st;
158  }
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 @@
162         anim->next_pts = -1;
163         anim->next_packet.stream_index = -1;
164  
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();
172  
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)
176         {
177                 fprintf(stderr,
178 @@ -606,7 +606,7 @@
179                 anim->pCodecCtx->pix_fmt,
180                 anim->x,
181                 anim->y,
182 -               PIX_FMT_RGBA,
183 +               AV_PIX_FMT_RGBA,
184                 SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
185                 NULL, NULL, NULL);
186                 
187 @@ -692,7 +692,7 @@
188         
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);
193  
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
198 @@ -519,7 +519,7 @@
199                 rv->c->pix_fmt = rv->codec->pix_fmts[0];
200         }
201         else {
202 -               rv->c->pix_fmt = PIX_FMT_YUVJ420P;
203 +               rv->c->pix_fmt = AV_PIX_FMT_YUVJ420P;
204         }
205  
206         rv->c->sample_aspect_ratio =
207 @@ -554,7 +554,7 @@
208         if (st->codec->width != width || st->codec->height != height ||
209             st->codec->pix_fmt != rv->c->pix_fmt)
210         {
211 -               rv->frame = avcodec_alloc_frame();
212 +               rv->frame = av_frame_alloc();
213                 avpicture_fill((AVPicture *) rv->frame,
214                                MEM_mallocN(avpicture_get_size(
215                                                rv->c->pix_fmt,
216 @@ -905,7 +905,7 @@
217  
218         memset(&next_packet, 0, sizeof(AVPacket));
219  
220 -       in_frame = avcodec_alloc_frame();
221 +       in_frame = av_frame_alloc();
222  
223         stream_size = avio_size(context->iFormatCtx->pb);
224  
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()
229  {
230         AVFrame *frame;
231 -       frame = avcodec_alloc_frame();
232 +       frame = av_frame_alloc();
233         if (m_format == RGBA32)
234         {
235                 avpicture_fill((AVPicture*)frame, 
236                         (uint8_t*)MEM_callocN(avpicture_get_size(
237 -                               PIX_FMT_RGBA,
238 +                               AV_PIX_FMT_RGBA,
239                                 m_codecCtx->width, m_codecCtx->height),
240                                 "ffmpeg rgba"),
241 -                       PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
242 +                       AV_PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
243         } else 
244         {
245                 avpicture_fill((AVPicture*)frame, 
246                         (uint8_t*)MEM_callocN(avpicture_get_size(
247 -                               PIX_FMT_RGB24,
248 +                               AV_PIX_FMT_RGB24,
249                                 m_codecCtx->width, m_codecCtx->height),
250                                 "ffmpeg rgb"),
251 -                       PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
252 +                       AV_PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
253         }
254         return frame;
255  }
256 @@ -236,8 +236,8 @@
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();
264  
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);
269  
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) 
279         {
280                 // allocate buffer to store final decoded frame
281                 m_format = RGBA32;
282 @@ -262,7 +262,7 @@
283                         m_codecCtx->pix_fmt,
284                         m_codecCtx->width,
285                         m_codecCtx->height,
286 -                       PIX_FMT_RGBA,
287 +                       AV_PIX_FMT_RGBA,
288                         SWS_FAST_BILINEAR,
289                         NULL, NULL, NULL);
290         } else
291 @@ -276,7 +276,7 @@
292                         m_codecCtx->pix_fmt,
293                         m_codecCtx->width,
294                         m_codecCtx->height,
295 -                       PIX_FMT_RGB24,
296 +                       AV_PIX_FMT_RGB24,
297                         SWS_FAST_BILINEAR,
298                         NULL, NULL, NULL);
299         }
This page took 1.38501 seconds and 3 git commands to generate.