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

Side by Side Diff: media/base/audio_decoder_config.h

Issue 1469353010: Configure MediaCodec with CDM in ADVA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 years, 11 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
« no previous file with comments | « media/base/android/demuxer_stream_player_params.cc ('k') | media/base/audio_decoder_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_BASE_AUDIO_DECODER_CONFIG_H_ 5 #ifndef MEDIA_BASE_AUDIO_DECODER_CONFIG_H_
6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 kCodecAC3 = 16, 42 kCodecAC3 = 16,
43 // DO NOT ADD RANDOM AUDIO CODECS! 43 // DO NOT ADD RANDOM AUDIO CODECS!
44 // 44 //
45 // The only acceptable time to add a new codec is if there is production code 45 // The only acceptable time to add a new codec is if there is production code
46 // that uses said codec in the same CL. 46 // that uses said codec in the same CL.
47 47
48 // Must always be equal to the largest entry ever logged. 48 // Must always be equal to the largest entry ever logged.
49 kAudioCodecMax = kCodecAC3, 49 kAudioCodecMax = kCodecAC3,
50 }; 50 };
51 51
52 std::string MEDIA_EXPORT GetCodecName(AudioCodec codec);
53
52 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of 54 // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of
53 // |bits_per_channel|, we should switch over since bits are generally confusing 55 // |bits_per_channel|, we should switch over since bits are generally confusing
54 // to work with. 56 // to work with.
55 class MEDIA_EXPORT AudioDecoderConfig { 57 class MEDIA_EXPORT AudioDecoderConfig {
56 public: 58 public:
57 // Constructs an uninitialized object. Clients should call Initialize() with 59 // Constructs an uninitialized object. Clients should call Initialize() with
58 // appropriate values before using. 60 // appropriate values before using.
59 AudioDecoderConfig(); 61 AudioDecoderConfig();
60 62
61 // Constructs an initialized object. 63 // Constructs an initialized object.
(...skipping 21 matching lines...) Expand all
83 bool IsValidConfig() const; 85 bool IsValidConfig() const;
84 86
85 // Returns true if all fields in |config| match this config. 87 // Returns true if all fields in |config| match this config.
86 // Note: The contents of |extra_data_| are compared not the raw pointers. 88 // Note: The contents of |extra_data_| are compared not the raw pointers.
87 bool Matches(const AudioDecoderConfig& config) const; 89 bool Matches(const AudioDecoderConfig& config) const;
88 90
89 // Returns a human-readable string describing |*this|. For debugging & test 91 // Returns a human-readable string describing |*this|. For debugging & test
90 // output only. 92 // output only.
91 std::string AsHumanReadableString() const; 93 std::string AsHumanReadableString() const;
92 94
93 std::string GetHumanReadableCodecName() const;
94
95 AudioCodec codec() const { return codec_; } 95 AudioCodec codec() const { return codec_; }
96 int bits_per_channel() const { return bytes_per_channel_ * 8; } 96 int bits_per_channel() const { return bytes_per_channel_ * 8; }
97 int bytes_per_channel() const { return bytes_per_channel_; } 97 int bytes_per_channel() const { return bytes_per_channel_; }
98 ChannelLayout channel_layout() const { return channel_layout_; } 98 ChannelLayout channel_layout() const { return channel_layout_; }
99 int samples_per_second() const { return samples_per_second_; } 99 int samples_per_second() const { return samples_per_second_; }
100 SampleFormat sample_format() const { return sample_format_; } 100 SampleFormat sample_format() const { return sample_format_; }
101 int bytes_per_frame() const { return bytes_per_frame_; } 101 int bytes_per_frame() const { return bytes_per_frame_; }
102 base::TimeDelta seek_preroll() const { return seek_preroll_; } 102 base::TimeDelta seek_preroll() const { return seek_preroll_; }
103 int codec_delay() const { return codec_delay_; } 103 int codec_delay() const { return codec_delay_; }
104 104
(...skipping 26 matching lines...) Expand all
131 int codec_delay_; 131 int codec_delay_;
132 132
133 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler 133 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler
134 // generated copy constructor and assignment operator. Since the extra data is 134 // generated copy constructor and assignment operator. Since the extra data is
135 // typically small, the performance impact is minimal. 135 // typically small, the performance impact is minimal.
136 }; 136 };
137 137
138 } // namespace media 138 } // namespace media
139 139
140 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ 140 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_
OLDNEW
« no previous file with comments | « media/base/android/demuxer_stream_player_params.cc ('k') | media/base/audio_decoder_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698