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; |
46 case kCodecVC1: | 48 case kCodecVC1: |
47 return CODEC_ID_VC1; | 49 return CODEC_ID_VC1; |
48 case kCodecH264: | 50 case kCodecH264: |
49 return CODEC_ID_H264; | 51 return CODEC_ID_H264; |
50 case kCodecTheora: | 52 case kCodecTheora: |
51 return CODEC_ID_THEORA; | 53 return CODEC_ID_THEORA; |
52 case kCodecMPEG2: | 54 case kCodecMPEG2: |
53 return CODEC_ID_MPEG2VIDEO; | 55 return CODEC_ID_MPEG2VIDEO; |
54 case kCodecMPEG4: | 56 case kCodecMPEG4: |
55 return CODEC_ID_MPEG4; | 57 return CODEC_ID_MPEG4; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 avcodec_close(stream->codec); | 228 avcodec_close(stream->codec); |
227 } | 229 } |
228 } | 230 } |
229 } | 231 } |
230 | 232 |
231 // Then finally cleanup the format context. | 233 // Then finally cleanup the format context. |
232 av_close_input_file(format_context); | 234 av_close_input_file(format_context); |
233 } | 235 } |
234 | 236 |
235 } // namespace media | 237 } // namespace media |
OLD | NEW |