From f66ea1daedf14e932a1d76f91d66bd775b6a1309 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Wed, 12 Oct 2016 09:28:30 -0400 Subject: Fixed build errors when compiling with EXTENDED_MEDIA_MODE=ON The GStreamer include directories were not properly set up in the CMake files for appMain and the Media Manager component, this commit fixes this. --- src/appMain/CMakeLists.txt | 1 + src/components/media_manager/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index debcfe66c2..84b2c847bd 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -45,6 +45,7 @@ cmake_policy(POP) if (EXTENDED_MEDIA_MODE) set(default_media_inc ${GSTREAMER_gst_INCLUDE_DIR} +${GSTREAMER_gstconfig_INCLUDE_DIR} ) else(EXTENDED_MEDIA_MODE) set(default_media_inc diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt index 69af6e7841..3ca02357ab 100644 --- a/src/components/media_manager/CMakeLists.txt +++ b/src/components/media_manager/CMakeLists.txt @@ -37,6 +37,7 @@ pkg_check_modules(GLIB2 REQUIRED glib-2.0) add_definitions(${GLIB2_CFLAGS}) set(default_includes ${GSTREAMER_gst_INCLUDE_DIR} + ${GSTREAMER_gstconfig_INCLUDE_DIR} ${GLIB_glib_2_INCLUDE_DIR} ) set(default_sources @@ -63,6 +64,8 @@ set(LIBRARIES glib-2.0 ) else(EXTENDED_MEDIA_MODE) +set(default_includes +) set(default_sources ${COMPONENTS_DIR}/media_manager/src/audio/socket_audio_streamer_adapter.cc @@ -96,6 +99,7 @@ include_directories ( ${JSONCPP_INCLUDE_DIRECTORY} ${CMAKE_BINARY_DIR}/src/components/ ${COMPONENTS_DIR}/policy/include/ + ${default_includes} ${LOG4CXX_INCLUDE_DIRECTORY} ) -- cgit v1.2.1 From cb7972dba3c3da665ce779cf8b78ef83bfefc256 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Wed, 12 Oct 2016 11:32:16 -0400 Subject: Fix SEGFAULT in media_manager_impl.cc when EXTENDED_MEDIA_MODE=ON media_manager_impl.cc tries to make an A2DPSourcePlayerAdapter using the protocol handler before it is set, causing the program to SEGFAULT. This commit moves this creation to the PlayA2DPSource method and adds an explicit check to make sure that the protocol handler is set beforehand. --- src/components/media_manager/src/media_manager_impl.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc index e531894b27..b89fc4c71f 100644 --- a/src/components/media_manager/src/media_manager_impl.cc +++ b/src/components/media_manager/src/media_manager_impl.cc @@ -114,8 +114,6 @@ void MediaManagerImpl::Init() { #if defined(EXTENDED_MEDIA_MODE) LOG4CXX_INFO(logger_, "Called Init with default configuration."); - a2dp_player_ = - new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer()); from_mic_recorder_ = new FromMicRecorderAdapter(); #endif @@ -157,6 +155,14 @@ void MediaManagerImpl::Init() { void MediaManagerImpl::PlayA2DPSource(int32_t application_key) { LOG4CXX_AUTO_TRACE(logger_); + +#if defined(EXTENDED_MEDIA_MODE) + if (!a2dp_player_ && protocol_handler_) { + a2dp_player_ = + new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer()); + } +#endif + if (a2dp_player_) { a2dp_player_->StartActivity(application_key); } -- cgit v1.2.1