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

Side by Side Diff: content/browser/renderer_host/media/audio_sync_reader.h

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Pepper audio fixed Created 4 years 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 // Returns null on failure. 39 // Returns null on failure.
40 static std::unique_ptr<AudioSyncReader> Create( 40 static std::unique_ptr<AudioSyncReader> Create(
41 const media::AudioParameters& params); 41 const media::AudioParameters& params);
42 42
43 base::SharedMemory* shared_memory() const { return shared_memory_.get(); } 43 base::SharedMemory* shared_memory() const { return shared_memory_.get(); }
44 base::CancelableSyncSocket* foreign_socket() const { 44 base::CancelableSyncSocket* foreign_socket() const {
45 return foreign_socket_.get(); 45 return foreign_socket_.get();
46 } 46 }
47 47
48 // media::AudioOutputController::SyncReader implementations. 48 // media::AudioOutputController::SyncReader implementations.
49 void UpdatePendingBytes(uint32_t bytes, uint32_t frames_skipped) override; 49 void RequestMoreData(base::TimeDelta delay,
50 base::TimeTicks delay_timestamp,
51 int prior_frames_skipped) override;
50 void Read(media::AudioBus* dest) override; 52 void Read(media::AudioBus* dest) override;
51 void Close() override; 53 void Close() override;
52 54
53 private: 55 private:
54 AudioSyncReader(const media::AudioParameters& params, 56 AudioSyncReader(const media::AudioParameters& params,
55 std::unique_ptr<base::SharedMemory> shared_memory, 57 std::unique_ptr<base::SharedMemory> shared_memory,
56 std::unique_ptr<base::CancelableSyncSocket> socket, 58 std::unique_ptr<base::CancelableSyncSocket> socket,
57 std::unique_ptr<base::CancelableSyncSocket> foreign_socket); 59 std::unique_ptr<base::CancelableSyncSocket> foreign_socket);
58 60
59 // Blocks until data is ready for reading or a timeout expires. Returns false 61 // Blocks until data is ready for reading or a timeout expires. Returns false
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // The index of the audio buffer we're expecting to be sent from the renderer; 93 // The index of the audio buffer we're expecting to be sent from the renderer;
92 // used to block with timeout for audio data. 94 // used to block with timeout for audio data.
93 uint32_t buffer_index_; 95 uint32_t buffer_index_;
94 96
95 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); 97 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader);
96 }; 98 };
97 99
98 } // namespace content 100 } // namespace content
99 101
100 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 102 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698