[Native][C++]Screen Sharing

992 views
Skip to first unread message

Francois Temasys

unread,
Feb 18, 2014, 4:50:19 AM2/18/14
to discuss...@googlegroups.com
Hi,

I saw many discussions about the sharing of the desktop/windows in the javascript API.
I wanted to try to do the same on the native C++ API and I don't find how. I'm even wondering if it is implemented in the libjingle code.

Here is how I was planning to do:
std::vector<talk_base::WindowDescription> descriptions_desk;
dev_manager
->GetWindows(&descriptions_desk);
std
::cout << " Number of window found: " << descriptions_desk.size() << std::endl;
std
::vector<talk_base::WindowDescription>::iterator desk_it = descriptions_desk.begin();
for (; desk_it != descriptions_desk.end(); ++desk_it)
{
 capturer
= dev_manager->CreateWindowCapturer(desk_it->id());

 
if (capturer != NULL)

 
break;
else
 std
::cout << "Couldn't create window capturer for: " << desk_it->title() << std::endl;
}

But "createWindowCapturer" is always returning NULL which is normal because in the implementation of the DeviceManager.cc(243):
VideoCapturer* DeviceManager::CreateWindowCapturer(talk_base::WindowId window) {
#if defined(WINDOW_CAPTURER_NAME)
  WINDOW_CAPTURER_NAME
* window_capturer = new WINDOW_CAPTURER_NAME();
 
if (!window_capturer->Init(window)) {
   
delete window_capturer;
   
return NULL;
 
}
 
return window_capturer;
#else
 
return NULL;
#endif
}

According to this code I was looking for a child of cricket::VideoCapturer that has a Init() function and except the FileVideoCapturer class there is nothing.
Should I write my own classes for implementing this function?

Marco Ma

unread,
Jun 30, 2015, 11:27:47 PM6/30/15
to discuss...@googlegroups.com
Hi,Francois Temasys:
 I meet the same question ,did you find a way to solve it?

在 2014年2月18日星期二 UTC+8下午5:50:19,Francois Temasys写道:

Byron Clark

unread,
Jul 6, 2015, 3:35:53 PM7/6/15
to discuss...@googlegroups.com
You'll want to take a look at remoting::CastVideoCapturerAdapter in the chromium source (remoting/host/cast_video_capturer_adapter.{h,cc}). The code has some chromium dependencies, so unless you're working in chromium you'll want to build something that works like that class.
Reply all
Reply to author
Forward
0 new messages