| OLD | NEW |
| 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_STREAM_PARSER_H_ | 5 #ifndef MEDIA_BASE_STREAM_PARSER_H_ |
| 6 #define MEDIA_BASE_STREAM_PARSER_H_ | 6 #define MEDIA_BASE_STREAM_PARSER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 class AudioDecoderConfig; | 18 class AudioDecoderConfig; |
| 19 class Buffer; | 19 class StreamParserBuffer; |
| 20 class VideoDecoderConfig; | 20 class VideoDecoderConfig; |
| 21 | 21 |
| 22 // Abstract interface for parsing media byte streams. | 22 // Abstract interface for parsing media byte streams. |
| 23 class MEDIA_EXPORT StreamParser { | 23 class MEDIA_EXPORT StreamParser { |
| 24 public: | 24 public: |
| 25 typedef std::deque<scoped_refptr<Buffer> > BufferQueue; | 25 typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue; |
| 26 | 26 |
| 27 StreamParser(); | 27 StreamParser(); |
| 28 virtual ~StreamParser(); | 28 virtual ~StreamParser(); |
| 29 | 29 |
| 30 // Indicates completion of parser initialization. | 30 // Indicates completion of parser initialization. |
| 31 // First parameter - Indicates initialization success. Set to true if | 31 // First parameter - Indicates initialization success. Set to true if |
| 32 // initialization was successful. False if an error | 32 // initialization was successful. False if an error |
| 33 // occurred. | 33 // occurred. |
| 34 // Second parameter - Indicates the stream duration. Only contains a valid | 34 // Second parameter - Indicates the stream duration. Only contains a valid |
| 35 // value if the first parameter is true. | 35 // value if the first parameter is true. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Returns true if the parse succeeds. | 81 // Returns true if the parse succeeds. |
| 82 virtual bool Parse(const uint8* buf, int size) = 0; | 82 virtual bool Parse(const uint8* buf, int size) = 0; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 DISALLOW_COPY_AND_ASSIGN(StreamParser); | 85 DISALLOW_COPY_AND_ASSIGN(StreamParser); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace media | 88 } // namespace media |
| 89 | 89 |
| 90 #endif // MEDIA_BASE_STREAM_PARSER_H_ | 90 #endif // MEDIA_BASE_STREAM_PARSER_H_ |
| OLD | NEW |