Functions/APIs
[Media Session]


Functions

alp_status_t alp_media_property_get (int32_t id, AlpMMPropertyType propertyType, int32_t propertyKey, AlpMMPropertyCode properytyCode, void *outValue, int32_t *ioLength)
 Returns the value of an object item property.
alp_status_t alp_media_property_set (int32_t id, int32_t propertyKey, AlpMMPropertyCode propertyCode, void *value, int32_t *length)
 Sets an object item property value.
alp_status_t alp_media_session_add_dest (AlpMMSessionID session, const char *destURL, AlpMMDestID *outDest)
 Adds a data destination to the session.
alp_status_t alp_media_session_add_source (AlpMMSessionID session, AlpMMSourceType type, const void *sourceURL, AlpMMSourceID *outSource)
 Adds a data source to the session.
alp_status_t alp_media_session_control (AlpMMSessionID session, AlpMMSessionControlOpcode sessionCtl)
 Sends control opcodes to the movie server for playback, record, capture, and preview.
alp_status_t alp_media_session_create (AlpMMSessionClassID sessionClass, AlpMMSessionID *outSession)
 create a new session.
alp_status_t alp_media_session_destroy (AlpMMSessionID session)
 Destroy a session created by alp_media_session_created().
alp_status_t alp_media_session_finalize (AlpMMSessionID session)
 Finalize the set of tracks for this session.
alp_status_t alp_media_session_get_state (AlpMMSessionID session, AlpMMSessionState *outState)
 Returns the current state of a session.
alp_status_t alp_media_session_gst_init ()
 Initialize the Gstreamer.
alp_status_t alp_media_session_play_tone (unsigned short amplitude, unsigned short duration, unsigned short freq, const char *streamtype)
 Play tone.
alp_status_t alp_media_session_register_callback (AlpMMSessionID session, AlpMMSessionCallbackFn callback, void *userdata)
 Registers a callback function to monitor this session by handling events.
alp_status_t alp_media_session_register_grab_callback (AlpMMSessionID session, AlpMMSessionGrabCallbackFn callback, void *userdata)
 Registers a callback function to grab a buffer of data.
alp_status_t alp_media_session_remove_all (AlpMMSessionID session)
 Removes from a session all sources, destinations, and the tracks that connect them.
alp_status_t alp_media_session_seek (AlpMMSessionID session, AlpMMSessionSeekOrigin origin, int64_t position)
 Seeks to a different location in the current session.
alp_status_t alp_media_session_seek_full (AlpMMSessionID session, AlpMMSessionSeekOrigin origin, int64_t position, int64_t play_duration, double rate, int is_Accurate)
 Seeks to a new current position and play a duration you want in the current session, also can set new playback rate.
alp_status_t alp_media_session_syssnd_init ()
 Init for play system sound.
alp_status_t alp_media_session_syssnd_play (const char *sound, const char *streamtype, int volume)
 Play system sound defined by Global Setting use system sound method.
alp_status_t alp_media_session_syssnd_play_file (char *filename, const char *streamtype, int volume)
 Play a sound file use system sound method.


Function Documentation

alp_status_t alp_media_property_get int32_t  id,
AlpMMPropertyType  propertyType,
int32_t  propertyKey,
AlpMMPropertyCode  properytyCode,
void *  outValue,
int32_t *  ioLength
 

Returns the value of an object item property.

Parameters:
[in] id A valid object ID.
[in] propertyType the type of information to return.
[in] propertyKey A valid property key.
[in,out] outValue On input, a pointer to a buffer capable of storing the specified type of data. On output, a pointer to the value, if it was found and enough storage space was provided.
[in] propertyCode the expected type of data.
[in,out] ioLength On input, if propertyCode specifies a variable-length value with no delimiter (ALP_MM_PROPERTY_CODE_RAW), then this is a pointer to the size of the outValue buffer in bytes; otherwise this is may be NULL. On output, a pointer to the actual size of the value.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_ERR_PARAM The ID is 0 or the outValue pointer is NULL.

