X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_capture.h;h=8a513df971fa20f2cba71e25ac603242b9be3be3;hb=a5746714e6ca1e665bf9e74344e67712443f947a;hp=336f6bd253ae25945843d672eae7c1bda915091b;hpb=80a2892bbe07a4e065704830e9e7244d2b1139fa;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;