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

(-)file_not_specified_in_diff (-79 / +85 lines)
Line  Link Here
0
-- libquicktime-1.2.4.orig/plugins/ffmpeg/lqt_ffmpeg.c
0
++ libquicktime-1.2.4/plugins/ffmpeg/lqt_ffmpeg.c
Lines 386-392 static lqt_image_size_static_t image_siz Link Here
386
struct CODECIDMAP codecidmap_v[] =
386
struct CODECIDMAP codecidmap_v[] =
387
  {
387
  {
388
    {
388
    {
389
      .id = CODEC_ID_MPEG1VIDEO,
389
      .id = AV_CODEC_ID_MPEG1VIDEO,
390
      .index = -1,
390
      .index = -1,
391
      .encoder = NULL,
391
      .encoder = NULL,
392
      .decoder = NULL,
392
      .decoder = NULL,
Lines 397-403 struct CODECIDMAP codecidmap_v[] = Link Here
397
      .wav_ids = { LQT_WAV_ID_NONE }
397
      .wav_ids = { LQT_WAV_ID_NONE }
398
    },
398
    },
399
    {
399
    {
400
      .id = CODEC_ID_MPEG4,
400
      .id = AV_CODEC_ID_MPEG4,
401
      .index = -1,
401
      .index = -1,
402
      .encoder = NULL,
402
      .encoder = NULL,
403
      .decoder = NULL,
403
      .decoder = NULL,
Lines 415-421 struct CODECIDMAP codecidmap_v[] = Link Here
415
      .compression_id = LQT_COMPRESSION_MPEG4_ASP,
415
      .compression_id = LQT_COMPRESSION_MPEG4_ASP,
416
    },
416
    },
417
    {
417
    {
418
      .id = CODEC_ID_MSMPEG4V1,
418
      .id = AV_CODEC_ID_MSMPEG4V1,
419
      .index = -1,
419
      .index = -1,
420
      .encoder = NULL,
420
      .encoder = NULL,
421
      .decoder = NULL,
421
      .decoder = NULL,
Lines 426-432 struct CODECIDMAP codecidmap_v[] = Link Here
426
      .wav_ids = { LQT_WAV_ID_NONE },
426
      .wav_ids = { LQT_WAV_ID_NONE },
427
    },
427
    },
428
    {
428
    {
429
      .id = CODEC_ID_MSMPEG4V2,
429
      .id = AV_CODEC_ID_MSMPEG4V2,
430
      .index = -1,
430
      .index = -1,
431
      .encoder = NULL,
431
      .encoder = NULL,
432
      .decoder = NULL,
432
      .decoder = NULL,
Lines 437-443 struct CODECIDMAP codecidmap_v[] = Link Here
437
      .wav_ids = { LQT_WAV_ID_NONE },
437
      .wav_ids = { LQT_WAV_ID_NONE },
438
    },
438
    },
439
    {
439
    {
440
      .id = CODEC_ID_MSMPEG4V3,
440
      .id = AV_CODEC_ID_MSMPEG4V3,
441
      .index = -1,
441
      .index = -1,
442
      .encoder = NULL,
442
      .encoder = NULL,
443
      .decoder = NULL,
443
      .decoder = NULL,
Lines 453-459 struct CODECIDMAP codecidmap_v[] = Link Here
453
      .do_encode = 1,
453
      .do_encode = 1,
454
    },
454
    },
455
    {
455
    {
456
      .id = CODEC_ID_MSMPEG4V3,
456
      .id = AV_CODEC_ID_MSMPEG4V3,
457
      .index = -1,
457
      .index = -1,
458
      .encoder = NULL,
458
      .encoder = NULL,
459
      .decoder = NULL,
459
      .decoder = NULL,
Lines 468-474 struct CODECIDMAP codecidmap_v[] = Link Here
468
    },
468
    },
469
#if 0
469
#if 0
470
    {
470
    {
471
      .id = CODEC_ID_WMV1,
471
      .id = AV_CODEC_ID_WMV1,
472
      .index = -1,
472
      .index = -1,
473
      .encoder = NULL,
473
      .encoder = NULL,
474
      .decoder = NULL,
474
      .decoder = NULL,
Lines 481-487 struct CODECIDMAP codecidmap_v[] = Link Here
481
    },
481
    },
482
#endif
482
#endif
483
    {
483
    {
484
      .id = CODEC_ID_H263,
484
      .id = AV_CODEC_ID_H263,
485
      .index = -1,
485
      .index = -1,
486
      .encoder = NULL,
486
      .encoder = NULL,
487
      .decoder = NULL,
487
      .decoder = NULL,
Lines 493-499 struct CODECIDMAP codecidmap_v[] = Link Here
493
      .compatibility_flags = LQT_FILE_QT_OLD | LQT_FILE_QT | LQT_FILE_MP4 | LQT_FILE_3GP,
493
      .compatibility_flags = LQT_FILE_QT_OLD | LQT_FILE_QT | LQT_FILE_MP4 | LQT_FILE_3GP,
494
    },
494
    },
495
    {
495
    {
496
      .id = CODEC_ID_H263,
496
      .id = AV_CODEC_ID_H263,
497
      .index = -1,
497
      .index = -1,
498
      .encoder = NULL,
498
      .encoder = NULL,
499
      .decoder = NULL,
499
      .decoder = NULL,
Lines 508-514 struct CODECIDMAP codecidmap_v[] = Link Here
508
      .do_encode = 1,
508
      .do_encode = 1,
509
    },
509
    },
510
    {
510
    {
511
      .id = CODEC_ID_H264,
511
      .id = AV_CODEC_ID_H264,
512
      .index = -1,
512
      .index = -1,
513
      .encoder = NULL,
513
      .encoder = NULL,
514
      .decoder = NULL,
514
      .decoder = NULL,
Lines 519-525 struct CODECIDMAP codecidmap_v[] = Link Here
519
      .wav_ids = { LQT_WAV_ID_NONE },
519
      .wav_ids = { LQT_WAV_ID_NONE },
520
    },
520
    },
521
    {
521
    {
522
      .id = CODEC_ID_H263P,
522
      .id = AV_CODEC_ID_H263P,
523
      .index = -1,
523
      .index = -1,
524
      .encoder = NULL,
524
      .encoder = NULL,
525
      .decoder = NULL,
525
      .decoder = NULL,
Lines 533-539 struct CODECIDMAP codecidmap_v[] = Link Here
533
      .do_encode = 1,
533
      .do_encode = 1,
534
    },
534
    },
535
    {
535
    {
536
      .id = CODEC_ID_H263I,
536
      .id = AV_CODEC_ID_H263I,
537
      .index = -1,
537
      .index = -1,
538
      .encoder = NULL,
538
      .encoder = NULL,
539
      .decoder = NULL,
539
      .decoder = NULL,
Lines 544-550 struct CODECIDMAP codecidmap_v[] = Link Here
544
      .wav_ids = { LQT_WAV_ID_NONE },
544
      .wav_ids = { LQT_WAV_ID_NONE },
545
    },
545
    },
546
    {
546
    {
547
      .id = CODEC_ID_SVQ1,
547
      .id = AV_CODEC_ID_SVQ1,
548
      .index = -1,
548
      .index = -1,
549
      .encoder = NULL,
549
      .encoder = NULL,
550
      .decoder = NULL,
550
      .decoder = NULL,
Lines 555-561 struct CODECIDMAP codecidmap_v[] = Link Here
555
      .wav_ids = { LQT_WAV_ID_NONE },
555
      .wav_ids = { LQT_WAV_ID_NONE },
556
    },
556
    },
557
    {
557
    {
558
      .id = CODEC_ID_SVQ3,
558
      .id = AV_CODEC_ID_SVQ3,
559
      .index = -1,
559
      .index = -1,
560
      .encoder = NULL,
560
      .encoder = NULL,
561
      .decoder = NULL,
561
      .decoder = NULL,
Lines 566-572 struct CODECIDMAP codecidmap_v[] = Link Here
566
      .wav_ids = { LQT_WAV_ID_NONE },
566
      .wav_ids = { LQT_WAV_ID_NONE },
567
    },
567
    },
568
    {
568
    {
569
      .id = CODEC_ID_MJPEG,
569
      .id = AV_CODEC_ID_MJPEG,
570
      .index = -1,
570
      .index = -1,
571
      .encoder = NULL,
571
      .encoder = NULL,
572
      .decoder = NULL,
572
      .decoder = NULL,
Lines 580-586 struct CODECIDMAP codecidmap_v[] = Link Here
580
      .do_encode = 1,
580
      .do_encode = 1,
581
    },
581
    },
582
    {
582
    {
583
      .id = CODEC_ID_MJPEGB,
583
      .id = AV_CODEC_ID_MJPEGB,
584
      .index = -1,
584
      .index = -1,
585
      .encoder = NULL,
585
      .encoder = NULL,
586
      .decoder = NULL,
586
      .decoder = NULL,
Lines 594-600 struct CODECIDMAP codecidmap_v[] = Link Here
594
    },
594
    },
595
#if LIBAVCODEC_BUILD >= 3346688
595
#if LIBAVCODEC_BUILD >= 3346688
596
    {
596
    {
597
      .id = CODEC_ID_TARGA,
597
      .id = AV_CODEC_ID_TARGA,
598
      .index = -1,
598
      .index = -1,
599
      .encoder = NULL,
599
      .encoder = NULL,
600
      .decoder = NULL,
600
      .decoder = NULL,
Lines 606-612 struct CODECIDMAP codecidmap_v[] = Link Here
606
#endif
606
#endif
607
#if LIBAVCODEC_BUILD >= 3347456
607
#if LIBAVCODEC_BUILD >= 3347456
608
    {
608
    {
609
      .id = CODEC_ID_TIFF,
609
      .id = AV_CODEC_ID_TIFF,
610
      .index = -1,
610
      .index = -1,
611
      .encoder = NULL,
611
      .encoder = NULL,
612
      .decoder = NULL,
612
      .decoder = NULL,
Lines 617-623 struct CODECIDMAP codecidmap_v[] = Link Here
617
    },
617
    },
618
#endif
618
#endif
619
    {
619
    {
620
      .id = CODEC_ID_8BPS,
620
      .id = AV_CODEC_ID_8BPS,
621
      .index = -1,
621
      .index = -1,
622
      .encoder = NULL,
622
      .encoder = NULL,
623
      .decoder = NULL,
623
      .decoder = NULL,
Lines 627-633 struct CODECIDMAP codecidmap_v[] = Link Here
627
      .wav_ids = { LQT_WAV_ID_NONE },
627
      .wav_ids = { LQT_WAV_ID_NONE },
628
    },
628
    },
629
    {
629
    {
630
      .id = CODEC_ID_INDEO3,
630
      .id = AV_CODEC_ID_INDEO3,
631
      .index = -1,
631
      .index = -1,
632
      .encoder = NULL,
632
      .encoder = NULL,
633
      .decoder = NULL,
633
      .decoder = NULL,
Lines 638-644 struct CODECIDMAP codecidmap_v[] = Link Here
638
      .wav_ids = { LQT_WAV_ID_NONE },
638
      .wav_ids = { LQT_WAV_ID_NONE },
639
    },
639
    },
640
    {
640
    {
641
      .id = CODEC_ID_RPZA,
641
      .id = AV_CODEC_ID_RPZA,
642
      .index = -1,
642
      .index = -1,
643
      .encoder = NULL,
643
      .encoder = NULL,
644
      .decoder = NULL,
644
      .decoder = NULL,
Lines 648-654 struct CODECIDMAP codecidmap_v[] = Link Here
648
      .wav_ids = { LQT_WAV_ID_NONE },
648
      .wav_ids = { LQT_WAV_ID_NONE },
649
    },
649
    },
650
    {
650
    {
651
      .id = CODEC_ID_SMC,
651
      .id = AV_CODEC_ID_SMC,
652
      .index = -1,
652
      .index = -1,
653
      .encoder = NULL,
653
      .encoder = NULL,
654
      .decoder = NULL,
654
      .decoder = NULL,
Lines 658-664 struct CODECIDMAP codecidmap_v[] = Link Here
658
      .wav_ids = { LQT_WAV_ID_NONE },
658
      .wav_ids = { LQT_WAV_ID_NONE },
659
    },
659
    },
660
    {
660
    {
661
      .id = CODEC_ID_CINEPAK,
661
      .id = AV_CODEC_ID_CINEPAK,
662
      .index = -1,
662
      .index = -1,
663
      .encoder = NULL,
663
      .encoder = NULL,
664
      .decoder = NULL,
664
      .decoder = NULL,
Lines 669-675 struct CODECIDMAP codecidmap_v[] = Link Here
669
      .wav_ids = { LQT_WAV_ID_NONE },
669
      .wav_ids = { LQT_WAV_ID_NONE },
670
    },
670
    },
671
    {
671
    {
672
      .id = CODEC_ID_CYUV,
672
      .id = AV_CODEC_ID_CYUV,
673
      .index = -1,
673
      .index = -1,
674
      .encoder = NULL,
674
      .encoder = NULL,
675
      .decoder = NULL,
675
      .decoder = NULL,
Lines 680-686 struct CODECIDMAP codecidmap_v[] = Link Here
680
      .wav_ids = { LQT_WAV_ID_NONE },
680
      .wav_ids = { LQT_WAV_ID_NONE },
681
    },
681
    },
682
    {
682
    {
683
      .id = CODEC_ID_QTRLE,
683
      .id = AV_CODEC_ID_QTRLE,
684
      .index = -1,
684
      .index = -1,
685
      .encoder = NULL,
685
      .encoder = NULL,
686
      .decoder = NULL,
686
      .decoder = NULL,
Lines 693-699 struct CODECIDMAP codecidmap_v[] = Link Here
693
      .encoding_colormodels = (int[]){ BC_RGB888, BC_RGBA8888, LQT_COLORMODEL_NONE },
693
      .encoding_colormodels = (int[]){ BC_RGB888, BC_RGBA8888, LQT_COLORMODEL_NONE },
694
    },
694
    },
695
    {
695
    {
696
      .id = CODEC_ID_MSRLE,
696
      .id = AV_CODEC_ID_MSRLE,
697
      .index = -1,
697
      .index = -1,
698
      .encoder = NULL,
698
      .encoder = NULL,
699
      .decoder = NULL,
699
      .decoder = NULL,
Lines 703-709 struct CODECIDMAP codecidmap_v[] = Link Here
703
      .wav_ids = { LQT_WAV_ID_NONE },
703
      .wav_ids = { LQT_WAV_ID_NONE },
704
    },
704
    },
705
    {
705
    {
706
      .id = CODEC_ID_DVVIDEO,
706
      .id = AV_CODEC_ID_DVVIDEO,
707
      .index = -1,
707
      .index = -1,
708
      .encoder = NULL,
708
      .encoder = NULL,
709
      .decoder = NULL,
709
      .decoder = NULL,
Lines 719-725 struct CODECIDMAP codecidmap_v[] = Link Here
719
      .image_sizes = image_sizes_dv,
719
      .image_sizes = image_sizes_dv,
720
    },
720
    },
721
    {
721
    {
722
      .id = CODEC_ID_DVVIDEO,
722
      .id = AV_CODEC_ID_DVVIDEO,
723
      .index = -1,
723
      .index = -1,
724
      .encoder = NULL,
724
      .encoder = NULL,
725
      .decoder = NULL,
725
      .decoder = NULL,
Lines 735-741 struct CODECIDMAP codecidmap_v[] = Link Here
735
      .image_sizes = image_sizes_dv,
735
      .image_sizes = image_sizes_dv,
736
    },
736
    },
737
    {
737
    {
738
      .id = CODEC_ID_DVVIDEO,
738
      .id = AV_CODEC_ID_DVVIDEO,
739
      .index = -1,
739
      .index = -1,
740
      .encoder = NULL,
740
      .encoder = NULL,
741
      .decoder = NULL,
741
      .decoder = NULL,
Lines 751-757 struct CODECIDMAP codecidmap_v[] = Link Here
751
    },
751
    },
752
    /* DVCPRO HD (decoding only for now) */
752
    /* DVCPRO HD (decoding only for now) */
753
    {
753
    {
754
      .id = CODEC_ID_DVVIDEO,
754
      .id = AV_CODEC_ID_DVVIDEO,
755
      .index = -1,
755
      .index = -1,
756
      .encoder = NULL,
756
      .encoder = NULL,
757
      .decoder = NULL,
757
      .decoder = NULL,
Lines 772-778 struct CODECIDMAP codecidmap_v[] = Link Here
772
      // .do_encode = 1
772
      // .do_encode = 1
773
    },
773
    },
774
    {
774
    {
775
      .id = CODEC_ID_FFVHUFF,
775
      .id = AV_CODEC_ID_FFVHUFF,
776
      .index = -1,
776
      .index = -1,
777
      .encoder = NULL,
777
      .encoder = NULL,
778
      .decoder = NULL,
778
      .decoder = NULL,
Lines 785-791 struct CODECIDMAP codecidmap_v[] = Link Here
785
      .do_encode = 1
785
      .do_encode = 1
786
    },
786
    },
787
    {
787
    {
788
      .id = CODEC_ID_FFV1,
788
      .id = AV_CODEC_ID_FFV1,
789
      .index = -1,
789
      .index = -1,
790
      .encoder = NULL,
790
      .encoder = NULL,
791
      .decoder = NULL,
791
      .decoder = NULL,
Lines 801-807 struct CODECIDMAP codecidmap_v[] = Link Here
801
    },
801
    },
802
#if LIBAVCODEC_BUILD >= 3352576
802
#if LIBAVCODEC_BUILD >= 3352576
803
    {
803
    {
804
      .id = CODEC_ID_DNXHD,
804
      .id = AV_CODEC_ID_DNXHD,
805
      .index = -1,
805
      .index = -1,
806
      .encoder = NULL,
806
      .encoder = NULL,
807
      .decoder = NULL,
807
      .decoder = NULL,
Lines 817-823 struct CODECIDMAP codecidmap_v[] = Link Here
817
    },
817
    },
818
#endif
818
#endif
819
    {
819
    {
820
      .id = CODEC_ID_MPEG2VIDEO,
820
      .id = AV_CODEC_ID_MPEG2VIDEO,
821
      .index = -1,
821
      .index = -1,
822
      .encoder = NULL,
822
      .encoder = NULL,
823
      .decoder = NULL,
823
      .decoder = NULL,
Lines 839-845 struct CODECIDMAP codecidmap_v[] = Link Here
839
struct CODECIDMAP codecidmap_a[] =
839
struct CODECIDMAP codecidmap_a[] =
840
  {
840
  {
841
    {
841
    {
842
      .id = CODEC_ID_MP3,
842
      .id = AV_CODEC_ID_MP3,
843
      .index = -1,
843
      .index = -1,
844
      .encoder = NULL,
844
      .encoder = NULL,
845
      .decoder = NULL,
845
      .decoder = NULL,
Lines 851-857 struct CODECIDMAP codecidmap_a[] = Link Here
851
      .wav_ids = { 0x50, 0x55, LQT_WAV_ID_NONE },
851
      .wav_ids = { 0x50, 0x55, LQT_WAV_ID_NONE },
852
    },
852
    },
853
    {
853
    {
854
      .id = CODEC_ID_MP2,
854
      .id = AV_CODEC_ID_MP2,
855
      .index = -1,
855
      .index = -1,
856
      .encoder = NULL,
856
      .encoder = NULL,
857
      .decoder = NULL,
857
      .decoder = NULL,
Lines 866-872 struct CODECIDMAP codecidmap_a[] = Link Here
866
      .compression_id = LQT_COMPRESSION_MP2,
866
      .compression_id = LQT_COMPRESSION_MP2,
867
    },
867
    },
868
    {
868
    {
869
      .id = CODEC_ID_AC3,
869
      .id = AV_CODEC_ID_AC3,
870
      .index = -1,
870
      .index = -1,
871
      .encoder = NULL,
871
      .encoder = NULL,
872
      .decoder = NULL,
872
      .decoder = NULL,
Lines 881-887 struct CODECIDMAP codecidmap_a[] = Link Here
881
      .compression_id = LQT_COMPRESSION_AC3,
881
      .compression_id = LQT_COMPRESSION_AC3,
882
    },
882
    },
883
    {
883
    {
884
      .id = CODEC_ID_QDM2,
884
      .id = AV_CODEC_ID_QDM2,
885
      .index = -1,
885
      .index = -1,
886
      .encoder = NULL,
886
      .encoder = NULL,
887
      .decoder = NULL,
887
      .decoder = NULL,
Lines 896-902 struct CODECIDMAP codecidmap_a[] = Link Here
896
#if 1
896
#if 1
897
    /* Doesn't work as long as audio chunks are not split into VBR "Samples" */
897
    /* Doesn't work as long as audio chunks are not split into VBR "Samples" */
898
    {
898
    {
899
      .id = CODEC_ID_ALAC,
899
      .id = AV_CODEC_ID_ALAC,
900
      .index = -1,
900
      .index = -1,
901
      .encoder = NULL,
901
      .encoder = NULL,
902
      .decoder = NULL,
902
      .decoder = NULL,
Lines 909-915 struct CODECIDMAP codecidmap_a[] = Link Here
909
#if 1
909
#if 1
910
    /* Sounds ugly */
910
    /* Sounds ugly */
911
    {
911
    {
912
      .id = CODEC_ID_ADPCM_MS,
912
      .id = AV_CODEC_ID_ADPCM_MS,
913
      .index = -1,
913
      .index = -1,
914
      .encoder = NULL,
914
      .encoder = NULL,
915
      .decoder = NULL,
915
      .decoder = NULL,
Lines 922-928 struct CODECIDMAP codecidmap_a[] = Link Here
922
#if 1
922
#if 1
923
    /* Sounds ugly */
923
    /* Sounds ugly */
924
    {
924
    {
925
      .id = CODEC_ID_ADPCM_IMA_WAV,
925
      .id = AV_CODEC_ID_ADPCM_IMA_WAV,
926
      .index = -1,
926
      .index = -1,
927
      .encoder = NULL,
927
      .encoder = NULL,
928
      .decoder = NULL,
928
      .decoder = NULL,
929
-- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c
929
++ libquicktime-1.2.4/plugins/ffmpeg/audio.c
Lines 45-50 Link Here
45
#define ENCODE_AUDIO 1
45
#define ENCODE_AUDIO 1
46
#endif
46
#endif
47
47
48
// Has been deprecated for ages. Now removed. For now do what ffmpeg does
49
// 192000 = 1 second of 48khz 32bit audio
50
#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
51
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
52
#endif
53
48
/* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
54
/* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
49
55
50
/* MPEG Audio header parsing code */
56
/* MPEG Audio header parsing code */
Lines 626-632 static int decode_chunk(quicktime_t * fi Link Here
626
    {
632
    {
627
    /* If the codec is mp3, make sure to decode the very last frame */
633
    /* If the codec is mp3, make sure to decode the very last frame */
628
634
629
    if((codec->avctx->codec_id == CODEC_ID_MP3) &&
635
    if((codec->avctx->codec_id == AV_CODEC_ID_MP3) &&
630
       (codec->bytes_in_chunk_buffer >= 4))
636
       (codec->bytes_in_chunk_buffer >= 4))
631
      {
637
      {
632
      if(!mpa_decode_header(&mph, codec->chunk_buffer, (const mpa_header*)0))
638
      if(!mpa_decode_header(&mph, codec->chunk_buffer, (const mpa_header*)0))
Lines 695-701 static int decode_chunk(quicktime_t * fi Link Here
695
    
701
    
696
    /* Some really broken mp3 files have the header bytes split across 2 chunks */
702
    /* Some really broken mp3 files have the header bytes split across 2 chunks */
697
703
698
    if(codec->avctx->codec_id == CODEC_ID_MP3)
704
    if(codec->avctx->codec_id == AV_CODEC_ID_MP3)
699
      {
705
      {
700
      if(codec->bytes_in_chunk_buffer < 4)
706
      if(codec->bytes_in_chunk_buffer < 4)
701
        {
707
        {
Lines 806-812 static int decode_chunk(quicktime_t * fi Link Here
806
    
812
    
807
    if(bytes_decoded < 0)
813
    if(bytes_decoded < 0)
808
      {
814
      {
809
      if(codec->avctx->codec_id == CODEC_ID_MP3)
815
      if(codec->avctx->codec_id == AV_CODEC_ID_MP3)
810
        {
816
        {
811
        /* For mp3, bytes_decoded < 0 means, that the frame should be muted */
817
        /* For mp3, bytes_decoded < 0 means, that the frame should be muted */
812
        memset(&codec->sample_buffer[track_map->channels * (codec->sample_buffer_end -
818
        memset(&codec->sample_buffer[track_map->channels * (codec->sample_buffer_end -
Lines 866-873 static void init_compression_info(quickt Link Here
866
  quicktime_audio_map_t *track_map = &file->atracks[track];
872
  quicktime_audio_map_t *track_map = &file->atracks[track];
867
  quicktime_ffmpeg_audio_codec_t *codec = track_map->codec->priv;
873
  quicktime_ffmpeg_audio_codec_t *codec = track_map->codec->priv;
868
874
869
  if((codec->decoder->id == CODEC_ID_MP2) ||
875
  if((codec->decoder->id == AV_CODEC_ID_MP2) ||
870
     (codec->decoder->id == CODEC_ID_MP3))
876
     (codec->decoder->id == AV_CODEC_ID_MP3))
871
    {
877
    {
872
    mpa_header h;
878
    mpa_header h;
873
    uint32_t header;
879
    uint32_t header;
Lines 909-915 static void init_compression_info(quickt Link Here
909
    else
915
    else
910
      track_map->ci.bitrate = h.bitrate;
916
      track_map->ci.bitrate = h.bitrate;
911
    }
917
    }
912
  else if(codec->decoder->id == CODEC_ID_AC3)
918
  else if(codec->decoder->id == AV_CODEC_ID_AC3)
913
    {
919
    {
914
    a52_header h;
920
    a52_header h;
915
    uint8_t * ptr;
921
    uint8_t * ptr;
Lines 986-992 static int lqt_ffmpeg_decode_audio(quick Link Here
986
#endif
992
#endif
987
    /* Some codecs need extra stuff */
993
    /* Some codecs need extra stuff */
988
994
989
    if(codec->decoder->id == CODEC_ID_ALAC)
995
    if(codec->decoder->id == AV_CODEC_ID_ALAC)
990
      {
996
      {
991
      header = quicktime_wave_get_user_atom(track_map->track, "alac", &header_len);
997
      header = quicktime_wave_get_user_atom(track_map->track, "alac", &header_len);
992
      if(header)
998
      if(header)
Lines 995-1001 static int lqt_ffmpeg_decode_audio(quick Link Here
995
        codec->avctx->extradata_size = header_len;
1001
        codec->avctx->extradata_size = header_len;
996
        }
1002
        }
997
      }
1003
      }
998
    if(codec->decoder->id == CODEC_ID_QDM2)
1004
    if(codec->decoder->id == AV_CODEC_ID_QDM2)
999
      {
1005
      {
1000
      header = quicktime_wave_get_user_atom(track_map->track, "QDCA", &header_len);
1006
      header = quicktime_wave_get_user_atom(track_map->track, "QDCA", &header_len);
1001
      if(header)
1007
      if(header)
Lines 1495-1503 void quicktime_init_audio_codec_ffmpeg(q Link Here
1495
    codec_base->decode_audio = lqt_ffmpeg_decode_audio;
1501
    codec_base->decode_audio = lqt_ffmpeg_decode_audio;
1496
  codec_base->set_parameter = set_parameter;
1502
  codec_base->set_parameter = set_parameter;
1497
1503
1498
  if((decoder->id == CODEC_ID_MP3) || (decoder->id == CODEC_ID_MP2))
1504
  if((decoder->id == AV_CODEC_ID_MP3) || (decoder->id == AV_CODEC_ID_MP2))
1499
    codec_base->read_packet = read_packet_mpa;
1505
    codec_base->read_packet = read_packet_mpa;
1500
  else if(decoder->id == CODEC_ID_AC3)
1506
  else if(decoder->id == AV_CODEC_ID_AC3)
1501
    {
1507
    {
1502
    codec_base->write_packet = write_packet_ac3;
1508
    codec_base->write_packet = write_packet_ac3;
1503
    codec_base->read_packet = read_packet_ac3;
1509
    codec_base->read_packet = read_packet_ac3;
1504
-- libquicktime-1.2.4.orig/plugins/ffmpeg/video.c
1510
++ libquicktime-1.2.4/plugins/ffmpeg/video.c
Lines 400-406 static void lqt_ffmpeg_setup_decoding_co Link Here
400
  codec->reinterpret_pix_fmt = codec->avctx->pix_fmt;
400
  codec->reinterpret_pix_fmt = codec->avctx->pix_fmt;
401
401
402
  /* First we try codec-specific colormodel matching. */
402
  /* First we try codec-specific colormodel matching. */
403
  if(codec->decoder->id == CODEC_ID_DNXHD)
403
  if(codec->decoder->id == AV_CODEC_ID_DNXHD)
404
    {
404
    {
405
    /* FFMpeg supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 for DNxHD, which
405
    /* FFMpeg supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 for DNxHD, which
406
       we sometimes interpret as PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10. */
406
       we sometimes interpret as PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10. */
Lines 438-444 static void lqt_ffmpeg_setup_encoding_co Link Here
438
  quicktime_ffmpeg_video_codec_t *codec = vtrack->codec->priv;
438
  quicktime_ffmpeg_video_codec_t *codec = vtrack->codec->priv;
439
  codec->avctx->pix_fmt = lqt_ffmpeg_get_ffmpeg_colormodel(vtrack->stream_cmodel);
439
  codec->avctx->pix_fmt = lqt_ffmpeg_get_ffmpeg_colormodel(vtrack->stream_cmodel);
440
440
441
  if (codec->encoder->id == CODEC_ID_DNXHD)
441
  if (codec->encoder->id == AV_CODEC_ID_DNXHD)
442
    {
442
    {
443
    /* FFMpeg's DNxHD encoder only supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10
443
    /* FFMpeg's DNxHD encoder only supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10
444
       and doesn't know anything about PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10
444
       and doesn't know anything about PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10
Lines 728-740 static int lqt_ffmpeg_decode_video(quick Link Here
728
728
729
    /* Set extradata: It's done differently for each codec */
729
    /* Set extradata: It's done differently for each codec */
730
730
731
    if(codec->decoder->id == CODEC_ID_SVQ3)
731
    if(codec->decoder->id == AV_CODEC_ID_SVQ3)
732
      {
732
      {
733
      extradata       = trak->mdia.minf.stbl.stsd.table[0].table_raw + 4;
733
      extradata       = trak->mdia.minf.stbl.stsd.table[0].table_raw + 4;
734
      extradata_size  = trak->mdia.minf.stbl.stsd.table[0].table_raw_size - 4;
734
      extradata_size  = trak->mdia.minf.stbl.stsd.table[0].table_raw_size - 4;
735
      
735
      
736
      }
736
      }
737
    else if(codec->decoder->id == CODEC_ID_H264)
737
    else if(codec->decoder->id == AV_CODEC_ID_H264)
738
      {
738
      {
739
      user_atom = quicktime_stsd_get_user_atom(trak, "avcC", &user_atom_len);
739
      user_atom = quicktime_stsd_get_user_atom(trak, "avcC", &user_atom_len);
740
740
Lines 753-759 static int lqt_ffmpeg_decode_video(quick Link Here
753
        }
753
        }
754
      
754
      
755
      }
755
      }
756
    else if(codec->decoder->id == CODEC_ID_MPEG4)
756
    else if(codec->decoder->id == AV_CODEC_ID_MPEG4)
757
      {
757
      {
758
      if(trak->mdia.minf.stbl.stsd.table[0].has_esds)
758
      if(trak->mdia.minf.stbl.stsd.table[0].has_esds)
759
        {
759
        {
Lines 947-961 static int lqt_ffmpeg_decode_video(quick Link Here
947
          }
947
          }
948
#endif
948
#endif
949
      }
949
      }
950
    if(codec->decoder->id == CODEC_ID_DVVIDEO)
950
    if(codec->decoder->id == AV_CODEC_ID_DVVIDEO)
951
      {
951
      {
952
      if(vtrack->stream_cmodel == BC_YUV420P)
952
      if(vtrack->stream_cmodel == BC_YUV420P)
953
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL;
953
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL;
954
      vtrack->interlace_mode = LQT_INTERLACE_BOTTOM_FIRST;
954
      vtrack->interlace_mode = LQT_INTERLACE_BOTTOM_FIRST;
955
      vtrack->ci.id = LQT_COMPRESSION_DV;
955
      vtrack->ci.id = LQT_COMPRESSION_DV;
956
      }
956
      }
957
    else if((codec->decoder->id == CODEC_ID_MPEG4) ||
957
    else if((codec->decoder->id == AV_CODEC_ID_MPEG4) ||
958
            (codec->decoder->id == CODEC_ID_H264))
958
            (codec->decoder->id == AV_CODEC_ID_H264))
959
      {
959
      {
960
      if(vtrack->stream_cmodel == BC_YUV420P)
960
      if(vtrack->stream_cmodel == BC_YUV420P)
961
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2;
961
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2;
Lines 1299-1311 static int lqt_ffmpeg_encode_video(quick Link Here
1299
    {
1299
    {
1300
    if(vtrack->stream_cmodel == BC_YUV420P)
1300
    if(vtrack->stream_cmodel == BC_YUV420P)
1301
      {
1301
      {
1302
      if(codec->encoder->id == CODEC_ID_MPEG4)
1302
      if(codec->encoder->id == AV_CODEC_ID_MPEG4)
1303
        {
1303
        {
1304
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2;
1304
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2;
1305
        /* enable interlaced encoding */
1305
        /* enable interlaced encoding */
1306
        vtrack->interlace_mode = LQT_INTERLACE_NONE;
1306
        vtrack->interlace_mode = LQT_INTERLACE_NONE;
1307
        }
1307
        }
1308
      else if(codec->encoder->id == CODEC_ID_DVVIDEO)
1308
      else if(codec->encoder->id == AV_CODEC_ID_DVVIDEO)
1309
        {
1309
        {
1310
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL;
1310
        vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL;
1311
        }
1311
        }
Lines 1340-1346 static int lqt_ffmpeg_encode_video(quick Link Here
1340
    codec->avctx->sample_aspect_ratio.num = pixel_width;
1340
    codec->avctx->sample_aspect_ratio.num = pixel_width;
1341
    codec->avctx->sample_aspect_ratio.den = pixel_height;
1341
    codec->avctx->sample_aspect_ratio.den = pixel_height;
1342
    /* Use global headers for mp4v */
1342
    /* Use global headers for mp4v */
1343
    if(codec->encoder->id == CODEC_ID_MPEG4)
1343
    if(codec->encoder->id == AV_CODEC_ID_MPEG4)
1344
      {
1344
      {
1345
      if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML)))
1345
      if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML)))
1346
        {
1346
        {
Lines 1364-1375 static int lqt_ffmpeg_encode_video(quick Link Here
1364
        }
1364
        }
1365
#endif
1365
#endif
1366
      }
1366
      }
1367
    else if((codec->encoder->id == CODEC_ID_MSMPEG4V3) && (trak->strl) &&
1367
    else if((codec->encoder->id == AV_CODEC_ID_MSMPEG4V3) && (trak->strl) &&
1368
            !strncmp(trak->strl->strf.bh.biCompression, "DIV3", 4))
1368
            !strncmp(trak->strl->strf.bh.biCompression, "DIV3", 4))
1369
      {
1369
      {
1370
      strncpy(trak->strl->strh.fccHandler, "div3", 4);
1370
      strncpy(trak->strl->strh.fccHandler, "div3", 4);
1371
      }
1371
      }
1372
    else if((codec->encoder->id == CODEC_ID_H263) &&
1372
    else if((codec->encoder->id == AV_CODEC_ID_H263) &&
1373
            (file->file_type & (LQT_FILE_MP4|LQT_FILE_3GP)))
1373
            (file->file_type & (LQT_FILE_MP4|LQT_FILE_3GP)))
1374
      {
1374
      {
1375
      uint8_t d263_data[] =
1375
      uint8_t d263_data[] =
Lines 1383-1389 static int lqt_ffmpeg_encode_video(quick Link Here
1383
      strncpy(trak->mdia.minf.stbl.stsd.table[0].format,
1383
      strncpy(trak->mdia.minf.stbl.stsd.table[0].format,
1384
              "s263", 4);
1384
              "s263", 4);
1385
      }
1385
      }
1386
    else if(codec->encoder->id == CODEC_ID_FFVHUFF)
1386
    else if(codec->encoder->id == AV_CODEC_ID_FFVHUFF)
1387
      {
1387
      {
1388
      if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML)))
1388
      if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML)))
1389
        {
1389
        {
Lines 1391-1397 static int lqt_ffmpeg_encode_video(quick Link Here
1391
        codec->write_global_header = 1;
1391
        codec->write_global_header = 1;
1392
        }
1392
        }
1393
      }
1393
      }
1394
    else if(codec->encoder->id == CODEC_ID_QTRLE)
1394
    else if(codec->encoder->id == AV_CODEC_ID_QTRLE)
1395
      {
1395
      {
1396
      if(vtrack->stream_cmodel == BC_RGBA8888)
1396
      if(vtrack->stream_cmodel == BC_RGBA8888)
1397
        {
1397
        {
Lines 1402-1412 static int lqt_ffmpeg_encode_video(quick Link Here
1402
        vtrack->track->mdia.minf.stbl.stsd.table[0].depth = 32;
1402
        vtrack->track->mdia.minf.stbl.stsd.table[0].depth = 32;
1403
        }
1403
        }
1404
      }
1404
      }
1405
    else if(codec->encoder->id == CODEC_ID_DVVIDEO)
1405
    else if(codec->encoder->id == AV_CODEC_ID_DVVIDEO)
1406
      {
1406
      {
1407
      set_dv_fourcc(width, height, vtrack->stream_cmodel, trak);
1407
      set_dv_fourcc(width, height, vtrack->stream_cmodel, trak);
1408
      }
1408
      }
1409
    else if(codec->encoder->id == CODEC_ID_DNXHD)
1409
    else if(codec->encoder->id == AV_CODEC_ID_DNXHD)
1410
      {
1410
      {
1411
      if(vtrack->interlace_mode != LQT_INTERLACE_NONE)
1411
      if(vtrack->interlace_mode != LQT_INTERLACE_NONE)
1412
        {
1412
        {
Lines 1558-1569 static int lqt_ffmpeg_encode_video(quick Link Here
1558
  
1558
  
1559
#endif
1559
#endif
1560
  
1560
  
1561
  if(!was_initialized && codec->encoder->id == CODEC_ID_DNXHD)
1561
  if(!was_initialized && codec->encoder->id == AV_CODEC_ID_DNXHD)
1562
    setup_avid_atoms(file, vtrack, codec->buffer, bytes_encoded);
1562
    setup_avid_atoms(file, vtrack, codec->buffer, bytes_encoded);
1563
  
1563
  
1564
  if(bytes_encoded)
1564
  if(bytes_encoded)
1565
    {
1565
    {
1566
    if (pts == AV_NOPTS_VALUE || (codec->encoder->id == CODEC_ID_DNXHD && pts == 0))
1566
    if (pts == AV_NOPTS_VALUE || (codec->encoder->id == AV_CODEC_ID_DNXHD && pts == 0))
1567
      {
1567
      {
1568
      /* Some codecs don't bother generating presentation timestamps.
1568
      /* Some codecs don't bother generating presentation timestamps.
1569
         FFMpeg's DNxHD encoder doesn't even bother to set it to AV_NOPTS_VALUE. */
1569
         FFMpeg's DNxHD encoder doesn't even bother to set it to AV_NOPTS_VALUE. */
Lines 1590-1602 static int lqt_ffmpeg_encode_video(quick Link Here
1590
1590
1591
  if(codec->write_global_header && !codec->global_header_written)
1591
  if(codec->write_global_header && !codec->global_header_written)
1592
    {
1592
    {
1593
    if(codec->encoder->id == CODEC_ID_FFVHUFF)
1593
    if(codec->encoder->id == AV_CODEC_ID_FFVHUFF)
1594
      {
1594
      {
1595
      quicktime_user_atoms_add_atom(&trak->mdia.minf.stbl.stsd.table[0].user_atoms,
1595
      quicktime_user_atoms_add_atom(&trak->mdia.minf.stbl.stsd.table[0].user_atoms,
1596
                                    "glbl",
1596
                                    "glbl",
1597
                                    codec->avctx->extradata, codec->avctx->extradata_size );
1597
                                    codec->avctx->extradata, codec->avctx->extradata_size );
1598
      }
1598
      }
1599
    else if(codec->encoder->id == CODEC_ID_MPEG4)
1599
    else if(codec->encoder->id == AV_CODEC_ID_MPEG4)
1600
      {
1600
      {
1601
      int advanced = 0;
1601
      int advanced = 0;
1602
      if(codec->avctx->max_b_frames ||
1602
      if(codec->avctx->max_b_frames ||
Lines 1903-1920 void quicktime_init_video_codec_ffmpeg(q Link Here
1903
    codec_base->encode_video = lqt_ffmpeg_encode_video;
1903
    codec_base->encode_video = lqt_ffmpeg_encode_video;
1904
    codec_base->set_pass = set_pass_ffmpeg;
1904
    codec_base->set_pass = set_pass_ffmpeg;
1905
1905
1906
    if(encoder->id == CODEC_ID_MPEG4)
1906
    if(encoder->id == AV_CODEC_ID_MPEG4)
1907
      {
1907
      {
1908
      codec_base->writes_compressed = writes_compressed_mpeg4;
1908
      codec_base->writes_compressed = writes_compressed_mpeg4;
1909
      codec_base->init_compressed   = init_compressed_mpeg4;
1909
      codec_base->init_compressed   = init_compressed_mpeg4;
1910
      codec_base->write_packet = write_packet_mpeg4;
1910
      codec_base->write_packet = write_packet_mpeg4;
1911
      }
1911
      }
1912
    else if(encoder->id == CODEC_ID_MPEG2VIDEO)
1912
    else if(encoder->id == AV_CODEC_ID_MPEG2VIDEO)
1913
      {
1913
      {
1914
      codec_base->writes_compressed = writes_compressed_imx;
1914
      codec_base->writes_compressed = writes_compressed_imx;
1915
      codec_base->init_compressed   = init_compressed_imx;
1915
      codec_base->init_compressed   = init_compressed_imx;
1916
      }
1916
      }
1917
    else if(encoder->id == CODEC_ID_DVVIDEO)
1917
    else if(encoder->id == AV_CODEC_ID_DVVIDEO)
1918
      {
1918
      {
1919
      codec_base->init_compressed = init_compressed_dv;
1919
      codec_base->init_compressed = init_compressed_dv;
1920
      }
1920
      }
Lines 1922-1928 void quicktime_init_video_codec_ffmpeg(q Link Here
1922
    }
1922
    }
1923
  if(decoder)
1923
  if(decoder)
1924
    {
1924
    {
1925
    if(decoder->id == CODEC_ID_H264)
1925
    if(decoder->id == AV_CODEC_ID_H264)
1926
      codec_base->read_packet = read_packet_h264;
1926
      codec_base->read_packet = read_packet_h264;
1927
    codec_base->decode_video = lqt_ffmpeg_decode_video;
1927
    codec_base->decode_video = lqt_ffmpeg_decode_video;
1928
    }
1928
    }

Return to bug 509300