Changeset 158
- Timestamp:
- 10/13/06 19:07:19 (2 years ago)
- Files:
-
- trunk/MatroskaImport.c (modified) (2 diffs)
- trunk/MkvMovieSetup.cpp (modified) (4 diffs)
- trunk/Perian.xcodeproj/project.pbxproj (modified) (7 diffs)
- trunk/SubImport.c (added)
- trunk/SubImport.h (added)
- trunk/ff_MovieImport.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaImport.c
r138 r158 37 37 #include "MatroskaImport.h" 38 38 #include "MkvImportPrivate.h" 39 #include "SubImport.h" 39 40 40 41 #pragma mark- Component Dispatch … … 138 139 inFlags, 139 140 outFlags); 140 141 if (err) goto bail; 142 143 LoadExternalSubtitles(&theFileFSRef, theMovie); 144 141 145 bail: 142 146 if (store->filename) trunk/MkvMovieSetup.cpp
r156 r158 26 26 #include "MkvImportPrivate.h" 27 27 #include "MkvMovieSetup.h" 28 #include "SubImport.h" 28 29 #include <QuickTime/QuickTime.h> 29 30 #include <AudioToolbox/AudioToolbox.h> … … 541 542 ComponentResult err = noErr; 542 543 Fixed trackWidth, trackHeight; 543 Fixed horizontalOffset, verticalOffset;544 544 Rect movieBox; 545 545 MediaHandler mh; … … 575 575 (*imgDesc)->height = height; 576 576 577 mkvTrack->theTrack = NewMovieTrack(theMovie, trackWidth, trackHeight, kNoVolume); 578 if (mkvTrack->theTrack == NULL) { 579 err = GetMoviesError(); 580 goto bail; 581 } 582 583 mkvTrack->theMedia = NewTrackMedia(mkvTrack->theTrack, VideoMediaType, GetMovieTimeScale(theMovie), dataRef, dataRefType); 584 if (mkvTrack->theMedia == NULL) { 585 err = GetMoviesError(); 586 goto bail; 587 } 588 589 // finally, say that we're transparent 590 mh = GetMediaHandler(mkvTrack->theMedia); 591 MediaSetGraphicsMode(mh, graphicsModePreWhiteAlpha, NULL); 592 577 593 } else if ((*imgDesc)->cType == kSubFormatUTF8) { 578 (*imgDesc)->width = FixedToInt(trackWidth); 579 (*imgDesc)->height = FixedToInt(trackHeight); 594 mkvTrack->theTrack = CreatePlaintextSubTrack(theMovie, imgDesc, GetMovieTimeScale(theMovie), dataRef, dataRefType); 595 if (mkvTrack->theTrack == NULL) { 596 err = GetMoviesError(); 597 goto bail; 598 } 599 600 mkvTrack->theMedia = GetTrackMedia(mkvTrack->theTrack); 580 601 581 602 } else { … … 584 605 } 585 606 586 mkvTrack->theTrack = NewMovieTrack(theMovie, trackWidth, trackHeight, kNoVolume);587 if (mkvTrack->theTrack == NULL) {588 err = GetMoviesError();589 goto bail;590 }591 592 mkvTrack->theMedia = NewTrackMedia(mkvTrack->theTrack, VideoMediaType,593 GetMovieTimeScale(theMovie), dataRef, dataRefType);594 if (mkvTrack->theMedia == NULL) {595 err = GetMoviesError();596 goto bail;597 }598 599 607 // this sets up anything else needed in the description for the specific codec. 600 608 FinishSampleDescription(tr_entry, (SampleDescriptionHandle) imgDesc); 601 602 // finally, say that we're transparent603 mh = GetMediaHandler(mkvTrack->theMedia);604 MediaSetGraphicsMode(mh, graphicsModePreWhiteAlpha, NULL);605 609 606 610 // and save our sample description trunk/Perian.xcodeproj/project.pbxproj
r143 r158 161 161 61CB120D0ACE0F8D007994BD /* MatroskaCodecIDs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 61D691500AC8E382000EFC7D /* MatroskaCodecIDs.cpp */; }; 162 162 61CB12260ACE1074007994BD /* MatroskaImport.r in Rez */ = {isa = PBXBuildFile; fileRef = 61D691590AC8E382000EFC7D /* MatroskaImport.r */; }; 163 61D514DE0ADF3DBA00A671E1 /* SubImport.c in Sources */ = {isa = PBXBuildFile; fileRef = 61D514DD0ADF3DBA00A671E1 /* SubImport.c */; }; 164 61D517730AE0402E00A671E1 /* CommonUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = 61D517720AE0402E00A671E1 /* CommonUtils.c */; }; 163 165 8F483B550A642644002CCA73 /* libavformat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F483B540A642644002CCA73 /* libavformat.a */; }; 164 166 8F483B5E0A6426C1002CCA73 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F483B5D0A6426C1002CCA73 /* AudioToolbox.framework */; }; … … 340 342 61CB11CA0ACDF50F007994BD /* KaxTrackVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = KaxTrackVideo.cpp; path = libmatroska/src/KaxTrackVideo.cpp; sourceTree = "<group>"; }; 341 343 61CB11CB0ACDF50F007994BD /* KaxVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = KaxVersion.cpp; path = libmatroska/src/KaxVersion.cpp; sourceTree = "<group>"; }; 344 61D514DC0ADF3DBA00A671E1 /* SubImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubImport.h; sourceTree = "<group>"; }; 345 61D514DD0ADF3DBA00A671E1 /* SubImport.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SubImport.c; sourceTree = "<group>"; }; 346 61D517710AE0402E00A671E1 /* CommonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonUtils.h; sourceTree = "<group>"; }; 347 61D517720AE0402E00A671E1 /* CommonUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CommonUtils.c; sourceTree = "<group>"; }; 342 348 61D6914E0AC8E382000EFC7D /* DataHandlerCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataHandlerCallback.cpp; sourceTree = "<group>"; }; 343 349 61D6914F0AC8E382000EFC7D /* DataHandlerCallback.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataHandlerCallback.h; sourceTree = "<group>"; }; … … 422 428 isa = PBXGroup; 423 429 children = ( 430 61CB11020ACDF37C007994BD /* libebml */, 431 61CB11720ACDF4BB007994BD /* libmatroska */, 424 432 8F483B5D0A6426C1002CCA73 /* AudioToolbox.framework */, 425 433 1156DBD80A3CE9F500963B0E /* libz.dylib */, … … 468 476 113F58980A6B091600509987 /* Codecprintf.h */, 469 477 113F58990A6B091600509987 /* Codecprintf.c */, 478 61D517710AE0402E00A671E1 /* CommonUtils.h */, 479 61D517720AE0402E00A671E1 /* CommonUtils.c */, 470 480 ); 471 481 name = Source; … … 491 501 6123D6230AD0A3FE003EDE52 /* VobSubCodec.h */, 492 502 6123D6250AD0A3FF003EDE52 /* VobSubCodecDispatch.h */, 503 61D514DC0ADF3DBA00A671E1 /* SubImport.h */, 504 61D514DD0ADF3DBA00A671E1 /* SubImport.c */, 493 505 ); 494 506 name = Subtitles; … … 609 621 isa = PBXGroup; 610 622 children = ( 611 61CB11020ACDF37C007994BD /* libebml */,612 61CB11720ACDF4BB007994BD /* libmatroska */,613 623 61D6916B0AC8E3A3000EFC7D /* Import */, 614 624 61D6916C0AC8E3C5000EFC7D /* Export */, … … 880 890 6123D6260AD0A3FF003EDE52 /* VobSubCodec.c in Sources */, 881 891 613CD51E0AD1FB650098A825 /* TextSubCodec.c in Sources */, 892 61D514DE0ADF3DBA00A671E1 /* SubImport.c in Sources */, 893 61D517730AE0402E00A671E1 /* CommonUtils.c in Sources */, 882 894 ); 883 895 runOnlyForDeploymentPostprocessing = 0; trunk/ff_MovieImport.c
r154 r158 27 27 #include "Codecprintf.h" 28 28 #include "riff.h" 29 #include "SubImport.h" 29 30 30 31 /* This one is a little big in ffmpeg and private anyway */ … … 340 341 Handle dataRef = NULL; 341 342 OSType dataRefType; 343 FSRef theFileFSRef; 342 344 343 345 *outFlags = 0; … … 348 350 result = MovieImportDataRef(storage->ci, dataRef, dataRefType, theMovie, targetTrack, usedTrack, atTime, addedDuration, 349 351 inFlags, outFlags); 352 require_noerr(result, bail); 353 354 result = FSpMakeFSRef(theFile, &theFileFSRef); 355 require_noerr(result, bail); 356 357 LoadExternalSubtitles(&theFileFSRef, theMovie); 358 350 359 bail: 351 360 if(dataRef)
