Commit 05397dd4 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

screen sharing: fix limited screen sharing offset on win32

- Offset isn't passed the same ways for gdigrab and x11grab

Change-Id: I5b48e8c40ff7f60e5d8e875835330d7b225a7175
Tuleap: #319
parent cf5d18df
......@@ -77,6 +77,10 @@ int MediaDecoder::openInput(const DeviceParams& params)
if (params.framerate)
av_dict_set(&options_, "framerate", ring::to_string(params.framerate.real()).c_str(), 0);
#endif
if (params.offset_x || params.offset_y) {
av_dict_set(&options_, "offset_x", ring::to_string(params.offset_x).c_str(), 0);
av_dict_set(&options_, "offset_y", ring::to_string(params.offset_y).c_str(), 0);
}
if (params.channel)
av_dict_set(&options_, "channel", ring::to_string(params.channel).c_str(), 0);
av_dict_set(&options_, "loop", params.loop.c_str(), 0);
......
......@@ -40,6 +40,8 @@ struct DeviceParams {
unsigned channel {}; // Channel number
std::string loop {};
std::string sdp_flags {};
unsigned offset_x {};
unsigned offset_y {};
};
}
......
......@@ -245,6 +245,10 @@ VideoInput::initGdiGrab(std::string params)
iss >> w >> sep >> h;
decOpts_.width = round2pow(w, 3);
decOpts_.height = round2pow(h, 3);
size_t plus = params.find('+');
std::istringstream dss(params.substr(plus + 1, space - plus));
dss >> decOpts_.offset_x >> sep >> decOpts_.offset_y;
} else {
decOpts_.width = default_grab_width;
decOpts_.height = default_grab_height;
......
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