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

Side by Side Diff: media/ffmpeg/ffmpeg_common.cc

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 years, 9 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/channel_layout.h ('k') | no next file » | 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 #include "media/ffmpeg/ffmpeg_common.h" 5 #include "media/ffmpeg/ffmpeg_common.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/audio_decoder_config.h" 8 #include "media/base/audio_decoder_config.h"
9 #include "media/base/video_decoder_config.h" 9 #include "media/base/video_decoder_config.h"
10 10
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 switch (layout) { 291 switch (layout) {
292 case AV_CH_LAYOUT_MONO: 292 case AV_CH_LAYOUT_MONO:
293 return CHANNEL_LAYOUT_MONO; 293 return CHANNEL_LAYOUT_MONO;
294 case AV_CH_LAYOUT_STEREO: 294 case AV_CH_LAYOUT_STEREO:
295 return CHANNEL_LAYOUT_STEREO; 295 return CHANNEL_LAYOUT_STEREO;
296 case AV_CH_LAYOUT_2_1: 296 case AV_CH_LAYOUT_2_1:
297 return CHANNEL_LAYOUT_2_1; 297 return CHANNEL_LAYOUT_2_1;
298 case AV_CH_LAYOUT_SURROUND: 298 case AV_CH_LAYOUT_SURROUND:
299 return CHANNEL_LAYOUT_SURROUND; 299 return CHANNEL_LAYOUT_SURROUND;
300 case AV_CH_LAYOUT_4POINT0: 300 case AV_CH_LAYOUT_4POINT0:
301 return CHANNEL_LAYOUT_4POINT0; 301 return CHANNEL_LAYOUT_4_0;
302 case AV_CH_LAYOUT_2_2: 302 case AV_CH_LAYOUT_2_2:
303 return CHANNEL_LAYOUT_2_2; 303 return CHANNEL_LAYOUT_2_2;
304 case AV_CH_LAYOUT_QUAD: 304 case AV_CH_LAYOUT_QUAD:
305 return CHANNEL_LAYOUT_QUAD; 305 return CHANNEL_LAYOUT_QUAD;
306 case AV_CH_LAYOUT_5POINT0: 306 case AV_CH_LAYOUT_5POINT0:
307 return CHANNEL_LAYOUT_5POINT0; 307 return CHANNEL_LAYOUT_5_0;
308 case AV_CH_LAYOUT_5POINT1: 308 case AV_CH_LAYOUT_5POINT1:
309 return CHANNEL_LAYOUT_5POINT1; 309 return CHANNEL_LAYOUT_5_1;
310 case AV_CH_LAYOUT_5POINT0_BACK: 310 case AV_CH_LAYOUT_5POINT0_BACK:
311 return CHANNEL_LAYOUT_5POINT0_BACK; 311 return CHANNEL_LAYOUT_5_0_BACK;
312 case AV_CH_LAYOUT_5POINT1_BACK: 312 case AV_CH_LAYOUT_5POINT1_BACK:
313 return CHANNEL_LAYOUT_5POINT1_BACK; 313 return CHANNEL_LAYOUT_5_1_BACK;
314 case AV_CH_LAYOUT_7POINT0: 314 case AV_CH_LAYOUT_7POINT0:
315 return CHANNEL_LAYOUT_7POINT0; 315 return CHANNEL_LAYOUT_7_0;
316 case AV_CH_LAYOUT_7POINT1: 316 case AV_CH_LAYOUT_7POINT1:
317 return CHANNEL_LAYOUT_7POINT1; 317 return CHANNEL_LAYOUT_7_1;
318 case AV_CH_LAYOUT_7POINT1_WIDE: 318 case AV_CH_LAYOUT_7POINT1_WIDE:
319 return CHANNEL_LAYOUT_7POINT1_WIDE; 319 return CHANNEL_LAYOUT_7_1_WIDE;
320 case AV_CH_LAYOUT_STEREO_DOWNMIX: 320 case AV_CH_LAYOUT_STEREO_DOWNMIX:
321 return CHANNEL_LAYOUT_STEREO_DOWNMIX; 321 return CHANNEL_LAYOUT_STEREO_DOWNMIX;
322 default: 322 default:
323 // FFmpeg channel_layout is 0 for .wav and .mp3. We know mono and stereo 323 // FFmpeg channel_layout is 0 for .wav and .mp3. We know mono and stereo
324 // from the number of channels, otherwise report errors. 324 // from the number of channels, otherwise report errors.
325 if (channels == 1) 325 if (channels == 1)
326 return CHANNEL_LAYOUT_MONO; 326 return CHANNEL_LAYOUT_MONO;
327 if (channels == 2) 327 if (channels == 2)
328 return CHANNEL_LAYOUT_STEREO; 328 return CHANNEL_LAYOUT_STEREO;
329 DVLOG(1) << "Unsupported channel layout: " << layout; 329 DVLOG(1) << "Unsupported channel layout: " << layout;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 avcodec_close(stream->codec); 383 avcodec_close(stream->codec);
384 } 384 }
385 } 385 }
386 } 386 }
387 387
388 // Then finally cleanup the format context. 388 // Then finally cleanup the format context.
389 avformat_close_input(&format_context); 389 avformat_close_input(&format_context);
390 } 390 }
391 391
392 } // namespace media 392 } // namespace media
OLDNEW
« no previous file with comments | « media/base/channel_layout.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698