PROGRAMMER'S GUIDEMPEG library
BackForward
MPEG Library / 12. Function Details-3

12.3 Still image playback



 List
 Title

Function specifications

 Function

Generate MPEG still image handle

 Function Name

MPG_SpCreate

 No

3.1 3.1

Form
MpgSp MPG_SpCreate (StmHn vstm)
input
vstm: video stream handle
output
none
Function value
MPEG still image handle
function
Generates a handle for playing an MPEG still image stream. Specifies the video stream handle for still image data.

 List
 Title

Function specifications

 Function

Erase MPEG still image handle

 Function Name

MPG_SpDestroy

 No

3.2

Form
Sint32 MPG_SpDestroy (MpgSp mpgsp)
input
mpgsp: MPEG still image handle
output
none
Function value
Error code
function
Erases the MPEG still image handle.
[remarks]
(a) The handle must be stopped for both audio and video.
(b) The handle is not registered as the handle to be played next by the MPG_MvEntryNext function.
(c) In this function, the playback stop function is executed.

 List
 Title

Function specifications

 Function

Setting the output destination of still images

 Function Name

MPG_SpSetVideoDest

 No

3.3

Form
void MPG_SpSetVideoDest (MpgSp mpgsp, Sint32 dst)
input
 mpgsp
 : MPEG still image handle
 dst
 :Output destination
output
none
Function value
none
function
Set the output destination of MPEG video. The output destination is as follows.
(1) Output destination
remarks
(a) The setting of this function becomes effective by calling the MPG_SpStart function.

 List
 Title

Function specifications

 Function

Setting the end condition for still images

 Function Name

MPG_SpSetTermCond

 No

3.4 3.4

Form
void MPG_SpSetTermCond (MpgSp mpgsp, Sint32 vcnd)
input
 mpgsp
 : MPEG still image handle
 vcnd
 : MPEG video stream termination condition
output
none
Function value
none
function
Set the transfer end condition for the video stream. You can OR the following values.
(1) Termination conditions for MPEG video stream
・ MPG_TCND_EOR
 : When transferring a sector with an EOR bit set
・ MPG_TCND_SEC
 : When system end code appears in the stream
・ MPG_TCND_NON
 : Do not set the end condition 

 List
 Title

Function specifications

 Function

Still image channel settings

 Function Name

MPG_SpSetChan

 No

3.5

Form
void MPG_SpSetChan (MpgSp mpgsp, Sint32 ch)
input
 mpgsp
 : MPEG still image handle
 ch
 : Channel number (MPG_IGNORE: not specified)
output
none
Function value
none
function
Specifies the channel number of the video stream to be played. The default is unspecified.
The channel switches immediately when this function is called. Data whose channel numbers do not match will be erased sequentially from the CD buffer.

 List
 Title

Function specifications

 Function

Setting the stream ID of the still image

 Function Name

MPG_SpSetId

 No

3.6

Form
void MPG_SpSetId (MpgSp mpgsp, Sint32 id)
input
 mpgsp
 : MPEG still image handle
 id
 : ID number (MPG_IGNORE: not specified)
output
none
Function value
none
function
Specify the ID of the video to be played. The default is unspecified.
Data whose ID numbers do not match will be deleted sequentially from the CD buffer.

 List
 Title

Function specifications

 Function

Start of still image playback

 Function Name

MPG_SpStart

 No

3.7

Form
Sint32 MPG_SpStart (MpgSp mpgsp)
input
mpgsp: MPEG still image handle
output
none
Function value
Error code
function
Playback of the still image starts.
remarks
(a) If this function is called while playing another stream, MPG_ERR_PLAYING is returned.
(b) If the MPEG decoder connection fails, MPG_ERR_MCON is returned.

 List
 Title

Function specifications

 Function

Stop playing still images

 Function Name

MPG_SpStop

 No

3.8

Form
Sint32 MPG_SpStop (MpgSp mpgsp)
input
mpgsp: MPEG still image handle
output
none
Function value
Error code
function
Stops playing the still image.
remarks
(a) If this function is called during the restoration process, the MPEG decoder will be initialized and MPG_ERR_RCV will be returned.

 List
 Title

Function specifications

 Function

Executing still image decoding

 Function Name

MPG_SpDecNext

 No

3.9

Form
Sint32 MPG_SpDecNext (MpgSp mpgsp, Sint32 bnk)
input
 mpgsp
 : MPEG still image handle
 bnk
 : Frame bank number
output
none
Function value
Error code
function
Expands the image for one screen to the specified frame bank.
【caution】
Only when decoding the first picture, make sure you are ready to decode using the MPG_IsDecReady function before executing this function.
After that, be sure to execute this function at intervals of 1 frame worth of decoding time (2VSYNC) or more. Normally, it is necessary to take synchronization timing using VSYNC, audio playback volume, and so on.
For details, see P.57 "Sending Decode Synchronous Signals" in the CDC Manual (MPEG Part).
See (CDC_MpOutDsync function).

 List
 Title

Function specifications

 Function

Acquiring the operating state of a still image

 Function Name

MPG_SpGetVideoStat

 No

3.10

Form
Sint32 MPG_SpGetVideoStat (MpgSp mpgsp)
input
mpgsp: MPEG still image handle
output
none
Function value
Current operating status
function
Gets the current operating status as shown below.
(1) Current operating status
・ MPG_SSTAT_STOP
 : Stopped
・ MPG_SSTAT_PREP
 :in preparation
・ MPG_SSTAT_PLAY
 : Playing
・ MPG_SSTAT_ERR
 :error 

 List
 Title

Function specifications

 Function

Get timecode for still images

 Function Name

MPG_SpGetTimeCode

 No

3.11

Form
void MPG_SpGetTimeCode (MpgSp mpgsp, Sint32 * hh, Sint32 * mm, Sint32 * ss, Sint32 * pp)
input
mpgsp: MPEG still image handle
output
 hh
 : Timecode time (0-23)
 mm
 : Timecode minutes (0-59)
 ss
 : Timecode seconds (0-59)
 pp
 : Timecode picture (0-29)
Function value
none
function
Gets the timecode in the video stream. Outputs 0 when the video stream is not playing.
remarks
(a) The video stream must be encoded in NTSC drop frames.
(b) Pictures are sometimes called frames.

 List
 Title

Function specifications

 Function

Still image MPEG window connection

 Function Name

MPG_SpConnectWin

 No

3.12

Form
void MPG_SpConnectWin (MpgSp mpgsp, MpgWn mpgwn, Sint32 bnk)
input
 mpgsp
 : MPEG still image handle
 mpgwn
 : MPEG window
 bnk
 : Frame bank number
output
none
Function value
none
function
Connect the MPEG still image handle to the MPEG window. The decoded still image is displayed through this MPEG window.

 List
 Title

Function specifications

 Function

Detaching the still image MPEG window

 Function Name

MPG_SpDisconnectWin

 No

3.13

Form
void MPG_SpDisconnectWin (MpgSp mpgsp, MpgWn mpgwn, Sint32 bnk)
input
 mpgsp
 : MPEG still image handle
 mpgwn
 : MPEG window
 bnk
 : Frame bank number
output
none
Function value
none
function
Disconnects the MPEG still image handle from the MPEG window.

 List
 Title

Function specifications

 Function

Still image output

 Function Name

MPG_SpOutput

 No

3.14

Form
Sint32MPG_SpOutput (MpgSp mpgsp, Sint32 bnk)
input
 mpgsp
 : MPEG still image handle
 bnk
 : Frame bank number
output
none
Function value
Error code
function
Outputs a still image. If another MPEG still image handle or MPEG video handle is being output, it will fail and no still image will be output. The MPEG window connected to the specified frame bank number is output. If direct output to VDP2 is specified, the direct output window connected to the specified bank will be used. In the case of output by host transfer, the image data is transferred to the buffer area of the host transfer window connected to the specified bank.
remarks
(a) mpgsp must be in host output mode and operating state is playing. If this is not the case, the still image output will fail.

BackForward
PROGRAMMER'S GUIDEMPEG library
Copyright SEGA ENTERPRISES, LTD., 1997