*
*/
-
#ifndef __MM_H__
#define __MM_H__
* @author
* @version 1.0
* @brief This file includes all the necessary header files of multimediaframework.
-
+
@mainpage Multimedia Framework
@par
@addtogroup COMMON
@{
- * @file mm_attrs.h
- * @version 1.0
- * @brief This file declares data structures and functions of attribute library.
+ * @file mm_attrs.h
+ * @version 1.0
+ * @brief This file declares data structures and functions of attribute library.
@par
This part describes the APIs with respect to Multimedia Attribute Library.
/**
* Enumeration for attribute values types.
*/
-typedef enum{
+typedef enum {
MM_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
MM_ATTRS_TYPE_INT, /**< Integer type attribute */
MM_ATTRS_TYPE_DOUBLE, /**< Double type attribute */
MM_ATTRS_TYPE_STRING, /**< UTF-8 String type attribute */
MM_ATTRS_TYPE_DATA, /**< Pointer type attribute */
MM_ATTRS_TYPE_NUM, /**< Number of attribute type */
-}MMAttrsType;
+} MMAttrsType;
/**
* Enumeration for attribute validation type.
/**
* This function is to set the integer value to the attribute by name.
* @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
- * @param val [in] integer value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @param attr_name [in] attribute name
+ * @param val [in] integer value to set
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
int mm_attrs_set_int_by_name(MMHandleType attrs, const char *attr_name, int val);
* @param attrs [in] Handle of attributes list
* @param attr_name [in] Name of attribute
* @param val [out] Value of attribute
- * @return This function returns attribute value
+ * @return This function returns attribute value
*/
int mm_attrs_get_int_by_name(MMHandleType attrs, const char *attr_name, int *val);
/**
* This function is to set the string to attribute by name.
* @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
+ * @param attr_name [in] attribute name
* @param string [in] string value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
int mm_attrs_set_string_by_name(MMHandleType attrs, const char *attr_name, const char *string);
/**
* This function is to set the data to the attribute by name.
* @param attrs [in] MMAttrs handle
- * @param attr_name [in] attribute name
+ * @param attr_name [in] attribute name
* @param data [in] data pointer to set
* @param size [in] data size to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
int mm_attrs_set_data_by_name(MMHandleType attrs, const char *attr_name, void *data, int size);
/**
* This function is to get the data from the attribute by name.
- * @param attrs [in] Handle of attributes list
+ * @param attrs [in] Handle of attributes list
* @param attr_name [in] Name of attribute
- * @param data [out] data pointer to set
+ * @param data [out] data pointer to set
* @return This function returns user defined value on success, or NULL
* on failure
*/
/**
* This function is to retrieve type of attribute.
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param attrtype [out] On return contains type of attribute
* @return This function returns MM_ERROR_NONE.
* @see MMAttrsType
/**
* This function is to get flags of attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
- * @param flags [out] On return contains flags of attribute.
+ * @param flags [out] On return contains flags of attribute.
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @see MMAttrsFlag
*/
/**
* This function is to get valid value type of attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
- * @param type [out] On return contains valid value type of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @param type [out] On return contains valid value type of attribute
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @see MMAttrsType
*/
int mm_attrs_get_valid_type(MMHandleType attrs, int id, int *type);
/**
* This function is to get valid range of attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
* @param min [out] minimum value of the valid range.
* @param max [out] maximum value of the valid range.
/**
* This function is to get valid array of attribute with given id.
- * @param attrs [in] list of attributes
+ * @param attrs [in] list of attributes
* @param id [in] ID of attribute
- * @param count [out] number of array
- * @param array [out] on return contains valid array of attribute
+ * @param count [out] number of array
+ * @param array [out] on return contains valid array of attribute
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
int mm_attrs_get_valid_array(MMHandleType attrs, int id, int *count, int **array);
/**
* This function is to get valid double type range of attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
* @param min [out] minimum value of the valid range.
* @param max [out] maximum value of the valid range.
/**
* This function is to get valid double type array of attribute with given id.
- * @param attrs [in] list of attributes
+ * @param attrs [in] list of attributes
* @param id [in] ID of attribute
- * @param count [out] number of array
- * @param array [out] on return contains valid array of attribute
+ * @param count [out] number of array
+ * @param array [out] on return contains valid array of attribute
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
int mm_attrs_get_valid_double_array(MMHandleType h, int idx, int *count, double **array);
/**
* This function is to set integer value to attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
* @param val [in] integer value to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @see mm_attrs_get_int
*/
int mm_attrs_set_int(MMHandleType attrs, int id, int val);
/**
* This function is to get integer value to attribute with given id.
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
* @param val [out] On return contains integer value of attribute
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks If type of attributes is not an integer type, the value which is returned by this function is meaningless.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @remarks If type of attributes is not an integer type, the value which is returned by this function is meaningless.
* @see mm_attrs_get_int
*/
int mm_attrs_get_int(MMHandleType attrs, int id, int *val);
/**
* This function is to set double value to attribute with given id.
*
- * @param attrs [in] List of attributes
+ * @param attrs [in] List of attributes
* @param id [in] ID of attribute
* @param val [in] Integer value to set
*
*
* @param attrs [in] Handle of attributes list
* @param attr_name [in] Name of attribute
- * @param val [in] Integer value to set
+ * @param val [in] Integer value to set
*
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
*/
* This function is to get double value to attribute with given id.
*
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param attrval [out] On return contains double value of attribute on success, or invalid value.
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @see mm_attrs_set_double
*
* @param attrs [in] Handle of attributes list
* @param attr_name [in] Name of attribute
- * @param val [out] Double value to set
+ * @param val [out] Double value to set
*
- * @return This function returns attribute value
+ * @return This function returns attribute value
*/
int mm_attrs_get_double_by_name(MMHandleType attrs, const char *attr_name, double *val);
/**
* This function is to set string to attribute with given id.
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param string [in] String to set
* @param size [in] length of string to set
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @see mm_attrs_get_string
*/
int mm_attrs_set_string(MMHandleType attrs, int id, const char *string, int size);
/**
* This function is to get string to attribute with given id.
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param sval [in] Placeholder to output string buffer
* @param size [in] The field contains number of characters filled in the buffer
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Application would be responsible for managing/releasing the string
- * @see mm_attrs_set_string
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @remarks Application would be responsible for managing/releasing the string
+ * @see mm_attrs_set_string
*/
int mm_attrs_get_string(MMHandleType attrs, int id, char **sval, int *size);
/**
* This function is to set pointer to attribute with given id.
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param data [in] data to set
* @param size [in] Length of input data
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
- * @remarks Data type is the reference to memory which is allocated by user. The allocated memory must be freed by user.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @remarks Data type is the reference to memory which is allocated by user. The allocated memory must be freed by user.
* @see mm_attrs_get_data
*/
int mm_attrs_set_data(MMHandleType attrs, int id, void *data, int size);
/**
* This function is to get pointer to attribute with given id.
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param data [out] Placeholder to output data buffer
* @param size [out] The field contains number of bytes filled in the buffer
- * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
+ * @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @remarks Application would be responsible for managing/releasing data
* @see mm_attrs_set_data
*/
* A function to get information of the attribute
*
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param array [out] Contains the array of attribute on success,
* or NULL pointer on failure.
* @param count [out] Count of array
* This function is to get array of attribute with given id.
*
* @param attrs [in] List of attributes
- * @param id [in] ID of attribute
+ * @param id [in] ID of attribute
* @param array [out] Contains the array of attribute on success,
* or NULL pointer on failure.
* @param count [out] Count of array
/**
* Sets properties on an object.
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
+ * @param attrs [in] List of attributes
+ * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
+ * @param attribute_name [in] name of the first property to set
* @param ... [in] value for the first property, followed optionally by more
* name/value pairs, followed by %NULL
*
/**
* Gets properties on an object.
- * @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
+ * @param attrs [in] List of attributes
+ * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
+ * @param attribute_name [in] name of the first property to set
* @param ... [in] value for the first property, followed optionally by more
* name/value pairs, followed by %NULL
*
* Sets properties on an object with va_list param.
* @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
+ * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
+ * @param attribute_name [in] name of the first property to set
* @param var_args [in] variable arguments
*
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @remarks Multiple setter of attribute
* @see mm_attrs_multiple_set
*/
-int mm_attrs_set_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
+int mm_attrs_set_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
/**
* Gets properties on an object with va_list param.
* @param attrs [in] List of attributes
- * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
- * @param attribute_name [in] name of the first property to set
+ * @param err_attr_name [out] the name of attributes that occurs error. Free this variable after use.
+ * @param attribute_name [in] name of the first property to set
* @param var_args [in] variable arguments
*
* @return This function returns MM_ERROR_NONE on success, or negative value with error code.
* @remarks Multiple setter of attribute
* @see mm_attrs_multiple_get
*/
-int mm_attrs_get_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
+int mm_attrs_get_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
/**
* @}
enum mmf_value_type {
MMF_VALUE_TYPE_INT = MM_ATTRS_TYPE_INT,
- MMF_VALUE_TYPE_DOUBLE=MM_ATTRS_TYPE_DOUBLE,
+ MMF_VALUE_TYPE_DOUBLE = MM_ATTRS_TYPE_DOUBLE,
MMF_VALUE_TYPE_STRING = MM_ATTRS_TYPE_STRING,
MMF_VALUE_TYPE_DATA = MM_ATTRS_TYPE_DATA,
};
typedef struct mmf_attribute_construct_info mmf_attrs_construct_info_t;
typedef bool (*mmf_attrs_commit_func_t)(int attr_idx,
- const char* attr_name,
- const mmf_value_t *value,
- void *commit_param);
+ const char* attr_name,
+ const mmf_value_t *value,
+ void *commit_param);
struct mmf_value {
int type;
MMHandleType mmf_attrs_new(int count);
MMHandleType mmf_attrs_new_from_data(const char *name,
- mmf_attrs_construct_info_t *info,
- int count,
- mmf_attrs_commit_func_t commit_func,
- void *commit_param);
+ mmf_attrs_construct_info_t *info,
+ int count,
+ mmf_attrs_commit_func_t commit_func,
+ void *commit_param);
void mmf_attrs_free(MMHandleType attrs);
#define debug_warning(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_WARN, fmt, ##arg)
#define debug_error(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_ERROR, fmt, ##arg)
#define debug_critical(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_FATAL, fmt, ##arg)
-#define debug_profile(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG,"<TIMER> " fmt, ##arg)
+#define debug_profile(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<TIMER> " fmt, ##arg)
#define debug_fenter() mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<ENTER> \n")
#define debug_fleave() mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<LEAVE> \n")
-#define debug_enter(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG,"<ENTER> [<---] " fmt, ##arg)
-#define debug_leave(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG,"<LEAVE> [--->] " fmt, ##arg)
+#define debug_enter(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<ENTER> [<---] " fmt, ##arg)
+#define debug_leave(fmt, arg...) mm_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<LEAVE> [--->] " fmt, ##arg)
#define secure_debug_verbose(fmt, arg...) mm_secure_log_by_owner(MMF_LOG_OWNER, LOG_VERBOSE, fmt, ##arg)
#define secure_debug_log(fmt, arg...) mm_secure_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, fmt, ##arg)
#define secure_debug_profile(fmt, arg...) mm_secure_log_by_owner(MMF_LOG_OWNER, LOG_DEBUG, "<TIMER> " fmt, ##arg)
#define return_if_fail(expr) \
- if(!(expr)) { \
+ if (!(expr)) { \
debug_warning("failed [%s]\n", #expr); \
return; \
}
}
#endif
-#endif /* __MMF_DEBUG_H__ */
\ No newline at end of file
+#endif /* __MMF_DEBUG_H__ */
*/
enum MMMessageType {
/* COMMON */
- MM_MESSAGE_UNKNOWN = 0x00, /**< Unknown message type */
- MM_MESSAGE_ERROR, /**< Error message type */
- MM_MESSAGE_WARNING, /**< Warning message type */
- MM_MESSAGE_STATE_CHANGED, /**< State change message type */
- MM_MESSAGE_STATE_INTERRUPTED, /**< State change by interrupt */
- MM_MESSAGE_READY_TO_RESUME, /**< Ready to resume message type */
+ MM_MESSAGE_UNKNOWN = 0x00, /**< Unknown message type */
+ MM_MESSAGE_ERROR, /**< Error message type */
+ MM_MESSAGE_WARNING, /**< Warning message type */
+ MM_MESSAGE_STATE_CHANGED, /**< State change message type */
+ MM_MESSAGE_STATE_INTERRUPTED, /**< State change by interrupt */
+ MM_MESSAGE_READY_TO_RESUME, /**< Ready to resume message type */
/* PLAYER */
MM_MESSAGE_CONNECTING = 0x100, /**< Connecting message type */
/* CAMCORDER */
MM_MESSAGE_CAMCORDER_STATE_CHANGED = 0x200, /**< State changed.*/
- MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM, /**< State change by audio session manager message type */
+ MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM, /**< State change by audio session manager message type */
MM_MESSAGE_CAMCORDER_MAX_SIZE, /**< Maximum size, camcorder waits for user's order (cam_commit/cancel).*/
MM_MESSAGE_CAMCORDER_NO_FREE_SPACE, /**< No free space, camcorder waits for user's order (cam_commit/cancel).*/
MM_MESSAGE_CAMCORDER_TIME_LIMIT, /**< Time limit, camcorder waits for user's order (cam_commit/cancel)*/
MM_MESSAGE_FILEINFO_RESERVED = 0x700, /**< Reserved message for File Info */
/* STREAM RECORDER */
- MM_MESSAGE_STREAMRECORDER_ERROR = 0x800,
+ MM_MESSAGE_STREAMRECORDER_ERROR = 0x800,
MM_MESSAGE_STREAMRECORDER_CONSUME_COMPLETE,
MM_MESSAGE_STREAMRECORDER_STATE_CHANGED,
MM_MESSAGE_STREAMRECORDER_MAX_SIZE, /**< Maximum size, streamcorder waits for user's order (commit/cancel) */
/**
* union.
*/
- int union_type; /**< Type of union. Please refer MMMessageUnionType */
+ int union_type; /**< Type of union. Please refer MMMessageUnionType */
union {
int code; /**< Error or warning code */
unsigned long long total; /**< Total time */
unsigned long long filesize; /**< Recording File size (KB). An approximate value. */
unsigned long long remained_time; /**< Remained time (ms).
- This is available if time limit is not set or
- time limit is bigger than estimated remained time. */
+ This is available if time limit is not set or
+ time limit is bigger than estimated remained time. */
} recording_status;
/**
* Video frame capture
*/
struct {
- unsigned int width; /* width of captured image */
+ unsigned int width; /* width of captured image */
unsigned int height; /* height of captured image */
unsigned int orientation; /* orientation of captured image */
} captured_frame;
*/
/**
- @addtogroup COMMON
- @{
+ @addtogroup COMMON
+ @{
*/
#ifndef __MM_TYPES_H__
MM_AUDIO_CODEC_G729, /**< G729 codec */
MM_AUDIO_CODEC_G729A, /**< G729a codec */
MM_AUDIO_CODEC_G729_1, /**< G729.1 codec */
- MM_AUDIO_CODEC_REAL, /**< Real audio */
+ MM_AUDIO_CODEC_REAL, /**< Real audio */
MM_AUDIO_CODEC_AAC_LC, /**< AAC-Low complexity codec */
MM_AUDIO_CODEC_AAC_MAIN, /**< AAC-Main profile codec */
MM_AUDIO_CODEC_AAC_SRS, /**< AAC-Scalable sample rate codec */
* Enumerations of file container format.
*/
enum MMFileFormatType {
- MM_FILE_FORMAT_INVALID = -1,/**< Invalid file format */
- MM_FILE_FORMAT_3GP, /**< 3GP file format */
- MM_FILE_FORMAT_ASF, /**< Advanced Systems File file format */
- MM_FILE_FORMAT_AVI, /**< Audio Video Interleaved file format */
- MM_FILE_FORMAT_MATROSKA, /**< MATROSAK file format */
- MM_FILE_FORMAT_MP4, /**< MP4 file format */
- MM_FILE_FORMAT_OGG, /**< OGG file format */
- MM_FILE_FORMAT_NUT, /**< NUT file format */
- MM_FILE_FORMAT_QT, /**< MOV file format */
- MM_FILE_FORMAT_REAL, /**< RealMedia file format */
- MM_FILE_FORMAT_AMR, /**< AMR file format */
- MM_FILE_FORMAT_AAC, /**< AAC file format */
- MM_FILE_FORMAT_MP3, /**< MP3 file format */
- MM_FILE_FORMAT_AIFF, /**< AIFF file format */
- MM_FILE_FORMAT_AU, /**< Audio file format */
- MM_FILE_FORMAT_WAV, /**< WAV file format */
- MM_FILE_FORMAT_MID, /**< MID file format */
- MM_FILE_FORMAT_MMF, /**< MMF file format */
- MM_FILE_FORMAT_DIVX, /**< DivX file format */
- MM_FILE_FORMAT_FLV, /**< Flash video file format */
- MM_FILE_FORMAT_VOB, /**< DVD-Video Object file format */
- MM_FILE_FORMAT_IMELODY, /**< IMelody file format */
- MM_FILE_FORMAT_WMA, /**< WMA file format */
- MM_FILE_FORMAT_WMV, /**< WMV file format */
- MM_FILE_FORMAT_JPG, /**< JPEG file format */
- MM_FILE_FORMAT_FLAC, /**< FLAC file format */
- MM_FILE_FORMAT_M2TS, /**< MPEG2-Transport Stream file format */
- MM_FILE_FORMAT_M2PS, /**< MPEG2-Program Stream file format */
- MM_FILE_FORMAT_M1VIDEO, /**< MPEG1-Video file format */
- MM_FILE_FORMAT_M1AUDIO, /**< MPEG1-Audio file format */
- MM_FILE_FORMAT_NUM, /**< Number of file format type */
+ MM_FILE_FORMAT_INVALID = -1, /**< Invalid file format */
+ MM_FILE_FORMAT_3GP, /**< 3GP file format */
+ MM_FILE_FORMAT_ASF, /**< Advanced Systems File file format */
+ MM_FILE_FORMAT_AVI, /**< Audio Video Interleaved file format */
+ MM_FILE_FORMAT_MATROSKA, /**< MATROSAK file format */
+ MM_FILE_FORMAT_MP4, /**< MP4 file format */
+ MM_FILE_FORMAT_OGG, /**< OGG file format */
+ MM_FILE_FORMAT_NUT, /**< NUT file format */
+ MM_FILE_FORMAT_QT, /**< MOV file format */
+ MM_FILE_FORMAT_REAL, /**< RealMedia file format */
+ MM_FILE_FORMAT_AMR, /**< AMR file format */
+ MM_FILE_FORMAT_AAC, /**< AAC file format */
+ MM_FILE_FORMAT_MP3, /**< MP3 file format */
+ MM_FILE_FORMAT_AIFF, /**< AIFF file format */
+ MM_FILE_FORMAT_AU, /**< Audio file format */
+ MM_FILE_FORMAT_WAV, /**< WAV file format */
+ MM_FILE_FORMAT_MID, /**< MID file format */
+ MM_FILE_FORMAT_MMF, /**< MMF file format */
+ MM_FILE_FORMAT_DIVX, /**< DivX file format */
+ MM_FILE_FORMAT_FLV, /**< Flash video file format */
+ MM_FILE_FORMAT_VOB, /**< DVD-Video Object file format */
+ MM_FILE_FORMAT_IMELODY, /**< IMelody file format */
+ MM_FILE_FORMAT_WMA, /**< WMA file format */
+ MM_FILE_FORMAT_WMV, /**< WMV file format */
+ MM_FILE_FORMAT_JPG, /**< JPEG file format */
+ MM_FILE_FORMAT_FLAC, /**< FLAC file format */
+ MM_FILE_FORMAT_M2TS, /**< MPEG2-Transport Stream file format */
+ MM_FILE_FORMAT_M2PS, /**< MPEG2-Program Stream file format */
+ MM_FILE_FORMAT_M1VIDEO, /**< MPEG1-Video file format */
+ MM_FILE_FORMAT_M1AUDIO, /**< MPEG1-Audio file format */
+ MM_FILE_FORMAT_NUM, /**< Number of file format type */
};
/**
MM_DISPLAY_METHOD_ORIGIN_OR_LETTER,
MM_DISPLAY_METHOD_CUSTOM_ROI,
MM_DISPLAY_METHOD_NUM
-}MMDisplayGeometryMethod;
+} MMDisplayGeometryMethod;
/*
* Enumerations of ROI mode of display geometry method
typedef enum {
MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN = 0,
MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
-}MMDisplayGeometryMethodRoiMode;
+} MMDisplayGeometryMethodRoiMode;
#define MM_VIDEO_BUFFER_PLANE_MAX 4 /**< Max num of video buffer plane */
*/
typedef struct {
MMVideoBufferType type; /**< buffer type
- - The field of handle that type indicates should be filled,
- and other fields of handle are optional. */
+ - The field of handle that type indicates should be filled,
+ and other fields of handle are optional. */
MMPixelFormatType format; /**< buffer type */
int plane_num; /**< number of planes */
int width[MM_VIDEO_BUFFER_PLANE_MAX]; /**< width of buffer */
MMVideoBufferHandle handle; /**< handle of buffer */
int is_secured; /**< secured buffer flag. ex) TrustZone memory, user can not access it. */
int flush_request; /**< flush request flag
- - If this flag is TRUE, sink element will make copy of last buffer,
- and it will return all buffers from src element.
- Then, src element can restart without changing pipeline state. */
+ - If this flag is TRUE, sink element will make copy of last buffer,
+ and it will return all buffers from src element.
+ Then, src element can restart without changing pipeline state. */
MMRectType crop; /**< crop information of buffer */
} MMVideoBuffer;
{
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
return_val_if_fail(h && idx >= 0 && idx < attrs->count && attrtype, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *attrtype=attrs->items[idx].value.type;
+ *attrtype = attrs->items[idx].value.type;
return MM_ERROR_NONE;
}
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && flags, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *flags=attrs->items[idx].flags;
+ *flags = attrs->items[idx].flags;
return MM_ERROR_NONE;
}
{
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && type, MM_ERROR_COMMON_INVALID_ARGUMENT);
- *type=attrs->items[idx].value_spec.type;
+ *type = attrs->items[idx].value_spec.type;
return MM_ERROR_NONE;
}
return_val_if_fail(attrs && count && idx >= 0 && idx < attrs->count && array, MM_ERROR_COMMON_INVALID_ARGUMENT);
if (count)
*count = attrs->items[idx].value_spec.spec.int_spec.array.count;
- *array=attrs->items[idx].value_spec.spec.int_spec.array.array;
+ *array = attrs->items[idx].value_spec.spec.int_spec.array.array;
return MM_ERROR_NONE;
}
mmf_attribute_t *item = &attrs->items[idx];
return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (!mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
+ if (!mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE)) {
return MM_ERROR_COMMON_INVALID_PERMISSION;
}
- if (mmf_attribute_validate_int(item, val))
- {
+ if (mmf_attribute_validate_int(item, val)) {
int ret = 0;
ret = mmf_attribute_set_int(item, val);
mmf_attribute_t *item = &attrs->items[idx];
return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE))
- {
- *val=mmf_value_get_int(&attrs->items[idx].value);
+ if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE)) {
+ *val = mmf_value_get_int(&attrs->items[idx].value);
return MM_ERROR_NONE;
}
return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
if (!mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
return MM_ERROR_COMMON_INVALID_PERMISSION;
- }
- if (mmf_attribute_validate_double(item, val))
- {
+ if (mmf_attribute_validate_double(item, val)) {
int ret = 0;
ret = mmf_attribute_set_double(item, val);
mmf_attribute_t *item = &attrs->items[idx];
return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE))
- {
- *val=mmf_value_get_double(&attrs->items[idx].value);
+ if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_READABLE)) {
+ *val = mmf_value_get_double(&attrs->items[idx].value);
return MM_ERROR_NONE;
}
MM_ATTR_ITEM_WRITE_LOCK(item);
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
+ if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE)) {
int ret = 0;
ret = mmf_attribute_set_string(item, string, size);
mmf_attribute_t *item = &attrs->items[idx];
return_val_if_fail(item, MM_ERROR_COMMON_INVALID_ARGUMENT);
- if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE))
- {
+ if (mmf_attribute_check_flags(item, MM_ATTRS_FLAG_WRITABLE)) {
int ret = 0;
ret = mmf_attribute_set_data(item, data, size);
}
-int mm_attrs_get_data(MMHandleType h, int idx,void **data, int *size)
+int mm_attrs_get_data(MMHandleType h, int idx, void **data, int *size)
{
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
return_val_if_fail(attrs && idx >= 0 && idx < attrs->count && data, MM_ERROR_COMMON_INVALID_ARGUMENT);
//mmf_debug(MMF_DEBUG_LOG, "Access denied.\n");
return MM_ERROR_COMMON_INVALID_PERMISSION;
}
- *data=mmf_value_get_data(&attrs->items[idx].value,size);
+ *data = mmf_value_get_data(&attrs->items[idx].value, size);
return MM_ERROR_NONE;
}
if (idx >= 0) {
if (string) {
size = strlen(string);
- }
- else {
+ } else {
string = NULL;
size = 0;
}
}
-int mm_attrs_set_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
+int mm_attrs_set_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
{
const char *name = NULL;
int ret = MM_ERROR_NONE;
*err_attr_name = NULL;
name = attribute_name;
- while (name)
- {
+ while (name) {
int idx = -1;
MMAttrsType attr_type = MM_ATTRS_TYPE_INVALID;
//name check
- if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE)
- {
+ if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE) {
+
if (err_attr_name)
*err_attr_name = strdup(name);
return ret;
//cast and set
- switch (attr_type)
+ switch (attr_type) {
+ case MM_ATTRS_TYPE_INT:
{
- case MM_ATTRS_TYPE_INT:
- {
- int val = va_arg ((var_args), int);
+ int val = va_arg((var_args), int);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %d)\n", name, val);
- ret = mm_attrs_set_int(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_DOUBLE:
- {
- double val = va_arg ((var_args), double);
+ ret = mm_attrs_set_int(attrs, idx, val);
+ break;
+ }
+ case MM_ATTRS_TYPE_DOUBLE:
+ {
+ double val = va_arg((var_args), double);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %f)\n", name, val);
- ret = mm_attrs_set_double(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_STRING:
- {
- char * val = va_arg ((var_args), char*);
- int size = va_arg ((var_args), int);
+ ret = mm_attrs_set_double(attrs, idx, val);
+ break;
+ }
+ case MM_ATTRS_TYPE_STRING:
+ {
+ char * val = va_arg((var_args), char*);
+ int size = va_arg((var_args), int);
// mmf_debug(MMF_DEBUG_LOG, "(%s: \'%s\', size: %d)\n", name, val, size);
- ret = mm_attrs_set_string(attrs, idx, (const char*)val, size);
- break;
- }
- case MM_ATTRS_TYPE_DATA:
- {
- void * val = va_arg ((var_args), void*);
- int size = va_arg ((var_args), int);
+ ret = mm_attrs_set_string(attrs, idx, (const char*)val, size);
+ break;
+ }
+ case MM_ATTRS_TYPE_DATA:
+ {
+ void * val = va_arg((var_args), void*);
+ int size = va_arg((var_args), int);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %d)\n", name, val, size);
- ret = mm_attrs_set_data(attrs, idx, val, size);
- break;
- }
- case MM_ATTRS_TYPE_INVALID:
- default:
- //mmf_debug(MMF_DEBUG_ERROR, "This function doesn't support attribute type(%d, name:%s)\n", attr_type, name);
- return MM_ERROR_COMMON_INVALID_ARGUMENT;
- break;
+ ret = mm_attrs_set_data(attrs, idx, val, size);
+ break;
+ }
+ case MM_ATTRS_TYPE_INVALID:
+ default:
+ //mmf_debug(MMF_DEBUG_ERROR, "This function doesn't support attribute type(%d, name:%s)\n", attr_type, name);
+ return MM_ERROR_COMMON_INVALID_ARGUMENT;
+ break;
}
- if (ret != MM_ERROR_NONE)
- {
+ if (ret != MM_ERROR_NONE) {
if (err_attr_name)
*err_attr_name = strdup(name);
//mmf_debug(MMF_DEBUG_ERROR, "Setting failure.(name:%s)\n", name);
}
//next name
- name = va_arg (var_args, char*);
+ name = va_arg(var_args, char*);
}
if (mmf_attrs_commit_err(attrs, err_attr_name) == -1) {
//mmf_debug(MMF_DEBUG_ERROR, "result of mmf_attrs_commit_err is -1 (name:%s)", name);
return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
- }
- else
+ } else {
return MM_ERROR_NONE;
+ }
return ret;
}
-int mm_attrs_get_valist (MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
+int mm_attrs_get_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args)
{
const char *name = NULL;
int ret = MM_ERROR_NONE;
*err_attr_name = NULL;
name = attribute_name;
- while (name)
- {
+ while (name) {
int idx = -1;
MMAttrsType attr_type = MM_ATTRS_TYPE_INVALID;
//name check
- if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE)
- {
+ if ((ret = mm_attrs_get_index(attrs, name, &idx)) != MM_ERROR_NONE) {
if (err_attr_name)
*err_attr_name = strdup(name);
return ret;
//cast and set
- switch (attr_type)
+ switch (attr_type) {
+ case MM_ATTRS_TYPE_INT:
{
- case MM_ATTRS_TYPE_INT:
- {
- int * val = va_arg ((var_args), int*);
+ int * val = va_arg((var_args), int*);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %p)\n", name, val);
- ret = mm_attrs_get_int(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_DOUBLE:
- {
- double * val = va_arg ((var_args), double*);
+ ret = mm_attrs_get_int(attrs, idx, val);
+ break;
+ }
+ case MM_ATTRS_TYPE_DOUBLE:
+ {
+ double * val = va_arg((var_args), double*);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %p)\n", name, val);
- ret = mm_attrs_get_double(attrs, idx, val);
- break;
- }
- case MM_ATTRS_TYPE_STRING:
- {
- char ** val = va_arg ((var_args), char**);
- int * size = va_arg ((var_args), int*);
+ ret = mm_attrs_get_double(attrs, idx, val);
+ break;
+ }
+ case MM_ATTRS_TYPE_STRING:
+ {
+ char ** val = va_arg((var_args), char**);
+ int * size = va_arg((var_args), int*);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %p)\n", name, val, size);
- ret = mm_attrs_get_string(attrs, idx, (char**)val, size);
- break;
- }
- case MM_ATTRS_TYPE_DATA:
- {
- void ** val = va_arg ((var_args), void**);
- int * size = va_arg ((var_args), int*);
+ ret = mm_attrs_get_string(attrs, idx, (char**)val, size);
+ break;
+ }
+ case MM_ATTRS_TYPE_DATA:
+ {
+ void ** val = va_arg((var_args), void**);
+ int * size = va_arg((var_args), int*);
// mmf_debug(MMF_DEBUG_LOG, "(%s: %p, size: %p)\n", name, val, size);
- ret = mm_attrs_get_data(attrs, idx, val, size);
- break;
- }
- case MM_ATTRS_TYPE_INVALID:
- default:
+ ret = mm_attrs_get_data(attrs, idx, val, size);
+ break;
+ }
+ case MM_ATTRS_TYPE_INVALID:
+ default:
// mmf_debug(MMF_DEBUG_ERROR, "This function doesn't support attribute type(%d, name:%s)\n", attr_type, name);
- //if (err_attr_name)
- // *err_attr_name = strdup(name);
- ret = MM_ERROR_COMMON_INVALID_ARGUMENT;
- break;
+ //if (err_attr_name)
+ // *err_attr_name = strdup(name);
+ ret = MM_ERROR_COMMON_INVALID_ARGUMENT;
+ break;
}
- if (ret != MM_ERROR_NONE)
- {
+ if (ret != MM_ERROR_NONE) {
if (err_attr_name)
*err_attr_name = strdup(name);
//mmf_debug(MMF_DEBUG_ERROR, "Setting failure.(name:%s)\n", name);
}
//next name
- name = va_arg (var_args, char*);
+ name = va_arg(var_args, char*);
}
return ret;
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- va_start (var_args, attribute_name);
- ret = mm_attrs_set_valist (handle, err_attr_name, attribute_name, var_args);
- va_end (var_args);
+ va_start(var_args, attribute_name);
+ ret = mm_attrs_set_valist(handle, err_attr_name, attribute_name, var_args);
+ va_end(var_args);
return ret;
}
return_val_if_fail(attribute_name, MM_ERROR_COMMON_INVALID_ARGUMENT);
- va_start (var_args, attribute_name);
- ret = mm_attrs_get_valist (handle, err_attr_name, attribute_name, var_args);
- va_end (var_args);
+ va_start(var_args, attribute_name);
+ ret = mm_attrs_get_valist(handle, err_attr_name, attribute_name, var_args);
+ va_end(var_args);
return ret;
}
return_val_if_fail(h, MM_ERROR_COMMON_INVALID_ARGUMENT);
return_val_if_fail(info, MM_ERROR_COMMON_INVALID_ARGUMENT);
- return_val_if_fail( 0 <= idx && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
+ return_val_if_fail(0 <= idx && idx < attrs->count, MM_ERROR_COMMON_INVALID_ARGUMENT);
memset(info, 0x00, sizeof(MMAttrsInfo));
info->flag = attrs->items[idx].flags;
info->validity_type = attrs->items[idx].value_spec.type;
- switch (info->validity_type)
- {
- case MM_ATTRS_VALID_TYPE_INT_ARRAY:
- info->int_array.array = attrs->items[idx].value_spec.spec.int_spec.array.array;
- info->int_array.count = attrs->items[idx].value_spec.spec.int_spec.array.count;
- info->int_array.dval = attrs->items[idx].value_spec.spec.int_spec.array.dval;
+ switch (info->validity_type) {
+ case MM_ATTRS_VALID_TYPE_INT_ARRAY:
+ info->int_array.array = attrs->items[idx].value_spec.spec.int_spec.array.array;
+ info->int_array.count = attrs->items[idx].value_spec.spec.int_spec.array.count;
+ info->int_array.dval = attrs->items[idx].value_spec.spec.int_spec.array.dval;
break;
- case MM_ATTRS_VALID_TYPE_INT_RANGE:
- info->int_range.min = attrs->items[idx].value_spec.spec.int_spec.range.min;
- info->int_range.max = attrs->items[idx].value_spec.spec.int_spec.range.max;
- info->int_range.dval = attrs->items[idx].value_spec.spec.int_spec.range.dval;
+ case MM_ATTRS_VALID_TYPE_INT_RANGE:
+ info->int_range.min = attrs->items[idx].value_spec.spec.int_spec.range.min;
+ info->int_range.max = attrs->items[idx].value_spec.spec.int_spec.range.max;
+ info->int_range.dval = attrs->items[idx].value_spec.spec.int_spec.range.dval;
break;
- case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
- info->double_array.array = attrs->items[idx].value_spec.spec.double_spec.array.array;
- info->double_array.count = attrs->items[idx].value_spec.spec.double_spec.array.count;
- info->double_array.dval = attrs->items[idx].value_spec.spec.double_spec.array.dval;
+ case MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY:
+ info->double_array.array = attrs->items[idx].value_spec.spec.double_spec.array.array;
+ info->double_array.count = attrs->items[idx].value_spec.spec.double_spec.array.count;
+ info->double_array.dval = attrs->items[idx].value_spec.spec.double_spec.array.dval;
break;
- case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
- info->double_range.min = attrs->items[idx].value_spec.spec.double_spec.range.min;
- info->double_range.max = attrs->items[idx].value_spec.spec.double_spec.range.max;
- info->double_range.dval = attrs->items[idx].value_spec.spec.double_spec.range.dval;
+ case MM_ATTRS_VALID_TYPE_DOUBLE_RANGE:
+ info->double_range.min = attrs->items[idx].value_spec.spec.double_spec.range.min;
+ info->double_range.max = attrs->items[idx].value_spec.spec.double_spec.range.max;
+ info->double_range.dval = attrs->items[idx].value_spec.spec.double_spec.range.dval;
break;
- case MM_ATTRS_VALID_TYPE_NONE:
- //mmf_debug(MMF_DEBUG_LOG, "Valid type none.\n");
+ case MM_ATTRS_VALID_TYPE_NONE:
+ //mmf_debug(MMF_DEBUG_LOG, "Valid type none.\n");
break;
- case MM_ATTRS_VALID_TYPE_INVALID:
- default:
+ case MM_ATTRS_VALID_TYPE_INVALID:
+ default:
break;
}
double mmf_value_get_double(mmf_value_t *v)
{
- return_val_if_fail(v->type == MMF_VALUE_TYPE_DOUBLE, -1);
- return v->value.d_val;
+ return_val_if_fail(v->type == MMF_VALUE_TYPE_DOUBLE, -1);
+ return v->value.d_val;
}
-int mmf_value_set_string(mmf_value_t *v, const char *sval,int size)
+int mmf_value_set_string(mmf_value_t *v, const char *sval, int size)
{
return_val_if_fail(v && v->type == MMF_VALUE_TYPE_STRING, -1);
if (v->value.s_val != NULL) {
v->value.s_val = NULL;
v->size = 0;
}
- if (sval){
+ if (sval) {
v->value.s_val = strdup(sval);
v->size = size;
- }
- else{
+ } else {
v->value.s_val = NULL;
v->size = 0;
- }
+ }
return 0;
}
char* mmf_value_get_string(const mmf_value_t *v, int *size)
{
return_val_if_fail(v && v->type == MMF_VALUE_TYPE_STRING, NULL);
- *size=v->size;
+ *size = v->size;
return v->value.s_val;
}
-int mmf_value_set_data(mmf_value_t *v, void *data,int size)
+int mmf_value_set_data(mmf_value_t *v, void *data, int size)
{
return_val_if_fail(v && v->type == MMF_VALUE_TYPE_DATA, -1);
v->value.p_val = data;
- v->size=size;
+ v->size = size;
return 0;
}
-void* mmf_value_get_data(const mmf_value_t *v,int *size)
+void* mmf_value_get_data(const mmf_value_t *v, int *size)
{
return_val_if_fail(v && v->type == MMF_VALUE_TYPE_DATA, NULL);
- *size=v->size;
+ *size = v->size;
return v->value.p_val;
}
int mmf_value_spec_clear(mmf_value_spec_t *vs)
{
return_val_if_fail(vs, -1);
- switch(vs->type) {
+ switch (vs->type) {
case MMF_VALUE_SPEC_INT_ARRAY:
if (vs->spec.int_spec.array.array) {
free(vs->spec.int_spec.array.array);
{
return_val_if_fail(item, -1);
- if (mmf_value_set_string(&item->tmpval, string,size) == 0) {
+ if (mmf_value_set_string(&item->tmpval, string, size) == 0) {
if (string)
item->flags |= MM_ATTRS_FLAG_MODIFIED;
{
return_val_if_fail(item, -1);
- if (mmf_value_set_data(&item->tmpval, data,size) == 0) {
+ if (mmf_value_set_data(&item->tmpval, data, size) == 0) {
item->flags |= MM_ATTRS_FLAG_MODIFIED;
return 0;
}
{
return_val_if_fail(count > 0, 0);
mmf_attrs_t *attrs;
- attrs = (mmf_attrs_t *) malloc (sizeof(mmf_attrs_t));
+ attrs = (mmf_attrs_t *) malloc(sizeof(mmf_attrs_t));
if (attrs == NULL) {
debug_error("malloc failed");
}
attrs->count = count;
- attrs->items = (mmf_attribute_t *) malloc (sizeof(mmf_attribute_t) * count);
- if(attrs->items == NULL) {
- debug_error("Failed to malloc for attrs->items.");
- free(attrs);
- attrs=NULL;
- return 0;
- }
+ attrs->items = (mmf_attribute_t *) malloc(sizeof(mmf_attribute_t) * count);
+ if (attrs->items == NULL) {
+ debug_error("Failed to malloc for attrs->items.");
+ free(attrs);
+ attrs = NULL;
+ return 0;
+ }
memset(attrs->items, 0, sizeof(mmf_attribute_t) * count);
}
MMHandleType mmf_attrs_new_from_data(const char *name,
- mmf_attrs_construct_info_t *info,
- int count,
- mmf_attrs_commit_func_t commit_func,
- void *commit_param)
+ mmf_attrs_construct_info_t *info,
+ int count,
+ mmf_attrs_commit_func_t commit_func,
+ void *commit_param)
{
return_val_if_fail(info && count > 0, 0);
MMHandleType h;
mmf_attrs_t *attrs;
h = mmf_attrs_new(count);
- if(!h) {
+ if (!h) {
return 0;
}
mmf_attrs_init(h, info, count);
pthread_mutex_init(&item->write_lock, NULL);
mmf_attribute_init(item,
- info[i].name,
- info[i].value_type,
- info[i].flags);
+ info[i].name,
+ info[i].value_type,
+ info[i].flags);
switch (info[i].value_type) {
case MMF_VALUE_TYPE_INT:
assert(item->value.value.i_val == 0);
mmf_value_set_int(&item->value,
- (intptr_t)info[i].default_value);
+ (intptr_t)info[i].default_value);
break;
case MMF_VALUE_TYPE_DOUBLE:
{
size = strlen(info[i].default_value)+1;
}
mmf_value_set_string(&item->value,
- (const char *)info[i].default_value,size);
+ (const char *)info[i].default_value, size);
break;
case MMF_VALUE_TYPE_DATA:
assert(item->value.value.p_val == NULL);
if (info[i].default_value) {
size = sizeof(info[i].default_value)+1;
}
- mmf_value_set_data(&item->value, info[i].default_value,size);
+ mmf_value_set_data(&item->value, info[i].default_value, size);
break;
default:
//mmf_debug(MMF_DEBUG_LOG, "ERROR: Invalid MMF_VALUE_TYPE\n");
{
return_val_if_fail(h, -1);
- mmf_attrs_t *attrs = (mmf_attrs_t * )h;
+ mmf_attrs_t *attrs = (mmf_attrs_t *)h;
mmf_attribute_t *item = NULL;
int i;
int ret = 0;
int mmf_attrs_commit_err(MMHandleType h, char **err_attr_name)
{
- mmf_attrs_t *attrs = (mmf_attrs_t * )h;
+ mmf_attrs_t *attrs = (mmf_attrs_t *)h;
mmf_attribute_t *item = NULL;
int i;
int ret = 0;
int mmf_attrs_set_valid_type(MMHandleType h, int idx, int v_type)
{
return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
+ return_val_if_fail(idx >= 0, -1);
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
return mmf_value_spec_init(&attrs->items[idx].value_spec, v_type);
}
int mmf_attrs_set_valid_range(MMHandleType h, int idx, int min, int max, int dval)
{
return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
+ return_val_if_fail(idx >= 0, -1);
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_INT_RANGE);
int mmf_attrs_set_valid_array(MMHandleType h, int idx, const int *array, int count, int dval)
{
return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
+ return_val_if_fail(idx >= 0, -1);
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_INT_ARRAY);
int mmf_attrs_set_valid_double_range(MMHandleType h, int idx, double min, double max, double dval)
{
return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
+ return_val_if_fail(idx >= 0, -1);
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_RANGE);
int mmf_attrs_set_valid_double_array(MMHandleType h, int idx, const double *array, int count, double dval)
{
return_val_if_fail(h, -1);
- return_val_if_fail(idx>=0, -1);
+ return_val_if_fail(idx >= 0, -1);
mmf_attrs_t *attrs = (mmf_attrs_t *) h;
mmf_value_spec_clear(&attrs->items[idx].value_spec);
assert(attrs->items[idx].value_spec.type == MMF_VALUE_SPEC_DOUBLE_ARRAY);
if (list == NULL) {
/* first item */
g_list = item;
- }
- else {
+ } else {
list = g_list;
/* move to last */
/* remove handle */
if (prev) {
prev->next = list->next;
- }
- else {
+ } else {
g_list = list->next;
}
Name: libmm-common
Summary: Multimedia Framework Common Lib
-Version: 0.2.104
+Version: 0.2.105
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0