Auto-gen API header & dispatcher 25/61625/1
authorHyongtaek Lim <hyongtaek.lim@samsung.com>
Wed, 9 Mar 2016 08:19:49 +0000 (17:19 +0900)
committerHyongtaek Lim <hyongtaek.lim@samsung.com>
Wed, 9 Mar 2016 08:20:22 +0000 (17:20 +0900)
Signed-off-by: Hyongtaek Lim <hyongtaek.lim@samsung.com>
Change-Id: Ibfab0948691dc0de0c0cf95dc8aa3ba0002722a0

legacy/test/CMakeLists.txt
muse/CMakeLists.txt
muse/README_FOR_NEW_API [new file with mode: 0644]
muse/api.list [new file with mode: 0644]
muse/include/muse_player.h
muse/make_api.py [new file with mode: 0644]
muse/src/muse_player.c [new file with mode: 0644]
muse/src/muse_player_msg_dispatcher.c
muse/test/CMakeLists.txt [new file with mode: 0644]
muse/test/build_verify.c [new file with mode: 0644]
packaging/mmsvc-player.spec

index d5ed258..5607f48 100644 (file)
@@ -10,10 +10,9 @@ ENDIF(X11_SUPPORT)
 IF(WAYLAND_SUPPORT)
        SET(WIN_PKG "${WIN_PKG} ecore-wayland")
 ENDIF(WAYLAND_SUPPORT)
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_test} REQUIRED libtbm mm-player appcore-efl elementary ecore evas capi-media-sound-manager ${WIN_PKG})
-
-
 FOREACH(flag ${${fw_test}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index 63be246..cae4681 100644 (file)
@@ -38,6 +38,8 @@ ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 
+execute_process(COMMAND python make_api.py -l api.list WORKING_DIRECTORY ${service})
+
 aux_source_directory(src MUSED_SOURCES)
 ADD_LIBRARY(${fw_name} SHARED ${MUSED_SOURCES})
 
@@ -56,5 +58,7 @@ INSTALL(
         FILES_MATCHING
         PATTERN "*_private.h" EXCLUDE
         PATTERN "${INC_DIR}/*.h"
+        PATTERN "${INC_DIR}/*.def"
         )
 
+ADD_SUBDIRECTORY(test)
diff --git a/muse/README_FOR_NEW_API b/muse/README_FOR_NEW_API
new file mode 100644 (file)
index 0000000..5a8d344
--- /dev/null
@@ -0,0 +1,64 @@
+Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+
+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.
+------------------------------------------------------------------------
+
+API can be added using make_api.py python script with muse daemon
+1. Write new API except "player_" in api.list
+2. Write code for muse module in muse_player.c
+3. Write coed for client proxy in player.c
+
+Example>
+New api name is "player_xxx".
++-------------------------- api.list ---------------------------+
+|                                                               |
+| xxx                                                           |
+|                                                               |
++---------------------------------------------------------------+
+
++----------------------- muse_player.c -------------------------+
+|                                                               |
+| int player_disp_xxx(muse_module_h module)                     |
+| {                                                             |
+|     int ret = -1;                                             |
+|     intptr_t handle;                                          |
+|     muse_player_api_e api = MUSE_PLAYER_API_XXX;              |
+|                                                               |
+|     handle = muse_core_ipc_get_handle(module);                |
+|                                                               |
+|     ret = legacy_player_xxx((player_h)handle);                |
+|                                                               |
+|     player_msg_return(api, ret, module);                      |
+|                                                               |
+|     return ret;                                               |
+| }                                                             |
+|                                                               |
++---------------------------------------------------------------+
+
++------------------------- player.c ----------------------------+
+|                                                               |
+| int player_xxx(player_h player)                               |
+| {                                                             |
+|     PLAYER_INSTANCE_CHECK(player);                            |
+|     int ret = PLAYER_ERROR_NONE;                              |
+|     muse_player_api_e api = MUSE_PLAYER_API_XXX;              |
+|     player_cli_s *pc = (player_cli_s *)player;                |
+|     char *ret_buf = NULL;                                     |
+|                                                               |
+|     player_msg_send(api, pc, ret_buf, ret);                   |
+|                                                               |
+|     g_free(ret_buf);                                          |
+|     return ret;                                               |
+| }                                                             |
+|                                                               |
++---------------------------------------------------------------+
diff --git a/muse/api.list b/muse/api.list
new file mode 100644 (file)
index 0000000..a4e0248
--- /dev/null
@@ -0,0 +1,7 @@
+get_track_count
+get_current_track
+select_track
+get_track_language_code
+set_pcm_extraction_mode
+set_pcm_spec
+set_streaming_playback_rate
index a3f63be..c5e5975 100644 (file)
@@ -96,13 +96,7 @@ typedef enum {
        MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE,
        MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
        MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD,
-       MUSE_PLAYER_API_GET_TRACK_COUNT,
-       MUSE_PLAYER_API_GET_CURRENT_TRACK,
-       MUSE_PLAYER_API_SELECT_TRACK,
-       MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE,
-       MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE,
-       MUSE_PLAYER_API_SET_PCM_SPEC,
-       MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE,
+#include "muse_player_api.def"
        MUSE_PLAYER_API_MAX
 } muse_player_api_e;
 
diff --git a/muse/make_api.py b/muse/make_api.py
new file mode 100644 (file)
index 0000000..4e4375f
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+import sys, getopt
+
+def main(argv):
+       product = ""
+       try:
+               opts, args = getopt.getopt(argv, "hpl:", ["product","list"])
+       except getopt.GetoptError:
+               print 'make_api.py -l api.list [-p]'
+               sys.exit(1)
+       for opt, arg in opts:
+               if opt == '-h':
+                       print 'make_api.py -l api.list [-p]'
+                       sys.exit(0)
+               elif opt in ("-l", "--list"):
+                       ListFileName = arg
+               elif opt in ("-p", "--product"):
+                       product = "product_"
+
+       DefFileName = "include/muse_player_" + product + "api.def"
+       FuncFileName = "include/muse_player_" + product + "api.func"
+       HeadFileName = "include/muse_player_" + product + "api.h"
+
+
+
+       WarningText = "/***************************************************************\n* This is auto-gen file from " + ListFileName + "\n* Never modify this file.\n***************************************************************/\n"
+       HeaderPrefix = "#ifndef __AUTO_GEN_MUSE_PLAYER_" + product.upper() + "API_H__\n#define __AUTO_GEN_MUSE_PLAYER_" + product.upper() + "API_H__\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
+       HeaderPostfix = "#ifdef __cplusplus\n}\n#endif\n#endif"
+
+       ListFile = open(ListFileName)
+       DefFile = open(DefFileName, "w")
+       FuncFile = open(FuncFileName, "w")
+       HeadFile = open(HeadFileName, "w")
+
+       DefFile.write(WarningText)
+       FuncFile.write(WarningText)
+       HeadFile.write(WarningText)
+       HeadFile.write(HeaderPrefix)
+
+       for line in ListFile:
+               line = line.replace('\n', '')
+               if len(line) > 1:
+                       DefFile.write("MUSE_PLAYER_API_" + line.upper() +",\n")
+                       FuncFile.write("player_disp_" + line + ",\n")
+                       HeadFile.write("int player_disp_" + line + "(muse_module_h module);\n")
+
+       HeadFile.write(HeaderPostfix)
+
+       DefFile.close()
+       ListFile.close()
+       FuncFile.close()
+       HeadFile.close()
+
+if __name__ == "__main__":
+       main(sys.argv[1:])
diff --git a/muse/src/muse_player.c b/muse/src/muse_player.c
new file mode 100644 (file)
index 0000000..db3c53e
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 <tbm_bufmgr.h>
+#include <tbm_surface.h>
+#include <tbm_surface_internal.h>
+#include "muse_core.h"
+#include "muse_core_ipc.h"
+#include "muse_player.h"
+#include "muse_player_msg.h"
+#include "muse_player_api.h"
+#include "legacy_player_private.h"
+#include "legacy_player_internal.h"
+
+static tbm_bufmgr bufmgr;
+
+static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void *user_data)
+{
+       muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
+       muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME;
+       muse_module_h module = (muse_module_h)user_data;
+       tbm_bo bo;
+       tbm_bo_handle thandle;
+       tbm_key key;
+       char checker = 1;
+       unsigned int expired = 0x0fffffff;
+       int size = 0;
+       void *data = NULL;
+       if (audio_frame) {
+               size = audio_frame->size;
+               data = audio_frame->data;
+       } else {
+               LOGE("audio frame is NULL");
+               return;
+       }
+
+       LOGD("ENTER");
+
+       muse_core_ipc_get_bufmgr(&bufmgr);
+       bo = tbm_bo_alloc(bufmgr, size + 1, TBM_BO_DEFAULT);
+       if (!bo) {
+               LOGE("TBM get error : tbm_bo_alloc return NULL");
+               return;
+       }
+       thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+       if (thandle.ptr == NULL) {
+               LOGE("TBM get error : handle pointer is NULL");
+               tbm_bo_unref(bo);
+               return;
+       }
+       memcpy(thandle.ptr, data, size);
+       key = tbm_bo_export(bo);
+       if (key == 0) {
+               LOGE("TBM get error : export key is 0");
+               checker = 0;
+               tbm_bo_unmap(bo);
+               tbm_bo_unref(bo);
+               return;
+       }
+       /* mark to write */
+       *((char *)thandle.ptr + size) = 1;
+
+       tbm_bo_unmap(bo);
+
+       player_msg_event2_array(api, ev, module, INT, key, INT, size, audio_frame, sizeof(player_audio_raw_data_s), sizeof(char));
+
+       while (checker && expired--) {
+               thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+               checker = *((char *)thandle.ptr + size);
+               tbm_bo_unmap(bo);
+       }
+
+       tbm_bo_unref(bo);
+}
+
+int player_disp_get_track_count(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_COUNT;
+       player_stream_type_e type;
+       int count;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get(type, muse_core_client_get_msg(module));
+
+       ret = legacy_player_get_track_count((player_h)handle, type, &count);
+       if (ret == PLAYER_ERROR_NONE)
+               player_msg_return1(api, ret, module, INT, count);
+       else
+               player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_get_current_track(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_GET_CURRENT_TRACK;
+       player_stream_type_e type;
+       int index;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get(type, muse_core_client_get_msg(module));
+
+       ret = legacy_player_get_current_track((player_h)handle, type, &index);
+       if (ret == PLAYER_ERROR_NONE)
+               player_msg_return1(api, ret, module, INT, index);
+       else
+               player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_select_track(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK;
+       player_stream_type_e type;
+       int index;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get(type, muse_core_client_get_msg(module));
+       player_msg_get(index, muse_core_client_get_msg(module));
+
+       ret = legacy_player_select_track((player_h)handle, type, index);
+       player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_get_track_language_code(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE;
+       player_stream_type_e type;
+       int index;
+       char *code;
+       const int code_len = 2;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get(type, muse_core_client_get_msg(module));
+       player_msg_get(index, muse_core_client_get_msg(module));
+
+       ret = legacy_player_get_track_language_code((player_h)handle, type, index, &code);
+       if (ret == PLAYER_ERROR_NONE)
+               player_msg_return_array(api, ret, module, code, code_len, sizeof(char));
+       else
+               player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_set_pcm_extraction_mode(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE;
+       int sync;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get(sync, muse_core_client_get_msg(module));
+
+       ret = legacy_player_set_pcm_extraction_mode((player_h)handle, sync, _audio_frame_decoded_cb, module);
+
+       player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_set_pcm_spec(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_SPEC;
+       char format[MUSE_URI_MAX_LENGTH] = { 0, };
+       int samplerate;
+       int channel;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get_string(format, muse_core_client_get_msg(module));
+       player_msg_get(samplerate, muse_core_client_get_msg(module));
+       player_msg_get(channel, muse_core_client_get_msg(module));
+
+       ret = legacy_player_set_pcm_spec((player_h)handle, format, samplerate, channel);
+
+       player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+int player_disp_set_streaming_playback_rate(muse_module_h module)
+{
+       int ret = -1;
+       intptr_t handle;
+       muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE;
+       double rate = 0;
+
+       handle = muse_core_ipc_get_handle(module);
+       player_msg_get_type(rate, muse_core_client_get_msg(module), DOUBLE);
+
+       ret = legacy_player_set_streaming_playback_rate((player_h)handle, (float)rate);
+
+       player_msg_return(api, ret, module);
+
+       return ret;
+}
+
+
index e5f6d1a..47851ce 100644 (file)
@@ -22,6 +22,7 @@
 #include "muse_core_ipc.h"
 #include "muse_player.h"
 #include "muse_player_msg.h"
+#include "muse_player_api.h"
 #include "legacy_player_private.h"
 #include "legacy_player_internal.h"
 
@@ -236,64 +237,6 @@ static void _media_packet_video_decoded_cb(media_packet_h pkt, void *user_data)
        player_msg_event7_array(api, ev, module, INT, key[0], INT, key[1], INT, key[2], INT, key[3], POINTER, packet, INT, mimetype, INT64, pts, surface_info, surface_info_size, sizeof(char));
 }
 
-static void _audio_frame_decoded_cb(player_audio_raw_data_s * audio_frame, void *user_data)
-{
-       muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
-       muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME;
-       muse_module_h module = (muse_module_h)user_data;
-       tbm_bo bo;
-       tbm_bo_handle thandle;
-       tbm_key key;
-       char checker = 1;
-       unsigned int expired = 0x0fffffff;
-       int size = 0;
-       void *data = NULL;
-       if (audio_frame) {
-               size = audio_frame->size;
-               data = audio_frame->data;
-       } else {
-               LOGE("audio frame is NULL");
-               return;
-       }
-
-       LOGD("ENTER");
-
-       bo = tbm_bo_alloc(bufmgr, size + 1, TBM_BO_DEFAULT);
-       if (!bo) {
-               LOGE("TBM get error : tbm_bo_alloc return NULL");
-               return;
-       }
-       thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
-       if (thandle.ptr == NULL) {
-               LOGE("TBM get error : handle pointer is NULL");
-               tbm_bo_unref(bo);
-               return;
-       }
-       memcpy(thandle.ptr, data, size);
-       key = tbm_bo_export(bo);
-       if (key == 0) {
-               LOGE("TBM get error : export key is 0");
-               checker = 0;
-               tbm_bo_unmap(bo);
-               tbm_bo_unref(bo);
-               return;
-       }
-       /* mark to write */
-       *((char *)thandle.ptr + size) = 1;
-
-       tbm_bo_unmap(bo);
-
-       player_msg_event2_array(api, ev, module, INT, key, INT, size, audio_frame, sizeof(player_audio_raw_data_s), sizeof(char));
-
-       while (checker && expired--) {
-               thandle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
-               checker = *((char *)thandle.ptr + size);
-               tbm_bo_unmap(bo);
-       }
-
-       tbm_bo_unref(bo);
-}
-
 static void _video_stream_changed_cb(int width, int height, int fps, int bit_rate, void *user_data)
 {
        muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
@@ -1926,142 +1869,6 @@ static int player_disp_get_media_stream_buffer_min_threshold(muse_module_h modul
        return ret;
 }
 
-static int player_disp_get_track_count(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_COUNT;
-       player_stream_type_e type;
-       int count;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get(type, muse_core_client_get_msg(module));
-
-       ret = legacy_player_get_track_count((player_h)handle, type, &count);
-       if (ret == PLAYER_ERROR_NONE)
-               player_msg_return1(api, ret, module, INT, count);
-       else
-               player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_get_current_track(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_GET_CURRENT_TRACK;
-       player_stream_type_e type;
-       int index;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get(type, muse_core_client_get_msg(module));
-
-       ret = legacy_player_get_current_track((player_h)handle, type, &index);
-       if (ret == PLAYER_ERROR_NONE)
-               player_msg_return1(api, ret, module, INT, index);
-       else
-               player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_select_track(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_SELECT_TRACK;
-       player_stream_type_e type;
-       int index;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get(type, muse_core_client_get_msg(module));
-       player_msg_get(index, muse_core_client_get_msg(module));
-
-       ret = legacy_player_select_track((player_h)handle, type, index);
-       player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_get_track_language_code(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE;
-       player_stream_type_e type;
-       int index;
-       char *code;
-       const int code_len = 2;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get(type, muse_core_client_get_msg(module));
-       player_msg_get(index, muse_core_client_get_msg(module));
-
-       ret = legacy_player_get_track_language_code((player_h)handle, type, index, &code);
-       if (ret == PLAYER_ERROR_NONE)
-               player_msg_return_array(api, ret, module, code, code_len, sizeof(char));
-       else
-               player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_set_pcm_extraction_mode(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE;
-       int sync;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get(sync, muse_core_client_get_msg(module));
-
-       ret = legacy_player_set_pcm_extraction_mode((player_h)handle, sync, _audio_frame_decoded_cb, module);
-
-       player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_set_pcm_spec(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_SET_PCM_SPEC;
-       char format[MUSE_URI_MAX_LENGTH] = { 0, };
-       int samplerate;
-       int channel;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get_string(format, muse_core_client_get_msg(module));
-       player_msg_get(samplerate, muse_core_client_get_msg(module));
-       player_msg_get(channel, muse_core_client_get_msg(module));
-
-       ret = legacy_player_set_pcm_spec((player_h)handle, format, samplerate, channel);
-
-       player_msg_return(api, ret, module);
-
-       return ret;
-}
-
-static int player_disp_set_streaming_playback_rate(muse_module_h module)
-{
-       int ret = -1;
-       intptr_t handle;
-       muse_player_api_e api = MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE;
-       double rate = 0;
-
-       handle = muse_core_ipc_get_handle(module);
-       player_msg_get_type(rate, muse_core_client_get_msg(module), DOUBLE);
-
-       ret = legacy_player_set_streaming_playback_rate((player_h)handle, (float)rate);
-
-       player_msg_return(api, ret, module);
-
-       return ret;
-}
-
 int (*dispatcher[MUSE_PLAYER_API_MAX])(muse_module_h module) = {
        player_disp_create,                     /* MUSE_PLAYER_API_CREATE */
        player_disp_destroy,            /* MUSE_PLAYER_API_DESTROY */
@@ -2128,11 +1935,5 @@ int (*dispatcher[MUSE_PLAYER_API_MAX])(muse_module_h module) = {
        player_disp_get_media_stream_buffer_max_size,   /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MAX_SIZE */
        player_disp_set_media_stream_buffer_min_threshold,      /* MUSE_PLAYER_API_SET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
        player_disp_get_media_stream_buffer_min_threshold,      /* MUSE_PLAYER_API_GET_MEDIA_STREAM_BUFFER_MIN_THRESHOLD */
-       player_disp_get_track_count,    /* MUSE_PLAYER_API_GET_TRACK_COUNT */
-       player_disp_get_current_track,  /* MUSE_PLAYER_API_GET_CURRENT_TRACK */
-       player_disp_select_track,               /* MUSE_PLAYER_API_SELECT_TRACK */
-       player_disp_get_track_language_code,    /* MUSE_PLAYER_API_GET_TRACK_LANGUAGE_CODE */
-       player_disp_set_pcm_extraction_mode,    /* MUSE_PLAYER_API_SET_PCM_EXTRACTION_MODE */
-       player_disp_set_pcm_spec,                               /* MUSE_PLAYER_API_SET_PCM_SPEC */
-       player_disp_set_streaming_playback_rate,        /* MUSE_PLAYER_API_SET_STREAMING_PLAYBACK_RATE */
+#include "muse_player_api.func"
 };
diff --git a/muse/test/CMakeLists.txt b/muse/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a240b33
--- /dev/null
@@ -0,0 +1,22 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(fw_test "${fw_name}-test")
+
+INCLUDE_DIRECTORIES(../muse/include)
+link_directories(${CMAKE_SOURCE_DIR}/../)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_test} REQUIRED mused capi-media-sound-manager)
+FOREACH(flag ${${fw_test}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -pie")
+
+aux_source_directory(. sources)
+FOREACH(src ${sources})
+    GET_FILENAME_COMPONENT(src_name ${src} NAME_WE)
+    MESSAGE("${src_name}")
+    ADD_EXECUTABLE(${src_name} ${src})
+    TARGET_LINK_LIBRARIES(${src_name} muse-player ${${fw_test}_LDFLAGS})
+ENDFOREACH()
+
diff --git a/muse/test/build_verify.c b/muse/test/build_verify.c
new file mode 100644 (file)
index 0000000..20a888f
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 <muse_core.h>
+#include <muse_core_ipc.h>
+#include "muse_player.h"
+#include "muse_player_msg.h"
+
+/*
+* This is only for build verify
+* Does NOT include package
+*/
+
+int main(){
+       return 0;
+}
index ad220f0..328ad2d 100644 (file)
@@ -99,6 +99,7 @@ rm -rf %{buildroot}
 
 %files devel
 %{_includedir}/media/*.h
+%{_includedir}/media/*.def
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/liblegacy-player.so
 %{_libdir}/libmuse-player.so