Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Side by Side Diff: content/browser/renderer_host/media/web_contents_video_capture_device.cc

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Relevant files only. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Implementation notes: This needs to work on a variety of hardware 5 // Implementation notes: This needs to work on a variety of hardware
6 // configurations where the speed of the CPU and GPU greatly affect overall 6 // configurations where the speed of the CPU and GPU greatly affect overall
7 // performance. Therefore, the process of capturing has been split up into a 7 // performance. Therefore, the process of capturing has been split up into a
8 // pipeline of three stages. Each stage executes on its own thread: 8 // pipeline of three stages. Each stage executes on its own thread:
9 // 9 //
10 // 1. Capture: A bitmap is snapshotted/copied from the RenderView's backing 10 // 1. Capture: A bitmap is snapshotted/copied from the RenderView's backing
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include <algorithm> 43 #include <algorithm>
44 #include <string> 44 #include <string>
45 45
46 #include "base/basictypes.h" 46 #include "base/basictypes.h"
47 #include "base/bind.h" 47 #include "base/bind.h"
48 #include "base/bind_helpers.h" 48 #include "base/bind_helpers.h"
49 #include "base/callback_forward.h" 49 #include "base/callback_forward.h"
50 #include "base/debug/trace_event.h" 50 #include "base/debug/trace_event.h"
51 #include "base/logging.h" 51 #include "base/logging.h"
52 #include "base/memory/scoped_ptr.h" 52 #include "base/memory/scoped_ptr.h"
53 #include "base/string_number_conversions.h"
54 #include "base/string_piece.h"
55 #include "base/string_util.h"
53 #include "base/stringprintf.h" 56 #include "base/stringprintf.h"
54 #include "base/synchronization/lock.h" 57 #include "base/synchronization/lock.h"
55 #include "base/threading/thread.h" 58 #include "base/threading/thread.h"
56 #include "base/time.h" 59 #include "base/time.h"
57 #include "content/browser/renderer_host/media/web_contents_capture_util.h" 60 #include "content/browser/renderer_host/media/web_contents_capture_util.h"
58 #include "content/public/browser/browser_thread.h" 61 #include "content/public/browser/browser_thread.h"
59 #include "content/public/browser/render_process_host.h" 62 #include "content/public/browser/render_process_host.h"
60 #include "content/public/browser/render_view_host.h" 63 #include "content/public/browser/render_view_host.h"
61 #include "content/public/browser/render_widget_host_view.h" 64 #include "content/public/browser/render_widget_host_view.h"
62 #include "content/public/browser/web_contents.h" 65 #include "content/public/browser/web_contents.h"
63 #include "content/public/browser/web_contents_observer.h" 66 #include "content/public/browser/web_contents_observer.h"
67 #include "content/public/common/media_stream_request.h"
64 #include "media/base/bind_to_loop.h" 68 #include "media/base/bind_to_loop.h"
65 #include "media/video/capture/video_capture_types.h" 69 #include "media/video/capture/video_capture_types.h"
66 #include "skia/ext/image_operations.h" 70 #include "skia/ext/image_operations.h"
67 #include "skia/ext/platform_canvas.h" 71 #include "skia/ext/platform_canvas.h"
68 #include "third_party/skia/include/core/SkBitmap.h" 72 #include "third_party/skia/include/core/SkBitmap.h"
69 #include "third_party/skia/include/core/SkColor.h" 73 #include "third_party/skia/include/core/SkColor.h"
70 #include "ui/gfx/rect.h" 74 #include "ui/gfx/rect.h"
71 75
72 // TODO(miu): The caller of Allocate() should use an appropriate heuristic to 76 // TODO(miu): The caller of Allocate() should use an appropriate heuristic to
73 // determine the frame size. For now, hard-code the capture device to 720p 77 // determine the frame size. For now, hard-code the capture device to 720p
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 capturer_->SetConsumer(NULL); 1054 capturer_->SetConsumer(NULL);
1051 capturer_->DeAllocate(); 1055 capturer_->DeAllocate();
1052 } 1056 }
1053 1057
1054 const media::VideoCaptureDevice::Name& 1058 const media::VideoCaptureDevice::Name&
1055 WebContentsVideoCaptureDevice::device_name() { 1059 WebContentsVideoCaptureDevice::device_name() {
1056 return device_name_; 1060 return device_name_;
1057 } 1061 }
1058 1062
1059 } // namespace content 1063 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698