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

Unified Diff: webrtc/media/base/videocapturer.h

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added dummy capturerenderadapter.cc Created 4 years, 10 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
« no previous file with comments | « webrtc/media/base/videobroadcaster.cc ('k') | webrtc/media/base/videocapturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videocapturer.h
diff --git a/webrtc/media/base/videocapturer.h b/webrtc/media/base/videocapturer.h
index 3b0d05e86ec01aec08c37e4bcf92a945ee1f2d6c..3addd8f05d7a40b63272efbe90a5ab81c7fb5c98 100644
--- a/webrtc/media/base/videocapturer.h
+++ b/webrtc/media/base/videocapturer.h
@@ -19,6 +19,7 @@
#include "webrtc/base/basictypes.h"
#include "webrtc/base/criticalsection.h"
+#include "webrtc/media/base/videosourceinterface.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/rollingaccumulator.h"
#include "webrtc/base/scoped_ptr.h"
@@ -27,6 +28,7 @@
#include "webrtc/base/timing.h"
#include "webrtc/media/base/mediachannel.h"
#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/devices/devicemanager.h"
@@ -73,7 +75,7 @@ struct CapturedFrame {
// time with nanosecond units.
uint32_t data_size; // number of bytes of the frame data
- webrtc::VideoRotation rotation; // rotation in degrees of the frame.
+ 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.
@@ -108,9 +110,9 @@ struct CapturedFrame {
// media engine thread). Hence, the VideoCapture subclasses dont need to be
// thread safe.
//
-class VideoCapturer
- : public sigslot::has_slots<>,
- public rtc::MessageHandler {
+class VideoCapturer : public sigslot::has_slots<>,
+ public rtc::MessageHandler,
+ public rtc::VideoSourceInterface<cricket::VideoFrame> {
public:
// All signals are marshalled to |thread| or the creating thread if
// none is provided.
@@ -197,11 +199,6 @@ class VideoCapturer
return capture_state_;
}
- // Tells videocapturer whether to apply the pending rotation. By default, the
- // rotation is applied and the generated frame is up right. When set to false,
- // generated frames will carry the rotation information from
- // SetCaptureRotation. Return value indicates whether this operation succeeds.
- virtual bool SetApplyRotation(bool enable);
virtual bool GetApplyRotation() { return apply_rotation_; }
// Returns true if the capturer is screencasting. This can be used to
@@ -240,10 +237,6 @@ class VideoCapturer
// Signal the captured frame to downstream.
sigslot::signal2<VideoCapturer*, const CapturedFrame*,
sigslot::multi_threaded_local> SignalFrameCaptured;
- // Signal the captured and possibly adapted frame to downstream consumers
- // such as the encoder.
- sigslot::signal2<VideoCapturer*, const VideoFrame*,
- sigslot::multi_threaded_local> SignalVideoFrame;
// If true, run video adaptation. By default, video adaptation is enabled
// and users must call video_adapter()->OnOutputFormatRequest()
@@ -269,7 +262,16 @@ class VideoCapturer
VariableInfo<double>* frame_time_stats,
VideoFormat* last_captured_frame_format);
+ // Implements VideoSourceInterface
+ void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
+ const rtc::VideoSinkWants& wants) override;
+ void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
+
protected:
+ // OnSinkWantsChanged can be overridden to change the default behavior
+ // when a sink changes its VideoSinkWants by calling AddOrUpdateSink.
+ virtual void OnSinkWantsChanged(const rtc::VideoSinkWants& wants);
+
// Callback attached to SignalFrameCaptured where SignalVideoFrames is called.
void OnFrameCaptured(VideoCapturer* video_capturer,
const CapturedFrame* captured_frame);
@@ -344,6 +346,7 @@ class VideoCapturer
bool muted_;
int black_frame_count_down_;
+ rtc::VideoBroadcaster broadcaster_;
bool enable_video_adapter_;
CoordinatedVideoAdapter video_adapter_;
« no previous file with comments | « webrtc/media/base/videobroadcaster.cc ('k') | webrtc/media/base/videocapturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698