summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungbae Shin <seungbae.shin@samsung.com>2018-09-04 13:25:56 +0900
committerSeungbae Shin <seungbae.shin@samsung.com>2018-09-04 13:40:18 +0900
commited7fd91231042534b90f88f11be584917393ef06 (patch)
treeb8c9ec90e4409e8503c841811fd5b66da4c5ac78
parent910c47d1aac9c0c497698f2c71456fabcfca4a7b (diff)
downloadmm-hal-interface-ed7fd91231042534b90f88f11be584917393ef06.tar.gz
mm-hal-interface-ed7fd91231042534b90f88f11be584917393ef06.tar.bz2
mm-hal-interface-ed7fd91231042534b90f88f11be584917393ef06.zip
Remove duplicated class declaration & Remove warnings for codec testsubmit/tizen/20180904.104810submit/tizen/20180904.063940accepted/tizen/unified/20180905.060826
[Version] 0.0.17 [Profile] Common [Issue Type] Revise [Dependency module] N/A Change-Id: I86c280b70e2852a63621ca448937e487196df984
-rwxr-xr-xpackaging/mm-hal-interface.spec4
-rw-r--r--testcase/audio/parser.cpp36
-rw-r--r--testcase/audio/parser.hh20
-rw-r--r--testcase/codec/Makefile.am2
-rw-r--r--testcase/codec/codec_haltests.cpp18
5 files changed, 32 insertions, 48 deletions
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 <string.h>
#include <string>
+#include <parser.hh>
+
#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<string, string>& device);
- void parse_device_file_array_object(json_object *device_file_array_o, pair<string, string>& 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<string, string> m_playback; // device_string, device_params
- pair<string, string> 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 <seungbae.shin@samsung.com>
+ *
+ * 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 <iostream>
#include <string>
#include <json.h>
-#include <assert.h>
-#include <string.h>
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) {