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

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: Updated comments + dchecks in ffmpeg demux stream Created 4 years, 6 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_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;
xhwang 2016/06/04 00:09:43 nit: add empty line
servolk 2016/06/09 21:00:13 Done.
98 // Disables and re-enables the stream. Reading from a disabled stream will
99 // return an end-of-stream (EOS) buffer. When a stream is re-enabled, it needs
100 // to know the current playback position |timestamp| in order to resume
101 // reading data from a key frame preceeding the |timestamp|.
102 virtual void set_enabled(bool enabled, base::TimeDelta timestamp) = 0;
103
94 protected: 104 protected:
95 // Only allow concrete implementations to get deleted. 105 // Only allow concrete implementations to get deleted.
96 virtual ~DemuxerStream(); 106 virtual ~DemuxerStream();
97 }; 107 };
98 108
99 } // namespace media 109 } // namespace media
100 110
101 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ 111 #endif // MEDIA_BASE_DEMUXER_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698