int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags,
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
int64_t end_time) {
- VP9_COMMON *volatile const cm = &cpi->common;
+ VP9_COMMON *const cm = &cpi->common;
struct vpx_usec_timer timer;
- volatile int res = 0;
+ int res = 0;
const int subsampling_x = sd->subsampling_x;
const int subsampling_y = sd->subsampling_y;
#if CONFIG_VP9_HIGHBITDEPTH
const int use_highbitdepth = (sd->flags & YV12_FLAG_HIGHBITDEPTH) != 0;
#endif
- if (setjmp(cm->error.jmp)) {
- cm->error.setjmp = 0;
- return -1;
- }
- cm->error.setjmp = 1;
-
#if CONFIG_VP9_HIGHBITDEPTH
check_initial_width(cpi, use_highbitdepth, subsampling_x, subsampling_y);
#else
res = -1;
}
- cm->error.setjmp = 0;
return res;
}
#include "./vpx_config.h"
#include "vpx/vpx_encoder.h"
#include "vpx_ports/vpx_once.h"
+#include "vpx_ports/system_state.h"
#include "vpx/internal/vpx_codec_internal.h"
#include "./vpx_version.h"
#include "vp9/encoder/vp9_encoder.h"
const vpx_image_t *img,
vpx_codec_pts_t pts,
unsigned long duration,
- vpx_enc_frame_flags_t flags,
+ vpx_enc_frame_flags_t enc_flags,
unsigned long deadline) {
- vpx_codec_err_t res = VPX_CODEC_OK;
+ volatile vpx_codec_err_t res = VPX_CODEC_OK;
+ volatile vpx_enc_frame_flags_t flags = enc_flags;
VP9_COMP *const cpi = ctx->cpi;
const vpx_rational_t *const timebase = &ctx->cfg.g_timebase;
size_t data_sz;
return VPX_CODEC_INVALID_PARAM;
}
+ if (setjmp(cpi->common.error.jmp)) {
+ cpi->common.error.setjmp = 0;
+ res = update_error_state(ctx, &cpi->common.error);
+ vpx_clear_system_state();
+ return res;
+ }
+ cpi->common.error.setjmp = 1;
+
vp9_apply_encoding_flags(cpi, flags);
// Handle fixed keyframe intervals
* the buffer size anyway.
*/
if (cx_data_sz < ctx->cx_data_sz / 2) {
- ctx->base.err_detail = "Compressed data buffer too small";
+ vpx_internal_error(&cpi->common.error, VPX_CODEC_ERROR,
+ "Compressed data buffer too small");
return VPX_CODEC_ERROR;
}
}
}
}
+ cpi->common.error.setjmp = 0;
return res;
}