Revert "Put ViEFrameProviderBase::DeliverFrame back in the critical section in ViECapturer::DeliverI420Frame"
This reverts commit r8724. Reason for revert: This was not the cause of the tsan issues. BUG=1128 R=mflodman@webrtc.org, pbos@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50389004 Cr-Commit-Position: refs/heads/master@{#8790} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8790 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c7157da599
commit
17c64d1c96
@ -509,56 +509,56 @@ bool ViECapturer::ViECaptureProcess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViECapturer::DeliverI420Frame(I420VideoFrame* video_frame) {
|
void ViECapturer::DeliverI420Frame(I420VideoFrame* video_frame) {
|
||||||
CriticalSectionScoped cs(effects_and_stats_cs_.get());
|
|
||||||
|
|
||||||
if (video_frame->native_handle() != NULL) {
|
if (video_frame->native_handle() != NULL) {
|
||||||
ViEFrameProviderBase::DeliverFrame(video_frame, std::vector<uint32_t>());
|
ViEFrameProviderBase::DeliverFrame(video_frame, std::vector<uint32_t>());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply image enhancement and effect filter.
|
// Apply image enhancement and effect filter.
|
||||||
if (deflicker_frame_stats_) {
|
{
|
||||||
if (image_proc_module_->GetFrameStats(deflicker_frame_stats_,
|
CriticalSectionScoped cs(effects_and_stats_cs_.get());
|
||||||
*video_frame) == 0) {
|
if (deflicker_frame_stats_) {
|
||||||
image_proc_module_->Deflickering(video_frame, deflicker_frame_stats_);
|
if (image_proc_module_->GetFrameStats(deflicker_frame_stats_,
|
||||||
} else {
|
*video_frame) == 0) {
|
||||||
LOG_F(LS_ERROR) << "Could not get frame stats.";
|
image_proc_module_->Deflickering(video_frame, deflicker_frame_stats_);
|
||||||
}
|
} else {
|
||||||
}
|
LOG_F(LS_ERROR) << "Could not get frame stats.";
|
||||||
if (brightness_frame_stats_) {
|
|
||||||
if (image_proc_module_->GetFrameStats(brightness_frame_stats_,
|
|
||||||
*video_frame) == 0) {
|
|
||||||
int32_t brightness = image_proc_module_->BrightnessDetection(
|
|
||||||
*video_frame, *brightness_frame_stats_);
|
|
||||||
|
|
||||||
switch (brightness) {
|
|
||||||
case VideoProcessingModule::kNoWarning:
|
|
||||||
current_brightness_level_ = Normal;
|
|
||||||
break;
|
|
||||||
case VideoProcessingModule::kDarkWarning:
|
|
||||||
current_brightness_level_ = Dark;
|
|
||||||
break;
|
|
||||||
case VideoProcessingModule::kBrightWarning:
|
|
||||||
current_brightness_level_ = Bright;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (brightness_frame_stats_) {
|
||||||
if (effect_filter_) {
|
if (image_proc_module_->GetFrameStats(brightness_frame_stats_,
|
||||||
size_t length =
|
*video_frame) == 0) {
|
||||||
CalcBufferSize(kI420, video_frame->width(), video_frame->height());
|
int32_t brightness = image_proc_module_->BrightnessDetection(
|
||||||
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[length]);
|
*video_frame, *brightness_frame_stats_);
|
||||||
ExtractBuffer(*video_frame, length, video_buffer.get());
|
|
||||||
effect_filter_->Transform(length,
|
|
||||||
video_buffer.get(),
|
|
||||||
video_frame->ntp_time_ms(),
|
|
||||||
video_frame->timestamp(),
|
|
||||||
video_frame->width(),
|
|
||||||
video_frame->height());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
switch (brightness) {
|
||||||
|
case VideoProcessingModule::kNoWarning:
|
||||||
|
current_brightness_level_ = Normal;
|
||||||
|
break;
|
||||||
|
case VideoProcessingModule::kDarkWarning:
|
||||||
|
current_brightness_level_ = Dark;
|
||||||
|
break;
|
||||||
|
case VideoProcessingModule::kBrightWarning:
|
||||||
|
current_brightness_level_ = Bright;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (effect_filter_) {
|
||||||
|
size_t length =
|
||||||
|
CalcBufferSize(kI420, video_frame->width(), video_frame->height());
|
||||||
|
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[length]);
|
||||||
|
ExtractBuffer(*video_frame, length, video_buffer.get());
|
||||||
|
effect_filter_->Transform(length,
|
||||||
|
video_buffer.get(),
|
||||||
|
video_frame->ntp_time_ms(),
|
||||||
|
video_frame->timestamp(),
|
||||||
|
video_frame->width(),
|
||||||
|
video_frame->height());
|
||||||
|
}
|
||||||
|
}
|
||||||
// Deliver the captured frame to all observers (channels, renderer or file).
|
// Deliver the captured frame to all observers (channels, renderer or file).
|
||||||
ViEFrameProviderBase::DeliverFrame(video_frame, std::vector<uint32_t>());
|
ViEFrameProviderBase::DeliverFrame(video_frame, std::vector<uint32_t>());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user