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

Side by Side Diff: media/mp4/aac.cc

Issue 16114009: Add AAC codec specific data for MSE on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 #include "media/mp4/aac.h" 5 #include "media/mp4/aac.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/bit_reader.h" 10 #include "media/base/bit_reader.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 adts[2] = ((profile_ - 1) << 6) + (frequency_index_ << 2) + 182 adts[2] = ((profile_ - 1) << 6) + (frequency_index_ << 2) +
183 (channel_config_ >> 2); 183 (channel_config_ >> 2);
184 adts[3] = ((channel_config_ & 0x3) << 6) + (size >> 11); 184 adts[3] = ((channel_config_ & 0x3) << 6) + (size >> 11);
185 adts[4] = (size & 0x7ff) >> 3; 185 adts[4] = (size & 0x7ff) >> 3;
186 adts[5] = ((size & 7) << 5) + 0x1f; 186 adts[5] = ((size & 7) << 5) + 0x1f;
187 adts[6] = 0xfc; 187 adts[6] = 0xfc;
188 188
189 return true; 189 return true;
190 } 190 }
191 191
192 #if defined(OS_ANDROID)
193 std::vector<uint8> AAC::GetCodecSpecificData() const {
194 std::vector<uint8> csd;
acolwell GONE FROM CHROMIUM 2013/05/29 22:37:25 I don't believe this is sufficient for all cases.
qinmin 2013/05/30 03:07:55 Done.
195 csd.push_back(profile_ << 3 | frequency_index_ >> 1);
196 csd.push_back((frequency_index_ & 0x01) << 7 | channel_config_ << 3);
197 return csd;
198 }
199 #endif
200
192 // Currently this function only support GASpecificConfig defined in 201 // Currently this function only support GASpecificConfig defined in
193 // ISO 14496 Part 3 Table 4.1 - Syntax of GASpecificConfig() 202 // ISO 14496 Part 3 Table 4.1 - Syntax of GASpecificConfig()
194 bool AAC::SkipDecoderGASpecificConfig(BitReader* bit_reader) const { 203 bool AAC::SkipDecoderGASpecificConfig(BitReader* bit_reader) const {
195 switch (profile_) { 204 switch (profile_) {
196 case 1: 205 case 1:
197 case 2: 206 case 2:
198 case 3: 207 case 3:
199 case 4: 208 case 4:
200 case 6: 209 case 6:
201 case 7: 210 case 7:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 272
264 RCHECK(bit_reader->ReadBits(1, &dummy)); // extensionFlag3 273 RCHECK(bit_reader->ReadBits(1, &dummy)); // extensionFlag3
265 } 274 }
266 275
267 return true; 276 return true;
268 } 277 }
269 278
270 } // namespace mp4 279 } // namespace mp4
271 280
272 } // namespace media 281 } // namespace media
OLDNEW
« no previous file with comments | « media/mp4/aac.h ('k') | media/mp4/mp4_stream_parser.cc » ('j') | media/mp4/mp4_stream_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698