MoSync 3.3
IX_STREAMING.h File Reference

Defines

#define EVENT_TYPE_STREAM   15
#define STREAMEVENT_OPEN_COMPLETE   1
 A connection to the streaming server has been established.
#define STREAMEVENT_PREPARE_COMPLETE   2
 After this event, you can retrieve information about the stream.
#define STREAMEVENT_PLAY_COMPLETE   3
 The stream reached its end.
#define STREAMEVENT_LOADING_STARTED   4
 Also known as buffering.
#define STREAMEVENT_LOADING_COMPLETE   5
 After this event, the stream is actually playing.
#define STREAMEVENT_UNKNOWN_EVENT   6

Functions

struct __attribute ((packed, aligned(4))) MAStreamEventData
 Event data associated with an audio stream.
int maSoundPlayConn (MAHandle conn, const char *mimeType)
MAHandle maStreamVideoStart (const char *url)
MAExtent maStreamVideoSize (MAHandle stream)
int maStreamVideoSetFrame (MAHandle stream, const MARect *rect)
int maStreamLength (MAHandle stream)
int maStreamPos (MAHandle stream)
int maStreamSetPos (MAHandle stream, int pos)
int maStreamPause (MAHandle stream)
int maStreamResume (MAHandle stream)
int maStreamClose (MAHandle stream)

Variables

 MAStreamEventData

Define Documentation

#define EVENT_TYPE_STREAM   15

Has MAEvent::data point to a MAStreamEventData.

#define STREAMEVENT_OPEN_COMPLETE   1

A connection to the streaming server has been established.

After this event, you can retrieve information about the stream.

#define STREAMEVENT_PLAY_COMPLETE   3

The stream reached its end.

Also known as buffering.

After this event, the stream is actually playing.

#define STREAMEVENT_UNKNOWN_EVENT   6

Function Documentation

struct __attribute ( (packed, aligned(4))  ) [read]

Event data associated with an audio stream.

One of the STREAMEVENT constants.

The stream associated with the event.

Positive values denote progress. Negative values denote errors. Zero is not used.

int maSoundPlayConn ( MAHandle  conn,
const char *  mimeType 
)

Starts playing sound streamed from the specified connection. The connection is made inaccessible for ordinary operations. Causes STREAM events when the state of the streaming changes. The connection is closed when the sound stops.

Returns:
> 0 on successful start, < 0 on error.
Parameters:
connA readable connection, opened with maConnect() or maHttpCreate(). HTTP connections must be Finished to be readable.
mimeTypeThe MIME type of the sound stream. It can sometimes be retrieved from the HTTP "Content-Type" header.

References maIOCtl().

MAHandle maStreamVideoStart ( const char *  url)

Top-left corner, auto-starts playing. Causes STREAM events. Only one stream is allowed at a time.

Parameters:
urlAn RTSP url.
Returns:
A Stream MAHandle >0, if successful in starting the operation. IOCTL_UNAVAILABLE if the function is unavailable. <= -2 on other errors.

References maIOCtl().

Returns the size, in pixels, of the video stream. <0 if the length cannot be determined.

Will only work after STREAMEVENT_PREPARE_COMPLETE has been received for the stream.

References maIOCtl().

int maStreamVideoSetFrame ( MAHandle  stream,
const MARect rect 
)

Sets the screen rectangle that the video stream should be shown in. The default rectangle is in the top-left corner of the screen, and has the same size as the source video.

Will only work after STREAMEVENT_PREPARE_COMPLETE has been received for the stream.

If the video is playing when you call this function, the picture frame may go black for a second while the system reorders itself.

Whether the video is stretched or clipped to fit in the specified rectangle depends on the combination platform/codec. There should be a list; we don't have one yet. Symbian always stretches. I suspect most Java platforms stretches too, but I'm not sure.

Returns:
IOCTL_UNAVAILABLE if the function is unavailable. <= -2 on other errors.

References maIOCtl().

int maStreamLength ( MAHandle  stream)

Returns the length of the stream, in milliseconds. <0 if the length cannot be determined.

Will only work after STREAMEVENT_PREPARE_COMPLETE has been received for the stream.

References maIOCtl().

int maStreamPos ( MAHandle  stream)

Returns the current playing time position of the stream, in milliseconds. Returns <0 if the position cannot be determined.

Will only work after STREAMEVENT_PREPARE_COMPLETE has been received for the stream.

References maIOCtl().

int maStreamSetPos ( MAHandle  stream,
int  pos 
)

Sets the playing time position in the stream. The provided position is clamped to the length of the stream. For some platform/media combinations, setting the position is not very accurate. The return value will indicate the actual position set.

Will only work after STREAMEVENT_PREPARE_COMPLETE has been received for the stream.

Parameters:
streamA valid stream handle.
posA position, in milliseconds.
Returns:
<0 on error.

References maIOCtl().

int maStreamPause ( MAHandle  stream)

Pauses the stream. Does nothing if the stream is already paused.

References maIOCtl().

int maStreamResume ( MAHandle  stream)

Resumes the stream. Does nothing if the stream is already playing.

References maIOCtl().

int maStreamClose ( MAHandle  stream)

Closes the stream, releasing resources and rendering the handle invalid.

References maIOCtl().


Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines