Skip to content
Snippets Groups Projects
Commit e1b50fd3 authored by Philippe Gorley's avatar Philippe Gorley Committed by Guillaume Roguez
Browse files

accel: let xlib choose the device if using vaapi-x11


Change-Id: I2c21585512831cadfeaae39119d2b6c9fc372775
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 2b6f3b07
Branches
Tags
No related merge requests found
...@@ -91,8 +91,7 @@ VaapiAccel::checkAvailability() ...@@ -91,8 +91,7 @@ VaapiAccel::checkAvailability()
if (hardwareDeviceCtx == nullptr) if (hardwareDeviceCtx == nullptr)
return false; return false;
#elif HAVE_VAAPI_ACCEL_X11 #elif HAVE_VAAPI_ACCEL_X11
deviceName_ = ":0"; if (av_hwdevice_ctx_create(&hardwareDeviceCtx, AV_HWDEVICE_TYPE_VAAPI, nullptr, nullptr, 0) < 0) {
if (av_hwdevice_ctx_create(&hardwareDeviceCtx, AV_HWDEVICE_TYPE_VAAPI, deviceName_.c_str(), nullptr, 0) < 0) {
return false; return false;
} }
#endif #endif
...@@ -123,7 +122,10 @@ VaapiAccel::init() ...@@ -123,7 +122,10 @@ VaapiAccel::init()
codecCtx_->hw_frames_ctx = av_buffer_ref(framesBufferRef_.get()); codecCtx_->hw_frames_ctx = av_buffer_ref(framesBufferRef_.get());
RING_DBG("VAAPI decoder initialized via device: %s", deviceName_.c_str()); if (!deviceName_.empty())
RING_DBG("VAAPI decoder initialized via device: %s", deviceName_.c_str());
else
RING_DBG("VAAPI decoder initialized");
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment