forge
Explore
Log in

Don't you dare go Hollow

U17: vk-video-ffi delete the synchronous encode* methods and flush_last (no caller: ec-vk wraps submit*+flush, ec-hw calls ec-vk only)

Browse files at this commit

f5328b9bcc3d4eba014e8894b62474b3e73c09a6Ahmet Kaan GümüşParent: 95a81bb
shims/vk-video-ffi/src/av1_encode.rsmodified+0 -40
@@ -302,13 +302,6 @@ impl Av1EncodeSession {
302302 self.encode_uploaded(pic)
303303 }
304304
305- /// Encodes one picture from a shared D3D11 texture synchronously and returns its coded bytes.
306- #[cfg(windows)]
307- pub fn encode_d3d11(&mut self, src: &crate::D3d11Texture<'_>, pic: &Av1Picture) -> Result<Vec<u8>, Error> {
308- self.submit_d3d11(src, pic)?;
309- self.enc.flush_last()
310- }
311-
312305 fn encode_uploaded(&mut self, pic: &Av1Picture) -> Result<Option<Vec<u8>>, Error> {
313306 let extent = self.enc.extent;
314307
@@ -448,39 +441,6 @@ impl Av1EncodeSession {
448441 Ok(out)
449442 }
450443
451- /// Encodes one picture synchronously and returns its coded bytes.
452- pub fn encode(&mut self, y: &[u8], uv: &[u8], pic: &Av1Picture) -> Result<Vec<u8>, Error> {
453- self.submit(y, uv, pic)?;
454- self.enc.flush_last()
455- }
456-
457- /// Encodes one picture synchronously and returns its coded bytes.
458- pub fn encode_16(&mut self, y: &[u16], uv: &[u16], pic: &Av1Picture) -> Result<Vec<u8>, Error> {
459- self.submit_16(y, uv, pic)?;
460- self.enc.flush_last()
461- }
462-
463- /// Encodes one picture synchronously and returns its coded bytes.
464- pub fn encode_rgb(
465- &mut self,
466- rgb: &[u8],
467- src_width: u32,
468- src_height: u32,
469- stride_bytes: u32,
470- bgr: bool,
471- pic: &Av1Picture,
472- ) -> Result<Vec<u8>, Error> {
473- self.submit_rgb(rgb, src_width, src_height, stride_bytes, bgr, pic)?;
474- self.enc.flush_last()
475- }
476-
477- #[cfg(target_os = "linux")]
478- /// Encodes one picture synchronously and returns its coded bytes.
479- pub fn encode_dmabuf(&mut self, src: &DmaBuf<'_>, pic: &Av1Picture) -> Result<Vec<u8>, Error> {
480- self.submit_dmabuf(src, pic)?;
481- self.enc.flush_last()
482- }
483-
484444 /// Waits for queued pictures and returns their coded bytes in order.
485445 pub fn flush(&mut self) -> Result<Vec<Vec<u8>>, Error> {
486446 self.enc.flush()
shims/vk-video-ffi/src/h264_encode.rsmodified+0 -34
@@ -399,13 +399,6 @@ impl H264EncodeSession {
399399 self.encode_uploaded(pic)
400400 }
401401
402- /// Encodes one picture from a shared D3D11 texture synchronously and returns its coded bytes.
403- #[cfg(windows)]
404- pub fn encode_d3d11(&mut self, src: &crate::D3d11Texture<'_>, pic: &H264Picture) -> Result<Vec<u8>, Error> {
405- self.submit_d3d11(src, pic)?;
406- self.enc.flush_last()
407- }
408-
409402 fn encode_uploaded(&mut self, pic: &H264Picture) -> Result<Option<Vec<u8>>, Error> {
410403 let extent = self.enc.extent;
411404
@@ -538,33 +531,6 @@ impl H264EncodeSession {
538531 .submit(&begin_slots, &mut applied.rc, &mut chain.rc, &encode)
539532 }
540533
541- /// Encodes one picture synchronously and returns its coded bytes.
542- pub fn encode(&mut self, y: &[u8], uv: &[u8], pic: &H264Picture) -> Result<Vec<u8>, Error> {
543- self.submit(y, uv, pic)?;
544- self.enc.flush_last()
545- }
546-
547- /// Encodes one picture synchronously and returns its coded bytes.
548- pub fn encode_rgb(
549- &mut self,
550- rgb: &[u8],
551- src_width: u32,
552- src_height: u32,
553- stride_bytes: u32,
554- bgr: bool,
555- pic: &H264Picture,
556- ) -> Result<Vec<u8>, Error> {
557- self.submit_rgb(rgb, src_width, src_height, stride_bytes, bgr, pic)?;
558- self.enc.flush_last()
559- }
560-
561- #[cfg(target_os = "linux")]
562- /// Encodes one picture synchronously and returns its coded bytes.
563- pub fn encode_dmabuf(&mut self, src: &DmaBuf<'_>, pic: &H264Picture) -> Result<Vec<u8>, Error> {
564- self.submit_dmabuf(src, pic)?;
565- self.enc.flush_last()
566- }
567-
568534 /// Waits for queued pictures and returns their coded bytes in order.
569535 pub fn flush(&mut self) -> Result<Vec<Vec<u8>>, Error> {
570536 self.enc.flush()
shims/vk-video-ffi/src/h265_encode.rsmodified+0 -40
@@ -344,13 +344,6 @@ impl H265EncodeSession {
344344 self.encode_uploaded(pic)
345345 }
346346
347- /// Encodes one picture from a shared D3D11 texture synchronously and returns its coded bytes.
348- #[cfg(windows)]
349- pub fn encode_d3d11(&mut self, src: &crate::D3d11Texture<'_>, pic: &H265Picture) -> Result<Vec<u8>, Error> {
350- self.submit_d3d11(src, pic)?;
351- self.enc.flush_last()
352- }
353-
354347 fn encode_uploaded(&mut self, pic: &H265Picture) -> Result<Option<Vec<u8>>, Error> {
355348 let extent = self.enc.extent;
356349
@@ -462,39 +455,6 @@ impl H265EncodeSession {
462455 .submit(&begin_slots, &mut applied.rc, &mut chain.rc, &encode)
463456 }
464457
465- /// Encodes one picture synchronously and returns its coded bytes.
466- pub fn encode(&mut self, y: &[u8], uv: &[u8], pic: &H265Picture) -> Result<Vec<u8>, Error> {
467- self.submit(y, uv, pic)?;
468- self.enc.flush_last()
469- }
470-
471- /// Encodes one picture synchronously and returns its coded bytes.
472- pub fn encode_16(&mut self, y: &[u16], uv: &[u16], pic: &H265Picture) -> Result<Vec<u8>, Error> {
473- self.submit_16(y, uv, pic)?;
474- self.enc.flush_last()
475- }
476-
477- /// Encodes one picture synchronously and returns its coded bytes.
478- pub fn encode_rgb(
479- &mut self,
480- rgb: &[u8],
481- src_width: u32,
482- src_height: u32,
483- stride_bytes: u32,
484- bgr: bool,
485- pic: &H265Picture,
486- ) -> Result<Vec<u8>, Error> {
487- self.submit_rgb(rgb, src_width, src_height, stride_bytes, bgr, pic)?;
488- self.enc.flush_last()
489- }
490-
491- #[cfg(target_os = "linux")]
492- /// Encodes one picture synchronously and returns its coded bytes.
493- pub fn encode_dmabuf(&mut self, src: &DmaBuf<'_>, pic: &H265Picture) -> Result<Vec<u8>, Error> {
494- self.submit_dmabuf(src, pic)?;
495- self.enc.flush_last()
496- }
497-
498458 /// Waits for queued pictures and returns their coded bytes in order.
499459 pub fn flush(&mut self) -> Result<Vec<Vec<u8>>, Error> {
500460 self.enc.flush()
shims/vk-video-ffi/src/session.rsmodified+0 -7
@@ -1444,13 +1444,6 @@ impl Encoder {
14441444 Ok(out)
14451445 }
14461446
1447- /// Flushes and returns the last picture, for synchronous use where one picture is queued per call.
1448- pub(crate) fn flush_last(&mut self) -> Result<Vec<u8>, Error> {
1449- self.flush()?
1450- .pop()
1451- .ok_or_else(|| Error::Invalid("no picture encoded".into()))
1452- }
1453-
14541447 fn finish(&mut self, k: usize) -> Result<Vec<u8>, Error> {
14551448 let slot = &self.slots[k];
14561449 slot.main.wait()?;