OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 420 } |
421 | 421 |
422 if (stats_proxy_) | 422 if (stats_proxy_) |
423 stats_proxy_->OnSendEncodedImage(encoded_image, rtp_video_hdr); | 423 stats_proxy_->OnSendEncodedImage(encoded_image, rtp_video_hdr); |
424 | 424 |
425 bool success = send_payload_router_->RoutePayload( | 425 bool success = send_payload_router_->RoutePayload( |
426 encoded_image._frameType, payload_type, encoded_image._timeStamp, | 426 encoded_image._frameType, payload_type, encoded_image._timeStamp, |
427 encoded_image.capture_time_ms_, encoded_image._buffer, | 427 encoded_image.capture_time_ms_, encoded_image._buffer, |
428 encoded_image._length, fragmentation_header, rtp_video_hdr); | 428 encoded_image._length, fragmentation_header, rtp_video_hdr); |
429 overuse_detector_->FrameSent(encoded_image._timeStamp); | 429 overuse_detector_->FrameSent(encoded_image._timeStamp); |
| 430 |
| 431 if (kEnableFrameRecording) { |
| 432 int layer = rtp_video_hdr->simulcastIdx; |
| 433 IvfFileWriter* file_writer; |
| 434 { |
| 435 rtc::CritScope lock(&data_cs_); |
| 436 if (file_writers_[layer] == nullptr) { |
| 437 std::ostringstream oss; |
| 438 oss << "bitstream_ssrc"; |
| 439 for (uint32_t ssrc : ssrcs_) |
| 440 oss << "_" << ssrc; |
| 441 oss << "_layer" << layer << ".ivf"; |
| 442 rtc::Pathname file_name(oss.str()); |
| 443 file_writers_[layer] = |
| 444 IvfFileWriter::Open(file_name, rtp_video_hdr->codec); |
| 445 } |
| 446 file_writer = file_writers_[layer].get(); |
| 447 } |
| 448 if (file_writer) { |
| 449 bool ok = file_writer->WriteFrame(encoded_image); |
| 450 RTC_DCHECK(ok); |
| 451 } |
| 452 } |
| 453 |
430 return success ? 0 : -1; | 454 return success ? 0 : -1; |
431 } | 455 } |
432 | 456 |
433 void ViEEncoder::OnEncoderImplementationName( | 457 void ViEEncoder::OnEncoderImplementationName( |
434 const char* implementation_name) { | 458 const char* implementation_name) { |
435 if (stats_proxy_) | 459 if (stats_proxy_) |
436 stats_proxy_->OnEncoderImplementationName(implementation_name); | 460 stats_proxy_->OnEncoderImplementationName(implementation_name); |
437 } | 461 } |
438 | 462 |
439 int32_t ViEEncoder::SendStatistics(const uint32_t bit_rate, | 463 int32_t ViEEncoder::SendStatistics(const uint32_t bit_rate, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 const uint32_t width, | 554 const uint32_t width, |
531 const uint32_t height) { | 555 const uint32_t height) { |
532 return vp_->SetTargetResolution(width, height, frame_rate); | 556 return vp_->SetTargetResolution(width, height, frame_rate); |
533 } | 557 } |
534 | 558 |
535 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { | 559 void QMVideoSettingsCallback::SetTargetFramerate(int frame_rate) { |
536 vp_->SetTargetFramerate(frame_rate); | 560 vp_->SetTargetFramerate(frame_rate); |
537 } | 561 } |
538 | 562 |
539 } // namespace webrtc | 563 } // namespace webrtc |
OLD | NEW |