Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: media/formats/webm/webm_audio_client.h

Issue 1490613005: media config: expand is_encrypted to a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ddorwin comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_AUDIO_CLIENT_H_ 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_ 6 #define MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "media/base/media_log.h" 14 #include "media/base/media_log.h"
15 #include "media/formats/webm/webm_parser.h" 15 #include "media/formats/webm/webm_parser.h"
16 16
17 namespace media { 17 namespace media {
18 class AudioDecoderConfig; 18 class AudioDecoderConfig;
19 class EncryptionScheme;
19 20
20 // Helper class used to parse an Audio element inside a TrackEntry element. 21 // Helper class used to parse an Audio element inside a TrackEntry element.
21 class WebMAudioClient : public WebMParserClient { 22 class WebMAudioClient : public WebMParserClient {
22 public: 23 public:
23 explicit WebMAudioClient(const scoped_refptr<MediaLog>& media_log); 24 explicit WebMAudioClient(const scoped_refptr<MediaLog>& media_log);
24 ~WebMAudioClient() override; 25 ~WebMAudioClient() override;
25 26
26 // Reset this object's state so it can process a new audio track element. 27 // Reset this object's state so it can process a new audio track element.
27 void Reset(); 28 void Reset();
28 29
29 // Initialize |config| with the data in |codec_id|, |codec_private|, 30 // Initialize |config| with the data in |codec_id|, |codec_private|,
30 // |is_encrypted| and the fields parsed from the last audio track element this 31 // |encryption_scheme| and the fields parsed from the last audio track element
31 // object was used to parse. 32 // this object was used to parse.
32 // Returns true if |config| was successfully initialized. 33 // Returns true if |config| was successfully initialized.
33 // Returns false if there was unexpected values in the provided parameters or 34 // Returns false if there was unexpected values in the provided parameters or
34 // audio track element fields. 35 // audio track element fields.
35 bool InitializeConfig(const std::string& codec_id, 36 bool InitializeConfig(const std::string& codec_id,
36 const std::vector<uint8_t>& codec_private, 37 const std::vector<uint8_t>& codec_private,
37 const int64_t seek_preroll, 38 const int64_t seek_preroll,
38 const int64_t codec_delay, 39 const int64_t codec_delay,
39 bool is_encrypted, 40 const EncryptionScheme& encryption_scheme,
40 AudioDecoderConfig* config); 41 AudioDecoderConfig* config);
41 42
42 private: 43 private:
43 // WebMParserClient implementation. 44 // WebMParserClient implementation.
44 bool OnUInt(int id, int64_t val) override; 45 bool OnUInt(int id, int64_t val) override;
45 bool OnFloat(int id, double val) override; 46 bool OnFloat(int id, double val) override;
46 47
47 scoped_refptr<MediaLog> media_log_; 48 scoped_refptr<MediaLog> media_log_;
48 int channels_; 49 int channels_;
49 double samples_per_second_; 50 double samples_per_second_;
50 double output_samples_per_second_; 51 double output_samples_per_second_;
51 52
52 DISALLOW_COPY_AND_ASSIGN(WebMAudioClient); 53 DISALLOW_COPY_AND_ASSIGN(WebMAudioClient);
53 }; 54 };
54 55
55 } // namespace media 56 } // namespace media
56 57
57 #endif // MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_ 58 #endif // MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698