cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / media / webm / webm_audio_client.h
blob1338f5cbd66e78935c5b8de9133ce626b765979d
1 // Copyright (c) 2013 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_AUDIO_CLIENT_H_
6 #define MEDIA_WEBM_WEBM_AUDIO_CLIENT_H_
8 #include <string>
9 #include <vector>
11 #include "media/base/media_log.h"
12 #include "media/webm/webm_parser.h"
14 namespace media {
15 class AudioDecoderConfig;
17 // Helper class used to parse an Audio element inside a TrackEntry element.
18 class WebMAudioClient : public WebMParserClient {
19 public:
20 explicit WebMAudioClient(const LogCB& log_cb);
21 virtual ~WebMAudioClient();
23 // Reset this object's state so it can process a new audio track element.
24 void Reset();
26 // Initialize |config| with the data in |codec_id|, |codec_private|,
27 // |is_encrypted| and the fields parsed from the last audio track element this
28 // object was used to parse.
29 // Returns true if |config| was successfully initialized.
30 // Returns false if there was unexpected values in the provided parameters or
31 // audio track element fields.
32 bool InitializeConfig(const std::string& codec_id,
33 const std::vector<uint8>& codec_private,
34 bool is_encrypted,
35 AudioDecoderConfig* config);
37 private:
38 // WebMParserClient implementation.
39 virtual bool OnUInt(int id, int64 val) OVERRIDE;
40 virtual bool OnFloat(int id, double val) OVERRIDE;
42 LogCB log_cb_;
43 int channels_;
44 double samples_per_second_;
45 double output_samples_per_second_;
47 DISALLOW_COPY_AND_ASSIGN(WebMAudioClient);
50 } // namespace media
52 #endif // MEDIA_WEBM_WEBM_AUDIO_CLIENT_H_