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

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 1106563002: FakeVideoCaptureDevice: add support for capturing into Dma-Bufs using VGEM in CrOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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
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 #include "content/browser/media/capture/web_contents_video_capture_device.h" 5 #include "content/browser/media/capture/web_contents_video_capture_device.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 int buffer_id) 387 int buffer_id)
388 : id_(buffer_id), 388 : id_(buffer_id),
389 pool_(pool), 389 pool_(pool),
390 buffer_handle_(buffer_handle.Pass()) { 390 buffer_handle_(buffer_handle.Pass()) {
391 DCHECK(pool_.get()); 391 DCHECK(pool_.get());
392 } 392 }
393 int id() const override { return id_; } 393 int id() const override { return id_; }
394 size_t size() const override { return buffer_handle_->size(); } 394 size_t size() const override { return buffer_handle_->size(); }
395 void* data() override { return buffer_handle_->data(); } 395 void* data() override { return buffer_handle_->data(); }
396 ClientBuffer AsClientBuffer() override { return nullptr; } 396 ClientBuffer AsClientBuffer() override { return nullptr; }
397 base::PlatformFile AsPlatformFile() override { return 0; }
397 398
398 private: 399 private:
399 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); } 400 ~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); }
400 401
401 const int id_; 402 const int id_;
402 const scoped_refptr<VideoCaptureBufferPool> pool_; 403 const scoped_refptr<VideoCaptureBufferPool> pool_;
403 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_; 404 const scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle_;
404 }; 405 };
405 406
406 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; 407 scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 source()->SetSolidColor(SK_ColorGREEN); 872 source()->SetSolidColor(SK_ColorGREEN);
872 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); 873 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN));
873 source()->SetSolidColor(SK_ColorRED); 874 source()->SetSolidColor(SK_ColorRED);
874 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); 875 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED));
875 876
876 device()->StopAndDeAllocate(); 877 device()->StopAndDeAllocate();
877 } 878 }
878 879
879 } // namespace 880 } // namespace
880 } // namespace content 881 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698