CRI Middleware Library Reference Manual : MWSFD

Constants

[Menu]

MwsfdStat
Handle status

Description

The following constants indicate handle status.

Define | Remarks
--- | ---
MWSFD_STAT_STOP | Stopping
MWSFD_STAT_PREP | Preparing
MWSFD_STAT_PLAYING | Playing
MWSFD_STAT_PLAYEND | Finishing playing
MWSFD_STAT_ERROR | Error state

Remarks

For compatibility, Old definitions are remained.

MWE_PLY_STAT_STOP

MWE_PLY_STAT_PREP

MWE_PLY_STAT_PLAYING

MWE_PLY_STAT_PLAYEND

MWE_PLY_STAT_ERROR

[Menu]

MWSFD_VHZ_~
Vsync frequency

Description

The following constants indicate vertical sync (Vsync) frequency for decoder.

Define | Remarks
--- | ---
MWSFD_VHZ_59_94 | 59.94Hz (NTSC)
MWSFD_VHZ_50_00 | 50.00Hz (PAL)
MWSFD_VHZ_60_00 | 60.00Hz

[Menu]

MwsfdDecSvr
Type of decode server

Description

The following constants indicate the type of decode server.

Define | Remarks
--- | ---
MWSFD_DEC_SVR_IDLE | decode during idle time of main procedure
MWSFD_DEC_SVR_MAIN | decode in main procedure

[Menu]

MWSFD_COMPO_~
Frame composition mode

Description

The following constants indicate frame composition mode.

Define | Remarks
--- | ---
MWSFD_COMPO_AUTO | Automatic configuration (default is Opaque)
MWSFD_COMPO_OPAQ | Opaque
MWSFD_COMPO_ALPHFULL | Full alpha
MWSFD_COMPO_ALPHLUMI | Luminance key alpha
MWSFD_COMPO_ALPH3 | 3 value alpha
MWSFD_COMPO_Z | Z depth movie

[Menu]

MWSFD_FTYPE_~
Type of file to play

Description

The following constants indicate the type of file to play for Sofdec.

Define | Remarks
--- | ---
MWSFD_FTYPE_SFD | Sofdec data (Sound and video)
MWSFD_FTYPE_MPV | Sofdec video (Video only)
MWSFD_FTYPE_VONLYSFD | Sofdec data (Video only)
MWSFD_FTYPE_M2TS | MPEG-2 Transport Stream

Remarks

For compatibility, Old definitions are remained.

MWE_PLY_FTYPE_SFD

MWE_PLY_FTYPE_MPV

[Menu]

MwsfdBufFmt
Data format of decoder's output buffer

Description

The following constants indicate the data format of decoder's outpu buffer.

Define | Remarks
--- | ---
MWSFD_BUFFMT_DEFAULT | default format for each platform
MWSFD_BUFFMT_MB_YCC420 | YCC 4:2:0 / macro block arrangement
MWSFD_BUFFMT_MB_ARGB8888 | RGB 32bit / macro block arrangement
MWSFD_BUFFMT_PLN_YCC420 | YCC 4:2:0 / plane arrangement

Remarks

For compatibility, Old definitions are remained.

MWE_PLY_BUFFMT type

MWE_PLY_BUFFMT_MB_YCC420

MWE_PLY_BUFFMT_MB_ARGB8888

MWE_PLY_BUFFMT_PLN_YCC420

[Menu]

MWSFD_OUTVOL_~
Output audio volume

Description

The following constants indicate output audio volume.

Define | Remarks
--- | ---
MWSFD_OUTVOL_MAX | Maximum volume
MWSFD_OUTVOL_MIN | Minimum volume (silent)

[Menu]

MWSFD_CH_~
Output audio channel

Description

The following constants indicate output audio channel.

Define | Remarks
--- | ---
MWSFD_CH_L | Left channel
MWSFD_CH_R | Right channel

Remarks

For compatibility, Old definitions are remained.

MWD_CH_L

MWD_CH_R

[Menu]

MWSFD_PAN_~
Output audio pan

Description

The following constants indicate output audio pan.

In the MWSFD_PAN_AUTO, pan would be set automatically according to data.

Define | Remarks
--- | ---
MWSFD_PAN_LEFT | Left pan
MWSFD_PAN_CENTER | Center pan
MWSFD_PAN_RIGHT | Right pan
MWSFD_PAN_AUTO | Automatic configuration

Remarks

For compatibility, Old definitions are remained.

MWD_PAN_LEFT

MWD_PAN_CENTER

MWD_PAN_RIGHT

MWD_PAN_AUTO

[Menu]

MWSFD_DFL_OUTBUFSIZE
Horizontal pitch of output frame buffer

Description The following constants indicate horizontal pitch of output frame buffer. MWSFD_DFL_OUTBUFSIZE Unspecified horizontal pitch of output frame buffer. Frame conversion may be done with width of input frame.

[Menu]

MwsfdLumiKey
Luminance alpha's transparence key

Description

The following constants indicate luminance alpha's transparence key.

Define | Remarks
--- | ---
MWSFD_LUMIKEY_BLACK | Black key transparence
MWSFD_LUMIKEY_WHITE | White key transparence

[Menu]

MwsfdFrmType
Frame type

Description

The following constants indicate frame type of progressive or interlace.

Define | Remarks
--- | ---
MWSFD_FRMTYPE_UNKNOWN | Unidentified video whether progressive or interlace
MWSFD_FRMTYPE_PROGRESSIVE | Progressive video
MWSFD_FRMTYPE_INTERLACE | Interlace video

[Menu]

MwsfdPtype
Picture type

Description

The following constants indicate picture type.

Define | Remarks
--- | ---
MWSFD_PTYPE_I | I picture
MWSFD_PTYPE_P | P picture
MWSFD_PTYPE_B | B picture
MWSFD_PTYPE_D | D picture

Remarks

For compatibility, Old definitions are remained.

MWE_PLY_PTYPE type

MWE_PLY_PTYPE_I

MWE_PLY_PTYPE_P

MWE_PLY_PTYPE_B

MWE_PLY_PTYPE_D

[Menu]

MwsfdYuvMode
YUV conversion mode

Description

The following constants indicate picture type.

Define | Remarks
--- | ---
MWSFD_YUVMODE_UNKNOWN | Unknown (n/a)
MWSFD_YUVMODE_ITU_R_BT_601 | ITU-R BT.601 format. This is standard format. It is same as CCIR601.
MWSFD_YUVMODE_CSC | Color Space Conpensation mode
MWSFD_YUVMODE_BASIC_YCBCR | Basic YCbCr (n/a)
MWSFD_YUVMODE_HIGH_CONTRAST | High contrast (n/a)
MWSFD_YUVMODE_RAW_YUV | Raw YUV data (n/a)

[Menu]

MWSFD_SYNCMODE_~
Synchronization mode

Description

The following constants indicate video synchronization mode.

Define | Remarks
--- | ---
MWSFD_SYNCMODE_NONE | No synchronization
MWSFD_SYNCMODE_VSYNC | V-Sync synchronization
MWSFD_SYNCMODE_AUDIO | Audio synchronization
MWSFD_SYNCMODE_EXTCLOCK | External clock synchronization

Remarks

For compatibility, Old definitions are remained.

MWD_PLY_SYNC_NONE

MWD_PLY_SYNC_VSYNC

MWD_PLY_SYNC_AUDIO

[Menu]

MwsfdFrmSync
Frame obtain synchronization mode

Description

The following constants indicate frame obtain synchronization mode.

Define | Remarks
--- | ---
MWSFD_FRMSYNC_TIME | time synchronization
MWSFD_FRMSYNC_NONE | no synchronization (= all decoded frame obtain)

[Menu]

MWSFD_ZVAL_~
Z value for Z movie

Description

The following constants indicate minimum/maximum Z value and Z range for Z movie.

Define | Remarks
--- | ---
MWSFD_ZVAL_MIN | Minimum Z Value (32bit)
MWSFD_ZVAL_MAX | Maximum Z Value (32bit)
MWSFD_ZVAL_RANGE | Range of Z Value

[Menu]

MwsfdVideoCodec
Video codec type

Description

The following constants indicate video codec type.

Define | Remarks
--- | ---
MWSFD_VIDEOCODEC_UNKNOWN | Unknown
MWSFD_VIDEOCODEC_M1V | Sofdec Video, MPEG-1 Video
MWSFD_VIDEOCODEC_M2V | MPEG-2 Video
MWSFD_VIDEOCODEC_M4V | MPEG-4 Video
MWSFD_VIDEOCODEC_H264 | H.264

Macro

[Menu]

MWSFD_TIME2SEC
Conversion of number of samples to sec

Format
MWSFD_TIME2SEC(ncount, tscale)
Input

