diff options
author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 18:00:39 +0000 |
---|---|---|
committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-24 18:00:39 +0000 |
commit | cd187678ad319a37e01acc91e80d0ebc419cecc4 (patch) | |
tree | 61ce8a715a363e9e2ecbe838a36ccd35f8d7668d /media/base | |
parent | cb1c54c4b0fcf8b36bded821dfea596d318e522c (diff) | |
download | chromium_src-cd187678ad319a37e01acc91e80d0ebc419cecc4.zip chromium_src-cd187678ad319a37e01acc91e80d0ebc419cecc4.tar.gz chromium_src-cd187678ad319a37e01acc91e80d0ebc419cecc4.tar.bz2 |
Refactoring StreamParser & StreamParserHost interfaces.
- Moving ByteQueue from ChunkDemuxer into WebMStreamParser to simplify handling
multiple StreamParsers.
- Replacing OnAudioConfig & OnVideoConfig with a single OnNewConfigs method to
make it easier to verify that initialization segments all contain the same
number and type of streams.
BUG=122909
TEST=Existing ChunkDemuxer tests.
Review URL: http://codereview.chromium.org/10205004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/stream_parser.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h index 8397fad1..daeee4b 100644 --- a/media/base/stream_parser.h +++ b/media/base/stream_parser.h @@ -27,13 +27,14 @@ class MEDIA_EXPORT StreamParserHost { StreamParserHost(); virtual ~StreamParserHost(); - // A new audio decoder configuration was encountered. All audio buffers - // after this call will be associated with this configuration. - virtual bool OnNewAudioConfig(const AudioDecoderConfig& config) = 0; - - // A new video decoder configuration was encountered. All video buffers - // after this call will be associated with this configuration. - virtual bool OnNewVideoConfig(const VideoDecoderConfig& config) = 0; + // New audio and/or video decoder configurations were encountered. All audio + // and video buffers after this call will be associated with these + // configurations. + // Returns true if the new configurations are accepted. + // Returns false if the new configurations are not supported and indicates + // that a parsing error should be signalled. + virtual bool OnNewConfigs(const AudioDecoderConfig& audio_config, + const VideoDecoderConfig& video_config) = 0; // New audio buffers have been received. virtual bool OnAudioBuffers(const BufferQueue& buffers) = 0; @@ -72,10 +73,8 @@ class MEDIA_EXPORT StreamParser { // Called when there is new data to parse. // - // Returns < 0 if the parse fails. - // Returns 0 if more data is needed. - // Returning > 0 indicates success & the number of bytes parsed. - virtual int Parse(const uint8* buf, int size) = 0; + // Returns true if the parse succeeds. + virtual bool Parse(const uint8* buf, int size) = 0; private: DISALLOW_COPY_AND_ASSIGN(StreamParser); |