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

Unified 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: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_parameters.h
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h
index 3820d8cc3c91de2f3f7168d58074d2b25f8a4072..025f1cd31487d1128b19763668e3828b062920c9 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -5,21 +5,31 @@
#ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_
#define MEDIA_AUDIO_AUDIO_PARAMETERS_H_
+#include <stdint.h>
#include <string>
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/time/time.h"
+#include "media/base/audio_bus.h"
#include "media/base/channel_layout.h"
#include "media/base/media_export.h"
namespace media {
-struct MEDIA_EXPORT AudioInputBufferParameters {
+struct ALIGNAS(AudioBus::kChannelAlignment) MEDIA_EXPORT
+ AudioInputBufferParameters {
double volume;
uint32 size;
+ uint32_t hardware_delay_bytes;
+ uint32_t id;
bool key_pressed;
};
+COMPILE_ASSERT(
+ sizeof(AudioInputBufferParameters) % AudioBus::kChannelAlignment == 0,
+ AudioInputBufferParameters_not_aligned);
tommi (sloooow) - chröme 2015/08/18 12:44:37 I think we should apply the alignas attribute on t
Henrik Grunell 2015/08/19 14:28:38 Did that and hit dcheck in AudioBus::WrapMemory. A
+
// Use a struct-in-struct approach to ensure that we can calculate the required
// size as sizeof(AudioInputBufferParameters) + #(bytes in audio buffer) without
// using packing.
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698