----- Original Message ----- > From: "Vivien Didelot" <[email protected]> > To: [email protected] > Cc: "tristan matthews" <[email protected]>, "Vivien > Didelot" > <[email protected]> > Sent: Friday, February 14, 2014 1:27:27 PM > Subject: [RFC] (WIP) add X11 as a source > > --- > daemon/src/video/video_input.cpp | 10 ++++++++++ > daemon/src/video/video_preferences.cpp | 13 +++++++++++-- > 2 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/daemon/src/video/video_input.cpp > b/daemon/src/video/video_input.cpp > index 1de4ba1..62cec65 100644 > --- a/daemon/src/video/video_input.cpp > +++ b/daemon/src/video/video_input.cpp > @@ -65,16 +65,26 @@ bool VideoInput::setup() > { > // it's a v4l device if starting with /dev/video > static const char * const V4L_PATH = "/dev/video"; > + static const char * const X11_DISPLAY = ":0"; > > string format_str; > string input = args_["input"]; > > decoder_ = new VideoDecoder(); > > + /* video4linux2 specific */ > if (args_["input"].find(V4L_PATH) != std::string::npos) { > DEBUG("Using v4l2 format"); > format_str = "video4linux2"; > } > + > + /* x11 specific */ > + else if (args_["input"].find(X11_DISPLAY) != std::string::npos) > { > + DEBUG("Using x11grab format"); > + format_str = "x11grab"; > + } > + > + /* common settings */ > if (!args_["framerate"].empty()) > decoder_->setOption("framerate", > args_["framerate"].c_str()); > if (!args_["video_size"].empty()) > diff --git a/daemon/src/video/video_preferences.cpp > b/daemon/src/video/video_preferences.cpp > index 332a885..5aee976 100644 > --- a/daemon/src/video/video_preferences.cpp > +++ b/daemon/src/video/video_preferences.cpp > @@ -46,7 +46,12 @@ VideoPreference::VideoPreference() : > std::map<std::string, std::string> VideoPreference::getSettings() > { > std::map<std::string, std::string> args; > - if (not device_.empty()) { > + > + if (device_.empty()) { > + // TODO do we care? > + } else if (device_ == "X11") { > + args["input"] = ":0"; > + } else { > args["input"] = v4l2_list_->getDeviceNode(device_); > std::stringstream ss; > ss << v4l2_list_->getChannelNum(device_, channel_); > @@ -88,7 +93,11 @@ void VideoPreference::unserialize(const > Conf::YamlNode &map) > > std::vector<std::string> > VideoPreference::getDeviceList() { > - return v4l2_list_->getDeviceList(); > + > + // FIXME: this should be hidden > + auto result(v4l2_list_->getDeviceList()); > + result.push_back("X11"); > + return result; > } > > std::vector<std::string> > -- > 1.8.5.4 >
Looks good, so far it works locally (i.e. I can get a "preview" of my desktop) but it fails to be sent to a peer during a call, I get: [swscaler @ 0x7f715c012560] deprecated pixel format used, make sure you did set range correctly "Unsupported pixel format" Best, Tritsan -- Tristan Matthews Développeur de logiciels libres [email protected] Ligne directe: 514-276-5468 poste 190 Fax : 514-276-5465 7275 Saint Urbain Bureau 200 Montréal, QC, H2R 2Y5 _______________________________________________ SFLphone mailing list [email protected] http://lists.savoirfairelinux.net/mailman/listinfo/sflphone
