Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 609716
Collapse All | Expand All

(-)blender-2.72b.orig/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp (-2 / +2 lines)
Lines 58-66 Link Here
58
		got_frame = 0;
58
		got_frame = 0;
59
59
60
		if(!frame)
60
		if(!frame)
61
			frame = avcodec_alloc_frame();
61
			frame = av_frame_alloc();	
62
		else
62
		else
63
			avcodec_get_frame_defaults(frame);
63
			av_frame_unref(frame);	
64
64
65
		read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
65
		read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
66
		if(read_length < 0)
66
		if(read_length < 0)
(-)blender-2.72b.orig/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp (-2 / +4 lines)
Lines 202-208 Link Here
202
			m_frame = av_frame_alloc();
202
			m_frame = av_frame_alloc();
203
			if (!m_frame)
203
			if (!m_frame)
204
				AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
204
				AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
205
			avcodec_get_frame_defaults(m_frame);
205
			av_frame_unref(m_frame);	
206
			m_frame->linesize[0]    = m_input_size * samplesize;
206
			m_frame->linesize[0]    = m_input_size * samplesize;
207
			m_frame->format         = m_codecCtx->sample_fmt;
207
			m_frame->format         = m_codecCtx->sample_fmt;
208
			m_frame->nb_samples     = m_input_size;
208
			m_frame->nb_samples     = m_input_size;
Lines 224-230 Link Here
224
				if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
224
				if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
225
					AUD_THROW(AUD_ERROR_FILE, file_error);
225
					AUD_THROW(AUD_ERROR_FILE, file_error);
226
226
227
				avformat_write_header(m_formatCtx, NULL);
227
				if(avformat_write_header(m_formatCtx, NULL) < 0) {
228
                    			throw;
229
                }	
228
			}
230
			}
229
			catch(AUD_Exception&)
231
			catch(AUD_Exception&)
230
			{
232
			{
(-)blender-2.72b.orig/intern/ffmpeg/ffmpeg_compat.h (+226 lines)
Lines 446-449 Link Here
446
#  define FFMPEG_HAVE_DEPRECATED_FLAGS2
446
#  define FFMPEG_HAVE_DEPRECATED_FLAGS2
447
#endif
447
#endif
448
448
449
/* Since FFmpeg-1.1 this constant have AV_ prefix. */
450
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 13, 100)
451
#  define AV_PIX_FMT_BGR32 PIX_FMT_BGR32
452
#  define AV_PIX_FMT_YUV422P PIX_FMT_YUV422P
453
#  define AV_PIX_FMT_BGRA PIX_FMT_BGRA
454
#  define AV_PIX_FMT_ARGB PIX_FMT_ARGB
455
#  define AV_PIX_FMT_RGBA PIX_FMT_RGBA
456
#endif
457
458
/* New API from FFmpeg-2.0 which soon became recommended one. */
459
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 38, 100)
460
#  define av_frame_alloc avcodec_alloc_frame
461
#  define av_frame_free avcodec_free_frame
462
#  define av_frame_unref avcodec_get_frame_defaults
463
#endif
464
465
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 102)
466
467
/* NOTE: The code in this block are from FFmpeg 2.6.4, which is licensed by LGPL. */
468
469
#define MAX_NEG_CROP 1024
470
471
#define times4(x) x, x, x, x
472
#define times256(x) times4(times4(times4(times4(times4(x)))))
473
474
static const uint8_t ff_compat_crop_tab[256 + 2 * MAX_NEG_CROP] = {
475
times256(0x00),
476
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
477
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
478
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
479
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
480
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
481
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
482
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
483
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
484
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
485
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
486
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
487
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
488
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
489
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
490
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
491
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
492
times256(0xFF)
493
};
494
495
#undef times4
496
#undef times256
497
498
/* filter parameters: [-1 4 2 4 -1] // 8 */
499
FFMPEG_INLINE
500
void deinterlace_line(uint8_t *dst,
501
                      const uint8_t *lum_m4, const uint8_t *lum_m3,
502
                      const uint8_t *lum_m2, const uint8_t *lum_m1,
503
                      const uint8_t *lum,
504
                      int size)
