X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=futatabi%2Fplayer.h;h=03da29e364b80db3c2a503fc3e3d98b25ee90a84;hp=b57bada647f2cb48439265cf8e534a6179c4d8f3;hb=eaba7288c4fb39ca195c9355970293bcaf088dbc;hpb=5198acefd13b91a7953f1db1370ce7d434132472 diff --git a/futatabi/player.h b/futatabi/player.h index b57bada..03da29e 100644 --- a/futatabi/player.h +++ b/futatabi/player.h @@ -6,6 +6,7 @@ #include "queue_spot_holder.h" extern "C" { +#include #include } @@ -21,7 +22,12 @@ class QSurfaceFormat; class Player : public QueueInterface { public: - Player(JPEGFrameView *destination, bool also_output_to_stream); + enum StreamOutput { + NO_STREAM_OUTPUT, + HTTPD_STREAM_OUTPUT, // Output to global_httpd. + FILE_STREAM_OUTPUT // Output to file_avctx. + }; + Player(JPEGFrameView *destination, StreamOutput stream_output, AVFormatContext *file_avctx = nullptr); ~Player(); void play_clip(const Clip &clip, size_t clip_idx, unsigned stream_idx); @@ -48,7 +54,7 @@ public: void release_queue_spot() override; private: - void thread_func(bool also_output_to_stream); + void thread_func(StreamOutput stream_output, AVFormatContext *file_avctx); 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);