ncount: playback time in sample units (number of samples)

tscale: sampling frequency (Hz)

Output

None

Return value

playback time in real time (sec)

Description

converts the return value of mwPlyGetTime to sec.

Remarks

For compatibility, Old definitions are remained.

MWD_PLY_TIME2SEC(ncount, tscale)

[Menu]

MWSFD_TIME2MSEC
Conversion of number of samples to msec

Format
MWSFD_TIME2MSEC(ncount, tscale)
Input

ncount: playback time in sample units (number of samples)

tscale: sampling frequency (Hz)

Output

None

Return value

playback time in real time (msec)

Description

converts the return value of mwPlyGetTime to msec.

Remarks

For compatibility, Old definitions are remained.

MWD_PLY_TIME2MSEC(ncount, tscale)

[Menu]

MWSFD_SIZE_PICUSRBUF
Buffer size of user data in picture layer

Format
MWSFD_SIZE_PICUSRBUF(npool, size1pic)
Input

npool: the number of frame pool which is set in handle creation parameter

size1pic: maximum user data size per 1 picture

Output

None

Return value

Buffer size of user data in picture layer (byte)

Description

calculates buffer size of setting paramteter for mwPlyAttachPicUsrBuf().

[Menu]

MWSFD_CALC_WORK_VPTS
Calc for Video PTS (for MPEG-2 Transport Stream)

Format
MWSFD_CALC_WORK_VPTS(picnum)
Input

picnum : the number of picture whitch holding information of time

Output

None

Return value

The size of buffer for video PTS (byte)

Description

calc size for setting by mwPlySetVideoPts function.

Remarks

Normally, please set the number of picture is 90. 90 pictures is about 3 seconds.

Data types

[Menu]

MWPLY
Middleware playback handle

Description Handle to control playback sofdec data.

[Menu]

MwsfdInitPrm
Initialization parameter structure

Description

Parameter structure for setting the initialization function of Sofdec library.

Member | Type | Remarks
--- | --- | ---
vhz | Float32 | frequency of vsync [Hz]
disp_cycle | Sint32 | This parameter is no use after MWSFD Ver.3.86.
disp_latency | Sint32 | This parameter is no use after MWSFD Ver.3.86.
dec_svr | MwsfdDecSvr | decode server
rsv | Sint32 | reserved (set to all zero)

Remarks

For compatibility, Old definitions are remained.

MWS_PLY_INIT_SFD type

[Menu]

MwsfdCrePrm
Handle creation parameter structure

Description

Parameter structure to set when creating a Middleware playback handle for Sofdec library.

Member | Type | Remarks
--- | --- | ---
ftype | Sint32 | Type of file to play
max_bps | Sint32 | Maximum bitstream amount (unit: bit/sec). Also possible to set an amount lower than actual use. If the program stops during playback, raise this value.
max_width | Sint32 | Maximum width of playback screen image size (unit: pixel)
max_height | Sint32 | Maximum height of playback screen image size (unit: pixel)
nfrm_pool_wk | Sint32 | Number of frame pools in the system area (usually:2, min:1). If frames are dropped due to variations in the processing load, raise this number.
max_stm | Sint32 | Maximum number of parallel reading streams included ADX.
work | Sint8* | Pointer to the buffer for use
wksize | Sint32 | Allocated buffer size (unit: bytes)
compo_mode | Sint32 | Composition mode.

Remarks

Maximum number of frame pools is 14.

For compatibility, Old definitions are remained.

MWS_PLY_CPRM_SFD type

[Menu]

MwsfdFrmObj
Frame information structure

Description

This is the movie surface information that is to be obtained when playing a texture movie.

Member | Type | Remarks
--- | --- | ---
*bufadr | Uint8 | Decoder's output buffer address
frmid | Sint32 | each frame identifier ID
buffmt | MwsfdBufFmt | Data format of decoder's output buffer
width | Sint32 | number of pixels in horizontal direction
height | Sint32 | number of pixels in vertical direction
x_mb | Sint32 | number of macro blocks in horizontal direction
y_mb | Sint32 | number of macro blocks in vertical direction
ptype | MwsfdPtype | Picture type
fps | Sint32 | frame rate [fps * 1000]
fno | Sint32 | Count of frame
time | Sint32 | Display time
tunit | Sint32 | Unit of display time
concat_cnt | Sint32 | Count of concatenation processing
fno_per_file | Sint32 | Count of frame in the file
time_per_file | Sint32 | Playback time in the file
errcnt | Sint32 | Count of data error occurrence
rcvcnt | Sint32 | Count of data error recoveryn
usrdatptr | void * | Pointer to user data in picture layer
usrdatsize | Sint32 | Data size of user data in picture layer
frmtype | MwsfdFrmType | Frame type
frmcodec | MwsfdFrmCodec | Frame information of codec specific
yuvmode | MwsfdYuvMode | YUV conversion mode
zmin | Uint32 | Minimum dynamic range for Z movie
zmax | Uint32 | Maximum dynamic range for Z movie
*sud_ptr | void | data pointer of Sofdec specific
sud_size | Sint32 | data size of Sofdec specific

Remarks

For compatibility, Old definitions are remained.

MWS_PLY_FRM type

[Menu]

MwsfdSbtPrm
Subtitle parameter

Description

This is subtitle parameter structure that is obtained by mwPlyGetSubtile function.

Member | Type | Remarks
--- | --- | ---
update | Bool | update data flag
datasize | Sint32 | size of data [byte]
tunit | Sint32 | time unit
intime | Sint32 | start display time. sec = intime / tunit.
durtime | Sint32 | duration of display time. sec = intime / tunit.

[Menu]

MwsfdPlyInf
Playback information structure

Description

This is the playback information structure for getting playback information function.

Member | Type | Remarks
--- | --- | ---
drop_frm_cnt | Sint32 | Count of drop frame
skip_dec_cnt | Sint32 | Count of decode frame skip
skip_disp_cnt | Sint32 | Count of display frame skip
skip_emptyb_cnt | Sint32 | Count of skip empty-B picture
no_supply_cnt | Sint32 | Count of data supply shortage
average_fps | Float32 | average frame rate

[Menu]

MwsfdHdrInf
File header information

Description

This is File header information structure that is obtained by mwPlyGetHdrInf function.

Member | Type | Remarks
--- | --- | ---
playable | Bool | Flag of playable movie ( TURE: playable, FALSE: not playable)
ftype | Sint32 | Type of file (MWSFD_FTYPE_~ )
width | Sint32 | Number of pixels in horizontal direction
height | Sint32 | Number of pixels in vertical direction
fps | Sint32 | Frame rate [fps * 1000]
frmnum | Sint32 | Number of video frames
fxtype | Sint32 | F/X type
num_video_ch | Sint32 | Number of video channel
num_audio_ch | Sint32 | Number of audio channel
a_sfreq | Sint32 | Sampling frequency of default audio channel
a_nch | Sint32 | Monaural / stereo of default audio channel

[Menu]

MwsfdMallocFn
Malloc function

Description

This is malloc function type that is set to MWSFD library.

Format
void *(*MwsfdMallocFn)(void *obj, Uint32 size)
Input

obj : user's object

size : size of allocation

Output

None

Return value

None

[Menu]

MwsfdFreeFn
Free function

Description

This is free function type that is set to MWSFD library.

Format
void (*MwsfdFreeFn)(void *obj, void *ptr)
Input

obj : user's object

ptr : allocated pointer

Output

None

Return value

None

[Menu]

MwsfdYccPlane
YCbCr plane information structure

Description

This is the YcbCr plane information.

Member | Type | Remarks
--- | --- | ---
*y_ptr | Uint8 | Y buffer pointer
*cb_ptr | Uint8 | Cb buffer pointer
*cr_ptr | Uint8 | Cr buffer pointer
y_width | Sint32 | Y buffer width
cb_width | Sint32 | Cb buffer width
cr_width | Sint32 | Cr buffer width

Remarks

For compatibility, Old definitions are remained.

MWS_PLY_YCC_PLANE type

[Menu]

MwsfdMakeZTblCbFn
Make Z conversion table function

Description

This is make z conversion table function type that is set to MWSFD library.

Format
void (*MwsfdMakeZTblCbFn)(Uint32 *orgtbl, Float32 znear, Float32 zfar, void *ztbl)
Input

orgtbl : the pointer of table whitch convert from output decoding to Z-value (0x00000000~0x7FFFFFFF). the table buffer exist in MWPLY handle's work buffer.

znear : near value of Z.

zfar : far value of Z.

Output

ztbl : the pointer of table whitch convert from Z-value (0x00000000~0x7FFFFFFF) to content in Z-Buffer. the table buffer exist in MWPLY handle's work buffer.