505
{
506
    const uint8_t *cm = ff_compat_crop_tab + MAX_NEG_CROP;
507
    int sum;
508
509
    for(;size > 0;size--) {
510
        sum = -lum_m4[0];
511
        sum += lum_m3[0] << 2;
512
        sum += lum_m2[0] << 1;
513
        sum += lum_m1[0] << 2;
514
        sum += -lum[0];
515
        dst[0] = cm[(sum + 4) >> 3];
516
        lum_m4++;
517
        lum_m3++;
518
        lum_m2++;
519
        lum_m1++;
520
        lum++;
521
        dst++;
522
    }
523
}
524
525
FFMPEG_INLINE
526
void deinterlace_line_inplace(uint8_t *lum_m4, uint8_t *lum_m3,
527
                              uint8_t *lum_m2, uint8_t *lum_m1,
528
                              uint8_t *lum, int size)
529
{
530
    const uint8_t *cm = ff_compat_crop_tab + MAX_NEG_CROP;
531
    int sum;
532
533
    for(;size > 0;size--) {
534
        sum = -lum_m4[0];
535
        sum += lum_m3[0] << 2;
536
        sum += lum_m2[0] << 1;
537
        lum_m4[0]=lum_m2[0];
538
        sum += lum_m1[0] << 2;
539
        sum += -lum[0];
540
        lum_m2[0] = cm[(sum + 4) >> 3];
541
        lum_m4++;
542
        lum_m3++;
543
        lum_m2++;
544
        lum_m1++;
545
        lum++;
546
    }
547
}
548
549
/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
550
   top field is copied as is, but the bottom field is deinterlaced
551
   against the top field. */
552
FFMPEG_INLINE
553
void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
554
                              const uint8_t *src1, int src_wrap,
555
                              int width, int height)
556
{
557
    const uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2;
558
    int y;
559
560
    src_m2 = src1;
561
    src_m1 = src1;
562
    src_0=&src_m1[src_wrap];
563
    src_p1=&src_0[src_wrap];
564
    src_p2=&src_p1[src_wrap];
565
    for(y=0;y<(height-2);y+=2) {
566
        memcpy(dst,src_m1,width);
567
        dst += dst_wrap;
568
        deinterlace_line(dst,src_m2,src_m1,src_0,src_p1,src_p2,width);
569
        src_m2 = src_0;
570
        src_m1 = src_p1;
571
        src_0 = src_p2;
572
        src_p1 += 2*src_wrap;
573
        src_p2 += 2*src_wrap;
574
        dst += dst_wrap;
575
    }
576
    memcpy(dst,src_m1,width);
577
    dst += dst_wrap;
578
    /* do last line */
579
    deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width);
580
}
581
582
FFMPEG_INLINE
583
int deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
584
                                     int width, int height)
585
{
586
    uint8_t *src_m1, *src_0, *src_p1, *src_p2;
587
    int y;
588
    uint8_t *buf = (uint8_t *)av_malloc(width);
589
    if (!buf)
590
        return AVERROR(ENOMEM);
591
592
    src_m1 = src1;
593
    memcpy(buf,src_m1,width);
594
    src_0=&src_m1[src_wrap];
595
    src_p1=&src_0[src_wrap];
596
    src_p2=&src_p1[src_wrap];
597
    for(y=0;y<(height-2);y+=2) {
598
        deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
599
        src_m1 = src_p1;
600
        src_0 = src_p2;
601
        src_p1 += 2*src_wrap;
602
        src_p2 += 2*src_wrap;
603
    }
604
    /* do last line */
605
    deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
606
    av_free(buf);
607
    return 0;
608
}
609
610
#ifdef __GNUC__
611
#  pragma GCC diagnostic push
612
#  pragma GCC diagnostic ignored "-Wdeprecated-declarations"
613
#endif
614
615
FFMPEG_INLINE
616
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
617
                          enum AVPixelFormat pix_fmt, int width, int height)
