Video and audio data presentation interface5615401Abstract Presentation of digital video and audio data in a computer system. Am application program may call upon a driver program to manipulate streams of video and audio data, including commands to present the video or audio to an operator, retrieve status information about the presentation, simultaneously present graphics with video data, halt or pause presentations, allocate or release resources for presentation, and group multiple streams for synchrony. The driver program may operate upon the grouped streams in synchrony in response to unified commands from the application program. An interface to the driver program may comprise a interrupt instruction invoked with a designated interrupt and a designated set of commands: initialization; open and close; play, pause, stop, seek, and step; group; set and get; installation; and termination. The driver program may be called upon using a standardized interface for such functions, in which the application program may indicate a designated set of parameters for each function call. Claims We claim: Description BACKGROUND OF THE INVENTION
______________________________________
FMP.sub.-- INIT
initialize the driver program 108
FMP.sub.-- OPEN
open a data stream 109
FMP.sub.-- CLOSE
close a data stream 109
FMP.sub.-- PLAY
present ("play") a data stream 109
FMP.sub.-- PAUSE
pause a data stream 109
FMP.sub.-- STOP
stop a data stream 109
FMP.sub.-- SEEK
locate ("seek") a designated position in a
data stream 109
FMP.sub.-- STEP
increment the position of a data stream 109
by one video frame
FMP.sub.-- GROUP
designate data streams 109 as a group
FMP.sub.-- SET
set a parameter of the driver program 108
or a data stream 109
FMP.sub.-- GET
get a parameter of the driver program 108
or a data stream 109
FMP.sub.-- CALLBACK
install a callback function for a data stream
109
FMP.sub.-- SIGNAL
install a signal for a data stream 109
FMP.sub.-- UNLOAD
terminate the driver program 108 and
unload it from memory
______________________________________
These commands are described in more detail herein. In a preferred embodiment, when an application program, stored in memory 103 or in mass storage 104 and controlling the processor 102, desires to use the capabilities of the presentation device 106, it may execute an interrupt instruction with a designated interrupt, and thus cause the processor 102 to generate an interrupt, as is known in the art. The interrupt may be responded to by the operating system 107, which may direct the interrupt to a driver program 108. In a preferred embodiment, the operating system 107 may be responsive to a calling sequence used by the application program to command the driver program 108. In a preferred embodiment, the driver program 108 may comprise a unified calling sequence for each of its functions, so that all calls to the driver program 108 may be easily identified by the operating system 107. As noted herein, in a preferred embodiment, the computer system 101 may comprise an Intel 386 processor 102; such a processor may comprise a set of 16-bit registers including AX, BX, CX, and DX registers. In a preferred embodiment, a unified calling sequence may comprise registers BX, CX, DX and AX, and may be as follows: BH command identifier BL identifier for data stream (sometimes called a "stream handle") The symbols BH and BL identify high and low halves of register BX. CX data flags DX (with AX) 32-bit data value or data pointer, with the high half in DX and the low half in AX In a preferred embodiment, no registers other than BX, CX, DX and AX will be read by the FMP DOS driver program 108. In a preferred embodiment, a unified return sequence may comprise registers BX, CX, DX and AX, and may be as follows: BH error code, if any BL DOS error code, if BH indicates a DOS error DX (with AX) 32-bit return data value or data pointer, with the high half in DX and the low half in AX In a preferred embodiment, no registers other than BX, CX, DX and AX will be modified by the FMP DOS driver program 108. INTERFACE BETWEEN APPLICATION AND DRIVER PROGRAM FIGS. 2A, 2B, 2C, and 2D (collectively "FIG. 2") show a flow diagram of an interface between an application program and a device for presenting video and audio data. At step 201, the application program may determine whether the driver program 108 is installed. If so, the process proceeds with step 202, where the application program issues a command to install the driver program 108. Thereafter, the process proceeds with step 203. In a preferred embodiment, the driver program 108 may be loaded before the application program starts. The driver program may install itself by seizing an unused interrupt within the range 80h to FFh. The driver program 108 may then store a predetermined text string such as "FMPDriver" relative to a location pointed to by the interrupt vector. At an offset of +2, a Pascal-type string may be stored; at an offset of +3, a C-type string may be stored. Pascal-type and C-type strings are known in the art. In step 201, to determine whether the driver program 108 is installed, the application program may search the list of interrupt vectors for the installed driver. In step 202, to install the driver program 108, the application program may search for the location of the driver program 108 in a predetermined location. In a preferred embodiment, this predetermined location may be a DOS environment variable, "FMPDriver", whose value has been preset to a pathname of a DOS executable file for the driver program 108, such as "FMPDRV.EXE". Upon finding the driver program 108, the application program may start the driver program 108 and reexecute step 201 to determine if the driver program 108 was successfully installed. At step 203, the application program may issue the FMP.sub.-- INIT command to initialize the driver program 108. This command may reset the presentation device 106 and set any variables in the driver program 108 to their default values. At step 204, the application program may issue the FMP.sub.-- GET command to get information about the driver program 108, such as its name, version, and a set of state information about the presentation device 106. At step 205, the application program may determine whether to install a "callback" function with the driver program 108. If so, the process proceeds with step 206, where the application program may issue the FMP.sub.-- CALLBACK command to install a callback function with the driver program 108. Thereafter, the process proceeds with step 207. A callback function is a function within the application program that may be called by the driver program 108, to provide feedback information to the application program. For example, the driver program 108 may call the callback function to provide information on the state of an operation that the presentation device 106 is still working on. In a preferred embodiment, the application program may define one callback function for each data stream 109. If a data stream 109 has no callback function defined for it, a default callback function provided by the driver program 108 may be called instead (if one exists). In step 206, the application program may call the FMP.sub.-- CALLBACK function with a value for a data stream 109 that is a null indicator to specify the default callback function as the callback function to use. In a preferred embodiment, the specified callback function may be called with a calling sequence that is standard for the language that function is written in, e.g., a Pascal standard calling sequence or a C standard calling sequence. Pascal standard calling sequences and C standard calling sequences are known in the art. Arguments may be passed in registers or on a calling stack, as is known in the art. When arguments are passed in registers, the following calling sequence may be used: BH message identifier BL identifier for data stream (sometimes called a "stream handle") DX (with AX) 32-bit data value or data pointer, with the high half in DX and the low half in AX Register DX (with AX) are referred to as the "value". In a preferred embodiment, a zero value may be returned if the operation was a success. In a preferred embodiment, one of the following messages may be passed to the callback function:
__________________________________________________________________________
FMPM.sub.-- ERROR
An error occurred while executing a command
given by the application program. The value
may comprise an error code, which may com-
prise one of the following error codes:
FMPE.sub.-- DOS
A DOS error occurred while reading the data
stream 109. Register AL may comprise the
DOS error code.
FMPE.sub.-- HARDWARE
A hardware error occurred with the presenta-
tion device 106. Register AL may comprise
information about the error.
FMPE.sub.-- STREAM
The data stream 109 comprises invalid data.
FMPE.sub.-- DATA
The data stream 109 has no available data.
FMPM.sub.-- SIGNAL
This message is issued when the data stream
109 reaches a position specified with the
FMP.sub.-- SIGNAL command, or when a period has
completed. The value may comprise the cur-
rent position of the data stream 109.
FMPM.sub.-- COMPLETE
This message is issued when a command issued
by the application program has been com-
pleted, for example when a "play" command has
ended. The data stream 109 will be in a
ready mode, i.e., paused or stopped. The
value may comprise the command identifier for
the completed command.
FMPM.sub.-- CANCEL
This message is issued when a new command has
been sent by the application program before
the previous command was completed. The
value may comprise the command identifier for
the canceled command.
FMPF.sub.-- BUF.sub.-- CREATE
This message is sent when a buffered data
stream 109 is opened. The application pro-
gram may allocate and initialize buffers upon
receiving this message. The value may com-
prise the value passed by the application
program to the FMP.sub.-- OPEN command, and a zero
value may be returned on success.
FMPF.sub.-- BUF.sub.-- CLOSE
This message is sent when a buffered data
stream 109 is to be closed. The application
program may release any memory allocated for
the buffer when this message is received.
FMPF.sub.-- BUF.sub.-- SEEK
This message is sent to the application pro-
gram to seek to a given position in bytes.
The value may comprise the position to reach,
in bytes.
FMPM.sub.-- BUF.sub.-- EMPTY
This message is sent to the application pro-
gram when the buffer for a buffered data
stream 109 is empty and more data is needed
to complete the command issued by the appli-
cation program. The application program may
specify an address for a new buffer with the
FMP.sub.-- SET -- FMPI.sub.-- BUF.sub.-- ADDR command.
Alterna-
tively, the application may set FMPI.sub.-- BUF.sub.-- LOOP
to cause the driver program to scan the same
buffer again. Otherwise, the data stream 109
will be stopped.
FMPM.sub.-- BUF.sub.-- POS
This message is sent to the application pro-
gram when the buffer for a buffered data
stream 109 reaches a position indicated when
the data stream 109 was initiated (using the
FMPI.sub.-- BUF.sub.-- POS parameter). When the data
stream 109 is played, the application program
will generally receive this message before it
receives FMPM.sub.-- BUF.sub.-- EMPTY, so it does not have
to prepare the first buffer before opening
the data stream 109.
__________________________________________________________________________
At step 207, the application program may determine whether to set parameters for the presentation device 106 or the driver program 108. If so, the process continues with step 208, where the application program may issue the FMP.sub.-- SET command to the driver program 108. Thereafter, the process continues with step 209. In step 208, the application program may issue the FMP.sub.-- SET command to prepare the presentation device 106 or the driver program 108 for the particular types of data stream 109 that the application program will seek to present. At step 209, the application program may determine whether to open a new data stream 109. If not, the process repeats step 209 until the determination is YES. Thereafter, the process proceeds with step 211. In step 209, the application program effectively loops until it seeks to open a new data stream 109, for example, its first data stream 109. In a preferred embodiment, there are two elementary types of data stream 109, those comprising only video data and those comprising only audio data. There are also more complex data streams 109; one such is an interleaved data stream 109, which may comprise both video data and audio data interleaved together. When an application program opens an interleaved data stream 109, the driver program 108 may generate a group data stream 109, comprising the individual video and audio component data streams 109, grouped together for synchronization. Thus, when the application program seeks to present the group data stream 109, the video and audio component data streams 109 will be presented together in synchrony. At step 211, the application program may open a data stream 109 by issuing the FMP.sub.-- OPEN command. At step 212, the application program may determine whether to open another data stream 109. If so, the process may continue with step 211. The application program may loop over steps 211 and 212 until it has opened all the data streams 109 it seeks to open. In a preferred embodiment, the driver program 108 may open up to 255 data streams 109, each of which may have its own characteristics. These characteristics may comprise speed (i.e., speed of presentation), window size (i.e., the size of the video image for presentation), volume (i.e., the volume of sound presentation, time format (i.e., the number of frames per second). In a preferred embodiment, characteristics of a data stream 109 may vary depending upon whether it is a video or an audio data stream. At step 213, the application program may determine whether to form a group data stream 109. If so, the process continues with step 214, where the application program may issue the FMP.sub.-- OPEN command to open a new group data stream 109, and may proceed thereafter to step 212. Otherwise, the process continues with step 215. In a preferred embodiment, a group data stream 109 may comprise more than one elementary data stream 109. As with other data streams 109, the application program may issue commands with regard to a group data stream 109, such as to play, to stop, to step forward, to seek the data stream 109 to a designated location. Commands issued with regard to a group data stream 109 may apply to each of the elementary data streams 109 it comprises. An application program may also select and deselect data streams 109 within a group data stream 109; it may thus designate which data streams 109 within the group data stream 109 should be affected by a command. This may be useful, for example, when a group data stream 109 comprises several tracks of audio data streams 109. The application program may thus select which of the several audio tracks to play. At step 215, the application program determines whether to make a change to a group data stream 109. The process continues with step 214, where the application program may issue the FMP.sub.-- GROUP command to add, remove, select, or deselect a data stream 109 from the group data stream 109, and may proceed thereafter to step 215 again. Thereafter, the process proceeds with step 217. The application program may loop over steps 215 and 216 until it has made all the changes to the group data stream 109 it seeks to make. At step 217, the application program may determine whether to install a callback function for any of the data streams 109 or group data streams 109 it has opened. If so, the process proceeds to step 218, where the application program may issue the FMP.sub.-- CALLBACK command, in similar manner as in step 206, and may proceed thereafter to step 217 again. Thereafter, the process proceeds with step 219. The application program may loop over steps 217 and 218 until it has installed all the callback functions it seeks to install. At step 219, the application program may determine whether to set parameters for any data streams 109. If so, the process proceeds to step 220, where the application program may issue the FMP.sub.-- SET command to set parameters, and may proceed thereafter to step 219 again. Thereafter, the process proceeds with step 222. At step 222, the application program may determine whether to install a new signal for a data stream 109 or to modify an existing signal for a data stream 109. If so, the process proceeds with step 223, where the application program may issue the FMP.sub.-- SIGNAL command to install a new signal or to modify an existing signal, and may proceed thereafter with step 222 again. Thereafter, the process proceeds with step 224. The application program may loop over steps 222 and 223 until it has installed all the signals it seeks to install. In a preferred embodiment, a signal may be a mechanism to inform the application program when a designated location in a data stream 109 has been reached by the presentation device 106. If that location is reached and the application program has installed a signal for a data stream 109, the driver program 108 will call the installed callback function for that data stream 109 with the message FMPM.sub.-- SIGNAL. The application program may receive this message and use the information to perform a designated procedure, to issue other commands, or to call upon the operating system 107 to trigger other system events. In a preferred embodiment, each data stream 109 may have only one signal outstanding at a time. At step 224, the application program may determine whether to present (also called "play") a data stream 109. If so, the process proceeds with step 225, where the application program may issue the FMP.sub.-- PLAY command to cause the presentation device 106 and the driver program 108 to present the data stream 109, and may proceed thereafter with step 224 again. Thereafter, the process proceeds with step 226. At step 226, the application program may determine whether to step a data stream 109 forward. If so, the process proceeds with step 227, where the application program may issue the FMP.sub.-- STEP command to cause the presentation device 106 and the driver program 108 to step the data stream 109 forward one frame, and may proceed thereafter with step 226 again. Thereafter, the process proceeds with step 228. At step 228, the application program may determine whether to seek a designated location within a data stream 109. If so, the process proceeds with step 229, where the application program may issue the FMP.sub.-- SEEK command to cause the presentation device 106 and the driver program 108 to seek a designated location in the data stream 109, and may proceed thereafter with step 228 again. Thereafter, the process proceeds with step 230. At step 230, the application program may determine whether to stop a data stream 109. If so, the process proceeds with step 231, where the application program may issue the FMP.sub.-- STOP command to cause the presentation device 106 and the driver program 108 to stop the data stream 109, and may proceed thereafter with step 230 again. Thereafter, the process proceeds with step 232. At step 232, the application program may determine whether to pause a data stream 109. If so, the process proceeds with step 233, where the application program may issue the FMP.sub.-- PAUSE command to cause the presentation device 106 and the driver program 108 to pause the data stream 109, and may proceed thereafter with step 232 again. Thereafter, the process proceeds with step 235. In a preferred embodiment, a data stream 109 may comprise one of a set of "play modes", each of which may designate a status of the data stream 109. These play modes may be as follows:
______________________________________
STOP mode The data stream 109 is stopped. There is no
video picture and no audio sound.
PAUSE mode The data stream 109 is paused. For an audio
data stream 109, this is the same as STOP
mode. For a video data stream 109, the last
(most recent) video frame is held frozen in a
presentation frame window.
PLAY mode The data stream 109 is playing, i.e., being
presented by the presentation device 106.
This mode is valid for both video and audio.
SEEK mode The data stream 109 is moving to a designated
location. This mode is valid for both video
and audio.
STEP mode The data stream 109 is moving forward one
frame. This mode is valid for video data
streams 109 only.
______________________________________
The PAUSE mode and the STOP mode may be termed "ready" modes. In a preferred embodiment, if the application program issues a command and the data stream 109 is not in a ready mode, the command is canceled and the application program callback function is called with the FMPM.sub.-- CANCEL message. In a preferred embodiment, when the application program issues a command to enter PLAY mode, SEEK mode, or STEP mode, it may also designate the mode to enter when that command is completed. The application program may designate PAUSE mode, STOP mode, or the previous ready mode (i.e., the ready mode the data stream 109 was in before the new command). In a preferred embodiment, the driver program 108 will cause control to return to the application program as soon as possible. Control may thus be returned before the command is completed. The application program may obtain the current mode for the data stream 109 by issuing the FMP.sub.-- GET command and waiting for the command to complete. When the command is completed, the driver program 108 will call the callback function for the data stream 109 with the FMPM.sub.-- COMPLETE message. It may occur that a first data stream is in PLAY mode (i.e., it is being presented by the presentation device 106), and the application program seeks to present a second, different, data stream 109. In a preferred embodiment, if the presentation device is unable to present both data streams 109 at once, the FMP.sub.-- PLAY command for the second data stream 109 is given priority. The first data stream 109 will have its PLAY mode canceled, and it will be returned to the mode it would normally have if its PLAY mode has completed normally, and the callback function for the first data stream 109 will be called with the FMPM.sub.-- CANCEL message. At step 235, the application program may determine whether to close a data stream 109. If so, the process proceeds with step 236, where the application program may issue the FMP.sub.-- CLOSE command to close the data stream 109, and may proceed thereafter with step 235 again. Thereafter, the process proceeds with step 237. At step 237, the application program may determine whether to exit. If not, the process proceeds with step 212 (label D). Otherwise, the process proceeds with step 238. At step 238, the application program may determine whether all data streams are closed. If not, the process proceeds with step 239, where the application program may issue the FMP.sub.-- INIT command to close all open data streams 109 and reset the presentation device 106. Thereafter, the process proceeds with step 240. At step 240, the application program may determine whether it installed the driver program 108. If so, the process proceeds with step 241, where the application program may issue the FMP.sub.-- UNLOAD command to deinstall the driver program 108. Thereafter, the process proceeds with step 243, where it is complete and the application program may exit. DRIVER PROGRAM FUNCTIONS FIG. 3 shows a flow diagram of a responsive procedure for a device for presenting video and audio data. In a preferred embodiment, an application program may issue a command to the driver program 108 to cause it to perform one of a set of functions. As noted herein, issue of that command may use a designated interrupt and a designated calling sequence. In a preferred embodiment, the driver program 108 may proceed as follows: At step 302, the driver program 108 may run function associated with the command issued by the application program. At step 303, the driver program 108 may determine whether the function caused an error. If so, the process proceeds with step 304, where the driver program 108 may run an error handler program. Thereafter the process proceeds with step 305, where it is complete and the driver program 108 may exit. For each command, the application program may specify a flag FMPF.sub.-- TEST. This flag instructs the driver program 108 to return a value specifying whether the driver program 108 and the presentation device 106 supports that command, but to abstain from making any "real" changes. The following pages A8--A24 describe commands that may be implemented in a preferred embodiment of the driver program 108. ALTERNATIVE EMBODIMENTS While preferred embodiments are disclosed herein, many variations are possible which remain within the concept and scope of the invention, and these variations would become clear to one of ordinary skill in the art after perusal of the specification, drawings and claims herein.
|
Same subclass Same class Consider this |
||||||||||
