Skip to content

Commit

Permalink
DXVA hardware decoding on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Jan 26, 2025
1 parent 1fc5d89 commit 7d2caa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions crates/ffmpeg-hw-device/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ impl CodecContextExt for codec::decoder::decoder::Decoder {
return Err("no hw config");
}

if (*config).methods & (AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX as i32) == 1
&& (*config).device_type == AVHWDeviceType::AV_HWDEVICE_TYPE_VIDEOTOOLBOX
{
if (*config).methods & (AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX as i32) == 1 {
HW_PIX_FMT.set((*config).pix_fmt);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rendering/src/decoder/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl FfmpegDecoder {
#[cfg(target_os = "windows")]
{
decoder
.try_use_hw_device(AVHWDeviceType::AV_HWDEVICE_TYPE_D3D11VA, Pixel::NV12)
.try_use_hw_device(AVHWDeviceType::AV_HWDEVICE_TYPE_DXVA2, Pixel::DXVA2_VLD)
.ok()
}

Expand Down

1 comment on commit 7d2caa5

@vercel
Copy link

@vercel vercel bot commented on 7d2caa5 Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.