"Fossies" - the Fresh Open Source Software Archive

Member "quicktime4linux-2.3/qtinfo.c" (9 Jan 2007, 1456 Bytes) of package /linux/privat/old/quicktime4linux-2.3-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*  Qtinfo by Elliot Lee <sopwith@redhat.com> */
    2 
    3 #include "quicktime.h"
    4 
    5 static void file_info(char *filename);
    6 
    7 int main(int argc, char *argv[])
    8 {
    9     int i;
   10 
   11     if(argc < 2) {
   12         printf("Usage: %s filename...\n", argv[0]);
   13         return 1;
   14     }
   15 
   16     for(i = 1; i < argc; i++) {
   17         file_info(argv[i]);
   18     }
   19 
   20     return 0;
   21 }
   22 
   23 static void
   24 file_info(char *filename)
   25 {
   26     quicktime_t* qtfile;
   27     int i, n;
   28 
   29     qtfile = quicktime_open(filename, 1, 0);
   30 
   31     if(!qtfile) {
   32         printf("Couldn't open %s as a QuickTime file.\n", filename);
   33         return;
   34     }
   35 
   36     printf("\nFile %s:\n", filename);
   37     n = quicktime_audio_tracks(qtfile);
   38     printf("  %d audio tracks.\n", n);
   39     for(i = 0; i < n; i++) {
   40 
   41       printf("    %d channels. %d bits. sample rate %ld. length %ld. compressor %s.\n",
   42          quicktime_track_channels(qtfile, i),
   43          quicktime_audio_bits(qtfile, i),
   44          quicktime_sample_rate(qtfile, i),
   45          quicktime_audio_length(qtfile, i),
   46          quicktime_audio_compressor(qtfile, i));
   47       printf("    %ssupported.\n",
   48          quicktime_supported_audio(qtfile, i)?"":"NOT ");
   49     }
   50 
   51     n = quicktime_video_tracks(qtfile);
   52     printf("  %d video tracks.\n", n);
   53     for(i = 0; i < n; i++) {
   54       printf("    %dx%d rate %f length %ld compressor %s.\n",
   55          quicktime_video_width(qtfile, i),
   56          quicktime_video_height(qtfile, i),
   57          quicktime_frame_rate(qtfile, i),
   58          quicktime_video_length(qtfile, i),
   59          quicktime_video_compressor(qtfile, i));
   60       printf("    %ssupported.\n",
   61          quicktime_supported_video(qtfile, i)?"":"NOT ");
   62     }
   63 }
   64