+struct VADisplayWithCleanup {
+ ~VADisplayWithCleanup();
+
+ VADisplay va_dpy;
+ Display *x11_display = nullptr;
+ bool can_use_zerocopy = true;
+ int drm_fd = -1;
+};
+std::unique_ptr<VADisplayWithCleanup> va_open_display(const std::string &va_display); // Can return nullptr on failure.
+
class QuickSyncEncoderImpl {
public:
QuickSyncEncoderImpl(const std::string &filename, movit::ResourcePool *resource_pool, QSurface *surface, const std::string &va_display, int width, int height, AVOutputFormat *oformat, X264Encoder *x264_encoder, DiskSpaceEstimator *disk_space_estimator);
class QuickSyncEncoderImpl {
public:
QuickSyncEncoderImpl(const std::string &filename, movit::ResourcePool *resource_pool, QSurface *surface, const std::string &va_display, int width, int height, AVOutputFormat *oformat, X264Encoder *x264_encoder, DiskSpaceEstimator *disk_space_estimator);
int build_packed_seq_buffer(movit::YCbCrLumaCoefficients ycbcr_coefficients, unsigned char **header_buffer);
int build_packed_slice_buffer(unsigned char **header_buffer);
int init_va(const std::string &va_display);
int build_packed_seq_buffer(movit::YCbCrLumaCoefficients ycbcr_coefficients, unsigned char **header_buffer);
int build_packed_slice_buffer(unsigned char **header_buffer);
int init_va(const std::string &va_display);
std::map<int, PendingFrame> reorder_buffer;
int quicksync_encoding_frame_num = 0;
std::map<int, PendingFrame> reorder_buffer;
int quicksync_encoding_frame_num = 0;
std::unique_ptr<AudioEncoder> file_audio_encoder;
X264Encoder *x264_encoder; // nullptr if not using x264.
std::unique_ptr<AudioEncoder> file_audio_encoder;
X264Encoder *x264_encoder; // nullptr if not using x264.
VAProfile h264_profile = (VAProfile)~0;
VAConfigAttrib config_attrib[VAConfigAttribTypeMax];
int config_attrib_num = 0, enc_packed_header_idx;
VAProfile h264_profile = (VAProfile)~0;
VAConfigAttrib config_attrib[VAConfigAttribTypeMax];
int config_attrib_num = 0, enc_packed_header_idx;