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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 RTPFragmentationHeader frag_header; | 370 RTPFragmentationHeader frag_header; |
371 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, | 371 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, |
372 &frag_header); | 372 &frag_header); |
373 | 373 |
374 // Encoder can skip frames to save bandwidth in which case | 374 // Encoder can skip frames to save bandwidth in which case |
375 // |encoded_image_._length| == 0. | 375 // |encoded_image_._length| == 0. |
376 if (encoded_image_._length > 0) { | 376 if (encoded_image_._length > 0) { |
377 // Deliver encoded image. | 377 // Deliver encoded image. |
378 CodecSpecificInfo codec_specific; | 378 CodecSpecificInfo codec_specific; |
379 codec_specific.codecType = kVideoCodecH264; | 379 codec_specific.codecType = kVideoCodecH264; |
380 encoded_image_callback_->Encoded(encoded_image_, &codec_specific, | 380 encoded_image_callback_->OnEncodedImage(encoded_image_, &codec_specific, |
381 &frag_header); | 381 &frag_header); |
382 | 382 |
383 // Parse and report QP. | 383 // Parse and report QP. |
384 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, | 384 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, |
385 encoded_image_._length); | 385 encoded_image_._length); |
386 int qp = -1; | 386 int qp = -1; |
387 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) | 387 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) |
388 quality_scaler_.ReportQP(qp); | 388 quality_scaler_.ReportQP(qp); |
389 } else { | 389 } else { |
390 quality_scaler_.ReportDroppedFrame(); | 390 quality_scaler_.ReportDroppedFrame(); |
391 } | 391 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 487 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
488 return WEBRTC_VIDEO_CODEC_OK; | 488 return WEBRTC_VIDEO_CODEC_OK; |
489 } | 489 } |
490 | 490 |
491 void H264EncoderImpl::OnDroppedFrame() { | 491 void H264EncoderImpl::OnDroppedFrame() { |
492 quality_scaler_.ReportDroppedFrame(); | 492 quality_scaler_.ReportDroppedFrame(); |
493 } | 493 } |
494 | 494 |
495 } // namespace webrtc | 495 } // namespace webrtc |
OLD | NEW |