ENDIF(${USE_MIXER} STREQUAL "yes")
IF(${TIZEN_PUBLIC} STREQUAL "ON")
+SET(PC_REQUIRED "capi-media-sound-manager")
SET(PC_CFLAGS "${PC_CFLAGS} -DTIZEN_FEATURE_PUBLIC")
ENDIF(${TIZEN_PUBLIC} STREQUAL "ON")
-\r
-prefix = @PREFIX@\r
-exec_prefix = /usr\r
-libdir = @LIB_INSTALL_DIR@\r
-\r
-Name: @PC_NAME@\r
-Description: @PACKAGE_DESCRYPTION@\r
-Version: @VERSION@\r
-Libs: -L${libdir} @PC_LDFLAGS@\r
-Cflags : @PC_CFLAGS@\r
+
+prefix = @PREFIX@
+exec_prefix = /usr
+libdir = @LIB_INSTALL_DIR@
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRYPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags : @PC_CFLAGS@
#include <utility>
#include <vector>
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <sound_manager.h>
+#endif
+
#ifdef USE_MIXER
#include "mixer/mixer.h"
#endif
* @return @c True on success, otherwise @c False
*/
virtual bool EnableVideoHole(bool value) { return false; }
+
+ /**
+ * @brief Set sound stream information
+ * @param [in] stream_info : sound stream information
+ * @pre The player state must be set to #EsState::kIdle.
+ * @post None
+ * @return @c True on success, otherwise @c False
+ * @exception None
+ */
+ virtual bool SetSoundStreamInfo(const sound_stream_info_h stream_info) {
+ return false;
+ }
#endif
// LCOV_EXCL_STOP
#ifndef __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
#define __ESPLUSPLAYER_ESPLUSPLAYER_CAPI_ESPLUSPLAYER_CAPI_H__
+#ifdef TIZEN_FEATURE_PUBLIC
+#include <media/sound_manager.h>
+#endif
+
#include "esplusplayer_capi/buffer.h"
#include "esplusplayer_capi/display.h"
#include "esplusplayer_capi/drm.h"
* esplusplayer_set_media_packet_video_decoded_cb()
*/
int esplusplayer_enable_video_hole(esplusplayer_handle handle, const bool value);
+
+/**
+ * @brief Set sound stream information
+ * @param [in] handle : esplusplayer handle.
+ * @param [in] stream_info : sound stream information
+ * @return @c ESPLUSPLAYER_ERROR_TYPE_NONE on success,otherwise @c one of
+ * esplusplayer_error_type
+ * values will be returned.
+ * @retval #ESPLUSPLAYER_ERROR_TYPE_NONE Successful
+ * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER Invalid parameter
+ * @retval #ESPLUSPLAYER_ERROR_TYPE_INVALID_OPERATION Internal operation
+ * failed
+ * @code
+ * esplusplayer_open(esplayer);
+ * esplusplayer_set_sound_stream_info(esplayer, stream_info);
+ * // ... your codes ...
+ * esplusplayer_close(esplayer);
+ * @endcode
+ * @pre The player state must be set to #ESPLUSPLAYER_STATE_IDLE
+ * @post None
+ * @exception None
+ * @see esplusplayer_open()
+ */
+int esplusplayer_set_sound_stream_info(
+ esplusplayer_handle handle, const sound_stream_info_h stream_info);
#endif
#ifdef __cplusplus
}
Name: esplusplayer
Summary: new multimedia streaming player
Version: 1.2.1
-Release: 1
+Release: 2
Group: Multimedia/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(ecore-wl2)
%if %{with TIZEN_PUBLIC}
BuildRequires: pkgconfig(libtrackrenderer)
+BuildRequires: pkgconfig(capi-media-sound-manager)
# for test
BuildRequires: pkgconfig(capi-mediademuxer)
BuildRequires: pkgconfig(appcore-efl)
ELSE(${PRODUCT_TYPE_AUDIO} STREQUAL "no")
SET(dependents ${dependents} "libavoc-av")
ENDIF(${PRODUCT_TYPE_AUDIO} STREQUAL "no")
+ELSE(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "capi-media-sound-manager")
ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
INCLUDE(FindPkgConfig)
bool GetVideoStreamRotationInfo(VideoRotation* rotation) override;
bool SetSimpleMixOutBufferLevel(
const PlayerSimpleMixOutBufferLevel level) override;
+#ifdef TIZEN_FEATURE_PUBLIC
+ bool EnableVideoHole(bool value) override;
+ bool SetSoundStreamInfo(const sound_stream_info_h stream_info) override;
+#endif // TIZEN_FEATURE_PUBLIC
private:
using SubmitPacketOperator =
};
#endif // USE_MIXER
-#ifdef TIZEN_FEATURE_PUBLIC
- bool EnableVideoHole(bool value) override;
-#endif
private:
std::vector<Track> track_;
}
return trackrenderer_->EnableVideoHole(value);
}
+
+bool EsPlayer::SetSoundStreamInfo(const sound_stream_info_h stream_info) {
+ if (state_manager_.GetState() != EsState::kIdle) {
+ LOG_ERROR_P(this, "Invalid State , current %d",
+ state_manager_.GetStateEnum());
+ return false;
+ }
+ if (!stream_info) {
+ LOG_ERROR_P(this, "stream_info is null");
+ return false;
+ }
+ return trackrenderer_->SetSoundStreamInfo(stream_info);
+}
#endif
namespace es_conf {
auto ret = cast_(handle)->EnableVideoHole(value);
return convert_return_type_(ret);
}
+
+int esplusplayer_set_sound_stream_info(
+ esplusplayer_handle handle, const sound_stream_info_h stream_info) {
+ LOG_ENTER_P(cast_(handle))
+ if (is_null_(handle) || is_null_(stream_info))
+ return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
+
+ auto ret = cast_(handle)->SetSoundStreamInfo(stream_info);
+ return convert_return_type_(ret);
+}
#endif
SET(dependents ${dependents} "context-aware-api"
"drmdecrypt"
"logger")
+ELSE(${TIZEN_PUBLIC} STREQUAL "OFF")
+SET(dependents ${dependents} "capi-media-sound-manager")
ENDIF(${TIZEN_PUBLIC} STREQUAL "OFF")
INCLUDE(FindPkgConfig)
bool SetSimpleMixOutBufferLevel(const int& level);
#ifdef TIZEN_FEATURE_PUBLIC
bool EnableVideoHole(bool value);
+ bool SetSoundStreamInfo(const sound_stream_info_h stream_info);
#endif
private:
bool TrackRendererAdapter::EnableVideoHole(bool value) {
return (trackrenderer_enable_video_hole(handle_, value) != kFailed);
}
+
+bool TrackRendererAdapter::SetSoundStreamInfo(
+ const sound_stream_info_h stream_info) {
+ return (trackrenderer_set_sound_stream_info(handle_, stream_info) != kFailed);
+}
#endif
// LCOV_EXCL_START
SET(${fw_name}_LDFLAGS)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED glib-2.0 appcore-efl elementary capi-mediademuxer)
+pkg_check_modules(${fw_test} REQUIRED glib-2.0 appcore-efl elementary capi-mediademuxer capi-media-sound-manager)
FOREACH(flag ${${fw_test}_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#include <dlog.h>
#include <mediademuxer.h>
#include <getopt.h>
+#include <sound_manager.h>
#include "esplusplayer_capi/esplusplayer_capi.h"
#include "esplusplayer_capi/esplusplayer_internal.h"
CURRENT_STATUS_ENABLE_VIDEO_HOLE,
CURRENT_STATUS_SET_RENDER_TIME_OFFSET,
CURRENT_STATUS_SET_LOW_LATENCY_MODE,
+ CURRENT_STATUS_SET_SOUND_STREAM_INFO,
};
/* for video display */
bool stop_thread;
int video_track_id;
int audio_track_id;
+ sound_stream_info_h stream_info;
} test_h;
static appdata g_ad;
return;
}
+ if (g_test_h->stream_info) {
+ sound_manager_destroy_stream_information(g_test_h->stream_info);
+ g_test_h->stream_info = NULL;
+ }
+
// need to stop feeding thread;
mediademuxer_stop(g_test_h->demux_h);
mediademuxer_unprepare(g_test_h->demux_h);
return;
}
+ if (g_test_h->stream_info) {
+ sound_manager_destroy_stream_information(g_test_h->stream_info);
+ g_test_h->stream_info = NULL;
+ }
+
int ret = esplusplayer_close(g_test_h->espp_h);
if (ret != ESPLUSPLAYER_ERROR_TYPE_NONE)
g_print(" => failed to esplusplayer_close()\n");
g_print(" => esplusplayer_enable_video_hole() success\n");
}
+static void __test_set_sound_stream_info(int type)
+{
+ if (!g_test_h) {
+ g_print("test handle is NULL\n");
+ return;
+ }
+
+ sound_device_list_h device_list = NULL;
+ int ret = SOUND_MANAGER_ERROR_NONE;
+
+ if (g_test_h->stream_info) {
+ sound_manager_destroy_stream_information(g_test_h->stream_info);
+ g_print("stream information is already set, destroy stream info\n");
+ }
+ if (sound_manager_create_stream_information(static_cast<sound_stream_type_e>(type), NULL, NULL, &g_test_h->stream_info)) {
+ g_print("failed to create stream_information()\n");
+ return;
+ }
+ /* In case of MEDIA_EXTERNAL_ONLY, we need to set external device manually */
+ if (type == (int)SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY) {
+ sound_device_h device = NULL;
+ sound_device_type_e device_type;
+
+ if ((ret = sound_manager_get_device_list(SOUND_DEVICE_ALL_MASK, &device_list))) {
+ g_print("failed to sound_manager_get_device_list(), ret(0x%x)\n", ret);
+ goto END;
+ }
+ while (!(ret = sound_manager_get_next_device(device_list, &device))) {
+ if ((ret = sound_manager_get_device_type(device, &device_type))) {
+ g_print("failed to sound_manager_get_device_type(), ret(0x%x)\n", ret);
+ goto END;
+ }
+ if (device_type == SOUND_DEVICE_BLUETOOTH_MEDIA || device_type == SOUND_DEVICE_USB_AUDIO) {
+ if ((ret = sound_manager_add_device_for_stream_routing(g_test_h->stream_info, device))) {
+ g_print("failed to sound_manager_add_device_for_stream_routing(), ret(0x%x)\n", ret);
+ goto END;
+ }
+ if ((ret = sound_manager_apply_stream_routing(g_test_h->stream_info))) {
+ g_print("failed to sound_manager_apply_stream_routing(), ret(0x%x)\n", ret);
+ goto END;
+ }
+ break;
+ }
+ }
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ g_print("failed to sound_manager_get_next_device(), ret(0x%x)\n", ret);
+ goto END;
+ }
+ }
+
+ if (esplusplayer_set_sound_stream_info(g_test_h->espp_h, g_test_h->stream_info) != ESPLUSPLAYER_ERROR_TYPE_NONE) {
+ g_print(" => failed to esplusplayer_set_sound_stream_info\n");
+ sound_manager_destroy_stream_information(g_test_h->stream_info);
+ g_test_h->stream_info = NULL;
+ } else {
+ g_print(" => esplusplayer_set_sound_stream_info() success\n");
+ }
+
+END:
+ if (device_list)
+ sound_manager_free_device_list(device_list);
+}
+
static void __test_quick_prepare()
{
int ret = 0;
g_menu_state = CURRENT_STATUS_SET_VIDEO_ROI;
} else if (strncmp(cmd, "drt", 3) == 0) {
g_menu_state = CURRENT_STATUS_SET_DISPLAY_ROTATION;
+ } else if (strncmp(cmd, "ssi", 3) == 0) {
+ g_menu_state = CURRENT_STATUS_SET_SOUND_STREAM_INFO;
} else {
g_print("unknown menu \n");
}
g_print("h.Set Mute\n");
g_print("[etc] ");
g_print("sr.Set render time offset\t");
- g_print("ll.Set low latency mode\n\n");
+ g_print("ll.Set low latency mode\n");
+ g_print(" ssi.Set sound stream info\n\n");
g_print("-- << mediademuxer cmd >> ---------------------------------------------------------------\n");
g_print("prd.prepare demuxer\n\n");
g_print("*** Input stream type and time offset\n");
} else if (g_menu_state == CURRENT_STATUS_SET_LOW_LATENCY_MODE) {
g_print("*** Input low latency mode (0: none, 1: disable preroll)\n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_SOUND_STREAM_INFO) {
+ g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
} else {
g_print("*** Unknown status.\n");
quit_program();
reset_menu_state();
break;
}
+ case CURRENT_STATUS_SET_SOUND_STREAM_INFO:
+ {
+ value = atoi(cmd);
+ __test_set_sound_stream_info(value);
+ reset_menu_state();
+ break;
+ }
default:
break;
}