dav1d: add public defines for max amount of tile and frame threads

Otherwise the library user will have to guess and find out the limit the hard way.
parent 197a19ad
......@@ -41,6 +41,9 @@ extern "C" {
typedef struct Dav1dContext Dav1dContext;
typedef struct Dav1dRef Dav1dRef;
#define DAV1D_MAX_FRAME_THREADS 256
#define DAV1D_MAX_TILE_THREADS 64
typedef struct Dav1dSettings {
int n_frame_threads;
int n_tile_threads;
......
......@@ -75,9 +75,9 @@ int dav1d_open(Dav1dContext **const c_out,
validate_input_or_ret(c_out != NULL, -EINVAL);
validate_input_or_ret(s != NULL, -EINVAL);
validate_input_or_ret(s->n_tile_threads >= 1 &&
s->n_tile_threads <= 64, -EINVAL);
s->n_tile_threads <= DAV1D_MAX_TILE_THREADS, -EINVAL);
validate_input_or_ret(s->n_frame_threads >= 1 &&
s->n_frame_threads <= 256, -EINVAL);
s->n_frame_threads <= DAV1D_MAX_FRAME_THREADS, -EINVAL);
validate_input_or_ret(s->allocator.alloc_picture_callback != NULL,
-EINVAL);
validate_input_or_ret(s->allocator.release_picture_callback != NULL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment