Skip to content

Commit 54b57fb

Browse files
committed
dedicated handle-needs-input error
1 parent 83bbacb commit 54b57fb

File tree

1 file changed

+17
-1
lines changed
  • crates/enc-mediafoundation/src/video

1 file changed

+17
-1
lines changed

crates/enc-mediafoundation/src/video/h264.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ pub enum NewVideoEncoderError {
7878
InputType(windows::core::Error),
7979
}
8080

81+
#[derive(Clone, Debug, thiserror::Error)]
82+
pub enum HandleNeedsInputError {
83+
#[error("ProcessTexture: {0}")]
84+
ProcessTexture(windows::core::Error),
85+
#[error("CreateSurfaceBuffer: {0}")]
86+
CreateSurfaceBuffer(windows::core::Error),
87+
#[error("CreateSample: {0}")]
88+
CreateSample(windows::core::Error),
89+
#[error("AddBuffer: {0}")]
90+
AddBuffer(windows::core::Error),
91+
#[error("SetSampleTime: {0}")]
92+
SetSampleTime(windows::core::Error),
93+
#[error("ProcessInput: {0}")]
94+
ProcessInput(windows::core::Error),
95+
}
96+
8197
unsafe impl Send for H264Encoder {}
8298

8399
impl H264Encoder {
@@ -349,7 +365,7 @@ impl H264Encoder {
349365
&mut self,
350366
texture: &ID3D11Texture2D,
351367
timestamp: TimeSpan,
352-
) -> windows::core::Result<()> {
368+
) -> Result<(), HandleNeedsInputError> {
353369
self.video_processor.process_texture(texture)?;
354370

355371
let first_time = self.first_time.get_or_insert(timestamp);

0 commit comments

Comments
 (0)