OLD | NEW |
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 } | 303 } |
304 | 304 |
305 video_stream_decoder_.reset(new VideoStreamDecoder( | 305 video_stream_decoder_.reset(new VideoStreamDecoder( |
306 &video_receiver_, &rtp_stream_receiver_, &rtp_stream_receiver_, | 306 &video_receiver_, &rtp_stream_receiver_, &rtp_stream_receiver_, |
307 rtp_stream_receiver_.IsRetransmissionsEnabled(), protected_by_fec, | 307 rtp_stream_receiver_.IsRetransmissionsEnabled(), protected_by_fec, |
308 &stats_proxy_, renderer)); | 308 &stats_proxy_, renderer)); |
309 // Register the channel to receive stats updates. | 309 // Register the channel to receive stats updates. |
310 call_stats_->RegisterStatsObserver(video_stream_decoder_.get()); | 310 call_stats_->RegisterStatsObserver(video_stream_decoder_.get()); |
311 // Start the decode thread | 311 // Start the decode thread |
312 decode_thread_.Start(); | 312 decode_thread_.Start(); |
313 #if !defined(WEBRTC_ANDROID) | |
314 // On android, the decoding happens on a different thread and frames | |
315 // are delivered on that thread (that in itself needs to be fixed). | |
316 // In any event, the actual decoding work is higher priority than the | |
317 // |decode_thread_| on Android, so we only raise the deocode priority on | |
318 // platforms other than Android. | |
319 decode_thread_.SetPriority(rtc::kHighestPriority); | 313 decode_thread_.SetPriority(rtc::kHighestPriority); |
320 #endif | |
321 rtp_stream_receiver_.StartReceive(); | 314 rtp_stream_receiver_.StartReceive(); |
322 } | 315 } |
323 | 316 |
324 void VideoReceiveStream::Stop() { | 317 void VideoReceiveStream::Stop() { |
325 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 318 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
326 rtp_stream_receiver_.StopReceive(); | 319 rtp_stream_receiver_.StopReceive(); |
327 // TriggerDecoderShutdown will release any waiting decoder thread and make it | 320 // TriggerDecoderShutdown will release any waiting decoder thread and make it |
328 // stop immediately, instead of waiting for a timeout. Needs to be called | 321 // stop immediately, instead of waiting for a timeout. Needs to be called |
329 // before joining the decoder thread thread. | 322 // before joining the decoder thread thread. |
330 video_receiver_.TriggerDecoderShutdown(); | 323 video_receiver_.TriggerDecoderShutdown(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 rtp_stream_receiver_.FrameDecoded(frame->picture_id); | 489 rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
497 } else { | 490 } else { |
498 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 491 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
499 << " ms, requesting keyframe."; | 492 << " ms, requesting keyframe."; |
500 RequestKeyFrame(); | 493 RequestKeyFrame(); |
501 } | 494 } |
502 return true; | 495 return true; |
503 } | 496 } |
504 } // namespace internal | 497 } // namespace internal |
505 } // namespace webrtc | 498 } // namespace webrtc |
OLD | NEW |