CVO capturer feature: allow unrotated frame flows through the capture pipeline.

split from https://webrtc-codereview.appspot.com/37029004/

This is based on clean up code change at https://webrtc-codereview.appspot.com/37129004

BUG=4145
R=perkj@webrtc.org, pthatcher@webrtc.org, stefan@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39799004

Cr-Commit-Position: refs/heads/master@{#8337}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8337 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
guoweis@webrtc.org
2015-02-11 17:51:17 +00:00
parent 073dd7b423
commit 20e8f22766
23 changed files with 370 additions and 32 deletions

View File

@@ -110,7 +110,8 @@ VideoCapturer::VideoCapturer()
: thread_(rtc::Thread::Current()),
adapt_frame_drops_data_(kMaxAccumulatorSize),
effect_frame_drops_data_(kMaxAccumulatorSize),
frame_time_data_(kMaxAccumulatorSize) {
frame_time_data_(kMaxAccumulatorSize),
apply_rotation_(true) {
Construct();
}
@@ -118,7 +119,8 @@ VideoCapturer::VideoCapturer(rtc::Thread* thread)
: thread_(thread),
adapt_frame_drops_data_(kMaxAccumulatorSize),
effect_frame_drops_data_(kMaxAccumulatorSize),
frame_time_data_(kMaxAccumulatorSize) {
frame_time_data_(kMaxAccumulatorSize),
apply_rotation_(true) {
Construct();
}
@@ -254,6 +256,14 @@ bool VideoCapturer::MuteToBlackThenPause(bool muted) {
return Pause(false);
}
bool VideoCapturer::SetApplyRotation(bool enable) {
apply_rotation_ = enable;
if (frame_factory_) {
frame_factory_->SetApplyRotation(apply_rotation_);
}
return true;
}
void VideoCapturer::SetSupportedFormats(
const std::vector<VideoFormat>& formats) {
supported_formats_ = formats;
@@ -340,6 +350,13 @@ std::string VideoCapturer::ToString(const CapturedFrame* captured_frame) const {
return ss.str();
}
void VideoCapturer::set_frame_factory(VideoFrameFactory* frame_factory) {
frame_factory_.reset(frame_factory);
if (frame_factory) {
frame_factory->SetApplyRotation(apply_rotation_);
}
}
void VideoCapturer::GetStats(VariableInfo<int>* adapt_drops_stats,
VariableInfo<int>* effect_drops_stats,
VariableInfo<double>* frame_time_stats,