From: Seungbae Shin Date: Tue, 4 Sep 2018 04:25:56 +0000 (+0900) Subject: Remove duplicated class declaration & Remove warnings for codec test X-Git-Tag: submit/tizen/20180904.063940 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen%2F20180904.063940;p=platform%2Fcore%2Fmultimedia%2Fmm-hal-interface.git Remove duplicated class declaration & Remove warnings for codec test [Version] 0.0.17 [Profile] Common [Issue Type] Revise [Dependency module] N/A Change-Id: I86c280b70e2852a63621ca448937e487196df984 --- diff --git a/packaging/mm-hal-interface.spec b/packaging/mm-hal-interface.spec index 5592c56..b6415d8 100755 --- a/packaging/mm-hal-interface.spec +++ b/packaging/mm-hal-interface.spec @@ -1,6 +1,6 @@ Name: mm-hal-interface Summary: Multimedia HAL Interface -Version: 0.0.16 +Version: 0.0.17 Release: 0 Group: Multimedia/Development License: Apache-2.0 @@ -154,7 +154,6 @@ rm -rf %{_datadir}/testcase/res/ %manifest mm-hal-interface-codec.manifest %license LICENSE.APLv2 %defattr(-,root,root,-) -%{_libdir}/libcodec*.so.* %files devel %defattr(-,root,root,-) @@ -188,4 +187,5 @@ rm -rf %{_datadir}/testcase/res/ %license LICENSE.APLv2 %defattr(-,root,root,-) %{_bindir}/codec_* +%{_libdir}/libcodec*.so.* %{_datadir}/testcase/res/codec/* diff --git a/testcase/audio/parser.cpp b/testcase/audio/parser.cpp index 05099ee..a9c5609 100644 --- a/testcase/audio/parser.cpp +++ b/testcase/audio/parser.cpp @@ -4,6 +4,8 @@ #include #include +#include + #define DEVICE_FILE_OBJECT "device-files" #define DEVICE_TYPE_PROP_PLAYBACK_DEVICES "playback-devices" #define DEVICE_TYPE_PROP_CAPTURE_DEVICES "capture-devices" @@ -33,40 +35,6 @@ using namespace std; -class CDeviceMapParser -{ -public: - CDeviceMapParser(); - CDeviceMapParser(const char* map_file); - virtual ~CDeviceMapParser(); - - void dump_devices(); - - void get_playback(string& card, string& device_num, int& rate, int& channels); - void get_capture(string& card, string& device_num, int& rate, int& channels); - -private: - void open_json(const char* json_file); - void close_json(); - void parse_device_string_object(json_object *device_string_o, string& device_string); - void parse_device_role_object(json_object *device_role_o, string& device_params); - void parse_device_file_object(json_object *device_file_o, pair& device); - void parse_device_file_array_object(json_object *device_file_array_o, pair& device); - - void parse_playback(); - void parse_capture(); - void get_device(string& s, string& card, string& device_num); - void get_params(string& s, int& rate, int& channels); - void get_single_param(string& s, int& rate, int& channels); - - // FixMe, pair doens't define what is paired clearly.... - pair m_playback; // device_string, device_params - pair m_capture; // device_string, device_params - - json_object *m_json_obj; - json_object *m_json_device_files_obj; -}; - CDeviceMapParser::CDeviceMapParser() { open_json("/etc/pulse/device-map.json"); diff --git a/testcase/audio/parser.hh b/testcase/audio/parser.hh index b53ba89..c0d421f 100644 --- a/testcase/audio/parser.hh +++ b/testcase/audio/parser.hh @@ -1,8 +1,24 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Seungbae Shin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include #include #include -#include -#include using namespace std; diff --git a/testcase/codec/Makefile.am b/testcase/codec/Makefile.am index d82559e..014213c 100644 --- a/testcase/codec/Makefile.am +++ b/testcase/codec/Makefile.am @@ -1,7 +1,7 @@ # with gtest bin_PROGRAMS = codec_haltests -TEST_FILES_DIRECTORY = /usr/share/testcase/res +TEST_FILES_DIRECTORY = /usr/share/testcase/res/codec codec_haltests_SOURCES = \ codec_haltests.cpp diff --git a/testcase/codec/codec_haltests.cpp b/testcase/codec/codec_haltests.cpp index 04a5313..41498aa 100644 --- a/testcase/codec/codec_haltests.cpp +++ b/testcase/codec/codec_haltests.cpp @@ -37,7 +37,7 @@ typedef struct _codec_list_t codec_list_t; #define CODEC_INI_GET_STRING(x_dict, x_item, x_ini, x_default) \ do {\ - gchar* str = iniparser_getstring(x_dict, x_ini, x_default); \ + char* str = iniparser_getstring(x_dict, x_ini, x_default); \ \ if (str && \ (strlen(str) > 0) && \ @@ -55,8 +55,8 @@ typedef enum { struct _codec_list_t { codec_list_e ename; - gchar cname[CODEC_INI_MAX_STRLEN]; - gchar plugins[2][CODEC_INI_MAX_STRLEN]; + char cname[CODEC_INI_MAX_STRLEN]; + char plugins[2][CODEC_INI_MAX_STRLEN]; }; static codec_list_t codec_list[] = { @@ -73,16 +73,16 @@ void get_plugins_list_from_ini(dictionary *dict, codec_list_t *codec_list, int c char *usr_ptr = NULL; const char *delimiters = " ,"; size_t len; - gchar port_name[CNAME_SIZE]; - gchar temp[CNAME_SIZE]; - gchar cname[CNAME_SIZE]; + char port_name[CNAME_SIZE]; + char temp[CNAME_SIZE]; + char cname[CNAME_SIZE]; const char *type[2]; type[0] = ":hw_decoder"; type[1] = ":hw_encoder"; - CODEC_INI_GET_STRING(dict, port_name, "port_in_use:media_codec_port", DEFAULT_PORT); + CODEC_INI_GET_STRING(dict, port_name, (char *)"port_in_use:media_codec_port", (char *)DEFAULT_PORT); - if (strcmp(port_name, "GST_PORT") == 0) { + if (strcmp(port_name, DEFAULT_PORT) == 0) { for (i = 0; i < 2; i++) { for (j = 0; j < codec_num; j++) { index = 0; @@ -90,7 +90,7 @@ void get_plugins_list_from_ini(dictionary *dict, codec_list_t *codec_list, int c snprintf(cname, CNAME_SIZE, "%s", codec_list[j].cname); len = strlen(cname); snprintf(cname + len, CNAME_SIZE - len, "%s", type[i]); - CODEC_INI_GET_STRING(dict, temp, cname, ""); + CODEC_INI_GET_STRING(dict, temp, cname, (char *)""); token = strtok_r(temp, delimiters, &usr_ptr); while (token) {