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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 2518143004: [Mojo Video Capture] Replace RESOURCE_UTILIZATION with interface ReceiverLoadObserver (Closed)
Patch Set: Fix for android-only code Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/web_contents_video_capture_device_unittest.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index cc6bc3a3bd140d0cb3e49e3154ba5f7fb21e81fd..38430287a0044d3cf6c21d3964d4b3a2fb51c092 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -338,36 +338,39 @@ class StubClient : public media::VideoCaptureDevice::Client {
}
~StubClient() override {}
- MOCK_METHOD6(OnIncomingCapturedData,
+ MOCK_METHOD7(OnIncomingCapturedData,
void(const uint8_t* data,
int length,
const media::VideoCaptureFormat& frame_format,
int rotation,
base::TimeTicks reference_time,
- base::TimeDelta timestamp));
+ base::TimeDelta timestamp,
+ int frame_feedback_id));
MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>
ReserveOutputBuffer(const gfx::Size& dimensions,
media::VideoPixelFormat format,
- media::VideoPixelStorage storage) override {
+ media::VideoPixelStorage storage,
+ int frame_feedback_id) override {
CHECK_EQ(format, media::PIXEL_FORMAT_I420);
int buffer_id_to_drop =
media::VideoCaptureBufferPool::kInvalidId; // Ignored.
const int buffer_id = buffer_pool_->ReserveForProducer(
- dimensions, format, storage, &buffer_id_to_drop);
+ dimensions, format, storage, frame_feedback_id, &buffer_id_to_drop);
if (buffer_id == media::VideoCaptureBufferPool::kInvalidId)
return NULL;
return std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>(
- new AutoReleaseBuffer(
- buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id));
+ new AutoReleaseBuffer(buffer_pool_,
+ buffer_pool_->GetBufferHandle(buffer_id),
+ buffer_id, frame_feedback_id));
}
// Trampoline method to workaround GMOCK problems with std::unique_ptr<>.
void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
- const media::VideoCaptureFormat& frame_format,
+ const media::VideoCaptureFormat& format,
base::TimeTicks reference_time,
base::TimeDelta timestamp) override {
DoOnIncomingCapturedBuffer();
@@ -404,15 +407,17 @@ class StubClient : public media::VideoCaptureDevice::Client {
std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>
ResurrectLastOutputBuffer(const gfx::Size& dimensions,
media::VideoPixelFormat format,
- media::VideoPixelStorage storage) override {
+ media::VideoPixelStorage storage,
+ int frame_feedback_id) override {
CHECK_EQ(format, media::PIXEL_FORMAT_I420);
const int buffer_id =
buffer_pool_->ResurrectLastForProducer(dimensions, format, storage);
if (buffer_id == media::VideoCaptureBufferPool::kInvalidId)
return nullptr;
return std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>(
- new AutoReleaseBuffer(
- buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id));
+ new AutoReleaseBuffer(buffer_pool_,
+ buffer_pool_->GetBufferHandle(buffer_id),
+ buffer_id, frame_feedback_id));
}
void OnError(const tracked_objects::Location& from_here,
@@ -428,13 +433,16 @@ class StubClient : public media::VideoCaptureDevice::Client {
AutoReleaseBuffer(
const scoped_refptr<media::VideoCaptureBufferPool>& pool,
std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle,
- int buffer_id)
+ int buffer_id,
+ int frame_feedback_id)
: id_(buffer_id),
+ frame_feedback_id_(frame_feedback_id),
pool_(pool),
buffer_handle_(std::move(buffer_handle)) {
DCHECK(pool_);
}
int id() const override { return id_; }
+ int frame_feedback_id() const override { return frame_feedback_id_; }
gfx::Size dimensions() const override {
return buffer_handle_->dimensions();
}
@@ -458,6 +466,7 @@ class StubClient : public media::VideoCaptureDevice::Client {
~AutoReleaseBuffer() override { pool_->RelinquishProducerReservation(id_); }
const int id_;
+ const int frame_feedback_id_;
const scoped_refptr<media::VideoCaptureBufferPool> pool_;
const std::unique_ptr<media::VideoCaptureBufferHandle> buffer_handle_;
};

Powered by Google App Engine
This is Rietveld 408576698