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 #include "media/base/preload.h" | |
15 | 14 |
16 namespace media { | 15 namespace media { |
17 | 16 |
18 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { | 17 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { |
19 public: | 18 public: |
20 virtual ~DemuxerHost(); | 19 virtual ~DemuxerHost(); |
21 | 20 |
22 // Get the duration of the media in microseconds. If the duration has not | 21 // Get the duration of the media in microseconds. If the duration has not |
23 // been determined yet, then returns 0. | 22 // been determined yet, then returns 0. |
24 virtual void SetDuration(base::TimeDelta duration) = 0; | 23 virtual void SetDuration(base::TimeDelta duration) = 0; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // This method is called from the pipeline when the audio renderer | 60 // This method is called from the pipeline when the audio renderer |
62 // is disabled. Demuxers can ignore the notification if they do not | 61 // is disabled. Demuxers can ignore the notification if they do not |
63 // need to react to this event. | 62 // need to react to this event. |
64 // | 63 // |
65 // TODO(acolwell): Change to generic DisableStream(DemuxerStream::Type). | 64 // TODO(acolwell): Change to generic DisableStream(DemuxerStream::Type). |
66 virtual void OnAudioRendererDisabled(); | 65 virtual void OnAudioRendererDisabled(); |
67 | 66 |
68 // Returns the given stream type, or NULL if that type is not present. | 67 // Returns the given stream type, or NULL if that type is not present. |
69 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0; | 68 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0; |
70 | 69 |
71 // Alert the Demuxer that the video preload value has been changed. | |
72 virtual void SetPreload(Preload preload) = 0; | |
73 | |
74 // Returns the starting time for the media file. | 70 // Returns the starting time for the media file. |
75 virtual base::TimeDelta GetStartTime() const = 0; | 71 virtual base::TimeDelta GetStartTime() const = 0; |
76 | 72 |
77 // Returns the content bitrate. May be obtained from container or | 73 // Returns the content bitrate. May be obtained from container or |
78 // approximated. Returns 0 if it is unknown. | 74 // approximated. Returns 0 if it is unknown. |
79 virtual int GetBitrate() = 0; | 75 virtual int GetBitrate() = 0; |
80 | 76 |
81 // Returns true if the source is from a local file or stream (such as a | 77 // Returns true if the source is from a local file or stream (such as a |
82 // webcam stream), false otherwise. | 78 // webcam stream), false otherwise. |
83 virtual bool IsLocalSource() = 0; | 79 virtual bool IsLocalSource() = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
98 | 94 |
99 private: | 95 private: |
100 DemuxerHost* host_; | 96 DemuxerHost* host_; |
101 | 97 |
102 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 98 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
103 }; | 99 }; |
104 | 100 |
105 } // namespace media | 101 } // namespace media |
106 | 102 |
107 #endif // MEDIA_BASE_DEMUXER_H_ | 103 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |