Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart Home: Camera viewing and input streaming #128

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ set(optional_deps Alsa
XSLT
${PLATFORM_OPTIONAL_DEPS})

# ROS dependencies. Keep in alphabetical order please
list(APPEND required_deps
ament_cmake
image_transport
oasis_msgs
rcl_interfaces
rclcpp
rmw
sensor_msgs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those must be optional, so we need an option ENABLE_SMARTHOME

)

# Check optional deps first, since their availability can influence required ones, e.g. ffmpeg
core_optional_dep(${optional_deps})
core_require_dep(${required_deps})
Expand Down Expand Up @@ -464,12 +475,6 @@ endif()

include(cmake/scripts/${CORE_SYSTEM_NAME}/Install.cmake)

# Add uninstall target
if(CMAKE_GENERATOR MATCHES Makefile)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/common/Uninstall.cmake)
set_target_properties(uninstall PROPERTIES FOLDER "Build Utilities")
endif()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed?


# Create target that allows to build binary-addons.
# Use make binary-addons ADDONS="visualization.spectrum" to select the addons to build.
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
Expand Down
53 changes: 53 additions & 0 deletions addons/skin.estuary/xml/SmartHome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<window>
<controls>
<!-- Top row -->
<control type="cameraview">
<width>33%</width>
<height>33%</height>
<topic>/oasis/kinect2/hd/image_color</topic>
</control>
<control type="cameraview">
<left>33%</left>
<width>33%</width>
<height>33%</height>
<topic>/oasis/netbook/image_raw</topic>
</control>
<control type="cameraview">
<left>67%</left>
<width>33%</width>
<height>33%</height>
<topic>/oasis/lenovo/image_raw</topic>
</control>

<!-- Middle row -->
<control type="cameraview">
<top>33%</top>
<width>33%</width>
<height>33%</height>
<topic>/oasis/kinect2/sd/image_color_rect</topic>
</control>
<control type="cameraview">
<top>33%</top>
<left>33%</left>
<width>33%</width>
<height>33%</height>
<topic>/oasis/netbook/foreground</topic>
</control>
<control type="cameraview">
<top>33%</top>
<left>67%</left>
<width>33%</width>
<height>33%</height>
<topic>/oasis/lenovo/foreground</topic>
</control>

<!-- Bottom row -->
<control type="cameraview">
<top>67%</top>
<width>33%</width>
<height>33%</height>
<topic>/oasis/kinect2/foreground</topic>
</control>
</controls>
</window>
5 changes: 5 additions & 0 deletions cmake/scripts/common/Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ macro(export_dep)
set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE)
set(DEPLIBS ${DEPLIBS} PARENT_SCOPE)
set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE)
set(${dep}_FOUND ${${dep}_FOUND} PARENT_SCOPE)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this? Please use ${depup} like all other depends

set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE)
mark_as_advanced(${dep}_LIBRARIES)
mark_as_advanced(${depup}_LIBRARIES)
endmacro()

Expand Down Expand Up @@ -385,8 +387,11 @@ function(core_require_dep)
split_dependency_specification(${depspec} dep version)
find_package_with_ver(${dep} ${version} REQUIRED)
string(TOUPPER ${dep} depup)
list(APPEND SYSTEM_INCLUDES ${${dep}_INCLUDE_DIRS})
list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
list(APPEND DEPLIBS ${${dep}_LIBRARIES})
list(APPEND DEPLIBS ${${depup}_LIBRARIES})
list(APPEND DEP_DEFINES ${${dep}_DEFINITIONS})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, all those shouldn't be needed

list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
export_dep()
endforeach()
Expand Down
7 changes: 7 additions & 0 deletions cmake/treedata/common/smarthome.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
xbmc/smarthome smarthome
xbmc/smarthome/guibridge smarthome/guibridge
xbmc/smarthome/guicontrols smarthome/guicontrols
xbmc/smarthome/input smarthome/input
xbmc/smarthome/rendering smarthome/rendering
xbmc/smarthome/ros2 smarthome/ros2
xbmc/smarthome/streams smarthome/streams
5 changes: 5 additions & 0 deletions xbmc/ServiceBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,8 @@ std::shared_ptr<CKeyboardLayoutManager> CServiceBroker::GetKeyboardLayoutManager
{
return g_serviceBroker.m_keyboardLayoutManager;
}

