The RTV 2.0 decoder object provides methods to decompress the RTV 2.0/2.1 video format. It is presented in the class library for editing and format-conversion purposes.
Note: The UMSRTV2Decoder object is shipped for compatibility with the Ultimedia Services Version 1.1.0 product. The function provided is redundant with the UMSRTV2VideoDecoder object. The UMSRTV2VideoDecoder object is the preferred object for decoding RTV 2.0 or 2.1 video, since it inherits methods from the UMSVideoDecoder base video decoder class.
To learn more about the UMSRTV2Decoder object, see:
For introductory information, see Video Codec Objects.
To avoid name collision on defines, integer values have been captured as enumerated lists. The set of valid values from an enumerated list can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object are:
enum ReturnCode { Success, Failure, UnsupportedFormat, UnsupportedAlgorithm, OutOfRange, Uninitialized, OutOfMemory };
enum RTV2DecImageFormatOut { RGB8Dither, YUV9, RGB24, BGR24Reverse };
enum RTV2DecOutputQuality { Low, Medium, High };
An RTV 2.0 frame header has the following header, which it shares with other video codecs within the AVSS file format:
This method decompresses a frame and formats it as requested by set_image_format. It can be mixed freely with the decompress_frame_only method.
Begin decompression at an I frame. The format for a compressed frame is described in the preceding text.
in char *comp_frame | Pointer to the start of the compressed frame data. |
in char *image_frame | Pointer to the start of the decompressed image data. |
This method decompresses a frame and updates the decoder's internal buffers, but does not produce the final output frame. It allows for frame skipping in the displaying application, while maintaining the correct state in the decoder. It can be mixed freely with the decompress_frame method.
Begin decompression at an I frame. The format for a compressed frame is described in the preceding text.
in char *comp_frame | Pointer to the start of the compressed frame data. |
This method copies the decoder's color map table to a memory area provided by the calling application. It returns the Failure error code if the pointer color_map is NULL or if the internal color map pointer is NULL; otherwise, it returns Success.
The action of this method is independent of the current image format. You can call set_image_format before or after a call to this method with identical results.
This method can be called at any time during the decoding of a video clip.
In general, the application needs to reformat the color map for the windows systems it uses. For AIXwindows, the color map entries should be converted to AIXwindows format color map entries and should be copied (in the same order as they appear) into a contiguous series of cells in the window's color map.
This method gets the attributes for the color map used by the decoder to create the image frame.
The method always returns Success.
out long colormap_base_index | The base address of the decoder's color map in the output window's color map. |
out long colormap_size | The number of color entries in the color map. |
This method returns the current output image format.
Any of the values from the enumerated list RTV2DecImageFormatOut are possible.
This method queries the frame width and height parameters. If set_image_size has not been called, the parameters have the default values; otherwise, they have the values set by the last call to set_image_size. The method always returns Success.
out long width | Width of the decompressed frame. |
out long height | Height of the decompressed frame. |
This method returns the output quality, as last set by set_output_quality or SomInit.
The output quality setting for the decoder.
This method sets up the characteristics of the decoder's internal color map and dithering algorithm. It can be called at any time, but it affects only the RGB8Dither output format.
Failure | The method returns the Failure error code if, for some reason, the internal pointer to the internal copy of the color map is NULL. |
OutOfRange | The method returns OutOfRange if colormap_base_value is less than 0 or if colormap_base_value + colormap_size is greater than 256. Note that a negative value of colormap_size is quantized to 64. |
This method sets the format of the output frames to be created by the decoder. If an invalid format is specified, the method returns the UnsupportedFormat error code; otherwise, the method returns Success.
in ImageFormatOut image_format | Any of the values from the RTV2DecImageFormatOut enumerated list are possible. |
This method sets the frame width and height parameters, and allocates the internal frame buffers for the object. The first frame decoded after changing the image size must be an I frame.
in long width | Width of the decompressed frame. |
in long height | Height of the decompressed frame. |
This method sets the output quality for all frames until the next time the method is called; it can be called at any time.
in OutputQuality output_quality | The desired output quality. |
Failure | The method returns Failure if the output_quality is invalid. |
For introductory information, see Video Codec Objects.