| OLD | NEW |
| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "media/base/decoder_buffer.h" | 9 #include "media/base/decoder_buffer.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 case kSampleFormatPlanarF32: | 264 case kSampleFormatPlanarF32: |
| 265 return AV_SAMPLE_FMT_FLTP; | 265 return AV_SAMPLE_FMT_FLTP; |
| 266 default: | 266 default: |
| 267 DVLOG(1) << "Unknown SampleFormat: " << sample_format; | 267 DVLOG(1) << "Unknown SampleFormat: " << sample_format; |
| 268 } | 268 } |
| 269 return AV_SAMPLE_FMT_NONE; | 269 return AV_SAMPLE_FMT_NONE; |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Converts a channel count into a channel layout. Layouts chosen based on the | 272 // Converts a channel count into a channel layout. Layouts chosen based on the |
| 273 // Vorbis / Opus channel layout. | 273 // Vorbis / Opus channel layout. |
| 274 static ChannelLayout GuessChannelLayout(int channels) { | 274 ChannelLayout GuessChannelLayout(int channels) { |
| 275 switch (channels) { | 275 switch (channels) { |
| 276 case 1: | 276 case 1: |
| 277 return CHANNEL_LAYOUT_MONO; | 277 return CHANNEL_LAYOUT_MONO; |
| 278 case 2: | 278 case 2: |
| 279 return CHANNEL_LAYOUT_STEREO; | 279 return CHANNEL_LAYOUT_STEREO; |
| 280 case 3: | 280 case 3: |
| 281 return CHANNEL_LAYOUT_SURROUND; | 281 return CHANNEL_LAYOUT_SURROUND; |
| 282 case 4: | 282 case 4: |
| 283 return CHANNEL_LAYOUT_QUAD; | 283 return CHANNEL_LAYOUT_QUAD; |
| 284 case 5: | 284 case 5: |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 return PIX_FMT_YUV422P; | 511 return PIX_FMT_YUV422P; |
| 512 case VideoFrame::YV12: | 512 case VideoFrame::YV12: |
| 513 return PIX_FMT_YUV420P; | 513 return PIX_FMT_YUV420P; |
| 514 default: | 514 default: |
| 515 DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format; | 515 DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format; |
| 516 } | 516 } |
| 517 return PIX_FMT_NONE; | 517 return PIX_FMT_NONE; |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace media | 520 } // namespace media |
| OLD | NEW |