Skip to content
Snippets Groups Projects
Commit 9740a79c authored by Philippe Gorley's avatar Philippe Gorley Committed by Sébastien Blin
Browse files

accel: remove libdrm code

Change-Id: I21af38d6a5fcd36d11955b185f0858c8bb07a278
Gitlab: #135
parent bf3f83ba
No related branches found
No related tags found
No related merge requests found
......@@ -155,23 +155,7 @@ HardwareAccel::setDetails(AVCodecContext* codecCtx)
bool
HardwareAccel::initDevice()
{
int ret = 0;
// default DRM device may not work on multi GPU computers, so check all possible values
if (hwType_ == AV_HWDEVICE_TYPE_VAAPI) {
const std::string path = "/dev/dri/";
auto files = jami::fileutils::readDirectory(path);
// renderD* is preferred over card*
std::sort(files.rbegin(), files.rend());
for (auto& entry : files) {
std::string deviceName = path + entry;
if ((ret = av_hwdevice_ctx_create(&deviceCtx_, hwType_, deviceName.c_str(), nullptr, 0)) >= 0) {
return true;
}
}
}
// default device (nullptr) works for most cases
ret = av_hwdevice_ctx_create(&deviceCtx_, hwType_, nullptr, nullptr, 0);
return ret >= 0;
return av_hwdevice_ctx_create(&deviceCtx_, hwType_, nullptr, nullptr, 0) >= 0;
}
bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment