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