AVIDump: Add a struct for the state.

So AddFrame use no global state and can be threaded well.
This commit is contained in:
degasus
2016-11-04 18:19:35 +01:00
parent dad5041737
commit be29090aae
9 changed files with 44 additions and 18 deletions

View File

@ -14,8 +14,21 @@ private:
static void CheckResolution(int width, int height);
public:
struct Frame
{
u64 ticks = 0;
u32 ticks_per_second = 0;
bool first_frame = false;
};
static bool Start(int w, int h);
static void AddFrame(const u8* data, int width, int height, int stride, u64 ticks);
static void AddFrame(const u8* data, int width, int height, int stride, const Frame& state);
static void Stop();
static void DoState();
#if defined(HAVE_LIBAV) || defined(_WIN32)
static Frame FetchState(u64 ticks);
#else
static Frame FetchState(u64 ticks) { return {}; }
#endif
};