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_DEMUXER_H_ | 5 #ifndef MEDIA_BASE_DEMUXER_H_ |
6 #define MEDIA_BASE_DEMUXER_H_ | 6 #define MEDIA_BASE_DEMUXER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "media/base/data_source.h" | 10 #include "media/base/data_source.h" |
11 #include "media/base/demuxer_stream.h" | 11 #include "media/base/demuxer_stream.h" |
12 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
13 #include "media/base/pipeline_status.h" | 13 #include "media/base/pipeline_status.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { | 17 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { |
18 public: | 18 public: |
19 virtual ~DemuxerHost(); | |
20 | |
21 // Get the duration of the media in microseconds. If the duration has not | 19 // Get the duration of the media in microseconds. If the duration has not |
22 // been determined yet, then returns 0. | 20 // been determined yet, then returns 0. |
23 virtual void SetDuration(base::TimeDelta duration) = 0; | 21 virtual void SetDuration(base::TimeDelta duration) = 0; |
24 | 22 |
25 // Sets the byte offset at which the client is requesting the video. | 23 // Sets the byte offset at which the client is requesting the video. |
26 virtual void SetCurrentReadPosition(int64 offset) = 0; | 24 virtual void SetCurrentReadPosition(int64 offset) = 0; |
27 | 25 |
28 // Stops execution of the pipeline due to a fatal error. Do not call this | 26 // Stops execution of the pipeline due to a fatal error. Do not call this |
29 // method with PIPELINE_OK. | 27 // method with PIPELINE_OK. |
30 virtual void OnDemuxerError(PipelineStatus error) = 0; | 28 virtual void OnDemuxerError(PipelineStatus error) = 0; |
| 29 |
| 30 protected: |
| 31 virtual ~DemuxerHost(); |
31 }; | 32 }; |
32 | 33 |
33 class MEDIA_EXPORT Demuxer : public base::RefCountedThreadSafe<Demuxer> { | 34 class MEDIA_EXPORT Demuxer : public base::RefCountedThreadSafe<Demuxer> { |
34 public: | 35 public: |
35 Demuxer(); | 36 Demuxer(); |
36 | 37 |
37 // Completes initialization of the demuxer. | 38 // Completes initialization of the demuxer. |
38 // | 39 // |
39 // The demuxer does not own |host| as it is guaranteed to outlive the | 40 // The demuxer does not own |host| as it is guaranteed to outlive the |
40 // lifetime of the demuxer. Don't delete it! | 41 // lifetime of the demuxer. Don't delete it! |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 friend class base::RefCountedThreadSafe<Demuxer>; | 75 friend class base::RefCountedThreadSafe<Demuxer>; |
75 virtual ~Demuxer(); | 76 virtual ~Demuxer(); |
76 | 77 |
77 private: | 78 private: |
78 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 79 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
79 }; | 80 }; |
80 | 81 |
81 } // namespace media | 82 } // namespace media |
82 | 83 |
83 #endif // MEDIA_BASE_DEMUXER_H_ | 84 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |