home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / Multimedia / MPEGPlay2.3 / Source / MPEGView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-09  |  1.9 KB  |  87 lines

  1. // MPEGView.h
  2.  
  3. #import <appkit/View.h>
  4. #import <sys/param.h>
  5.  
  6. #define MAX_PRIORITY 30
  7.  
  8. #define RGB_COLOR    0
  9. #define BW_COLOR    1
  10.  
  11. typedef struct _mpeg_info
  12. {
  13. // window settings
  14.     int    colorSpace,
  15.         zoom,
  16.         backing;
  17.     BOOL sync,
  18.         drop;
  19.     float fps;
  20. // stream attributes
  21.     unsigned int h_size;
  22.     unsigned int v_size;
  23.     unsigned char aspect_ratio;        // Code for aspect ratio.
  24.     unsigned char picture_rate;        // Code for picture rate.
  25.     unsigned long bit_rate;            // Bit rate.
  26.     unsigned int vbv_buffer_size;    // Minimum buffer size.
  27.     BOOL const_param_flag;            // Contrained parameter flag.
  28. // measured statistics
  29.     int    totalFrames,
  30.         frameCount;
  31.     double    elapsedTime;
  32. } mpegInfo;
  33.  
  34. extern char *gpchProgName;
  35. extern char *gpchOK;
  36.  
  37.  
  38. @interface MPEGView:View
  39. {
  40.     id    theBitmap;                // used in -drawSelf::
  41.     int    theWidth, theHeight;
  42.     NXRect theRect;
  43.     char *data;                    //
  44.     id    mpegThread;
  45.     NXSize theSize;                // for -newZoom:
  46.     mpegInfo *info;                // for -stats
  47.     char *address;                // video cache
  48.     int len, maxlen;
  49.     DPSTimedEntry tag;            // for timedEntry
  50.     int frameLength, frameCount, frameNumber, procIndex;
  51.     id controller;
  52.     char *adrs, *end;
  53.     double startTime, now;
  54. }
  55.  
  56. /*** Initialization methods ***/
  57. - initSize:(const NXSize *)aSize info:(mpegInfo *)pInfo;
  58. - free;
  59.  
  60. /*** Standard C functions ***/
  61. double ReadSysClock(void);
  62. // DROP_FRAME
  63. // CHECK_FOR_END
  64. // SLOW_STUFF
  65. // SHOW_FRAME
  66. void te_none(DPSTimedEntry, double, void *);
  67. void te_sync(DPSTimedEntry, double, void *);
  68. void te_drop(DPSTimedEntry, double, void *);
  69. void te_syncNdrop(DPSTimedEntry, double, void *);
  70.  
  71. /*** Instance methods ***/
  72. - runAgain;
  73. - runFromFile:(const char *)mpegFile;
  74. - banner;
  75. - setAddress:(char *)anAddress len:(int)aLen maxlen:(int)aMaxlen;
  76. - (BOOL)ready;
  77. - (mpegInfo *)info;
  78. - (NXSize *)newZoom:(int)zoom;
  79. - newSync:(BOOL)flag;
  80. - newDrop:(BOOL)flag;
  81. - newFrameRate:(float)fps;
  82.  
  83. /*** View Instance methods ***/
  84. - drawSelf:(const NXRect *)rects :(int)rectCount;
  85.  
  86. @end
  87.