[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

Concepts Common to Video Codec Objects

To learn more about the common features of video codec objects, see:

For introductory information, see Programming with Video Codec Objects.

Method Calls

Common method calls for decoders include:

set_image_format Selects the format of the frames at the output of a decoder object. A particular decoder object might only support a subset of the complete list of formats; the method returns an error code if the requested image format is unsupported or invalid.
set_image_size Sets the size of the output frames of a decoder object. The calling application should be able to obtain these from the file that contains the compressed image or video. Note that a particular decoder might only support certain frame sizes.
set_colormap_attributes Used for the RGB8Dither format. Sets the size of the decoder's color map and the position to which it is copied (after formatting) in the color map of the display window. The method uses the requested size of the color map to select from the sizes a particular decoder supports.
get_color_map Copies the decoder's internal copy of its color map to an area provided by the calling application. Each entry in the color map consists of 4 bytes: 0, red, green, and blue. The application provides a pointer to an area of memory to receive the color map.
decompress_frame Decompresses one frame of video and formats it according to the selected image format. The application provides pointers to the compressed frame and an area of memory to receive the decompressed frame. If the compressed video has reference frames and delta frames, the application should start the decoding at an reference frame.

Common method calls for encoders include:

set_image_format Sets the format of the frames that an encoder object accepts at its input. All the encoders support the RGB24 format, but none support RGB8Dither.
set_image_size Sets the dimensions of the input frames that the encoder expects.
set_subimage_size Specifies a rectangular subimage of an input frame that is actually encoded. The method specifies the dimensions of the subimage and its position in the input frame. It allows the application to select an area of interest or to conserve CPU power.
get_max_buffer_size Returns a size for a buffer that is virtually guaranteed to be large enough to hold a compressed frame. The size given depends on the size of the frames or subimages that are encoded. With most encoders, it is impossible to guarantee that the buffer size is always sufficient, but the probability of overrun is extremely small.
compress_frame Compresses one frame or subimage. The calling application provides pointers to the input frame and the buffer to receive the compressed frame.

Object Behavior and Buffering

Object behavior and buffering are determined by methods. For example, the set_image_format, set_image_size, and get_color_map methods are used to set up objects for operation; the compress_frame and decompress_frame methods cause the objects to process and transfer image data.

Applications and objects communicate to achieve a task. For example, in a decoding operation, an object gets data from a compressed frame within an application, the object decodes the data, and the object sends an image frame back to the application.

Tips for Using Video Codecs

The following tips provide important information for using decoders:

The following tips provide important information for using encoders:

The following tip provides important information for using buffers:

For introductory information, see Programming with Video Codec Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]