618
{
619
    int i, ret;
620
621
    if (pix_fmt != AV_PIX_FMT_YUV420P &&
622
        pix_fmt != AV_PIX_FMT_YUVJ420P &&
623
        pix_fmt != AV_PIX_FMT_YUV422P &&
624
        pix_fmt != AV_PIX_FMT_YUVJ422P &&
625
        pix_fmt != AV_PIX_FMT_YUV444P &&
626
        pix_fmt != AV_PIX_FMT_YUV411P &&
627
        pix_fmt != AV_PIX_FMT_GRAY8)
628
        return -1;
629
    if ((width & 3) != 0 || (height & 3) != 0)
630
        return -1;
631
632
    for(i=0;i<3;i++) {
633
        if (i == 1) {
634
            switch(pix_fmt) {
635
            case AV_PIX_FMT_YUVJ420P:
636
            case AV_PIX_FMT_YUV420P:
637
                width >>= 1;
638
                height >>= 1;
639
                break;
640
            case AV_PIX_FMT_YUV422P:
641
            case AV_PIX_FMT_YUVJ422P:
642
                width >>= 1;
643
                break;
644
            case AV_PIX_FMT_YUV411P:
645
                width >>= 2;
646
                break;
647
            default:
648
                break;
649
            }
650
            if (pix_fmt == AV_PIX_FMT_GRAY8) {
651
                break;
652
            }
653
        }
654
        if (src == dst) {
655
            ret = deinterlace_bottom_field_inplace(dst->data[i],
656
                                                   dst->linesize[i],
657
                                                   width, height);
658
            if (ret < 0)
659
                return ret;
660
        } else {
661
            deinterlace_bottom_field(dst->data[i],dst->linesize[i],
662
                                     src->data[i], src->linesize[i],
663
                                     width, height);
664
        }
665
    }
666
    return 0;
667
}
668
669
#ifdef __GNUC__
670
#  pragma GCC diagnostic pop
671
#endif
672
673
#endif
674
449
#endif
675
#endif
(-)blender-2.72b.orig/source/blender/blenkernel/intern/writeffmpeg.c (-17 / +17 lines)
Lines 134-141 Link Here
134
	audio_time += (double) audio_input_samples / (double) c->sample_rate;
134
	audio_time += (double) audio_input_samples / (double) c->sample_rate;
135
135
136
#ifdef FFMPEG_HAVE_ENCODE_AUDIO2
136
#ifdef FFMPEG_HAVE_ENCODE_AUDIO2
137
	frame = avcodec_alloc_frame();
137
	frame = av_frame_alloc();
138
	avcodec_get_frame_defaults(frame);
138
    	av_frame_unref(frame);
139
	frame->pts = audio_time / av_q2d(c->time_base);
139
	frame->pts = audio_time / av_q2d(c->time_base);
140
	frame->nb_samples = audio_input_samples;
140
	frame->nb_samples = audio_input_samples;
141
	frame->format = c->sample_fmt;
141
	frame->format = c->sample_fmt;
Lines 168-174 Link Here
168
	}
168
	}
169
169
170
	if (!got_output) {
170
	if (!got_output) {
171
		avcodec_free_frame(&frame);
171
		av_frame_free(&frame);	
172
		return 0;
172
		return 0;
173
	}
173
	}
174
#else
174
#else
Lines 198-204 Link Here
198
		if (av_interleaved_write_frame(outfile, &pkt) != 0) {
198
		if (av_interleaved_write_frame(outfile, &pkt) != 0) {
199
			fprintf(stderr, "Error writing audio packet!\n");
199
			fprintf(stderr, "Error writing audio packet!\n");
200
			if (frame)
200
			if (frame)
201
				avcodec_free_frame(&frame);
201
				av_frame_free(&frame);
202
			return -1;
202
			return -1;
203
		}
203
		}
204
204
Lines 206-212 Link Here
206
	}
206
	}
207
207
208
	if (frame)
208
	if (frame)
209
		avcodec_free_frame(&frame);
209
		av_frame_free(&frame);
210
210
211
	return 0;
211
	return 0;
212
}
212
}
Lines 220-226 Link Here
220
	int size;
220
	int size;
221
	
221
	
222
	/* allocate space for the struct */
222
	/* allocate space for the struct */
223
	f = avcodec_alloc_frame();
223
	f = av_frame_alloc();
224
	if (!f) return NULL;
224
	if (!f) return NULL;
225
	size = avpicture_get_size(pix_fmt, width, height);
225
	size = avpicture_get_size(pix_fmt, width, height);
226
	/* allocate the actual picture buffer */
226
	/* allocate the actual picture buffer */
Lines 359-366 Link Here
359
	int height = c->height;
359
	int height = c->height;
360
	AVFrame *rgb_frame;
360
	AVFrame *rgb_frame;
361
361
362
	if (c->pix_fmt != PIX_FMT_BGR32) {
362
    	if (c->pix_fmt != AV_PIX_FMT_BGR32) {
363
		rgb_frame = alloc_picture(PIX_FMT_BGR32, width, height);
363
        	rgb_frame = alloc_picture(AV_PIX_FMT_BGR32, width, height);
364
		if (!rgb_frame) {
364
		if (!rgb_frame) {
365
			BKE_report(reports, RPT_ERROR, "Could not allocate temporary frame");
365
			BKE_report(reports, RPT_ERROR, "Could not allocate temporary frame");
366
			return NULL;
366
			return NULL;
Lines 410-423 Link Here
410
		}
410
		}
411
	}
411
	}
