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

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

Issue 8229013: Fix problem when we did not play beginning of HTML5 audio stream in low latency mode. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_sync_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "base/file_descriptor_posix.h" 9 #include "base/file_descriptor_posix.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 12 matching lines...) Expand all
23 class AudioSyncReader : public media::AudioOutputController::SyncReader { 23 class AudioSyncReader : public media::AudioOutputController::SyncReader {
24 public: 24 public:
25 explicit AudioSyncReader(base::SharedMemory* shared_memory); 25 explicit AudioSyncReader(base::SharedMemory* shared_memory);
26 26
27 virtual ~AudioSyncReader(); 27 virtual ~AudioSyncReader();
28 28
29 // media::AudioOutputController::SyncReader implementations. 29 // media::AudioOutputController::SyncReader implementations.
30 virtual void UpdatePendingBytes(uint32 bytes); 30 virtual void UpdatePendingBytes(uint32 bytes);
31 virtual uint32 Read(void* data, uint32 size); 31 virtual uint32 Read(void* data, uint32 size);
32 virtual void Close(); 32 virtual void Close();
33 virtual bool DataReady();
33 34
34 bool Init(); 35 bool Init();
35 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle, 36 bool PrepareForeignSocketHandle(base::ProcessHandle process_handle,
36 #if defined(OS_WIN) 37 #if defined(OS_WIN)
37 base::SyncSocket::Handle* foreign_handle); 38 base::SyncSocket::Handle* foreign_handle);
38 #else 39 #else
39 base::FileDescriptor* foreign_handle); 40 base::FileDescriptor* foreign_handle);
40 #endif 41 #endif
41 42
42 private: 43 private:
43 base::SharedMemory* shared_memory_; 44 base::SharedMemory* shared_memory_;
44 base::Time previous_call_time_; 45 base::Time previous_call_time_;
45 46
46 // A pair of SyncSocket for transmitting audio data. 47 // A pair of SyncSocket for transmitting audio data.
47 scoped_ptr<base::SyncSocket> socket_; 48 scoped_ptr<base::SyncSocket> socket_;
48 49
49 // SyncSocket to be used by the renderer. The reference is released after 50 // SyncSocket to be used by the renderer. The reference is released after
50 // PrepareForeignSocketHandle() is called and ran successfully. 51 // PrepareForeignSocketHandle() is called and ran successfully.
51 scoped_ptr<base::SyncSocket> foreign_socket_; 52 scoped_ptr<base::SyncSocket> foreign_socket_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); 54 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader);
54 }; 55 };
55 56
56 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ 57 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_sync_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698