]> git.sesse.net Git - nageru/blobdiff - quicksync_encoder.cpp
Run IWYU on quicksync_encoder.{cpp,h}.
[nageru] / quicksync_encoder.cpp
index 041ac07d85db3076aa8df0bc1b8306a1717d7edb..55a0eabb5e3a5d191cbe90e8a889ac118ac10b6a 100644 (file)
@@ -1,18 +1,22 @@
 //#include "sysdeps.h"
 #include "quicksync_encoder.h"
 
-#include <movit/resource_pool.h>
+#include <movit/resource_pool.h>  // Must be above the Xlib includes.
 #include <movit/util.h>
+
 #include <EGL/eglplatform.h>
-#include <X11/X.h>
 #include <X11/Xlib.h>
 #include <assert.h>
 #include <epoxy/egl.h>
+#include <fcntl.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avio.h>
+#include <libavutil/error.h>
 #include <libdrm/drm_fourcc.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <fcntl.h>
+#include <unistd.h>
 #include <va/va.h>
 #include <va/va_drm.h>
 #include <va/va_drmcommon.h>
 #include <va/va_x11.h>
 #include <algorithm>
 #include <condition_variable>
+#include <cstddef>
 #include <cstdint>
 #include <map>
 #include <memory>
 #include <mutex>
 #include <queue>
+#include <stack>
 #include <string>
 #include <thread>
 #include <utility>
 #include "audio_encoder.h"
 #include "context.h"
 #include "defs.h"
+#include "ffmpeg_raii.h"
 #include "flags.h"
 #include "mux.h"
+#include "ref_counted_frame.h"
 #include "timebase.h"
 #include "x264_encoder.h"
 
@@ -1716,10 +1724,6 @@ int QuickSyncEncoderImpl::deinit_va()
     return 0;
 }
 
-namespace {
-
-}  // namespace
-
 QuickSyncEncoderImpl::QuickSyncEncoderImpl(const std::string &filename, movit::ResourcePool *resource_pool, QSurface *surface, const string &va_display, int width, int height, AVOutputFormat *oformat, X264Encoder *x264_encoder)
        : current_storage_frame(0), resource_pool(resource_pool), surface(surface), x264_encoder(x264_encoder), frame_width(width), frame_height(height)
 {
@@ -1942,7 +1946,8 @@ void QuickSyncEncoderImpl::open_output_file(const std::string &filename)
        }
 
        string video_extradata = "";  // FIXME: See other comment about global headers.
-       file_mux.reset(new Mux(avctx, frame_width, frame_height, Mux::CODEC_H264, video_extradata, file_audio_encoder->get_ctx(), TIMEBASE, nullptr));
+       AVCodecParametersWithDeleter audio_codecpar = file_audio_encoder->get_codec_parameters();
+       file_mux.reset(new Mux(avctx, frame_width, frame_height, Mux::CODEC_H264, video_extradata, audio_codecpar.get(), TIMEBASE));
 }
 
 void QuickSyncEncoderImpl::encode_thread_func()