Quoting Andreas Rheinhardt (2024-04-08 21:51:59) > +/** > + * ThreadProgress is an API to easily notify other threads about progress > + * of any kind as long as it can be packaged into an int and is consistent > + * with the natural ordering of integers. > + * > + * Each initialized ThreadProgress can be in one of two modes: No-op mode > + * or ordinary mode. In the former mode, ff_thread_report_progress() and > + * ff_thread_await_progress() are no-ops to simply support usecases like > + * non-frame-threading. Only in the latter case perform these functions
Maybe 'strictly serial usecases' or 'non-parallel usecases' would sound better. > + * what their name already implies. > + */ > + > +#include <limits.h> > +#include <stdatomic.h> > +#include "libavutil/thread.h" > + > +/** > + * This struct should be treated as opaque by users. > + */ > +typedef struct ThreadProgress { > + atomic_int progress; > + unsigned init; > + AVMutex progress_mutex; > + AVCond progress_cond; > +} ThreadProgress; > + > +/** > + * Initialize a ThreadProgress. > + * > + * @param init_mode If zero, the ThreadProgress will be initialized so that > + * to be in no-op mode as described above. Otherwise Seems like something missing here. LGTM otherwise. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".