OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/capturer/video_frame_capturer.h" | 5 #include "remoting/capturer/video_frame_capturer.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <Cocoa/Cocoa.h> | 8 #include <Cocoa/Cocoa.h> |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <IOKit/pwr_mgt/IOPMLib.h> | 10 #include <IOKit/pwr_mgt/IOPMLib.h> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 VideoFrameCapturerMac(); | 105 VideoFrameCapturerMac(); |
106 virtual ~VideoFrameCapturerMac(); | 106 virtual ~VideoFrameCapturerMac(); |
107 | 107 |
108 bool Init(); | 108 bool Init(); |
109 | 109 |
110 // Overridden from VideoFrameCapturer: | 110 // Overridden from VideoFrameCapturer: |
111 virtual void Start(Delegate* delegate) OVERRIDE; | 111 virtual void Start(Delegate* delegate) OVERRIDE; |
112 virtual void Stop() OVERRIDE; | 112 virtual void Stop() OVERRIDE; |
113 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; | 113 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; |
114 virtual void CaptureFrame() OVERRIDE; | 114 virtual void CaptureFrame() OVERRIDE; |
115 virtual const SkISize& size_most_recent() const OVERRIDE; | |
116 | 115 |
117 private: | 116 private: |
118 void CaptureCursor(); | 117 void CaptureCursor(); |
119 | 118 |
120 void GlBlitFast(const VideoFrame& buffer, const SkRegion& region); | 119 void GlBlitFast(const VideoFrame& buffer, const SkRegion& region); |
121 void GlBlitSlow(const VideoFrame& buffer); | 120 void GlBlitSlow(const VideoFrame& buffer); |
122 void CgBlitPreLion(const VideoFrame& buffer, const SkRegion& region); | 121 void CgBlitPreLion(const VideoFrame& buffer, const SkRegion& region); |
123 void CgBlitPostLion(const VideoFrame& buffer, const SkRegion& region); | 122 void CgBlitPostLion(const VideoFrame& buffer, const SkRegion& region); |
124 | 123 |
125 // Called when the screen configuration is changed. | 124 // Called when the screen configuration is changed. |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 CopyRect(display_base_address, | 645 CopyRect(display_base_address, |
647 src_bytes_per_row, | 646 src_bytes_per_row, |
648 out_ptr, | 647 out_ptr, |
649 buffer.bytes_per_row(), | 648 buffer.bytes_per_row(), |
650 src_bytes_per_pixel, | 649 src_bytes_per_pixel, |
651 i.rect()); | 650 i.rect()); |
652 } | 651 } |
653 } | 652 } |
654 } | 653 } |
655 | 654 |
656 const SkISize& VideoFrameCapturerMac::size_most_recent() const { | |
657 return helper_.size_most_recent(); | |
658 } | |
659 | |
660 void VideoFrameCapturerMac::ScreenConfigurationChanged() { | 655 void VideoFrameCapturerMac::ScreenConfigurationChanged() { |
661 // Release existing buffers, which will be of the wrong size. | 656 // Release existing buffers, which will be of the wrong size. |
662 ReleaseBuffers(); | 657 ReleaseBuffers(); |
663 | 658 |
664 // Clear the dirty region, in case the display is down-sizing. | 659 // Clear the dirty region, in case the display is down-sizing. |
665 helper_.ClearInvalidRegion(); | 660 helper_.ClearInvalidRegion(); |
666 | 661 |
667 // Fetch the list if active displays and calculate their bounds. | 662 // Fetch the list if active displays and calculate their bounds. |
668 CGDisplayCount display_count; | 663 CGDisplayCount display_count; |
669 CGError error = CGGetActiveDisplayList(0, NULL, &display_count); | 664 CGError error = CGGetActiveDisplayList(0, NULL, &display_count); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 } | 850 } |
856 | 851 |
857 // static | 852 // static |
858 scoped_ptr<VideoFrameCapturer> VideoFrameCapturer::CreateWithFactory( | 853 scoped_ptr<VideoFrameCapturer> VideoFrameCapturer::CreateWithFactory( |
859 SharedBufferFactory* shared_buffer_factory) { | 854 SharedBufferFactory* shared_buffer_factory) { |
860 NOTIMPLEMENTED(); | 855 NOTIMPLEMENTED(); |
861 return scoped_ptr<VideoFrameCapturer>(); | 856 return scoped_ptr<VideoFrameCapturer>(); |
862 } | 857 } |
863 | 858 |
864 } // namespace remoting | 859 } // namespace remoting |
OLD | NEW |