57#define MAGIC to_fourcc('C', 'F', 'C', 'P')
58#define MOD_NAME "[change pixfmt cap. f.] "
70 if (strlen(cfg) == 0 || strcmp(cfg,
"help") == 0) {
71 printf(
"Performs pixel format change transformation.\n\n"
115 unsigned char *in_data = (
unsigned char *) in->
tiles[0].
data;
116 unsigned char *out_data = (
unsigned char *) out->
tiles[0].
data;
120 for (
unsigned int i = 0; i < in->
tiles[0].
height; i += 1) {
122 in_data += src_linesize;
123 out_data += dst_linesize;
152 const size_t alloc_len = *
len;
156 if (decoder == NULL) {
159 if (*
len +
sizeof c > alloc_len) {
160 MSG(ERROR,
"Insufficient size %zd for get_property!\n",
164 memcpy((
char*)
val + *
len, &c,
sizeof c);
void vf_free(struct video_frame *buf)
Frees video_frame structure.
struct video_desc video_desc_from_frame(const struct video_frame *frame)
Returns struct video_desc from video frame.
void vf_data_deleter(struct video_frame *buf)
int vc_get_linesize(unsigned int width, codec_t codec)
struct video_frame * vf_alloc_desc(struct video_desc desc)
Allocates video frame accordig given desc.
codec_t get_codec_from_name(const char *name)
#define CAPTURE_FILTER_ABI_VERSION
#define ADD_VO_PP_CAPTURE_FILTER_WRAPPER(name, init, filter, done, set_out_buf, get_prop_callb)
static struct video_frame * filter(void *state, struct video_frame *in)
static void vo_pp_set_out_buffer(void *state, char *buffer)
static bool change_pixfmt_vo_pp_get_property(void *state, int property, void *val, size_t *len)
static const struct capture_filter_info capture_filter_change_pixfmt
static void done(void *state)
static int init(struct module *parent, const char *cfg, void **state)
int color_printf(const char *format,...)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_ERROR
general errors
@ LIBRARY_CLASS_CAPTURE_FILTER
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
decoder_t get_decoder_from_to(codec_t in, codec_t out)
decoder_func_t * decoder_t
void * vo_pp_out_buffer
buffer to write to if we use vo_pp wrapper (otherwise unused)
char * data
Raw tile data. Pointer must be at least 4B aligned.
unsigned int data_len
length of the data
void(* data_deleter)(struct video_frame *)
void(* dispose)(struct video_frame *)
Struct video_frame represents a video frame and contains video description.
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
struct video_frame_callbacks callbacks
static void change_pixfmt(AVFrame *frame, unsigned char *dst, av_to_uv_convert_t *convert, codec_t out_codec, int width, int height, int pitch, int rgb_shift[static restrict 3], struct state_libavcodec_decompress_sws *sws)
#define VIDEO_FRAME_DISPOSE(frame)
#define VO_PP_PROPERTY_CODECS