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 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ | 5 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ |
6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ | 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ |
7 | 7 |
8 #include "services/media/framework/parts/decoder.h" | 8 #include "services/media/framework/parts/decoder.h" |
9 #include "services/media/framework_ffmpeg/av_codec_context.h" | 9 #include "services/media/framework_ffmpeg/av_codec_context.h" |
10 #include "services/media/framework_ffmpeg/av_frame.h" | 10 #include "services/media/framework_ffmpeg/av_frame.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 ~AvBufferContext() { | 52 ~AvBufferContext() { |
53 if (allocator_ == nullptr) { | 53 if (allocator_ == nullptr) { |
54 // Previously released. | 54 // Previously released. |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 if (size_ != 0) { | 58 if (size_ != 0) { |
59 DCHECK(buffer_ != nullptr); | 59 DCHECK(buffer_ != nullptr); |
60 allocator_->ReleasePayloadBuffer(size_, buffer_); | 60 allocator_->ReleasePayloadBuffer(buffer_); |
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
64 DCHECK(buffer_ == nullptr); | 64 DCHECK(buffer_ == nullptr); |
65 } | 65 } |
66 | 66 |
67 uint8_t* buffer() { return buffer_; } | 67 uint8_t* buffer() { return buffer_; } |
68 | 68 |
69 size_t size() { return size_; } | 69 size_t size() { return size_; } |
70 | 70 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 AvCodecContextPtr av_codec_context_; | 114 AvCodecContextPtr av_codec_context_; |
115 AVPacket av_packet_; | 115 AVPacket av_packet_; |
116 ffmpeg::AvFramePtr av_frame_ptr_; | 116 ffmpeg::AvFramePtr av_frame_ptr_; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace media | 119 } // namespace media |
120 } // namespace mojo | 120 } // namespace mojo |
121 | 121 |
122 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ | 122 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_DECODER_BASE_H_ |
OLD | NEW |