From b710713d0427bbe3158e3f900077e3d10ba018e5 Mon Sep 17 00:00:00 2001 From: SeokHoon Lee Date: Wed, 16 Mar 2016 10:44:18 +0900 Subject: [PATCH] Check build warning Signed-off-by: SeokHoon Lee Change-Id: I2685f28a53e4bf796b290a34418dd9596d802aa3 --- packaging/libmm-streamrecorder.spec | 2 +- src/include/mm_streamrecorder_ini.h | 72 ------------------------------------- src/mm_streamrecorder_attribute.c | 5 ++- src/mm_streamrecorder_ini.c | 30 +--------------- src/mm_streamrecorder_internal.c | 6 ++-- src/mm_streamrecorder_recorder.c | 3 +- test/mm_streamrecorder_testsuite.c | 26 ++++---------- 7 files changed, 19 insertions(+), 125 deletions(-) diff --git a/packaging/libmm-streamrecorder.spec b/packaging/libmm-streamrecorder.spec index e30c202..2bb8a53 100644 --- a/packaging/libmm-streamrecorder.spec +++ b/packaging/libmm-streamrecorder.spec @@ -1,6 +1,6 @@ Name: libmm-streamrecorder Summary: Media Stream Recorder library -Version: 0.0.3 +Version: 0.0.4 Release: 0 Group: Multimedia/Other License: Apache-2.0 diff --git a/src/include/mm_streamrecorder_ini.h b/src/include/mm_streamrecorder_ini.h index 7fbaca5..a65453e 100644 --- a/src/include/mm_streamrecorder_ini.h +++ b/src/include/mm_streamrecorder_ini.h @@ -133,78 +133,6 @@ typedef struct __mm_streamrecorder_ini { #define DEFAULT_SUPPORTED_VIDEO_ENCODERS "" #define DEFAULT_SUPPORTED_FILE_FORMATS "" -#define MM_STREAMRECORDER_DEFAULT_INI \ -" \ -[general]\n\ -\n\ -retrialcount =10\n\ -\n\ -minimum frame =5\n\ -\n\ -reset pause time = 0 \n\ -\n\ -screen record =0 \n\ -\n\ -convert output buffer num =6\n\ -\n\ -[encodebin]\n\ -\n\ -encsink bin profile = 0 \n\ -\n\ -encsink source auto audio resample = 0\n\ -\n\ -encsink source auto audio colorsapce = 0 \n\ -\n\ -encsink source auto audio convert =1\n\ -\n\ -encsink source use video toggle = 1\n\ -\n\ -[pipeline]\n\ -\n\ -encsink bin source = xvimagesrc\n\ -\n\ -name of audio src \n\ -\n\ -h264 encoder = omx_h264enc\n\ -\n\ -h263 encoder = omx_h263enc\n\ -\n\ -mpeg4 encoder = omx_mpeg4enc\n\ -\n\ -name of audio encoder =savsenc_aac\n\ -\n\ -name of 3GP muxer =ffmux_3gp\n\ -\n\ -use parser= \n\ -\n\ -name of MP4 muxer =ffmux_mp4\n\ -\n\ -name of video converter\n\ -\n\ -name of sink = filesink \n\ -\n\ -[video param]\n\ -\n\ -video frame wait time = 200000\n\ -\n\ -[audio param]\n\ -\n\ -audio frame minimum space = 102400\n\ -\n\ -audio frame wait time = 20000\n\ -\n\ -supported width = ""\n\ -\n\ -supported height = ""\n\ -\n\ -supported audio encoders = ""\n\ -\n\ -supported video encoders = ""\n\ -\n\ -supported file formats = ""\n\ -\n\ -" - int _mm_streamrecorder_ini_load(mm_streamrecorder_ini_t * ini); diff --git a/src/mm_streamrecorder_attribute.c b/src/mm_streamrecorder_attribute.c index 40d7c91..61464d6 100644 --- a/src/mm_streamrecorder_attribute.c +++ b/src/mm_streamrecorder_attribute.c @@ -277,6 +277,9 @@ mm_streamrecorder_attr_construct_info stream_attrs_const_info[] = { /*----------------------------------------------------------------------- | LOCAL FUNCTION PROTOTYPES: | -----------------------------------------------------------------------*/ +int _mmstreamrecorder_get_available_format(MMHandleType handle, int type, int ** format); + + /* STATIC INTERNAL FUNCTION */ static int __mmstreamrecorder_set_conf_to_valid_info(MMHandleType handle) { @@ -692,7 +695,7 @@ _mmstreamrecorder_get_available_format(MMHandleType handle, int type, int ** for int count = 0; int i = 0; int fmt = 0; - const char *name = NULL; + char *name = NULL; mmf_return_val_if_fail(hstreamrecorder, 0); diff --git a/src/mm_streamrecorder_ini.c b/src/mm_streamrecorder_ini.c index 89c4dfa..7160ec1 100644 --- a/src/mm_streamrecorder_ini.c +++ b/src/mm_streamrecorder_ini.c @@ -30,9 +30,6 @@ static gboolean loaded = FALSE; /* global variables here */ -#ifdef MM_STREAMRECORDER_DEFAULT_INI -static gboolean __generate_default_ini(void); -#endif static void __get_element_list(mm_streamrecorder_ini_t* ini, gchar* str, int keyword_type); static void __mm_streamrecorder_ini_check_status(void); @@ -78,31 +75,6 @@ do { \ } \ } while (0) - -#ifdef MM_STREAMRECORDER_DEFAULT_INI -static -gboolean __generate_default_ini(void) -{ - FILE *fp = NULL; - const gchar *default_ini = MM_STREAMRECORDER_DEFAULT_INI; - - /* create new file */ - fp = fopen(MM_STREAMRECORDER_INI_DEFAULT_PATH, "wt"); - - if (!fp) - return FALSE; - - /* writing default ini file */ - if (strlen(default_ini) != fwrite(default_ini, 1, strlen(default_ini), fp)) { - fclose(fp); - return FALSE; - } - - fclose(fp); - return TRUE; -} -#endif - int _mm_streamrecorder_ini_load(mm_streamrecorder_ini_t *ini) { dictionary *dict = NULL; @@ -160,7 +132,7 @@ 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_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); diff --git a/src/mm_streamrecorder_internal.c b/src/mm_streamrecorder_internal.c index 435f5d5..b9f6da6 100644 --- a/src/mm_streamrecorder_internal.c +++ b/src/mm_streamrecorder_internal.c @@ -46,10 +46,13 @@ /*--------------------------------------------------------------------------------------- | LOCAL FUNCTION PROTOTYPES: | ---------------------------------------------------------------------------------------*/ +void _mmstreamrecorder_set_state(MMHandleType handle, int state); + /*======================================================================================= | FUNCTION DEFINITIONS | =======================================================================================*/ + /*--------------------------------------------------------------------------------------- | GLOBAL FUNCTION DEFINITIONS: | ---------------------------------------------------------------------------------------*/ @@ -375,7 +378,6 @@ int _mmstreamrecorder_record(MMHandleType handle) return MM_ERROR_NONE; _ERR_STREAMRECORDER_CMD: - _ERR_STREAMRECORDER_CMD_PRECON: /* check internal error of gstreamer */ if (hstreamrecorder->sub_context->error_code != MM_ERROR_NONE) { ret = hstreamrecorder->sub_context->error_code; @@ -442,7 +444,7 @@ int _mmstreamrecorder_push_stream_buffer(MMHandleType handle, MMStreamRecorderSt ret = _mmstreamrecorder_push_videostream_buffer(handle, timestamp, stream_buffer->buffer, size); } else if (streamtype == MM_STREAM_TYPE_AUDIO) { gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY, - buffer, size, 0, buffer, stream_buffer, _mmstreamrecorder_buffer_destroy)); + buffer, size, 0, size, stream_buffer, _mmstreamrecorder_buffer_destroy)); ret = _mmstreamrecorder_push_audiostream_buffer(handle, timestamp, stream_buffer->buffer, size); } else { gst_buffer_unmap(stream_buffer->buffer, &map); diff --git a/src/mm_streamrecorder_recorder.c b/src/mm_streamrecorder_recorder.c index 2d5c083..402118e 100644 --- a/src/mm_streamrecorder_recorder.c +++ b/src/mm_streamrecorder_recorder.c @@ -1271,8 +1271,9 @@ int _mmstreamrecorder_video_handle_eos(MMHandleType handle) sc = MMF_STREAMRECORDER_SUBCONTEXT(handle); mmf_return_val_if_fail(sc, FALSE); mmf_return_val_if_fail(sc->info_video, FALSE); - if (sc->audio_enable == TRUE) + if (sc->audio_enable == TRUE) { mmf_return_val_if_fail(sc->info_audio, FALSE); + } mmf_return_val_if_fail(sc->info_file, FALSE); diff --git a/test/mm_streamrecorder_testsuite.c b/test/mm_streamrecorder_testsuite.c index 91403ca..5564ff6 100644 --- a/test/mm_streamrecorder_testsuite.c +++ b/test/mm_streamrecorder_testsuite.c @@ -686,16 +686,10 @@ static void setting_menu(gchar buf) int width_count = 0; int height_count = 0; int i = 0; - int count = 0; - int value = 0; - int* array = NULL; int *width_array = NULL; int *height_array = NULL; - char *err_attr_name = NULL; str_xypair_t input_pair; - char filename[100]; int err = MM_ERROR_NONE; - int x = 0, y = 0, width = 0, height = 0; if (hstreamrecorder->mode == MODE_VIDEO_CAPTURE) { switch (buf) { @@ -992,17 +986,11 @@ static gboolean init(int type) char *err_attr_name = NULL; int video_codec = MM_VIDEO_CODEC_INVALID; - int audio_codec = MM_AUDIO_CODEC_INVALID; int file_format = MM_FILE_FORMAT_INVALID; - int audio_enc = MM_AUDIO_CODEC_INVALID; - int channel = 0; int v_bitrate = 0; - int a_bitrate = 0; int video_width = 0; int video_height = 0; int video_fps = 0; - int audio_samplerate = 0; - int audio_src_format = 0; int video_src_format = 0; int rec_mode = 0; const char *filename = "/opt/usr/media/test.mp4"; @@ -1020,17 +1008,17 @@ static gboolean init(int type) *=================================================================================*/ if (type == MODE_VIDEO_CAPTURE) { video_codec = MM_VIDEO_CODEC_MPEG4; - /*audio_codec = MM_AUDIO_CODEC_AAC;*/ + /* audio_codec = MM_AUDIO_CODEC_AAC; */ file_format = MM_FILE_FORMAT_MP4; - /*audio_enc = MM_AUDIO_CODEC_PCM;*/ - /*channel = 1; - v_bitrate = 8000000; - /*a_bitrate = 64000;*/ + /* audio_enc = MM_AUDIO_CODEC_PCM; */ + /* channel = 1; */ + /* v_bitrate = 8000000; */ + /* a_bitrate = 64000; */ video_width = 640; video_height = 480; video_fps = 30; - /*audio_samplerate = 48000;*/ - /*audio_src_format = 2;*/ + /* audio_samplerate = 48000; */ + /* audio_src_format = 2; */ rec_mode = 0; video_src_format = MM_STREAMRECORDER_INPUT_FORMAT_NV12; mm_streamrecorder_set_attributes((MMHandleType)str_handle, &err_attr_name, -- 2.7.4