[0.3.68] remove app dependency at audio_test 35/145735/4
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 23 Aug 2017 11:49:57 +0000 (20:49 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 23 Aug 2017 12:07:06 +0000 (21:07 +0900)
Change-Id: I353b927633f94e8b9dd276a66bc369c6acb17933

packaging/capi-media-player.spec
test/player_audio_test.c

index 5433766..c2d8090 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.67
+Version:    0.3.68
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index d7c8a9b..5436d8d 100644 (file)
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-#include <player.h>
-#include <player_internal.h>
-#include <sound_manager.h>
-#include <pthread.h>
+
 #include <glib.h>
-#include <dlfcn.h>
-#include <appcore-efl.h>
-#include <Ecore.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <system_info.h>
+#include <sound_manager.h>
+#include "player.h"
+#include "player_internal.h"
 
 #ifdef PACKAGE
 #undef PACKAGE
@@ -36,8 +36,7 @@
 #define PLAYER_AUDIO_TEST_DUMP_PATH_PREFIX   "/home/owner/dump_pcm_"
 #define DEFAULT_HTTP_TIMEOUT -1
 
-#include <system_info.h>
-#include <stdlib.h>
+
 typedef enum {
        TIZEN_PROFILE_UNKNOWN = 0,
        TIZEN_PROFILE_MOBILE = 0x1,
@@ -139,24 +138,9 @@ static player_h g_player[MAX_HANDLE] = { 0, };
 static player_seek_pos_t seek_info = {0};
 int g_handle_num = 1;
 int g_menu_state = CURRENT_STATUS_MAINMENU;
-gboolean quit_pushing;
 sound_stream_info_h g_stream_info_h = NULL;
 static adaptive_variant_info_t max_limit = {-1, -1, -1};
 
-static int app_create(void *data)
-{
-       return 0;
-}
-static int app_terminate(void *data)
-{
-       return 0;
-}
-
-struct appcore_ops ops = {
-       .create = app_create,
-       .terminate = app_terminate,
-};
-
 static void prepared_cb(void *user_data)
 {
        g_print("[Player_Audio_Test] prepared_cb!!!!\n");
@@ -1000,7 +984,6 @@ static void get_audio_eq()
 
 void quit_program()
 {
-
        if (g_pcm_fd)
                fclose(g_pcm_fd);
 
@@ -1008,12 +991,11 @@ void quit_program()
                _player_unprepare();
                _player_destroy();
        }
-       printf("call quit_program, but can not call elm_exit()..please Ctrl+c\n");
-#ifdef TIZEN_PLAYER_TEST_ENABLE_VIDEO
-       elm_exit();
-#endif
+
        if (g_audio_fmt)
                media_format_unref(g_audio_fmt);
+
+       exit(0);
 }
 
 void play_with_ini(char *file_path)
@@ -1069,7 +1051,6 @@ void _interpret_main_menu(char *cmd)
                } else if (strncmp(cmd, "D", 1) == 0) {
                        decoding_audio();
                } else if (strncmp(cmd, "q", 1) == 0) {
-                       quit_pushing = TRUE;
                        quit_program();
                } else if (strncmp(cmd, "E", 1) == 0) {
                        g_menu_state = CURRENT_STATUS_AUDIO_EQUALIZER;
@@ -1394,11 +1375,16 @@ gboolean input(GIOChannel * channel)
 int main(int argc, char *argv[])
 {
        GIOChannel *stdin_channel;
+       GMainLoop *loop = g_main_loop_new(NULL, 0);
        stdin_channel = g_io_channel_unix_new(0);
        g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
        g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc) input, NULL);
 
        displaymenu();
-       return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
 
+       g_main_loop_run(loop);
+
+       g_print("exit player_audio_test\n");
+       g_main_loop_unref(loop);
+       return 0;
 }