ALP_STATUS_MM_PROPERTY_KEY_INVALID The specified property key is invalid.

ALP_STATUS_MM_NO_ENOUGH_SPACE The outValue buffer was filled to capacity with a partial value and ioLength is set to indicate the required capacity.

Remarks:
See also:
alp_media_property_set.

alp_status_t alp_media_property_set int32_t  id,
int32_t  propertyKey,
AlpMMPropertyCode  propertyCode,
void *  value,
int32_t *  length
 

Sets an object item property value.

Parameters:
[in] id A valid object ID.
[in] propertyKey A valid property key.
[in] propertyCode the expected type of data.
[in] value A pointer to the value to set for the property.
[in] if propertyCode specifies a variable-length value with no delimiter(ALP_MM_PROPERTY_CODE_RAW), then this indicates the size of the value in bytes, otherwise, length is ignored and should be set to 0.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_ERR_PARAM The ID is 0 or the value pointer is NULL.

ALP_STATUS_MM_PROPERTY_IS_READONLY Set a read only property.

ALP_STATUS_MM_PROPERTY_KEY_OBJ_UNMATCH The specified property key does not match the object's properties.

ALP_STATUS_MM_PROPERTY_KEY_INVALID The specified property key is invalid.

ALP_STATUS_MM_PROPERTY_KEY_INVALID The specified property key is invalid.

Remarks:
See also:
alp_media_property_get.

alp_status_t alp_media_session_add_dest AlpMMSessionID  session,
const char *  destURL,
AlpMMDestID outDest
 

Adds a data destination to the session.

Parameters:
[in] session A valid multimedia session ID.
[in] destURL Pointer to a URL of the destination to add to the session.
[out] outDest Pointer to the multimedia destination ID, if the function succeeds.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_INVALID_DEST_URL The URL in destURL is invalid.

ALP_STATUS_MM_OBJECT_EXIST The dest URL is already exist.

ALP_STATUS_MM_ERR_PARAM The pointer destURL or outDest is NULL, or the sessionID is 0.

Remarks:
See also:
alp_media_session_create, alp_media_session_add_source

alp_status_t alp_media_session_add_source AlpMMSessionID  session,
AlpMMSourceType  type,
const void *  sourceURL,
AlpMMSourceID outSource
 

Adds a data source to the session.

Parameters:
[in] session A valid multimedia session ID.
[in] type specified the type of source.
[in] sourceURL Pointer to a URL of the data source to add to the session.
[out] outSource Pointer to the multimedia source ID, if the function succeeds.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_INVALID_SOURCE_TYPE Can't support the source type.

ALP_STATUS_MM_ERR_PARAM The pointer sourceURL or outSource is NULL, or the sessionID is 0.

ALP_STATUS_MM_ERR_UNSUPPORTED Not supported source type.

Remarks:
See also:
alp_media_session_create, alp_media_session_add_dest

alp_status_t alp_media_session_control AlpMMSessionID  session,
AlpMMSessionControlOpcode  sessionCtl
 

Sends control opcodes to the movie server for playback, record, capture, and preview.

Parameters:
[in] session A valid multimedia session ID.
[in] sessionCtl The opcode. Specify one of the constants listed in AlpMMSessionControlOpcode.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The sessionID is 0.

ALP_STATUS_MM_ERR_MISS_OBJECT No tracks can be start because missing source or destination.

ALP_STATUS_MM_NOT_ALLOWED Operation not allowed for this session.

Remarks:
See also:
alp_media_session_create, alp_media_session_seek, alp_media_session_seek_full.

alp_status_t alp_media_session_create AlpMMSessionClassID  sessionClass,
AlpMMSessionID outSession
 

create a new session.

Parameters:
[in] sessionClass A valid multimedia session class ID. Specify one the constants listed in _AlpMMSessionClassID.
[out] outSession A valid multimedia session ID, if the function succeeds. On input, this must be 0.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_ERR_PARAM The outSession parameter is a NULL pointer.

