Index: content/browser/media/capture/content_video_capture_device_core.h |
diff --git a/content/browser/media/capture/content_video_capture_device_core.h b/content/browser/media/capture/content_video_capture_device_core.h |
index 992caa74b6ce360c890be5e0ec5d96226fca1918..119296cd691f0abd01e137fcf6a4ae59974a0739 100644 |
--- a/content/browser/media/capture/content_video_capture_device_core.h |
+++ b/content/browser/media/capture/content_video_capture_device_core.h |
@@ -13,17 +13,16 @@ |
#include "base/threading/thread_checker.h" |
#include "content/browser/media/capture/video_capture_oracle.h" |
#include "content/common/content_export.h" |
+#include "media/base/video_frame.h" |
#include "media/video/capture/video_capture_device.h" |
namespace media { |
+class VideoCaptureParams; |
class VideoFrame; |
} // namespace media |
namespace content { |
-const int kMinFrameWidth = 2; |
-const int kMinFrameHeight = 2; |
- |
// Returns the nearest even integer closer to zero. |
template<typename IntType> |
IntType MakeEven(IntType x) { |
@@ -52,11 +51,12 @@ class ThreadSafeCaptureOracle |
const media::VideoCaptureParams& params); |
// Called when a captured frame is available or an error has occurred. |
- // If |success| is true then the frame provided is valid and |timestamp| |
- // indicates when the frame was painted. |
- // If |success| is false, both the frame provided and |timestamp| are invalid. |
- typedef base::Callback<void(base::TimeTicks timestamp, bool success)> |
- CaptureFrameCallback; |
+ // If |success| is true then |frame| is valid and |timestamp| indicates when |
+ // the frame was painted. |
+ // If |success| is false, all other parameters are invalid. |
Ami GONE FROM CHROMIUM
2014/04/01 18:03:38
Maybe make this the first param, then?
hshi1
2014/04/24 20:55:45
It's a bit messy. See web_contents_video_capture_d
Ami GONE FROM CHROMIUM
2014/04/24 21:05:28
Yeah, not worth it.
|
+ typedef base::Callback<void(const scoped_refptr<media::VideoFrame>& frame, |
+ base::TimeTicks timestamp, |
+ bool success)> CaptureFrameCallback; |
bool ObserveEventAndDecideCapture(VideoCaptureOracle::Event event, |
base::TimeTicks event_time, |
@@ -86,9 +86,9 @@ class ThreadSafeCaptureOracle |
// Callback invoked on completion of all captures. |
void DidCaptureFrame( |
+ int frame_number, |
const scoped_refptr<media::VideoCaptureDevice::Client::Buffer>& buffer, |
const scoped_refptr<media::VideoFrame>& frame, |
- int frame_number, |
base::TimeTicks timestamp, |
bool success); |
@@ -102,14 +102,13 @@ class ThreadSafeCaptureOracle |
const scoped_ptr<VideoCaptureOracle> oracle_; |
// The video capture parameters used to construct the oracle proxy. |
- const media::VideoCaptureParams params_; |
+ media::VideoCaptureParams params_; |
// Indicates if capture size has been updated after construction. |
bool capture_size_updated_; |
- // The current capturing resolution and frame rate. |
- gfx::Size capture_size_; |
- int frame_rate_; |
+ // The current capturing format, as a media::VideoFrame::Format. |
+ media::VideoFrame::Format video_frame_format_; |
}; |
// Keeps track of the video capture source frames and executes copying on the |
@@ -124,8 +123,8 @@ class VideoCaptureMachine { |
// Starts capturing. Returns true if succeeded. |
// Must be run on the UI BrowserThread. |
- virtual bool Start( |
- const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy) = 0; |
+ virtual bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy, |
+ const media::VideoCaptureParams& params) = 0; |
// Stops capturing. Must be run on the UI BrowserThread. |
// |callback| is invoked after the capturing has stopped. |