Skip to content

inputdrv_introduction

shekh edited this page Apr 15, 2018 · 1 revision

VirtualDub Plugin SDK 1.2

About input drivers

Input driver plugins allow custom file formats to be exposed to VirtualDub. They are combinations of a file detector, file parser, and decoder, which allows great flexibility in supporting varieties of file formats.

General control flow

The first object in an input plugin is the input file driver, which implements the IVDXInputDriver interface and supplies very basic information about the supported file format, such as the human-readable name for the file open dialog and common file extensions. In addition, the driver also handles auto-detection of the file format, which allows the host to detect which plugin should handle a format by either the filename or specific bytes in the file. Each plugin votes based on its priority and its confidence in the match, and either the plugin with the best vote is used to open the file, or an error is reported to the user saying that the file is not supported.

Once identified, the file is passed off to an input file object. Input file objects implement IVDXInputFile interface. The job of an input file object is to parse the input file and expose streams to the host, such as audio and video streams. Although not required, the input file object also often holds the base lock on the file, which prevents other applications from modifying the file while it is in use.

An input file object, in turn, may create one or more stream objects, which implement IVDXStreamSource. Stream objects expose streams of samples, which may be either video samples or audio samples. Generic timing and read services are exposed on sample streams. A stream in the input file may be opened multiple times to create multiple stream objects, allowing multiple parallel reads into the same stream on disk.

Video streams also implement IVDXVideoSource, which exposes additional information about the video stream, such as frame size, frame rate, and frame order. The video samples may be decoded to raw images using IVDXVideoDecoder, which does the actual video decoding, and IVDXVideoDecoderModel, which tracks the required decoding order. Video decoder models can support streams with just key frames, key frames + delta frames (I/P), intra/predicted/bidirectional frames (I/P/B), or even more complex frame dependency patterns.

The net result of all of this is that an input plugin can expose an entirely new file format, along with an entirely new video compression algorithm.


Copyright (C) 2007-2012 Avery Lee.

Clone this wiki locally