Return value

None

[Menu]

MwsfdFlowCnt
Data flow counter

Description

This is the counter of supply data and consume data.

Member | Type | Remarks
--- | --- | ---
supplied | Sint64 | Counter of supply data [byte]
consumed | Sint64 | Counter of consume data [byte] (including discard data)
discarded | Sint64 | Counter of discard data [byte]

[Menu]

MwsfdFlowInf
Data flow information structure

Description

This is the data flow informatin of each decode unit.

Member | Type | Remarks
--- | --- | ---
system | MwsfdFlowCnt | Data flow counter of system decoder
video | MwsfdFlowCnt | Data flow counter of video decoder (not support yet about discard data)
audio | MwsfdFlowCnt | Data flow counter of audio decoder (not support yet about discard data)
adxtin | MwsfdFlowCnt | Data flow counter of input SJ to ADXT (not support yet about discard data)

[Menu]

MwsfdExtClockFn
External clock function

Description

This is external clock function type that is set to MWSFD library.

This function is used on MWSFD_SYNCMODE_EXTCLOCK mode.

Format
void (*MwsfdExtClockFn)(void *usrobj, Sint32 *time, Sint32 *tunit)
Input

mwply :Middleware playback handle

Output

time :time counter

tunit :time unit

Return value

None

[Menu]

MwsfdFrmCodec
Frame information for video codec-specific

Description

This is frame information for video codec-specific.

Member | Type | Remarks
--- | --- | ---
videocodec | MwsfdVideoCodec | Video codec type
frmm2v | MwsfdFrmM2v | MPEG-2 frame information (MPEG-1, SofdecVideo is available too)

[Menu]

MwsfdFrmM2v
MPEG-2 frame information structure

Description

This structure is recorded directly information in MPEG-2 bit stream.

This information is available in the case of MPEG-1 and Sofdec Video.

Member | Type | Remarks
--- | --- | ---
pts | Sint64 | PTS 33bit (-1:no PTS info)
picture_structure | Sint32 | Picture structure (0:reserved 1:top-field, 2:bottom-f. 3:frame)
chroma_format | Sint32 | Chroma format (0:reserved 1:420 2:422 3:444)
bit_rate | Sint32 | Bit rate (18+12=30bit)
vbv_buffer_size | Sint32 | VBV buffer size (10+8=18bit)
display_horizontal_size | Sint16 | Display horizontal size 14bit
display_vertical_size | Sint16 | Display vertical size 14bit
progressive_frame | Sint8 | 0:interlace 1:progressive
top_field_first | Sint8 | Top field first flag
repeat_first_field | Sint8 | Repeat first field flag
aspect_ratio_information | Sint8 | Aspect ratio information 4bit
constrained_parameters_flag | Sint8 | Constrained parameters flag
frame_rate_extension_n | Sint8 | Frame rate extension n 2bit
frame_rate_extension_d | Sint8 | Frame rate extension d 5bit
profile_and_level_indication | Uint8 | Profile and level indication 8bit
progressive_sequence | Sint8 | Progressive sequence flag
low_delay | Sint8 | Low delay flag
video_format | Sint8 | Video format 3bit
colour_description | Sint8 | Color description flag 1bit
colour_primaries | Uint8 | Color primaries 8bit
transfer_characteristics | Uint8 | Transfer characteristics 8bit
matrix_coefficients | Uint8 | Matrix coefficients 8bit

Function

[Menu]

mwPlyInitSfdFx
Initialize library

Format
void mwPlyInitSofdec(MwsfdInitPrm *iprm)
Input

iprm : Initialization parameter

Output

None

Return value

None

Description

This function initializes the library.

Remarks

If this function called repeatedly, function runs only first time.

If you will change initialize parameter, calls mwPlyFinishSfdFx function, and after call mwPlyInitSfdFx function.

Example

    memset(&iprm, 0, sizeof(MwsfdInitPrm));         // zero clear
    iprm.vhz            = MWSFD_VHZ_59_94;          // NTSC
    iprm.dec_svr        = MWSFD_DEC_SVR_IDLE;       // Idle Thread Decode
    mwPlyInitSfdFx(&iprm);

[Menu]

mwPlyFinishSfdFx
Finalize library

Format
void mwPlyFinishSfdFx(void)
Input

None

Output

None

Return value

None

Description

This function performs the library end processing.

[Menu]

mwPlyCalcWorkCprmSfd
Work area size calculation

Format
Sint32 mwPlyCalcWorkCprmSfd(MwsfdCrePrm *cprm)
Input

cprm : Handle creation parameter

Output

None

Return value

Work area size (unit: bytes)

Description

Calculates the work area size.

Example

    refer mwPlyCreateSofdec function.

[Menu]

mwPlyCreateSofdec
Create a handle

Format
MWPLY mwPlyCreateSofdec(MwsfdCrePrm *cprm)
Input

cprm : Handle creation parameter

Output

None

Return value

Middleware playback handle

Description

This function creates a handle.

Example

    memset(&cprm, 0, sizeof(MwsfdCrePrm));      // For zero setting for reserved area
    cprm.compo_mode     = MWSFD_COMPO_AUTO;     // Composition mode
    cprm.ftype          = MWSFD_FTYPE_SFD;      // Playback file type
    cprm.max_bps        = 6 * 1000 * 1000;      // Bit rate:6Mbit/sec
    cprm.max_width      = 640;                  // Image size:640x448
    cprm.max_height     = 480;
    cprm.nfrm_pool_wk   = 2;                    // Number of frame buffers
    cprm.max_stm        = 1;                    // Max number of parallel reading
    cprm.buffmt         = MWSFD_BUFFMT_DEFAULT
    cprm.wksize = mwPlyCalcWorkCprmSfd(&cprm);  // Work area size calculation
    cprm.work           = malloc(cprm.wksize);  // Work area allocation
    ply = mwPlyCreateSofdec(&cprm);

[Menu]

mwPlyDestroy
Destroy a handle

Format
void mwPlyDestroy(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Destroys the handle.

[Menu]

mwPlyStartFname
Start playback

Format
void mwPlyStartFname(MWPLY mwply, Char8 *fname)
Input

mwply : Middleware playback handle

fname : file name of sofdec data to play

Output

None

Return value

None

Description

Starts playback sofdec data with specified file name.

[Menu]

mwPlyStop
Stop playback

Format
void mwPlyStop(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Stops playback sofdec data.

After calling this function, the handle status transits to STOP.

It might take time to execute mwPlyStop function when the handle status is PREP/PLAYING.

[Menu]

mwPlyRequestStop
Request stop playback

Format
void mwPlyRequestStop(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

This is a non-blocking function that just requests command and returns immediately.

The handle status can not be changed after this function but after completion of internal stop process.

It required for status transition to keep calling ADXM_ExecMain function and wait Vsync function in main loop.

This function can avoid having to wait for late function return.

The period of time from calling mwPlyRequestStop function till changed to STOP status is indefinite because of dependency on movie decoding and file reading process.

[Menu]

mwPlyGetStat
Get the handle status

Format
MwsfdStat mwPlyGetStat(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Internal handle status

Description

Gets the internal status of the Middleware playback handle.

Define | Remarks
--- | ---
MWSFD_STAT_STOP | Stopping
MWSFD_STAT_PREP | Preparing
MWSFD_STAT_PLAYING | Playing
MWSFD_STAT_PLAYEND | Finishing playback
MWSFD_STAT_ERROR | Error

[Menu]

mwPlyGetCurFrm
Get current frame

Format
void mwPlyGetCurFrm(MWPLY mwply, MwsfdFrmObj *frm)
Input

mwply : Middleware playback handle

Output

frm : frame information

Return value

None

Description

This function gets the frame to be displayed.

Remarks

(a) If failed to get frame, then frm.bufadr is set to NULL.

(b) Release any unused frames by mwPlyRelCurFrm promptly.

(c) This function can not use with mwPlyGetFrm/mwPlyRelFrm.

Example

    for (;;) {
        MwsfdFrmObj frm;
        /* Main Loop */
        ADXM_ExecMain();
        mwPlyGetCurFrm(mwply, &frm);
        if (frm.bufadr != NULL) {
            /* Conversion of frame */
            /* Transfer texture to VRAM */
            UsrLoadMvFrmFx(mwply, &frm);
            mwPlyRelCurFrm(mwply);
        }
        UsrDrawMv();
    }

[Menu]

mwPlyRelCurFrm
Release current frame

Format
void mwPlyRelCurFrm(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Release the frame reserved by mwPlyGetCurFrm.

Remarks

(a) This function can not use with mwPlyGetFrm/mwPlyRelFrm.

Example

    refer mwPlyGetCurFrm function.

[Menu]

mwPlyGetTime
Get the number of the playing sample

Format
void mwPlyGetTime(MWPLY mwply, Sint32 *ncount, Sint32 *tscale)
Input

mwply : Middleware playback handle

Output

ncount : time

tscale : unit of time (Hz)

Return value

None

Description

This function gets the playback time.

Remarks

Actual time (second or millisecond) can be calculated by:

sec = MWSFD_TIME2SEC(ncount , tscale);

msec = MWSFD_TIME2MSEC(ncount , tscale);

[Menu]

mwPlyPause
Pause playback / Resume playback

Format
void mwPlyPause(MWPLY mwply, Sint32 sw)
Input

mwply : Middleware playback handle

sw : Pause / Resume switch (ON=Pause, OFF=Resume)

Output

None

Return value

None

Description

Pause and resume playback.

Remarks

In the case of playback Video only, Pause in a pause means single step playback.

[Menu]

mwPlyIsPause
Get pause status ON/OFF

Format
Bool mwPlyIsPause(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

TRUE : in pause (= pause ON)

FALSE : not in pause (= pause OFF)

Description

Get pause status whether pause ON/OFF.

Return value is independent from middleware playback handle status, but result of calling mwPlyPause function.

[Menu]

mwPlyGetFrm
Get frame

Format
Bool mwPlyGetFrm(MWPLY mwply, Sint32 *frmid, MwsfdFrmObj *frm)
Input

mwply : Middleware playback handle

Output

frmid :frame identifier ID

frm :frame information

Return value

TRUE : successed getting frame.

FALSE : failed getting frame.

Description

This function gets the frame to be displayed.

To get next frame, application don't need to release previous frame.

Application can get each frame only one.

The data of frame is hold until releasing the frame or calling mwPlyStop function.

This function is need to execute on same thread of

mwPlyGetFrm and mwPlyRelFrm need to be called on same thread.

This function can not use with mwPlyGetCurFrm/mwPlyRelCurFrm.

[Menu]

mwPlyRelFrm
Release frame

Format
void mwPlyRelFrm(MWPLY mwply, Sint32 frmid)
Input

mwply : Middleware playback handle

frmid : frame identifier ID

Output

None

Return value

None

Description

This function release the frame indicated by frame ID.

Application can release each frame only one. If you repeatedly released, error callback occured.

mwPlyGetFrm and mwPlyRelFrm need to be called on same thread.

This function can not use with mwPlyGetCurFrm/mwPlyRelCurFrm.

[Menu]

mwPlyStartAfs
Start AFS playback

Format
void mwPlyStartAfs(MWPLY mwply, Sint32 patid, Sint32 fid)
Input

mwply : Middleware playback handle

patid : partition ID

fid : faile ID

Output

None

Return value

None

Description

Starts playback by file ID in AFS file.

Example

    static char ptinfo[ADXF_CALC_PTINFO_FMGL_SIZE(MAX_INSIDE)];
        ADXF_LoadPartitionFmgLongNw(ptid, "movie.afs", NULL, ptinfo);
        for(;;) {
            if (ADXF_GetPtStat(ptid) == ADXF_STAT_READEND) {
                break;
            }
        }
        fid = 0;
        mwPlyStartAfs(mwply, ptid, fid);

[Menu]

mwPlyStartFnameRange
Start playing by range in file

Format
void mwPlyStartFnameRange(MWPLY mwply, Char8 *fname, Sint32 offset_sct, Sint32 range_sct)
Input

mwply : Middleware playback handle

fname : File name that includes Sofdec data.

offset_sct : Offset of Sofdec data in file [sector]

range_sct : Size of Sofdec data [sector]

Output

None

Return value

None

Description

Start playing Sofdec data by range in file.

Please use your original packing file including Sofdec data.

[Menu]

mwPlyStartSj
Start Stream Joint playback

Format
void mwPlyStartSj (MWPLY mwply, SJ sji)
Input

mwply : Middleware playback handle

sji : Input SJ handle

Output

None

Return value

None

Description

Starts playback by SJ handle.

[Menu]

mwPlyTermSupply
Notify the end of data supply

Format
void mwPlyTermSupply(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Notify the end of data supply to MWPLY handle whitch start by mwPlyStartSj function.

Please call this function after you supply all of data to to SJ.

After mwPlyTermSupply function was called and all of data was decoded, MWPLY handle's status transit to PLAYEND.

[Menu]

mwPlyStartMem
Start OnMemory playback

Format
void mwPlyStartMem (MWPLY mwply, void *addr, Sint32 len)
Input

mwply : Middleware playback handle

addr : memory address

len : data size

Output

None

Return value

None

Description

Starts playback on memory movie file.

This function can not play seamless loop/continuous playback.

This function can play only SFD format, can not play MWSFD_FTYPE_MPV data.

Remarks

ADX library has "memory file system(MFS)" for reading data on memory.

By MFS, mwPlyStartFname/mwPlyStartFnameLp/mwPlyEntryFname functions can play data on memory.

About MFS, please refer sample program "adxmfs" of ADX.

[Menu]

mwPlyStartFnameLp
Start seamless loop playback

Format
void mwPlyStartFnameLp(MWPLY mwply, Char8 *fname)
Input

mwply : Middleware playback handle

fname : file name of sofdec data to play

Output

None

Return value

None

Description

Starts seamless loop playback sofdec data with specified file name.

Remarks

(a) mwPlyGetTime() function's return-value means total playback time.

(b) The playback is terminated in limit time, even if the playback is in mid-flow. About limit time, please refer to mwPlySetLimitTime, mwPlyGetLimitTime functions.

(c) By mwPlyReleaseLp() function, the playback is terminated at end of stream.

(d) If movie's total time is vely short (ex. below 2 second), the playback could be not smoothly because reading file is not ready in time.

(e) You can play infinite loop by mwPlySetInfiniteSingleLoop function.

[Menu]

mwPlyReleaseLp
Stop seamless loop playback

Format
void mwPlyReleaseLp(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Release seamless loop playback.

Remarks

The playback is terminated at end of stream.

If call function timing is near at end of stream, The playback is terminated at end of next stream.

[Menu]

mwPlyStartAfsLp
Start AFS Loop playback

Format
void mwPlyStartAfsLp(MWPLY mwply, Sint32 patid, Sint32 fid)
Input

mwply : Middleware playback handle

patid : partition ID

fid : faile ID

Output

None

Return value

None

Description

Starts seamless loop playback by file ID in AFS file.

Remarks

Refer to mwPlyStartFnameLp() function's Remarks.

[Menu]

mwPlyStartFnameRangeLp
Start seamless loop playback by range in file

Format
void mwPlyStartFnameRangeLp(MWPLY mwply, Char8 *fname, Sint32 offset_sct, Sint32 range_sct)
Input

mwply : Middleware playback handle

fname : File name that includes Sofdec data.

offset_sct : Offset of Sofdec data in file [sector]

range_sct : Size of Sofdec data [sector]

Output

None

Return value

None

Description

Start seamless loop playback of Sofdec data by range in file.

Please use your original packing file including Sofdec data.

[Menu]

mwPlySetInfiniteSingleLoop
Set infinite single loop

Format
void mwPlySetInfiniteSingleLoop(MWPLY mwply, Bool sw)
Input

mwply : Middleware playback handle

sw : mode switch (ON = use infinite loop playback, OFF = not use infinite loop playback)

Output

None

Return value

None

Description

Set infinite single loop playback.

The default setting is OFF.

The playback is terminated in limit time, even if the playback is in mid-flow.

Infinite single movie loop playback function is a kind of automatic restart, finished by reaching playback limit time.

Restart process runs inside ADXM_ExecMain function.

Restarting movie, playback looks breaking up but handle status is kept as PLAYING.

Also playback time, frame ID and other information related to plyaback will be reset by restart process.

Strictly, restart process will wake up at not just playback limit time but a certain time before it, that is based on length of the movie. Therefore movie would not stop halfway.

Restart process will wake up starting by follow functions exclusively.

- mwPlyStartFnameLp

- mwPlyStartAfsLp

- mwPlyStartFnameRangeLp

- mwPlyStartLsnLp

For example, this sample code can't use infinite loop playback.

mwPlyEntryFname(ply, loopmovie.sfd);

mwPlyStartSeamless(ply);

mwPlySetSeamlessLp(ply, ON);

Remarks

The number of restart can be got by mwPlyGetInfiniteLoopCount function.

[Menu]

mwPlyGetInfiniteLoopCount
Get the count of internal restart for infinite loop playback

Format
Uint32 mwPlyGetInfiniteLoopCount(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The count of internal restart for infinite loop playback

Description

Get the count of internal restart for infinite loop playback.

[Menu]

mwPlyEntryFname
Make filename entry for continuous playback

Format
void mwPlyEntryFname(MWPLY mwply, Char8 *fname)
Input

mwply : Middleware playback handle

fname : file name of sofdec data to enter play list

Output

None

Return value

None

Description

Add filename to continuous play list.

Remarks

(a) Assigned file name is deleted from file list after the file was played.

(b) Before start playback, can add some files. If the playback is in mid-flow, can add filename.

(c) If file is added to file list, the playback could be not smoothly because reading file is not ready in time.

Example

    /* Playback 4 files seamless continuously. */
    mwPlyEntryFname(mwply, "movie1.sfd");
    mwPlyEntryFname(mwply, "movie2.sfd");
    mwPlyEntryFname(mwply, "movie3.sfd");
    mwPlyEntryFname(mwply, "movie4.sfd");
    mwPlyStartSeamless(mwply);                   /* Start */
    mwPlyReleaseSeamless(mwply);                 /* Notify end entry */

[Menu]

mwPlyStartSeamless
Start seamless continuous playback

Format
void mwPlyStartSeamless(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Starts seamless continuous playback by file list.

Remarks

(a) mwPlyGetTime() function's return-value means total playback time.

(b) The playback is terminated in limit time, even if the playback is in mid-flow. About limit time, please refer to mwPlySetLimitTime, mwPlyGetLimitTime functions.

(c) By mwPlyReleaseLp() function, the playback is terminated at end of stream.

(d) If movie's total time is vely short (ex. below 2 second), the playback could be not smoothly because reading file is not ready in time.

(e) This function can't use infinite single loop playback.

Example

    refer mwPlyEntryFname function.

[Menu]

mwPlyReleaseSeamless
Stop seamless continuous playback

Format
void mwPlyReleaseSeamless(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Terminate filelist for continuous playback.

Remarks

After all file listed was played, the playback is termination.

Example

    refer mwPlyEntryFname function.

[Menu]

mwPlySetSeamlessLp
Set seamless loop play

Format
void mwPlySetSeamlessLp(MWPLY mwply, Sint32 flg)
Input

mwply : Middleware playback handle

flg : flag (1: loop ON, 0: loop OFF)

Output

None

Return value

None

Description

Set a loop playback of files witch is registered on continuous playback.

Example

    mwPlyEntryFname(mwply, "file01.sfd");
    mwPlyEntryFname(mwply, "file02.sfd");
    mwPlyEntryFname(mwply, "file03.sfd");
    mwPlySetSeamlessLp(mwply, ON);
    mwPlyStartSeamless(mwply);

[Menu]

mwPlyGetNumSlFiles
Get the number of entry file

Format
Sint32 mwPlyGetNumSlFiles(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of file listed

Description

Get The number of file listed for continuous playback at now.

Example

    /* Get num entry files and file name */
    num_entry = mwPlyGetNumSlFiles(mwply);
    for (i = 0; i < num_entry; i++) {
        printf("%s\n", mwPlyGetSlFname(mwply, i));
    }

[Menu]

mwPlyGetSlFname
Get filename of entry file

Format
Char8 *mwPlyGetSlFname(MWPLY mwply, Sint32 stm_no)
Input

mwply : Middleware playback handle

stm_no : Ordinal number which is relative from reading file now

Output

None

Return value

File name

Description

Get the file name in file list. "stm_no" of now reading file is zero.

Example

    refer mwPlyGetNumSlFiles function.

[Menu]

mwPlyEntryAfs
Make AFS entry for continuous playback

Format
void mwPlyEntryAfs(MWPLY mwply, Sint32 patid, Sint32 fid)
Input

mwply : Middleware playback handle

patid : partition ID

fid : faile ID

Output

None

Return value

None

Description

Add file to continuous play list by file ID in AFS file.

Remarks

Refer to mwPlyEntryFname() function's Remarks.

[Menu]

mwPlyEntryFnameRange
Make filename entry for continuous playback by range in file

Format
void mwPlyEntryFnameRange(MWPLY mwply, Char8 *fname, Sint32 offset_sct, Sint32 range_sct)
Input

mwply : Middleware playback handle

fname : File name that includes Sofdec data.

offset_sct : Offset of Sofdec data in file [sector]

range_sct : Size of Sofdec data [sector]

Output

None

Return value

None

Description

Add filename to continuous play list by range in file.

Remarks

(a) Assigned file name is deleted from file list after the file was played.

(b) Before start playback, can add some files. If the playback is in mid-flow, can add filename.

(c) If file is added to file list, the playback could be not smoothly because reading file is not ready in time.

[Menu]

mwPlySetOutVol
Set output volume

Format
void mwPlySetOutVol(MWPLY mwply, Sint32 vol)
Input

mwply : Middleware playback handle

vol : Output volume (Minimun value is ?796, Maximum value is 0)

Output

None

Return value

None

Description

Set audio channel number in the multiple audio stream.

[Menu]

mwPlyGetOutVol
Get output volume

Format
Sint32 mwPlyGetOutVol(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Output volume (Minimun value is ?796, Maximum value is 0)

Description

Get current audio volume.

[Menu]

mwPlySetOutPan
Set output pan

Format
void mwPlySetOutPan(MWPLY mwply, Sint32 chno, Sint32 pan)
Input

mwply : Middleware playback handle

chno : Channel number (MWSFD_CH_L / MWSFD_CH_R)

pan : Output pan value (-15 to 15)

Output

None

Return value

None

Description

Set output pan in each channel.

[Menu]

mwPlyGetOutPan
Get output pan

Format
Sint32 mwPlyGetOutPan(MWPLY mwply, Sint32 chno)
Input

mwply : Middleware playback handle

chno : Channel number (MWSFD_CH_L / MWSFD_CH_R)

Output

None

Return value

Output pan value (-15 to 15)

Description

Get current audio pan in each channel.

[Menu]

mwPlyGetNumAudioCh
Get the number of audio channel streams

Format
Sint32 mwPlyGetNumAudioCh(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of audio channel streams.

Description

Get the number of audio channel streams in SFD file.

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

[Menu]

mwPlySetAudioCh
Set audio channel

Format
void mwPlySetAudioCh(MWPLY mwply, Sint32 ch)
Input

mwply : Middleware playback handle

ch : Channel number (Minimun value is 0)

Output

None

Return value

None

Description

Set audio channel number in the multiple audio stream.

[Menu]

mwPlyGetAudioCh
Get audio channel playing now

Format
Sint32 mwPlyGetAudioCh(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Channel number

Description

Get audio channel number playing now.

[Menu]

mwPlyGetAhxWorkSize
Get size of work buffer for AHX

Format
Sint32 mwPlyGetAhxWorkSize(void)
Input

None

Output

None

Return value

size of work buffer for AHX

Description

Get size of work buffer for AHX

[Menu]

mwPlyAttachAhx
Attach AHX

Format
void mwPlyAttachAhx(MWPLY mwply, void *wkptr, Sint32 wksize, Sint32 ch)
Input

mwply : Middleware playback handle

wkptr : pointer of work buffer

wksize : size of work buffer

ch : channel number of AHX stream

Output

None

Return value

None

Description

Attach AHX.

[Menu]

mwPlyDetachAhx
Detach AHX

Format
void mwPlyDetachAhx(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Detach AHX.

[Menu]

mwPlySetAhxCh
Set channel number of AHX

Format
void mwPlySetAhxCh(MWPLY mwply, Sint32 ch)
Input

mwply : Middleware playback handle

ch : channel number of AHX

Output

None

Return value

None

Description

Set channel number of AHX.

[Menu]

mwPlyGetSubtitle
Get subtitle data

Format
Sint32 mwPlyGetSubtitle(MWPLY mwply, Uint8 *bufptr, Sint32 bufsize, MwsfdSbtPrm *sbtprm)
Input

mwply : Middleware playback handle

bufptr : pointer of user's buffer

bufsize : size of user's buffer [byte]

Output

sbtprm : Subtitle parameter

Return value

1 : Got subtitle data on time

other : Didn't get subtitle data

Description

This function copies subtitle to user's buffer and get subtitle parameter.

While subtitle's duration time of display, this function get same data repeatedly.

For use, please set MWSFD_COMPO_AUTO to composition mode of MWPLY handle.

[Menu]

mwPlySetSubtitleCh
Set channel of subtitle data

Format
void mwPlySetSubtitleCh(MWPLY mwply, Sint32 chno)
Input

mwply : Middleware playback handle

chno : channel number of subtitle data

Output

None

Return value

None

Description

Set channel of subtitle data

[Menu]

mwPlyGetNumSubtitleCh
Get the number of subtitle channel

Format
Sint32 mwPlyGetNumSubtitleCh(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of subtitle channel.

Description

Get the number of subtitle channel in SFD file.

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

[Menu]

mwPlySetSubtitleScount
Set shift time of subtitle data

Format
void mwPlySetSubtitleScount(MWPLY mwply, Sint32 scount)
Input

mwply : Middleware playback handle

scount : shift time count (sec = scount / tunit)

Output

None

Return value

None

Description

Set shift time of subtitle data

[Menu]

mwPlyFxSetOutBufPitchHeight
Set output buffer size

Format
void mwPlyFxSetOutBufSize(MWPLY mwply, Sint32 width, Sint32 height)
Input

mwply : Middleware playback handle

pitch : width of output buffer (Byte)

height : height of output buffer (Byte)

Output

None

Return value

None

Description

Set size of output buffer.

[Menu]

mwPlyFxGetOutBufPitchHeight
Get output buffer size

Format
void mwPlyFxGetOutBufPitchHeight(MWPLY mwply, Sint32 *pitch, Sint32 *height)
Input

mwply : Middleware playback handle

Output

pitch : width of output buffer (Byte)

height : height of output buffer (Byte)

Return value

None

Description

Get size of output buffer.

Remarks

If unset condition, this function's return-value is "MWSFD_DFL_OUTBUFSIZE".

[Menu]

mwPlyFxSetCompoMode
Set composition mode

Format
void mwPlyFxSetCompoMode(MWPLY mwply, Sint32 mode)
Input

mwply : Middleware playback handle

mode : composition mode

Output

None

Return value

None

Description

Set composition mode.

[Menu]

mwPlyFxGetCompoMode
Get composition mode

Format
Sint32 mwPlyFxGetCompoMode(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Composition mode

Description

Get composition mode.

[Menu]

mwPlyFxSetLumiPrm
Set luminance key alpha parameter

Format
void mwPlyFxSetLumiPrm(MWPLY mwply, Sint32 in_th, Sint32 out_th, MwsfdLumiKey key)
Input

mwply : Middleware playback handle

in_th : transparence in-threshold (min: 0 max: 255)

out_th : transparence out-threshold (min: 0 max: 255)

key : transparence key

Output

None

Return value

None

Description

Set luminance key alpha parameter.

[Menu]

mwPlyFxGetLumiPrm
Get luminance key alpha parameter

Format
void mwPlyFxGetLumiPrm(MWPLY mwply, Sint32 *in_th, Sint32 *out_th, MwsfdLumiKey *key)
Input

mwply : Middleware playback handle

Output

in_th : transparence in-threshold (min: 0 max: 255)

out_th : transparence out-threshold (min: 0 max: 255)

key : transparence key

Return value

None

Description

Get luminance key alpha parameter.

[Menu]

mwPlyFxSetAlp3Prm
Set alpha 3-value parameter

Format
void mwPlyFxSetAlp3Prm(MWPLY mwply, Uint8 zero, Uint8 half, Uint8 full)
Input

mwply : Middleware playback handle

zero : alpha value (0~255) for transparence pixels

half : alpha value (0~255) for translucence pixels

full : alpha value (0~255) for opaque pixels

Output

None

Return value

None

Description

Set alpha 3-value parameter.

Remarks

Please use to adjust translucence pixels.

Alpha 3-value movie was encoded based on transparence/translucence/opaque pixcels.

If you change alpha vlue of transparence/opaque pixels extremely, NOISE may be occured.

[Menu]

mwPlyFxGetAlp3Prm
Get alpha 3-value parameter

Format
void mwPlyFxGetAlp3Prm(MWPLY mwply, Uint8 *zero, Uint8 *half, Uint8 *full)
Input

mwply : Middleware playback handle

Output

zero : alpha value (0~255) for transparence pixels

half : alpha value (0~255) for translucence pixels

full : alpha value (0~255) for opaque pixels

Return value

None

Description

Get alpha 3-value parameter.

[Menu]

mwPlyFxCnvFrmZ16
Convert 16bit depth Z value

Format
void mwPlyFxCnvFrmZ16(MWPLY mwply, MwsfdFrmObj *frm, Uint8 *zout)
Input

mwply : Middleware playback handle

frm : Frame Information

Output

zout : Z-buffer pointer

Return value

None

Description

Convert to 16bit-Z format from decoded frame.

[Menu]

mwPlyFxCnvFrmZ32
Convert 32bit depth Z value

Format
void mwPlyFxCnvFrmZ32(MWPLY mwply, MwsfdFrmObj *frm, Uint8 *zout)
Input

mwply : Middleware playback handle

frm : Frame Information

Output

zout : Z-buffer pointer

Return value

None

Description

Convert to 32bit-Z format from decoded frame.

[Menu]

mwPlyFxSetZclip
Set Z depth clip

Format
void mwPlyFxSetZclip(MWPLY mwply, Float32 znear, Float32 zfar)
Input

mwply : Middleware playback handle

znear : Z-near value

zfar : Z-far value

Output

None

Return value

None

Description

Set Z-clip to MWPLY handle.

[Menu]

mwPlyFxGetZclip
Get Z depth clip

Format
void mwPlyFxGetZclip(MWPLY mwply, Float32 *znear, Float32 *zfar)
Input

mwply : Middleware playback handle

Output

znear : Z-near value

zfar : Z-far value

Return value

None

Description

Get Z-clip assigned in MWPLY handle.

[Menu]

mwPlyFxSetCbFnMakeZTbl
Set callback function for making z table

Format
void mwPlyFxSetCbFnMakeZTbl(MWPLY mwply, MwsfdMakeZTblCbFn func)
Input

mwply : Middleware playback handle

func : function to make Z conversion table

Output

None

Return value

None

Description

Normally do not call this function.

Set callback function for making z table.

[Menu]

mwPlyGetFxType
Get F/X type in Sofdec data

Format
Sint32 mwPlyGetFxType(mwply)
Input

mwply : Middleware playback handle

Return value

F/X type

Description

Get F/X type in Sofdec data.

This function can get following F/X type.

- MWSFD_COMPO_OPAQ : Opaque

- MWSFD_COMPO_ALPHFULL : Full-Alpha

- MWSFD_COMPO_ALPH3 : 3value-Alpha

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

[Menu]

mwPlyGetHdrInf
Get file header information

Format
void mwPlyGetHdrInf(Sint8 *buf, Sint32 bsize, MwsfdHdrInf *hdrinf)
Input

buf : Address of data

bsize : Size of data

Output

hdrinf : file header information structure

Return value

None

Description

Analyze the SFD file.

Please input the top 20 Kbyte of SFD file on memory.

[Menu]

mwPlyGetTotalFrmNum
Get the number of movie frame

Format
Sint32 mwPlyGetTotalFrmNum(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of movie frame

Description

Get the number of movie frame

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

Example

    for (;;) {
        MwsfdFrmObj frm;
        /* Main Loop */
        ADXM_ExecMain();
        if (mwPlyGetStat(mwply) == MWSFD_STAT_PLAYING) {
            numfrm = mwPlyGetTotalFrmNum(mwply);
        }
        mwPlyGetCurFrm(mwply, &frm);
        if (frm.bufadr != NULL) {
            /* Conversion of frame */
            /* Transfer texture to VRAM */
            UsrLoadMvFrmFx(mwply, &frm);
            mwPlyRelCurFrm(mwply);
        }
        UsrDrawMv();
    }

[Menu]

mwPlyGetPlayingHdrInf
Get file header information

Format
void mwPlyGetPlayingHdrInf(MWPLY mwply, MwsfdHdrInf *hdrinf)
Input

mwply : Middleware playback handle

Output

hdrinf : file header information structure

Return value

None

Description

Get movie header info from playing movie file.

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

This function can get only information from SFD file.

[Menu]

mwPlySetMallocFn
Set malloc / free function

Format
void mwPlySetMallocFn(MwsfdMallocFn mallocfn, MwsfdFreeFn freefn, void *obj)
Input

mwply : Middleware playback handle

mallocfn : malloc function

freefun : free function

obj : argument of malloc / free function

Output

None

Return value

None

Description

The work buffer of a MWPLY handle is securable using registered Malloc / free function. A work buffer is secured by two or more times of Malloc.

The memory secured at the time of handle creation is released at the time of handle destruction.

When you use the registered function, it is a parameter at the time of handle creation, and please make a buffer address of creation parameter into NULL.

Remarks

The registered function is used only within mwPlyCreateSofdec() and mwPlyDestroy().

[Menu]

mwPlySetSpeed
Set speed of playback

Format
void mwPlySetSpeed(MWPLY mwply, Sint32 speed)
Input

mwply : Middleware playback handle

speed : Playback speed (1000 = x1 speed)

Output

None

Return value

None

Description

Set speed of playback.

Playback speed depends on load average of decoding movie. Therefore actual playback speed is not necessarily correspond to setting speed.

[Menu]

mwPlySetSyncMode
Set synchronization mode

Format
void mwPlySetSyncMode(MWPLY mwply, Sint32 mode)
Input

mwply : Middleware playback handle

mode : synchronization mode

Output

None

Return value

None

Description

Set synchronization mode.

If you change the syncmode, please call this function before start playback.

Define | Remarks
--- | ---
MWSFD_SYNCMODE_NONE | No synchronization : MWSFD lib doesn't manage frame's synchronization.mwPlyGetCurFrm() function obtains frame, if there is a frame pooled.Can't be playing the movie with audio.
MWSFD_SYNCMODE_VSYNC | V-Sync synchronization : MWSFD lib doesn't synchronize video and audio.Video was synchronized Vsync.
MWSFD_SYNCMODE_AUDIO | Audio synchronization : MWSFD lib synchronize video and audio.
MWSFD_SYNCMODE_EXTCLOCK | External clock Audio synchronization : MWSFD lib synchronize callback function of external clock.

Remarks

Default mode is the following.

Playing file type | Default mode
--- | ---
SFD file contained audio | MWSFD_SYNCMODE_AUDIO
SFD file (only video) | MWSFD_SYNCMODE_VSYNC
M1V file | MWSFD_SYNCMODE_VSYNC

In the case of MWSFD_FTYPE_VONLYSFD, default mode is MWSFD_SYNCMODE_VSYNC, even if SFD file contained audio.

[Menu]

mwPlyGetSyncMode
Get synchronization mode

Format
Sint32 mwPlyGetSyncMode(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

MWSFD_SYNCMODE_~ : synchronization mode macro

Description

Get synchronization mode.

[Menu]

mwPlySetTimerCh
Set timer channel

Format
void mwPlySetTimerCh(Sint32 chno)
Input

chno : timer channel

Output

None

Return value

None

Description

Set timer channel.

If you don't use timer, please set -1 as channel number.

[Menu]

mwPlyGetTimerCh
Get timer channel

Format
Sint32 mwPlyGetTimerCh(void)
Input

None

Output

None

Return value

The number of timer channel.

-1 : No use timer

Description

Get the number of timer channel

[Menu]

mwPlyAttachPicUsrBuf
Attach buffer for user data in picture layer

Format
void mwPlyAttachPicUsrBuf(MWPLY mwply, void *bufptr, Sint32 bufsize, Sint32 size1pic)
Input

mwply : Middleware playback handle

bufptr : Pointer to user data in picture layer

bufsize : Data size of user data in picture layer

size1pic : Maximum user data size per 1 picture

Output

None

Return value

None

Description

buffer setting function to get user data in each frame.

After setting, some value would be set to member usrdatptr, usrdatsize of structure MwsfdFrmObj which is acquired by mwPlyGetCurFrm().

If size of user data exceeds size1pic, you can not refer to user data exceeded size1pic.

Remarks

Sofdec CRAFT does not have function to fill in user data.

[Menu]

mwPlySetFrmSync
Set frame obtain synchronization mode

Format
void mwPlySetFrmSync(MWPLY mwply, MwsfdFrmSync frmsync)
Input

mwply : Middleware playback handle

frmsync : frame obtain synchronization mode

Output

None

Return value

None

Description

Set frame obtain synchronization mode.

Define | Remarks
--- | ---

MWSFD_FRMSYNC_TIME

time synchronization :
mwPlyGetCurFrm() function assigns frame which is nearest display-time. The following process run.
(1) obtatin frame.
(2) check whether next frame is ready.
(3) If next frame is ready, release current frame.
(4) obtatin next frame.

MWSFD_FRMSYNC_NONE | no synchronization : mwPlyGetCurFrm() function assigns all decoded frames in order.

Remarks

Default mode is no synchronization.

[Menu]

mwPlyGetFrmSync
Get frame obtain synchronization mode

Format
MwsfdFrmSync mwPlyGetFrmSync(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

MWSFD_FRMSYNC_~ : frame obtain synchronization mode macro

Description

Get frame obtain synchronization mode.

[Menu]

mwPlySetCbExtClock
Set external clock callback function

Format
void mwPlySetCbExtClock(MWPLY mwply, MwsfdExtClockFn extclock_fn, Sint32 extclock_max, void *extclock_usrobj)
Input

mwply :Middleware playback handle

extclock_fn :External clock function

extclock_max :The maximum namber of clock value (In the case fo 8bit: 0x000000FF, 32bit:0xFFFFFFFF)

extclock_usrobj :User object (first argument of external clock function)

Output

None

Return value

None

Description

Set external clock callback function for MWSFD_SYNCMODE_EXTCLOCK mode.

The external clock callback need satisfy the following conditions.

- Return the value that always increases monotonously by the same pace.

- The overflow of the clock value must be larger more enough than the update time cycle. (The update time cycle is generaly Vsync.)

The external clock callback function is called at the following timing.

- If using ADX thread and auto update Sofdec time mode, then the callback function is called from Vsync thread.

- If not using ADX thread and auto update Sofdec time mode, then the callback function is called from ADXM_ExecMain function.

- If not auto update Sofdec time mode, then the callback function is called from mwPlyUpdateTime function.

Remarks

If latest clock value is less than previous one, Sofdec library assume overflow of clock value.

When the overflow occurred, Sofdec library compensates the clock value : clock value = latest value - previous value + clock_max + 1.

[Menu]

mwPlySetUpdateTimeAuto
Set auto update time mode

Format
void mwPlySetUpdateTimeAuto(MWPLY mwply, Bool sw)
Input

mwply :Middleware playback handle

sw : mode switch (ON = use auto update time, OFF = not use auto update time)

Output

None

Return value

None

Description

Set auto update time mode.

The default mode is ON (use auto update time).

If you change the mode, please call this function before start playback.

When not use auto update time mode, the application need to call mwPlyUpdateTime function for update time.

For example, this function is used when Vsync thread of ADX can't synchronize with main loop.

Remarks

When use auto update time mode , updating time is executed at the following timing.

- If using ADX thread, updating is executed in Vsync thread of ADX.

- If not using ADX thread, updating is executed in ADXM_ExecMain function.

You can use ADX thread when you call ADXM_SetupThread or ADXM_SetupFramework function before initialization of ADX/Sofdec.

[Menu]

mwPlyUpdateTime
Update Sofdec time

Format
void mwPlyUpdateTime(MWPLY mwply)
Input

mwply:Middleware playback handle. If you use NULL, it is for all handles.

Output

None

Return value

None

Description

Update Sofdec time.

If you use not auto update time mode by mwPlySetUpdateTimeAuto function, please call this function once per main loop.

Please call this function at the same timing in vsync (ex. after wait vsync).

If you use auto update time mode, this function don't update time.

[Menu]

mwPlyGetVersionStr
Get Sofdec library version string

Format
const Char8 *mwPlyGetVersionStr(void)
Input

None

Output

None

Return value

Pointer of version string

Description

Get Sofdec library version number string.

[Menu]

mwPlySetLimitTime
Set limit time of playback

Format
void mwPlySetLimitTime(MWPLY mwply, Sint32 sec)
Input

mwply : Middleware playback handle

sec : playback's time limit[second]

Output

None

Return value

None

Description

Set limit time of playback.

The playback(simple, seamless loop, seamless concatenation) is terminated in limit time, even if the playback is in mid-flow.

playback limit time depends on following condition.

- Vsync frequency (one of handle creation parameter)

- with or without audio

- frame rate of the movie

You can't set limit time over the default limit.

Typical playback limit time is follows.

- 29.97fps frame rate movie without audio

59.94Hz : 99hrs 31min 11sec

50.00Hz : 119hrs 18min 15sec

60.00Hz : 99hrs 25min 12sec

- movie with audio

59.94Hz : 9hrs 57min 06sec

50.00Hz : 11hrs 55min 48sec

60.00Hz : 9hrs 56min 30sec

Generally playback limit time without audio is about 10 times longer than with audio except 23.976fps that is about 4 times longer.

Remarks

Playback limit time can be got by mwPlyGetLimitTime function after changing to PLAYING state.

[Menu]

mwPlyGetLimitTime
Get limit time of playback

Format
Sint32 mwPlyGetLimitTime(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The limit time [msec].

Description

Get limit time of playback.

Please call this function after the handle status transit to PLAYING.

Remarks

About limit time, please refer to mwPlySetLimitTime function.

[Menu]

mwPlyGetPlyInf
Get playback information

Format
void mwPlyGetPlyInf(MWPLY mwply, MwsfdPlyInf *plyinf)
Input

mwply : Middleware playback handle

Output

plyinf : playback information structure

Return value

None

Description

Get statistic playback information.

Each information as below is obtainable.

(a) Count of drop frame ; mwPlyGetNumDropFrm

(b) Count of decode frame skip ; mwPlyGetNumSkipDec

(c) Count of display frame skip ; mwPlyGetNumSkipDisp

(d) Count of empty-B picture skip ; mwPlyGetNumSkipEmptyB

Difference of return value of above function are as follows.

(yes = obtainable, no = is not obtainable)

function | decode frame skip | display frame skip | empty-B picture skip
--- | --- | --- | ---
mwPlyGetNumDropFrm | yes | yes | no
mwPlyGetNumSkipDec | yes | no | no
mwPlyGetNumSkipDisp | no | yes | no
mwPlyGetNumSkipEmptyB | no | no | yes

[Menu]

mwPlyGetNumTotalDec
Get the total number of decode frame

Format
Sint32 mwPlyGetNumTotalDec(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The total number of frames decoded.

Description

Get the total number of frames docoded in the playback.

[Menu]

mwPlyGetNumDecPool
Get the number of decoded frame in pool

Format
Sint32 mwPlyGetNumTotalDec(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of frames pooled.

Description

Get the number of frames pooled which is docoded.

After last frame was released, this function return -1.

[Menu]

mwPlyGetNumDropFrm
Get the number of dropped frame

Format
Sint32 mwPlyGetNumDropFrm(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of dropped frames.

Description

Get the number of decoding skip.

In setting skip empty-B picture, this function's return-value doesn't contain the count of empty-B picture.

[Menu]

mwPlyGetNumSkipDec
Get the number of skipped frame to decode

Format
Sint32 mwPlyGetNumSkipDec(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of skipped frame to decode.

Description

Get the total number of decoding skip.

Remarks

This counter is increased by a frame that does not finish decoding till it's time to display.

[Menu]

mwPlyGetNumSkipDisp
Get the number of skipped frame to display

Format
Sint32 mwPlyGetNumSkipDisp(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of skipped frame to decode.

Description

Get the total number of skipped frame to display.

Remarks

This counter is increased by a frame that is not obtained till it's time to display.

[Menu]

mwPlyGetNumSkipEmptyB
Get the number of skipped empty B picture

Format
Sint32 mwPlyGetNumSkipEmptyB(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of skipped empty-B picture.

Description

Get the number of skipped empty-B picture.

In setting skip empty-B picture, this function return 0.

[Menu]

mwPlyGetFlowInf
Get data flow information

Format
void mwPlyGetFlowInf(MWPLY mwply, MwsfdFlowInf *flowinf)
Input

mwply : Middleware playback handle

Output

flowinf : data flow information

Return value

None

Description

Get data flow information of system stream.

[Menu]

mwPlySetBpicSkip
Set B-picture skip decode

Format
void mwPlySetBpicSkip(MWPLY mwply, Bool sw)
Input

mwply : Middleware playback handle

sw : setting switch (ON: skip B-picture, OFF: don't skip B-picture)

Output

None

Return value

None

Description

Set switch skip B-picture decode.

[Menu]

mwPlySetEmptyBpicSkip
Set Empty B picture skip decode

Format
void mwPlySetEmptyBpicSkip(MWPLY mwply, Bool sw)
Input

mwply : Middleware playback handle

sw : setting switch (ON: skip empty-B, OFF: don't skip empty-B)

Output

None

Return value

None

Description

Set switch skip empty-B-picture decode.

[Menu]

mwPlySetPpicSkip
Set P-picture skip decode

Format
void mwPlySetPpicSkip(MWPLY mwply, Bool sw)
Input

mwply : Middleware playback handle

sw : setting switch (ON: skip P-picture, OFF: don't skip P-picture)

Output

None

Return value

None

Description

Set switch skip P-picture decode.

[Menu]

mwPlyGetAdxtHn
Get ADXT handle

Format
ADXT mwPlyGetAdxtHn(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

ADXT handle

Description

Get ADXT handle in MWPLY handle.

[Menu]

mwPlyGetInputSj
Get input Stream Joint

Format
SJ mwPlyGetInputSj(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

SJ handle

Description

Get input SJ handle in MWPLY handle.

[Menu]

mwPlyGetSfdHn
Get decoder handle

Format
void *mwPlyGetSfdHn(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Video decoder handle

Description

Get video decoder handle in MWPLY handle.

[Menu]

mwPlyGetNumRemainFrm
Get number of gettable new frames

Format
Sint32 mwPlyGetNumRemainFrm(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

the number of gettable new frames

Description

This function get the number of gettable new frames. This number don't include frames which already application got.

If this function return 0, applicatin can not get next frame.

[Menu]

mwPlySwitchToIdle
Switch to idle thread

Format
void mwPlySwitchToIdle(void)
Input

None

Output

None

Return value

None

Description

Change into idle thread, that is, Main thread is falling a sleep until next VSync.

If you use MWSFD Ver.3.30 or later, mwPlySwitchToIdle function is same ADXM_WaitVsync function.

Please substitute ADXM_WaitVsync function for user function that waits for Vsync.

[Menu]

mwPlyIsSvrBdr
Determine whether process is in server border

Format
Bool mwPlyIsSvrBdr(void)
Input

None

Output

None

Return value

TRUE : in server border

FALSE : not in server border

Description

Determine whether process is in server border.

[Menu]

mwPlyCalcYccPlane
Calculate YcbCr plane

Format
void mwPlyCalcYccPlane(Uint8 *bufptr, Sint32 width, Sint32 height,MWS_PLY_YCC_PLANE *ycc)
Input

bufptr : decoder's output buffer address

width : width by number of pixels

height : height by number of pixels

Output

ycc : YCbCr plane information

Return value

None

Description

Calculate each of Y, Cb, Cr buffer pointer and width from decoder's output buffer address.

[Menu]

mwPlySetAudioSw
Set audio output switch

Format
void mwPlySetAudioSw(MWPLY mwply, Sint32 sw)
Input

mwply : Middleware playback handle

sw : Audio output switch (ON=decode audio, OFF=skip to decode audio)

Output

None

Return value

None

Description

Set audio output switch in decoder level.

If you change the sudio switch, please call this function before start playback.

Remarks

Mute OFF is realised by volume 0, mwPlySetOutVol(mwply, 0).

[Menu]

mwPlyGetNumVideoCh
Get the number of video channel streams

Format
Sint32 mwPlyGetNumVideoCh(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

The number of video channel streams.

Description

Get the number of video channel streams in SFD file.

Remarks

This function is enabled after that handle's status is MWSFD_STAT_PLAYING.

[Menu]

mwPlySetVideoCh
Set video stream channel

Format
void mwPlySetVideoCh(MWPLY mwply, Sint32 ch)
Input

mwply : Middleware playback handle

ch : Channel number (Minimun value is 0)

Output

None

Return value

None

Description

Set audio channel number in the multiple video stream.

[Menu]

mwPlyGetVideoCh
Get video channel playing now

Format
Sint32 mwPlyGetVideoCh(MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

Channel number

Description

Get video channel number playing now.

[Menu]

mwPlySetVideoSw
Set video output switch

Format
void mwPlySetVideoSw(MWPLY mwply, Sint32 sw)
Input

mwply : Middleware playback handle

sw : Video output switch (ON=decode video, OFF=skip to decode video)

Output

None

Return value

None

Description

Set video output switch in decoder level.

[Menu]

mwPlyVsyncHndl
Vsync processing

Format
void mwPlyVsyncHndl (MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

None

Description

Execute MWSFD library's vsync process about only one MWPLY handle.

Remarks

This function is not available.

[Menu]

mwPlyExecSvrHndl
Server function by each handle

Format
Bool mwPlyExecSvrHndl (MWPLY mwply)
Input

mwply : Middleware playback handle

Output

None

Return value

TRUE : server process request more execution.

FALSE : server process don't request more execution now.

Description

Execute MWSFD library's server process about only one MWPLY handle.

Remarks

Normally, Calling this funcition by application is prohibited.

[Menu]

mwPlyExecVsyncServer
Time update server of outer thread manager

Format
Bool mwPlyExecVsyncServer(void)
Input

None

Output

None

Return value

TRUE : process for time update that should be done remains.

FALSE : process for time update has finished.

Description

Appilication that does not use ADX thread function must call this function instead.

Normally do not call this function.

[Menu]

mwPlyExecDecServer
Decode server of outer thread manager

Format
Bool mwPlyExecDecServer(void)
Input

None

Output

None

Return value

TRUE : process for decode that should be done remains.

FALSE : process for decode has finished.

Description

Appilication that does not use ADX thread function must call this function instead.

Normally do not call this function.

Copyright (c) 2001-2006 CRI Middleware Co.,LTD.