| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 static void write_ivf_frame_header(FILE *outfile, | 132 static void write_ivf_frame_header(FILE *outfile, |
| 133 const vpx_codec_cx_pkt_t *pkt) | 133 const vpx_codec_cx_pkt_t *pkt) |
| 134 { | 134 { |
| 135 char header[12]; | 135 char header[12]; |
| 136 vpx_codec_pts_t pts; | 136 vpx_codec_pts_t pts; |
| 137 | 137 |
| 138 if(pkt->kind != VPX_CODEC_CX_FRAME_PKT) | 138 if(pkt->kind != VPX_CODEC_CX_FRAME_PKT) |
| 139 return; | 139 return; |
| 140 | 140 |
| 141 pts = pkt->data.frame.pts; | 141 pts = pkt->data.frame.pts; |
| 142 mem_put_le32(header, pkt->data.frame.sz); | 142 mem_put_le32(header, (unsigned int)pkt->data.frame.sz); |
| 143 mem_put_le32(header+4, pts&0xFFFFFFFF); | 143 mem_put_le32(header+4, pts&0xFFFFFFFF); |
| 144 mem_put_le32(header+8, pts >> 32); | 144 mem_put_le32(header+8, pts >> 32); |
| 145 | 145 |
| 146 (void) fwrite(header, 1, 12, outfile); | 146 (void) fwrite(header, 1, 12, outfile); |
| 147 } | 147 } |
| 148 | 148 |
| 149 int main(int argc, char **argv) { | 149 int main(int argc, char **argv) { |
| 150 FILE *infile, *outfile; | 150 FILE *infile, *outfile; |
| 151 vpx_codec_ctx_t codec; | 151 vpx_codec_ctx_t codec; |
| 152 vpx_codec_enc_cfg_t cfg; | 152 vpx_codec_enc_cfg_t cfg; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 vpx_img_free(&raw); | 250 vpx_img_free(&raw); |
| 251 if(vpx_codec_destroy(&codec)) | 251 if(vpx_codec_destroy(&codec)) |
| 252 die_codec(&codec, "Failed to destroy codec"); | 252 die_codec(&codec, "Failed to destroy codec"); |
| 253 | 253 |
| 254 /* Try to rewrite the file header with the actual frame count */ | 254 /* Try to rewrite the file header with the actual frame count */ |
| 255 if(!fseek(outfile, 0, SEEK_SET)) | 255 if(!fseek(outfile, 0, SEEK_SET)) |
| 256 write_ivf_file_header(outfile, &cfg, frame_cnt-1); | 256 write_ivf_file_header(outfile, &cfg, frame_cnt-1); |
| 257 fclose(outfile); | 257 fclose(outfile); |
| 258 return EXIT_SUCCESS; | 258 return EXIT_SUCCESS; |
| 259 } | 259 } |
| OLD | NEW |