Changeset 708
- Timestamp:
- 09/28/07 20:17:09 (1 year ago)
- Files:
-
- trunk/FFusionCodec.c (modified) (4 diffs)
- trunk/FFusionCodec.h (modified) (1 diff)
- trunk/FFusionCodec.r (modified) (7 diffs)
- trunk/PerianAviImporter.r (modified) (1 diff)
- trunk/ff_MovieImport.c (modified) (3 diffs)
- trunk/ff_MovieImportVersion.h (modified) (1 diff)
- trunk/ff_private.c (modified) (4 diffs)
- trunk/ff_private.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/FFusionCodec.c
r707 r708 451 451 int index; 452 452 CodecCapabilities *capabilities = p->capabilities; 453 Byte* myptr;454 453 long count = 0; 455 454 Handle imgDescExt; … … 597 596 codecID = CODEC_ID_SNOW; 598 597 break; 598 599 case 'RJPG': 600 case 'NUV1': 601 codecID = CODEC_ID_NUV; 602 break; 603 599 604 600 605 default: … … 621 626 // We also pass the FourCC since it allows the H263 hybrid decoder 622 627 // to make the difference between the various flavours of DivX 623 624 myptr = (unsigned char *)&(glob->componentType); 625 glob->avContext->codec_tag = (myptr[3] << 24) + (myptr[2] << 16) + (myptr[1] << 8) + myptr[0]; 628 glob->avContext->codec_tag = Endian32_Swap(glob->componentType); 626 629 627 630 // avc1 requires the avcC extension … … 1453 1456 err = GetComponentResource((Component)glob->self, codecInfoResourceType, kSnowCodecInfoResID, (Handle *)&tempCodecInfo); 1454 1457 break; 1458 1459 case 'RJPG': 1460 err = GetComponentResource((Component)glob->self, codecInfoResourceType, kNuvCodecInfoResID, (Handle *)&tempCodecInfo); 1461 break; 1462 1455 1463 1456 1464 default: // should never happen but we have to handle the case trunk/FFusionCodec.h
r681 r708 50 50 #define kFRAPSCodecInfoResID 273 51 51 #define kSnowCodecInfoResID 274 52 #define kNuvCodecInfoResID 275 52 53 53 54 #define kFFusionCodecManufacturer 'Peri' trunk/FFusionCodec.r
r681 r708 63 63 #define kFRAPSName "Fraps" 64 64 #define kSnowName "Snow" 65 #define kNuvName "NuppelVideo" 65 66 66 67 // Codec names Resource ID … … 85 86 #define kFRAPSNameResID 273 86 87 #define kSnowNameResID 274 88 #define kNuvNameResID 275 87 89 88 90 // Codec infos Resource ID … … 107 109 #define kFRAPSInfoResID 302 108 110 #define kSnowInfoResID 303 111 #define kNuvInfoResID 304 109 112 110 113 // These flags specify information about the capabilities of the component … … 593 596 0 // Private Data 594 597 }; 598 599 //--------------------------------------------------------------------------- 600 // Nuv Description Resources 601 //--------------------------------------------------------------------------- 602 603 resource 'cdci' (kNuvCodecInfoResID) { 604 kNuvName, // Type 605 1, // Version 606 1, // Revision level 607 kFFusionCodecManufacturer, // Manufacturer 608 kFFusionDecompressionFlags, // Decompression Flags 609 0, // Compression Flags 610 kFFusionFormatFlags, // Format Flags 611 128, // Compression Accuracy 612 128, // Decomression Accuracy 613 200, // Compression Speed 614 200, // Decompression Speed 615 128, // Compression Level 616 0, // Reserved 617 1, // Minimum Height 618 1, // Minimum Width 619 0, // Decompression Pipeline Latency 620 0, // Compression Pipeline Latency 621 0 // Private Data 622 }; 623 595 624 596 625 //--------------------------------------------------------------------------- … … 3003 3032 3004 3033 //--------------------------------------------------------------------------- 3034 // New Nuv Components 3035 //--------------------------------------------------------------------------- 3036 resource 'thng' (334) { 3037 decompressorComponentType, // Type 3038 'RJPG', // SubType 3039 kFFusionCodecManufacturer, // Manufacturer 3040 0, // - use componentHasMultiplePlatforms 3041 0, 3042 0, 3043 0, 3044 'STR ', // Name Type 3045 kNuvNameResID, // Name ID 3046 'STR ', // Info Type 3047 kNuvInfoResID, // Info ID 3048 0, // Icon Type 3049 0, // Icon ID 3050 kFFusionCodecVersion, // Version 3051 componentHasMultiplePlatforms + // Registration Flags 3052 componentDoAutoVersion, // Registration Flags 3053 0, // Resource ID of Icon Family 3054 { 3055 kFFusionDecompressionFlags, 3056 'dlle', // Entry point found by symbol name 'dlle' resource 3057 256, // ID of 'dlle' resource 3058 platformPowerPCNativeEntryPoint, 3059 kFFusionDecompressionFlags, 3060 'dlle', 3061 256, 3062 platformIA32NativeEntryPoint, 3063 }; 3064 }; 3065 3066 //--------------------------------------------------------------------------- 3067 // Old Nuv Components 3068 //--------------------------------------------------------------------------- 3069 resource 'thng' (335) { 3070 decompressorComponentType, // Type 3071 'NUV1', // SubType 3072 kFFusionCodecManufacturer, // Manufacturer 3073 0, // - use componentHasMultiplePlatforms 3074 0, 3075 0, 3076 0, 3077 'STR ', // Name Type 3078 kNuvNameResID, // Name ID 3079 'STR ', // Info Type 3080 kNuvInfoResID, // Info ID 3081 0, // Icon Type 3082 0, // Icon ID 3083 kFFusionCodecVersion, // Version 3084 componentHasMultiplePlatforms + // Registration Flags 3085 componentDoAutoVersion, // Registration Flags 3086 0, // Resource ID of Icon Family 3087 { 3088 kFFusionDecompressionFlags, 3089 'dlle', // Entry point found by symbol name 'dlle' resource 3090 256, // ID of 'dlle' resource 3091 platformPowerPCNativeEntryPoint, 3092 kFFusionDecompressionFlags, 3093 'dlle', 3094 256, 3095 platformIA32NativeEntryPoint, 3096 }; 3097 }; 3098 3099 3100 //--------------------------------------------------------------------------- 3005 3101 // Component Name Resources 3006 3102 //--------------------------------------------------------------------------- … … 3082 3178 }; 3083 3179 3180 resource 'STR ' (kNuvNameResID) { 3181 "NuppelVideo (Perian)" 3182 }; 3183 3084 3184 //--------------------------------------------------------------------------- 3085 3185 // Component Name Resources … … 3162 3262 }; 3163 3263 3264 resource 'STR ' (kNuvInfoResID) { 3265 "Decompresses video stored in NuppelVideo format." 3266 }; 3267 3164 3268 //--------------------------------------------------------------------------- 3165 3269 // Code Entry Point for Mach-O trunk/PerianAviImporter.r
r584 r708 322 322 }; 323 323 324 325 326 327 /* Component Manager Things - 328 Nuv */ 329 resource 'thng' (kNuvthngResID) { 330 'eat ', // Type 331 'NUV ', // SubType 332 'Myth', // Manufacturer 333 0, 334 0, 335 0, 336 0, 337 'STR ', // Name Type 338 kNuvthngResID, // Name ID 339 0, // Info Type 340 0, // Info ID 341 0, // Icon Type 342 0, // Icon ID 343 kFFAviComponentVersion, // Version 344 componentHasMultiplePlatforms + 345 componentDoAutoVersion, // Registratin Flags 346 0, // Resource ID of Icon Family 347 { 348 kFFAvi_MovieImportFlags | movieImportSubTypeIsFileExtension, 349 'dlle', // Code Resource type 350 512, 351 platformIA32NativeEntryPoint, // IA32 352 kFFAvi_MovieImportFlags | movieImportSubTypeIsFileExtension, 353 'dlle', 354 512, 355 platformPowerPCNativeEntryPoint, // PowerPC 356 }, 357 'thnr', kNuvthngResID 358 }; 359 360 resource 'thnr' (kNuvthngResID) { 361 { 362 'mime', 1, 0, 363 'mime', kNuvthngResID, 0, 364 } 365 }; 366 367 resource 'mime' (kNuvthngResID) { 368 { 369 kMimeInfoMimeTypeTag, 1, "audio/x-nuv"; 370 kMimeInfoFileExtensionTag, 1, "nuv"; 371 kMimeInfoDescriptionTag, 1, "NuppelVideo"; 372 }; 373 }; 374 375 resource 'STR ' (kNuvthngResID) { 376 "NuppelVideo" 377 }; 378 379 380 381 324 382 resource 'dlle' (512) { 325 383 "FFAvi_MovieImportComponentDispatch" trunk/ff_MovieImport.c
r706 r708 88 88 REGISTER_DEMUXER(flv); 89 89 REGISTER_DEMUXER(tta); 90 REGISTER_DEMUXER(nuv); 90 91 register_parsers(); 91 92 … … 108 109 REGISTER_DECODER(fraps); 109 110 REGISTER_DECODER(snow); 111 REGISTER_DECODER(nuv); 110 112 111 113 REGISTER_DECODER(wmav1); … … 205 207 err = GetComponentResource((Component)storage->ci, 'mime', kTTAthngResID, (Handle*)mimeInfo); 206 208 break; 209 case 'NUV ': 210 err = GetComponentResource((Component)storage->ci, 'mime', kNuvthngResID, (Handle*)mimeInfo); 211 break; 207 212 default: 208 213 err = GetComponentResource((Component)storage->ci, 'mime', kAVIthngResID, (Handle*)mimeInfo); trunk/ff_MovieImportVersion.h
r584 r708 31 31 #define kFLVthngResID 515 32 32 #define kTTAthngResID 517 33 #define kNuvthngResID 518 33 34 34 35 #endif trunk/ff_private.c
r702 r708 542 542 if(st->codec->codec_type == CODEC_TYPE_VIDEO) { 543 543 track = NewMovieTrack(theMovie, st->codec->width << 16, st->codec->height << 16, kNoVolume); 544 545 // XXX Support for 'old' NUV files, that didn't put the codec_tag in the file. 546 if( st->codec->codec_id == CODEC_ID_NUV && st->codec->codec_tag == 0 ) { 547 st->codec->codec_tag = MKTAG( 'N', 'U', 'V', '1' ); 548 } 549 544 550 initialize_video_map(&map[j], track, dataRef, dataRefType, storage->firstFrames + j); 545 551 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { … … 857 863 858 864 while((readResult = av_read_frame(formatContext, &packet)) == 0) { 865 bool trustPacketDuration = true; 859 866 ncstream = &storage->stream_map[packet.stream_index]; 860 867 stream = ncstream->str; … … 864 871 if((packet.flags & PKT_FLAG_KEY) == 0) 865 872 flags |= mediaSampleNotSync; 873 874 if(IS_NUV(storage->componentType) && codecContext->codec_id == CODEC_ID_MP3) trustPacketDuration = false; 866 875 867 876 memset(&sampleRec, 0, sizeof(sampleRec)); … … 890 899 } 891 900 892 if(packet.duration == 0) { 901 902 // If this is a nuv file, then we want to set the duration to zero. 903 // This is because the nuv container doesn't have the framesize info 904 // for audio. 905 906 if(packet.duration == 0 || !trustPacketDuration) { 893 907 //no duration, we'll have to wait for the next packet to calculate it 894 908 // keep the duration of the last sample, so we can use it if it's the last frame trunk/ff_private.h
r686 r708 119 119 120 120 #define IS_AVI(x) (x == 'AVI ' || x == 'VfW ' || x == 'VFW ') 121 #define IS_NUV(x) (x == 'NUV ') 121 122 122 123 #endif
