]> git.sesse.net Git - nageru/blobdiff - video_encoder.cpp
Add functionality for MJPEG export.
[nageru] / video_encoder.cpp
index 2ce5580fec3f456d33a1ed81f5fdf015b3c02ad2..2b8fcd5edec9e0a9ea3a79aed79d39d02494375d 100644 (file)
@@ -34,7 +34,7 @@ string generate_local_dump_filename(int frame)
        tm now_tm;
        localtime_r(&now, &now_tm);
 
-       char timestamp[256];
+       char timestamp[64];
        strftime(timestamp, sizeof(timestamp), "%F-%T%z", &now_tm);
 
        // Use the frame number to disambiguate between two cuts starting
@@ -216,9 +216,9 @@ int VideoEncoder::write_packet2(uint8_t *buf, int buf_size, AVIODataMarkerType t
 
        if (type == AVIO_DATA_MARKER_HEADER) {
                stream_mux_header.append((char *)buf, buf_size);
-               httpd->set_header(stream_mux_header);
+               httpd->set_header(HTTPD::MAIN_STREAM, stream_mux_header);
        } else {
-               httpd->add_data((char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 });
+               httpd->add_data(HTTPD::MAIN_STREAM, (char *)buf, buf_size, type == AVIO_DATA_MARKER_SYNC_POINT, time, AVRational{ AV_TIME_BASE, 1 });
        }
        return buf_size;
 }