running = true;
}
+MJPEGEncoder::~MJPEGEncoder()
+{
+ av_free(avctx->pb->buffer);
+}
+
void MJPEGEncoder::stop()
{
if (!running) {
unique_lock<mutex> lock(mu);
for (;;) {
any_frames_to_be_encoded.wait(lock, [this] { return !frames_to_be_encoded.empty() || should_quit; });
- if (should_quit) return;
+ if (should_quit) break;
QueuedFrame qf = move(frames_to_be_encoded.front());
frames_to_be_encoded.pop();
exit(1);
}
}
+
+ free(tmp_y);
+ free(tmp_cbcr);
+ free(tmp_cb);
+ free(tmp_cr);
}
class VABufferDestroyer {
class MJPEGEncoder {
public:
MJPEGEncoder(HTTPD *httpd, const std::string &va_display);
+ ~MJPEGEncoder();
void stop();
void upload_frame(int64_t pts, unsigned card_index, RefCountedFrame frame, const bmusb::VideoFormat &video_format, size_t y_offset, size_t cbcr_offset);