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

Side by Side Diff: media/base/decoder_buffer.h

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarity. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 MEDIA_BASE_DECODER_BUFFER_H_ 5 #ifndef MEDIA_BASE_DECODER_BUFFER_H_
6 #define MEDIA_BASE_DECODER_BUFFER_H_ 6 #define MEDIA_BASE_DECODER_BUFFER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void set_decrypt_config(scoped_ptr<DecryptConfig> decrypt_config) { 123 void set_decrypt_config(scoped_ptr<DecryptConfig> decrypt_config) {
124 DCHECK(!end_of_stream()); 124 DCHECK(!end_of_stream());
125 decrypt_config_ = decrypt_config.Pass(); 125 decrypt_config_ = decrypt_config.Pass();
126 } 126 }
127 127
128 // If there's no data in this buffer, it represents end of stream. 128 // If there's no data in this buffer, it represents end of stream.
129 bool end_of_stream() const { 129 bool end_of_stream() const {
130 return data_ == NULL; 130 return data_ == NULL;
131 } 131 }
132 132
133 // Is this buffer preroll before a splice frame?
134 bool splice_preroll() const {
135 DCHECK(!end_of_stream());
136 return splice_preroll_;
137 }
138
139 void set_splice_preroll(bool splice_preroll) {
140 DCHECK(!end_of_stream());
141 splice_preroll_ = splice_preroll;
142 }
143
133 // Returns a human-readable string describing |*this|. 144 // Returns a human-readable string describing |*this|.
134 std::string AsHumanReadableString(); 145 std::string AsHumanReadableString();
135 146
136 protected: 147 protected:
137 friend class base::RefCountedThreadSafe<DecoderBuffer>; 148 friend class base::RefCountedThreadSafe<DecoderBuffer>;
138 149
139 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer 150 // Allocates a buffer of size |size| >= 0 and copies |data| into it. Buffer
140 // will be padded and aligned as necessary. If |data| is NULL then |data_| is 151 // will be padded and aligned as necessary. If |data| is NULL then |data_| is
141 // set to NULL and |buffer_size_| to 0. 152 // set to NULL and |buffer_size_| to 0.
142 DecoderBuffer(const uint8* data, int size, 153 DecoderBuffer(const uint8* data, int size,
143 const uint8* side_data, int side_data_size); 154 const uint8* side_data, int side_data_size);
144 virtual ~DecoderBuffer(); 155 virtual ~DecoderBuffer();
145 156
146 private: 157 private:
147 base::TimeDelta timestamp_; 158 base::TimeDelta timestamp_;
148 base::TimeDelta duration_; 159 base::TimeDelta duration_;
149 160
150 int size_; 161 int size_;
151 scoped_ptr<uint8, base::ScopedPtrAlignedFree> data_; 162 scoped_ptr<uint8, base::ScopedPtrAlignedFree> data_;
152 int side_data_size_; 163 int side_data_size_;
153 scoped_ptr<uint8, base::ScopedPtrAlignedFree> side_data_; 164 scoped_ptr<uint8, base::ScopedPtrAlignedFree> side_data_;
154 scoped_ptr<DecryptConfig> decrypt_config_; 165 scoped_ptr<DecryptConfig> decrypt_config_;
155 base::TimeDelta discard_padding_; 166 base::TimeDelta discard_padding_;
167 bool splice_preroll_;
156 168
157 // Constructor helper method for memory allocations. 169 // Constructor helper method for memory allocations.
158 void Initialize(); 170 void Initialize();
159 171
160 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); 172 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer);
161 }; 173 };
162 174
163 } // namespace media 175 } // namespace media
164 176
165 #endif // MEDIA_BASE_DECODER_BUFFER_H_ 177 #endif // MEDIA_BASE_DECODER_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698