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

Side by Side Diff: media/audio/audio_parameters.h

Issue 1293503002: Check buffer index in shared memory for input audio. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 5 years, 4 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 (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_AUDIO_AUDIO_PARAMETERS_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_
6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_
7 7
8 #include <stdint.h>
8 #include <string> 9 #include <string>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "media/base/channel_layout.h" 13 #include "media/base/channel_layout.h"
13 #include "media/base/media_export.h" 14 #include "media/base/media_export.h"
14 15
15 namespace media { 16 namespace media {
16 17
17 struct MEDIA_EXPORT AudioInputBufferParameters { 18 struct MEDIA_EXPORT AudioInputBufferParameters {
tommi (sloooow) - chröme 2015/08/14 09:56:21 use #pragma pack if explicit packing is always nec
Henrik Grunell 2015/08/14 12:38:32 As discussed offline, that doesn't work (for gcc a
18 double volume; 19 double volume;
19 uint32 size; 20 uint32 size;
21 uint32_t hardware_delay_bytes;
22 uint32_t id;
20 bool key_pressed; 23 bool key_pressed;
24 uint8_t pad8[3];
DaleCurtis 2015/08/13 22:00:49 ?
25 uint64_t pad64;
21 }; 26 };
22 27
23 // Use a struct-in-struct approach to ensure that we can calculate the required 28 // Use a struct-in-struct approach to ensure that we can calculate the required
24 // size as sizeof(AudioInputBufferParameters) + #(bytes in audio buffer) without 29 // size as sizeof(AudioInputBufferParameters) + #(bytes in audio buffer) without
25 // using packing. 30 // using packing.
26 struct MEDIA_EXPORT AudioInputBuffer { 31 struct MEDIA_EXPORT AudioInputBuffer {
27 AudioInputBufferParameters params; 32 AudioInputBufferParameters params;
28 int8 audio[1]; 33 int8 audio[1];
29 }; 34 };
30 35
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (a.sample_rate() != b.sample_rate()) 131 if (a.sample_rate() != b.sample_rate())
127 return a.sample_rate() < b.sample_rate(); 132 return a.sample_rate() < b.sample_rate();
128 if (a.bits_per_sample() != b.bits_per_sample()) 133 if (a.bits_per_sample() != b.bits_per_sample())
129 return a.bits_per_sample() < b.bits_per_sample(); 134 return a.bits_per_sample() < b.bits_per_sample();
130 return a.frames_per_buffer() < b.frames_per_buffer(); 135 return a.frames_per_buffer() < b.frames_per_buffer();
131 } 136 }
132 137
133 } // namespace media 138 } // namespace media
134 139
135 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 140 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_
OLDNEW
« media/audio/audio_input_device.cc ('K') | « media/audio/audio_input_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698