OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 void ReadFromDemuxerStream(media::DemuxerStream::Type type, | 161 void ReadFromDemuxerStream(media::DemuxerStream::Type type, |
162 scoped_ptr<media::DemuxerData> data, | 162 scoped_ptr<media::DemuxerData> data, |
163 size_t index); | 163 size_t index); |
164 void OnBufferReady(media::DemuxerStream::Type type, | 164 void OnBufferReady(media::DemuxerStream::Type type, |
165 scoped_ptr<media::DemuxerData> data, | 165 scoped_ptr<media::DemuxerData> data, |
166 size_t index, | 166 size_t index, |
167 media::DemuxerStream::Status status, | 167 media::DemuxerStream::Status status, |
168 const scoped_refptr<media::DecoderBuffer>& buffer); | 168 const scoped_refptr<media::DecoderBuffer>& buffer); |
169 | 169 |
170 // Helper function for calculating duration. | 170 // Helper function for calculating duration. |
171 int GetDurationMs(); | 171 base::TimeDelta GetDuration() const; |
172 | 172 |
173 bool IsSeeking() const; | 173 bool IsSeeking() const; |
174 | 174 |
175 // Returns |seek_time| if it is still buffered or if there is no currently | 175 // Returns |seek_time| if it is still buffered or if there is no currently |
176 // buffered range including or soon after |seek_time|. If |seek_time| is not | 176 // buffered range including or soon after |seek_time|. If |seek_time| is not |
177 // buffered, but there is a later range buffered near to |seek_time|, returns | 177 // buffered, but there is a later range buffered near to |seek_time|, returns |
178 // next buffered range's start time instead. Only call this for browser seeks. | 178 // next buffered range's start time instead. Only call this for browser seeks. |
179 // |seeking_lock_| must be held by caller. | 179 // |seeking_lock_| must be held by caller. |
180 base::TimeDelta FindBufferedBrowserSeekTime_Locked( | 180 base::TimeDelta FindBufferedBrowserSeekTime_Locked( |
181 const base::TimeDelta& seek_time) const; | 181 const base::TimeDelta& seek_time) const; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; | 237 base::WeakPtrFactory<MediaSourceDelegate> main_weak_factory_; |
238 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; | 238 base::WeakPtrFactory<MediaSourceDelegate> media_weak_factory_; |
239 base::WeakPtr<MediaSourceDelegate> main_weak_this_; | 239 base::WeakPtr<MediaSourceDelegate> main_weak_this_; |
240 | 240 |
241 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); | 241 DISALLOW_COPY_AND_ASSIGN(MediaSourceDelegate); |
242 }; | 242 }; |
243 | 243 |
244 } // namespace content | 244 } // namespace content |
245 | 245 |
246 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ | 246 #endif // CONTENT_RENDERER_MEDIA_ANDROID_MEDIA_SOURCE_DELEGATE_H_ |
OLD | NEW |