| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 if (!frame_decoded) { | 340 if (!frame_decoded) { |
| 341 LOG(LS_WARNING) << "avcodec_decode_video2 successful but no frame was " | 341 LOG(LS_WARNING) << "avcodec_decode_video2 successful but no frame was " |
| 342 "decoded."; | 342 "decoded."; |
| 343 return WEBRTC_VIDEO_CODEC_OK; | 343 return WEBRTC_VIDEO_CODEC_OK; |
| 344 } | 344 } |
| 345 | 345 |
| 346 // Obtain the |video_frame| containing the decoded image. | 346 // Obtain the |video_frame| containing the decoded image. |
| 347 VideoFrame* video_frame = static_cast<VideoFrame*>( | 347 VideoFrame* video_frame = static_cast<VideoFrame*>( |
| 348 av_buffer_get_opaque(av_frame_->buf[0])); | 348 av_buffer_get_opaque(av_frame_->buf[0])); |
| 349 RTC_DCHECK(video_frame); | 349 RTC_DCHECK(video_frame); |
| 350 RTC_CHECK_EQ(av_frame_->data[kYPlane], | 350 RTC_CHECK_EQ(av_frame_->data[kYPlaneIndex], |
| 351 video_frame->video_frame_buffer()->DataY()); | 351 video_frame->video_frame_buffer()->DataY()); |
| 352 RTC_CHECK_EQ(av_frame_->data[kUPlane], | 352 RTC_CHECK_EQ(av_frame_->data[kUPlaneIndex], |
| 353 video_frame->video_frame_buffer()->DataU()); | 353 video_frame->video_frame_buffer()->DataU()); |
| 354 RTC_CHECK_EQ(av_frame_->data[kVPlane], | 354 RTC_CHECK_EQ(av_frame_->data[kVPlaneIndex], |
| 355 video_frame->video_frame_buffer()->DataV()); | 355 video_frame->video_frame_buffer()->DataV()); |
| 356 video_frame->set_timestamp(input_image._timeStamp); | 356 video_frame->set_timestamp(input_image._timeStamp); |
| 357 | 357 |
| 358 int32_t ret; | 358 int32_t ret; |
| 359 | 359 |
| 360 // The decoded image may be larger than what is supposed to be visible, see | 360 // The decoded image may be larger than what is supposed to be visible, see |
| 361 // |AVGetBuffer2|'s use of |avcodec_align_dimensions|. This crops the image | 361 // |AVGetBuffer2|'s use of |avcodec_align_dimensions|. This crops the image |
| 362 // without copying the underlying buffer. | 362 // without copying the underlying buffer. |
| 363 rtc::scoped_refptr<VideoFrameBuffer> buf = video_frame->video_frame_buffer(); | 363 rtc::scoped_refptr<VideoFrameBuffer> buf = video_frame->video_frame_buffer(); |
| 364 if (av_frame_->width != buf->width() || av_frame_->height != buf->height()) { | 364 if (av_frame_->width != buf->width() || av_frame_->height != buf->height()) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 void H264DecoderImpl::ReportError() { | 410 void H264DecoderImpl::ReportError() { |
| 411 if (has_reported_error_) | 411 if (has_reported_error_) |
| 412 return; | 412 return; |
| 413 RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.H264DecoderImpl.Event", | 413 RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.H264DecoderImpl.Event", |
| 414 kH264DecoderEventError, | 414 kH264DecoderEventError, |
| 415 kH264DecoderEventMax); | 415 kH264DecoderEventMax); |
| 416 has_reported_error_ = true; | 416 has_reported_error_ = true; |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace webrtc | 419 } // namespace webrtc |
| OLD | NEW |