ALP_STATUS_MM_ERR_NO_RESOURCE The session class is invalid.

Remarks:
See also:
_AlpMMSessionClassID, alp_media_session_finalize.

alp_status_t alp_media_session_destroy AlpMMSessionID  session  ) 
 

Destroy a session created by alp_media_session_created().

Parameters:
[in] session A valid multimedia session ID.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

Remarks:
This function destroy all allocated resources.
See also:

alp_status_t alp_media_session_finalize AlpMMSessionID  session  ) 
 

Finalize the set of tracks for this session.

Parameters:
[in] session A valid multimedia session ID.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

ALP_STATUS_SYS_ERR_MISS_OBJECT No tracks can be start because missing source or destination.

Remarks:
Calling this function is the final step in preparing a session to run, after this call succeeds, the session enters the ALP_MM_SESSION_READY state and you may call alp_media_property_get() to get property value, alp_media_property_set()to set property value, or alp_media_session_control() to begin playback or capture.After this function is called, the following functions may not be called for the session:alp_media_session_add_source, alp_media_session_add_dest
See also:
alp_media_session_create.

alp_status_t alp_media_session_get_state AlpMMSessionID  session,
AlpMMSessionState outState
 

Returns the current state of a session.

Parameters:
[in] session A valid multimedia session ID.
[out] outState The current state of the session. One of the constants listed in AlpMMSessionState.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

Remarks:
See also:
AlpMMSessionState.

alp_status_t alp_media_session_gst_init  ) 
 

Initialize the Gstreamer.

Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_NO_ENOUGH_MEMORY There is no enough memory.

ALP_STATUS_MM_ERR_NO_RESOURCE Gstreamer init failed.

Remarks:
Call this function first will reduce the time used by alp_media_session_create/alp_media_session_syssnd_init.
See also:
.

alp_status_t alp_media_session_play_tone unsigned short  amplitude,
unsigned short  duration,
unsigned short  freq,
const char *  streamtype
 

Play tone.

Parameters:
[in] amplitude It is the tone's amplitude in the range [0, 100]. If the amplitude is 0, the sound isn't played and the function returns immediately.
[in] duration It is the tone's duration[80, 2000] in milliseconds.
[in] freq It is the tone's frequency[21, 19912] in Hertz.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_NO_ENOUGH_MEMORY There is no enough memory.

ALP_STATUS_MM_ERR_NO_RESOURCE Gstreamer init failed.

Remarks:
See also:
alp_media_session_syssnd_init.

alp_status_t alp_media_session_register_callback AlpMMSessionID  session,
AlpMMSessionCallbackFn  callback,
void *  userdata
 

Registers a callback function to monitor this session by handling events.

Parameters:
[in] session A valid multimedia session ID.
[in] callback Pointer to the callback function.
[in] userdata Pointer to arbitrary user-provided data, or NULL. This pointer is passed to the callback function.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0 or the callback function is NULL.

ALP_STATUS_MM_NOT_ALLOWED There are too many callbacks registered for this session.

Remarks:
You can only register one callback function for one session.
See also:
AlpMMSessionCallbackFn.

alp_status_t alp_media_session_register_grab_callback AlpMMSessionID  session,
AlpMMSessionGrabCallbackFn  callback,
void *  userdata
 

Registers a callback function to grab a buffer of data.

Parameters:
[in] session A valid multimedia session ID.
[in] callback Pointer to the callback function.
[in] userdata Pointer to arbitrary user-provided data, or NULL. This pointer is passed to the callback function.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0 or the callback function is NULL.

ALP_STATUS_MM_NOT_ALLOWED There are too many callbacks registered for this session.

Remarks:
You can only register one callback function for one session.
See also:
AlpMMSessionCallbackFn.

alp_status_t alp_media_session_remove_all AlpMMSessionID  session  ) 
 

Removes from a session all sources, destinations, and the tracks that connect them.

