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

Side by Side Diff: media/base/data_source.h

Issue 224093011: Move DataSourceHost to BufferedDataSourceHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows release build. Created 6 years, 8 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
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | media/base/data_source.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) 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/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 // TODO(sandersd): Rename to BufferedDataSourceHost and move to
15 // content/renderer/media/.
16 class MEDIA_EXPORT DataSourceHost {
17 public:
18 // Set the total size of the media file.
19 virtual void SetTotalBytes(int64 total_bytes) = 0;
20
21 // Notify the host that byte range [start,end] has been buffered.
22 // TODO(fischman): remove this method when demuxing is push-based instead of
23 // pull-based. http://crbug.com/131444
24 virtual void AddBufferedByteRange(int64 start, int64 end) = 0;
25
26 protected:
27 virtual ~DataSourceHost();
28 };
29
30 class MEDIA_EXPORT DataSource { 14 class MEDIA_EXPORT DataSource {
31 public: 15 public:
32 typedef base::Callback<void(int64, int64)> StatusCallback; 16 typedef base::Callback<void(int64, int64)> StatusCallback;
33 typedef base::Callback<void(int)> ReadCB; 17 typedef base::Callback<void(int)> ReadCB;
34 static const int kReadError; 18 static const int kReadError;
35 19
36 DataSource(); 20 DataSource();
37 virtual ~DataSource(); 21 virtual ~DataSource();
38 22
39 // Reads |size| bytes from |position| into |data|. And when the read is done 23 // Reads |size| bytes from |position| into |data|. And when the read is done
(...skipping 18 matching lines...) Expand all
58 // Values of |bitrate| <= 0 are invalid and should be ignored. 42 // Values of |bitrate| <= 0 are invalid and should be ignored.
59 virtual void SetBitrate(int bitrate) = 0; 43 virtual void SetBitrate(int bitrate) = 0;
60 44
61 private: 45 private:
62 DISALLOW_COPY_AND_ASSIGN(DataSource); 46 DISALLOW_COPY_AND_ASSIGN(DataSource);
63 }; 47 };
64 48
65 } // namespace media 49 } // namespace media
66 50
67 #endif // MEDIA_BASE_DATA_SOURCE_H_ 51 #endif // MEDIA_BASE_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | media/base/data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698