Changeset 853
- Timestamp:
- 04/19/08 23:46:50 (3 months ago)
- Files:
-
- trunk/MatroskaCodecIDs.cpp (modified) (1 diff)
- trunk/MatroskaImportPrivate.cpp (modified) (4 diffs)
- trunk/ff_private.c (modified) (3 diffs)
- trunk/ff_private.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaCodecIDs.cpp
r852 r853 143 143 144 144 if (dir == kToSampleDescription) { 145 // WAVFORMATEX is stored in the private data, and some codecs (WMA) need it to decode146 145 KaxCodecPrivate & codecPrivate = GetChild<KaxCodecPrivate>(*tr_entry); 147 146 trunk/MatroskaImportPrivate.cpp
r851 r853 51 51 extern "C" { 52 52 #include "avutil.h" 53 #define CodecType AVCodecType 54 #include "ff_private.h" 55 #undef CodecType 53 56 } 54 57 … … 406 409 ComponentResult err = noErr; 407 410 ImageDescriptionHandle imgDesc; 408 CleanApertureImageDescriptionExtension **clap = (CleanApertureImageDescriptionExtension**)NewHandle(sizeof(CleanApertureImageDescriptionExtension));409 411 Fixed width, height; 410 412 … … 439 441 return invalidTrack; 440 442 } 441 442 SetCleanApertureDimensions(clap, width, height); 443 443 444 444 mkvTrack.theTrack = NewMovieTrack(theMovie, width, height, kNoVolume); 445 445 if (mkvTrack.theTrack == NULL) … … 461 461 (*imgDesc)->clutID = -1; 462 462 463 AddImageDescriptionExtension(imgDesc,(Handle)clap, kCleanApertureImageDescriptionExtension); 464 465 DisposeHandle((Handle)clap); 466 463 set_track_clean_aperture_ext(imgDesc, width, height); 467 464 mkvTrack.desc = (SampleDescriptionHandle) imgDesc; 468 465 trunk/ff_private.c
r842 r853 518 518 } 519 519 520 static void get_track_dimensions_for_codec(AVCodecContext *codec, Fixed *fixedWidth, Fixed *fixedHeight) 521 { 522 *fixedHeight = IntToFixed(codec->height); 523 524 if (!codec->sample_aspect_ratio.num) *fixedWidth = IntToFixed(codec->width); 525 else *fixedWidth = FloatToFixed(codec->width * av_q2d(codec->sample_aspect_ratio)); 526 } 527 528 void set_track_clean_aperture_ext(ImageDescriptionHandle imgDesc, Fixed cleanW, Fixed cleanH) 529 { 530 CleanApertureImageDescriptionExtension **clap = (CleanApertureImageDescriptionExtension**)NewHandle(sizeof(CleanApertureImageDescriptionExtension)); 531 532 int wN, wD, hN, hD; 533 534 av_reduce(&wN, &wD, cleanW, fixed1, UINT_MAX); 535 av_reduce(&hN, &hD, cleanH, fixed1, UINT_MAX); 536 537 **clap = (CleanApertureImageDescriptionExtension){EndianU32_NtoB(wN), EndianU32_NtoB(wD), 538 EndianU32_NtoB(hN), EndianU32_NtoB(hD), 539 EndianU32_NtoB(0), EndianU32_NtoB(1), 540 EndianU32_NtoB(0), EndianU32_NtoB(1)}; 541 542 AddImageDescriptionExtension(imgDesc, (Handle)clap, kCleanApertureImageDescriptionExtension); 543 544 DisposeHandle((Handle)clap); 545 } 546 520 547 /* This function prepares the movie to receivve the movie data, 521 548 * After success, *out_map points to a valid stream maping … … 544 571 545 572 if(st->codec->codec_type == CODEC_TYPE_VIDEO) { 546 track = NewMovieTrack(theMovie, st->codec->width << 16, st->codec->height << 16, kNoVolume); 573 Fixed width, height; 574 575 get_track_dimensions_for_codec(st->codec, &width, &height); 576 track = NewMovieTrack(theMovie, width, height, kNoVolume); 547 577 548 578 // XXX Support for 'old' NUV files, that didn't put the codec_tag in the file. … … 552 582 553 583 initialize_video_map(&map[j], track, dataRef, dataRefType, storage->firstFrames + j); 584 set_track_clean_aperture_ext((ImageDescriptionHandle)map[j].sampleHdl, width, height); 554 585 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { 555 586 if (st->codec->sample_rate > 0) { trunk/ff_private.h
r806 r853 111 111 uint8_t *create_cookie(AVCodecContext *codec, size_t *cookieSize, UInt32 formatID); 112 112 Handle create_strf_ext(AVCodecContext *codec); 113 void set_track_clean_aperture_ext(ImageDescriptionHandle imgDesc, Fixed cleanW, Fixed cleanH); 113 114 114 115 uint8_t *write_int32(uint8_t *target, int32_t data);
