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_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 5 #ifndef MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
6 #define MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 6 #define MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 14 #include "media/base/media_log.h" |
13 #include "media/webm/webm_content_encodings.h" | 15 #include "media/webm/webm_content_encodings.h" |
14 #include "media/webm/webm_parser.h" | 16 #include "media/webm/webm_parser.h" |
15 | 17 |
16 namespace media { | 18 namespace media { |
17 | 19 |
18 typedef std::vector<ContentEncoding*> ContentEncodings; | 20 typedef std::vector<ContentEncoding*> ContentEncodings; |
19 | 21 |
20 // Parser for WebM ContentEncodings element. | 22 // Parser for WebM ContentEncodings element. |
21 class MEDIA_EXPORT WebMContentEncodingsClient : public WebMParserClient { | 23 class MEDIA_EXPORT WebMContentEncodingsClient : public WebMParserClient { |
22 public: | 24 public: |
23 WebMContentEncodingsClient(); | 25 explicit WebMContentEncodingsClient(const LogCB& log_cb); |
24 virtual ~WebMContentEncodingsClient(); | 26 virtual ~WebMContentEncodingsClient(); |
25 | 27 |
26 const ContentEncodings& content_encodings() const; | 28 const ContentEncodings& content_encodings() const; |
27 | 29 |
28 // WebMParserClient methods | 30 // WebMParserClient methods |
29 virtual WebMParserClient* OnListStart(int id) OVERRIDE; | 31 virtual WebMParserClient* OnListStart(int id) OVERRIDE; |
30 virtual bool OnListEnd(int id) OVERRIDE; | 32 virtual bool OnListEnd(int id) OVERRIDE; |
31 virtual bool OnUInt(int id, int64 val) OVERRIDE; | 33 virtual bool OnUInt(int id, int64 val) OVERRIDE; |
32 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; | 34 virtual bool OnBinary(int id, const uint8* data, int size) OVERRIDE; |
33 | 35 |
34 private: | 36 private: |
| 37 LogCB log_cb_; |
35 scoped_ptr<ContentEncoding> cur_content_encoding_; | 38 scoped_ptr<ContentEncoding> cur_content_encoding_; |
36 bool content_encryption_encountered_; | 39 bool content_encryption_encountered_; |
37 ContentEncodings content_encodings_; | 40 ContentEncodings content_encodings_; |
38 | 41 |
39 // |content_encodings_| is ready. For debugging purpose. | 42 // |content_encodings_| is ready. For debugging purpose. |
40 bool content_encodings_ready_; | 43 bool content_encodings_ready_; |
41 | 44 |
42 DISALLOW_COPY_AND_ASSIGN(WebMContentEncodingsClient); | 45 DISALLOW_COPY_AND_ASSIGN(WebMContentEncodingsClient); |
43 }; | 46 }; |
44 | 47 |
45 } // namespace media | 48 } // namespace media |
46 | 49 |
47 #endif // MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 50 #endif // MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
OLD | NEW |