Name: libmm-streamrecorder
Summary: Media Stream Recorder library
-Version: 0.0.5
+Version: 0.0.6
Release: 0
Group: Multimedia/Other
License: Apache-2.0
int mm_streamrecorder_set_attributes(MMHandleType streamrecorder, char **err_attr_name, const char *attribute_name, ...) G_GNUC_NULL_TERMINATED;
/**
+ * mm_streamrecorder_get_attribute_info:\n
+ * Get detail information of the attribute. To manager attributes, an user may want to know the exact character of the attribute,
+ * such as type, flag, and validity. This is the function to provide such information.
+ * Depending on the 'validity_type', validity union would be different. To know about the type of union, please refer 'MMStreamRecorderAttrsInfo'.
+ *
+ * @param[in] streamrecorder Specifies the streamrecorder handle.
+ * @param[in] attribute_name attribute name that user want to get information.
+ * @param[out] info a structure that holds information related with the attribute.
+ * @return This function returns zero(MM_ERROR_NONE) on success, or negative value with error code.\n
+ * Please refer 'mm_error.h' to know the exact meaning of the error.
+ * @pre None
+ * @post None
+ * @remarks If the function succeeds, 'info' holds detail information about the attribute, such as type,
+ * flag, validity_type, validity_values, and default values.
+ * @see mm_streamrecorder_get_attributes, mm_streamrecorder_set_attributes
+ */
+
+int mm_streamrecorder_get_attribute_info(MMHandleType streamrecorder, const char *attribute_name, MMStreamRecorderAttrsInfo *info);
+
+/**
* mm_streamrecorder_get_state:\n
* Get the current state of streamreccorder.
* mm_streamrecorderr is working on the base of its state. An user should check the state of mm_streamrecorder before calling its functions.
========================================================================================*/
typedef struct {
MMStreamRecorderAttrsID attrid;
- const char *name;
+ char *name;
int value_type;
int flags;
union {
*/
bool _mmstreamrecorder_check_supported_attribute(MMHandleType handle, int attr_index);
-/**
- * mm_streamrecorder_get_attribute_info:\n
- * Get detail information of the attribute. To manager attributes, an user may want to know the exact character of the attribute,
- * such as type, flag, and validity. This is the function to provide such information.
- * Depending on the 'validity_type', validity union would be different. To know about the type of union, please refer 'MMStreamRecorderAttrsInfo'.
- *
- * @param[in] streamrecorder Specifies the streamrecorder handle.
- * @param[in] attribute_name attribute name that user want to get information.
- * @param[out] info a structure that holds information related with the attribute.
- * @return This function returns zero(MM_ERROR_NONE) on success, or negative value with error code.\n
- * Please refer 'mm_error.h' to know the exact meaning of the error.
- * @pre None
- * @post None
- * @remarks If the function succeeds, 'info' holds detail information about the attribute, such as type,
- * flag, validity_type, validity_values, and default values.
- * @see mm_streamrecorder_get_attributes, mm_streamrecorder_set_attributes
- */
-
-int mm_streamrecorder_get_attribute_info(MMHandleType streamrecorder, const char *attribute_name, MMStreamRecorderAttrsInfo *info);
-
bool _mmstreamrecorder_commit_video_bitrate(MMHandleType handle, int attr_idx, const mmf_value_t *value);
#ifdef __cplusplus
return ret;
}
+
+int mm_streamrecorder_get_attribute_info(MMHandleType streamrecorder, const char *attribute_name, MMStreamRecorderAttrsInfo * info)
+{
+ return _mmstreamrecorder_get_attribute_info(streamrecorder, attribute_name, info);
+}
/* 0 */
{
MM_STR_VIDEO_BUFFER_TYPE, /* ID */
- "videobuffer-type", /* Name */
+ (char *)"videobuffer-type", /* Name */
MMF_VALUE_TYPE_INT, /* Type */
MM_ATTRS_FLAG_RW, /* Flag */
{(void *)MM_STREAMRECORDER_VIDEO_TYPE_TBM_BO}, /* Default value */
},
/* 1 */
{MM_STR_VIDEO_FORMAT,
- "videosource-format",
+ (char *)"videosource-format",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)MM_STREAMRECORDER_INPUT_FORMAT_NV12},
/* 2 */
{
MM_STR_VIDEO_FRAMERATE,
- "video-framerate",
+ (char *)"video-framerate",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 3 */
{
MM_STR_VIDEO_ENCODER_BITRATE,
- "video-bitrate",
+ (char *)"video-bitrate",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 4 */
{
MM_STR_VIDEO_RESOLUTION_WIDTH,
- "video-resolution-width",
+ (char *)"video-resolution-width",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 5 */
{
MM_STR_VIDEO_RESOLUTION_HEIGHT,
- "video-resolution-height",
+ (char *)"video-resolution-height",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 6 */
{
MM_STR_AUDIO_FORMAT,
- "audio-source-format",
+ (char *)"audio-source-format",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)MM_STREAMRECORDER_AUDIO_FORMAT_PCM_S16_LE},
/* 7 */
{
MM_STR_AUDIO_ENCODER_BITRATE,
- "audio-bitrate",
+ (char *)"audio-bitrate",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)128000},
/* 8 */
{
MM_STR_AUDIO_SAMPLERATE,
- "audio-samplerate",
+ (char *)"audio-samplerate",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 9 */
{
MM_STR_VIDEO_ENCODER,
- "video-encoder",
+ (char *)"video-encoder",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 10 */
{
MM_STR_AUDIO_ENCODER,
- "audio-encoder",
+ (char *)"audio-encoder",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 11 */
{
MM_STR_AUDIO_CHENNEL_COUNT,
- "audio-channel-count",
+ (char *)"audio-channel-count",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)2},
/* 12 */
{
MM_STR_FILE_FORMAT,
- "file-format",
+ (char *)"file-format",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/* 13 */
{
MM_STR_TARGET_FILE_NAME,
- "filename",
+ (char *)"filename",
MMF_VALUE_TYPE_STRING,
MM_ATTRS_FLAG_RW,
{NULL},
/* 14 */
{
MM_STR_VIDEO_ENABLE,
- "video-enable",
+ (char *)"video-enable",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)FALSE},
/* 15 */
{
MM_STR_AUDIO_ENABLE,
- "audio-enable",
+ (char *)"audio-enable",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)FALSE},
/* 16 */
{
MM_STR_MODE,
- "recorder-mode",
+ (char *)"recorder-mode",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)MM_STREAMRECORDER_MODE_MEDIABUFFER},
/*17*/
{
MM_STR_TARGET_MAX_SIZE,
- "target-max-size",
+ (char *)"target-max-size",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
/*18*/
{
MM_STR_TARGET_TIME_LIMIT,
- "target-time-limit",
+ (char *)"target-time-limit",
MMF_VALUE_TYPE_INT,
MM_ATTRS_FLAG_RW,
{(void *)0},
return TRUE;
}
-
-int mm_streamrecorder_get_attribute_info(MMHandleType streamrecorder, const char *attribute_name, MMStreamRecorderAttrsInfo * info)
-{
- return _mmstreamrecorder_get_attribute_info(streamrecorder, attribute_name, info);
-}
ini->video_frame_wait_time = iniparser_getint(dict, "video param:video frame wait time", DEFAULT_VIDEO_FRAME_WAIT_TIME);
/*supported attribute*/
- MMSTREAMRECORDER_INI_GET_INT_FROM_LIST(dict, ini->supported_video_width, STREAMRECORDER_ATTRIBUTE_NUM_MAX, "attribute:supported width", DEFAULT_SUPPORTED_WIDTH);
- MMSTREAMRECORDER_INI_GET_INT_FROM_LIST(dict, ini->supported_video_height, STREAMRECORDER_ATTRIBUTE_NUM_MAX, "attribute:supported height", DEFAULT_SUPPORTED_HEIGHT);
- __get_element_list(ini, iniparser_getstring(dict, "attribute:supported audio encoders", DEFAULT_SUPPORTED_AUDIO_ENCODERS), KEYWORD_AUDIO_ENCODERS);
- __get_element_list(ini, iniparser_getstring(dict, "attribute:supported video encoders", DEFAULT_SUPPORTED_VIDEO_ENCODERS), KEYWORD_VIDEO_ENCODERS);
- __get_element_list(ini, iniparser_getstring(dict, "attribute:supported file formats", DEFAULT_SUPPORTED_FILE_FORMATS), KEYWORD_FILE_FORMATS);
+ MMSTREAMRECORDER_INI_GET_INT_FROM_LIST(dict, ini->supported_video_width, STREAMRECORDER_ATTRIBUTE_NUM_MAX, "attribute:supported width", (char *)DEFAULT_SUPPORTED_WIDTH);
+ MMSTREAMRECORDER_INI_GET_INT_FROM_LIST(dict, ini->supported_video_height, STREAMRECORDER_ATTRIBUTE_NUM_MAX, "attribute:supported height", (char *)DEFAULT_SUPPORTED_HEIGHT);
+ __get_element_list(ini, iniparser_getstring(dict, "attribute:supported audio encoders", (char*)DEFAULT_SUPPORTED_AUDIO_ENCODERS), KEYWORD_AUDIO_ENCODERS);
+ __get_element_list(ini, iniparser_getstring(dict, "attribute:supported video encoders", (char*)DEFAULT_SUPPORTED_VIDEO_ENCODERS), KEYWORD_VIDEO_ENCODERS);
+ __get_element_list(ini, iniparser_getstring(dict, "attribute:supported file formats", (char*)DEFAULT_SUPPORTED_FILE_FORMATS), KEYWORD_FILE_FORMATS);
} else { /* if dict is not available just fill the structure with default value */
_mmstreamrec_dbg_err("failed to load ini. using hardcoded default\n");
ini->video_frame_wait_time = DEFAULT_VIDEO_FRAME_WAIT_TIME;
/*supported attributes*/
- __get_element_list(ini, DEFAULT_SUPPORTED_AUDIO_ENCODERS, KEYWORD_AUDIO_ENCODERS);
- __get_element_list(ini, DEFAULT_SUPPORTED_VIDEO_ENCODERS, KEYWORD_VIDEO_ENCODERS);
- __get_element_list(ini, DEFAULT_SUPPORTED_FILE_FORMATS, KEYWORD_FILE_FORMATS);
+ __get_element_list(ini, (char *)DEFAULT_SUPPORTED_AUDIO_ENCODERS, KEYWORD_AUDIO_ENCODERS);
+ __get_element_list(ini, (char *)DEFAULT_SUPPORTED_VIDEO_ENCODERS, KEYWORD_VIDEO_ENCODERS);
+ __get_element_list(ini, (char *)DEFAULT_SUPPORTED_FILE_FORMATS, KEYWORD_FILE_FORMATS);
}
/* free dict as we got our own structure */