OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1221 webrtc::VideoReceiveStream::Config config(this); | 1221 webrtc::VideoReceiveStream::Config config(this); |
1222 ConfigureReceiverRtp(&config, sp); | 1222 ConfigureReceiverRtp(&config, sp); |
1223 | 1223 |
1224 // Set up A/V sync group based on sync label. | 1224 // Set up A/V sync group based on sync label. |
1225 config.sync_group = sp.sync_label; | 1225 config.sync_group = sp.sync_label; |
1226 | 1226 |
1227 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; | 1227 config.rtp.remb = send_codec_ ? HasRemb(send_codec_->codec) : false; |
1228 | 1228 |
1229 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( | 1229 receive_streams_[ssrc] = new WebRtcVideoReceiveStream( |
1230 call_, sp, config, external_decoder_factory_, default_stream, | 1230 call_, sp, config, external_decoder_factory_, default_stream, |
1231 recv_codecs_); | 1231 recv_codecs_, options_.disable_prerenderer_smoothing.value_or(false)); |
1232 | 1232 |
1233 return true; | 1233 return true; |
1234 } | 1234 } |
1235 | 1235 |
1236 void WebRtcVideoChannel2::ConfigureReceiverRtp( | 1236 void WebRtcVideoChannel2::ConfigureReceiverRtp( |
1237 webrtc::VideoReceiveStream::Config* config, | 1237 webrtc::VideoReceiveStream::Config* config, |
1238 const StreamParams& sp) const { | 1238 const StreamParams& sp) const { |
1239 uint32_t ssrc = sp.first_ssrc(); | 1239 uint32_t ssrc = sp.first_ssrc(); |
1240 | 1240 |
1241 config->rtp.remote_ssrc = ssrc; | 1241 config->rtp.remote_ssrc = ssrc; |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2330 } | 2330 } |
2331 } | 2331 } |
2332 | 2332 |
2333 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( | 2333 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( |
2334 webrtc::Call* call, | 2334 webrtc::Call* call, |
2335 const StreamParams& sp, | 2335 const StreamParams& sp, |
2336 const webrtc::VideoReceiveStream::Config& config, | 2336 const webrtc::VideoReceiveStream::Config& config, |
2337 WebRtcVideoDecoderFactory* external_decoder_factory, | 2337 WebRtcVideoDecoderFactory* external_decoder_factory, |
2338 bool default_stream, | 2338 bool default_stream, |
2339 const std::vector<VideoCodecSettings>& recv_codecs) | 2339 const std::vector<VideoCodecSettings>& recv_codecs) |
2340 : WebRtcVideoReceiveStream(call, | |
2341 sp, | |
2342 config, | |
2343 external_decoder_factory, | |
2344 default_stream, | |
2345 recv_codecs, | |
2346 false) {} | |
2347 | |
2348 WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( | |
mflodman
2015/11/23 14:43:43
I'd prefer to only have on constructor.
qiangchen
2015/11/24 00:21:05
You are right, this is a private class, thus no wo
| |
2349 webrtc::Call* call, | |
2350 const StreamParams& sp, | |
2351 const webrtc::VideoReceiveStream::Config& config, | |
2352 WebRtcVideoDecoderFactory* external_decoder_factory, | |
2353 bool default_stream, | |
2354 const std::vector<VideoCodecSettings>& recv_codecs, | |
2355 bool disable_prerenderer_smoothing) | |
2340 : call_(call), | 2356 : call_(call), |
2341 ssrcs_(sp.ssrcs), | 2357 ssrcs_(sp.ssrcs), |
2342 ssrc_groups_(sp.ssrc_groups), | 2358 ssrc_groups_(sp.ssrc_groups), |
2343 stream_(NULL), | 2359 stream_(NULL), |
2344 default_stream_(default_stream), | 2360 default_stream_(default_stream), |
2345 config_(config), | 2361 config_(config), |
2346 external_decoder_factory_(external_decoder_factory), | 2362 external_decoder_factory_(external_decoder_factory), |
2363 disable_prerenderer_smoothing_(disable_prerenderer_smoothing), | |
2347 renderer_(NULL), | 2364 renderer_(NULL), |
2348 last_width_(-1), | 2365 last_width_(-1), |
2349 last_height_(-1), | 2366 last_height_(-1), |
2350 first_frame_timestamp_(-1), | 2367 first_frame_timestamp_(-1), |
2351 estimated_remote_start_ntp_time_ms_(0) { | 2368 estimated_remote_start_ntp_time_ms_(0) { |
2352 config_.renderer = this; | 2369 config_.renderer = this; |
2353 // SetRecvCodecs will also reset (start) the VideoReceiveStream. | 2370 // SetRecvCodecs will also reset (start) the VideoReceiveStream. |
2354 LOG(LS_INFO) << "SetRecvCodecs (recv) because we are creating the receive " | 2371 LOG(LS_INFO) << "SetRecvCodecs (recv) because we are creating the receive " |
2355 "stream for the first time: " | 2372 "stream for the first time: " |
2356 << CodecSettingsVectorToString(recv_codecs); | 2373 << CodecSettingsVectorToString(recv_codecs); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2544 const WebRtcVideoFrame render_frame( | 2561 const WebRtcVideoFrame render_frame( |
2545 frame.video_frame_buffer(), | 2562 frame.video_frame_buffer(), |
2546 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); | 2563 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); |
2547 renderer_->RenderFrame(&render_frame); | 2564 renderer_->RenderFrame(&render_frame); |
2548 } | 2565 } |
2549 | 2566 |
2550 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsTextureSupported() const { | 2567 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsTextureSupported() const { |
2551 return true; | 2568 return true; |
2552 } | 2569 } |
2553 | 2570 |
2571 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream:: | |
2572 PrerendererSmoothingDisabled() const { | |
2573 return disable_prerenderer_smoothing_; | |
2574 } | |
2575 | |
2554 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { | 2576 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { |
2555 return default_stream_; | 2577 return default_stream_; |
2556 } | 2578 } |
2557 | 2579 |
2558 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRenderer( | 2580 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRenderer( |
2559 cricket::VideoRenderer* renderer) { | 2581 cricket::VideoRenderer* renderer) { |
2560 rtc::CritScope crit(&renderer_lock_); | 2582 rtc::CritScope crit(&renderer_lock_); |
2561 renderer_ = renderer; | 2583 renderer_ = renderer; |
2562 if (renderer_ != NULL && last_width_ != -1) { | 2584 if (renderer_ != NULL && last_width_ != -1) { |
2563 SetSize(last_width_, last_height_); | 2585 SetSize(last_width_, last_height_); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2742 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2764 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2743 } | 2765 } |
2744 } | 2766 } |
2745 | 2767 |
2746 return video_codecs; | 2768 return video_codecs; |
2747 } | 2769 } |
2748 | 2770 |
2749 } // namespace cricket | 2771 } // namespace cricket |
2750 | 2772 |
2751 #endif // HAVE_WEBRTC_VIDEO | 2773 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |