OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 RTPFragmentationHeader frag_header; | 360 RTPFragmentationHeader frag_header; |
361 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, | 361 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, |
362 &frag_header); | 362 &frag_header); |
363 | 363 |
364 // Encoder can skip frames to save bandwidth in which case | 364 // Encoder can skip frames to save bandwidth in which case |
365 // |encoded_image_._length| == 0. | 365 // |encoded_image_._length| == 0. |
366 if (encoded_image_._length > 0) { | 366 if (encoded_image_._length > 0) { |
367 // Deliver encoded image. | 367 // Deliver encoded image. |
368 CodecSpecificInfo codec_specific; | 368 CodecSpecificInfo codec_specific; |
369 codec_specific.codecType = kVideoCodecH264; | 369 codec_specific.codecType = kVideoCodecH264; |
370 encoded_image_callback_->OnEncodedImage(encoded_image_, &codec_specific, | 370 encoded_image_callback_->Encoded(encoded_image_, &codec_specific, |
371 &frag_header); | 371 &frag_header); |
372 | 372 |
373 // Parse and report QP. | 373 // Parse and report QP. |
374 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, | 374 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, |
375 encoded_image_._length); | 375 encoded_image_._length); |
376 int qp = -1; | 376 int qp = -1; |
377 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) | 377 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) |
378 quality_scaler_.ReportQP(qp); | 378 quality_scaler_.ReportQP(qp); |
379 } else { | 379 } else { |
380 quality_scaler_.ReportDroppedFrame(); | 380 quality_scaler_.ReportDroppedFrame(); |
381 } | 381 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 479 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
480 return WEBRTC_VIDEO_CODEC_OK; | 480 return WEBRTC_VIDEO_CODEC_OK; |
481 } | 481 } |
482 | 482 |
483 void H264EncoderImpl::OnDroppedFrame() { | 483 void H264EncoderImpl::OnDroppedFrame() { |
484 quality_scaler_.ReportDroppedFrame(); | 484 quality_scaler_.ReportDroppedFrame(); |
485 } | 485 } |
486 | 486 |
487 } // namespace webrtc | 487 } // namespace webrtc |
OLD | NEW |