The UMSVideoDecoder is a base class. Specific video decoder implementations inherit their interface from this class. Currently, the particular decoders in the class are the UMSJPEGVideoDecoder, UMSH261VideoDecoder, UMSH263VideoDecoder, UMSUMVideoDecoder, UMSIndeoVideoDecoder, UMSIndeo3VideoDecoder, and UMSRTV2VideoDecoder objects. These objects support JPEG/MJPEG, H.261, H.263, Ultimotion Matinee, Indeo 2.1, Indeo 3.1/3.2, and RTV 2.0/2.1 video. Codec developers are able to add new decoders to this class.
The UMSVideoDecoder object allows an application to be unaware of the particular decoder it is calling. The application can create a specific decoder either directly by the standard ObjectNameNew method or automatically using a configuration file and methods in the UMSVideoDecoderMClass metaclass.
Each real decoder implements the interface methods according to some common behavioral rules and the requirements of its core algorithms. Therefore, the basic behavior of UMSVideoDecoder methods is independent of the particular decoder; beyond that, the specific decoders share a common set of return codes and behave in a predictable fashion. Each decoder has its own algorithm-specific error traps. Also, different decoders can support different image formats, quality levels, and so forth. The returned parameters and error codes should allow the application to call methods in a codec-independent fashion.
The UMSVideoDecoder interface allows a decoder to support three useful functions beyond the usual decoder setup and decompression methods. First, it allows the decoder to implement different quality levels in its output frames; this allows a tradeoff between output quality and frame rate beyond the usual frame-skipping. Second, the interface allows for arbitrary resizing of the output frames. Third, an application can query a decoder for a list of the formats that the decoder supports.
The UMSVideoDecoder class is descended from the UMSNegotiatorSource class. Basically, the methods from the UMSVideoDecoder class that set and query image formats map to "generic" methods in the UMSNegotiatorSource class. The UMSNegotiatorSource and UMSNegotiatorSink classes provide a "generic" interface for connecting objects that produce data ("source" objects) and objects that consume data ("sink" objects).
Note: The UMSVideoDecoder class replaces the decoder objects in Ultimedia Services 1.0. The Ultimedia Services 1.0 decoder objects are still available but should not be used for further development.
To learn more about using the UMSVideoDecoder, see:
For introductory information, see Programming with Video Codec Objects.
To decode frames using the UMSVideoDecoder object, do the following:
When the video is finished, close the input file or network connection, free the input and output buffers and SOM sequence structures, and destroy the decoder and filereader or collaboration objects with _somFree.
The decoder options and defaults are as follows:
image format | IF_RGB8Dither |
colormap size | 224 |
colormap base index | 32 |
frame width x height | 352 x 288 |
output quality | 0 |
IF_RGB8Dither | size = 224 |
base | index = 32 |
Mono | size = 64 |
base index | arbitrary |
Output Quality: 2 levels of quality in resizing of IF_RGB8Dither
image format | IF_RGB8Dither |
colormap size | 224 |
colormap base index | 32 |
frame width x height | 76 x 144 |
output quality | 0 |
IF_RGB8Dither | size = 64, 128, 256; |
base index | arbitrary |
Resizing: arbitrary resizing of RGB formats; fast 1x2, 2x1, 2x2
Output Quality: 3 quality levels
image format | IF_RGB8Dither |
colormap size | 128 |
colormap base index | 128 |
frame width x height | 320 x 240 |
output quality | 0 |
IF_RGB8Dither | size = 128, 256; base index arbitrary |
image format | IF_RGB8Dither |
colormap size | 128 |
colormap base index | 128 |
frame width x height | 320 x 240 |
output quality | 0 |
IF_RGB8Dither | size = 64, 128, 256; base index arbitrary |
IF_RGB8Dither | size = 224; base index = 32 |
Resizing: arbitrary resizing of RGB except for IF_RGB8Dither with colormap size = 224
Output Quality: one quality level
image format | IF_RGB8Dither |
colormap size | 224 |
colormap base index | 32 |
frame width x height | 0 x 0 |
output quality | 100 |
Colormap Parameters: IF_RGB8Dither size = 64, 128, 256; base index arbitrary
Resizing: arbitrary resizing of RGB formats; fast 1x2, 2x1, 2x2
Output Quality: 3 quality levels
image format | IF_RGB8Dither |
colormap size | 128 |
colormap base index | 128 |
frame width x height | 256 x 240 |
output quality | 100 |
Colormap Parameters: IF_RGB8Dither size = 64, 128, 256; base index arbitrary
Resizing: arbitrary resizing of RGB formats
Output Quality: one quality level
image format | IF_RGB8Dither |
colormap size | 128 |
colormap base index | 128 |
frame width x height | 0 x 0 |
output quality | 100 |
The following tips provide important information for using the UMSVideoDecoder:
For introductory information, see Programming with Video Codec Objects.