412
412
413
	if (c->pix_fmt != PIX_FMT_BGR32) {
413
	if (c->pix_fmt != AV_PIX_FMT_BGR32) {
414
		sws_scale(img_convert_ctx, (const uint8_t *const *) rgb_frame->data,
414
		sws_scale(img_convert_ctx, (const uint8_t *const *) rgb_frame->data,
415
		          rgb_frame->linesize, 0, c->height,
415
		          rgb_frame->linesize, 0, c->height,
416
		          current_frame->data, current_frame->linesize);
416
		          current_frame->data, current_frame->linesize);
417
		delete_picture(rgb_frame);
417
		delete_picture(rgb_frame);
418
	}
418
	}
419
419
420
	current_frame->format = PIX_FMT_BGR32;
420
	current_frame->format = AV_PIX_FMT_BGR32;
421
	current_frame->width = width;
421
	current_frame->width = width;
422
	current_frame->height = height;
422
	current_frame->height = height;
423
423
Lines 585-596 Link Here
585
	}
585
	}
586
	else {
586
	else {
587
		/* makes HuffYUV happy ... */
587
		/* makes HuffYUV happy ... */
588
		c->pix_fmt = PIX_FMT_YUV422P;
588
		c->pix_fmt = AV_PIX_FMT_YUV422P;
589
	}
589
	}
590
590
591
	if (ffmpeg_type == FFMPEG_XVID) {
591
	if (ffmpeg_type == FFMPEG_XVID) {
592
		/* arghhhh ... */
592
		/* arghhhh ... */
593
		c->pix_fmt = PIX_FMT_YUV420P;
593
		c->pix_fmt = AV_PIX_FMT_YUV420P;
594
		c->codec_tag = (('D' << 24) + ('I' << 16) + ('V' << 8) + 'X');
594
		c->codec_tag = (('D' << 24) + ('I' << 16) + ('V' << 8) + 'X');
595
	}
595
	}
596
596
Lines 603-624 Link Here
603
	/* Keep lossless encodes in the RGB domain. */
603
	/* Keep lossless encodes in the RGB domain. */
604
	if (codec_id == AV_CODEC_ID_HUFFYUV) {
604
	if (codec_id == AV_CODEC_ID_HUFFYUV) {
605
		/* HUFFYUV was PIX_FMT_YUV422P before */
605
		/* HUFFYUV was PIX_FMT_YUV422P before */
606
		c->pix_fmt = PIX_FMT_RGB32;
606
		c->pix_fmt = AV_PIX_FMT_RGB32;
607
	}
607
	}
608
608
609
	if (codec_id == AV_CODEC_ID_FFV1) {
609
	if (codec_id == AV_CODEC_ID_FFV1) {
610
		c->pix_fmt = PIX_FMT_RGB32;
610
		c->pix_fmt = AV_PIX_FMT_RGB32;
611
	}
611
	}
612
612
613
	if (codec_id == AV_CODEC_ID_QTRLE) {
613
	if (codec_id == AV_CODEC_ID_QTRLE) {
614
		if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
614
		if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
615
			c->pix_fmt = PIX_FMT_ARGB;
615
			c->pix_fmt = AV_PIX_FMT_ARGB;
616
		}
616
		}
617
	}
617
	}
618
618
619
	if (codec_id == AV_CODEC_ID_PNG) {
619
	if (codec_id == AV_CODEC_ID_PNG) {
620
		if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
620
		if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
621
			c->pix_fmt = PIX_FMT_RGBA;
621
			c->pix_fmt = AV_PIX_FMT_RGBA;
622
		}
622
		}
623
	}
623
	}
624
624
Lines 656-662 Link Here
656
656
657
	current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
657
	current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
658
658
659
	img_convert_ctx = sws_getContext(c->width, c->height, PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
659
	img_convert_ctx = sws_getContext(c->width, c->height, AV_PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
660
	                                 NULL, NULL, NULL);
660
	                                 NULL, NULL, NULL);
661
	return st;
661
	return st;
662
}
662
}
(-)blender-2.72b.orig/source/blender/imbuf/intern/anim_movie.c (-6 / +6 lines)
Lines 565-576 Link Here
565
	anim->next_pts = -1;
565
	anim->next_pts = -1;
