Commit 77928eac authored by Niklas Haas's avatar Niklas Haas
Browse files

utils/libav: clarify lifetime of `pl_upload_avframe`

Turns out I actually made this very mistake. Oops.
parent af12b592
...@@ -58,13 +58,17 @@ static bool pl_frame_recreate_from_avframe(const struct pl_gpu *gpu, ...@@ -58,13 +58,17 @@ static bool pl_frame_recreate_from_avframe(const struct pl_gpu *gpu,
// must be an array of 4 pointers of type (const struct pl_tex *), each either // must be an array of 4 pointers of type (const struct pl_tex *), each either
// pointing to a valid texture, or NULL. Returns whether successful. // pointing to a valid texture, or NULL. Returns whether successful.
// //
// Note that this function will currently fail on HW accelerated AVFrame // Note: This function will currently fail on HW accelerated AVFrame formats.
// formats. For those, users must still use the specific interop functions from // For those, users must still use the specific interop functions from e.g.
// e.g. <libplacebo/vulkan.h>, depending on the HWAccel type. // <libplacebo/vulkan.h>, depending on the HWAccel type.
// //
// Note also that this function performs asynchronous uploads wherever // Note: This function performs asynchronous uploads wherever possible. This
// possible. This means that it may return *before* the source pixels are done // means that it may return *before* the source pixels are done being read
// being read from. The frame's data buffers are ref'd and freed automatically. // from. The frame's data buffers are ref'd and freed automatically.
//
// Note: As with `pl_frame_from_avframe`, the resulting `pl_frame` may
// reference data embedded in the AVFrame. As such, its lifetime is only
// valid as long as the AVFrame is valid.
static bool pl_upload_avframe(const struct pl_gpu *gpu, static bool pl_upload_avframe(const struct pl_gpu *gpu,
struct pl_frame *out_frame, struct pl_frame *out_frame,
const struct pl_tex *tex[4], const struct pl_tex *tex[4],
......
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