6 #include <condition_variable>
14 Player(JPEGFrameView *destination);
16 void play_clip(const Clip &clip, unsigned stream_idx);
17 void override_angle(unsigned stream_idx); // For the current clip only.
19 // Not thread-safe to set concurrently with playing.
20 // Will be called back from the player thread.
21 using done_callback_func = std::function<void()>;
22 void set_done_callback(done_callback_func cb) { done_callback = cb; }
27 JPEGFrameView *destination;
28 done_callback_func done_callback;
31 Clip current_clip; // Under mu. Can have pts_in = -1 for no clip.
32 unsigned current_stream_idx; // Under mu.
34 std::mutex queue_state_mu;
35 std::condition_variable new_clip_changed;
36 bool new_clip_ready = false; // Under queue_state_mu.
37 bool playing = false; // Under queue_state_mu.
38 int override_stream_idx = -1; // Under queue_state_mu.
41 #endif // !defined(_PLAYER_H)