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

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

Issue 1651673002: Add MediaCodecAudioDecoder implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A better linking issue fix Created 4 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
« no previous file with comments | « media/base/android/sdk_media_codec_bridge.cc ('k') | media/base/audio_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_AUDIO_BUFFER_H_ 5 #ifndef MEDIA_BASE_AUDIO_BUFFER_H_
6 #define MEDIA_BASE_AUDIO_BUFFER_H_ 6 #define MEDIA_BASE_AUDIO_BUFFER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Return the channel layout. 124 // Return the channel layout.
125 ChannelLayout channel_layout() const { return channel_layout_; } 125 ChannelLayout channel_layout() const { return channel_layout_; }
126 126
127 base::TimeDelta timestamp() const { return timestamp_; } 127 base::TimeDelta timestamp() const { return timestamp_; }
128 base::TimeDelta duration() const { return duration_; } 128 base::TimeDelta duration() const { return duration_; }
129 void set_timestamp(base::TimeDelta timestamp) { timestamp_ = timestamp; } 129 void set_timestamp(base::TimeDelta timestamp) { timestamp_ = timestamp; }
130 130
131 // If there's no data in this buffer, it represents end of stream. 131 // If there's no data in this buffer, it represents end of stream.
132 bool end_of_stream() const { return end_of_stream_; } 132 bool end_of_stream() const { return end_of_stream_; }
133 133
134 // Access to the raw buffer for ffmpeg to write directly to. Data for planar 134 // Access to the raw buffer for ffmpeg and Android MediaCodec decoders to
135 // data is grouped by channel. There is only 1 entry for interleaved formats. 135 // write directly to. For planar formats the vector elements correspond to
136 // the channels. For interleaved formats the resulting vector has exactly
137 // one element which contains the buffer pointer.
136 const std::vector<uint8_t*>& channel_data() const { return channel_data_; } 138 const std::vector<uint8_t*>& channel_data() const { return channel_data_; }
137 139
140 // The size of allocated data memory block. For planar formats channels go
141 // sequentially in this block.
142 size_t data_size() const { return data_size_; }
143
138 private: 144 private:
139 friend class base::RefCountedThreadSafe<AudioBuffer>; 145 friend class base::RefCountedThreadSafe<AudioBuffer>;
140 146
141 // mojo::TypeConverter added as a friend so that AudioBuffer can be 147 // mojo::TypeConverter added as a friend so that AudioBuffer can be
142 // transferred across a mojo connection. 148 // transferred across a mojo connection.
143 friend struct mojo::TypeConverter<mojo::StructPtr<interfaces::AudioBuffer>, 149 friend struct mojo::TypeConverter<mojo::StructPtr<interfaces::AudioBuffer>,
144 scoped_refptr<AudioBuffer>>; 150 scoped_refptr<AudioBuffer>>;
145 151
146 // Allocates aligned contiguous buffer to hold all channel data (1 block for 152 // Allocates aligned contiguous buffer to hold all channel data (1 block for
147 // interleaved data, |channel_count| blocks for planar data), copies 153 // interleaved data, |channel_count| blocks for planar data), copies
(...skipping 27 matching lines...) Expand all
175 181
176 // For planar data, points to each channels data. 182 // For planar data, points to each channels data.
177 std::vector<uint8_t*> channel_data_; 183 std::vector<uint8_t*> channel_data_;
178 184
179 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); 185 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer);
180 }; 186 };
181 187
182 } // namespace media 188 } // namespace media
183 189
184 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ 190 #endif // MEDIA_BASE_AUDIO_BUFFER_H_
OLDNEW
« no previous file with comments | « media/base/android/sdk_media_codec_bridge.cc ('k') | media/base/audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698