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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 vie_receiver_->GetRemoteSsrc()); | 348 vie_receiver_->GetRemoteSsrc()); |
349 } | 349 } |
350 | 350 |
351 VideoCaptureInput* VideoSendStream::Input() { | 351 VideoCaptureInput* VideoSendStream::Input() { |
352 return &input_; | 352 return &input_; |
353 } | 353 } |
354 | 354 |
355 void VideoSendStream::Start() { | 355 void VideoSendStream::Start() { |
356 if (payload_router_.active()) | 356 if (payload_router_.active()) |
357 return; | 357 return; |
| 358 TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Start"); |
358 vie_encoder_.Pause(); | 359 vie_encoder_.Pause(); |
359 payload_router_.set_active(true); | 360 payload_router_.set_active(true); |
360 // Was not already started, trigger a keyframe. | 361 // Was not already started, trigger a keyframe. |
361 vie_encoder_.SendKeyFrame(); | 362 vie_encoder_.SendKeyFrame(); |
362 vie_encoder_.Restart(); | 363 vie_encoder_.Restart(); |
363 vie_receiver_->StartReceive(); | 364 vie_receiver_->StartReceive(); |
364 } | 365 } |
365 | 366 |
366 void VideoSendStream::Stop() { | 367 void VideoSendStream::Stop() { |
367 if (!payload_router_.active()) | 368 if (!payload_router_.active()) |
368 return; | 369 return; |
| 370 TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Stop"); |
369 // TODO(pbos): Make sure the encoder stops here. | 371 // TODO(pbos): Make sure the encoder stops here. |
370 payload_router_.set_active(false); | 372 payload_router_.set_active(false); |
371 vie_receiver_->StopReceive(); | 373 vie_receiver_->StopReceive(); |
372 } | 374 } |
373 | 375 |
374 bool VideoSendStream::EncoderThreadFunction(void* obj) { | 376 bool VideoSendStream::EncoderThreadFunction(void* obj) { |
375 static_cast<VideoSendStream*>(obj)->EncoderProcess(); | 377 static_cast<VideoSendStream*>(obj)->EncoderProcess(); |
376 // We're done, return false to abort. | 378 // We're done, return false to abort. |
377 return false; | 379 return false; |
378 } | 380 } |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 } | 631 } |
630 | 632 |
631 void VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps, | 633 void VideoSendStream::OnBitrateUpdated(uint32_t bitrate_bps, |
632 uint8_t fraction_loss, | 634 uint8_t fraction_loss, |
633 int64_t rtt) { | 635 int64_t rtt) { |
634 vie_encoder_.OnBitrateUpdated(bitrate_bps, fraction_loss, rtt); | 636 vie_encoder_.OnBitrateUpdated(bitrate_bps, fraction_loss, rtt); |
635 } | 637 } |
636 | 638 |
637 } // namespace internal | 639 } // namespace internal |
638 } // namespace webrtc | 640 } // namespace webrtc |
OLD | NEW |