logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

video.h (6369B)


  1. /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
  2. /*
  3. * video.h - DEPRECATED MPEG-TS video decoder API
  4. *
  5. * NOTE: should not be used on future drivers
  6. *
  7. * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
  8. * & Ralph Metzler <ralph@convergence.de>
  9. * for convergence integrated media GmbH
  10. */
  11. #ifndef _DVBVIDEO_H_
  12. #define _DVBVIDEO_H_
  13. #include <linux/types.h>
  14. #include <time.h>
  15. typedef enum {
  16. VIDEO_FORMAT_4_3, /* Select 4:3 format */
  17. VIDEO_FORMAT_16_9, /* Select 16:9 format. */
  18. VIDEO_FORMAT_221_1 /* 2.21:1 */
  19. } video_format_t;
  20. typedef enum {
  21. VIDEO_PAN_SCAN, /* use pan and scan format */
  22. VIDEO_LETTER_BOX, /* use letterbox format */
  23. VIDEO_CENTER_CUT_OUT /* use center cut out format */
  24. } video_displayformat_t;
  25. typedef struct {
  26. int w;
  27. int h;
  28. video_format_t aspect_ratio;
  29. } video_size_t;
  30. typedef enum {
  31. VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
  32. VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
  33. comes from the user through the write
  34. system call */
  35. } video_stream_source_t;
  36. typedef enum {
  37. VIDEO_STOPPED, /* Video is stopped */
  38. VIDEO_PLAYING, /* Video is currently playing */
  39. VIDEO_FREEZED /* Video is freezed */
  40. } video_play_state_t;
  41. /* Decoder commands */
  42. #define VIDEO_CMD_PLAY (0)
  43. #define VIDEO_CMD_STOP (1)
  44. #define VIDEO_CMD_FREEZE (2)
  45. #define VIDEO_CMD_CONTINUE (3)
  46. /* Flags for VIDEO_CMD_FREEZE */
  47. #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
  48. /* Flags for VIDEO_CMD_STOP */
  49. #define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
  50. #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
  51. /* Play input formats: */
  52. /* The decoder has no special format requirements */
  53. #define VIDEO_PLAY_FMT_NONE (0)
  54. /* The decoder requires full GOPs */
  55. #define VIDEO_PLAY_FMT_GOP (1)
  56. /* The structure must be zeroed before use by the application
  57. This ensures it can be extended safely in the future. */
  58. struct video_command {
  59. __u32 cmd;
  60. __u32 flags;
  61. union {
  62. struct {
  63. __u64 pts;
  64. } stop;
  65. struct {
  66. /* 0 or 1000 specifies normal speed,
  67. 1 specifies forward single stepping,
  68. -1 specifies backward single stepping,
  69. >1: playback at speed/1000 of the normal speed,
  70. <-1: reverse playback at (-speed/1000) of the normal speed. */
  71. __s32 speed;
  72. __u32 format;
  73. } play;
  74. struct {
  75. __u32 data[16];
  76. } raw;
  77. };
  78. };
  79. /* FIELD_UNKNOWN can be used if the hardware does not know whether
  80. the Vsync is for an odd, even or progressive (i.e. non-interlaced)
  81. field. */
  82. #define VIDEO_VSYNC_FIELD_UNKNOWN (0)
  83. #define VIDEO_VSYNC_FIELD_ODD (1)
  84. #define VIDEO_VSYNC_FIELD_EVEN (2)
  85. #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
  86. struct video_event {
  87. __s32 type;
  88. #define VIDEO_EVENT_SIZE_CHANGED 1
  89. #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
  90. #define VIDEO_EVENT_DECODER_STOPPED 3
  91. #define VIDEO_EVENT_VSYNC 4
  92. /* unused, make sure to use atomic time for y2038 if it ever gets used */
  93. long timestamp;
  94. union {
  95. video_size_t size;
  96. unsigned int frame_rate; /* in frames per 1000sec */
  97. unsigned char vsync_field; /* unknown/odd/even/progressive */
  98. } u;
  99. };
  100. struct video_status {
  101. int video_blank; /* blank video on freeze? */
  102. video_play_state_t play_state; /* current state of playback */
  103. video_stream_source_t stream_source; /* current source (demux/memory) */
  104. video_format_t video_format; /* current aspect ratio of stream*/
  105. video_displayformat_t display_format;/* selected cropping mode */
  106. };
  107. struct video_still_picture {
  108. char *iFrame; /* pointer to a single iframe in memory */
  109. __s32 size;
  110. };
  111. typedef __u16 video_attributes_t;
  112. /* bits: descr. */
  113. /* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
  114. /* 13-12 TV system (0=525/60, 1=625/50) */
  115. /* 11-10 Aspect ratio (0=4:3, 3=16:9) */
  116. /* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
  117. /* 7 line 21-1 data present in GOP (1=yes, 0=no) */
  118. /* 6 line 21-2 data present in GOP (1=yes, 0=no) */
  119. /* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
  120. /* 2 source letterboxed (1=yes, 0=no) */
  121. /* 0 film/camera mode (0=
  122. *camera, 1=film (625/50 only)) */
  123. /* bit definitions for capabilities: */
  124. /* can the hardware decode MPEG1 and/or MPEG2? */
  125. #define VIDEO_CAP_MPEG1 1
  126. #define VIDEO_CAP_MPEG2 2
  127. /* can you send a system and/or program stream to video device?
  128. (you still have to open the video and the audio device but only
  129. send the stream to the video device) */
  130. #define VIDEO_CAP_SYS 4
  131. #define VIDEO_CAP_PROG 8
  132. /* can the driver also handle SPU, NAVI and CSS encoded data?
  133. (CSS API is not present yet) */
  134. #define VIDEO_CAP_SPU 16
  135. #define VIDEO_CAP_NAVI 32
  136. #define VIDEO_CAP_CSS 64
  137. #define VIDEO_STOP _IO('o', 21)
  138. #define VIDEO_PLAY _IO('o', 22)
  139. #define VIDEO_FREEZE _IO('o', 23)
  140. #define VIDEO_CONTINUE _IO('o', 24)
  141. #define VIDEO_SELECT_SOURCE _IO('o', 25)
  142. #define VIDEO_SET_BLANK _IO('o', 26)
  143. #define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
  144. #define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
  145. #define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
  146. #define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
  147. #define VIDEO_FAST_FORWARD _IO('o', 31)
  148. #define VIDEO_SLOWMOTION _IO('o', 32)
  149. #define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
  150. #define VIDEO_CLEAR_BUFFER _IO('o', 34)
  151. #define VIDEO_SET_STREAMTYPE _IO('o', 36)
  152. #define VIDEO_SET_FORMAT _IO('o', 37)
  153. #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
  154. /**
  155. * VIDEO_GET_PTS
  156. *
  157. * Read the 33 bit presentation time stamp as defined
  158. * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
  159. *
  160. * The PTS should belong to the currently played
  161. * frame if possible, but may also be a value close to it
  162. * like the PTS of the last decoded frame or the last PTS
  163. * extracted by the PES parser.
  164. */
  165. #define VIDEO_GET_PTS _IOR('o', 57, __u64)
  166. /* Read the number of displayed frames since the decoder was started */
  167. #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
  168. #define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
  169. #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
  170. #endif /* _DVBVIDEO_H_ */