go7007.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (C) 2005-2006 Micronas USA Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and the associated README documentation file (the
  6. * "Software"), to deal in the Software without restriction, including
  7. * without limitation the rights to use, copy, modify, merge, publish,
  8. * distribute, sublicense, and/or sell copies of the Software, and to
  9. * permit persons to whom the Software is furnished to do so.
  10. *
  11. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  12. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  14. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  15. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  16. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  17. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. */
  19. /* DEPRECATED -- use V4L2_PIX_FMT_MPEG and then call GO7007IOC_S_MPEG_PARAMS
  20. * to select between MPEG1, MPEG2, and MPEG4 */
  21. #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG4 */
  22. /* These will be replaced with a better interface
  23. * soon, so don't get too attached to them */
  24. #define GO7007IOC_S_BITRATE _IOW('V', BASE_VIDIOC_PRIVATE + 0, int)
  25. #define GO7007IOC_G_BITRATE _IOR('V', BASE_VIDIOC_PRIVATE + 1, int)
  26. enum go7007_aspect_ratio {
  27. GO7007_ASPECT_RATIO_1_1 = 0,
  28. GO7007_ASPECT_RATIO_4_3_NTSC = 1,
  29. GO7007_ASPECT_RATIO_4_3_PAL = 2,
  30. GO7007_ASPECT_RATIO_16_9_NTSC = 3,
  31. GO7007_ASPECT_RATIO_16_9_PAL = 4,
  32. };
  33. /* Used to set generic compression parameters */
  34. struct go7007_comp_params {
  35. __u32 gop_size;
  36. __u32 max_b_frames;
  37. enum go7007_aspect_ratio aspect_ratio;
  38. __u32 flags;
  39. __u32 reserved[8];
  40. };
  41. #define GO7007_COMP_CLOSED_GOP 0x00000001
  42. #define GO7007_COMP_OMIT_SEQ_HEADER 0x00000002
  43. enum go7007_mpeg_video_standard {
  44. GO7007_MPEG_VIDEO_MPEG1 = 0,
  45. GO7007_MPEG_VIDEO_MPEG2 = 1,
  46. GO7007_MPEG_VIDEO_MPEG4 = 2,
  47. };
  48. /* Used to set parameters for V4L2_PIX_FMT_MPEG format */
  49. struct go7007_mpeg_params {
  50. enum go7007_mpeg_video_standard mpeg_video_standard;
  51. __u32 flags;
  52. __u32 pali;
  53. __u32 reserved[8];
  54. };
  55. #define GO7007_MPEG_FORCE_DVD_MODE 0x00000001
  56. #define GO7007_MPEG_OMIT_GOP_HEADER 0x00000002
  57. #define GO7007_MPEG_REPEAT_SEQHEADER 0x00000004
  58. #define GO7007_MPEG_PROFILE(format, pali) (((format)<<24)|(pali))
  59. #define GO7007_MPEG2_PROFILE_MAIN_MAIN GO7007_MPEG_PROFILE(2, 0x48)
  60. #define GO7007_MPEG4_PROFILE_S_L0 GO7007_MPEG_PROFILE(4, 0x08)
  61. #define GO7007_MPEG4_PROFILE_S_L1 GO7007_MPEG_PROFILE(4, 0x01)
  62. #define GO7007_MPEG4_PROFILE_S_L2 GO7007_MPEG_PROFILE(4, 0x02)
  63. #define GO7007_MPEG4_PROFILE_S_L3 GO7007_MPEG_PROFILE(4, 0x03)
  64. #define GO7007_MPEG4_PROFILE_ARTS_L1 GO7007_MPEG_PROFILE(4, 0x91)
  65. #define GO7007_MPEG4_PROFILE_ARTS_L2 GO7007_MPEG_PROFILE(4, 0x92)
  66. #define GO7007_MPEG4_PROFILE_ARTS_L3 GO7007_MPEG_PROFILE(4, 0x93)
  67. #define GO7007_MPEG4_PROFILE_ARTS_L4 GO7007_MPEG_PROFILE(4, 0x94)
  68. #define GO7007_MPEG4_PROFILE_AS_L0 GO7007_MPEG_PROFILE(4, 0xf0)
  69. #define GO7007_MPEG4_PROFILE_AS_L1 GO7007_MPEG_PROFILE(4, 0xf1)
  70. #define GO7007_MPEG4_PROFILE_AS_L2 GO7007_MPEG_PROFILE(4, 0xf2)
  71. #define GO7007_MPEG4_PROFILE_AS_L3 GO7007_MPEG_PROFILE(4, 0xf3)
  72. #define GO7007_MPEG4_PROFILE_AS_L4 GO7007_MPEG_PROFILE(4, 0xf4)
  73. #define GO7007_MPEG4_PROFILE_AS_L5 GO7007_MPEG_PROFILE(4, 0xf5)
  74. struct go7007_md_params {
  75. __u16 region;
  76. __u16 trigger;
  77. __u16 pixel_threshold;
  78. __u16 motion_threshold;
  79. __u32 reserved[8];
  80. };
  81. struct go7007_md_region {
  82. __u16 region;
  83. __u16 flags;
  84. struct v4l2_clip *clips;
  85. __u32 reserved[8];
  86. };
  87. #define GO7007IOC_S_MPEG_PARAMS _IOWR('V', BASE_VIDIOC_PRIVATE + 2, \
  88. struct go7007_mpeg_params)
  89. #define GO7007IOC_G_MPEG_PARAMS _IOR('V', BASE_VIDIOC_PRIVATE + 3, \
  90. struct go7007_mpeg_params)
  91. #define GO7007IOC_S_COMP_PARAMS _IOWR('V', BASE_VIDIOC_PRIVATE + 4, \
  92. struct go7007_comp_params)
  93. #define GO7007IOC_G_COMP_PARAMS _IOR('V', BASE_VIDIOC_PRIVATE + 5, \
  94. struct go7007_comp_params)
  95. #define GO7007IOC_S_MD_PARAMS _IOWR('V', BASE_VIDIOC_PRIVATE + 6, \
  96. struct go7007_md_params)
  97. #define GO7007IOC_G_MD_PARAMS _IOR('V', BASE_VIDIOC_PRIVATE + 7, \
  98. struct go7007_md_params)
  99. #define GO7007IOC_S_MD_REGION _IOW('V', BASE_VIDIOC_PRIVATE + 8, \
  100. struct go7007_md_region)