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

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

Issue 208263018: Add SupportsConfigChanges() to DemuxerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audioconverterchunk
Patch Set: Make comment not specific to video_decoder_config(). Created 6 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
« no previous file with comments | « no previous file | media/base/fake_text_track_stream.h » ('j') | media/filters/decoder_stream.cc » ('J')
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 "media/base/media_export.h" 10 #include "media/base/media_export.h"
(...skipping 22 matching lines...) Expand all
33 // return. The second parameter MUST be NULL when this status is 33 // return. The second parameter MUST be NULL when this status is
34 // returned. 34 // returned.
35 // kConfigChange : Indicates that the AudioDecoderConfig or 35 // kConfigChange : Indicates that the AudioDecoderConfig or
36 // VideoDecoderConfig for the stream has changed. 36 // VideoDecoderConfig for the stream has changed.
37 // The DemuxerStream expects an audio_decoder_config() or 37 // The DemuxerStream expects an audio_decoder_config() or
38 // video_decoder_config() call before Read() will start 38 // video_decoder_config() call before Read() will start
39 // returning DecoderBuffers again. The decoder will need this 39 // returning DecoderBuffers again. The decoder will need this
40 // new configuration to properly decode the buffers read 40 // new configuration to properly decode the buffers read
41 // from this point forward. The second parameter MUST be NULL 41 // from this point forward. The second parameter MUST be NULL
42 // when this status is returned. 42 // when this status is returned.
43 // This will only be returned if SupportsConfigChanges()
44 // returns 'true' for this DemuxerStream.
43 enum Status { 45 enum Status {
44 kOk, 46 kOk,
45 kAborted, 47 kAborted,
46 kConfigChanged, 48 kConfigChanged,
47 }; 49 };
48 50
49 // Request a buffer to returned via the provided callback. 51 // Request a buffer to returned via the provided callback.
50 // 52 //
51 // The first parameter indicates the status of the read. 53 // The first parameter indicates the status of the read.
52 // The second parameter is non-NULL and contains media data 54 // The second parameter is non-NULL and contains media data
53 // or the end of the stream if the first parameter is kOk. NULL otherwise. 55 // or the end of the stream if the first parameter is kOk. NULL otherwise.
54 typedef base::Callback<void(Status, 56 typedef base::Callback<void(Status,
55 const scoped_refptr<DecoderBuffer>&)>ReadCB; 57 const scoped_refptr<DecoderBuffer>&)>ReadCB;
56 virtual void Read(const ReadCB& read_cb) = 0; 58 virtual void Read(const ReadCB& read_cb) = 0;
57 59
58 // Returns the audio decoder configuration. It is an error to call this method 60 // Returns the audio decoder configuration. It is an error to call this method
59 // if type() != AUDIO. 61 // if type() != AUDIO.
60 virtual AudioDecoderConfig audio_decoder_config() = 0; 62 virtual AudioDecoderConfig audio_decoder_config() = 0;
61 63
62 // Returns the video decoder configuration. It is an error to call this method 64 // Returns the video decoder configuration. It is an error to call this method
63 // if type() != VIDEO. 65 // if type() != VIDEO.
64 virtual VideoDecoderConfig video_decoder_config() = 0; 66 virtual VideoDecoderConfig video_decoder_config() = 0;
65 67
66 // Returns the type of stream. 68 // Returns the type of stream.
67 virtual Type type() = 0; 69 virtual Type type() = 0;
68 70
69 virtual void EnableBitstreamConverter() = 0; 71 virtual void EnableBitstreamConverter() = 0;
70 72
73 // Whether or not this DemuxerStream allows midstream configuration changes.
74 //
75 // A DemuxerStream that returns 'true' to this may return the 'kConfigChange'
76 // status from a Read() call. In this case the client is expected to be
77 // capable of taking appropriate action to handle config changes. Otherwise
78 // audio_decoder_config() and video_decoder_config()'s return values are
79 // guaranteed to remain constant, and the client may make optimizations based
80 // on this.
81 virtual bool SupportsConfigChanges() = 0;
82
71 protected: 83 protected:
72 // Only allow concrete implementations to get deleted. 84 // Only allow concrete implementations to get deleted.
73 virtual ~DemuxerStream(); 85 virtual ~DemuxerStream();
74 }; 86 };
75 87
76 } // namespace media 88 } // namespace media
77 89
78 #endif // MEDIA_BASE_DEMUXER_STREAM_H_ 90 #endif // MEDIA_BASE_DEMUXER_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/fake_text_track_stream.h » ('j') | media/filters/decoder_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698