]> git.sesse.net Git - nageru/blobdiff - nageru/mjpeg_encoder.h
Constify FFmpeg callbacks.
[nageru] / nageru / mjpeg_encoder.h
index 5f19246841dd8e5f5e0bb6c6e41981ec4e71ecdc..af03b28bc9de0ca46939a21981e97a5ee9793498 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _MJPEG_ENCODER_H
 #define _MJPEG_ENCODER_H 1
 
-#include "defs.h"
 #include "shared/ffmpeg_raii.h"
+#include "shared/ff_maybe_const.h"
 #include "shared/httpd.h"
 #include "shared/va_resource_pool.h"
 #include "ref_counted_frame.h"
@@ -16,15 +16,19 @@ extern "C" {
 #include <atomic>
 #include <bmusb/bmusb.h>
 #include <condition_variable>
-#include <list>
+#include <map>
+#include <memory>
 #include <mutex>
 #include <queue>
+#include <stddef.h>
 #include <stdint.h>
 #include <string>
 #include <thread>
+#include <vector>
 
 #include <movit/effect.h>
 #include <va/va.h>
+#include <va/va_enc_jpeg.h>
 
 struct jpeg_compress_struct;
 struct VADisplayWithCleanup;
@@ -81,8 +85,8 @@ private:
                HTTPD::StreamID stream_id;
        };
        std::map<HTTPD::StreamID, WritePacket2Context> ffmpeg_contexts;   // Statically set up, so we never need to worry about dangling pointers.
-       static int write_packet2_thunk(void *opaque, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
-       int write_packet2(HTTPD::StreamID stream_id, uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
+       static int write_packet2_thunk(void *opaque, FF_MAYBE_CONST uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
+       int write_packet2(HTTPD::StreamID stream_id, FF_MAYBE_CONST uint8_t *buf, int buf_size, AVIODataMarkerType type, int64_t time);
 
        std::thread encoder_thread, va_receiver_thread;