bool committed = false;
};
-VADisplayWithCleanup::~VADisplayWithCleanup()
-{
- if (va_dpy != nullptr) {
- vaTerminate(va_dpy);
- }
- if (x11_display != nullptr) {
- XCloseDisplay(x11_display);
- }
- if (drm_fd != -1) {
- close(drm_fd);
- }
-}
-
unique_ptr<VADisplayWithCleanup> va_open_display(const string &va_display)
{
if (va_display.empty() || va_display[0] != '/') { // An X display.
#include "image_input.h"
#include "input_mapping.h"
#include "shared/metrics.h"
+#include "shared/va_display.h"
#include "mjpeg_encoder.h"
#include "pbo_frame_allocator.h"
#include "shared/ref_counted_gl_sync.h"
#include "shared/timebase.h"
#include "timecode_renderer.h"
#include "v210_converter.h"
-#include "va_display_with_cleanup.h"
#include "video_encoder.h"
#undef Status
#include "shared/metrics.h"
#include "pbo_frame_allocator.h"
#include "shared/timebase.h"
-#include "va_display_with_cleanup.h"
+#include "shared/va_display.h"
#include <movit/colorspace_conversion_effect.h>
#include "flags.h"
#include "mjpeg_encoder.h"
#include "v210_converter.h"
-#include "va_display_with_cleanup.h"
+#include "shared/va_display.h"
using namespace std;
global_flags.use_zerocopy = use_zerocopy;
}
-VADisplayWithCleanup::~VADisplayWithCleanup()
-{
- if (va_dpy != nullptr) {
- vaTerminate(va_dpy);
- }
- if (x11_display != nullptr) {
- XCloseDisplay(x11_display);
- }
- if (drm_fd != -1) {
- close(drm_fd);
- }
-}
-
unique_ptr<VADisplayWithCleanup> va_open_display(const string &va_display)
{
if (va_display.empty() || va_display[0] != '/') { // An X display.
#include "shared/timebase.h"
#include "print_latency.h"
#include "shared/ref_counted_gl_sync.h"
-#include "va_display_with_cleanup.h"
+#include "shared/va_display.h"
#include "v4l_output.h"
#define SURFACE_NUM 16 /* 16 surfaces for source YUV */
protobufdep = dependency('protobuf')
alsadep = dependency('alsa')
movitdep = dependency('movit')
+vadrmdep = dependency('libva-drm')
+vax11dep = dependency('libva-x11')
# Preprocess Qt as needed.
qt_files = qt5.preprocess(
protobuf_lib = static_library('protobufs', proto_generated, dependencies: [protobufdep])
protobuf_hdrs = declare_dependency(sources: proto_generated)
-srcs = ['memcpy_interleaved.cpp', 'metacube2.cpp', 'ffmpeg_raii.cpp', 'mux.cpp', 'metrics.cpp', 'context.cpp', 'httpd.cpp', 'disk_space_estimator.cpp', 'read_file.cpp', 'text_proto.cpp', 'midi_device.cpp', 'ref_counted_texture.cpp']
+srcs = ['memcpy_interleaved.cpp', 'metacube2.cpp', 'ffmpeg_raii.cpp', 'mux.cpp', 'metrics.cpp', 'context.cpp', 'httpd.cpp', 'disk_space_estimator.cpp', 'read_file.cpp', 'text_proto.cpp', 'midi_device.cpp', 'ref_counted_texture.cpp', 'va_display.cpp']
srcs += proto_generated
# Qt objects.
srcs += qt_files
srcs += ['aboutdialog.cpp']
-shared = static_library('shared', srcs, include_directories: top_include, dependencies: [shared_qt5deps, libmicrohttpddep, protobufdep, alsadep, movitdep])
+shared = static_library('shared', srcs, include_directories: top_include, dependencies: [shared_qt5deps, libmicrohttpddep, protobufdep, alsadep, movitdep, vadrmdep, vax11dep])
shareddep = declare_dependency(
sources: proto_generated,
include_directories: top_include,
--- /dev/null
+#include "shared/va_display.h"
+#include <unistd.h>
+
+VADisplayWithCleanup::~VADisplayWithCleanup()
+{
+ if (va_dpy != nullptr) {
+ vaTerminate(va_dpy);
+ }
+ if (x11_display != nullptr) {
+ XCloseDisplay(x11_display);
+ }
+ if (drm_fd != -1) {
+ close(drm_fd);
+ }
+}
+
-#ifndef _VA_DISPLAY_WITH_CLEANUP
-#define _VA_DISPLAY_WITH_CLEANUP 1
+#ifndef _VA_DISPLAY_H
+#define _VA_DISPLAY _H1
#include <va/va.h>
#include <X11/Xlib.h>
#include <memory>
+#include <string.h>
struct VADisplayWithCleanup {
~VADisplayWithCleanup();
VADisplay va_dpy;
Display *x11_display = nullptr;
- bool can_use_zerocopy = true;
+ bool can_use_zerocopy = true; // For H.264 encoding in Nageru.
int drm_fd = -1;
};
std::unique_ptr<VADisplayWithCleanup> va_open_display(const std::string &va_display); // Can return nullptr on failure.
-#endif // !defined(_VA_DISPLAY_WITH_CLEANUP)
+#endif // !defined(_VA_DISPLAY_H)