Skip to content
Snippets Groups Projects
Commit 2d3d0353 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #13188: add video details to getCallDetails, if actively receiving video

parent 901db43b
No related branches found
No related tags found
No related merge requests found
...@@ -218,7 +218,7 @@ class Call : public Recordable { ...@@ -218,7 +218,7 @@ class Call : public Recordable {
unsigned int getLocalVideoPort(); unsigned int getLocalVideoPort();
void time_stop(); 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(); static std::map<std::string, std::string> getNullDetails();
std::map<std::string, std::string> createHistoryEntry() const; std::map<std::string, std::string> createHistoryEntry() const;
virtual bool setRecording(); virtual bool setRecording();
......
...@@ -74,3 +74,13 @@ void SIPCall::answer() ...@@ -74,3 +74,13 @@ void SIPCall::answer()
setConnectionState(CONNECTED); setConnectionState(CONNECTED);
setState(ACTIVE); 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;
}
...@@ -106,6 +106,10 @@ class SIPCall : public Call { ...@@ -106,6 +106,10 @@ class SIPCall : public Call {
pjsip_inv_session *inv; pjsip_inv_session *inv;
private: private:
// override of Call::getDetails
std::map<std::string, std::string>
getDetails();
virtual void answer(); virtual void answer();
NON_COPYABLE(SIPCall); NON_COPYABLE(SIPCall);
......
...@@ -316,4 +316,19 @@ void VideoReceiveThread::setRequestKeyFrameCallback(void (*cb)(const std::string ...@@ -316,4 +316,19 @@ void VideoReceiveThread::setRequestKeyFrameCallback(void (*cb)(const std::string
{ {
requestKeyFrameCallback_ = cb; 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 } // end namespace sfl_video
...@@ -92,6 +92,7 @@ class VideoReceiveThread : public ost::Thread { ...@@ -92,6 +92,7 @@ class VideoReceiveThread : public ost::Thread {
public: public:
VideoReceiveThread(const std::string &id, const std::map<std::string, std::string> &args); 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 ~VideoReceiveThread();
virtual void run(); virtual void run();
void setRequestKeyFrameCallback(void (*)(const std::string &)); void setRequestKeyFrameCallback(void (*)(const std::string &));
......
...@@ -155,4 +155,11 @@ void VideoRtpSession::forceKeyFrame() ...@@ -155,4 +155,11 @@ void VideoRtpSession::forceKeyFrame()
ERROR("Video sending thread is NULL"); 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 } // end namespace sfl_video
...@@ -52,6 +52,7 @@ class VideoRtpSession { ...@@ -52,6 +52,7 @@ class VideoRtpSession {
unsigned int port); unsigned int port);
void updateSDP(const Sdp &sdp); void updateSDP(const Sdp &sdp);
void forceKeyFrame(); void forceKeyFrame();
void addReceivingDetails(std::map<std::string, std::string> &details);
private: private:
std::tr1::shared_ptr<VideoSendThread> sendThread_; std::tr1::shared_ptr<VideoSendThread> sendThread_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment