tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.034304 submit/tizen_2.4/20151028.063738 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:27:58 +0000 (16:27 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:27:58 +0000 (16:27 +0900)
include/wav_player.h [changed mode: 0755->0644]
include/wav_player_internal.h [new file with mode: 0644]
packaging/capi-media-wav-player.spec
src/wav_player.c
src/wav_player_internal.c [new file with mode: 0644]
test/multimedia_wav_player_test.c

old mode 100755 (executable)
new mode 100644 (file)
index db65bf5..705aa56
@@ -41,10 +41,10 @@ extern "C"
  */
 typedef enum
 {
-    WAV_PLAYER_ERROR_NONE        = TIZEN_ERROR_NONE,                      /**< Successful */
-    WAV_PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,       /**< Invalid parameter */
-    WAV_PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,       /**< Invalid operation */
-    WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED = TIZEN_ERROR_WAV_PLAYER | 0x01                        /**< Format not supported */
+    WAV_PLAYER_ERROR_NONE                 = TIZEN_ERROR_NONE,                  /**< Successful */
+    WAV_PLAYER_ERROR_INVALID_PARAMETER    = TIZEN_ERROR_INVALID_PARAMETER,     /**< Invalid parameter */
+    WAV_PLAYER_ERROR_INVALID_OPERATION    = TIZEN_ERROR_INVALID_OPERATION,     /**< Invalid operation */
+    WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED = TIZEN_ERROR_WAV_PLAYER | 0x01      /**< Format not supported */
 } wav_player_error_e;
 
 /**
@@ -60,13 +60,13 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
 /**
  * @brief Plays a WAV file.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] path     The WAV file path to the file to be played
+ * @param[in] path     The file path to play
  * @param[in] type     The sound type
  * @param[in] callback The callback function to be invoked when a WAV file is no longer being played
  * @param[in] user_data        The user data to be passed to the callback function
  * @param[out] id      The WAV player ID (can be set to @c NULL)
  *
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #WAV_PLAYER_ERROR_NONE Successful
  * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
diff --git a/include/wav_player_internal.h b/include/wav_player_internal.h
new file mode 100644 (file)
index 0000000..0176a2b
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+* 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.
+*/
+
+#ifndef __TIZEN_MEDIA_WAV_PLAYER_INTERNAL_H__
+#define __TIZEN_MEDIA_WAV_PLAYER_INTERNAL_H__
+
+#include <tizen.h>
+#include <sound_manager.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*
+ * @file wav_player_internal.h
+ * @brief This file contains the WAV player API.
+ */
+
+/**
+ * @brief Plays a WAV file.
+ * @param[in] path     The WAV file path to play
+ * @param[in] type     The sound type
+ * @param[in] callback The callback function to invoke when a WAV file is finished playing
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @param[in] loop_count The number of loops for playing (-1 for infinite playing)
+ * @param[out] id      The WAV player ID ( can be set to NULL )
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WAV_PLAYER_ERROR_NONE Successful
+ * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @post       It invokes wav_player_playback_completed_cb() when a WAV file has finished playing.
+ * @see wav_player_stop()
+ * @see wav_player_playback_completed_cb()
+ */
+int wav_player_start_loop (const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int loop_count, int * id);
+
+/**
+ * @brief Plays a WAV file (with no session, other streams will be muted).
+ * @param[in] path     The WAV file path to play
+ * @param[in] type     The sound type
+ * @param[in] force_to_route_spk       Route output path to speaker
+ * @param[in] callback The callback function to invoke when a WAV file is finished playing
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @param[out] id      The WAV player ID ( can be set to NULL )
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WAV_PLAYER_ERROR_NONE Successful
+ * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @post       It invokes wav_player_playback_completed_cb() when a WAV file has finished playing.
+ * @see wav_player_stop()
+ * @see wav_player_playback_completed_cb()
+ */
+int wav_player_start_solo(const char *path, sound_type_e type, bool force_to_route_spk, wav_player_playback_completed_cb cb, void *user_data, int * id);
+
+/**
+ * @brief Plays a WAV file (with no session, other streams will be muted).
+ * @param[in] path     The WAV file path to play
+ * @param[in] type     The sound type
+ * @param[in] callback The callback function to invoke when a WAV file is finished playing
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @param[in] loop_count The number of loops for playing (-1 for infinite playing)
+ * @param[out] id      The WAV player ID ( can be set to NULL )
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WAV_PLAYER_ERROR_NONE Successful
+ * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @post       It invokes wav_player_playback_completed_cb() when a WAV file has finished playing.
+ * @see wav_player_stop()
+ * @see wav_player_playback_completed_cb()
+ */
+int wav_player_start_solo_loop(const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int loop_count, int * id);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_MEDIA_WAV_PLAYER_INTERNAL_H__ */
index 2405a34..5c201c5 100644 (file)
@@ -1,10 +1,10 @@
 #sbs-git:slp/api/wav-player capi-media-wav-player 0.1.0 8d904bb3bd0ca7fa01ebd8f4185e4b993d94c08d
 Name:       capi-media-wav-player
 Summary:    A wav player library in SLP C API
-Version:    0.1.12
+Version:    0.1.19
 Release:    0
-Group:      TO_BE/FILLED_IN
-License:    Apache License, Version 2.0
+Group:      libdevel
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(mm-sound)
index 70afc9a..279297b 100644 (file)
@@ -79,5 +79,4 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
 int wav_player_stop(int id)
 {
        return __convert_wav_player_error_code(__func__, mm_sound_stop_sound(id));
-}
-
+}
\ No newline at end of file
diff --git a/src/wav_player_internal.c b/src/wav_player_internal.c
new file mode 100644 (file)
index 0000000..de2af26
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+* 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.
+*/
+
+#define LOG_TAG "CAPI_MEDIA_WAV_PLAYER"
+
+#include <mm_sound.h>
+#include <mm_sound_private.h>
+#include <stdio.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <dlog.h>
+#include "wav_player.h"
+#include "wav_player_internal.h"
+#include "wav_player_private.h"
+#include <stdlib.h>
+
+int wav_player_start_loop (const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int loop_count, int * id)
+{
+       int ret = MM_ERROR_NONE;
+       return __convert_wav_player_error_code(__func__, ret);
+}
+
+int wav_player_start_solo(const char *path, sound_type_e type, bool force_to_route_spk, wav_player_playback_completed_cb cb, void *user_data, int * id)
+{
+       int ret = MM_ERROR_NONE;
+       return __convert_wav_player_error_code(__func__, ret);
+}
+
+int wav_player_start_solo_loop(const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int loop_count, int * id)
+{
+       int ret = MM_ERROR_NONE;
+       return __convert_wav_player_error_code(__func__, ret);
+}
index d9d5c8d..77b87f1 100644 (file)
@@ -56,13 +56,7 @@ void audio_io_test(){
 
 int main(int argc, char**argv)
 {
-       if( !g_thread_supported() )
-       {
-               g_thread_init(NULL);
-       }
-
-       GError *gerr = NULL;
-       event_thread = g_thread_create(GmainThread, NULL, 1, &gerr);
+       event_thread = g_thread_new("WavPlayerTest", GmainThread, NULL);
 
        wav_play_test();
        return 0;