Changeset 243

Show
Ignore:
Timestamp:
01/06/07 01:44:33 (2 years ago)
Author:
dconrad
Message:

MPEG 1 and 2 decoders. Refs #27.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CodecIDs.h

    r218 r243  
    7878         
    7979        // the following 4CCs don't have decoder support yet 
    80         kMPEG1VisualCodecType                   = 'mp1v', 
    81         kMPEG2VisualCodecType                   = 'mp2v', 
     80        kMPEG1VisualCodecType                   = 'MPEG', 
     81        kMPEG2VisualCodecType                   = 'MPG2', 
    8282        kAudioFormatDTS                         = 'DTS ',  
    8383        kAudioFormatTTA                         = 'TTA1', 
  • trunk/FFusionCodec.c

    r232 r243  
    514514                        case 'FFVH': 
    515515                                glob->avCodec = avcodec_find_decoder(CODEC_ID_FFVHUFF); 
     516                                break; 
     517                                 
     518                        case 'MPEG': 
     519                        case 'mpg1': 
     520                                glob->avCodec = avcodec_find_decoder(CODEC_ID_MPEG1VIDEO); 
     521                                break; 
     522                                 
     523                        case 'MPG2': 
     524                        case 'mpg2': 
     525                                glob->avCodec = avcodec_find_decoder(CODEC_ID_MPEG2VIDEO); 
    516526                                break; 
    517527                                 
     
    11701180                                break; 
    11711181                                 
     1182                        case 'MPEG': 
     1183                        case 'mpg1': 
     1184                                err = GetComponentResource((Component)glob->self, codecInfoResourceType, kMPEG1CodecInfoResID, (Handle *)&tempCodecInfo); 
     1185                                break; 
     1186                                 
     1187                        case 'MPG2': 
     1188                        case 'mpg2': 
     1189                                err = GetComponentResource((Component)glob->self, codecInfoResourceType, kMPEG2CodecInfoResID, (Handle *)&tempCodecInfo); 
     1190                                break; 
     1191                                 
    11721192            default:    // should never happen but we have to handle the case 
    11731193                err = GetComponentResource((Component)glob->self, codecInfoResourceType, kDivX4CodecInfoResID, (Handle *)&tempCodecInfo); 
  • trunk/FFusionCodec.h

    r230 r243  
    4646#define kVP3CodecInfoResID                      269 
    4747#define kHuffYUVCodecInfoResID          270 
     48#define kMPEG1CodecInfoResID            271 
     49#define kMPEG2CodecInfoResID            272 
    4850 
    4951#define kFFusionCodecManufacturer       'SNE2' 
  • trunk/FFusionCodec.r

    r231 r243  
    5959#define kVP3Name                "On2 VP3" 
    6060#define kHuffYUVName            "HuffYUV" 
     61#define kMPEG1Name              "MPEG-1 Video" 
     62#define kMPEG2Name              "MPEG-2 Video" 
    6163 
    6264// Codec names Resource ID 
     
    7779#define kVP3NameResID           269 
    7880#define kHuffYUVNameResID       270 
     81#define kMPEG1NameResID         271 
     82#define kMPEG2NameResID         272 
    7983 
    8084// Codec infos Resource ID 
     
    9599#define kVP3InfoResID           298 
    96100#define kHuffYUVInfoResID               299 
     101#define kMPEG1InfoResID         300 
     102#define kMPEG2InfoResID         301 
    97103 
    98104// These flags specify information about the capabilities of the component 
     
    483489 
    484490//--------------------------------------------------------------------------- 
     491// MPEG-1 Description Resources 
     492//--------------------------------------------------------------------------- 
     493 
     494resource 'cdci' (kMPEG1CodecInfoResID) { 
     495        kMPEG1Name,                             // Type 
     496        1,                                      // Version 
     497        1,                                      // Revision level 
     498        kFFusionCodecManufacturer,                      // Manufacturer 
     499        kFFusionDecompressionFlags,             // Decompression Flags 
     500        0,                                      // Compression Flags 
     501        kFFusionFormatFlags,                    // Format Flags 
     502        128,                                    // Compression Accuracy 
     503        128,                                    // Decomression Accuracy 
     504        200,                                    // Compression Speed 
     505        200,                                    // Decompression Speed 
     506        128,                                    // Compression Level 
     507        0,                                      // Reserved 
     508        1,                                      // Minimum Height 
     509        1,                                      // Minimum Width 
     510        0,                                      // Decompression Pipeline Latency 
     511        0,                                      // Compression Pipeline Latency 
     512        0                                       // Private Data 
     513}; 
     514 
     515//--------------------------------------------------------------------------- 
     516// MPEG-2 Description Resources 
     517//--------------------------------------------------------------------------- 
     518 
     519resource 'cdci' (kMPEG2CodecInfoResID) { 
     520        kMPEG2Name,                             // Type 
     521        1,                                      // Version 
     522        1,                                      // Revision level 
     523        kFFusionCodecManufacturer,                      // Manufacturer 
     524        kFFusionDecompressionFlags,             // Decompression Flags 
     525        0,                                      // Compression Flags 
     526        kFFusionFormatFlags,                    // Format Flags 
     527        128,                                    // Compression Accuracy 
     528        128,                                    // Decomression Accuracy 
     529        200,                                    // Compression Speed 
     530        200,                                    // Decompression Speed 
     531        128,                                    // Compression Level 
     532        0,                                      // Reserved 
     533        1,                                      // Minimum Height 
     534        1,                                      // Minimum Width 
     535        0,                                      // Decompression Pipeline Latency 
     536        0,                                      // Compression Pipeline Latency 
     537        0                                       // Private Data 
     538}; 
     539 
     540//--------------------------------------------------------------------------- 
    485541// MS-MPEG4 v1 Component 
    486542//--------------------------------------------------------------------------- 
     
    26092665 
    26102666//--------------------------------------------------------------------------- 
     2667// MPEG-1 Components 
     2668//--------------------------------------------------------------------------- 
     2669resource 'thng' (325) { 
     2670        decompressorComponentType,              // Type                  
     2671        'MPEG',                                 // SubType 
     2672        kFFusionCodecManufacturer,                      // Manufacturer 
     2673        0,                                      // - use componentHasMultiplePlatforms 
     2674        0, 
     2675        0, 
     2676        0, 
     2677        'STR ',                                 // Name Type 
     2678        kMPEG1NameResID,                        // Name ID 
     2679        'STR ',                                 // Info Type 
     2680        kMPEG1InfoResID,                        // Info ID 
     2681        0,                                      // Icon Type 
     2682        0,                                      // Icon ID 
     2683        kFFusionCodecVersion,                   // Version 
     2684        componentHasMultiplePlatforms +         // Registration Flags  
     2685        componentDoAutoVersion,                 // Registration Flags 
     2686        0,                                      // Resource ID of Icon Family 
     2687{ 
     2688        kFFusionDecompressionFlags,  
     2689        'dlle',                         // Entry point found by symbol name 'dlle' resource 
     2690        256,                            // ID of 'dlle' resource 
     2691        platformPowerPCNativeEntryPoint, 
     2692        kFFusionDecompressionFlags, 
     2693        'dlle', 
     2694        256, 
     2695        platformIA32NativeEntryPoint, 
     2696}; 
     2697}; 
     2698 
     2699resource 'thng' (326) { 
     2700        decompressorComponentType,              // Type                  
     2701        'mpg1',                                 // SubType 
     2702        kFFusionCodecManufacturer,                      // Manufacturer 
     2703        0,                                      // - use componentHasMultiplePlatforms 
     2704        0, 
     2705        0, 
     2706        0, 
     2707        'STR ',                                 // Name Type 
     2708        kMPEG1NameResID,                        // Name ID 
     2709        'STR ',                                 // Info Type 
     2710        kMPEG1InfoResID,                        // Info ID 
     2711        0,                                      // Icon Type 
     2712        0,                                      // Icon ID 
     2713        kFFusionCodecVersion,                   // Version 
     2714        componentHasMultiplePlatforms +         // Registration Flags  
     2715        componentDoAutoVersion,                 // Registration Flags 
     2716        0,                                      // Resource ID of Icon Family 
     2717{ 
     2718        kFFusionDecompressionFlags,  
     2719        'dlle',                         // Entry point found by symbol name 'dlle' resource 
     2720        256,                            // ID of 'dlle' resource 
     2721        platformPowerPCNativeEntryPoint, 
     2722        kFFusionDecompressionFlags, 
     2723        'dlle', 
     2724        256, 
     2725        platformIA32NativeEntryPoint, 
     2726}; 
     2727}; 
     2728 
     2729//--------------------------------------------------------------------------- 
     2730// MPEG-2 Components 
     2731//--------------------------------------------------------------------------- 
     2732resource 'thng' (327) { 
     2733        decompressorComponentType,              // Type                  
     2734        'MPG2',                                 // SubType 
     2735        kFFusionCodecManufacturer,                      // Manufacturer 
     2736        0,                                      // - use componentHasMultiplePlatforms 
     2737        0, 
     2738        0, 
     2739        0, 
     2740        'STR ',                                 // Name Type 
     2741        kMPEG2NameResID,                        // Name ID 
     2742        'STR ',                                 // Info Type 
     2743        kMPEG2InfoResID,                        // Info ID 
     2744        0,                                      // Icon Type 
     2745        0,                                      // Icon ID 
     2746        kFFusionCodecVersion,                   // Version 
     2747        componentHasMultiplePlatforms +         // Registration Flags  
     2748        componentDoAutoVersion,                 // Registration Flags 
     2749        0,                                      // Resource ID of Icon Family 
     2750{ 
     2751        kFFusionDecompressionFlags,  
     2752        'dlle',                         // Entry point found by symbol name 'dlle' resource 
     2753        256,                            // ID of 'dlle' resource 
     2754        platformPowerPCNativeEntryPoint, 
     2755        kFFusionDecompressionFlags, 
     2756        'dlle', 
     2757        256, 
     2758        platformIA32NativeEntryPoint, 
     2759}; 
     2760}; 
     2761 
     2762resource 'thng' (328) { 
     2763        decompressorComponentType,              // Type                  
     2764        'mpg2',                                 // SubType 
     2765        kFFusionCodecManufacturer,                      // Manufacturer 
     2766        0,                                      // - use componentHasMultiplePlatforms 
     2767        0, 
     2768        0, 
     2769        0, 
     2770        'STR ',                                 // Name Type 
     2771        kMPEG2NameResID,                        // Name ID 
     2772        'STR ',                                 // Info Type 
     2773        kMPEG2InfoResID,                        // Info ID 
     2774        0,                                      // Icon Type 
     2775        0,                                      // Icon ID 
     2776        kFFusionCodecVersion,                   // Version 
     2777        componentHasMultiplePlatforms +         // Registration Flags  
     2778        componentDoAutoVersion,                 // Registration Flags 
     2779        0,                                      // Resource ID of Icon Family 
     2780{ 
     2781        kFFusionDecompressionFlags,  
     2782        'dlle',                         // Entry point found by symbol name 'dlle' resource 
     2783        256,                            // ID of 'dlle' resource 
     2784        platformPowerPCNativeEntryPoint, 
     2785        kFFusionDecompressionFlags, 
     2786        'dlle', 
     2787        256, 
     2788        platformIA32NativeEntryPoint, 
     2789}; 
     2790}; 
     2791 
     2792//--------------------------------------------------------------------------- 
    26112793// Component Name Resources 
    26122794//--------------------------------------------------------------------------- 
     
    26722854}; 
    26732855 
     2856resource 'STR ' (kMPEG1NameResID) { 
     2857        "MPEG-1 Decoder" 
     2858}; 
     2859 
     2860resource 'STR ' (kMPEG2NameResID) { 
     2861        "MPEG-2 Decoder" 
     2862}; 
     2863 
    26742864//--------------------------------------------------------------------------- 
    26752865// Component Name Resources 
     
    27362926}; 
    27372927 
     2928resource 'STR ' (kMPEG1InfoResID) { 
     2929        "Decompresses video stored in MPEG-1 format." 
     2930}; 
     2931 
     2932resource 'STR ' (kMPEG2InfoResID) { 
     2933        "Decompresses video stored in MPEG-2 format." 
     2934}; 
     2935 
    27382936//--------------------------------------------------------------------------- 
    27392937// Code Entry Point for Mach-O 
  • trunk/ff_MovieImport.c

    r241 r243  
    7979                register_avcodec(&huffyuv_decoder); 
    8080                register_avcodec(&ffvhuff_decoder); 
     81                register_avcodec(&mpeg1video_decoder); 
     82                register_avcodec(&mpeg2video_decoder); 
    8183                 
    8284                register_avcodec(&wmav1_decoder);