OLD | NEW |
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 MEDIA_BASE_DATA_SOURCE_H_ | 5 #ifndef MEDIA_BASE_DATA_SOURCE_H_ |
6 #define MEDIA_BASE_DATA_SOURCE_H_ | 6 #define MEDIA_BASE_DATA_SOURCE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 class MEDIA_EXPORT DataSourceHost { | 15 class MEDIA_EXPORT DataSourceHost { |
16 public: | 16 public: |
17 // Set the total size of the media file. | 17 // Set the total size of the media file. |
18 virtual void SetTotalBytes(int64 total_bytes) = 0; | 18 virtual void SetTotalBytes(int64 total_bytes) = 0; |
19 | 19 |
20 // Notify the host that byte range [start,end] has been buffered. | 20 // Notify the host that byte range [start,end] has been buffered. |
21 // TODO(fischman): remove this method when demuxing is push-based instead of | 21 // TODO(fischman): remove this method when demuxing is push-based instead of |
22 // pull-based. http://crbug.com/131444 | 22 // pull-based. http://crbug.com/131444 |
23 virtual void AddBufferedByteRange(int64 start, int64 end) = 0; | 23 virtual void AddBufferedByteRange(int64 start, int64 end) = 0; |
24 | 24 |
25 // Notify the host that time range [start,end] has been buffered. | |
26 virtual void AddBufferedTimeRange(base::TimeDelta start, | |
27 base::TimeDelta end) = 0; | |
28 | |
29 protected: | 25 protected: |
30 virtual ~DataSourceHost(); | 26 virtual ~DataSourceHost(); |
31 }; | 27 }; |
32 | 28 |
33 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> { | 29 class MEDIA_EXPORT DataSource : public base::RefCountedThreadSafe<DataSource> { |
34 public: | 30 public: |
35 typedef base::Callback<void(int64, int64)> StatusCallback; | 31 typedef base::Callback<void(int64, int64)> StatusCallback; |
36 typedef base::Callback<void(int)> ReadCB; | 32 typedef base::Callback<void(int)> ReadCB; |
37 static const int kReadError; | 33 static const int kReadError; |
38 | 34 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 70 |
75 private: | 71 private: |
76 DataSourceHost* host_; | 72 DataSourceHost* host_; |
77 | 73 |
78 DISALLOW_COPY_AND_ASSIGN(DataSource); | 74 DISALLOW_COPY_AND_ASSIGN(DataSource); |
79 }; | 75 }; |
80 | 76 |
81 } // namespace media | 77 } // namespace media |
82 | 78 |
83 #endif // MEDIA_BASE_DATA_SOURCE_H_ | 79 #endif // MEDIA_BASE_DATA_SOURCE_H_ |
OLD | NEW |