You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Let the user choose which installed graphics card to use for
decoding HW_DE_DEVICE_SET and/or encoding HW_EN_DEVICE_SET Possible options are /dev/dri/renderD128 for the first, /dev/dri/renderD129 for the second, and so on.
This commit is contained in:
@@ -221,9 +221,15 @@ void FFmpegReader::Open()
|
||||
#if defined(__linux__)
|
||||
if (hw_de_on & hw_de_supported) {
|
||||
// Open Hardware Acceleration
|
||||
// Use the hw device given in the environment variable HW_DE_DEVICE_SET or the default if not set
|
||||
char *dev_hw = getenv( "HW_DE_DEVICE_SET" );
|
||||
// Check if it is there and writable
|
||||
if( dev_hw != NULL && access( dev_hw, W_OK ) == -1 ) {
|
||||
dev_hw = NULL; // use default
|
||||
}
|
||||
hw_device_ctx = NULL;
|
||||
pCodecCtx->get_format = get_vaapi_format;
|
||||
if (av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0) >= 0) {
|
||||
if (av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, dev_hw, NULL, 0) >= 0) {
|
||||
if (!(pCodecCtx->hw_device_ctx = av_buffer_ref(hw_device_ctx))) {
|
||||
throw InvalidCodec("Hardware device reference create failed.", path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user