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 "content/browser/renderer_host/media/video_capture_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 #define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \ | 39 #define UMA_HISTOGRAM_ASPECT_RATIO(name, width, height) \ |
40 UMA_HISTOGRAM_SPARSE_SLOWLY( \ | 40 UMA_HISTOGRAM_SPARSE_SLOWLY( \ |
41 name, \ | 41 name, \ |
42 (height) ? ((width) * 100) / (height) : kInfiniteRatio); | 42 (height) ? ((width) * 100) / (height) : kInfiniteRatio); |
43 | 43 |
44 class SyncTokenClientImpl : public VideoFrame::SyncTokenClient { | 44 class SyncTokenClientImpl : public VideoFrame::SyncTokenClient { |
45 public: | 45 public: |
46 explicit SyncTokenClientImpl(GLHelper* gl_helper) : gl_helper_(gl_helper) {} | 46 explicit SyncTokenClientImpl(GLHelper* gl_helper) : gl_helper_(gl_helper) {} |
47 ~SyncTokenClientImpl() override {} | 47 ~SyncTokenClientImpl() override {} |
48 void GenerateSyncToken(gpu::SyncToken* sync_token) override { | 48 uint32 InsertSyncPoint() override { return gl_helper_->InsertSyncPoint(); } |
49 gl_helper_->GenerateSyncToken(sync_token); | |
50 } | |
51 void WaitSyncToken(const gpu::SyncToken& sync_token) override { | 49 void WaitSyncToken(const gpu::SyncToken& sync_token) override { |
52 gl_helper_->WaitSyncToken(sync_token); | 50 gl_helper_->WaitSyncToken(sync_token); |
53 } | 51 } |
54 | 52 |
55 private: | 53 private: |
56 GLHelper* gl_helper_; | 54 GLHelper* gl_helper_; |
57 }; | 55 }; |
58 | 56 |
59 void ReturnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, | 57 void ReturnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, |
60 const gpu::SyncToken& sync_token) { | 58 const gpu::SyncToken& sync_token) { |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 int session_id, | 469 int session_id, |
472 const ControllerClients& clients) { | 470 const ControllerClients& clients) { |
473 for (auto client : clients) { | 471 for (auto client : clients) { |
474 if (client->session_id == session_id) | 472 if (client->session_id == session_id) |
475 return client; | 473 return client; |
476 } | 474 } |
477 return NULL; | 475 return NULL; |
478 } | 476 } |
479 | 477 |
480 } // namespace content | 478 } // namespace content |
OLD | NEW |