Retrieving processing state information

The FilterStateInfo structure is available via fa^.fsi and allows you to retrieve useful variables regarding the video being processed:

  • lCurrentFrame holds the current frame # being processed.  The first frame is 0, and the value counts up by one for every frame sent through the pipeline.

  • lMicrosecsPerFrame holds the speed of the video in microseconds per frame.  This allows you to convert between frame numbers and frame times.

  • lCurrentSourceFrame holds the current source frame.  This number will skip if any frames were deleted from the source prior to processing.  It is useful if you need to act on the absolute frame number; for instance, a filter which tries to remove interlacing jitter from 60fps converted video would need to examine this value to discern if the current frame came from an even or odd field.

  • lMicrosecsPerSrcFrame is the same as lMicrosecsPerFrame except it pertains to the source.

  • lSourceFrameMS gives the timestamp of the source frame, in milliseconds.

  • lDestFrameMS gives the timestamp of the destination frame, in milliseconds.

The variables corresponding to the output stream will be holding any values only if the flag FILTERPARAM_SWAP_BUFFERS was set in the paramProc function. Otherwise, the source and destination buffers (i.e. fa^.src and fa^.dst) will be the same and only the variables corresponding to the source will be updated during processing.