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

Unified Diff: media/capture/video/chromeos/mock_video_capture_client.h

Issue 2837273004: media: add video capture device for ARC++ camera HAL v3 (Closed)
Patch Set: RELAND: media: add video capture device for ARC++ camera HAL v3 Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/video/chromeos/mock_video_capture_client.h
diff --git a/media/capture/video/chromeos/mock_video_capture_client.h b/media/capture/video/chromeos/mock_video_capture_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..4423b2865f2fb2787a3f84ca6ade572f576ab32e
--- /dev/null
+++ b/media/capture/video/chromeos/mock_video_capture_client.h
@@ -0,0 +1,73 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAPTURE_VIDEO_CHROMEOS_MOCK_VIDEO_CAPTURE_CLIENT_H_
+#define MEDIA_CAPTURE_VIDEO_CHROMEOS_MOCK_VIDEO_CAPTURE_CLIENT_H_
+
+#include "media/capture/video/video_capture_device.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace media {
+namespace unittest_internal {
+
+class MockVideoCaptureClient : public VideoCaptureDevice::Client {
+ public:
+ MOCK_METHOD0(DoReserveOutputBuffer, void(void));
+ MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
+ MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void));
+ MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void));
+ MOCK_METHOD2(OnError,
+ void(const tracked_objects::Location& from_here,
+ const std::string& reason));
+ MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void));
+ MOCK_METHOD0(OnStarted, void(void));
+
+ explicit MockVideoCaptureClient();
+
+ ~MockVideoCaptureClient();
+
+ void SetFrameCb(base::OnceClosure frame_cb);
+
+ void SetQuitCb(base::OnceClosure quit_cb);
+
+ void DumpError(const tracked_objects::Location& location,
+ const std::string& message);
+
+ void OnIncomingCapturedData(const uint8_t* data,
+ int length,
+ const VideoCaptureFormat& format,
+ int rotation,
+ base::TimeTicks reference_time,
+ base::TimeDelta timestamp,
+ int frame_feedback_id) override;
+ // Trampoline methods to workaround GMOCK problems with std::unique_ptr<>.
+ Buffer ReserveOutputBuffer(const gfx::Size& dimensions,
+ media::VideoPixelFormat format,
+ media::VideoPixelStorage storage,
+ int frame_feedback_id) override;
+ void OnIncomingCapturedBuffer(Buffer buffer,
+ const VideoCaptureFormat& format,
+ base::TimeTicks reference_time,
+ base::TimeDelta timestamp) override;
+ void OnIncomingCapturedBufferExt(
+ Buffer buffer,
+ const VideoCaptureFormat& format,
+ base::TimeTicks reference_time,
+ base::TimeDelta timestamp,
+ gfx::Rect visible_rect,
+ const VideoFrameMetadata& additional_metadata) override;
+ Buffer ResurrectLastOutputBuffer(const gfx::Size& dimensions,
+ media::VideoPixelFormat format,
+ media::VideoPixelStorage storage,
+ int frame_feedback_id) override;
+
+ private:
+ base::OnceClosure frame_cb_;
+ base::OnceClosure quit_cb_;
+};
+
+} // namespace unittest_internal
+} // namespace media
+
+#endif // MEDIA_CAPTURE_VIDEO_CHROMEOS_MOCK_VIDEO_CAPTURE_CLIENT_H_
« no previous file with comments | « media/capture/video/chromeos/mock_camera_module.cc ('k') | media/capture/video/chromeos/mock_video_capture_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698