Commit Graph

53 Commits

Author SHA1 Message Date
cf1b51b6fb Moves the display reconfiguration callback into a separate class,
so that it can be shared with the cursor monitor when single monitor capturing
is added (https://webrtc-codereview.appspot.com/4679005/).
This Cl should have no functionality change.

BUG=2253
R=henrike@webrtc.org, sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/7599004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5461 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-29 21:59:12 +00:00
4985927d36 Implement screen enumeration and individual screen capturing for Windows.
BUG=2787
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/7239004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5399 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-17 17:19:16 +00:00
fb4e256d49 Fix crash in MouseCursor::CopyOf()
This issue was causing test failures with the latest webrtc roll.

R=mallinath@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/7249005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5392 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-16 04:45:35 +00:00
7a2ca7c621 Update needed to MockScreenCapturer after new methods addition to webrtc::ScreenCapturer.
This change is also must for rolling webrtc in chrome.

R=jiayl@webrtc.org
TBR=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/7219004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5389 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-15 19:00:13 +00:00
017b619010 Extends the ScreenCapturer interface for individual display screen cast.
Real implementations for each platform will be added in future CLs.

BUG=2787
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/6819005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5386 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-14 18:26:37 +00:00
eb31b45aaf Fix MouseCursorMonitorMac to return correct hotspot position.
Previusly (0, 0) was always return as mouse cursor hotspot.

BUG=2779
R=wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/7089004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5379 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-13 23:25:17 +00:00
8ae72560dd Make MouseCursor mutable
MouseCursor objects were previous immutable which makes it harder to
implement deserializers when MouseCursor is sent over IPC in Chromium.

R=dcaiafa@chromium.org

Committed: https://code.google.com/p/webrtc/source/detail?r=5310

Review URL: https://webrtc-codereview.appspot.com/6059005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5314 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-18 02:18:01 +00:00
e4c927208b Revert "Make MouseCursor mutable"
This reverts commit a6db8ab8bc4b569a26633b0ca3665297f1a5349b.

TBR=dcaiafa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/6079004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5311 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-17 22:48:50 +00:00
8fd1d26536 Make MouseCursor mutable
MouseCursor objects were previous immutable which makes it harder to
implement deserializers when MouseCursor is sent over IPC in Chromium.

R=dcaiafa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/6059005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5310 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-17 22:19:12 +00:00
5e13ac967b Add shape in DesktopFrame.
The shape will be used for Me2App mode in chromoting.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/4369005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5243 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-07 01:03:28 +00:00
e839da02c1 Fix MouseCursor to MouseCursorShape conversion in ScreenCapturerWin.
BUG=crbug.com/322596
R=dcaiafa@chromium.org, wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/4279005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5165 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-22 20:39:16 +00:00
5d85819dd2 Fix DesktopAndCursorComposer to restore frames to the original state.
Screen capturers may reuse frame buffers and they expect that the
frame content isn't changed by the frame consumer.
DesktopAndCursorComposer draws mouse cursor on generated frames and
it was releasing the frames with the mouse cursor on them. Fixed
it to restore frame content erasing mouse cursor before returning
desktop frames.

BUG=crbug.com/316297
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/3899004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5133 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-19 02:15:47 +00:00
773e72797f Provide a MouseCursorMonitor::CreateForWindow implementation in *_null.cc
Chromium issue:
https://code.google.com/p/chromium/issues/detail?id=310146

BUG=2551
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2759004

Patch from Daniel Nicoara <dnicoara@chromium.org>.

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5061 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-31 01:51:21 +00:00
31628aae7e Upgrade scoped_ptr to Chromium's latest version.
Analogous to the recent libjingle change: http://cl/54929753-p10.
This supports scoped_ptr<T[]> and scoped_ptr<C, FreeDeleter> rather
than scoped_array and scoped_ptr_malloc respectively.

- Add Chromium's template-based COMPILE_ASSERT. We didn't have this
previously in order to support the macro in C. Instead, move the
existing macro to compile_assert_c.h.
- Additionally copy the move.h and template_util.h depedencies and add
the WARN_UNUSED_RESULT macro.
- Leave scoped_array and scoped_ptr_malloc for now, but mark as
deprecated.
- Remove scoped_ptr foo(NULL) use. The default constructor handles it.
- Remove the now redundant COMPILE_ASSERT from peerconnection_jni.cc.
- Add a CHECK_ARRAY_SIZE macro to rtp_format_vp8_unittest.cc to remove
some repeated code.

TESTED=trybots
R=pbos@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2449005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5015 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-22 12:50:00 +00:00
2df89c0c8b MouseCursorMonitor implementation for OSX and Windows.
BUG=crbug.com/173265
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2388004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4994 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-17 19:47:18 +00:00
e6e749da38 Add MouseCursorRenderer.
The new class acts as a wrapper for DesktopCapturer interface. It takes
mouse shape and position from MouseCursorCapturer and renders it on the
frames produced by underlying DesktopCapturer.

BUG=crbug.com/173265
R=wez@chromium.org
TBR=andrew@webrtc.org (modules.gyp)

Review URL: https://webrtc-codereview.appspot.com/2387004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4968 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-16 02:48:41 +00:00
2767b53f66 Add MouseCursorCapturer interface with implementation for X11.
The new interface will be used to capture cursor shape and position and
blend it into the image captured with desktop capturers.

BUG=crbug.com/173265
R=wez@chromium.org
TBR=andrew@webrtc.org (modules.gyp)

Review URL: https://webrtc-codereview.appspot.com/2386005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4967 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-16 02:42:38 +00:00
30792987b8 Remove empty line in SharedXDisplay::RemoveEventHandler.
TBR=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2397004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4958 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-14 17:58:46 +00:00
7419a72383 Add event handling in SharedXDisplay.
SharedXDisplay has to handle X events because the events may belong to
different clients of that class.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2386004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4953 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-13 00:44:09 +00:00
894e6fe9ea Add DesktopCaptureOptions class.
The new class is used to pass configuration parameters to screen/window
capturers. It also allows to share X Window connection between multiple
objects.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2374004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4952 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-12 22:40:05 +00:00
becbefaee6 Fix WindowCapturerWin to capture window decorations after window size changes.
DWM doesn't update window decorations in bitmap captured
from GetWindowDC(). Work it around by calling PrintWindow()
after each resize (which somehow affects what's later
captured from GetWindowDC()). That solution avoids the
downsides of PrintWindow() (namely flickering) while still
allowing to capture window decorations correctly.

BUG=crbug.com/289759
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2295004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4847 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-25 22:56:59 +00:00
8d757ac0a2 Fix window capturer not to leak HDC.
Previously Windows window capturer kept DC handles between captures. As
result it was leaking DC handles in SelectWindow(). Fixed it so that it
calls GetWindowDC() for each capture.

R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2289004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4834 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-24 23:13:51 +00:00
958cdf68f3 Fix window capturer to stop capturing when the target is minimized.
BUG=crbug.com/288205
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2273005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4833 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-24 22:10:13 +00:00
2edb642810 Fix bugs in DesktopRegion::Subtract().
Fixed a bug that caused the crash in the linked bug and also couple of
other issues in the same code. Also added more tests.

BUG=crbug.com/295057
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2259005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4806 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-20 21:29:18 +00:00
6ab45b9dab Implement DesktopRegion subtraction.
Region subtraction is used in chromoting client, so it's needed to
replace SkRegion.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2205004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4741 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-13 19:53:16 +00:00
6a5cc9d899 Fix crash in the window capturer on windows
BUG=crbug.com/289753
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2203005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4737 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-12 19:17:26 +00:00
bebf3995ce Pre-multiply images for MouseCursorShape.
BUG=chromium:267270
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2173004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4685 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-05 19:32:46 +00:00
9ded07e3a4 Fix typo in InvertedDesktopFrame
BUG=279334
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2141004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4643 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-30 01:05:14 +00:00
01cb3ad883 Fix image flipping for OpenGL-based screen capturer on Mac.
I broke captured image flipping when refactoring this code while it was
still in chromium. Previously we had CaptureData that was returned from
capturers with correctly inverted stride, but frames were still stored
with positive stride. CaptureData was removed and so the returned frames
always had positive stride, which is not correct. Now ScreenCapturerMac
uses frames with inverted stride when capturing using OpenGL.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2105004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4621 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-26 21:48:56 +00:00
9f282403f2 WindowCapturer implementation for Linux.
Window enumeration is based on the code used by hangouts plugin
(see libjingle/talk/base/linuxwindowpicker.cc). XServerPixelBuffer
is used to capture windows. It had to be refactored to support window
capturing (previously it worked only for the whole screen).

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1741004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4605 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-23 18:22:12 +00:00
eef29ec6cf Implement window capturer for OS X.
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2055005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4599 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-23 00:39:46 +00:00
bf853f2732 Fix crash in screen capturer on Mac
BUG=crbug.com/247685
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/2006004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4518 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-10 01:30:23 +00:00
12dc1a38ca Switch C++-style C headers with their C equivalents.
The C++ headers define the C functions within the std:: namespace, but
we mainly don't use the std:: namespace for C functions. Therefore we
should include the C headers.

BUG=1833
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1917004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4486 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-05 16:22:53 +00:00
17758e96c5 Fix crash in DesktopRegion::Intersect().
BUG=crbug.com/266933
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1938004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4468 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-01 19:51:04 +00:00
e72428442d Fix some chromium-style warnings in webrtc/modules/desktop_capture/
BUG=163
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1904004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4446 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-31 15:32:43 +00:00
d102e66ef9 Fix ScreenCapturerLinux not to use XDamage when requested.
When moving this code to webrtc I added line "use_x_damage=true" for
debugging and forgot to remove it when landing this code, so the
capturer always tries to use XDamage.

BUG=crbug.com/263003
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1854004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4387 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-23 20:05:42 +00:00
d900e8bea8 Proper spacing for end-of-namespace comments.
BUG=
R=mflodman@webrtc.org, tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1760006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4293 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-07-03 15:12:26 +00:00
3348ae2b97 mac: Mark kCGLPFAFullScreen as allowed in a 10.6-only function.
kCGLPFAFullScreen is marked deprecated starting with 10.6 in the 10.9 SDK,
but it's functional on 10.6 and this code only runs on 10.6 and will go away
when support for 10.6 is dropped.

BUG=webrtc:1958
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1710004

Patch from Nico Weber <thakis@chromium.org>.

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4255 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-21 23:33:10 +00:00
a20eb91154 Make ScreenCapturerMac work in versions of OSX before Lion.
The screen capturer was broken when moving code to webrtc: width
and height parameters for glReadPixels were swapped by mistkake.

BUG=crbug.com/244102
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1678005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4239 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-17 22:22:40 +00:00
a590b41c9a Use intptr_t to represent window IDs on all platforms.
Previously void* was used on windows which makes it harder to work
with the IDs in cross-platform code.

R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1672004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4237 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-17 20:02:21 +00:00
6c35e0b0f7 Reorganize test targets in WebRTC
This CL will lower the number of test targets in WebRTC by:

Add common_audio_unittests and merge the following targets into it (copied from http://review.webrtc.org/1584006):
* resampler_unittests
* signal_processing_unittests
* vad_unittests

Merge into modules_unittests:
* bitrate_controller_unittests
* desktop_capture_unittests
* media_file_unittests
* remote_bitrate_estimator_unittests
* rtp_rtcp_unittests
* paced_sender_unittests

Merge into test_support_unittests:
* channel_transport_unittests

channel_transport.gyp was also removed in favor for test.gyp.

I had to remove a main method from rtcp_format_remb_unittest.cc
since it caused the fileutils.h code to not be able to find the
right project root path in ordrer to provide correct paths
to test files.

Buildbot configuration update will be synced with the commit of this CL.

TEST=trybots
BUG=1843
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1639004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4213 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-11 08:29:17 +00:00
4af0878e57 Allow the screen capturer to capture oversized cursors and cursors without alpha channel (Windows).
Changes in this CL:
  - CaptureCursor() scans the cursor to verify that it has alpha channel.
  - The AND mask of the cursor is used to reconstruct transparency if the cursor does not have alpha channel.
  - CaptureCursor() always outlines the cursor when a "screen reverse" pixel detected.  Previously it was only done for black and while cursors.
    
Added desktop_capture_unittest.MouseCursorShapeTest to test the cursor conversion code.
    
BUG=chromium:223147
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1627004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4210 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-10 22:29:17 +00:00
5e03f8ab67 Landing binary cursor image files to be used in a follow up CL.
See https://webrtc-codereview.appspot.com/1627004/ for more details. TBR since that CL has been reviewed and LGTMed.

TBR=sergeyu@chromium.org

BUG=chromium:223147

Review URL: https://webrtc-codereview.appspot.com/1647004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4209 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-10 21:07:31 +00:00
7e4ff354e3 Remove fake screen capturer because it's not used anywhere.
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1625004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4191 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-06 23:11:33 +00:00
d9c4658756 Fix leaks in DesktopRegion
BUG=crbug.com/246870
R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1615004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4186 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-05 19:24:42 +00:00
3d34f66292 Move screen capturers from chromium to webrtc.
R=alexeypa@chromium.org, wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1586005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4175 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-04 18:51:23 +00:00
3ee13e4ac2 Optimized DesktopRegion implementation.
Now DestktopRegion can merge overlapping rectangles.

R=wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1526004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4161 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-06-04 00:38:39 +00:00
ead3c6d508 Fix bugs in DesktopRegion::IntersectWith() and DesktopRect::IntersectWith().
IntersectWith() didn't work correctly which breaks screen capturers in chromium.

BUG=crbug.com/243160
R=alexeypa@chromium.org, wez@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1560004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4102 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-24 21:07:20 +00:00
6ec25073e3 Disable WindowCapturer tests on OSX and Linux
R=alexeypa@chromium.org

Review URL: https://webrtc-codereview.appspot.com/1533004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4085 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-22 18:47:07 +00:00
6ebfd346ae Add direct_dependent_settings in common.gypi.
When building chromium targets that depend on webrtc, compiler settings must
have the include path to webrtc and webrtc-specific defines that the headers
may depend on. Added direct_dependent_settings in common.gyp, so that all
webrtc target propagate these settings to dependencies.

R=andrew@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1371005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4084 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-22 18:22:21 +00:00