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

Side by Side Diff: chromecast/public/media/decoder_config.h

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test + android fixes Created 5 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_ 5 #ifndef CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_
6 #define CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_ 6 #define CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "chromecast/public/media/stream_id.h" 11 #include "stream_id.h"
12 12
13 namespace chromecast { 13 namespace chromecast {
14 namespace media { 14 namespace media {
15 15
16 // Maximum audio bytes per sample. 16 // Maximum audio bytes per sample.
17 static const int kMaxBytesPerSample = 4; 17 static const int kMaxBytesPerSample = 4;
18 18
19 // Maximum audio sampling rate. 19 // Maximum audio sampling rate.
20 static const int kMaxSampleRate = 192000; 20 static const int kMaxSampleRate = 192000;
21 21
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 struct AudioConfig { 91 struct AudioConfig {
92 AudioConfig() 92 AudioConfig()
93 : id(kPrimary), 93 : id(kPrimary),
94 codec(kAudioCodecUnknown), 94 codec(kAudioCodecUnknown),
95 sample_format(kUnknownSampleFormat), 95 sample_format(kUnknownSampleFormat),
96 bytes_per_channel(0), 96 bytes_per_channel(0),
97 channel_number(0), 97 channel_number(0),
98 samples_per_second(0), 98 samples_per_second(0),
99 extra_data(nullptr), 99 extra_data(nullptr),
100 extra_data_size(0), 100 extra_data_size(0),
101 is_encrypted(false) {} 101 is_encrypted(false) {}
byungchul 2015/07/27 18:22:23 does chorimum allow this inline ctor? It looks a c
halliwell 2015/07/28 02:19:36 it does. This has been in for a while now.
102 102
103 // Stream id. 103 // Stream id.
104 StreamId id; 104 StreamId id;
105 // Audio codec. 105 // Audio codec.
106 AudioCodec codec; 106 AudioCodec codec;
107 // The format of each audio sample. 107 // The format of each audio sample.
108 SampleFormat sample_format; 108 SampleFormat sample_format;
109 // Number of bytes in each channel. 109 // Number of bytes in each channel.
110 int bytes_per_channel; 110 int bytes_per_channel;
111 // Number of channels in this audio stream. 111 // Number of channels in this audio stream.
(...skipping 14 matching lines...) Expand all
126 // create a new object to reset the configuration and use IsValidConfig() to 126 // create a new object to reset the configuration and use IsValidConfig() to
127 // determine if the configuration is still valid or not. 127 // determine if the configuration is still valid or not.
128 struct VideoConfig { 128 struct VideoConfig {
129 VideoConfig() 129 VideoConfig()
130 : id(kPrimary), 130 : id(kPrimary),
131 codec(kVideoCodecUnknown), 131 codec(kVideoCodecUnknown),
132 profile(kVideoProfileUnknown), 132 profile(kVideoProfileUnknown),
133 additional_config(nullptr), 133 additional_config(nullptr),
134 extra_data(nullptr), 134 extra_data(nullptr),
135 extra_data_size(0), 135 extra_data_size(0),
136 is_encrypted(false) {} 136 is_encrypted(false) {}
byungchul 2015/07/27 18:22:23 ditto
halliwell 2015/07/28 02:19:36 ditto! :)
137 137
138 // Stream Id. 138 // Stream Id.
139 StreamId id; 139 StreamId id;
140 // Video codec. 140 // Video codec.
141 VideoCodec codec; 141 VideoCodec codec;
142 // Video codec profile. 142 // Video codec profile.
143 VideoProfile profile; 143 VideoProfile profile;
144 // Both |additional_config| and |extra_data| are the pointers to the object 144 // Both |additional_config| and |extra_data| are the pointers to the object
145 // memory that are allocated outside this structure. Consumers of the 145 // memory that are allocated outside this structure. Consumers of the
146 // structure should make a copy if it is expected to be used beyond the 146 // structure should make a copy if it is expected to be used beyond the
(...skipping 28 matching lines...) Expand all
175 inline bool IsValidConfig(const VideoConfig& config) { 175 inline bool IsValidConfig(const VideoConfig& config) {
176 return config.codec >= kVideoCodecMin && 176 return config.codec >= kVideoCodecMin &&
177 config.codec <= kVideoCodecMax && 177 config.codec <= kVideoCodecMax &&
178 config.codec != kVideoCodecUnknown; 178 config.codec != kVideoCodecUnknown;
179 } 179 }
180 180
181 } // namespace media 181 } // namespace media
182 } // namespace chromecast 182 } // namespace chromecast
183 183
184 #endif // CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_ 184 #endif // CHROMECAST_PUBLIC_MEDIA_DECODER_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698