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

Side by Side Diff: webrtc/video/video_receive_stream.cc

Issue 1428293003: Add VideoCodec::PreferDecodeLate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed SetExpectedRendererDelay bug Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 20 matching lines...) Expand all
31 return true; 31 return true;
32 } 32 }
33 return false; 33 return false;
34 } 34 }
35 35
36 std::string VideoReceiveStream::Decoder::ToString() const { 36 std::string VideoReceiveStream::Decoder::ToString() const {
37 std::stringstream ss; 37 std::stringstream ss;
38 ss << "{decoder: " << (decoder != nullptr ? "(VideoDecoder)" : "nullptr"); 38 ss << "{decoder: " << (decoder != nullptr ? "(VideoDecoder)" : "nullptr");
39 ss << ", payload_type: " << payload_type; 39 ss << ", payload_type: " << payload_type;
40 ss << ", payload_name: " << payload_name; 40 ss << ", payload_name: " << payload_name;
41 ss << ", is_renderer: " << (is_renderer ? "yes" : "no");
42 ss << ", expected_delay_ms: " << expected_delay_ms;
43 ss << '}'; 41 ss << '}';
44 42
45 return ss.str(); 43 return ss.str();
46 } 44 }
47 45
48 std::string VideoReceiveStream::Config::ToString() const { 46 std::string VideoReceiveStream::Config::ToString() const {
49 std::stringstream ss; 47 std::stringstream ss;
50 ss << "{decoders: ["; 48 ss << "{decoders: [";
51 for (size_t i = 0; i < decoders.size(); ++i) { 49 for (size_t i = 0; i < decoders.size(); ++i) {
52 ss << decoders[i].ToString(); 50 ss << decoders[i].ToString();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 vie_channel_->RegisterReceiveChannelRtcpStatisticsCallback( 254 vie_channel_->RegisterReceiveChannelRtcpStatisticsCallback(
257 stats_proxy_.get()); 255 stats_proxy_.get());
258 vie_channel_->RegisterReceiveChannelRtpStatisticsCallback(stats_proxy_.get()); 256 vie_channel_->RegisterReceiveChannelRtpStatisticsCallback(stats_proxy_.get());
259 vie_channel_->RegisterRtcpPacketTypeCounterObserver(stats_proxy_.get()); 257 vie_channel_->RegisterRtcpPacketTypeCounterObserver(stats_proxy_.get());
260 258
261 RTC_DCHECK(!config_.decoders.empty()); 259 RTC_DCHECK(!config_.decoders.empty());
262 for (size_t i = 0; i < config_.decoders.size(); ++i) { 260 for (size_t i = 0; i < config_.decoders.size(); ++i) {
263 const Decoder& decoder = config_.decoders[i]; 261 const Decoder& decoder = config_.decoders[i];
264 RTC_CHECK_EQ(0, 262 RTC_CHECK_EQ(0,
265 vie_channel_->RegisterExternalDecoder( 263 vie_channel_->RegisterExternalDecoder(
266 decoder.payload_type, decoder.decoder, decoder.is_renderer, 264 decoder.payload_type, decoder.decoder));
267 decoder.is_renderer ? decoder.expected_delay_ms
268 : config.render_delay_ms));
269 265
270 VideoCodec codec = CreateDecoderVideoCodec(decoder); 266 VideoCodec codec = CreateDecoderVideoCodec(decoder);
271 267
272 RTC_CHECK_EQ(0, vie_channel_->SetReceiveCodec(codec)); 268 RTC_CHECK_EQ(0, vie_channel_->SetReceiveCodec(codec));
273 } 269 }
274 270
275 incoming_video_stream_.reset(new IncomingVideoStream(0)); 271 incoming_video_stream_.reset(new IncomingVideoStream(0));
276 incoming_video_stream_->SetExpectedRenderDelay(config.render_delay_ms); 272 incoming_video_stream_->SetExpectedRenderDelay(config.render_delay_ms);
273 vie_channel_->SetExpectedRenderDelay(config.render_delay_ms);
pbos-webrtc 2015/11/05 17:47:30 Can you put this one step down to split up incomin
277 incoming_video_stream_->SetExternalCallback(this); 274 incoming_video_stream_->SetExternalCallback(this);
278 vie_channel_->SetIncomingVideoStream(incoming_video_stream_.get()); 275 vie_channel_->SetIncomingVideoStream(incoming_video_stream_.get());
279 276
280 vie_channel_->RegisterPreDecodeImageCallback(this); 277 vie_channel_->RegisterPreDecodeImageCallback(this);
281 vie_channel_->RegisterPreRenderCallback(this); 278 vie_channel_->RegisterPreRenderCallback(this);
282 } 279 }
283 280
284 VideoReceiveStream::~VideoReceiveStream() { 281 VideoReceiveStream::~VideoReceiveStream() {
285 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString(); 282 LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString();
286 incoming_video_stream_->Stop(); 283 incoming_video_stream_->Stop();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 return 0; 375 return 0;
379 } 376 }
380 377
381 void VideoReceiveStream::SignalNetworkState(NetworkState state) { 378 void VideoReceiveStream::SignalNetworkState(NetworkState state) {
382 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode 379 vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode
383 : RtcpMode::kOff); 380 : RtcpMode::kOff);
384 } 381 }
385 382
386 } // namespace internal 383 } // namespace internal
387 } // namespace webrtc 384 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698