| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 case CODEC_ID_VP8: | 36 case CODEC_ID_VP8: |
| 37 return kCodecVP8; | 37 return kCodecVP8; |
| 38 default: | 38 default: |
| 39 NOTREACHED(); | 39 NOTREACHED(); |
| 40 } | 40 } |
| 41 return kUnknown; | 41 return kUnknown; |
| 42 } | 42 } |
| 43 | 43 |
| 44 CodecID VideoCodecToCodecID(VideoCodec video_codec) { | 44 CodecID VideoCodecToCodecID(VideoCodec video_codec) { |
| 45 switch (video_codec) { | 45 switch (video_codec) { |
| 46 case kUnknown: | |
| 47 return CODEC_ID_NONE; | |
| 48 case kCodecVC1: | 46 case kCodecVC1: |
| 49 return CODEC_ID_VC1; | 47 return CODEC_ID_VC1; |
| 50 case kCodecH264: | 48 case kCodecH264: |
| 51 return CODEC_ID_H264; | 49 return CODEC_ID_H264; |
| 52 case kCodecTheora: | 50 case kCodecTheora: |
| 53 return CODEC_ID_THEORA; | 51 return CODEC_ID_THEORA; |
| 54 case kCodecMPEG2: | 52 case kCodecMPEG2: |
| 55 return CODEC_ID_MPEG2VIDEO; | 53 return CODEC_ID_MPEG2VIDEO; |
| 56 case kCodecMPEG4: | 54 case kCodecMPEG4: |
| 57 return CODEC_ID_MPEG4; | 55 return CODEC_ID_MPEG4; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 avcodec_close(stream->codec); | 226 avcodec_close(stream->codec); |
| 229 } | 227 } |
| 230 } | 228 } |
| 231 } | 229 } |
| 232 | 230 |
| 233 // Then finally cleanup the format context. | 231 // Then finally cleanup the format context. |
| 234 av_close_input_file(format_context); | 232 av_close_input_file(format_context); |
| 235 } | 233 } |
| 236 | 234 |
| 237 } // namespace media | 235 } // namespace media |
| OLD | NEW |