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
3 // found in the LICENSE file.
5 #ifndef MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_
6 #define MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "media/base/media_export.h"
14 #include "media/base/media_log.h"
15 #include "media/webm/webm_content_encodings.h"
16 #include "media/webm/webm_parser.h"
20 typedef std::vector
<ContentEncoding
*> ContentEncodings
;
22 // Parser for WebM ContentEncodings element.
23 class MEDIA_EXPORT WebMContentEncodingsClient
: public WebMParserClient
{
25 explicit WebMContentEncodingsClient(const LogCB
& log_cb
);
26 virtual ~WebMContentEncodingsClient();
28 const ContentEncodings
& content_encodings() const;
30 // WebMParserClient methods
31 virtual WebMParserClient
* OnListStart(int id
) OVERRIDE
;
32 virtual bool OnListEnd(int id
) OVERRIDE
;
33 virtual bool OnUInt(int id
, int64 val
) OVERRIDE
;
34 virtual bool OnBinary(int id
, const uint8
* data
, int size
) OVERRIDE
;
38 scoped_ptr
<ContentEncoding
> cur_content_encoding_
;
39 bool content_encryption_encountered_
;
40 ContentEncodings content_encodings_
;
42 // |content_encodings_| is ready. For debugging purpose.
43 bool content_encodings_ready_
;
45 DISALLOW_COPY_AND_ASSIGN(WebMContentEncodingsClient
);
50 #endif // MEDIA_WEBM_WEBM_CONTENT_ENCODINGS_CLIENT_H_