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

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

Issue 1727243002: Unify media track info reporting on a demuxer level (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tracks-impl-in-media
Patch Set: rebase Created 4 years, 9 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
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_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 <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "media/base/data_source.h" 14 #include "media/base/data_source.h"
15 #include "media/base/demuxer_stream.h" 15 #include "media/base/demuxer_stream.h"
16 #include "media/base/demuxer_stream_provider.h" 16 #include "media/base/demuxer_stream_provider.h"
17 #include "media/base/eme_constants.h" 17 #include "media/base/eme_constants.h"
18 #include "media/base/media_export.h" 18 #include "media/base/media_export.h"
19 #include "media/base/pipeline_status.h" 19 #include "media/base/pipeline_status.h"
20 #include "media/base/ranges.h" 20 #include "media/base/ranges.h"
21 21
22 namespace media { 22 namespace media {
23 23
24 class TextTrackConfig; 24 class TextTrackConfig;
25 class MediaTracks;
25 26
26 class MEDIA_EXPORT DemuxerHost { 27 class MEDIA_EXPORT DemuxerHost {
27 public: 28 public:
28 // Notify the host that buffered time ranges have changed. Note that buffered 29 // Notify the host that buffered time ranges have changed. Note that buffered
29 // time ranges can grow (when new media data is appended), but they can also 30 // time ranges can grow (when new media data is appended), but they can also
30 // shrink (when buffering reaches limit capacity and some buffered data 31 // shrink (when buffering reaches limit capacity and some buffered data
31 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of 32 // becomes evicted, e.g. due to MSE GC algorithm, or by explicit removal of
32 // ranges directed by MSE web app). 33 // ranges directed by MSE web app).
33 virtual void OnBufferedTimeRangesChanged( 34 virtual void OnBufferedTimeRangesChanged(
34 const Ranges<base::TimeDelta>& ranges) = 0; 35 const Ranges<base::TimeDelta>& ranges) = 0;
(...skipping 19 matching lines...) Expand all
54 55
55 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { 56 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider {
56 public: 57 public:
57 // A new potentially encrypted stream has been parsed. 58 // A new potentially encrypted stream has been parsed.
58 // First parameter - The type of initialization data. 59 // First parameter - The type of initialization data.
59 // Second parameter - The initialization data associated with the stream. 60 // Second parameter - The initialization data associated with the stream.
60 typedef base::Callback<void(EmeInitDataType type, 61 typedef base::Callback<void(EmeInitDataType type,
61 const std::vector<uint8_t>& init_data)> 62 const std::vector<uint8_t>& init_data)>
62 EncryptedMediaInitDataCB; 63 EncryptedMediaInitDataCB;
63 64
65 // Notifies demuxer clients that media track configuration has been updated
66 // (e.g. the inital stream metadata has been parsed successfully, or a new
wolenetz 2016/03/05 01:47:43 nit:initial
67 // init segment has been parsed successfully in MSE case).
68 typedef base::Callback<void(scoped_ptr<MediaTracks>)> MediaTracksUpdatedCB;
69
64 Demuxer(); 70 Demuxer();
65 ~Demuxer() override; 71 ~Demuxer() override;
66 72
67 // Returns the name of the demuxer for logging purpose. 73 // Returns the name of the demuxer for logging purpose.
68 virtual std::string GetDisplayName() const = 0; 74 virtual std::string GetDisplayName() const = 0;
69 75
70 // Completes initialization of the demuxer. 76 // Completes initialization of the demuxer.
71 // 77 //
72 // The demuxer does not own |host| as it is guaranteed to outlive the 78 // The demuxer does not own |host| as it is guaranteed to outlive the
73 // lifetime of the demuxer. Don't delete it! |status_cb| must only be run 79 // lifetime of the demuxer. Don't delete it! |status_cb| must only be run
(...skipping 24 matching lines...) Expand all
98 // Returns the memory usage in bytes for the demuxer. 104 // Returns the memory usage in bytes for the demuxer.
99 virtual int64_t GetMemoryUsage() const = 0; 105 virtual int64_t GetMemoryUsage() const = 0;
100 106
101 private: 107 private:
102 DISALLOW_COPY_AND_ASSIGN(Demuxer); 108 DISALLOW_COPY_AND_ASSIGN(Demuxer);
103 }; 109 };
104 110
105 } // namespace media 111 } // namespace media
106 112
107 #endif // MEDIA_BASE_DEMUXER_H_ 113 #endif // MEDIA_BASE_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698