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

Unified Diff: media/audio/audio_device_thread.h

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation for ALSA. Created 4 years, 5 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
Index: media/audio/audio_device_thread.h
diff --git a/media/audio/audio_device_thread.h b/media/audio/audio_device_thread.h
index f3287ef39ccf86705642dc5439f7b13860737f1d..e043f38e8930bedea05dfbb28e2785568384bd0c 100644
--- a/media/audio/audio_device_thread.h
+++ b/media/audio/audio_device_thread.h
@@ -12,10 +12,12 @@
#include "base/sync_socket.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_checker.h"
+#include "media/audio/audio_io.h"
#include "media/base/audio_parameters.h"
#include "media/base/media_export.h"
namespace media {
+struct AudioTimestamp;
// Data transfer between browser and render process uses a combination
// of sync sockets and shared memory. To read from the socket and render
@@ -42,7 +44,9 @@ class MEDIA_EXPORT AudioDeviceThread : public base::PlatformThread::Delegate {
virtual void MapSharedMemory() = 0;
// Called whenever we receive notifications about pending input data.
- virtual void Process(uint32_t pending_data) = 0;
+ // It also provides the current audio stream timestamp on the device.
+ virtual void Process(uint32_t pending_data,
+ const AudioTimestamp& timestamp) = 0;
protected:
virtual ~Callback();
@@ -75,6 +79,12 @@ class MEDIA_EXPORT AudioDeviceThread : public base::PlatformThread::Delegate {
// synchronous process and the thread will stop before the method returns.
~AudioDeviceThread() override;
+ // Represents a data packet to be received via the socket.
+ struct Packet {
+ uint32_t pending_data;
+ AudioTimestamp timestamp;
+ };
+
private:
void ThreadMain() final;

Powered by Google App Engine
This is Rietveld 408576698