Improve GlobalVariable violation 55/297455/2 accepted/tizen/8.0/unified/20231005.092738 accepted/tizen/unified/20230822.043326 accepted/tizen/unified/dev/20240620.004127 tizen_8.0_m2_release
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 18 Aug 2023 11:12:21 +0000 (20:12 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 18 Aug 2023 11:20:16 +0000 (20:20 +0900)
SAM Score: 3.71 -> 3.73
GV: 0.85 -> 1

[Version] 0.1.29
[Issue Type] SAM

Change-Id: I5c520f94e0b9d7cbfc90d2b993e7a3af206cb089

packaging/capi-mediamuxer.spec
test/mediamuxer_test.c
test/mediamuxer_test_with_mediacodec.c

index fd3e785..b122c34 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-mediamuxer
 Summary:    A Media Muxer library in Tizen Native API
-Version:    0.1.28
+Version:    0.1.29
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index af2dc8c..d420862 100644 (file)
@@ -75,18 +75,12 @@ enum {
 };
 
 mediamuxer_h myMuxer = 0;
-media_format_h media_format = NULL;
+static media_format_h media_format = NULL;
 media_format_h media_format_a = NULL;
-media_format_h media_format_t = NULL;
+static media_format_h media_format_t = NULL;
 media_format_h input_fmt = NULL;
 
-int use_video = 1;   /* 1 to test video with codec,   0 for audio */
-int use_encoder = 1;
 media_format_mimetype_e mimetype;
-int width = DEFAULT_OUT_BUF_WIDTH;
-int height = DEFAULT_OUT_BUF_HEIGHT;
-float fps = 0;
-int target_bits = 0;
 
 int samplerate = DEFAULT_SAMPPLERATE;
 int channel = DEFAULT_CHANNEL;
@@ -95,17 +89,22 @@ int pcm_format = 0;
 unsigned char buf_adts[ADTS_HEADER_SIZE];
 uint64_t pts = 0;
 #ifdef USE_MEDIA_CODEC
+int use_video = 1;   /* 1 to test video with codec,   0 for audio */
+int use_encoder = 1;
+int width = DEFAULT_OUT_BUF_WIDTH;
+int height = DEFAULT_OUT_BUF_HEIGHT;
+float fps = 0;
+int target_bits = 0;
 static int bitrate = DEFAULT_BITRATE;
 #endif
-int iseos_codec = 0;
-bool validate_with_codec = false;
+static bool validate_with_codec = false;
 bool validate_multitrack = false;
-bool validate_with_demux = false;
-bool validate_with_pcm = false;
+static bool validate_with_demux = false;
+static bool validate_with_pcm = false;
 
 char media_file[MAX_INPUT_SIZE];
 char data_sink[MAX_INPUT_SIZE];
-bool have_mp4 = false;
+static bool have_mp4 = false;
 bool have_vid_track = false;
 bool have_aud_track = false;
 bool have_text_track = false;
@@ -113,12 +112,14 @@ int track_index_vid = -1;
 int track_index_aud = -1;
 int track_index_aud2 = -1;
 int track_index_text = -1;
-int g_menu_state = CURRENT_STATUS_MAINMENU;
+static int g_menu_state = CURRENT_STATUS_MAINMENU;
 
-int demuxer_index_vid = -1;
-int demuxer_index_aud = -1;
-bool is_video = false;
-bool is_audio = false;
+#ifdef USE_MEDIA_DEMUX
+static int demuxer_index_vid = -1;
+static int demuxer_index_aud = -1;
+static bool is_video = false;
+static bool is_audio = false;
+#endif
 
 int demux_mp4();
 int demux_audio(bool need_demux);
index a7be998..b82739a 100644 (file)
@@ -475,7 +475,7 @@ unsigned int __extract_input_aacenc(FILE *fd, unsigned char* rawdata)
        readsize = ((samplebyte * channel) * (bit / 8));
        result = fread(buffer, 1, readsize, fd);
        if (result != readsize)
-               g_print("different size of read. result is %d\n", result);
+               g_print("different size of read. result is %zu\n", result);
 
        memcpy(rawdata, buffer, result);