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

Side by Side Diff: media/base/demuxer_stream.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/demuxer.h ('k') | media/base/fake_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_STREAM_H_ 5 #ifndef MEDIA_BASE_DEMUXER_STREAM_H_
6 #define MEDIA_BASE_DEMUXER_STREAM_H_ 6 #define MEDIA_BASE_DEMUXER_STREAM_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/time/time.h"
10 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
11 #include "media/base/video_rotation.h" 12 #include "media/base/video_rotation.h"
12 13
13 namespace media { 14 namespace media {
14 15
15 class AudioDecoderConfig; 16 class AudioDecoderConfig;
16 class DecoderBuffer; 17 class DecoderBuffer;
17 class VideoDecoderConfig; 18 class VideoDecoderConfig;
18 19
19 class MEDIA_EXPORT DemuxerStream { 20 class MEDIA_EXPORT DemuxerStream {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange' 85 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange'
85 // status from a Read() call. In this case the client is expected to be 86 // status from a Read() call. In this case the client is expected to be
86 // capable of taking appropriate action to handle config changes. Otherwise 87 // capable of taking appropriate action to handle config changes. Otherwise
87 // audio_decoder_config() and video_decoder_config()'s return values are 88 // audio_decoder_config() and video_decoder_config()'s return values are
88 // guaranteed to remain constant, and the client may make optimizations based 89 // guaranteed to remain constant, and the client may make optimizations based
89 // on this. 90 // on this.
90 virtual bool SupportsConfigChanges() = 0; 91 virtual bool SupportsConfigChanges() = 0;
91 92
92 virtual VideoRotation video_rotation() = 0; 93 virtual VideoRotation video_rotation() = 0;
93 94
95 // Indicates whether a DemuxerStream is currently enabled (i.e. should be
96 // decoded and rendered) or not.
97 virtual bool enabled() const = 0;
98
99 // Disables and re-enables the stream. Reading from a disabled stream will
100 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs
101 // to know the current playback position |timestamp| in order to resume
102 // reading data from a key frame preceeding the |timestamp|.
103 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0;
104
105 using StreamRestartedCB =
106 base::Callback<void(DemuxerStream*, base::TimeDelta)>;
107 virtual void SetStreamRestartedCB(const StreamRestartedCB& cb) = 0;
108
94 protected: 109 protected:
95 // Only allow concrete implementations to get deleted. 110 // Only allow concrete implementations to get deleted.
96 virtual ~DemuxerStream(); 111 virtual ~DemuxerStream();
97 }; 112 };
98 113
99 } // namespace media 114 } // namespace media
100 115
101 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ 116 #endif // MEDIA_BASE_DEMUXER_STREAM_H_
OLDNEW
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/fake_demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698