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

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

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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/formats/mp4/aac.h ('k') | media/formats/mp4/aac_unittest.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 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 #include "media/formats/mp4/aac.h" 5 #include "media/formats/mp4/aac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "media/base/bit_reader.h" 13 #include "media/base/bit_reader.h"
14 #include "media/formats/mp4/rcheck.h" 14 #include "media/formats/mp4/rcheck.h"
15 #include "media/formats/mpeg/adts_constants.h" 15 #include "media/formats/mpeg/adts_constants.h"
16 16
17 namespace media { 17 namespace media {
18 namespace mp4 { 18 namespace mp4 {
19 19
20 AAC::AAC() 20 AAC::AAC()
21 : profile_(0), frequency_index_(0), channel_config_(0), frequency_(0), 21 : profile_(0), frequency_index_(0), channel_config_(0), frequency_(0),
22 extension_frequency_(0), channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED) { 22 extension_frequency_(0), channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED) {
23 } 23 }
24 24
25 AAC::AAC(const AAC& other) = default; 25 AAC::AAC(const AAC& other) = default;
26 26
27 AAC::~AAC() { 27 AAC::~AAC() {
28 } 28 }
29 29
30 bool AAC::Parse(const std::vector<uint8_t>& data, 30 bool AAC::Parse(const std::vector<uint8_t>& data, MediaLog* media_log) {
31 const scoped_refptr<MediaLog>& media_log) {
32 #if defined(OS_ANDROID) 31 #if defined(OS_ANDROID)
33 codec_specific_data_ = data; 32 codec_specific_data_ = data;
34 #endif 33 #endif
35 if (data.empty()) 34 if (data.empty())
36 return false; 35 return false;
37 36
38 BitReader reader(&data[0], data.size()); 37 BitReader reader(&data[0], data.size());
39 uint8_t extension_type = 0; 38 uint8_t extension_type = 0;
40 bool ps_present = false; 39 bool ps_present = false;
41 uint8_t extension_frequency_index = 0xff; 40 uint8_t extension_frequency_index = 0xff;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 255
257 RCHECK(bit_reader->ReadBits(1, &dummy)); // extensionFlag3 256 RCHECK(bit_reader->ReadBits(1, &dummy)); // extensionFlag3
258 } 257 }
259 258
260 return true; 259 return true;
261 } 260 }
262 261
263 } // namespace mp4 262 } // namespace mp4
264 263
265 } // namespace media 264 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/aac.h ('k') | media/formats/mp4/aac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698