Commit 2d3d0353 authored by Tristan Matthews's avatar Tristan Matthews

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

parent 901db43b
......@@ -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();
......
......@@ -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;
}
......@@ -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);
......
......@@ -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
......@@ -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 &));
......
......@@ -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
......@@ -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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment