| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "services/media/framework_ffmpeg/av_codec_context.h" | 6 #include "services/media/framework_ffmpeg/av_codec_context.h" |
| 7 #include "services/media/framework_ffmpeg/ffmpeg_decoder_base.h" | 7 #include "services/media/framework_ffmpeg/ffmpeg_decoder_base.h" |
| 8 | 8 |
| 9 namespace mojo { | 9 namespace mojo { |
| 10 namespace media { | 10 namespace media { |
| 11 | 11 |
| 12 FfmpegDecoderBase::FfmpegDecoderBase(AvCodecContextPtr av_codec_context) | 12 FfmpegDecoderBase::FfmpegDecoderBase(AvCodecContextPtr av_codec_context) |
| 13 : av_codec_context_(std::move(av_codec_context)), | 13 : av_codec_context_(std::move(av_codec_context)), |
| 14 av_frame_ptr_(av_frame_alloc()) { | 14 av_frame_ptr_(ffmpeg::AvFrame::Create()) { |
| 15 DCHECK(av_codec_context_); | 15 DCHECK(av_codec_context_); |
| 16 } | 16 } |
| 17 | 17 |
| 18 FfmpegDecoderBase::~FfmpegDecoderBase() {} | 18 FfmpegDecoderBase::~FfmpegDecoderBase() {} |
| 19 | 19 |
| 20 std::unique_ptr<StreamType> FfmpegDecoderBase::output_stream_type() { | 20 std::unique_ptr<StreamType> FfmpegDecoderBase::output_stream_type() { |
| 21 return AvCodecContext::GetStreamType(*av_codec_context_); | 21 return AvCodecContext::GetStreamType(*av_codec_context_); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void FfmpegDecoderBase::Flush() { | 24 void FfmpegDecoderBase::Flush() { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 av_packet_.size = 0; | 90 av_packet_.size = 0; |
| 91 av_packet_.data = nullptr; | 91 av_packet_.data = nullptr; |
| 92 | 92 |
| 93 return true; | 93 return true; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace media | 96 } // namespace media |
| 97 } // namespace mojo | 97 } // namespace mojo |
| OLD | NEW |