This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deconding a h264 video stream... There are a few caveats which can cause some confusion. | |
// 1. 15 frames of 0 need flushing before we actually start pogressing. | |
// 2. Frames are extracted in chunks of 4 and appear in a swizzled order 4, 2, 1, 3, | |
// 3. The order seems consistent in blocks of 4, with the frames increasing from the middle entry rotating anti-clockwise. | |
// 4. Care needs to be taken when using frame numbers or timestamps to flag AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM | |
// Otherwise the decode may skip 4 frames (as the final frame will be delivered as the first in a block of 4). | |
// Havent experimented much yet but the blocks of 4 can also appear as blocks of 5, this may be due to frquency of keyframes | |
// tight loop will extract and decode all video frames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Copy, Clone)] | |
struct WinPixEventRuntime { | |
begin_event: BeginEventOnCommandList, | |
end_event: EndEventOnCommandList, | |
set_marker: SetMarkerOnCommandList, | |
} | |
impl WinPixEventRuntime { | |
pub fn create() -> Option<WinPixEventRuntime> { | |
unsafe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct Vec<T, const N: usize> { | |
v: [T; N] | |
} | |
impl<T, const N: usize> Vec<T, N> where T: std::ops::AddAssign + std::fmt::Display { | |
fn print(&self) { | |
for i in 0..N { | |
print!("{}, ", self.v[i]); | |
} | |
print!("\n"); |