Skip to content

Commit

Permalink
switch to ask for vulkan, use git url
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Nov 10, 2024
1 parent c424d7e commit 70a07bb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ wayland-protocols = { version = "0.32", features = [
] }
wayland-protocols-wlr = { version = "0.3", features = ["client"] }
ffmpeg-next = "7.0.1"
ffmpeg-sys-next = "7.0.0" # need direct dep on -sys to get metadata to consume in build.rs
ffmpeg-sys-next = { version = "7.0.0", features = ["vulkan"] }
thiserror = "1.0.38"
human-size = "0.4.2"
signal-hook = "0.3.15"
Expand All @@ -39,6 +39,7 @@ log = "0.4.21"
clap_complete = "4.5.8"
log-once = "0.4.1"
drm = "0.14.0"
ash = "0.38.0"


[dev-dependencies]
Expand All @@ -49,7 +50,7 @@ nix = { version = "0.29.0", default-features = false, features = [
serde_json = "1.0.103"

[patch.crates-io]
ffmpeg-sys-next = { path = "../rust-ffmpeg-sys" }
ffmpeg-sys-next = { git = "https://github.com/russelltg/rust-ffmpeg-sys", branch = "vulkan"}

[profile.release]
lto = "thin"
23 changes: 8 additions & 15 deletions src/avhw.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
use std::{
ffi::CString,
path::Path,
ptr::{null, null_mut},
};
use std::{ffi::CString, path::Path, ptr::null_mut};

use ash::vk;
use ffmpeg::{
dict,
ffi::{
av_buffer_ref, av_buffer_unref, av_hwdevice_ctx_create, av_hwframe_ctx_alloc,
av_hwframe_ctx_init, av_hwframe_get_buffer, AVHWFramesContext,
VkStructureType::VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,
},
format::Pixel,
frame,
};
use ffmpeg_sys_next::{
AVVulkanFramesContext, VkImageDrmFormatModifierListCreateInfoEXT, VkImageTiling,
};
use ffmpeg_sys_next::AVVulkanFramesContext;

use crate::DrmModifier;

Expand Down Expand Up @@ -99,13 +93,12 @@ impl AvHwDevCtx {
if self.fmt == Pixel::VULKAN {
let vk_ptr = hwframe_casted.hwctx as *mut AVVulkanFramesContext;

(*vk_ptr).tiling = VkImageTiling::VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
(*vk_ptr).tiling = vk::ImageTiling::DRM_FORMAT_MODIFIER_EXT;

let mut create_info = VkImageDrmFormatModifierListCreateInfoEXT {
sType: VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,
pNext: null(),
drmFormatModifierCount: modifiers.len() as u32,
pDrmFormatModifiers: modifiers.as_ptr() as _,
let mut create_info = vk::ImageDrmFormatModifierListCreateInfoEXT {
drm_format_modifier_count: modifiers.len() as u32,
p_drm_format_modifiers: modifiers.as_ptr() as _,
..Default::default()
};
(*vk_ptr).create_pnext = &mut create_info as *mut _ as _;
}
Expand Down

0 comments on commit 70a07bb

Please sign in to comment.