About MO_MEDIUM_CONTROL

The MO_MEDIUM_CONTROL structure is a set of functions to access a specific medium type.
It is used to offer a plugin like interface so that an application can use its own medium control.
Potential usages are : http streaming, another implementation of DVD or CNT reading etc...


Open

C Specification

#include <mo/Mobiclip.h>

MO_MEDIUM_COOKIE *(*Open)(const void *movie);

Arguments

movie Filename or pointer to the structure describing the movie to open. The structure is medium dependant.

Return Values

MO_MEDIUM_COOKIE, opaque pointer describing the opened stream. NULL if opening failed.

Description

That function is used to ask the medium control block to open a movie.



GetStatus

C Specification

#include <mo/Mobiclip.h>

MO_MEDIUM_STATE (*GetStatus)(MO_MEDIUM_COOKIE* cookie);

Arguments

cookie Instance of stream.

Return Values

MO_MEDIUM_STATE, state of that given stream.

Description

That function returns the current state of a stream. For local medium such as DVD and CNT, it is safe to always return READY.



Close

C Specification

#include <mo/Mobiclip.h>

void (*Close)(MO_MEDIUM_COOKIE* cookie);

Arguments

cookie Instance of stream.

Return Values

None.

Description

That function closes an opened stream.



GetSize

C Specification

#include <mo/Mobiclip.h>

s32 (*GetSize)(MO_MEDIUM_COOKIE* cookie);

Arguments

cookie Instance of stream.

Return Values

Size of the movie in bytes, 0 if unknown

Description

That function returns the size of the movie in bytes or 0 if it cannot be obtained.



Tell

C Specification

#include <mo/Mobiclip.h>

s32 (*Tell)(MO_MEDIUM_COOKIE* cookie);

Arguments

cookie Instance of stream.

Return Values

Current position in bytes into the stream

Description

That function returns the current position in bytes into the stream.



Seek

C Specification

#include <mo/Mobiclip.h>

MOResult (*Seek)(MO_MEDIUM_COOKIE* cookie,u32 position);

Arguments

cookie Instance of stream.
position Absolute position to seek to.

Return Values

MOResult

Description

That function requests a seek to the position given as parameter.
If the return value is MO_RESULT_FATAL, it means the seek request has been rejected.
If the return value is MO_RESULT_OK, it means the seek request has been accepted. It does not mean that the seek is complete!.
The user has to call GetStatus until it reaches the READY or ERROR states.



Read

C Specification

#include <mo/Mobiclip.h>

s32 (*Read)(MO_MEDIUM_COOKIE* cookie,u8* buffer,u32 size);

Arguments

cookie Instance of stream.
buffer Buffer to put data to.
size Number of bytes to read.

Return Values

s32

Description

That function requests to read a given number of bytes into a buffer.
The return value is the number of bytes actually read.
The return value can be :



Revision History

07/29/2008 Initial version.