diff --git a/bin/dbus/cx.ring.Ring.VideoManager.xml b/bin/dbus/cx.ring.Ring.VideoManager.xml index 5e3390a1b370f8a66ed3d8baa0551ce7264dde21..c1b648a841ff9cafeee46e582de18315a8f2d1cd 100644 --- a/bin/dbus/cx.ring.Ring.VideoManager.xml +++ b/bin/dbus/cx.ring.Ring.VideoManager.xml @@ -110,6 +110,17 @@ </arg> </method> + <method name="getRenderer" tp:name-for-bindings="getRenderer"> + <tp:docstring>Returns a map of information about a call's renderer.</tp:docstring> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="s" name="callId" direction="in"> + <tp:docstring>Call ID to get info about.</tp:docstring> + </arg> + <arg type="a{ss}" name="map" direction="out"> + <tp:docstring>Map containing renderer info, with empty strings and "0" if not found.</tp:docstring> + </arg> + </method> + <signal name="deviceEvent" tp:name-for-bindings="deviceEvent"> <tp:docstring>Signal triggered by changes in the detected v4l2 devices, e.g. a camera being unplugged.</tp:docstring> </signal> diff --git a/bin/dbus/dbusvideomanager.cpp b/bin/dbus/dbusvideomanager.cpp index 744e9ebba47df076d42a0aca2214ccb5fd8700a3..09c15bc6b85bf1240c82cf2208632a995ccf2347 100644 --- a/bin/dbus/dbusvideomanager.cpp +++ b/bin/dbus/dbusvideomanager.cpp @@ -97,6 +97,12 @@ DBusVideoManager::setDecodingAccelerated(const bool& state) DRing::setDecodingAccelerated(state); } +std::map<std::string, std::string> +DBusVideoManager::getRenderer(const std::string& callId) +{ + return DRing::getRenderer(callId); +} + std::string DBusVideoManager::startLocalRecorder(const bool& audioOnly, const std::string& filepath) { diff --git a/bin/dbus/dbusvideomanager.h b/bin/dbus/dbusvideomanager.h index 2148eb89d8ded6bb7344f7a3230edd5f9e4c5dfb..ff719a96d5ad37ba14557ae0680c30f4fc8434d6 100644 --- a/bin/dbus/dbusvideomanager.h +++ b/bin/dbus/dbusvideomanager.h @@ -63,6 +63,7 @@ class DRING_PUBLIC DBusVideoManager : bool hasCameraStarted(); bool getDecodingAccelerated(); void setDecodingAccelerated(const bool& state); + std::map<std::string, std::string> getRenderer(const std::string& callId); std::string startLocalRecorder(const bool& audioOnly, const std::string& filepath); void stopLocalRecorder(const std::string& filepath); }; diff --git a/configure.ac b/configure.ac index 668d866500e85a3b192a7dbab8be12831825c65c..f05b9efdce1c82afdadc400eae0cdf63538a6428 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Ring - configure.ac for automake 1.9 and autoconf 2.59 dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([Ring Daemon],[7.0.0],[ring@gnu.org],[ring]) +AC_INIT([Ring Daemon],[7.1.0],[ring@gnu.org],[ring]) AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2018]]) AC_REVISION([$Revision$]) diff --git a/doc/doxygen/core-doc.cfg.in b/doc/doxygen/core-doc.cfg.in index 6f871db8e0d5b0418ba992d77384d582228f9ab6..131f33f79931501987a170549fb614ea54ce82c3 100644 --- a/doc/doxygen/core-doc.cfg.in +++ b/doc/doxygen/core-doc.cfg.in @@ -31,7 +31,7 @@ PROJECT_NAME = "Ring Daemon" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 7.0.0 +PROJECT_NUMBER = 7.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/src/client/videomanager.cpp b/src/client/videomanager.cpp index ccbc94ef0956ee1024ed1509d985fa8a183feab1..3f723675d39c42a6c49ab1f9e28f0b78c53e5e98 100644 --- a/src/client/videomanager.cpp +++ b/src/client/videomanager.cpp @@ -34,6 +34,7 @@ #include "video/sinkclient.h" #include "client/ring_signal.h" #include "audio/ringbufferpool.h" +#include "dring/media_const.h" #include <functional> #include <memory> @@ -349,6 +350,25 @@ registerSinkTarget(const std::string& sinkId, const SinkTarget& target) RING_WARN("No sink found for id '%s'", sinkId.c_str()); } +std::map<std::string, std::string> +getRenderer(const std::string& callId) +{ + if (auto sink = ring::Manager::instance().getSinkClient(callId)) + return { + {DRing::Media::Details::CALL_ID, callId}, + {DRing::Media::Details::SHM_PATH, sink->openedName()}, + {DRing::Media::Details::WIDTH, ring::to_string(sink->getWidth())}, + {DRing::Media::Details::HEIGHT, ring::to_string(sink->getHeight())}, + }; + else + return { + {DRing::Media::Details::CALL_ID, callId}, + {DRing::Media::Details::SHM_PATH, ""}, + {DRing::Media::Details::WIDTH, "0"}, + {DRing::Media::Details::HEIGHT, "0"}, + }; +} + bool getDecodingAccelerated() { diff --git a/src/dring/media_const.h b/src/dring/media_const.h index 8e542a83f30f7eb814ef59825a7c7d3aa3e28fc4..1bd40414ab3754d9e513f1d92daac3ed183edcbc 100644 --- a/src/dring/media_const.h +++ b/src/dring/media_const.h @@ -40,6 +40,13 @@ namespace Details { constexpr static char MEDIA_TYPE_AUDIO[] = "MEDIA_TYPE_AUDIO"; constexpr static char MEDIA_TYPE_VIDEO[] = "MEDIA_TYPE_VIDEO"; + +// Renderer and Shm info +constexpr static char CALL_ID [] = "CALL_ID"; +constexpr static char SHM_PATH[] = "SHM_PATH"; +constexpr static char WIDTH [] = "WIDTH"; +constexpr static char HEIGHT [] = "HEIGHT"; + } } //namespace DRing::Media diff --git a/src/dring/videomanager_interface.h b/src/dring/videomanager_interface.h index 7bf40be7ce21e27b3f9002249e0d5cb890c5b513..d849be2c46ae6ee3faddb1a8f1f54656ec078a6e 100644 --- a/src/dring/videomanager_interface.h +++ b/src/dring/videomanager_interface.h @@ -150,6 +150,7 @@ DRING_PUBLIC bool hasCameraStarted(); DRING_PUBLIC bool switchInput(const std::string& resource); DRING_PUBLIC bool switchToCamera(); DRING_PUBLIC void registerSinkTarget(const std::string& sinkId, const SinkTarget& target); +DRING_PUBLIC std::map<std::string, std::string> getRenderer(const std::string& callId); DRING_PUBLIC std::string startLocalRecorder(const bool& audioOnly, const std::string& filepath); DRING_PUBLIC void stopLocalRecorder(const std::string& filepath); diff --git a/src/media/video/sinkclient.cpp b/src/media/video/sinkclient.cpp index aa267404f9a1439611d2c61919f0d98ff235d62d..ef4265a91163814e1c386fb8f688510c56ed3f2f 100644 --- a/src/media/video/sinkclient.cpp +++ b/src/media/video/sinkclient.cpp @@ -365,6 +365,8 @@ SinkClient::update(Observable<std::shared_ptr<VideoFrame>>* /*obs*/, void SinkClient::setFrameSize(int width, int height) { + width_ = width; + height_ = height; if (width > 0 and height > 0) { RING_WARN("Start sink <%s / %s>, size=%dx%d, mixer=%u", getId().c_str(), openedName().c_str(), width, height, mixer_); diff --git a/src/media/video/sinkclient.h b/src/media/video/sinkclient.h index 32b5c92c2eb47f020036d1f30362585de12f2b36..8068e8623c8b51c927a8665d153ede54616b4d42 100644 --- a/src/media/video/sinkclient.h +++ b/src/media/video/sinkclient.h @@ -54,6 +54,14 @@ class SinkClient : public VideoFramePassiveReader std::string openedName() const noexcept; + int getWidth() const noexcept { + return width_; + } + + int getHeight() const noexcept { + return height_; + } + // as VideoFramePassiveReader void update(Observable<std::shared_ptr<ring::VideoFrame>>*, const std::shared_ptr<ring::VideoFrame>&) override; @@ -70,6 +78,8 @@ class SinkClient : public VideoFramePassiveReader private: const std::string id_; const bool mixer_; + int width_ {0}; + int height_ {0}; bool started_ {false}; // used to arbitrate client's stop signal. DRing::SinkTarget target_; std::unique_ptr<VideoScaler> scaler_;