566
	anim->next_packet.stream_index = -1;
566
	anim->next_packet.stream_index = -1;
567
567
568
	anim->pFrame = avcodec_alloc_frame();
568
	anim->pFrame = av_frame_alloc();
569
	anim->pFrameComplete = false;
569
	anim->pFrameComplete = false;
570
	anim->pFrameDeinterlaced = avcodec_alloc_frame();
570
	anim->pFrameDeinterlaced = av_frame_alloc();
571
	anim->pFrameRGB = avcodec_alloc_frame();
571
	anim->pFrameRGB = av_frame_alloc();
572
572
573
	if (avpicture_get_size(PIX_FMT_RGBA, anim->x, anim->y) !=
573
	if (avpicture_get_size(AV_PIX_FMT_RGBA, anim->x, anim->y) !=
574
	    anim->x * anim->y * 4)
574
	    anim->x * anim->y * 4)
575
	{
575
	{
576
		fprintf(stderr,
576
		fprintf(stderr,
Lines 609-615 Link Here
609
	        anim->pCodecCtx->pix_fmt,
609
	        anim->pCodecCtx->pix_fmt,
610
	        anim->x,
610
	        anim->x,
611
	        anim->y,
611
	        anim->y,
612
	        PIX_FMT_RGBA,
612
	        AV_PIX_FMT_RGBA,
613
	        SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
613
	        SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
614
	        NULL, NULL, NULL);
614
	        NULL, NULL, NULL);
615
		
615
		
Lines 698-704 Link Here
698
	
698
	
699
	avpicture_fill((AVPicture *) anim->pFrameRGB,
699
	avpicture_fill((AVPicture *) anim->pFrameRGB,
700
	               (unsigned char *) ibuf->rect,
700
	               (unsigned char *) ibuf->rect,
701
	               PIX_FMT_RGBA, anim->x, anim->y);
701
	               AV_PIX_FMT_RGBA, anim->x, anim->y);
702
702
703
	if (ENDIAN_ORDER == B_ENDIAN) {
703
	if (ENDIAN_ORDER == B_ENDIAN) {
704
		int *dstStride   = anim->pFrameRGB->linesize;
704
		int *dstStride   = anim->pFrameRGB->linesize;
(-)blender-2.72b.orig/source/blender/imbuf/intern/indexer.c (-3 / +3 lines)
Lines 515-521 Link Here
515
		rv->c->pix_fmt = rv->codec->pix_fmts[0];
515
		rv->c->pix_fmt = rv->codec->pix_fmts[0];
516
	}
516
	}
517
	else {
517
	else {
518
		rv->c->pix_fmt = PIX_FMT_YUVJ420P;
518
		rv->c->pix_fmt = AV_PIX_FMT_YUVJ420P;
519
	}
519
	}
520
520
521
	rv->c->sample_aspect_ratio =
521
	rv->c->sample_aspect_ratio =
Lines 550-556 Link Here
550
	if (st->codec->width != width || st->codec->height != height ||
550
	if (st->codec->width != width || st->codec->height != height ||
551
	    st->codec->pix_fmt != rv->c->pix_fmt)
551
	    st->codec->pix_fmt != rv->c->pix_fmt)
552
	{
552
	{
553
		rv->frame = avcodec_alloc_frame();
553
		rv->frame = av_frame_alloc();
554
		avpicture_fill((AVPicture *) rv->frame,
554
		avpicture_fill((AVPicture *) rv->frame,
555
		               MEM_mallocN(avpicture_get_size(
555
		               MEM_mallocN(avpicture_get_size(
556
		                               rv->c->pix_fmt,
556
		                               rv->c->pix_fmt,
Lines 901-907 Link Here
901
901
902
	memset(&next_packet, 0, sizeof(AVPacket));
902
	memset(&next_packet, 0, sizeof(AVPacket));
903
903
904
	in_frame = avcodec_alloc_frame();
904
	in_frame = av_frame_alloc();
905
905
906
	stream_size = avio_size(context->iFormatCtx->pb);
906
	stream_size = avio_size(context->iFormatCtx->pb);
907
907
(-)blender-2.72b.orig/source/gameengine/VideoTexture/VideoFFmpeg.cpp (-13 / +13 lines)
Lines 133-155 Link Here
133
AVFrame	*VideoFFmpeg::allocFrameRGB()
133
AVFrame	*VideoFFmpeg::allocFrameRGB()
134
{
134
{
135
	AVFrame *frame;
135
	AVFrame *frame;
136
	frame = avcodec_alloc_frame();
136
	frame = av_frame_alloc();
137
	if (m_format == RGBA32)
137
	if (m_format == RGBA32)
138
	{
138
	{
139
		avpicture_fill((AVPicture*)frame, 
139
		avpicture_fill((AVPicture*)frame, 
140
			(uint8_t*)MEM_callocN(avpicture_get_size(
140
			(uint8_t*)MEM_callocN(avpicture_get_size(
141
				PIX_FMT_RGBA,
141
				AV_PIX_FMT_RGBA,
142
				m_codecCtx->width, m_codecCtx->height),
142
				m_codecCtx->width, m_codecCtx->height),
143
				"ffmpeg rgba"),
143
				"ffmpeg rgba"),
144
			PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
144
			AV_PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
145
	} else 
145
	} else 
146
	{
146
	{
147
		avpicture_fill((AVPicture*)frame, 
147
		avpicture_fill((AVPicture*)frame, 
148
			(uint8_t*)MEM_callocN(avpicture_get_size(
148
			(uint8_t*)MEM_callocN(avpicture_get_size(
149
				PIX_FMT_RGB24,
149
				AV_PIX_FMT_RGB24,
150
				m_codecCtx->width, m_codecCtx->height),
150
				m_codecCtx->width, m_codecCtx->height),
151
				"ffmpeg rgb"),
151
				"ffmpeg rgb"),
152
			PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
152
			AV_PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
153
	}
153
	}
154
	return frame;
154
	return frame;
155
}
155
}
Lines 229-236 Link Here
229
	m_codecCtx = codecCtx;
229
	m_codecCtx = codecCtx;
230
	m_formatCtx = formatCtx;
230
	m_formatCtx = formatCtx;
231
	m_videoStream = videoStream;
231
	m_videoStream = videoStream;
232
	m_frame = avcodec_alloc_frame();
232
	m_frame = av_frame_alloc();
233
	m_frameDeinterlaced = avcodec_alloc_frame();
233
	m_frameDeinterlaced = av_frame_alloc();
234
234
235
	// allocate buffer if deinterlacing is required
235
	// allocate buffer if deinterlacing is required
236
	avpicture_fill((AVPicture*)m_frameDeinterlaced, 
236
	avpicture_fill((AVPicture*)m_frameDeinterlaced, 
Lines 241-250 Link Here
241
		m_codecCtx->pix_fmt, m_codecCtx->width, m_codecCtx->height);
241
		m_codecCtx->pix_fmt, m_codecCtx->width, m_codecCtx->height);
242
242
243
	// check if the pixel format supports Alpha
243
	// check if the pixel format supports Alpha
244
	if (m_codecCtx->pix_fmt == PIX_FMT_RGB32 ||
244
	if (m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32 ||
245
		m_codecCtx->pix_fmt == PIX_FMT_BGR32 ||
245
		m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32 ||
246
		m_codecCtx->pix_fmt == PIX_FMT_RGB32_1 ||
246
		m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32_1 ||
247
		m_codecCtx->pix_fmt == PIX_FMT_BGR32_1) 
247
		m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32_1) 
248
	{
248
	{
249
		// allocate buffer to store final decoded frame
249
		// allocate buffer to store final decoded frame
250
		m_format = RGBA32;
250
		m_format = RGBA32;
Lines 255-261 Link Here
255
			m_codecCtx->pix_fmt,
255
			m_codecCtx->pix_fmt,
256
			m_codecCtx->width,
256
			m_codecCtx->width,
257
			m_codecCtx->height,
257
			m_codecCtx->height,
258
			PIX_FMT_RGBA,
258
			AV_PIX_FMT_RGBA,
259
			SWS_FAST_BILINEAR,
259
			SWS_FAST_BILINEAR,
260
			NULL, NULL, NULL);
260
			NULL, NULL, NULL);
261
	} else
261
	} else
Lines 269-275 Link Here
269
			m_codecCtx->pix_fmt,
269
			m_codecCtx->pix_fmt,
270
			m_codecCtx->width,
270
			m_codecCtx->width,
271
			m_codecCtx->height,
271
			m_codecCtx->height,
272
			PIX_FMT_RGB24,
272
			AV_PIX_FMT_RGB24,
273
			SWS_FAST_BILINEAR,
273
			SWS_FAST_BILINEAR,
274
			NULL, NULL, NULL);
274
			NULL, NULL, NULL);
275
	}
275
	}

Return to bug 609716