OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 // | 4 // |
5 // A Chrome specific data source for video stack pipeline. The actual resource | 5 // A Chrome specific data source for video stack pipeline. The actual resource |
6 // loading would happen in the browser process. This class is given a file | 6 // loading would happen in the browser process. This class is given a file |
7 // handle and will ask for progress of downloading from RenderView which | 7 // handle and will ask for progress of downloading from RenderView which |
8 // delegates requests to browser process through IPC. Asynchronous IO will be | 8 // delegates requests to browser process through IPC. Asynchronous IO will be |
9 // performed on the file handle. | 9 // performed on the file handle. |
10 // | 10 // |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 int64 content_length); | 95 int64 content_length); |
96 void OnReceivedData(size_t size); | 96 void OnReceivedData(size_t size); |
97 | 97 |
98 // Methods called from pipeline thread -------------------------------------- | 98 // Methods called from pipeline thread -------------------------------------- |
99 virtual bool Initialize(const std::string& url); | 99 virtual bool Initialize(const std::string& url); |
100 // media::MediaFilter implementation. | 100 // media::MediaFilter implementation. |
101 virtual void Stop(); | 101 virtual void Stop(); |
102 | 102 |
103 // Methods called from demuxer thread --------------------------------------- | 103 // Methods called from demuxer thread --------------------------------------- |
104 // media::DataSource implementation. | 104 // media::DataSource implementation. |
105 virtual size_t Read(char* data, size_t size); | 105 virtual size_t Read(uint8* data, size_t size); |
106 virtual bool GetPosition(int64* position_out); | 106 virtual bool GetPosition(int64* position_out); |
107 virtual bool SetPosition(int64 position); | 107 virtual bool SetPosition(int64 position); |
108 virtual bool GetSize(int64* size_out); | 108 virtual bool GetSize(int64* size_out); |
109 | 109 |
110 const media::MediaFormat* GetMediaFormat(); | 110 const media::MediaFormat* GetMediaFormat(); |
111 | 111 |
112 private: | 112 private: |
113 friend class media::FilterFactoryImpl1<DataSourceImpl, | 113 friend class media::FilterFactoryImpl1<DataSourceImpl, |
114 WebMediaPlayerDelegateImpl*>; | 114 WebMediaPlayerDelegateImpl*>; |
115 | 115 |
116 // Methods called from render thread ---------------------------------------- | 116 // Methods called from render thread ---------------------------------------- |
117 explicit DataSourceImpl(WebMediaPlayerDelegateImpl* delegate); | 117 explicit DataSourceImpl(WebMediaPlayerDelegateImpl* delegate); |
118 virtual ~DataSourceImpl(); | 118 virtual ~DataSourceImpl(); |
119 | 119 |
120 // Methods called from IO thread -------------------------------------------- | 120 // Methods called from IO thread -------------------------------------------- |
121 // Handlers for file reading. | 121 // Handlers for file reading. |
122 void OnCreateFileStream(base::PlatformFile file); | 122 void OnCreateFileStream(base::PlatformFile file); |
123 void OnReadFileStream(char* data, size_t size); | 123 void OnReadFileStream(uint8* data, size_t size); |
124 void OnCloseFileStream(); | 124 void OnCloseFileStream(); |
125 void OnSeekFileStream(net::Whence whence, int64 position); | 125 void OnSeekFileStream(net::Whence whence, int64 position); |
126 void OnDidFileStreamRead(int size); | 126 void OnDidFileStreamRead(int size); |
127 | 127 |
128 media::MediaFormat media_format_; | 128 media::MediaFormat media_format_; |
129 | 129 |
130 // Pointer to the delegate which provides access to RenderView, this is set | 130 // Pointer to the delegate which provides access to RenderView, this is set |
131 // in construction and can be accessed in all threads safely. | 131 // in construction and can be accessed in all threads safely. |
132 WebMediaPlayerDelegateImpl* delegate_; | 132 WebMediaPlayerDelegateImpl* delegate_; |
133 | 133 |
(...skipping 18 matching lines...) Expand all Loading... |
152 MessageLoop* io_loop_; | 152 MessageLoop* io_loop_; |
153 | 153 |
154 // Events for other operations on stream_. | 154 // Events for other operations on stream_. |
155 base::WaitableEvent close_event_; | 155 base::WaitableEvent close_event_; |
156 base::WaitableEvent seek_event_; | 156 base::WaitableEvent seek_event_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(DataSourceImpl); | 158 DISALLOW_COPY_AND_ASSIGN(DataSourceImpl); |
159 }; | 159 }; |
160 | 160 |
161 #endif // CHROME_RENDERER_MEDIA_DATA_SOURCE_IMPL_H_ | 161 #endif // CHROME_RENDERER_MEDIA_DATA_SOURCE_IMPL_H_ |
OLD | NEW |