6 #include <condition_variable>
14 Player(JPEGFrameView *destination);
16 void play_clip(const Clip &clip, unsigned stream_idx);
18 // Not thread-safe to set concurrently with playing.
19 // Will be called back from the player thread.
20 using done_callback_func = std::function<void()>;
21 void set_done_callback(done_callback_func cb) { done_callback = cb; }
26 JPEGFrameView *destination;
27 done_callback_func done_callback;
30 Clip current_clip; // Under mu.
31 unsigned current_stream_idx; // Under mu.
33 enum { PAUSED, PLAYING } cue_state = PAUSED; // Under cue_state_mu.
34 std::mutex cue_state_mu;
35 std::condition_variable cue_is_playing;
38 #endif // !defined(_PLAYER_H)