FFmpeg-backed video-file capture source. More...
#include <mxvk/include/mxvk/mxvk_ff_capture.hpp>
Public Member Functions | |
| void | close () |
| Close the active file and release decoder resources. | |
| double | fps () const |
| Source frame rate, falling back to 30 fps when unknown. | |
| int | hardware_decode_device () const |
| Selected CUDA hardware-decode device, or -1 for FFmpeg's default. | |
| int | height () const |
| Source height in pixels. | |
| bool | is_open () const |
| Check whether a decoder is open. | |
| bool | open (const std::string &filename) |
| Open a video file. | |
| bool | open (const std::string &filename, int cuda_device) |
| Open a video file on a selected CUDA decode device. | |
| VK_FF_Capture & | operator= (const VK_FF_Capture &)=delete |
| VK_FF_Capture & | operator= (VK_FF_Capture &&)=delete |
| bool | readRgba (std::vector< uint8_t > &rgba, int &width, int &height, int &pitch, bool flipY=false) |
| Decode the next frame as tightly packed RGBA8. | |
| bool | seek_start () |
| Seek the active video stream back to its beginning. | |
| bool | skip () |
| Decode and discard the next video frame. | |
| bool | using_hardware_decode () const |
| True when CUDA hardware decode is active. | |
| VK_FF_Capture ()=default | |
| Construct a closed capture source. | |
| VK_FF_Capture (const VK_FF_Capture &)=delete | |
| VK_FF_Capture (VK_FF_Capture &&)=delete | |
| int | width () const |
| Source width in pixels. | |
| ~VK_FF_Capture () | |
| Close and release FFmpeg resources. | |
FFmpeg-backed video-file capture source.
VK_FF_Capture opens video files directly through FFmpeg, prefers CUDA hardware decoding when available, and returns tightly packed RGBA8 frames suitable for Vulkan staging uploads or encoder input.
Definition at line 33 of file mxvk_ff_capture.hpp.
|
default |
Construct a closed capture source.
| mxvk::VK_FF_Capture::~VK_FF_Capture | ( | ) |
Close and release FFmpeg resources.
Definition at line 58 of file mxvk_ff_capture.cpp.
|
delete |
|
delete |
| void mxvk::VK_FF_Capture::close | ( | ) |
Close the active file and release decoder resources.
Definition at line 182 of file mxvk_ff_capture.cpp.
|
inlinenodiscard |
Source frame rate, falling back to 30 fps when unknown.
Definition at line 105 of file mxvk_ff_capture.hpp.
|
inlinenodiscard |
Selected CUDA hardware-decode device, or -1 for FFmpeg's default.
Definition at line 109 of file mxvk_ff_capture.hpp.
|
inlinenodiscard |
Source height in pixels.
Definition at line 103 of file mxvk_ff_capture.hpp.
|
inlinenodiscard |
Check whether a decoder is open.
Definition at line 77 of file mxvk_ff_capture.hpp.
| bool mxvk::VK_FF_Capture::open | ( | const std::string & | filename | ) |
Open a video file.
| filename | Path to the input video file. |
Definition at line 62 of file mxvk_ff_capture.cpp.
| bool mxvk::VK_FF_Capture::open | ( | const std::string & | filename, |
| int | cuda_device ) |
Open a video file on a selected CUDA decode device.
| filename | Path to the input video file. |
| cuda_device | CUDA device index used for hardware decode; a negative value lets FFmpeg select its default device. |
Definition at line 66 of file mxvk_ff_capture.cpp.
|
delete |
|
delete |
| bool mxvk::VK_FF_Capture::readRgba | ( | std::vector< uint8_t > & | rgba, |
| int & | width, | ||
| int & | height, | ||
| int & | pitch, | ||
| bool | flipY = false ) |
Decode the next frame as tightly packed RGBA8.
| rgba | Output byte buffer, resized to pitch * height. |
| width | Output frame width in pixels. |
| height | Output frame height in pixels. |
| pitch | Output row pitch in bytes. |
| flipY | Flip rows vertically after conversion when true. |
Definition at line 221 of file mxvk_ff_capture.cpp.
| bool mxvk::VK_FF_Capture::seek_start | ( | ) |
Seek the active video stream back to its beginning.
The decoder and optional hardware-device context remain active.
Definition at line 152 of file mxvk_ff_capture.cpp.
| bool mxvk::VK_FF_Capture::skip | ( | ) |
Decode and discard the next video frame.
Hardware frames remain on the decoder device and no RGBA conversion or host transfer is performed. This is intended for media-clock catch-up when a late source frame must not be rendered.
Definition at line 174 of file mxvk_ff_capture.cpp.
|
inlinenodiscard |
True when CUDA hardware decode is active.
Definition at line 107 of file mxvk_ff_capture.hpp.
|
inlinenodiscard |
Source width in pixels.
Definition at line 101 of file mxvk_ff_capture.hpp.