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

Side by Side Diff: media/base/audio_buffer.cc

Issue 2503233003: Add enumerations for compressed (E)AC3 sample format (Closed)
Patch Set: Fix proto Created 4 years, 1 month 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/base/android/sdk_media_codec_bridge.cc ('k') | media/base/audio_parameters.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/base/audio_buffer.h" 5 #include "media/base/audio_buffer.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 case kSampleFormatS32: 281 case kSampleFormatS32:
282 case kSampleFormatF32: { 282 case kSampleFormatF32: {
283 // Interleaved data can be shifted all at once. 283 // Interleaved data can be shifted all at once.
284 const int frame_size = channel_count_ * bytes_per_channel; 284 const int frame_size = channel_count_ * bytes_per_channel;
285 memmove(channel_data_[0] + start * frame_size, 285 memmove(channel_data_[0] + start * frame_size,
286 channel_data_[0] + end * frame_size, 286 channel_data_[0] + end * frame_size,
287 frame_size * frames_to_copy); 287 frame_size * frames_to_copy);
288 break; 288 break;
289 } 289 }
290 case kUnknownSampleFormat: 290 case kUnknownSampleFormat:
291 case kSampleFormatAc3:
292 case kSampleFormatEac3:
291 NOTREACHED() << "Invalid sample format!"; 293 NOTREACHED() << "Invalid sample format!";
292 } 294 }
293 } else { 295 } else {
294 CHECK_EQ(frames_to_copy, 0); 296 CHECK_EQ(frames_to_copy, 0);
295 } 297 }
296 298
297 // Trim the leftover data off the end of the buffer and update duration. 299 // Trim the leftover data off the end of the buffer and update duration.
298 TrimEnd(frames_to_trim); 300 TrimEnd(frames_to_trim);
299 } 301 }
300 302
301 } // namespace media 303 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/sdk_media_codec_bridge.cc ('k') | media/base/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698