1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * vivid-vid-common.h - common video support functions. 4 * 5 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 6 */ 7 8 #ifndef _VIVID_VID_COMMON_H_ 9 #define _VIVID_VID_COMMON_H_ 10 11 typedef int (*fmtfunc)(struct file *file, void *priv, struct v4l2_format *f); 12 13 /* 14 * Conversion function that converts a single-planar format to a 15 * single-plane multiplanar format. 16 */ 17 void fmt_sp2mp(const struct v4l2_format *sp_fmt, struct v4l2_format *mp_fmt); 18 int fmt_sp2mp_func(struct file *file, void *priv, 19 struct v4l2_format *f, fmtfunc func); 20 21 extern const struct v4l2_dv_timings_cap vivid_dv_timings_cap; 22 23 const struct vivid_fmt *vivid_get_format(struct vivid_dev *dev, u32 pixelformat); 24 25 struct vivid_dev *vivid_input_is_connected_to(struct vivid_dev *dev); 26 struct vivid_dev *vivid_output_is_connected_to(struct vivid_dev *dev); 27 bool vivid_vid_can_loop(struct vivid_dev *dev); 28 void vivid_send_source_change(struct vivid_dev *dev, unsigned int type); 29 void vivid_send_input_source_change(struct vivid_dev *dev, unsigned int input_index); 30 31 int vivid_vid_adjust_sel(unsigned flags, struct v4l2_rect *r); 32 33 int vivid_enum_fmt_vid(struct file *file, void *priv, struct v4l2_fmtdesc *f); 34 int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id); 35 int vidioc_g_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings); 36 int vidioc_enum_dv_timings(struct file *file, void *_fh, struct v4l2_enum_dv_timings *timings); 37 int vidioc_dv_timings_cap(struct file *file, void *_fh, struct v4l2_dv_timings_cap *cap); 38 int vidioc_g_edid(struct file *file, void *_fh, struct v4l2_edid *edid); 39 int vidioc_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub); 40 41 #endif 42