SMART_HOME::CSmartHomeServices& CServiceBroker::GetSmartHomeServices()
{
return g_application.m_ServiceManager->GetSmartHomeServices();
}
7 changes: 7 additions & 0 deletions xbmc/ServiceBroker.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ namespace RETRO
{
class CGUIGameRenderManager;
}

namespace SMART_HOME
{
class CSmartHomeServices;
}
}

namespace PERIPHERALS
Expand Down Expand Up @@ -196,6 +201,8 @@ class CServiceBroker
static void UnregisterKeyboardLayoutManager();
static std::shared_ptr<CKeyboardLayoutManager> GetKeyboardLayoutManager();

static KODI::SMART_HOME::CSmartHomeServices& GetSmartHomeServices();

private:
std::unique_ptr<CLog> m_logging;
std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> m_pAnnouncementManager;
Expand Down
12 changes: 12 additions & 0 deletions xbmc/ServiceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "powermanagement/PowerManager.h"
#include "profiles/ProfileManager.h"
#include "pvr/PVRManager.h"
#include "smarthome/SmartHomeServices.h"
#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
#include "storage/DetectDVDType.h"
#endif
Expand Down Expand Up @@ -160,6 +161,8 @@ bool CServiceManager::InitStageTwo(const std::string& profilesUserDataFolder)

m_gameRenderManager.reset(new RETRO::CGUIGameRenderManager);

m_smartHomeServices = std::make_unique<SMART_HOME::CSmartHomeServices>(*m_params, *m_peripherals);

m_fileExtensionProvider.reset(new CFileExtensionProvider(*m_addonMgr));

m_powerManager.reset(new CPowerManager());
Expand Down Expand Up @@ -211,6 +214,8 @@ bool CServiceManager::InitStageThree(const std::shared_ptr<CProfileManager>& pro
if (!m_Platform->InitStageThree())
return false;

m_smartHomeServices->Initialize(*m_gameServices);

init_level = 3;
return true;
}
Expand Down Expand Up @@ -240,6 +245,8 @@ void CServiceManager::DeinitStageTwo()
m_weatherManager.reset();
m_powerManager.reset();
m_fileExtensionProvider.reset();
m_smartHomeServices->Deinitialize();
m_smartHomeServices.reset();
m_gameRenderManager.reset();
m_peripherals.reset();
m_inputManager.reset();
Expand Down Expand Up @@ -435,3 +442,8 @@ CMediaManager& CServiceManager::GetMediaManager()
{
return *m_mediaManager;
}

SMART_HOME::CSmartHomeServices& CServiceManager::GetSmartHomeServices()
{
return *m_smartHomeServices;
}
8 changes: 8 additions & 0 deletions xbmc/ServiceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ namespace RETRO
{
class CGUIGameRenderManager;
}

namespace SMART_HOME
{
class CSmartHomeServices;
}
}

namespace MEDIA_DETECT
Expand Down Expand Up @@ -149,6 +154,8 @@ class CServiceManager
MEDIA_DETECT::CDetectDVDMedia& GetDetectDVDMedia();
#endif

KODI::SMART_HOME::CSmartHomeServices& GetSmartHomeServices();

protected:
struct delete_dataCacheCore
{
Expand Down Expand Up @@ -202,4 +209,5 @@ class CServiceManager
#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
std::unique_ptr<MEDIA_DETECT::CDetectDVDMedia> m_DetectDVDType;
#endif
std::unique_ptr<KODI::SMART_HOME::CSmartHomeServices> m_smartHomeServices;
};
6 changes: 4 additions & 2 deletions xbmc/games/controllers/input/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
set(SOURCES InputSink.cpp
set(SOURCES ControllerState.cpp
InputSink.cpp
PhysicalFeature.cpp
PhysicalTopology.cpp
)

set(HEADERS InputSink.h
set(HEADERS ControllerState.h
InputSink.h
PhysicalFeature.h
PhysicalTopology.h
)
Expand Down
Loading