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 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 for (size_t i = 0; i < allocated_decoders->size(); ++i) { | 2316 for (size_t i = 0; i < allocated_decoders->size(); ++i) { |
2317 if ((*allocated_decoders)[i].external) { | 2317 if ((*allocated_decoders)[i].external) { |
2318 external_decoder_factory_->DestroyVideoDecoder( | 2318 external_decoder_factory_->DestroyVideoDecoder( |
2319 (*allocated_decoders)[i].external_decoder); | 2319 (*allocated_decoders)[i].external_decoder); |
2320 } | 2320 } |
2321 delete (*allocated_decoders)[i].decoder; | 2321 delete (*allocated_decoders)[i].decoder; |
2322 } | 2322 } |
2323 allocated_decoders->clear(); | 2323 allocated_decoders->clear(); |
2324 } | 2324 } |
2325 | 2325 |
2326 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RenderFrame( | 2326 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::OnFrame( |
2327 const webrtc::VideoFrame& frame, | 2327 const webrtc::VideoFrame& frame) { |
2328 int time_to_render_ms) { | |
2329 rtc::CritScope crit(&sink_lock_); | 2328 rtc::CritScope crit(&sink_lock_); |
2330 | 2329 |
2331 if (first_frame_timestamp_ < 0) | 2330 if (first_frame_timestamp_ < 0) |
2332 first_frame_timestamp_ = frame.timestamp(); | 2331 first_frame_timestamp_ = frame.timestamp(); |
2333 int64_t rtp_time_elapsed_since_first_frame = | 2332 int64_t rtp_time_elapsed_since_first_frame = |
2334 (timestamp_wraparound_handler_.Unwrap(frame.timestamp()) - | 2333 (timestamp_wraparound_handler_.Unwrap(frame.timestamp()) - |
2335 first_frame_timestamp_); | 2334 first_frame_timestamp_); |
2336 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / | 2335 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / |
2337 (cricket::kVideoCodecClockrate / 1000); | 2336 (cricket::kVideoCodecClockrate / 1000); |
2338 if (frame.ntp_time_ms() > 0) | 2337 if (frame.ntp_time_ms() > 0) |
2339 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; | 2338 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; |
2340 | 2339 |
2341 if (sink_ == NULL) { | 2340 if (sink_ == NULL) { |
2342 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; | 2341 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; |
2343 return; | 2342 return; |
2344 } | 2343 } |
2345 | 2344 |
2346 last_width_ = frame.width(); | 2345 last_width_ = frame.width(); |
2347 last_height_ = frame.height(); | 2346 last_height_ = frame.height(); |
2348 | 2347 |
2349 const WebRtcVideoFrame render_frame( | 2348 const WebRtcVideoFrame render_frame( |
2350 frame.video_frame_buffer(), | 2349 frame.video_frame_buffer(), |
2351 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); | 2350 frame.render_time_ms() * rtc::kNumNanosecsPerMillisec, frame.rotation()); |
2352 sink_->OnFrame(render_frame); | 2351 sink_->OnFrame(render_frame); |
2353 } | 2352 } |
2354 | 2353 |
2355 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsTextureSupported() const { | |
2356 return true; | |
2357 } | |
2358 | |
2359 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::SmoothsRenderedFrames() | 2354 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::SmoothsRenderedFrames() |
2360 const { | 2355 const { |
2361 return disable_prerenderer_smoothing_; | 2356 return disable_prerenderer_smoothing_; |
2362 } | 2357 } |
2363 | 2358 |
2364 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { | 2359 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { |
2365 return default_stream_; | 2360 return default_stream_; |
2366 } | 2361 } |
2367 | 2362 |
2368 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSink( | 2363 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSink( |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 rtx_mapping[video_codecs[i].codec.id] != | 2526 rtx_mapping[video_codecs[i].codec.id] != |
2532 fec_settings.red_payload_type) { | 2527 fec_settings.red_payload_type) { |
2533 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2528 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2534 } | 2529 } |
2535 } | 2530 } |
2536 | 2531 |
2537 return video_codecs; | 2532 return video_codecs; |
2538 } | 2533 } |
2539 | 2534 |
2540 } // namespace cricket | 2535 } // namespace cricket |
OLD | NEW |