|
1 | 1 | use std::sync::Arc;
|
2 | 2 |
|
3 | 3 | use vulkano::{
|
| 4 | + command_buffer::allocator::{CommandBufferAllocator, StandardCommandBufferAllocator}, |
4 | 5 | device::{Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo, QueueFlags},
|
5 | 6 | image::ImageUsage,
|
6 | 7 | instance::{Instance, InstanceCreateFlags, InstanceCreateInfo},
|
| 8 | + query::{QueryPool, QueryPoolCreateInfo, QueryType}, |
7 | 9 | video::{
|
8 | 10 | CodecCapabilities, VideoDecodeCapabilityFlags, VideoDecodeH264PictureLayoutFlags,
|
9 | 11 | VideoDecodeH264ProfileInfo, VideoFormatInfo, VideoProfileInfo, VideoProfileListInfo,
|
@@ -195,4 +197,21 @@ fn main() {
|
195 | 197 | // 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"
|
196 | 198 | let h264_stream = include_bytes!("64x64-I.h264");
|
197 | 199 | 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(); |
198 | 217 | }
|
0 commit comments