diff --git a/daemon/src/call.h b/daemon/src/call.h index 7cdf74d1b46b3558bf0379edf5f09a8f43f7528a..7691da6ba00fb94fae6b9d7e1aeb9d3e02d42e33 100644 --- a/daemon/src/call.h +++ b/daemon/src/call.h @@ -218,7 +218,7 @@ class Call : public Recordable { unsigned int getLocalVideoPort(); void time_stop(); - std::map<std::string, std::string> getDetails(); + virtual std::map<std::string, std::string> getDetails(); static std::map<std::string, std::string> getNullDetails(); std::map<std::string, std::string> createHistoryEntry() const; virtual bool setRecording(); diff --git a/daemon/src/sip/sipcall.cpp b/daemon/src/sip/sipcall.cpp index 34c56000ec714e3798516e088fae61dcc6e5a0c5..a96cefb3f271dc3c33a46d83dacbb675cfc028b5 100644 --- a/daemon/src/sip/sipcall.cpp +++ b/daemon/src/sip/sipcall.cpp @@ -74,3 +74,13 @@ void SIPCall::answer() setConnectionState(CONNECTED); setState(ACTIVE); } + +std::map<std::string, std::string> +SIPCall::getDetails() +{ + std::map<std::string, std::string> details(Call::getDetails()); +#ifdef SFL_VIDEO + videortp_.addReceivingDetails(details); +#endif + return details; +} diff --git a/daemon/src/sip/sipcall.h b/daemon/src/sip/sipcall.h index a5884f953da66b7fc27dee6abc4180372194dd78..537975fb6566e732b81b168d156554678f199293 100644 --- a/daemon/src/sip/sipcall.h +++ b/daemon/src/sip/sipcall.h @@ -106,6 +106,10 @@ class SIPCall : public Call { pjsip_inv_session *inv; private: + // override of Call::getDetails + std::map<std::string, std::string> + getDetails(); + virtual void answer(); NON_COPYABLE(SIPCall); diff --git a/daemon/src/video/video_receive_thread.cpp b/daemon/src/video/video_receive_thread.cpp index 1bb48f46ca463590f622d32ef93f674e67477122..3da361d16552d3cae6218a1e230c418248656a5f 100644 --- a/daemon/src/video/video_receive_thread.cpp +++ b/daemon/src/video/video_receive_thread.cpp @@ -316,4 +316,19 @@ void VideoReceiveThread::setRequestKeyFrameCallback(void (*cb)(const std::string { requestKeyFrameCallback_ = cb; } + +void +VideoReceiveThread::addDetails(std::map<std::string, std::string> &details) +{ + if (receiving_ and dstWidth_ > 0 and dstHeight_ > 0) { + details["VIDEO_SHM_PATH"] = sink_.openedName(); + std::ostringstream os; + os << dstWidth_; + details["VIDEO_WIDTH"] = os.str(); + os.str(""); + os << dstHeight_; + details["VIDEO_HEIGHT"] = os.str(); + } +} + } // end namespace sfl_video diff --git a/daemon/src/video/video_receive_thread.h b/daemon/src/video/video_receive_thread.h index fccacf04ecadfaee41095006953c9d2af68433dd..e4b484ab9b64c987e8f65ab68bfe11a6f49a92bd 100644 --- a/daemon/src/video/video_receive_thread.h +++ b/daemon/src/video/video_receive_thread.h @@ -92,6 +92,7 @@ class VideoReceiveThread : public ost::Thread { public: VideoReceiveThread(const std::string &id, const std::map<std::string, std::string> &args); + void addDetails(std::map<std::string, std::string> &details); virtual ~VideoReceiveThread(); virtual void run(); void setRequestKeyFrameCallback(void (*)(const std::string &)); diff --git a/daemon/src/video/video_rtp_session.cpp b/daemon/src/video/video_rtp_session.cpp index 8c89092ababaef15d2cafb5c0aef7e45684bf047..97c655a5b738b45198be45a790018ce702cccd3a 100644 --- a/daemon/src/video/video_rtp_session.cpp +++ b/daemon/src/video/video_rtp_session.cpp @@ -155,4 +155,11 @@ void VideoRtpSession::forceKeyFrame() ERROR("Video sending thread is NULL"); } +void +VideoRtpSession::addReceivingDetails(std::map<std::string, std::string> &details) +{ + if (receiveThread_.get()) + receiveThread_->addDetails(details); +} + } // end namespace sfl_video diff --git a/daemon/src/video/video_rtp_session.h b/daemon/src/video/video_rtp_session.h index 2b80928cd558ef27cc4980c3ed896714961046e8..748ff566eca28905eae698ccd38eabe2f3e282c2 100644 --- a/daemon/src/video/video_rtp_session.h +++ b/daemon/src/video/video_rtp_session.h @@ -52,6 +52,7 @@ class VideoRtpSession { unsigned int port); void updateSDP(const Sdp &sdp); void forceKeyFrame(); + void addReceivingDetails(std::map<std::string, std::string> &details); private: std::tr1::shared_ptr<VideoSendThread> sendThread_;