Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: services/media/framework_ffmpeg/ffmpeg_decoder_base.h

Issue 2081753002: Motown: Stop requiring size when releasing payload buffers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « services/media/framework/payload_allocator.cc ('k') | services/media/framework_mojo/mojo_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698