X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_capture.h;fp=ffmpeg_capture.h;h=8a513df971fa20f2cba71e25ac603242b9be3be3;hb=4d4386716f258413132b8696315cb4efbf2c8b45;hp=336f6bd253ae25945843d672eae7c1bda915091b;hpb=c6c5e2ca4ea51426e32608f8b8e2cbcd5f1ab74f;p=nageru diff --git a/ffmpeg_capture.h b/ffmpeg_capture.h index 336f6bd..8a513df 100644 --- a/ffmpeg_capture.h +++ b/ffmpeg_capture.h @@ -77,6 +77,19 @@ public: producer_thread_should_quit.wakeup(); } + std::string get_filename() const + { + std::lock_guard lock(filename_mu); + return filename; + } + + void change_filename(const std::string &new_filename) + { + std::lock_guard lock(filename_mu); + filename = new_filename; + should_interrupt = true; + } + // Will stop the stream even if it's hung on blocking I/O. void disconnect() { @@ -215,6 +228,7 @@ private: static int interrupt_cb_thunk(void *unique); int interrupt_cb(); + mutable std::mutex filename_mu; std::string description, filename; uint16_t timecode = 0; unsigned width, height;