Chromium Code Reviews| 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 ReportError(); | 360 ReportError(); |
| 361 return WEBRTC_VIDEO_CODEC_ERROR; | 361 return WEBRTC_VIDEO_CODEC_ERROR; |
| 362 } | 362 } |
| 363 | 363 |
| 364 encoded_image_._encodedWidth = frame_buffer->width(); | 364 encoded_image_._encodedWidth = frame_buffer->width(); |
| 365 encoded_image_._encodedHeight = frame_buffer->height(); | 365 encoded_image_._encodedHeight = frame_buffer->height(); |
| 366 encoded_image_._timeStamp = input_frame.timestamp(); | 366 encoded_image_._timeStamp = input_frame.timestamp(); |
| 367 encoded_image_.ntp_time_ms_ = input_frame.ntp_time_ms(); | 367 encoded_image_.ntp_time_ms_ = input_frame.ntp_time_ms(); |
| 368 encoded_image_.capture_time_ms_ = input_frame.render_time_ms(); | 368 encoded_image_.capture_time_ms_ = input_frame.render_time_ms(); |
| 369 encoded_image_.rotation_ = input_frame.rotation(); | 369 encoded_image_.rotation_ = input_frame.rotation(); |
| 370 if (mode_ == kScreensharing) | |
|
tommi
2017/04/10 10:59:18
nit (2 lines, one assignment instead of 4 lines, t
ilnik
2017/04/10 12:47:42
Done.
| |
| 371 encoded_image_.content_type_ = VideoContentType::kScreenshare; | |
| 372 else | |
| 373 encoded_image_.content_type_ = VideoContentType::kUnspecified; | |
| 370 encoded_image_._frameType = ConvertToVideoFrameType(info.eFrameType); | 374 encoded_image_._frameType = ConvertToVideoFrameType(info.eFrameType); |
| 371 | 375 |
| 372 // Split encoded image up into fragments. This also updates |encoded_image_|. | 376 // Split encoded image up into fragments. This also updates |encoded_image_|. |
| 373 RTPFragmentationHeader frag_header; | 377 RTPFragmentationHeader frag_header; |
| 374 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, | 378 RtpFragmentize(&encoded_image_, &encoded_image_buffer_, *frame_buffer, &info, |
| 375 &frag_header); | 379 &frag_header); |
| 376 | 380 |
| 377 // Encoder can skip frames to save bandwidth in which case | 381 // Encoder can skip frames to save bandwidth in which case |
| 378 // |encoded_image_._length| == 0. | 382 // |encoded_image_._length| == 0. |
| 379 if (encoded_image_._length > 0) { | 383 if (encoded_image_._length > 0) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 | 498 |
| 495 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 499 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
| 496 return WEBRTC_VIDEO_CODEC_OK; | 500 return WEBRTC_VIDEO_CODEC_OK; |
| 497 } | 501 } |
| 498 | 502 |
| 499 VideoEncoder::ScalingSettings H264EncoderImpl::GetScalingSettings() const { | 503 VideoEncoder::ScalingSettings H264EncoderImpl::GetScalingSettings() const { |
| 500 return VideoEncoder::ScalingSettings(true); | 504 return VideoEncoder::ScalingSettings(true); |
| 501 } | 505 } |
| 502 | 506 |
| 503 } // namespace webrtc | 507 } // namespace webrtc |
| OLD | NEW |