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

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

Issue 16114009: Add AAC codec specific data for MSE on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments 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
« no previous file with comments | « media/base/android/media_codec_bridge.cc ('k') | media/mp4/aac.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_MP4_AAC_H_ 5 #ifndef MEDIA_MP4_AAC_H_
6 #define MEDIA_MP4_AAC_H_ 6 #define MEDIA_MP4_AAC_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Returns the channel_layout value that should used in an 45 // Returns the channel_layout value that should used in an
46 // AudioDecoderConfig. 46 // AudioDecoderConfig.
47 ChannelLayout GetChannelLayout(bool sbr_in_mimetype) const; 47 ChannelLayout GetChannelLayout(bool sbr_in_mimetype) const;
48 48
49 // This function converts a raw AAC frame into an AAC frame with an ADTS 49 // This function converts a raw AAC frame into an AAC frame with an ADTS
50 // header. On success, the function returns true and stores the converted data 50 // header. On success, the function returns true and stores the converted data
51 // in the buffer. The function returns false on failure and leaves the buffer 51 // in the buffer. The function returns false on failure and leaves the buffer
52 // unchanged. 52 // unchanged.
53 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; 53 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const;
54 54
55 #if defined(OS_ANDROID)
56 // Returns the codec specific data needed by android MediaCodec.
57 std::vector<uint8> codec_specific_data() const {
58 return codec_specific_data_;
59 }
60 #endif
61
55 // Size in bytes of the ADTS header added by ConvertEsdsToADTS(). 62 // Size in bytes of the ADTS header added by ConvertEsdsToADTS().
56 static const size_t kADTSHeaderSize = 7; 63 static const size_t kADTSHeaderSize = 7;
57 64
58 private: 65 private:
59 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; 66 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const;
60 bool SkipErrorSpecificConfig() const; 67 bool SkipErrorSpecificConfig() const;
61 bool SkipGASpecificConfig(BitReader* bit_reader) const; 68 bool SkipGASpecificConfig(BitReader* bit_reader) const;
62 69
63 // The following variables store the AAC specific configuration information 70 // The following variables store the AAC specific configuration information
64 // that are used to generate the ADTS header. 71 // that are used to generate the ADTS header.
65 uint8 profile_; 72 uint8 profile_;
66 uint8 frequency_index_; 73 uint8 frequency_index_;
67 uint8 channel_config_; 74 uint8 channel_config_;
68 75
76 #if defined(OS_ANDROID)
77 // The codec specific data needed by the android MediaCodec.
78 std::vector<uint8> codec_specific_data_;
79 #endif
80
69 // The following variables store audio configuration information that 81 // The following variables store audio configuration information that
70 // can be used by Chromium. They are based on the AAC specific 82 // can be used by Chromium. They are based on the AAC specific
71 // configuration but can be overridden by extensions in elementary 83 // configuration but can be overridden by extensions in elementary
72 // stream descriptor. 84 // stream descriptor.
73 int frequency_; 85 int frequency_;
74 int extension_frequency_; 86 int extension_frequency_;
75 ChannelLayout channel_layout_; 87 ChannelLayout channel_layout_;
76 }; 88 };
77 89
78 } // namespace mp4 90 } // namespace mp4
79 91
80 } // namespace media 92 } // namespace media
81 93
82 #endif // MEDIA_MP4_AAC_H_ 94 #endif // MEDIA_MP4_AAC_H_
OLDNEW
« no previous file with comments | « media/base/android/media_codec_bridge.cc ('k') | media/mp4/aac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698