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 <vector> |
| 9 |
8 #include "base/time/time.h" | 10 #include "base/time/time.h" |
9 #include "media/base/data_source.h" | 11 #include "media/base/data_source.h" |
10 #include "media/base/demuxer_stream.h" | 12 #include "media/base/demuxer_stream.h" |
11 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
12 #include "media/base/pipeline_status.h" | 14 #include "media/base/pipeline_status.h" |
13 | 15 |
14 namespace media { | 16 namespace media { |
15 | 17 |
16 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { | 18 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { |
17 public: | 19 public: |
18 // Sets the duration of the media in microseconds. | 20 // Sets the duration of the media in microseconds. |
19 // Duration may be kInfiniteDuration() if the duration is not known. | 21 // Duration may be kInfiniteDuration() if the duration is not known. |
20 virtual void SetDuration(base::TimeDelta duration) = 0; | 22 virtual void SetDuration(base::TimeDelta duration) = 0; |
21 | 23 |
22 // Stops execution of the pipeline due to a fatal error. Do not call this | 24 // Stops execution of the pipeline due to a fatal error. Do not call this |
23 // method with PIPELINE_OK. | 25 // method with PIPELINE_OK. |
24 virtual void OnDemuxerError(PipelineStatus error) = 0; | 26 virtual void OnDemuxerError(PipelineStatus error) = 0; |
25 | 27 |
26 protected: | 28 protected: |
27 virtual ~DemuxerHost(); | 29 virtual ~DemuxerHost(); |
28 }; | 30 }; |
29 | 31 |
30 class MEDIA_EXPORT Demuxer { | 32 class MEDIA_EXPORT Demuxer { |
31 public: | 33 public: |
| 34 // A new potentially encrypted stream has been parsed. |
| 35 // First parameter - The type of initialization data. |
| 36 // Second parameter - The initialization data associated with the stream. |
| 37 typedef base::Callback<void(const std::string& type, |
| 38 const std::vector<uint8>& init_data)> NeedKeyCB; |
| 39 |
32 Demuxer(); | 40 Demuxer(); |
33 virtual ~Demuxer(); | 41 virtual ~Demuxer(); |
34 | 42 |
35 // Completes initialization of the demuxer. | 43 // Completes initialization of the demuxer. |
36 // | 44 // |
37 // The demuxer does not own |host| as it is guaranteed to outlive the | 45 // The demuxer does not own |host| as it is guaranteed to outlive the |
38 // lifetime of the demuxer. Don't delete it! | 46 // lifetime of the demuxer. Don't delete it! |
39 virtual void Initialize(DemuxerHost* host, | 47 virtual void Initialize(DemuxerHost* host, |
40 const PipelineStatusCB& status_cb) = 0; | 48 const PipelineStatusCB& status_cb) = 0; |
41 | 49 |
(...skipping 25 matching lines...) Expand all Loading... |
67 // Returns the starting time for the media file. | 75 // Returns the starting time for the media file. |
68 virtual base::TimeDelta GetStartTime() const = 0; | 76 virtual base::TimeDelta GetStartTime() const = 0; |
69 | 77 |
70 private: | 78 private: |
71 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 79 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
72 }; | 80 }; |
73 | 81 |
74 } // namespace media | 82 } // namespace media |
75 | 83 |
76 #endif // MEDIA_BASE_DEMUXER_H_ | 84 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |