| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
| 6 #define MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 6 #define MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
| 17 #include "media/base/media_log.h" | 17 #include "media/base/media_log.h" |
| 18 #include "media/formats/webm/webm_content_encodings.h" | 18 #include "media/formats/webm/webm_content_encodings.h" |
| 19 #include "media/formats/webm/webm_parser.h" | 19 #include "media/formats/webm/webm_parser.h" |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 | 22 |
| 23 typedef std::vector<std::unique_ptr<ContentEncoding>> ContentEncodings; | 23 typedef std::vector<std::unique_ptr<ContentEncoding>> ContentEncodings; |
| 24 | 24 |
| 25 // Parser for WebM ContentEncodings element. | 25 // Parser for WebM ContentEncodings element. |
| 26 class MEDIA_EXPORT WebMContentEncodingsClient : public WebMParserClient { | 26 class MEDIA_EXPORT WebMContentEncodingsClient : public WebMParserClient { |
| 27 public: | 27 public: |
| 28 explicit WebMContentEncodingsClient(const scoped_refptr<MediaLog>& media_log); | 28 explicit WebMContentEncodingsClient(MediaLog* media_log); |
| 29 ~WebMContentEncodingsClient() override; | 29 ~WebMContentEncodingsClient() override; |
| 30 | 30 |
| 31 const ContentEncodings& content_encodings() const; | 31 const ContentEncodings& content_encodings() const; |
| 32 | 32 |
| 33 // WebMParserClient methods | 33 // WebMParserClient methods |
| 34 WebMParserClient* OnListStart(int id) override; | 34 WebMParserClient* OnListStart(int id) override; |
| 35 bool OnListEnd(int id) override; | 35 bool OnListEnd(int id) override; |
| 36 bool OnUInt(int id, int64_t val) override; | 36 bool OnUInt(int id, int64_t val) override; |
| 37 bool OnBinary(int id, const uint8_t* data, int size) override; | 37 bool OnBinary(int id, const uint8_t* data, int size) override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 scoped_refptr<MediaLog> media_log_; | 40 MediaLog* media_log_; |
| 41 std::unique_ptr<ContentEncoding> cur_content_encoding_; | 41 std::unique_ptr<ContentEncoding> cur_content_encoding_; |
| 42 bool content_encryption_encountered_; | 42 bool content_encryption_encountered_; |
| 43 ContentEncodings content_encodings_; | 43 ContentEncodings content_encodings_; |
| 44 | 44 |
| 45 // |content_encodings_| is ready. For debugging purpose. | 45 // |content_encodings_| is ready. For debugging purpose. |
| 46 bool content_encodings_ready_; | 46 bool content_encodings_ready_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(WebMContentEncodingsClient); | 48 DISALLOW_COPY_AND_ASSIGN(WebMContentEncodingsClient); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace media | 51 } // namespace media |
| 52 | 52 |
| 53 #endif // MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ | 53 #endif // MEDIA_FORMATS_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_ |
| OLD | NEW |