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 openh264_encoder_->ForceIntraFrame(true); | 360 openh264_encoder_->ForceIntraFrame(true); |
361 } | 361 } |
362 | 362 |
363 // EncodeFrame input. | 363 // EncodeFrame input. |
364 SSourcePicture picture; | 364 SSourcePicture picture; |
365 memset(&picture, 0, sizeof(SSourcePicture)); | 365 memset(&picture, 0, sizeof(SSourcePicture)); |
366 picture.iPicWidth = frame.width(); | 366 picture.iPicWidth = frame.width(); |
367 picture.iPicHeight = frame.height(); | 367 picture.iPicHeight = frame.height(); |
368 picture.iColorFormat = EVideoFormatType::videoFormatI420; | 368 picture.iColorFormat = EVideoFormatType::videoFormatI420; |
369 picture.uiTimeStamp = frame.ntp_time_ms(); | 369 picture.uiTimeStamp = frame.ntp_time_ms(); |
370 picture.iStride[0] = frame.video_frame_buffer()->StrideY(); | 370 picture.iStride[0] = frame.stride(kYPlane); |
371 picture.iStride[1] = frame.video_frame_buffer()->StrideU(); | 371 picture.iStride[1] = frame.stride(kUPlane); |
372 picture.iStride[2] = frame.video_frame_buffer()->StrideV(); | 372 picture.iStride[2] = frame.stride(kVPlane); |
373 picture.pData[0] = const_cast<uint8_t*>(frame.video_frame_buffer()->DataY()); | 373 picture.pData[0] = const_cast<uint8_t*>(frame.buffer(kYPlane)); |
374 picture.pData[1] = const_cast<uint8_t*>(frame.video_frame_buffer()->DataU()); | 374 picture.pData[1] = const_cast<uint8_t*>(frame.buffer(kUPlane)); |
375 picture.pData[2] = const_cast<uint8_t*>(frame.video_frame_buffer()->DataV()); | 375 picture.pData[2] = const_cast<uint8_t*>(frame.buffer(kVPlane)); |
376 | 376 |
377 // EncodeFrame output. | 377 // EncodeFrame output. |
378 SFrameBSInfo info; | 378 SFrameBSInfo info; |
379 memset(&info, 0, sizeof(SFrameBSInfo)); | 379 memset(&info, 0, sizeof(SFrameBSInfo)); |
380 | 380 |
381 // Encode! | 381 // Encode! |
382 int enc_ret = openh264_encoder_->EncodeFrame(&picture, &info); | 382 int enc_ret = openh264_encoder_->EncodeFrame(&picture, &info); |
383 if (enc_ret != 0) { | 383 if (enc_ret != 0) { |
384 LOG(LS_ERROR) << "OpenH264 frame encoding failed, EncodeFrame returned " | 384 LOG(LS_ERROR) << "OpenH264 frame encoding failed, EncodeFrame returned " |
385 << enc_ret << "."; | 385 << enc_ret << "."; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 | 442 |
443 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 443 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
444 return WEBRTC_VIDEO_CODEC_OK; | 444 return WEBRTC_VIDEO_CODEC_OK; |
445 } | 445 } |
446 | 446 |
447 void H264EncoderImpl::OnDroppedFrame() { | 447 void H264EncoderImpl::OnDroppedFrame() { |
448 } | 448 } |
449 | 449 |
450 } // namespace webrtc | 450 } // namespace webrtc |
OLD | NEW |