MOVIE TOOLS GUIDECinepak for SEGA Saturn
BackForward
Cinepak for SEGA Saturn


4.4.2 Data details

(1) Basic data

 List
 Title

Data specifications

 Data

Basic data

 Data Name
 No

1.0

 Model name
 explanation
 Uint8
 Unsigned 1-byte integer.
 Sint8
 Signed 1-byte integer.
 Uint16
 An unsigned 2-byte integer.
 Sint16
 Signed 2-byte integer.
 Uint32
 An unsigned 4-byte integer.
 Sint32
 Signed 4-byte integer.
 Bool
 Logical type. Take the following values.
FALSE fake
TRUE true

(2) Constant

 List
 Title

Data specifications

 Data

Error code

 Data Name

CPK_ERR_ ~

 No

2.1

The following constants represent error codes.
 Constant name
 explanation
 CPK_ERR_OK

CPK_ERR_OUT_OF_HANDLE
CPK_ERR_INSUFFICIENT_WORK
CPK_ERR_TOO_SMALL_BUF
CPK_ERR_NO_INIT
CPK_ERR_INVALID_HN
CPK_ERR_ILL_CREATE_MODE
CPK_ERR_TOO_SMALL_FLOP
CPK_ERR_TOO_LARGE_HEADER
CPK_ERR_HEADER_DATA
CPK_ERR_SAMPLE_ID
CPK_ERR_SAMPLE_DATA
CPK_ERR_ILLEGAL_PARA
CPK_ERR_ILLEGAL_HANDLE
CPK_ERR_NEXT_MOVI_STATUS
CPK_ERR_NEXT_MOVI_AUDIO
CPK_ERR_NEXT_MOVI_SCALE
CPK_ERR_CHANGE_NO_DATA
CPK_ERR_CHANGE_NO_ENTRY
CPK_ERR_PAUSE_STATUS
CPK_ERR_DMA_CPU_PCM
CPK_ERR_GFS_READ
CPK_ERR_DF_NO_DATA
CPK_ERR_DF_IS_NOT_VIDEO
 Normal termination handle cannot be created Insufficient work area Ring buffer size is small Initialization function is not called An invalid handle is specified.
Different from the mode at the time of Create
FLOP initial value is small Header is too large (ring buffer is small)
The film header is abnormal. The move identifier is abnormal. The move data is abnormal. The argument is incorrect. The handle is abnormal. The continuous playback movie status is abnormal. The next playback movie's audio conditions are not met. The time scales do not match The data supply of the next movie to be played is low. The next movie to be played is not specified. The pause function was called when the movie was not play or pause.
An error occurred when reading a file system in which DMA ended abnormally. There is no data supply for the header. It is not a video sample.

 List
 Title

Data specifications

 Data

Playback status

 Data Name

CPK_STAT_PLAY_ ~

 No

2.2

Shows the playback status of the movie.
 Constant name
 explanation
 CPK_STAT_PLAY_ERR_STOP
 Abnormal stop
 CPK_STAT_PLAY_STOP
 Stop
 CPK_STAT_PLAY_PAUSE
 pause
 CPK_STAT_PLAY_START
 Start playing
 CPK_STAT_PLAY_HEADER
 Film header processing in progress
 CPK_STAT_PLAY_TIME
 Playing (timer start)
 CPK_STAT_PLAY_END
 End of playback 

 List
 Title

Data specifications

 Data

Pause control command

 Data Name

CPK_PAUSE_ ~

 No

2.3

Indicates how to pause.
 Constant name
 explanation
 CPK_PAUSE_ON_AT_ONCE
 Immediate pause
 CPK_PAUSE_ON_KEYFRAME
 Pause at keyframe
 CPK_PAUSE_OFF
 Unpause 

 List
 Title

Data specifications

 Data

Work buffer size

 Data Name

CPK _ ** WORK_ ~

 No

2.4

Represents the size of the work buffer to be allocated.
 Constant name
 explanation
 CPK_24WORK_BSIZE

CPK_15WORK_BSIZE

 Number of bytes in the work buffer during 24-bit full-color movie playback
Number of bytes in the work buffer during 15-bit color movie playback

 List
 Title

Data specifications

 Data

Number of display colors

 Data Name

CPK_COLOR_ ~

 No

2.5

Specify the number of display colors to expand to.
 Constant name
 explanation
 CPK_COLOR_24BIT

CPK_COLOR_15BIT

 24-bit full color display.
Specified when displaying in full color with VDP2.
Display 15-bit color.
Specified when displaying 15-bit color with VDP1 or VDP2.

 List
 Title

Data specifications

 Data

Forced switchability check value

 Data Name

CPK_CHANGE_ ~

 No

2.6

Indicates the possibility of forced switching.
 Constant name
 explanation
 CPK_CHANGE_OK_AT_ONCE
CPK_CHANGE_NO_DATA


CPK_CHANGE_NO_ENTRY


CPK_CHANGE_TOO_LARGE_HEADER
 It is possible to forcibly switch immediately.
There is a shortage of data supply. Forced switching (CPK_Change)
When I execute, it does not play continuously smoothly.
The following movie is not registered in CPK_EntryNext. Forced switching (CPK_Change) cannot be executed.
The header is too large to force switching. The ring buffer is too small.

 List
 Title

Data specifications

 Data

Data transfer method

 Data Name

CPK_TRMODE_ ~

 No

2.7 2.7

