ref: 12dc2be0e918efd204d47eb5d9686a2d277aee71
parent: 41874f89efd630cb8362c7d04f664c360a46b73a
author: Michael Bradshaw <mjbshaw@google.com>
date: Wed Dec 12 21:06:32 EST 2018
Document the thread context in which Dav1dPicAllocator's functions are called
--- a/include/dav1d/picture.h
+++ b/include/dav1d/picture.h
@@ -75,6 +75,9 @@
* pixel width/height multiple of 128 pixels.
* data[1] and data[2] must share the same stride[1].
*
+ * This function will be called on the main thread (the thread which calls
+ * dav1d_get_picture()).
+ *
* @param pic The picture to allocate the buffer for. The callback needs to
* fill the picture data[0], data[1], data[2], stride[0] and
* stride[1].
@@ -88,6 +91,11 @@
int (*alloc_picture_callback)(Dav1dPicture *pic, void *cookie);
/**
* Release the picture buffer.
+ *
+ * If frame threading is used, this function may be called by the main
+ * thread (the thread which calls dav1d_get_picture()) or any of the frame
+ * threads and thus must be thread-safe. If frame threading is not used,
+ * this function will only be called on the main thread.
*
* @param pic The picture that was filled by alloc_picture_callback().
* @param cookie Custom pointer passed to all calls.