Japanese
PROGRAMMER'S GUIDEMPEG library
BackForward
MPEG library/12.Function details-3

12.3 Still image playback



 one
View
table
 Title

function specification

 Function

Generate MPEG still image handle

 Function name

MPG_SpCreate

 No

3.1

Format
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.

 one
View
table
 Title

function specification

 Function

Erase MPEG still image handle

 Function name

MPG_SpDestroy

 No

3.2

Format
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 in a stopped state for both audio and video.
(b) The handle is not registered as the next handle to be played by the MPG_MvEntryNext function.
(c) This function executes the playback stop function.

 one
View
table
 Title

function specification

 Function

Setting the still image output destination

 Function name

MPG_SpSetVideoDest

 No

3.3

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

 one
View
table
 Title

function specification

 Function

Setting end conditions for still images

 Function name

MPG_SpSetTermCond

 No

3.4

Format
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 video stream transfer end conditions. You can logically OR the following values:
(1) MPEG video stream termination conditions
・MPG_TCND_EOR
 :When transferring a sector with EOR bit set
・MPG_TCND_SEC
 : When a system end code appears in the stream
・MPG_TCND_NON
 : Do not set termination conditions 

 one
View
table
 Title

function specification

 Function

Setting the still image channel

 Function name

MPG_SpSetChan

 No

3.5

Format
void MPG_SpSetChan(MpgSp mpgsp, Sint32 ch)
input
 mpgsp
 :MPEG still image handle
 ch
 :Channel number (MPG_IGNORE: unspecified)
output
none
function value
none
function
Specifies the channel number of the video stream to be played. Default is unspecified.
When this function is called, the channel will be switched immediately. Data with mismatched channel numbers will be sequentially erased from the CD buffer.

 one
View
table
 Title

function specification

 Function

Setting the still image stream ID

 Function name

MPG_SpSetId

 No

3.6

Format
void MPG_SpSetId(MpgSp mpgsp, Sint32 id)
input
 mpgsp
 :MPEG still image handle
 id
 : ID number (MPG_IGNORE: unspecified)
output
none
function value
none
function
Specify the ID of the video to be played. Default is unspecified.
Data with unmatched ID numbers will be sequentially deleted from the CD buffer.

 one
View
table
 Title

function specification

 Function

Start of still image playback

 Function name

MPG_SpStart

 No

3.7

Format
Sint32 MPG_SpStart(MpgSp mpgsp)
input
mpgsp: MPEG still image handle
output
none
function value
Error code
function
Starts playing still images.
remarks
(a) If you call this function while playing another stream, MPG_ERR_PLAYING will be returned.
(b) If MPEG decoder connection fails, return MPG_ERR_MCON.

 one
View
table
 Title

function specification

 Function

Stopping still image playback

 Function name

MPG_SpStop

 No

3.8

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

 one
View
table
 Title

function specification

 Function

Executing still image decoding

 Function name

MPG_SpDecNext

 No

3.9

Format
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 an image for one screen into the specified frame bank.
【Note】
Only when decoding the first picture, use the MPG_IsDecReady function to confirm that decoding is ready before executing this function.
After that, be sure to execute this function at intervals of at least one frame's decoding time (2VSYNC). Normally, it is necessary to obtain synchronization timing using VSYNC, audio playback amount, etc.
For details, see page 57 "Decode synchronization signal transmission" in the CDC manual (MPEG part).
(See CDC_MpOutDsync function).

 one
View
table
 Title

function specification

 Function

Obtaining the operating status of still images

 Function name

MPG_SpGetVideoStat

 No

3.10

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

 one
View
table
 Title

function specification

 Function

Obtaining still image timecode

 Function name

MPG_SpGetTimeCode

 No

3.11

Format
void MPG_SpGetTimeCode(MpgSp mpgsp,Sint32 *hh, Sint32 *mm, Sint32 *ss, Sint32 *pp)
input
mpgsp: MPEG still image handle
output
 hh
 : Time code time (0 to 23)
 mm
 : Minute of time code (0 to 59)
 ss
 : Time code seconds (0 to 59)
 pp
 : Time code picture (0 to 29)
function value
none
function
Get the timecode present in the video stream. Outputs 0 when no video stream is playing.
remarks
(a) The video stream must be encoded with NTSC drop frames.
(b) A picture is sometimes called a frame.

 one
View
table
 Title

function specification

 Function

Still image MPEG window connection

 Function name

MPG_SpConnectWin

 No

3.12

Format
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 and the MPEG window. The decoded still image will be displayed through this MPEG window.

 one
View
table
 Title

function specification

 Function

Detaching the still image MPEG window

 Function name

MPG_SpDisconnectWin

 No

3.13

Format
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
Disconnect the MPEG still image handle and the MPEG window.

 one
View
table
 Title

function specification

 Function

Still image output

 Function name

MPG_SpOutput

 No

3.14

Format
Sint32MPG_SpOutput(MpgSp mpgsp, Sint32 bnk)
input
 mpgsp
 :MPEG still image handle
 bnk
 :Frame bank number
output
none
function value
Error code
function
Output still images. If another MPEG still image handle or MPEG video handle is being output, this will fail and the still image will not be output. The MPEG window connected to the specified frame bank number will be output. If direct output to VDP2 is specified, the direct output window connected to the specified bank will be used. When outputting 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 the operating state must be playing. If this is not the case, still image output will fail.

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