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

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

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « media/base/android/media_url_demuxer.cc ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.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/media_track.h"
20 #include "media/base/pipeline_status.h" 21 #include "media/base/pipeline_status.h"
21 #include "media/base/ranges.h" 22 #include "media/base/ranges.h"
22 23
23 namespace media { 24 namespace media {
24 25
25 class TextTrackConfig; 26 class TextTrackConfig;
26 class MediaTracks; 27 class MediaTracks;
27 28
28 class MEDIA_EXPORT DemuxerHost { 29 class MEDIA_EXPORT DemuxerHost {
29 public: 30 public:
(...skipping 30 matching lines...) Expand all
60 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { 61 class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider {
61 public: 62 public:
62 // A new potentially encrypted stream has been parsed. 63 // A new potentially encrypted stream has been parsed.
63 // First parameter - The type of initialization data. 64 // First parameter - The type of initialization data.
64 // Second parameter - The initialization data associated with the stream. 65 // Second parameter - The initialization data associated with the stream.
65 using EncryptedMediaInitDataCB = 66 using EncryptedMediaInitDataCB =
66 base::Callback<void(EmeInitDataType type, 67 base::Callback<void(EmeInitDataType type,
67 const std::vector<uint8_t>& init_data)>; 68 const std::vector<uint8_t>& init_data)>;
68 69
69 // Notifies demuxer clients that media track configuration has been updated 70 // Notifies demuxer clients that media track configuration has been updated
70 // (e.g. the inital stream metadata has been parsed successfully, or a new 71 // (e.g. the initial stream metadata has been parsed successfully, or a new
71 // init segment has been parsed successfully in MSE case). 72 // init segment has been parsed successfully in MSE case).
72 using MediaTracksUpdatedCB = 73 using MediaTracksUpdatedCB =
73 base::Callback<void(std::unique_ptr<MediaTracks>)>; 74 base::Callback<void(std::unique_ptr<MediaTracks>)>;
74 75
75 Demuxer(); 76 Demuxer();
76 ~Demuxer() override; 77 ~Demuxer() override;
77 78
78 // Returns the name of the demuxer for logging purpose. 79 // Returns the name of the demuxer for logging purpose.
79 virtual std::string GetDisplayName() const = 0; 80 virtual std::string GetDisplayName() const = 0;
80 81
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 virtual base::TimeDelta GetStartTime() const = 0; 129 virtual base::TimeDelta GetStartTime() const = 0;
129 130
130 // Returns Time represented by presentation timestamp 0. 131 // Returns Time represented by presentation timestamp 0.
131 // If the timstamps are not associated with a Time, then 132 // If the timstamps are not associated with a Time, then
132 // a null Time is returned. 133 // a null Time is returned.
133 virtual base::Time GetTimelineOffset() const = 0; 134 virtual base::Time GetTimelineOffset() const = 0;
134 135
135 // Returns the memory usage in bytes for the demuxer. 136 // Returns the memory usage in bytes for the demuxer.
136 virtual int64_t GetMemoryUsage() const = 0; 137 virtual int64_t GetMemoryUsage() const = 0;
137 138
139 virtual void OnEnabledAudioTracksChanged(
140 const std::vector<MediaTrack::Id>& track_ids,
141 base::TimeDelta currTime) = 0;
142
143 // |track_ids| is either empty or contains a single video track id.
144 virtual void OnSelectedVideoTrackChanged(
145 const std::vector<MediaTrack::Id>& track_ids,
146 base::TimeDelta currTime) = 0;
147
138 private: 148 private:
139 DISALLOW_COPY_AND_ASSIGN(Demuxer); 149 DISALLOW_COPY_AND_ASSIGN(Demuxer);
140 }; 150 };
141 151
142 } // namespace media 152 } // namespace media
143 153
144 #endif // MEDIA_BASE_DEMUXER_H_ 154 #endif // MEDIA_BASE_DEMUXER_H_
OLDNEW
« no previous file with comments | « media/base/android/media_url_demuxer.cc ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698