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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc

Issue 1369923005: Remove kSkipFrame usage. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: bogus default return value for ConvertFrameType Created 5 years, 2 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 | « no previous file | webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
index 7c4164c8ced525dffb66a99c8c98c876e24ba7e5..1b59be35368b461d87c7065bf7957e6e752f4f78 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
@@ -262,6 +262,10 @@ int SimulcastEncoderAdapter::Encode(
int src_width = input_image.width();
int src_height = input_image.height();
for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) {
+ // Don't encode frames in resolutions that we don't intend to send.
+ if (!streaminfos_[stream_idx].send_stream)
+ continue;
+
std::vector<VideoFrameType> stream_frame_types;
if (send_key_frame) {
stream_frame_types.push_back(kKeyFrame);
@@ -390,23 +394,8 @@ int32_t SimulcastEncoderAdapter::Encoded(
CodecSpecificInfoVP8* vp8Info = &(stream_codec_specific.codecSpecific.VP8);
vp8Info->simulcastIdx = stream_idx;
- if (streaminfos_[stream_idx].send_stream) {
- return encoded_complete_callback_->Encoded(encodedImage,
- &stream_codec_specific,
- fragmentation);
- } else {
- EncodedImage dummy_image;
- // Required in case padding is applied to dropped frames.
- dummy_image._timeStamp = encodedImage._timeStamp;
- dummy_image.capture_time_ms_ = encodedImage.capture_time_ms_;
- dummy_image._encodedWidth = encodedImage._encodedWidth;
- dummy_image._encodedHeight = encodedImage._encodedHeight;
- dummy_image._length = 0;
- dummy_image._frameType = kSkipFrame;
- vp8Info->keyIdx = kNoKeyIdx;
- return encoded_complete_callback_->Encoded(dummy_image,
- &stream_codec_specific, NULL);
- }
+ return encoded_complete_callback_->Encoded(
+ encodedImage, &stream_codec_specific, fragmentation);
}
uint32_t SimulcastEncoderAdapter::GetStreamBitrate(
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698