|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| bool MayaFlux::IO::VideoEncodeContext::encode_frame | ( | const uint8_t * | src_data, |
| size_t | src_size, | ||
| uint32_t | src_width, | ||
| uint32_t | src_height, | ||
| FFmpegMuxContext & | mux | ||
| ) |
Encode one raw pixel frame into the mux context.
Converts src_data from the source pixel format to the encoder's required format via SwsContext, stamps the monotonic PTS, and submits the frame to the encoder. Drains any available packets to the mux immediately.
src_data must be a packed, row-major image of exactly width * height * bytes_per_pixel(src_pixel_format) bytes as delivered by the swapchain readback. No stride padding is expected; the source linesize is computed as width * bytes_per_pixel.
Non-blocking with respect to the observer thread: this runs exclusively on the VideoFileWriter worker thread.
| src_data | Pointer to the first byte of the packed source image. |
| src_size | Byte count of src_data; must equal width * height * bpp. |
| mux | Mux context to receive encoded packets. |
Definition at line 255 of file VideoEncodeContext.cpp.
References codec_context, drain_packets(), is_valid(), m_cached_src_height, m_cached_src_width, m_last_error, m_pts, m_scratch_frame, m_src_pixel_fmt, m_src_src_bpp, and sws_context.
Referenced by MayaFlux::IO::VideoFileWriter::worker_loop().
Here is the call graph for this function:
Here is the caller graph for this function: