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

Movie File Access

The UMSMovieFileReader is a base class used by both the UMSMoviePlayer object and the movie_editor application. The UMSAVIMovieFileReader is an implementation of the base class for AVI movie files. The UMSMovieFileReader base class provides an abstraction that can be mapped onto various movie file formats. This permits other implementations of the base class for new file formats which can be used as UMSMovieFileReader objects. The UMSMovieFileReaderMClass metaclass has the method:

make_by_pathname 

Which detects the file type of a given file and instantiates the corresponding UMSMovieFileReader as specified for that file type in the UMS_config configuration file. This permits the UMSMoviePlayer object to inherit support for new file formats without being modified or recompiled.

To learn more about the UMSMovieFileReader, see:

For introductory information, see Programming with Formatted File Access Objects.

UMSMovieFileReader Object Method Calls

UMSMovieFileReader object method calls include:

open Opens a movie file.
close Closes a movie file.
get_audio_bits_per_sample Returns the current bits-per-sample value for the selected audio track.
get_audio_format_type Returns the current audio format for the selected audio track.
get_audio_frame Returns the audio data for a specified frame and track.
get_audio_number_of_channels Returns the current number of channels for the selected audio track.
get_audio_samples_per_second Returns the current samples per second for the selected audio track.
get_audio_track Returns the track number of the currently selected audio track.
get_current_frame_position Returns the current frame position in the file.
get_frame_rate Returns the video frame rate for the currently selected video track.
get_iframe_locations Returns the frame positions of previous and next I frames relative to a given video frame in the selected video track.
get_image_frame_dimensions Returns the video frame dimensions for the currently selected video track.
get_max_audio_buffer_size Returns the maximum buffer size required to hold any audio frame data for the currently selected audio track.
get_max_video_buffer_size Returns the maximum buffer size required to hold any video frame data for the currently selected video track.
get_movie_length Returns the number of frames in the currently selected video track.
get_next_movie_frame Returns the audio and video data for the next frame.
get_number_of_audio_tracks Returns the number of audio tracks contained in the file.
get_number_of_video_tracks Returns the number of video tracks contained in the file.
get_video_aspect_ratio Returns the video aspect ratio for the currently selected video track.
get_video_format_type Returns the format of the selected video track.
get_video_frame Returns the video data for a specified frame within a specified video track.
get_video_frame_type Returns a value indicating whether the selected video track has all I frames, I frames and delta frames, or bidirectional delta frames.
get_video_track Returns the track number of the currently selected video track.
seek_to_frame Seeks to a given frame location within the selected tracks.
set_audio_track Selects an audio track number.
set_speed_factor Specifies a playback speed factor.
set_video_track Selects a video track number.
get_audio_number_format Returns the current number format for the selected audio track.
get_audio_byte_order Returns the current byte order for the selected audio track.

Accessing Movie File Data

The UMSMovieFileReader provides an abstraction to a file containing audio and video data having synchronized playback. This abstraction permits the file to contain multiple video and audio streams. The first video stream is referred to as video track 0, the second as video track 1, and so forth. Similarly, the first audio stream is audio track 0. Track 0 is the default video and audio track.

The data in the file is accessed as frames. An audio frame is the audio data to be heard during the frame presentation time. The get_next_frame method returns the next video frame and the corresponding audio frame data and advances the file position one frame. The file location is specified through the seek_to_frame method or queried with get_current_frame_position method. The first frame in a file is numbered 0.

Random access to audio or video frame data is provided by the get_video_frame and get_audio_frame which specify both a frame and a track number. These methods do not change the current file location. Various queries are provided to determine the characteristics of the audio and video data for the selected track.

For introductory information, see Programming with Formatted File Access Objects.


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