CRI Middleware Library Reference Manual : ADXPS3

Constants

[Menu]

AdxmFramework
Description

Framework type (PS3 PPU)

Remarks

This is the middleware framework type for PS3 PPU.

ADXM_FRAMEWORK_DEFAULT is the most recommended definition in a certain platform, which can be specified in any platform.

Define | Remarks
--- | ---
ADXM_FRAMEWORK_DEFAULT | same as ADXM_FRAMEWORK_PS3PPU_MULTI_THREAD
ADXM_FRAMEWORK_PS3PPU_SINGLE_THREAD | Single thread (main thread only)
ADXM_FRAMEWORK_PS3PPU_MULTI_THREAD | Multiple thread

[Menu]

ADXM_PS3PPU_PRIO_~
Description

Default priority

Remarks

Default priority value for each middleware thread.

Define | Remarks
--- | ---
ADXM_PS3PPU_PRIO_VV | Virtual Vsync thread(100)
ADXM_PS3PPU_PRIO_VSYNC | Vsync thread(500)
ADXM_PS3PPU_PRIO_FS | File streaming thread(600)
ADXM_PS3PPU_PRIO_MAIN | Main thread(calling ADXM_SetupFramework functions)(1001)
ADXM_PS3PPU_PRIO_IDLE | Idle thread(1500)

[Menu]

ADXM_PS3PPU_STACK_SIZE
Description

Default stack size for thread

Remarks

Default stack size for creating middleware threads.

Macros | Value
--- | ---
ADXM_PS3PPU_STACK_SIZE | 8192

Data Types

[Menu]

AdxmThreadSprm_PS3PPU
Description

Thread setup parameter

Remarks

This is the argument for ADXM_SetupFramework function, to setup parameters for creating middleware threads.

It can be available being specified ADXM_FRAMEWORK_PS3PPU_MULTI_THREAD.

The much lower value means higher priority.

The member of structure are as follows.

Member | Type | Remarks
--- | --- | ---
priority_vv | Sint32 | prioroty for virtual Vsync thread
priority_vsync | Sint32 | prioroty for Vsync thread
priority_fs | Sint32 | prioroty for file streaming thread
priority_main | Sint32 | prioroty for main thread
priority_idle | Sint32 | prioroty for idle thread

[Menu]

Adxps3SoundConfig
Description

Setup paramaters of sound system

Remarks

This is the argument for ADXPS3_SetupSound functions, to setup sound configuration parameters of lower library.

Its work buffer size must be calculated by ADXPS3_CalcSoundWorkSize functions,

and then application has to allocate actual work buffer according to its size.

Specifying NULL pointer to mixer_handle, ADX would not output sound data to surround mixer.

The member of structure are as follows.

Member | Type | Remarks
--- | --- | ---
mixer_handle | CellAANHandle | handle of surround mixer returned by cellSurMixerGetAANHandle functions.
num_output_channels | Sint32 | the number of output channer (max 8), affecting work size and/or decoding load.
num_max_voices | Sint32 | the maximu number of voice, which can be created at the same time, affecting work size and/or decoding load.This is invloving the maximum munber of ADX handle implicitly.
work | Uint8 * | work buffer pointer, to decoding sound data.
work_size | Sint32 | work buffer size, that must be calculated by ADXPS3_CalcSoundWorkSize functions.

[Menu]

Adxps3SprmPs3Fs
Description

setup parameter for PS3 file system

Remarks

This is the argument for ADXPS3_SetupPs3Fs functions, which is used by ADX file system.

Member | Type | Remarks
--- | --- | ---
rtdir | const Char8 * | as root directory from ADX file system.

Functions

[Menu]

ADXM_SetupFramework
Description

Setup CRI middleware framework and start threads

Format
Bool CRIAPI ADXM_SetupFramework(AdxmFramework framework, void *prm);
Input

framework:framework type

prm:parameters

Output

None

Return Value

TRUE:Secceeded, FALSE:Failed

Feature

This function sets framework type and creates required middleware threads.

This function must be called before ADXT_Init function.

The pointer for AdxmThreadSprm_PS3PPU structure can be specified to prm.

NULL pointer means default.

The parameters can be available specified ADXM_FRAMEWORK_PS3PPU_MULTI_THREAD.

Example

    ADXM_SetupFramework(ADXM_FRAMEWORK_DEFAULT, NULL);
         :
    ADXT_Init();
         :
    for (;;) {
        ADXM_WaitVsync();
        ADXM_ExecMain();
           :
    }

[Menu]

ADXM_ShutdownFramework
Description

Finalize CRI middleware framework and stop threads

Format
Bool CRIAPI ADXM_ShutdownFramework(void);
Input

None

Output

None

Return Value

TRUE:Secceeded, FALSE:Failed

Feature

This function invalidate framework type and stop creates middleware threads.

