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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 RTPFragmentationHeader frag_header; | 359 RTPFragmentationHeader frag_header; |
360 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, | 360 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, |
361 &frag_header); | 361 &frag_header); |
362 | 362 |
363 // Encoder can skip frames to save bandwidth in which case | 363 // Encoder can skip frames to save bandwidth in which case |
364 // |encoded_image_._length| == 0. | 364 // |encoded_image_._length| == 0. |
365 if (encoded_image_._length > 0) { | 365 if (encoded_image_._length > 0) { |
366 // Deliver encoded image. | 366 // Deliver encoded image. |
367 CodecSpecificInfo codec_specific; | 367 CodecSpecificInfo codec_specific; |
368 codec_specific.codecType = kVideoCodecH264; | 368 codec_specific.codecType = kVideoCodecH264; |
369 encoded_image_callback_->Encoded(encoded_image_, &codec_specific, | 369 encoded_image_callback_->OnEncodedImage(encoded_image_, &codec_specific, |
370 &frag_header); | 370 &frag_header); |
371 | 371 |
372 // Parse and report QP. | 372 // Parse and report QP. |
373 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, | 373 h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer, |
374 encoded_image_._length); | 374 encoded_image_._length); |
375 int qp = -1; | 375 int qp = -1; |
376 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) | 376 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) |
377 quality_scaler_.ReportQP(qp); | 377 quality_scaler_.ReportQP(qp); |
378 } else { | 378 } else { |
379 quality_scaler_.ReportDroppedFrame(); | 379 quality_scaler_.ReportDroppedFrame(); |
380 } | 380 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 470 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
471 return WEBRTC_VIDEO_CODEC_OK; | 471 return WEBRTC_VIDEO_CODEC_OK; |
472 } | 472 } |
473 | 473 |
474 void H264EncoderImpl::OnDroppedFrame() { | 474 void H264EncoderImpl::OnDroppedFrame() { |
475 quality_scaler_.ReportDroppedFrame(); | 475 quality_scaler_.ReportDroppedFrame(); |
476 } | 476 } |
477 | 477 |
478 } // namespace webrtc | 478 } // namespace webrtc |
OLD | NEW |