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

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: 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 #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 // The codec specific data contains 2 bytes in the format of:
58 // oooo offf fccc c000
59 // o - audioObjectType
60 // f - samplingFreqIndex
61 // c - channelConfig
62 std::vector<uint8> GetCodecSpecificData() const;
63 #endif
64
55 // Size in bytes of the ADTS header added by ConvertEsdsToADTS(). 65 // Size in bytes of the ADTS header added by ConvertEsdsToADTS().
56 static const size_t kADTSHeaderSize = 7; 66 static const size_t kADTSHeaderSize = 7;
57 67
58 private: 68 private:
59 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; 69 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const;
60 bool SkipErrorSpecificConfig() const; 70 bool SkipErrorSpecificConfig() const;
61 bool SkipGASpecificConfig(BitReader* bit_reader) const; 71 bool SkipGASpecificConfig(BitReader* bit_reader) const;
62 72
63 // The following variables store the AAC specific configuration information 73 // The following variables store the AAC specific configuration information
64 // that are used to generate the ADTS header. 74 // that are used to generate the ADTS header.
65 uint8 profile_; 75 uint8 profile_;
66 uint8 frequency_index_; 76 uint8 frequency_index_;
67 uint8 channel_config_; 77 uint8 channel_config_;
68 78
69 // The following variables store audio configuration information that 79 // The following variables store audio configuration information that
70 // can be used by Chromium. They are based on the AAC specific 80 // can be used by Chromium. They are based on the AAC specific
71 // configuration but can be overridden by extensions in elementary 81 // configuration but can be overridden by extensions in elementary
72 // stream descriptor. 82 // stream descriptor.
73 int frequency_; 83 int frequency_;
74 int extension_frequency_; 84 int extension_frequency_;
75 ChannelLayout channel_layout_; 85 ChannelLayout channel_layout_;
76 }; 86 };
77 87
78 } // namespace mp4 88 } // namespace mp4
79 89
80 } // namespace media 90 } // namespace media
81 91
82 #endif // MEDIA_MP4_AAC_H_ 92 #endif // MEDIA_MP4_AAC_H_
OLDNEW
« no previous file with comments | « media/base/android/media_codec_bridge.cc ('k') | media/mp4/aac.cc » ('j') | media/mp4/aac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698