Parameters:
[in] session A valid multimedia session ID.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

Remarks:
This function resets the session state to ALP_MM_SESSION_NOT_INITIALIZED. Non-content properties remain unchanged.
See also:

alp_status_t alp_media_session_seek AlpMMSessionID  session,
AlpMMSessionSeekOrigin  origin,
int64_t  position
 

Seeks to a different location in the current session.

Parameters:
[in] session A valid multimedia session ID.
[in] origin Point to seek from, the seek location is measured from this point.Specify one of the constants listed in _AlpMMSessionSeekOrigin.
[in] position The distance to seek, in nanoseconds. A positive value means to seek forward and a negative value means to seek backward.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

ALP_STATUS_MM_OUT_OF_RANGE Position is out of range.

ALP_STATUS_MM_ERR_UNSUPPORTED Seeking is not supported in this session, some streaming types don't support seeking, or it is a capture session.

Remarks:
This function skips forward or backward in the media. After a successful seek operation, the session is stopped(it enters the ALP_MM_SESSION_READY state), whether or not it was playing previous to the call.
See also:
alp_media_session_seek_full alp_media_session_control, AlpMMSessionSeekOrigin, _AlpMMSessionSeekOrigin.

alp_status_t alp_media_session_seek_full AlpMMSessionID  session,
AlpMMSessionSeekOrigin  origin,
int64_t  position,
int64_t  play_duration,
double  rate,
int  is_Accurate
 

Seeks to a new current position and play a duration you want in the current session, also can set new playback rate.

Parameters:
[in] session A valid multimedia session ID.
[in] origin point to seek from, the new current position for seeking is relative to this point. Specify one of the constants listed in _AlpMMSessionSeekOrigin.
[in] position The value of the new current position, in nanoseconds.
[in] play_duration The value of the duration you want to play, in nanoseconds.
[in] rate The new playback rate.
[in] is_Accurate 0 or 1 to tell if you want to do seek accuratelly or not.
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_SESSION_ID_INVALID The sessionID is invalid.

ALP_STATUS_MM_ERR_PARAM The session ID is 0.

ALP_STATUS_MM_OUT_OF_RANGE Position is out of range.

ALP_STATUS_MM_ERR_UNSUPPORTED Seeking is not supported in this session, some streaming types don't support seeking, or it is a capture session.

Remarks:
This function skips forward or backward in the media. After a successful seek operation, the session is stopped(it enters the ALP_MM_SESSION_READY state), whether or not it was playing previous to the call.
See also:
alp_media_session_seek alp_media_session_control, AlpMMSessionSeekOrigin, _AlpMMSessionSeekOrigin.

alp_status_t alp_media_session_syssnd_init  ) 
 

Init for play system sound.

Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_NO_ENOUGH_MEMORY There is no enough memory.

ALP_STATUS_MM_ERR_NO_RESOURCE Gstreamer init failed.

Remarks:
See also:
prv_media_playback_syssnd_play.

alp_status_t alp_media_session_syssnd_play const char *  sound,
const char *  streamtype,
int  volume
 

Play system sound defined by Global Setting use system sound method.

Parameters:
[in] sound Use the constant which define in media_defs.h, such as ALP_SYS_SOUND_SOFTKEY_CLICK.
[in] streamtype The system sound stream type defined by audio manage.
[in] volume The volume level[0-7].
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_ERR_UNSUPPORTED The sound file format can't be supported.

Remarks:
See also:
alp_media_session_syssnd_init.

alp_status_t alp_media_session_syssnd_play_file char *  filename,
const char *  streamtype,
int  volume
 

Play a sound file use system sound method.

Parameters:
[in] filename Path of the file which you want to play.
[in] streamtype The system sound stream type defined by audio manage.
[in] volume The volume level[0-7].
Returns:
ALP_STATUS_OK No error.

ALP_STATUS_MM_ERR_UNSUPPORTED The sound file format can't be supported.

Remarks:
See also:
alp_media_session_syssnd_init.


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.