vivid-vid-common.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * vivid-vid-common.h - common video support functions.
  3. *
  4. * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  5. *
  6. * This program is free software; you may redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  11. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  13. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  14. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  15. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. * SOFTWARE.
  18. */
  19. #ifndef _VIVID_VID_COMMON_H_
  20. #define _VIVID_VID_COMMON_H_
  21. typedef int (*fmtfunc)(struct file *file, void *priv, struct v4l2_format *f);
  22. /*
  23. * Conversion function that converts a single-planar format to a
  24. * single-plane multiplanar format.
  25. */
  26. void fmt_sp2mp(const struct v4l2_format *sp_fmt, struct v4l2_format *mp_fmt);
  27. int fmt_sp2mp_func(struct file *file, void *priv,
  28. struct v4l2_format *f, fmtfunc func);
  29. extern const struct v4l2_dv_timings_cap vivid_dv_timings_cap;
  30. const struct vivid_fmt *vivid_get_format(struct vivid_dev *dev, u32 pixelformat);
  31. bool vivid_vid_can_loop(struct vivid_dev *dev);
  32. void vivid_send_source_change(struct vivid_dev *dev, unsigned type);
  33. bool rect_overlap(const struct v4l2_rect *r1, const struct v4l2_rect *r2);
  34. void rect_set_size_to(struct v4l2_rect *r, const struct v4l2_rect *size);
  35. void rect_set_min_size(struct v4l2_rect *r, const struct v4l2_rect *min_size);
  36. void rect_set_max_size(struct v4l2_rect *r, const struct v4l2_rect *max_size);
  37. void rect_map_inside(struct v4l2_rect *r, const struct v4l2_rect *boundary);
  38. bool rect_same_size(const struct v4l2_rect *r1, const struct v4l2_rect *r2);
  39. struct v4l2_rect rect_intersect(const struct v4l2_rect *a, const struct v4l2_rect *b);
  40. void rect_scale(struct v4l2_rect *r, const struct v4l2_rect *from,
  41. const struct v4l2_rect *to);
  42. int vivid_vid_adjust_sel(unsigned flags, struct v4l2_rect *r);
  43. int vivid_enum_fmt_vid(struct file *file, void *priv, struct v4l2_fmtdesc *f);
  44. int vidioc_enum_fmt_vid_mplane(struct file *file, void *priv, struct v4l2_fmtdesc *f);
  45. int vidioc_enum_fmt_vid(struct file *file, void *priv, struct v4l2_fmtdesc *f);
  46. int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id);
  47. int vidioc_g_dv_timings(struct file *file, void *_fh, struct v4l2_dv_timings *timings);
  48. int vidioc_enum_dv_timings(struct file *file, void *_fh, struct v4l2_enum_dv_timings *timings);
  49. int vidioc_dv_timings_cap(struct file *file, void *_fh, struct v4l2_dv_timings_cap *cap);
  50. int vidioc_g_edid(struct file *file, void *_fh, struct v4l2_edid *edid);
  51. int vidioc_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub);
  52. #endif