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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return SAVE_STATUS(ctx, res); | 63 return SAVE_STATUS(ctx, res); |
64 } | 64 } |
65 | 65 |
66 vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, | 66 vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, |
67 vpx_codec_iface_t *iface, | 67 vpx_codec_iface_t *iface, |
68 vpx_codec_enc_cfg_t *cfg, | 68 vpx_codec_enc_cfg_t *cfg, |
69 int num_enc, | 69 int num_enc, |
70 vpx_codec_flags_t flags, | 70 vpx_codec_flags_t flags, |
71 vpx_rational_t *dsf, | 71 vpx_rational_t *dsf, |
72 int ver) { | 72 int ver) { |
73 vpx_codec_err_t res = 0; | 73 vpx_codec_err_t res = VPX_CODEC_OK; |
74 | 74 |
75 if (ver != VPX_ENCODER_ABI_VERSION) | 75 if (ver != VPX_ENCODER_ABI_VERSION) |
76 res = VPX_CODEC_ABI_MISMATCH; | 76 res = VPX_CODEC_ABI_MISMATCH; |
77 else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1)) | 77 else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1)) |
78 res = VPX_CODEC_INVALID_PARAM; | 78 res = VPX_CODEC_INVALID_PARAM; |
79 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) | 79 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) |
80 res = VPX_CODEC_ABI_MISMATCH; | 80 res = VPX_CODEC_ABI_MISMATCH; |
81 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) | 81 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) |
82 res = VPX_CODEC_INCAPABLE; | 82 res = VPX_CODEC_INCAPABLE; |
83 else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA)) | 83 else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA)) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 static void FLOATING_POINT_RESTORE() {} | 200 static void FLOATING_POINT_RESTORE() {} |
201 #endif | 201 #endif |
202 | 202 |
203 | 203 |
204 vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, | 204 vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, |
205 const vpx_image_t *img, | 205 const vpx_image_t *img, |
206 vpx_codec_pts_t pts, | 206 vpx_codec_pts_t pts, |
207 unsigned long duration, | 207 unsigned long duration, |
208 vpx_enc_frame_flags_t flags, | 208 vpx_enc_frame_flags_t flags, |
209 unsigned long deadline) { | 209 unsigned long deadline) { |
210 vpx_codec_err_t res = 0; | 210 vpx_codec_err_t res = VPX_CODEC_OK; |
211 | 211 |
212 if (!ctx || (img && !duration)) | 212 if (!ctx || (img && !duration)) |
213 res = VPX_CODEC_INVALID_PARAM; | 213 res = VPX_CODEC_INVALID_PARAM; |
214 else if (!ctx->iface || !ctx->priv) | 214 else if (!ctx->iface || !ctx->priv) |
215 res = VPX_CODEC_ERROR; | 215 res = VPX_CODEC_ERROR; |
216 else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) | 216 else if (!(ctx->iface->caps & VPX_CODEC_CAP_ENCODER)) |
217 res = VPX_CODEC_INCAPABLE; | 217 res = VPX_CODEC_INCAPABLE; |
218 else { | 218 else { |
219 unsigned int num_enc = ctx->priv->enc.total_encoders; | 219 unsigned int num_enc = ctx->priv->enc.total_encoders; |
220 | 220 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 pkt = (const void *) * iter; | 399 pkt = (const void *) * iter; |
400 | 400 |
401 if ((size_t)(pkt - list->pkts) < list->cnt) | 401 if ((size_t)(pkt - list->pkts) < list->cnt) |
402 *iter = pkt + 1; | 402 *iter = pkt + 1; |
403 else | 403 else |
404 pkt = NULL; | 404 pkt = NULL; |
405 | 405 |
406 return pkt; | 406 return pkt; |
407 } | 407 } |
OLD | NEW |