typedef enum {
    CPK_TRMODE_CPU = 0, / * Software transfer * /
    CPK_TRMODE_SDMA, / * DMA cycle stealing (default value) * /
    CPK_TRMODE_SCU, / * SCU DMA * /
    CPK_TRMODE_SCUDSPDMA / * SCU-DSP DMA (new addition) * /
} CpkTrMode;

Note 1
The transfer method settings have the restrictions shown in the following table.

Restrictions on data transfer method settings
Processing \ method Software transfer CPU DMA SCU DMA SCU-DSP DMA
CPK_SetTrModeCd ×
CPK_SetTrModePcm ×

Note 2
If CPK_TRMODE_SCUDSPDMA is specified as the forwarding method, the Cinepak library initially has the right to use SCU-DSP. Use CPK_AllocScuDsp, CPK_FreeScuDsp when using SCU-DSP with both the Cinepak library and the application.

 List
 Title

Data specifications

 Data

CPU usage conditions

 Data Name

CPK_CPU_ ~

 No

2.8

typedef enum {
    CPK_CPU_MAIN = 1, / * master cpu only (default) * /
    CPK_CPU_SLAVE = 2, / * slave cpu only (not supported) * /
    CPK_CPU_DUAL = 3, / * dual cpu * /
    CPK_CPU_END
} CpkCpu;

caution
If you use a slave CPU in Cinepak, your application cannot use the slave CPU.

 List
 Title

Data specifications

 Data

Default value of silence rate [1 / s]

 Data Name

CPK_DEFAULT_SILENCE_RATE

 No

2.9

#define CPK_DEFAULT_SILENCE_RATE (8)

 List
 Title

Data specifications

 Data

Default value of playback speed (normal playback speed)

 Data Name

CPK_SPEED_ORIGINAL

 No

2.10

#define CPK_SPEED_ORIGINAL (0)

 List
 Title

Data specifications

 Data

Playback speed setting unit

 Data Name

CPK_SPEED_UNIT

 No

2.11

#define CPK_SPEED_UNIT (1024)

(3) Data type

 List
 Title

Data specifications

 Data

Movie handle

 Data Name

CpkHn

 No

3.1 3.1

Represents information for each movie.
typedef void * CpkHn;

 List
 Title

Data specifications

 Data

Creation parameters

 Data Name

CpkCreatePara

 No

3.2

Represents the creation information of the movie. Set various parameter values to Cpk_Create ~ as a structure.
typedef struct {
Uint32 * work_addr; / * Work start address * /
                   / * Work area when this library plays the movie * /
                   / * Number of bytes in the work * /
Uint32 work_size; / * Set CPK_24WORK_BSIZE or CPK_15WORK_BSIZE * /
                   / * Buffer address for storing movie files * /
Uint32 buf_addr; / * When playing a memory movie, its address * /
                   / * When playing a CD movie, the address of the ring buffer * /
                   / * Buffer size * /
Uint32 buf_size; / * File size when playing memory movie * /
                   / * Ring buffer size for CD movie * /
                   / * Sound memory PCM buffer address * /
Uint16 * pcm_addr; / * Sound memory PCM buffer size * /
Uint32 pcm_size; / * Quantization number for 1CH * /
                   / * Make it an integral multiple of 4KB (4096 * 1..4096 * 16) * /
} CpkCreatePara;

 List
 Title

Data specifications

 Data

Film header

 Data Name

CpkHeader

 No

3.3

Represents the header information of the movie.

/ * Film sample table item * /
typedef struct {
Uint32 offset; / * Offset from media start position * /
Sint32 size; / * Sample size * /
Sint32 time; / * Frame display time, -1: Audio sample * /
Sint32 duration; / * Frame display duration * /
} CpkFilmSample;

/ * Film header * / typedef struct { / * FilmHeader * / Uint32 film; / * “FILM” * / Uint32 size_header; / * Header size (offset to media start) * / Uint32 version; / * version * / Uint32 <> reserved; / * Reservation * / / * FrameDescription * / Uint32 fdsc; / * “FDSC” * / Uint32 size_fdsc; / * FDSC size 0x0000001C = 7 * 4 [byte] * / Uint32 c_type; / * Compression method “cvid” * / Uint32 height; / * Vertical width [pixel] * / Uint32 width; / * Horizontal width [pixel] * / Uin32 color; / * Number of display colors [bit] * / Uin32 sound_channel; / * Number of channels * / Uin32 sound_smpling_bit; / * Number of sampling bits [bit] * / Uin32 sound_compress; / * Compression 00h: None 01h: Reserve * / Uint32 sound_smpling_rate; / * Sampling rate [Hz] Lower 2 bytes are decimals * / Uin32 ckey; / * Chroma key information * / / * FilmSampleTable / * Uint32 stab; / * “STAB” * / Uint32 size_stab; / * STAB size (total number of samples + 1) * 16 [byte] * / Uint32 time_scale_film; / * Timescale * / Uint32 sample_total; / * Total number of samples * / CpkFilmSample sample [1]; / * Sample table arbitrary size * / } CpkHeader;

 List
 Title

Data specifications

 Data

Error registration function

 Data Name

CpkErrFunc

 No

3.4 3.4

A function that is called when an error occurs.
Form
void (* CpkErrFunc) (void * obj, Sint32 err_code)
input
obj: Registered object
err_code: error code
output
none

BackForward
MOVIE TOOLS GUIDECinepak for SEGA Saturn
Copyright SEGA ENTERPRISES, LTD ,. 1997