Index: webrtc/media/base/videocapturer.h |
diff --git a/webrtc/media/base/videocapturer.h b/webrtc/media/base/videocapturer.h |
index c9c96eeb1d299cb06eaad73c8d4734cfdc357eac..12aa1ca8bcba1d2b02794f4e9386d8f5317c2cdf 100644 |
--- a/webrtc/media/base/videocapturer.h |
+++ b/webrtc/media/base/videocapturer.h |
@@ -28,8 +28,7 @@ |
#include "webrtc/media/base/videoadapter.h" |
#include "webrtc/media/base/videobroadcaster.h" |
#include "webrtc/media/base/videocommon.h" |
-#include "webrtc/media/base/videoframefactory.h" |
- |
+#include "webrtc/media/base/videoframe.h" |
namespace cricket { |
@@ -43,39 +42,11 @@ enum CaptureState { |
CS_FAILED, // The capturer failed to start. |
}; |
+// TODO(nisse): For some reason, forward declaration doens't work when |
+// the definition is a "using" alias. |
+#if 0 |
class VideoFrame; |
- |
-struct CapturedFrame { |
- static const uint32_t kFrameHeaderSize = 40; // Size from width to data_size. |
- static const uint32_t kUnknownDataSize = 0xFFFFFFFF; |
- |
- CapturedFrame(); |
- |
- // Get the number of bytes of the frame data. If data_size is known, return |
- // it directly. Otherwise, calculate the size based on width, height, and |
- // fourcc. Return true if succeeded. |
- bool GetDataSize(uint32_t* size) const; |
- |
- // The width and height of the captured frame could be different from those |
- // of VideoFormat. Once the first frame is captured, the width, height, |
- // fourcc, pixel_width, and pixel_height should keep the same over frames. |
- int width; // in number of pixels |
- int height; // in number of pixels |
- uint32_t fourcc; // compression |
- uint32_t pixel_width; // width of a pixel, default is 1 |
- uint32_t pixel_height; // height of a pixel, default is 1 |
- int64_t time_stamp; // timestamp of when the frame was captured, in unix |
- // time with nanosecond units. |
- uint32_t data_size; // number of bytes of the frame data |
- |
- webrtc::VideoRotation rotation; // rotation in degrees of the frame. |
- |
- void* data; // pointer to the frame data. This object allocates the |
- // memory or points to an existing memory. |
- |
- private: |
- RTC_DISALLOW_COPY_AND_ASSIGN(CapturedFrame); |
-}; |
+#endif |
// VideoCapturer is an abstract class that defines the interfaces for video |
// capturing. The subclasses implement the video capturer for various types of |
@@ -192,13 +163,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
// Signal all capture state changes that are not a direct result of calling |
// Start(). |
sigslot::signal2<VideoCapturer*, CaptureState> SignalStateChange; |
- // Frame callbacks are multithreaded to allow disconnect and connect to be |
- // called concurrently. It also ensures that it is safe to call disconnect |
- // at any time which is needed since the signal may be called from an |
- // unmarshalled thread owned by the VideoCapturer. |
- // Signal the captured frame to downstream. |
- sigslot::signal2<VideoCapturer*, const CapturedFrame*, |
- sigslot::multi_threaded_local> SignalFrameCaptured; |
// If true, run video adaptation. By default, video adaptation is enabled |
// and users must call video_adapter()->OnOutputFormatRequest() |
@@ -208,9 +172,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
enable_video_adapter_ = enable_video_adapter; |
} |
- // Takes ownership. |
- void set_frame_factory(VideoFrameFactory* frame_factory); |
- |
bool GetInputSize(int* width, int* height); |
// Implements VideoSourceInterface |
@@ -251,10 +212,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
int* crop_y, |
int64_t* translated_camera_time_us); |
- // Callback attached to SignalFrameCaptured where SignalVideoFrames is called. |
- void OnFrameCaptured(VideoCapturer* video_capturer, |
- const CapturedFrame* captured_frame); |
- |
// Called when a frame has been captured and converted to a |
// VideoFrame. OnFrame can be called directly by an implementation |
// that does not use SignalFrameCaptured or OnFrameCaptured. The |
@@ -279,7 +236,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
} |
void SetSupportedFormats(const std::vector<VideoFormat>& formats); |
- VideoFrameFactory* frame_factory() { return frame_factory_.get(); } |
private: |
void Construct(); |
@@ -289,9 +245,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
int64_t GetFormatDistance(const VideoFormat& desired, |
const VideoFormat& supported); |
- // Convert captured frame to readable string for LOG messages. |
- std::string ToString(const CapturedFrame* frame) const; |
- |
// Updates filtered_supported_formats_ so that it contains the formats in |
// supported_formats_ that fulfill all applied restrictions. |
void UpdateFilteredSupportedFormats(); |
@@ -303,7 +256,6 @@ class VideoCapturer : public sigslot::has_slots<>, |
rtc::ThreadChecker thread_checker_; |
std::string id_; |
CaptureState capture_state_; |
- std::unique_ptr<VideoFrameFactory> frame_factory_; |
std::unique_ptr<VideoFormat> capture_format_; |
std::vector<VideoFormat> supported_formats_; |
std::unique_ptr<VideoFormat> max_format_; |
@@ -323,6 +275,7 @@ class VideoCapturer : public sigslot::has_slots<>, |
int input_width_ GUARDED_BY(frame_stats_crit_); |
int input_height_ GUARDED_BY(frame_stats_crit_); |
+ // TODO(nisse): Still needed? |
// Whether capturer should apply rotation to the frame before signaling it. |
bool apply_rotation_; |