From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- chromium/media/formats/webm/webm_audio_client.h | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 chromium/media/formats/webm/webm_audio_client.h (limited to 'chromium/media/formats/webm/webm_audio_client.h') diff --git a/chromium/media/formats/webm/webm_audio_client.h b/chromium/media/formats/webm/webm_audio_client.h new file mode 100644 index 00000000000..a723b0d1d48 --- /dev/null +++ b/chromium/media/formats/webm/webm_audio_client.h @@ -0,0 +1,54 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_ +#define MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_ + +#include +#include + +#include "media/base/media_log.h" +#include "media/formats/webm/webm_parser.h" + +namespace media { +class AudioDecoderConfig; + +// Helper class used to parse an Audio element inside a TrackEntry element. +class WebMAudioClient : public WebMParserClient { + public: + explicit WebMAudioClient(const LogCB& log_cb); + virtual ~WebMAudioClient(); + + // Reset this object's state so it can process a new audio track element. + void Reset(); + + // Initialize |config| with the data in |codec_id|, |codec_private|, + // |is_encrypted| and the fields parsed from the last audio track element this + // object was used to parse. + // Returns true if |config| was successfully initialized. + // Returns false if there was unexpected values in the provided parameters or + // audio track element fields. + bool InitializeConfig(const std::string& codec_id, + const std::vector& codec_private, + const int64 seek_preroll, + const int64 codec_delay, + bool is_encrypted, + AudioDecoderConfig* config); + + private: + // WebMParserClient implementation. + virtual bool OnUInt(int id, int64 val) OVERRIDE; + virtual bool OnFloat(int id, double val) OVERRIDE; + + LogCB log_cb_; + int channels_; + double samples_per_second_; + double output_samples_per_second_; + + DISALLOW_COPY_AND_ASSIGN(WebMAudioClient); +}; + +} // namespace media + +#endif // MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_ -- cgit v1.2.3