OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 if (!(outfile = fopen(argv[2], "wb"))) | 117 if (!(outfile = fopen(argv[2], "wb"))) |
118 die("Failed to open %s for writing.", argv[2]); | 118 die("Failed to open %s for writing.", argv[2]); |
119 | 119 |
120 info = vpx_video_reader_get_info(reader); | 120 info = vpx_video_reader_get_info(reader); |
121 | 121 |
122 decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); | 122 decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc); |
123 if (!decoder) | 123 if (!decoder) |
124 die("Unknown input codec."); | 124 die("Unknown input codec."); |
125 | 125 |
126 printf("Using %s\n", vpx_codec_iface_name(decoder->interface())); | 126 printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface())); |
127 | 127 |
128 if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) | 128 if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0)) |
129 die_codec(&codec, "Failed to initialize decoder."); | 129 die_codec(&codec, "Failed to initialize decoder."); |
130 | 130 |
131 while (vpx_video_reader_read_frame(reader)) { | 131 while (vpx_video_reader_read_frame(reader)) { |
132 vpx_codec_iter_t iter = NULL; | 132 vpx_codec_iter_t iter = NULL; |
133 vpx_image_t *img = NULL; | 133 vpx_image_t *img = NULL; |
134 size_t frame_size = 0; | 134 size_t frame_size = 0; |
135 const unsigned char *frame = vpx_video_reader_get_frame(reader, | 135 const unsigned char *frame = vpx_video_reader_get_frame(reader, |
136 &frame_size); | 136 &frame_size); |
137 if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) | 137 if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) |
138 die_codec(&codec, "Failed to decode frame."); | 138 die_codec(&codec, "Failed to decode frame."); |
(...skipping 10 matching lines...) Expand all Loading... |
149 | 149 |
150 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", | 150 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", |
151 info->frame_width, info->frame_height, argv[2]); | 151 info->frame_width, info->frame_height, argv[2]); |
152 | 152 |
153 vpx_video_reader_close(reader); | 153 vpx_video_reader_close(reader); |
154 | 154 |
155 fclose(outfile); | 155 fclose(outfile); |
156 | 156 |
157 return EXIT_SUCCESS; | 157 return EXIT_SUCCESS; |
158 } | 158 } |
OLD | NEW |