mm_streamrecorder_get_attribute_info move to streamrecorder from streamrecorder_attri... 11/64711/2 accepted/tizen/common/20160412.131230 accepted/tizen/ivi/20160413.082742 accepted/tizen/mobile/20160413.073230 accepted/tizen/tv/20160413.075527 accepted/tizen/wearable/20160413.080532 submit/tizen/20160412.071659
authorSeokHoon Lee <andy.shlee@samsung.com>
Tue, 5 Apr 2016 02:42:52 +0000 (11:42 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Mon, 11 Apr 2016 01:48:50 +0000 (10:48 +0900)
Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I1c12339df727d68467b95f6c6a7f61611bee74cf

packaging/libmm-streamrecorder.spec
src/include/mm_streamrecorder.h
src/include/mm_streamrecorder_attribute.h
src/mm_streamrecorder.c
src/mm_streamrecorder_attribute.c
src/mm_streamrecorder_ini.c

index cbbfafb..1b9de95 100644 (file)
@@ -1,6 +1,6 @@
 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
index 6414668..a369d7b 100644 (file)
@@ -613,6 +613,26 @@ int mm_streamrecorder_get_attributes(MMHandleType streamrecorder, char **err_att
 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.
index 4438ae3..4f80184 100644 (file)
@@ -90,7 +90,7 @@ typedef bool(*mmf_streamrecorder_commit_func_t) (MMHandleType handle, int attr_i
 ========================================================================================*/
 typedef struct {
        MMStreamRecorderAttrsID attrid;
-       const char *name;
+       char *name;
        int value_type;
        int flags;
        union {
@@ -226,26 +226,6 @@ bool _mmstreamrecorder_commit_audio_bitrate(MMHandleType handle, int attr_idx, c
  */
 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
index 7e867fa..ec4c9b6 100644 (file)
@@ -229,3 +229,8 @@ int mm_streamrecorder_set_attributes(MMHandleType streamrecorder, char **err_att
 
        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);
+}
index 61464d6..9d8fbe3 100644 (file)
@@ -43,7 +43,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_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 */
@@ -54,7 +54,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
         },
        /* 1  */
        {MM_STR_VIDEO_FORMAT,
-        "videosource-format",
+        (char *)"videosource-format",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)MM_STREAMRECORDER_INPUT_FORMAT_NV12},
@@ -66,7 +66,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 2  */
        {
         MM_STR_VIDEO_FRAMERATE,
-        "video-framerate",
+        (char *)"video-framerate",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -78,7 +78,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 3  */
        {
         MM_STR_VIDEO_ENCODER_BITRATE,
-        "video-bitrate",
+        (char *)"video-bitrate",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -90,7 +90,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 4  */
        {
         MM_STR_VIDEO_RESOLUTION_WIDTH,
-        "video-resolution-width",
+        (char *)"video-resolution-width",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -102,7 +102,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 5  */
        {
         MM_STR_VIDEO_RESOLUTION_HEIGHT,
-        "video-resolution-height",
+        (char *)"video-resolution-height",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -114,7 +114,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 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},
@@ -126,7 +126,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 7  */
        {
         MM_STR_AUDIO_ENCODER_BITRATE,
-        "audio-bitrate",
+        (char *)"audio-bitrate",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)128000},
@@ -138,7 +138,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 8  */
        {
         MM_STR_AUDIO_SAMPLERATE,
-        "audio-samplerate",
+        (char *)"audio-samplerate",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -150,7 +150,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 9  */
        {
         MM_STR_VIDEO_ENCODER,
-        "video-encoder",
+        (char *)"video-encoder",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -162,7 +162,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 10  */
        {
         MM_STR_AUDIO_ENCODER,
-        "audio-encoder",
+        (char *)"audio-encoder",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -174,7 +174,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 11  */
        {
         MM_STR_AUDIO_CHENNEL_COUNT,
-        "audio-channel-count",
+        (char *)"audio-channel-count",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)2},
@@ -186,7 +186,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 12  */
        {
         MM_STR_FILE_FORMAT,
-        "file-format",
+        (char *)"file-format",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -198,7 +198,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 13  */
        {
         MM_STR_TARGET_FILE_NAME,
-        "filename",
+        (char *)"filename",
         MMF_VALUE_TYPE_STRING,
         MM_ATTRS_FLAG_RW,
         {NULL},
@@ -210,7 +210,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 14  */
        {
         MM_STR_VIDEO_ENABLE,
-        "video-enable",
+        (char *)"video-enable",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)FALSE},
@@ -222,7 +222,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 15  */
        {
         MM_STR_AUDIO_ENABLE,
-        "audio-enable",
+        (char *)"audio-enable",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)FALSE},
@@ -234,7 +234,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /* 16 */
        {
         MM_STR_MODE,
-        "recorder-mode",
+        (char *)"recorder-mode",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)MM_STREAMRECORDER_MODE_MEDIABUFFER},
@@ -246,7 +246,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /*17*/
        {
         MM_STR_TARGET_MAX_SIZE,
-        "target-max-size",
+        (char *)"target-max-size",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -258,7 +258,7 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = {
        /*18*/
        {
         MM_STR_TARGET_TIME_LIMIT,
-        "target-time-limit",
+        (char *)"target-time-limit",
         MMF_VALUE_TYPE_INT,
         MM_ATTRS_FLAG_RW,
         {(void *)0},
@@ -1149,8 +1149,3 @@ bool _mmstreamrecorder_commit_audio_channel(MMHandleType handle, int attr_idx, c
 
        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);
-}
index 3a67847..49571f3 100644 (file)
@@ -132,11 +132,11 @@ int _mm_streamrecorder_ini_load(mm_streamrecorder_ini_t *ini)
                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");
@@ -176,9 +176,9 @@ int _mm_streamrecorder_ini_load(mm_streamrecorder_ini_t *ini)
                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 */