cx2341x.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. cx23415/6 header containing common defines.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  14. */
  15. #ifndef CX2341X_H
  16. #define CX2341X_H
  17. struct cx2341x_mpeg_params {
  18. /* misc */
  19. u16 width;
  20. u16 height;
  21. u16 is_50hz;
  22. /* stream */
  23. enum v4l2_mpeg_stream_type stream_type;
  24. /* audio */
  25. enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq;
  26. enum v4l2_mpeg_audio_encoding audio_encoding;
  27. enum v4l2_mpeg_audio_l2_bitrate audio_l2_bitrate;
  28. enum v4l2_mpeg_audio_mode audio_mode;
  29. enum v4l2_mpeg_audio_mode_extension audio_mode_extension;
  30. enum v4l2_mpeg_audio_emphasis audio_emphasis;
  31. enum v4l2_mpeg_audio_crc audio_crc;
  32. u8 audio_properties;
  33. /* video */
  34. enum v4l2_mpeg_video_encoding video_encoding;
  35. enum v4l2_mpeg_video_aspect video_aspect;
  36. u16 video_b_frames;
  37. u16 video_gop_size;
  38. u16 video_gop_closure;
  39. u16 video_pulldown;
  40. enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode;
  41. u32 video_bitrate;
  42. u32 video_bitrate_peak;
  43. u16 video_temporal_decimation;
  44. /* encoding filters */
  45. enum v4l2_mpeg_cx2341x_video_spatial_filter_mode video_spatial_filter_mode;
  46. u16 video_spatial_filter;
  47. enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type video_luma_spatial_filter_type;
  48. enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type video_chroma_spatial_filter_type;
  49. enum v4l2_mpeg_cx2341x_video_temporal_filter_mode video_temporal_filter_mode;
  50. u16 video_temporal_filter;
  51. enum v4l2_mpeg_cx2341x_video_median_filter_type video_median_filter_type;
  52. u16 video_luma_median_filter_top;
  53. u16 video_luma_median_filter_bottom;
  54. u16 video_chroma_median_filter_top;
  55. u16 video_chroma_median_filter_bottom;
  56. };
  57. #define CX2341X_MBOX_MAX_DATA 16
  58. extern const u32 cx2341x_mpeg_ctrls[];
  59. typedef int (*cx2341x_mbox_func)(void *priv, int cmd, int in, int out,
  60. u32 data[CX2341X_MBOX_MAX_DATA]);
  61. int cx2341x_update(void *priv, cx2341x_mbox_func func,
  62. const struct cx2341x_mpeg_params *old,
  63. const struct cx2341x_mpeg_params *new);
  64. int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params,
  65. struct v4l2_queryctrl *qctrl);
  66. const char **cx2341x_ctrl_get_menu(u32 id);
  67. int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params,
  68. struct v4l2_ext_controls *ctrls, int cmd);
  69. void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
  70. void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid);
  71. /* Firmware names */
  72. #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"
  73. /* Decoder firmware for the cx23415 only */
  74. #define CX2341X_FIRM_DEC_FILENAME "v4l-cx2341x-dec.fw"
  75. /* Firmware API commands */
  76. /* MPEG decoder API, specific to the cx23415 */
  77. #define CX2341X_DEC_PING_FW 0x00
  78. #define CX2341X_DEC_START_PLAYBACK 0x01
  79. #define CX2341X_DEC_STOP_PLAYBACK 0x02
  80. #define CX2341X_DEC_SET_PLAYBACK_SPEED 0x03
  81. #define CX2341X_DEC_STEP_VIDEO 0x05
  82. #define CX2341X_DEC_SET_DMA_BLOCK_SIZE 0x08
  83. #define CX2341X_DEC_GET_XFER_INFO 0x09
  84. #define CX2341X_DEC_GET_DMA_STATUS 0x0a
  85. #define CX2341X_DEC_SCHED_DMA_FROM_HOST 0x0b
  86. #define CX2341X_DEC_PAUSE_PLAYBACK 0x0d
  87. #define CX2341X_DEC_HALT_FW 0x0e
  88. #define CX2341X_DEC_SET_STANDARD 0x10
  89. #define CX2341X_DEC_GET_VERSION 0x11
  90. #define CX2341X_DEC_SET_STREAM_INPUT 0x14
  91. #define CX2341X_DEC_GET_TIMING_INFO 0x15
  92. #define CX2341X_DEC_SET_AUDIO_MODE 0x16
  93. #define CX2341X_DEC_SET_EVENT_NOTIFICATION 0x17
  94. #define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18
  95. #define CX2341X_DEC_EXTRACT_VBI 0x19
  96. #define CX2341X_DEC_SET_DECODER_SOURCE 0x1a
  97. #define CX2341X_DEC_SET_AUDIO_OUTPUT 0x1b
  98. #define CX2341X_DEC_SET_AV_DELAY 0x1c
  99. #define CX2341X_DEC_SET_PREBUFFERING 0x1e
  100. /* MPEG encoder API */
  101. #define CX2341X_ENC_PING_FW 0x80
  102. #define CX2341X_ENC_START_CAPTURE 0x81
  103. #define CX2341X_ENC_STOP_CAPTURE 0x82
  104. #define CX2341X_ENC_SET_AUDIO_ID 0x89
  105. #define CX2341X_ENC_SET_VIDEO_ID 0x8b
  106. #define CX2341X_ENC_SET_PCR_ID 0x8d
  107. #define CX2341X_ENC_SET_FRAME_RATE 0x8f
  108. #define CX2341X_ENC_SET_FRAME_SIZE 0x91
  109. #define CX2341X_ENC_SET_BIT_RATE 0x95
  110. #define CX2341X_ENC_SET_GOP_PROPERTIES 0x97
  111. #define CX2341X_ENC_SET_ASPECT_RATIO 0x99
  112. #define CX2341X_ENC_SET_DNR_FILTER_MODE 0x9b
  113. #define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d
  114. #define CX2341X_ENC_SET_CORING_LEVELS 0x9f
  115. #define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1
  116. #define CX2341X_ENC_SET_3_2_PULLDOWN 0xb1
  117. #define CX2341X_ENC_SET_VBI_LINE 0xb7
  118. #define CX2341X_ENC_SET_STREAM_TYPE 0xb9
  119. #define CX2341X_ENC_SET_OUTPUT_PORT 0xbb
  120. #define CX2341X_ENC_SET_AUDIO_PROPERTIES 0xbd
  121. #define CX2341X_ENC_HALT_FW 0xc3
  122. #define CX2341X_ENC_GET_VERSION 0xc4
  123. #define CX2341X_ENC_SET_GOP_CLOSURE 0xc5
  124. #define CX2341X_ENC_GET_SEQ_END 0xc6
  125. #define CX2341X_ENC_SET_PGM_INDEX_INFO 0xc7
  126. #define CX2341X_ENC_SET_VBI_CONFIG 0xc8
  127. #define CX2341X_ENC_SET_DMA_BLOCK_SIZE 0xc9
  128. #define CX2341X_ENC_GET_PREV_DMA_INFO_MB_10 0xca
  129. #define CX2341X_ENC_GET_PREV_DMA_INFO_MB_9 0xcb
  130. #define CX2341X_ENC_SCHED_DMA_TO_HOST 0xcc
  131. #define CX2341X_ENC_INITIALIZE_INPUT 0xcd
  132. #define CX2341X_ENC_SET_FRAME_DROP_RATE 0xd0
  133. #define CX2341X_ENC_PAUSE_ENCODER 0xd2
  134. #define CX2341X_ENC_REFRESH_INPUT 0xd3
  135. #define CX2341X_ENC_SET_COPYRIGHT 0xd4
  136. #define CX2341X_ENC_SET_EVENT_NOTIFICATION 0xd5
  137. #define CX2341X_ENC_SET_NUM_VSYNC_LINES 0xd6
  138. #define CX2341X_ENC_SET_PLACEHOLDER 0xd7
  139. #define CX2341X_ENC_MUTE_VIDEO 0xd9
  140. #define CX2341X_ENC_MUTE_AUDIO 0xda
  141. #define CX2341X_ENC_UNKNOWN 0xdb
  142. #define CX2341X_ENC_MISC 0xdc
  143. /* OSD API, specific to the cx23415 */
  144. #define CX2341X_OSD_GET_FRAMEBUFFER 0x41
  145. #define CX2341X_OSD_GET_PIXEL_FORMAT 0x42
  146. #define CX2341X_OSD_SET_PIXEL_FORMAT 0x43
  147. #define CX2341X_OSD_GET_STATE 0x44
  148. #define CX2341X_OSD_SET_STATE 0x45
  149. #define CX2341X_OSD_GET_OSD_COORDS 0x46
  150. #define CX2341X_OSD_SET_OSD_COORDS 0x47
  151. #define CX2341X_OSD_GET_SCREEN_COORDS 0x48
  152. #define CX2341X_OSD_SET_SCREEN_COORDS 0x49
  153. #define CX2341X_OSD_GET_GLOBAL_ALPHA 0x4a
  154. #define CX2341X_OSD_SET_GLOBAL_ALPHA 0x4b
  155. #define CX2341X_OSD_SET_BLEND_COORDS 0x4c
  156. #define CX2341X_OSD_GET_FLICKER_STATE 0x4f
  157. #define CX2341X_OSD_SET_FLICKER_STATE 0x50
  158. #define CX2341X_OSD_BLT_COPY 0x52
  159. #define CX2341X_OSD_BLT_FILL 0x53
  160. #define CX2341X_OSD_BLT_TEXT 0x54
  161. #define CX2341X_OSD_SET_FRAMEBUFFER_WINDOW 0x56
  162. #define CX2341X_OSD_SET_CHROMA_KEY 0x60
  163. #define CX2341X_OSD_GET_ALPHA_CONTENT_INDEX 0x61
  164. #define CX2341X_OSD_SET_ALPHA_CONTENT_INDEX 0x62
  165. #endif /* CX2341X_H */