Skip to content

Commit 6ca9a10

Browse files
committed
wip
1 parent 774ab44 commit 6ca9a10

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/src/bin/video/main.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use std::sync::Arc;
22

33
use vulkano::{
4+
command_buffer::allocator::{CommandBufferAllocator, StandardCommandBufferAllocator},
45
device::{Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo, QueueFlags},
56
image::ImageUsage,
67
instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
8+
query::{QueryPool, QueryPoolCreateInfo, QueryType},
79
video::{
810
CodecCapabilities, VideoDecodeCapabilityFlags, VideoDecodeH264PictureLayoutFlags,
911
VideoDecodeH264ProfileInfo, VideoFormatInfo, VideoProfileInfo, VideoProfileListInfo,
@@ -195,4 +197,21 @@ fn main() {
195197
// gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw,format=I420,width=64,height=64 ! x264enc ! video/x-h264,profile=constrained-baseline,stream-format=byte-stream ! filesink location="64x64-I.h264"
196198
let h264_stream = include_bytes!("64x64-I.h264");
197199
println!("loaded {} bytes of h264 data", h264_stream.len());
200+
201+
let command_buffer_allocator =
202+
StandardCommandBufferAllocator::new(device.clone(), Default::default());
203+
204+
let command_buffer = command_buffer_allocator
205+
.allocate(
206+
video_queue_family_index,
207+
vulkano::command_buffer::CommandBufferLevel::Primary,
208+
1,
209+
)
210+
.unwrap();
211+
212+
let query_pool = QueryPool::new(
213+
Arc::clone(&device),
214+
QueryPoolCreateInfo::query_type(QueryType::ResultStatusOnly),
215+
)
216+
.unwrap();
198217
}

0 commit comments

Comments
 (0)