Constants

 
[Menu]
MwsfdStat
Handle status
 
Description

The following constants indicate handle status.

DefineRemarks
MWSFD_STAT_STOPStopping
MWSFD_STAT_PREPPreparing
MWSFD_STAT_PLAYINGPlaying
MWSFD_STAT_PLAYENDFinishing playing
MWSFD_STAT_ERRORError 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.

DefineRemarks
MWSFD_VHZ_59_9459.94Hz (NTSC)
MWSFD_VHZ_50_0050.00Hz (PAL)
MWSFD_VHZ_60_0060.00Hz
 
[Menu]
MwsfdDecSvr
Type of decode server
 
Description

The following constants indicate the type of decode server.

DefineRemarks
MWSFD_DEC_SVR_IDLEdecode during idle time of main procedure
MWSFD_DEC_SVR_MAINdecode in main procedure
 
[Menu]
MWSFD_COMPO_~
Frame composition mode
 
Description

The following constants indicate frame composition mode.

DefineRemarks
MWSFD_COMPO_AUTOAutomatic configuration (default is Opaque)
MWSFD_COMPO_OPAQOpaque
MWSFD_COMPO_ALPHFULLFull alpha
MWSFD_COMPO_ALPHLUMILuminance key alpha
MWSFD_COMPO_ALPH33 value alpha
MWSFD_COMPO_ZZ depth movie
 
[Menu]
MWSFD_FTYPE_~
Type of file to play
 
Description

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

DefineRemarks
MWSFD_FTYPE_SFDSofdec data (Sound and video)
MWSFD_FTYPE_MPVSofdec video (Video only)
MWSFD_FTYPE_VONLYSFDSofdec data (Video only)
MWSFD_FTYPE_M2TSMPEG-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.

DefineRemarks
MWSFD_BUFFMT_DEFAULTdefault format for each platform
MWSFD_BUFFMT_MB_YCC420YCC 4:2:0 / macro block arrangement
MWSFD_BUFFMT_MB_ARGB8888RGB 32bit / macro block arrangement
MWSFD_BUFFMT_PLN_YCC420YCC 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.

DefineRemarks
MWSFD_OUTVOL_MAXMaximum volume
MWSFD_OUTVOL_MINMinimum volume (silent)
 
[Menu]
MWSFD_CH_~
Output audio channel
 
Description

The following constants indicate output audio channel.

DefineRemarks
MWSFD_CH_LLeft channel
MWSFD_CH_RRight 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.

DefineRemarks
MWSFD_PAN_LEFTLeft pan
MWSFD_PAN_CENTERCenter pan
MWSFD_PAN_RIGHTRight pan
MWSFD_PAN_AUTOAutomatic 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.

DefineRemarks
MWSFD_LUMIKEY_BLACKBlack key transparence
MWSFD_LUMIKEY_WHITEWhite key transparence
 
[Menu]
MwsfdFrmType
Frame type
 
Description

The following constants indicate frame type of progressive or interlace.

DefineRemarks
MWSFD_FRMTYPE_UNKNOWNUnidentified video whether progressive or interlace
MWSFD_FRMTYPE_PROGRESSIVEProgressive video
MWSFD_FRMTYPE_INTERLACEInterlace video
 
[Menu]
MwsfdPtype
Picture type
 
Description

The following constants indicate picture type.

DefineRemarks
MWSFD_PTYPE_II picture
MWSFD_PTYPE_PP picture
MWSFD_PTYPE_BB picture
MWSFD_PTYPE_DD 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.

DefineRemarks
MWSFD_YUVMODE_UNKNOWNUnknown (n/a)
MWSFD_YUVMODE_ITU_R_BT_601ITU-R BT.601 format. This is standard format. It is same as CCIR601.
MWSFD_YUVMODE_CSCColor Space Conpensation mode
MWSFD_YUVMODE_BASIC_YCBCRBasic YCbCr (n/a)
MWSFD_YUVMODE_HIGH_CONTRASTHigh contrast (n/a)
MWSFD_YUVMODE_RAW_YUVRaw YUV data (n/a)
 
[Menu]
MWSFD_SYNCMODE_~
Synchronization mode
 
