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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "media/base/data_source.h" | 15 #include "media/base/data_source.h" |
16 #include "media/base/demuxer_stream.h" | 16 #include "media/base/demuxer_stream.h" |
17 #include "media/base/demuxer_stream_provider.h" | 17 #include "media/base/demuxer_stream_provider.h" |
18 #include "media/base/eme_constants.h" | 18 #include "media/base/eme_constants.h" |
19 #include "media/base/media_export.h" | 19 #include "media/base/media_export.h" |
20 #include "media/base/pipeline_status.h" | 20 #include "media/base/pipeline_status.h" |
21 #include "media/base/ranges.h" | 21 #include "media/base/ranges.h" |
22 | 22 |
23 namespace media { | 23 namespace media { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 protected: | 56 protected: |
57 virtual ~DemuxerHost(); | 57 virtual ~DemuxerHost(); |
58 }; | 58 }; |
59 | 59 |
60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { | 60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { |
61 public: | 61 public: |
62 // A new potentially encrypted stream has been parsed. | 62 // A new potentially encrypted stream has been parsed. |
63 // First parameter - The type of initialization data. | 63 // First parameter - The type of initialization data. |
64 // Second parameter - The initialization data associated with the stream. | 64 // Second parameter - The initialization data associated with the stream. |
65 typedef base::Callback<void(EmeInitDataType type, | 65 using EncryptedMediaInitDataCB = |
66 const std::vector<uint8_t>& init_data)> | 66 base::Callback<void(EmeInitDataType type, |
67 EncryptedMediaInitDataCB; | 67 const std::vector<uint8_t>& init_data)>; |
68 | 68 |
69 // Notifies demuxer clients that media track configuration has been updated | 69 // Notifies demuxer clients that media track configuration has been updated |
70 // (e.g. the inital stream metadata has been parsed successfully, or a new | 70 // (e.g. the inital stream metadata has been parsed successfully, or a new |
71 // init segment has been parsed successfully in MSE case). | 71 // init segment has been parsed successfully in MSE case). |
72 typedef base::Callback<void(scoped_ptr<MediaTracks>)> MediaTracksUpdatedCB; | 72 using MediaTracksUpdatedCB = |
| 73 base::Callback<void(std::unique_ptr<MediaTracks>)>; |
73 | 74 |
74 Demuxer(); | 75 Demuxer(); |
75 ~Demuxer() override; | 76 ~Demuxer() override; |
76 | 77 |
77 // Returns the name of the demuxer for logging purpose. | 78 // Returns the name of the demuxer for logging purpose. |
78 virtual std::string GetDisplayName() const = 0; | 79 virtual std::string GetDisplayName() const = 0; |
79 | 80 |
80 // Completes initialization of the demuxer. | 81 // Completes initialization of the demuxer. |
81 // | 82 // |
82 // The demuxer does not own |host| as it is guaranteed to outlive the | 83 // The demuxer does not own |host| as it is guaranteed to outlive the |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Returns the memory usage in bytes for the demuxer. | 135 // Returns the memory usage in bytes for the demuxer. |
135 virtual int64_t GetMemoryUsage() const = 0; | 136 virtual int64_t GetMemoryUsage() const = 0; |
136 | 137 |
137 private: | 138 private: |
138 DISALLOW_COPY_AND_ASSIGN(Demuxer); | 139 DISALLOW_COPY_AND_ASSIGN(Demuxer); |
139 }; | 140 }; |
140 | 141 |
141 } // namespace media | 142 } // namespace media |
142 | 143 |
143 #endif // MEDIA_BASE_DEMUXER_H_ | 144 #endif // MEDIA_BASE_DEMUXER_H_ |
OLD | NEW |