}
Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
- : httpd(WIDTH, HEIGHT),
+ : httpd(),
num_cards(num_cards),
mixer_surface(create_surface(format)),
h264_encoder_surface(create_surface(format)),
limiter(OUTPUT_FREQUENCY),
compressor(OUTPUT_FREQUENCY)
{
- httpd.open_output_file(generate_local_dump_filename(/*frame=*/0).c_str());
- httpd.start(9095);
-
CHECK(init_movit(MOVIT_SHADER_DIR, MOVIT_DEBUG_OFF));
check_error();
display_chain->finalize();
h264_encoder.reset(new H264Encoder(h264_encoder_surface, global_flags.va_display, WIDTH, HEIGHT, &httpd));
+ h264_encoder->open_output_file(generate_local_dump_filename(/*frame=*/0).c_str());
+
+ // Start listening for clients only once H264Encoder has written its header, if any.
+ httpd.start(9095);
// First try initializing the PCI devices, then USB, until we have the desired number of cards.
unsigned num_pci_devices = 0, num_usb_devices = 0;
if (should_cut.exchange(false)) { // Test and clear.
string filename = generate_local_dump_filename(frame);
printf("Starting new recording: %s\n", filename.c_str());
+ h264_encoder->close_output_file();
h264_encoder->shutdown();
- httpd.close_output_file();
- httpd.open_output_file(filename.c_str());
h264_encoder.reset(new H264Encoder(h264_encoder_surface, global_flags.va_display, WIDTH, HEIGHT, &httpd));
+ h264_encoder->open_output_file(filename.c_str());
}
#if 0
new_frame_ready_callback = callback;
has_new_frame_ready_callback = true;
}
+
+mutex RefCountedGLsync::fence_lock;