OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 for (size_t i = 0; i < allocated_decoders->size(); ++i) { | 2352 for (size_t i = 0; i < allocated_decoders->size(); ++i) { |
2353 if ((*allocated_decoders)[i].external) { | 2353 if ((*allocated_decoders)[i].external) { |
2354 external_decoder_factory_->DestroyVideoDecoder( | 2354 external_decoder_factory_->DestroyVideoDecoder( |
2355 (*allocated_decoders)[i].external_decoder); | 2355 (*allocated_decoders)[i].external_decoder); |
2356 } | 2356 } |
2357 delete (*allocated_decoders)[i].decoder; | 2357 delete (*allocated_decoders)[i].decoder; |
2358 } | 2358 } |
2359 allocated_decoders->clear(); | 2359 allocated_decoders->clear(); |
2360 } | 2360 } |
2361 | 2361 |
2362 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RenderFrame( | 2362 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::OnFrame( |
2363 const webrtc::VideoFrame& frame, | 2363 const webrtc::VideoFrame& frame) { |
2364 int time_to_render_ms) { | |
2365 rtc::CritScope crit(&sink_lock_); | 2364 rtc::CritScope crit(&sink_lock_); |
2366 | 2365 |
2367 if (first_frame_timestamp_ < 0) | 2366 if (first_frame_timestamp_ < 0) |
2368 first_frame_timestamp_ = frame.timestamp(); | 2367 first_frame_timestamp_ = frame.timestamp(); |
2369 int64_t rtp_time_elapsed_since_first_frame = | 2368 int64_t rtp_time_elapsed_since_first_frame = |
2370 (timestamp_wraparound_handler_.Unwrap(frame.timestamp()) - | 2369 (timestamp_wraparound_handler_.Unwrap(frame.timestamp()) - |
2371 first_frame_timestamp_); | 2370 first_frame_timestamp_); |
2372 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / | 2371 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / |
2373 (cricket::kVideoCodecClockrate / 1000); | 2372 (cricket::kVideoCodecClockrate / 1000); |
2374 if (frame.ntp_time_ms() > 0) | 2373 if (frame.ntp_time_ms() > 0) |
2375 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; | 2374 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; |
2376 | 2375 |
2377 if (sink_ == NULL) { | 2376 if (sink_ == NULL) { |
2378 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; | 2377 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; |
2379 return; | 2378 return; |
2380 } | 2379 } |
2381 | 2380 |
2382 last_width_ = frame.width(); | 2381 last_width_ = frame.width(); |
2383 last_height_ = frame.height(); | 2382 last_height_ = frame.height(); |
2384 | 2383 |
2385 const WebRtcVideoFrame render_frame( | 2384 const WebRtcVideoFrame render_frame( |
2386 frame.video_frame_buffer(), | 2385 frame.video_frame_buffer(), |
2387 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); | 2386 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); |
2388 sink_->OnFrame(render_frame); | 2387 sink_->OnFrame(render_frame); |
2389 } | 2388 } |
2390 | 2389 |
2391 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsTextureSupported() const { | |
2392 return true; | |
2393 } | |
2394 | |
2395 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::SmoothsRenderedFrames() | 2390 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::SmoothsRenderedFrames() |
2396 const { | 2391 const { |
2397 return disable_prerenderer_smoothing_; | 2392 return disable_prerenderer_smoothing_; |
2398 } | 2393 } |
2399 | 2394 |
2400 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { | 2395 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { |
2401 return default_stream_; | 2396 return default_stream_; |
2402 } | 2397 } |
2403 | 2398 |
2404 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSink( | 2399 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSink( |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 rtx_mapping[video_codecs[i].codec.id] != | 2562 rtx_mapping[video_codecs[i].codec.id] != |
2568 fec_settings.red_payload_type) { | 2563 fec_settings.red_payload_type) { |
2569 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2564 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2570 } | 2565 } |
2571 } | 2566 } |
2572 | 2567 |
2573 return video_codecs; | 2568 return video_codecs; |
2574 } | 2569 } |
2575 | 2570 |
2576 } // namespace cricket | 2571 } // namespace cricket |
OLD | NEW |