X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=video_encoder.h;fp=video_encoder.h;h=617b51842554b5db5f5325e4c1cfeafff94c591f;hb=ab03e5e6f24b1651b4ca7df95e20aa5786939209;hp=78162e9c91badb1f18273d7b27ee0f430c3734da;hpb=64f9314bfe9b21fed7304a4d08a35d80e8c73144;p=nageru diff --git a/video_encoder.h b/video_encoder.h index 78162e9..617b518 100644 --- a/video_encoder.h +++ b/video_encoder.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -47,7 +48,8 @@ private: int write_packet(uint8_t *buf, int buf_size); AVOutputFormat *oformat; - std::unique_ptr quicksync_encoder; + std::mutex qs_mu; + std::unique_ptr quicksync_encoder; // Under . movit::ResourcePool *resource_pool; QSurface *surface; std::string va_display; @@ -64,6 +66,12 @@ private: std::string stream_mux_header; bool stream_mux_writing_keyframes = false; + + std::atomic quicksync_encoders_in_shutdown{0}; + + // Encoders that are shutdown, but need to call release_gl_resources() + // (or be deleted) from some thread with an OpenGL context. + std::vector> qs_needing_cleanup; // Under . }; #endif