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

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

Issue 600143002: Adding new function ReadFrames() that returns the audio frame in planar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | media/base/audio_buffer.cc » ('j') | media/base/audio_buffer.cc » ('J')
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 <vector> 8 #include <vector>
9 9
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Copy frames into |dest|. |frames_to_copy| is the number of frames to copy. 66 // Copy frames into |dest|. |frames_to_copy| is the number of frames to copy.
67 // |source_frame_offset| specifies how many frames in the buffer to skip 67 // |source_frame_offset| specifies how many frames in the buffer to skip
68 // first. |dest_frame_offset| is the frame offset in |dest|. The frames are 68 // first. |dest_frame_offset| is the frame offset in |dest|. The frames are
69 // converted from their source format into planar float32 data (which is all 69 // converted from their source format into planar float32 data (which is all
70 // that AudioBus handles). 70 // that AudioBus handles).
71 void ReadFrames(int frames_to_copy, 71 void ReadFrames(int frames_to_copy,
72 int source_frame_offset, 72 int source_frame_offset,
73 int dest_frame_offset, 73 int dest_frame_offset,
74 AudioBus* dest); 74 AudioBus* dest);
75 75
76 // Copy frames into |std::vector<int32>|. The frames are converted from their
77 // source format into planar int32; note that while each frame use 32 bits
78 // each fame is actually PCM signed 24-bit little-endian.
79 std::vector<int32> ReadFrames();
DaleCurtis 2014/09/24 22:30:17 We don't have a SampleFormat for planar 24 bit, on
80
76 // Trim an AudioBuffer by removing |frames_to_trim| frames from the start. 81 // Trim an AudioBuffer by removing |frames_to_trim| frames from the start.
77 // Timestamp and duration are adjusted to reflect the fewer frames. 82 // Timestamp and duration are adjusted to reflect the fewer frames.
78 // Note that repeated calls to TrimStart() may result in timestamp() and 83 // Note that repeated calls to TrimStart() may result in timestamp() and
79 // duration() being off by a few microseconds due to rounding issues. 84 // duration() being off by a few microseconds due to rounding issues.
80 void TrimStart(int frames_to_trim); 85 void TrimStart(int frames_to_trim);
81 86
82 // Trim an AudioBuffer by removing |frames_to_trim| frames from the end. 87 // Trim an AudioBuffer by removing |frames_to_trim| frames from the end.
83 // Duration is adjusted to reflect the fewer frames. 88 // Duration is adjusted to reflect the fewer frames.
84 void TrimEnd(int frames_to_trim); 89 void TrimEnd(int frames_to_trim);
85 90
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 149
145 // For planar data, points to each channels data. 150 // For planar data, points to each channels data.
146 std::vector<uint8*> channel_data_; 151 std::vector<uint8*> channel_data_;
147 152
148 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer); 153 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioBuffer);
149 }; 154 };
150 155
151 } // namespace media 156 } // namespace media
152 157
153 #endif // MEDIA_BASE_AUDIO_BUFFER_H_ 158 #endif // MEDIA_BASE_AUDIO_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/audio_buffer.cc » ('j') | media/base/audio_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698