Commit 21f81fc6 authored by Adrien Béraud's avatar Adrien Béraud

sipvoiplink: cleanup

Change-Id: I7d266d9d82d76715f8f88807e4944821a04aee20
parent a427a151
...@@ -87,7 +87,7 @@ bool VideoReceiveThread::setup() ...@@ -87,7 +87,7 @@ bool VideoReceiveThread::setup()
dstWidth_ = args_.width; dstWidth_ = args_.width;
dstHeight_ = args_.height; dstHeight_ = args_.height;
const std::string SDP_FILENAME = "dummyFilename"; static const std::string SDP_FILENAME = "dummyFilename";
if (args_.input.empty()) { if (args_.input.empty()) {
args_.format = "sdp"; args_.format = "sdp";
args_.input = SDP_FILENAME; args_.input = SDP_FILENAME;
......
...@@ -952,26 +952,23 @@ handleMediaControl(SIPCall& call, pjsip_msg_body* body) ...@@ -952,26 +952,23 @@ handleMediaControl(SIPCall& call, pjsip_msg_body* body)
/* Apply and answer the INFO request */ /* Apply and answer the INFO request */
pj_strset(&control_st, (char *) body->data, body->len); pj_strset(&control_st, (char *) body->data, body->len);
constexpr pj_str_t PICT_FAST_UPDATE = CONST_PJ_STR("picture_fast_update"); static constexpr pj_str_t PICT_FAST_UPDATE = CONST_PJ_STR("picture_fast_update");
constexpr pj_str_t DEVICE_ORIENTATION = CONST_PJ_STR("device_orientation"); static constexpr pj_str_t DEVICE_ORIENTATION = CONST_PJ_STR("device_orientation");
if (pj_strstr(&control_st, &PICT_FAST_UPDATE)) { if (pj_strstr(&control_st, &PICT_FAST_UPDATE)) {
call.sendKeyframe(); call.sendKeyframe();
return true; return true;
} else if (pj_strstr(&control_st, &DEVICE_ORIENTATION)) { } else if (pj_strstr(&control_st, &DEVICE_ORIENTATION)) {
int rotation = 0; static const std::regex ORIENTATION_REGEX("device_orientation=([-+]?[0-9]+)");
std::string body_msg = control_st.ptr;
std::string body_msg(control_st.ptr, control_st.slen);
std::smatch matched_pattern; std::smatch matched_pattern;
std::regex str_pattern("device_orientation=([-+]?[0-9]+)"); std::regex_search(body_msg, matched_pattern, ORIENTATION_REGEX);
std::regex_search(body_msg, matched_pattern, str_pattern);
if (matched_pattern.ready() && !matched_pattern.empty() && matched_pattern[1].matched) { if (matched_pattern.ready() && !matched_pattern.empty() && matched_pattern[1].matched) {
rotation = std::stoi(matched_pattern[1]); int rotation = std::stoi(matched_pattern[1]);
JAMI_WARN("Rotate video %d deg.", rotation); JAMI_WARN("Rotate video %d deg.", rotation);
call.getVideoRtp().setRotation(rotation); call.getVideoRtp().setRotation(rotation);
return true; return true;
} }
} }
......
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