Description

The following constants indicate video synchronization mode.

DefineRemarks
MWSFD_SYNCMODE_NONENo synchronization
MWSFD_SYNCMODE_VSYNCV-Sync synchronization
MWSFD_SYNCMODE_AUDIOAudio synchronization
MWSFD_SYNCMODE_EXTCLOCKExternal 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.

DefineRemarks
MWSFD_FRMSYNC_TIMEtime synchronization
MWSFD_FRMSYNC_NONEno 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.

DefineRemarks
MWSFD_ZVAL_MINMinimum Z Value (32bit)
MWSFD_ZVAL_MAXMaximum Z Value (32bit)
MWSFD_ZVAL_RANGERange of Z Value
 
[Menu]
MwsfdVideoCodec
Video codec type
 
Description

The following constants indicate video codec type.

DefineRemarks
MWSFD_VIDEOCODEC_UNKNOWNUnknown
MWSFD_VIDEOCODEC_M1VSofdec Video, MPEG-1 Video
MWSFD_VIDEOCODEC_M2VMPEG-2 Video
MWSFD_VIDEOCODEC_M4VMPEG-4 Video
MWSFD_VIDEOCODEC_H264H.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.

MemberTypeRemarks
vhzFloat32frequency of vsync [Hz]
disp_cycleSint32This parameter is no use after MWSFD Ver.3.86.
disp_latencySint32This parameter is no use after MWSFD Ver.3.86.
dec_svrMwsfdDecSvrdecode server
rsvSint32reserved (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.

MemberTypeRemarks
ftypeSint32Type of file to play
max_bpsSint32Maximum 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_widthSint32Maximum width of playback screen image size (unit: pixel)
max_heightSint32Maximum height of playback screen image size (unit: pixel)
nfrm_pool_wkSint32Number 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_stmSint32Maximum number of parallel reading streams included ADX.
workSint8*Pointer to the buffer for use
wksizeSint32Allocated buffer size (unit: bytes)
compo_modeSint32Composition 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.

MemberTypeRemarks
*bufadrUint8Decoder's output buffer address
frmidSint32each frame identifier ID
buffmtMwsfdBufFmtData format of decoder's output buffer
widthSint32number of pixels in horizontal direction
heightSint32number of pixels in vertical direction
x_mbSint32number of macro blocks in horizontal direction
y_mbSint32number of macro blocks in vertical direction
ptypeMwsfdPtypePicture type
fpsSint32frame rate [fps * 1000]
fnoSint32Count of frame
timeSint32Display time
tunitSint32Unit of display time
concat_cntSint32Count of concatenation processing
fno_per_fileSint32Count of frame in the file
time_per_fileSint32Playback time in the file
errcntSint32Count of data error occurrence
rcvcntSint32Count of data error recoveryn
usrdatptrvoid *Pointer to user data in picture layer
usrdatsizeSint32Data size of user data in picture layer
frmtypeMwsfdFrmTypeFrame type
frmcodecMwsfdFrmCodecFrame information of codec specific
yuvmodeMwsfdYuvModeYUV conversion mode
zminUint32Minimum dynamic range for Z movie
zmaxUint32Maximum dynamic range for Z movie
*sud_ptrvoiddata pointer of Sofdec specific
sud_sizeSint32data 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.

MemberTypeRemarks
updateBoolupdate data flag
datasizeSint32size of data [byte]
tunitSint32time unit
intimeSint32start display time. sec = intime / tunit.
durtimeSint32duration of display time. sec = intime / tunit.
 
[Menu]
MwsfdPlyInf
Playback information structure
 
Description

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

MemberTypeRemarks
drop_frm_cntSint32Count of drop frame
skip_dec_cntSint32Count of decode frame skip
skip_disp_cntSint32Count of display frame skip
skip_emptyb_cntSint32Count of skip empty-B picture
no_supply_cntSint32Count of data supply shortage
average_fpsFloat32average frame rate
 
[Menu]
MwsfdHdrInf
File header information
 
Description

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

MemberTypeRemarks
playableBoolFlag of playable movie ( TURE: playable, FALSE: not playable)
ftypeSint32Type of file (MWSFD_FTYPE_~ )
widthSint32Number of pixels in horizontal direction
heightSint32Number of pixels in vertical direction
fpsSint32Frame rate [fps * 1000]
frmnumSint32Number of video frames
fxtypeSint32F/X type
num_video_chSint32Number of video channel
num_audio_chSint32Number of audio channel
a_sfreqSint32Sampling frequency of default audio channel
a_nchSint32Monaural / 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.

MemberTypeRemarks
*y_ptrUint8Y buffer pointer
*cb_ptrUint8Cb buffer pointer
*cr_ptrUint8Cr buffer pointer
y_widthSint32Y buffer width
cb_widthSint32Cb buffer width
cr_widthSint32Cr 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.

MemberTypeRemarks
suppliedSint64Counter of supply data [byte]
consumedSint64Counter of consume data [byte] (including discard data)
discardedSint64Counter of discard data [byte]
 
[Menu]
MwsfdFlowInf
Data flow information structure
 
Description

This is the data flow informatin of each decode unit.

MemberTypeRemarks
systemMwsfdFlowCntData flow counter of system decoder
videoMwsfdFlowCntData flow counter of video decoder (not support yet about discard data)
audioMwsfdFlowCntData flow counter of audio decoder (not support yet about discard data)
adxtinMwsfdFlowCntData 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.

MemberTypeRemarks
videocodecMwsfdVideoCodecVideo codec type
frmm2vMwsfdFrmM2vMPEG-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.

MemberTypeRemarks
ptsSint64PTS 33bit (-1:no PTS info)
picture_structureSint32Picture structure (0:reserved 1:top-field, 2:bottom-f. 3:frame)
chroma_formatSint32Chroma format (0:reserved 1:420 2:422 3:444)
bit_rateSint32Bit rate (18+12=30bit)
vbv_buffer_sizeSint32VBV buffer size (10+8=18bit)
display_horizontal_sizeSint16Display horizontal size 14bit
display_vertical_sizeSint16Display vertical size 14bit
progressive_frameSint80:interlace 1:progressive
top_field_firstSint8Top field first flag
repeat_first_fieldSint8Repeat first field flag
aspect_ratio_informationSint8Aspect ratio information 4bit
constrained_parameters_flagSint8Constrained parameters flag
frame_rate_extension_nSint8Frame rate extension n 2bit
frame_rate_extension_dSint8Frame rate extension d 5bit
profile_and_level_indicationUint8Profile and level indication 8bit
progressive_sequenceSint8Progressive sequence flag
low_delaySint8Low delay flag
video_formatSint8Video format 3bit
colour_descriptionSint8Color description flag 1bit
colour_primariesUint8Color primaries 8bit
transfer_characteristicsUint8Transfer characteristics 8bit
matrix_coefficientsUint8Matrix 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.

DefineRemarks
MWSFD_STAT_STOPStopping
MWSFD_STAT_PREPPreparing
MWSFD_STAT_PLAYINGPlaying
MWSFD_STAT_PLAYENDFinishing playback
MWSFD_STAT_ERRORError
 
[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.

DefineRemarks
MWSFD_SYNCMODE_NONENo 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_VSYNCV-Sync synchronization :
MWSFD lib doesn't synchronize video and audio.Video was synchronized Vsync.
MWSFD_SYNCMODE_AUDIOAudio synchronization :
MWSFD lib synchronize video and audio.
MWSFD_SYNCMODE_EXTCLOCKExternal clock Audio synchronization :
MWSFD lib synchronize callback function of external clock.
 
Remarks

Default mode is the following.

Playing file typeDefault mode
SFD file contained audioMWSFD_SYNCMODE_AUDIO
SFD file (only video)MWSFD_SYNCMODE_VSYNC
M1V fileMWSFD_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.

DefineRemarks
MWSFD_FRMSYNC_TIMEtime 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_NONEno 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)

functiondecode frame skip display frame skipempty-B picture skip
mwPlyGetNumDropFrmyesyesno
mwPlyGetNumSkipDecyesnono
mwPlyGetNumSkipDispnoyesno
mwPlyGetNumSkipEmptyBnonoyes
 
[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.