[vlc-devel] Frame time information in vout module?

Simon Wilson s.wilson5 at uq.edu.au
Tue Dec 8 00:44:14 CET 2009

Hi all,

I'm working on a new vout module that pushes data into an
ICMDecompressionSession on OSX (so that I can pull the data out at the other
end inside my application, which embeds VLC, using Core Video). So far, my
code (based loosely on the opengllayer.m) can create the decompression
session and perform the necessary initialization. In my module's display()
method, however, I need to populate the following structure for each frame
for the decompression session:

struct ICMFrameTimeRecord {
  wide  value;  /* frame display time*/
  long  scale;  /* timescale of value/duration fields*/
  void * base;  /* timebase*/

  long duration;  /* duration frame is to be displayed (0 if unknown)*/
  Fixed  rate;  /* rate of timebase relative to wall-time*/

  long  recordSize;  /* total number of bytes in ICMFrameTimeRecord*/

  long  frameNumber; /* number of frame, zero if not known*/

  long  flags;

  wide  virtualStartTime;       /* conceptual start time*/
  long  virtualDuration;        /* conceptual duration*/

/* The following fields only exist for QuickTime 7.0 and greater. */
  TimeValue64 decodeTime;  /* suggested decode time, if
icmFrameTimeHasDecodeTime is set in flags*/

The code eamples I've found use this method tend to only set the following:

qt_frame_time.recordSize = sizeof(ICMFrameTimeRecord);
*(TimeValue64 *) &qt_frame_time.value = display_time;
qt_frame_time.scale = media_time_scale_;
qt_frame_time.rate = fixed1; // 1.0
qt_frame_time.flags = icmFrameTimeIsNonScheduledDisplayTime;
qt_frame_time.frameNumber  = fnum_to_decode+1;

So, my question is -- where about could I find appropriate timing values for
each frame (in order to compute 'value' and 'scale') from within the vout
module to plug into this struct? Or should I be targeting a higher level
within the chain? If it helps, I'm using VLC to play DVDs for image


Simon Wilson
s.wilson5 at uq.edu.au

More information about the vlc-devel mailing list