X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=player.h;h=10e0b6ab471bc477cf86c17d843239a16f3a590a;hb=f96a233d97789c748000975e486e8b89c5c7d472;hp=e251c6e86d8f20446e8692361bad34c2123d15bd;hpb=83f00b3618fa1cb4527b59f6e2d2f8d3f52cc25a;p=nageru diff --git a/player.h b/player.h index e251c6e..10e0b6a 100644 --- a/player.h +++ b/player.h @@ -3,15 +3,22 @@ #include "clip_list.h" +extern "C" { +#include +} + #include #include #include class JPEGFrameView; +class VideoStream; +class QSurface; +class QSurfaceFormat; class Player { public: - Player(JPEGFrameView *destination); + Player(JPEGFrameView *destination, bool also_output_to_stream); void play_clip(const Clip &clip, unsigned stream_idx); void override_angle(unsigned stream_idx); // For the current clip only. @@ -22,7 +29,10 @@ public: void set_done_callback(done_callback_func cb) { done_callback = cb; } private: - void thread_func(); + void thread_func(bool also_output_to_stream); + void open_output_stream(); + static int write_packet2_thunk(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time); + int write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time); JPEGFrameView *destination; done_callback_func done_callback; @@ -36,6 +46,8 @@ private: bool new_clip_ready = false; // Under queue_state_mu. bool playing = false; // Under queue_state_mu. int override_stream_idx = -1; // Under queue_state_mu. + + std::unique_ptr video_stream; // Can be nullptr. }; #endif // !defined(_PLAYER_H)