This function must be called after ADXT_Finish function.

Example

    ADXT_Finish();
          :
    ADXM_ShutdownFramework();

[Menu]

ADXPS3_CalcSoundWorkSize
Description

Calculate work size for sound system

Format
Sint32 CRIAPI ADXPS3_CalcSoundWorkSize(const Adxps3SoundConfig *config);
Input

config:Setup paramaters of sound system

Output

None

Return Value

work size (byte)

Feature

This function returns work size for sound system based on Adxps3SoundConfig structure except work_size and work.

Example

    cellSurMixerCreate(&sur_mixer_config);
    cellSurMixerGetAANHandle(&sur_mixer_handle);
            :
    Adxps3SoundConfig config;
    memset(&config, 0, sizeof(config));
    config.mixer_handle        = sur_mixer_handle;
    config.num_output_channels = NUM_OUTPUT_CHANNELS;
    config.num_voices          = NUM_MAX_VOICES;
    config.work_size           = ADXPS3_CalcSoundWorkSize(&config);
    config.work                = malloc(config.work_size);
    ADXPS3_SetupSound(&config);
    cellSurMixerStart();
            :
    ADXT_Init();

[Menu]

ADXPS3_SetupSound
Description

Setup sound system

Format
Bool CRIAPI ADXPS3_SetupSound(const Adxps3SoundConfig *config);
Input

config:Setup paramaters of sound system

Output

None

Return Value

TRUE:Succeeded, FALSE:Failed

Feature

Setup ADX sound system based on Adxps3SoundConfig structure.

This function must be called before ADXT_Init.

Surround mixer must be stopped calling this function.

Example

    cellSurMixerCreate(&sur_mixer_config);
    cellSurMixerGetAANHandle(&sur_mixer_handle);
            :
    Adxps3SoundConfig config;
    memset(&config, 0, sizeof(config));
    config.mixer_handle        = sur_mixer_handle;
    config.num_output_channels = NUM_OUTPUT_CHANNELS;
    config.num_voices          = NUM_MAX_VOICES;
    config.work_size           = ADXPS3_CalcSoundWorkSize(&config);
    config.work                = malloc(config.work_size);
    ADXPS3_SetupSound(&config);
    cellSurMixerStart();
            :
    ADXT_Init();

[Menu]

ADXPS3_ShutdownSound
Description

Shutdown sound system

Format
void CRIAPI ADXPS3_ShutdownSound(void);
Input

None

Output

None

Return Value

None

Feature

Shutdown ADX sound system.

This function must be called after ADXT_Finish.

Example

    ADXT_Finish();
          :
    cellSurMixerPause(CELL_SURMIXER_CONT_PAUSE_ON_IMMEDIATE);
          :
    ADXPS3_ShutdownSound();
          :
    cellSurMixerFinalize();

[Menu]

ADXPS3_SoundNotifyCallback
Description

Nofify callback funciton to input sound data for surround mixer

Format
Sint32 CRIAPI ADXPS3_SoundNotifyCallback(void *arg, Uint32 counter, Uint32 num_samples);
Input

arg: arguments calling cellSurMixerSetNotifyCallback functions

counter:increment counter of every callback

num_samples:samples that should be generated in its callback

Output

None

Return Value

0: Succeeded, 1: Failed (Not implemented now)

Feature

This is the callback function to notify for sound input.

This must be called by the function registerd by cellSurMixerSetNotifyCallback functions.

ADXPS3_SoundNotifyCallback functions can be set, if application would not output to surround mixer at all.

Example

    cellSurMixerCreate(&sur_mixer_config);
    cellSurMixerSetNotifyCallback(ADXPS3_SoundNotifyCallback, NULL);

[Menu]

ADXPS3_SetupPs3Fs
Description

Setup PS3 file system

Format
void CRIAPI ADXPS3_SetupPs3Fs(const Adxps3SprmPs3Fs *sprm);
Input

sprm:setup parameter

Output

None

Return Value

None

Feature

This function set PS3 file system to ADX, and set its root directory.

This function must be called before ADXT_Init functions.

NULL argument means default parameters as follows.

setup parameter | default value
--- | ---
root directory | root directory of PS3 file system

Example

    Adxps3SprmPs3Fs sprm;
    memset(&sprm, 0, sizeof(sprm));
    sprm.rtdir = "/data/adx";
    ADXPS3_SetupPs3Fs(&sprm);
          :
    ADXT_Init();

[Menu]

ADXPS3_ShutdownPs3Fs
Description

Shutdown PS3 file system

Format
void CRIAPI ADXPS3_ShutdownPs3Fs(void);
Input

None

Output

None

Return Value

None

Feature

This function invalidates PS3 file system to ADX.

This function must be called before ADXT_Finish functions.

Example

    ADXT_Finish();
          :
    ADXPS3_ShutdownPs3Fs();

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