Files
UltraGrid/tools/ipc_frame_ug.h
Martin Piatka cb07eb354f ipc_frame: Add _hq version of ipc_frame_from_ug_frame
This version does the pixel conversion first before scaling to avoid
artifacts due to big block size of source pixel format. Significantly
slower.
2023-06-27 15:36:15 +02:00

37 lines
1.1 KiB
C

#ifndef IPC_FRAME_UG_32ee5c748f3e
#define IPC_FRAME_UG_32ee5c748f3e
#include "ipc_frame.h"
#include "types.h"
struct video_frame;
/**
* @brief Make an ipc frame from ultragrid frame
*
* Data is copied, src frame can be freed afterwards.
*
* @param[out] dst destination ipc frame
* @param[in] src source ultragrid frame
* @param[in] codec codec to convert into, VIDEO_CODEC_NONE for no conversion
* @param[in] scale_factor frame dimensions are divided by this amount. 0 for original size
*/
bool ipc_frame_from_ug_frame(struct Ipc_frame *dst,
const struct video_frame *src,
codec_t codec,
unsigned scale_factor);
/**
* @brief Same as ipc_frame_from_ug_frame, but convert pixfmt first and scale later.
*/
bool ipc_frame_from_ug_frame_hq(struct Ipc_frame *dst,
const struct video_frame *src,
codec_t codec,
unsigned scale_factor);
bool ipc_frame_write_to_fd(const struct Ipc_frame *f, int fd);
int ipc_frame_get_scale_factor(int src_w, int src_h, int target_w, int target_h);
#endif //IPC_FRAME_UG_32ee5c748f3e