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

Unified Diff: webrtc/modules/video_capture/video_capture_impl.h

Issue 2534553002: Replace VideoCaptureDataCallback by VideoSinkInterface. (Closed)
Patch Set: Break overlong lines. 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: webrtc/modules/video_capture/video_capture_impl.h
diff --git a/webrtc/modules/video_capture/video_capture_impl.h b/webrtc/modules/video_capture/video_capture_impl.h
index e9fee7edb42cedc1237510c18e31aafef7db60f5..a507450fb1c2143db6f507df91ef52abeb674843 100644
--- a/webrtc/modules/video_capture/video_capture_impl.h
+++ b/webrtc/modules/video_capture/video_capture_impl.h
@@ -39,7 +39,6 @@ public:
* deviceUniqueIdUTF8 - name of the device. Available names can be found by using GetDeviceName
*/
static rtc::scoped_refptr<VideoCaptureModule> Create(
- const int32_t id,
const char* deviceUniqueIdUTF8);
/*
@@ -49,10 +48,9 @@ public:
* externalCapture - [out] interface to call when a new frame is captured.
*/
static rtc::scoped_refptr<VideoCaptureModule> Create(
- const int32_t id,
VideoCaptureExternal*& externalCapture);
- static DeviceInfo* CreateDeviceInfo(const int32_t id);
+ static DeviceInfo* CreateDeviceInfo();
// Helpers for converting between (integral) degrees and
// VideoRotation values. Return 0 on success.
@@ -60,55 +58,41 @@ public:
static int32_t RotationInDegrees(VideoRotation rotation, int* degrees);
//Call backs
- virtual void RegisterCaptureDataCallback(
- VideoCaptureDataCallback& dataCallback);
- virtual void DeRegisterCaptureDataCallback();
- virtual void RegisterCaptureCallback(VideoCaptureFeedBack& callBack);
- virtual void DeRegisterCaptureCallback();
-
- virtual void SetCaptureDelay(int32_t delayMS);
- virtual int32_t CaptureDelay();
- virtual int32_t SetCaptureRotation(VideoRotation rotation);
- virtual bool SetApplyRotation(bool enable);
- virtual bool GetApplyRotation() {
+ void RegisterCaptureDataCallback(
+ rtc::VideoSinkInterface<VideoFrame>* dataCallback) override;
+ void DeRegisterCaptureDataCallback() override;
+
+ int32_t SetCaptureRotation(VideoRotation rotation) override;
+ bool SetApplyRotation(bool enable) override;
+ bool GetApplyRotation() override {
return apply_rotation_;
}
- virtual void EnableFrameRateCallback(const bool enable);
- virtual void EnableNoPictureAlarm(const bool enable);
-
- virtual const char* CurrentDeviceName() const;
-
- // Module handling
- virtual int64_t TimeUntilNextProcess();
- virtual void Process();
+ const char* CurrentDeviceName() const override;
// Implement VideoCaptureExternal
// |capture_time| must be specified in NTP time format in milliseconds.
- virtual int32_t IncomingFrame(uint8_t* videoFrame,
- size_t videoFrameLength,
- const VideoCaptureCapability& frameInfo,
- int64_t captureTime = 0);
+ int32_t IncomingFrame(uint8_t* videoFrame,
+ size_t videoFrameLength,
+ const VideoCaptureCapability& frameInfo,
+ int64_t captureTime = 0) override;
// Platform dependent
- virtual int32_t StartCapture(const VideoCaptureCapability& capability)
+ int32_t StartCapture(const VideoCaptureCapability& capability) override
{
_requestedCapability = capability;
return -1;
}
- virtual int32_t StopCapture() { return -1; }
- virtual bool CaptureStarted() {return false; }
- virtual int32_t CaptureSettings(VideoCaptureCapability& /*settings*/)
+ int32_t StopCapture() override { return -1; }
+ bool CaptureStarted() override {return false; }
+ int32_t CaptureSettings(VideoCaptureCapability& /*settings*/) override
{ return -1; }
- VideoCaptureEncodeInterface* GetEncodeInterface(const VideoCodec& /*codec*/)
- { return NULL; }
protected:
- VideoCaptureImpl(const int32_t id);
+ VideoCaptureImpl();
virtual ~VideoCaptureImpl();
int32_t DeliverCapturedFrame(VideoFrame& captureFrame);
- int32_t _id; // Module ID
char* _deviceUniqueId; // current Device unique name;
CriticalSectionWrapper& _apiCs;
int32_t _captureDelay; // Current capture delay. May be changed of platform dependent parts.
@@ -117,19 +101,12 @@ private:
void UpdateFrameCount();
uint32_t CalculateFrameRate(int64_t now_ns);
- CriticalSectionWrapper& _callBackCs;
-
// last time the module process function was called.
int64_t _lastProcessTimeNanos;
// last time the frame rate callback function was called.
int64_t _lastFrameRateCallbackTimeNanos;
- bool _frameRateCallBack; // true if EnableFrameRateCallback
- bool _noPictureAlarmCallBack; //true if EnableNoPictureAlarm
- VideoCaptureAlarm _captureAlarm; // current value of the noPictureAlarm
- int32_t _setCaptureDelay; // The currently used capture delay
- VideoCaptureDataCallback* _dataCallBack;
- VideoCaptureFeedBack* _captureCallBack;
+ rtc::VideoSinkInterface<VideoFrame>* _dataCallBack;
int64_t _lastProcessFrameTimeNanos;
// timestamp for local captured frames
« no previous file with comments | « webrtc/modules/video_capture/video_capture_factory.cc ('k') | webrtc/modules/video_capture/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698