1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Appendix K. DVB Video Header File</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvbapi.html" title="Part II. LINUX DVB API"><link rel="prev" href="net_h.html" title="Appendix J. DVB Network Header File"><link rel="next" href="remotes.html" title="Part III. Remote Controller API"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix K. DVB Video Header File</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="net_h.html">Prev</a> </td><th width="60%" align="center">Part II. LINUX DVB API</th><td width="20%" align="right"> <a accesskey="n" href="remotes.html">Next</a></td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h2 class="title"><a name="video_h"></a>Appendix K. DVB Video Header File</h2></div></div></div><pre class="programlisting"> 2/* 3 * video.h 4 * 5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> 6 * & Ralph Metzler <ralph@convergence.de> 7 * for convergence integrated media GmbH 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public License 11 * as published by the Free Software Foundation; either version 2.1 12 * of the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * 23 */ 24 25#ifndef _UAPI_DVBVIDEO_H_ 26#define _UAPI_DVBVIDEO_H_ 27 28#include <linux/types.h> 29#ifndef __KERNEL__ 30#include <stdint.h> 31#include <time.h> 32#endif 33 34typedef enum { 35 VIDEO_FORMAT_4_3, /* Select 4:3 format */ 36 VIDEO_FORMAT_16_9, /* Select 16:9 format. */ 37 VIDEO_FORMAT_221_1 /* 2.21:1 */ 38} <a class="link" href="dvb_video.html#video-format-t" title="video_format_t">video_format_t</a>; 39 40 41typedef enum { 42 VIDEO_SYSTEM_PAL, 43 VIDEO_SYSTEM_NTSC, 44 VIDEO_SYSTEM_PALN, 45 VIDEO_SYSTEM_PALNc, 46 VIDEO_SYSTEM_PALM, 47 VIDEO_SYSTEM_NTSC60, 48 VIDEO_SYSTEM_PAL60, 49 VIDEO_SYSTEM_PALM60 50} <a class="link" href="dvb_video.html#video-system" title="video_system_t">video_system_t</a>; 51 52 53typedef enum { 54 VIDEO_PAN_SCAN, /* use pan and scan format */ 55 VIDEO_LETTER_BOX, /* use letterbox format */ 56 VIDEO_CENTER_CUT_OUT /* use center cut out format */ 57} <a class="link" href="dvb_video.html#video-displayformat-t" title="video_displayformat_t">video_displayformat_t</a>; 58 59typedef struct { 60 int w; 61 int h; 62 video_format_t aspect_ratio; 63} <a class="link" href="dvb_video.html#video-size-t" title="video_size_t">video_size_t</a>; 64 65typedef enum { 66 VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ 67 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream 68 comes from the user through the write 69 system call */ 70} <a class="link" href="dvb_video.html#video-stream-source-t" title="video_stream_source_t">video_stream_source_t</a>; 71 72 73typedef enum { 74 VIDEO_STOPPED, /* Video is stopped */ 75 VIDEO_PLAYING, /* Video is currently playing */ 76 VIDEO_FREEZED /* Video is freezed */ 77} <a class="link" href="dvb_video.html#video-play-state-t" title="video_play_state_t">video_play_state_t</a>; 78 79 80/* Decoder commands */ 81#define VIDEO_CMD_PLAY (0) 82#define VIDEO_CMD_STOP (1) 83#define VIDEO_CMD_FREEZE (2) 84#define VIDEO_CMD_CONTINUE (3) 85 86/* Flags for VIDEO_CMD_FREEZE */ 87#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) 88 89/* Flags for VIDEO_CMD_STOP */ 90#define VIDEO_CMD_STOP_TO_BLACK (1 << 0) 91#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) 92 93/* Play input formats: */ 94/* The decoder has no special format requirements */ 95#define VIDEO_PLAY_FMT_NONE (0) 96/* The decoder requires full GOPs */ 97#define VIDEO_PLAY_FMT_GOP (1) 98 99/* The structure must be zeroed before use by the application 100 This ensures it can be extended safely in the future. */ 101struct <a class="link" href="dvb_video.html#video-command" title="struct video_command">video_command</a> { 102 __u32 cmd; 103 __u32 flags; 104 union { 105 struct { 106 __u64 pts; 107 } stop; 108 109 struct { 110 /* 0 or 1000 specifies normal speed, 111 1 specifies forward single stepping, 112 -1 specifies backward single stepping, 113 >1: playback at speed/1000 of the normal speed, 114 <-1: reverse playback at (-speed/1000) of the normal speed. */ 115 __s32 speed; 116 __u32 format; 117 } play; 118 119 struct { 120 __u32 data[16]; 121 } raw; 122 }; 123}; 124 125/* FIELD_UNKNOWN can be used if the hardware does not know whether 126 the Vsync is for an odd, even or progressive (i.e.ie; non-interlaced) 127 field. */ 128#define VIDEO_VSYNC_FIELD_UNKNOWN (0) 129#define VIDEO_VSYNC_FIELD_ODD (1) 130#define VIDEO_VSYNC_FIELD_EVEN (2) 131#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) 132 133struct <a class="link" href="dvb_video.html#video-event" title="struct video_event">video_event</a> { 134 __s32 type; 135#define VIDEO_EVENT_SIZE_CHANGED 1 136#define VIDEO_EVENT_FRAME_RATE_CHANGED 2 137#define VIDEO_EVENT_DECODER_STOPPED 3 138#define VIDEO_EVENT_VSYNC 4 139 __kernel_time_t timestamp; 140 union { 141 video_size_t size; 142 unsigned int frame_rate; /* in frames per 1000sec */ 143 unsigned char vsync_field; /* unknown/odd/even/progressive */ 144 } u; 145}; 146 147 148struct <a class="link" href="dvb_video.html#video-status" title="struct video_status">video_status</a> { 149 int video_blank; /* blank video on freeze? */ 150 video_play_state_t play_state; /* current state of playback */ 151 video_stream_source_t stream_source; /* current source (demux/memory) */ 152 video_format_t video_format; /* current aspect ratio of stream*/ 153 video_displayformat_t display_format;/* selected cropping mode */ 154}; 155 156 157struct <a class="link" href="dvb_video.html#video-still-picture" title="struct video_still_picture">video_still_picture</a> { 158 char __user *iFrame; /* pointer to a single iframe in memory */ 159 __s32 size; 160}; 161 162 163typedef 164struct <a class="link" href="dvb_video.html#video-highlight" title="struct video_highlight">video_highlight</a> { 165 int active; /* 1=show highlight, 0=hide highlight */ 166 __u8 contrast1; /* 7- 4 Pattern pixel contrast */ 167 /* 3- 0 Background pixel contrast */ 168 __u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */ 169 /* 3- 0 Emphasis pixel-1 contrast */ 170 __u8 color1; /* 7- 4 Pattern pixel color */ 171 /* 3- 0 Background pixel color */ 172 __u8 color2; /* 7- 4 Emphasis pixel-2 color */ 173 /* 3- 0 Emphasis pixel-1 color */ 174 __u32 ypos; /* 23-22 auto action mode */ 175 /* 21-12 start y */ 176 /* 9- 0 end y */ 177 __u32 xpos; /* 23-22 button color number */ 178 /* 21-12 start x */ 179 /* 9- 0 end x */ 180} <a class="link" href="dvb_video.html#video-highlight" title="struct video_highlight">video_highlight_t</a>; 181 182 183typedef struct <a class="link" href="dvb_video.html#video-spu" title="struct video_spu">video_spu</a> { 184 int active; 185 int stream_id; 186} <a class="link" href="dvb_video.html#video-spu" title="struct video_spu">video_spu_t</a>; 187 188 189typedef struct <a class="link" href="dvb_video.html#video-spu-palette" title="struct video_spu_palette">video_spu_palette</a> { /* SPU Palette information */ 190 int length; 191 __u8 __user *palette; 192} <a class="link" href="dvb_video.html#video-spu-palette" title="struct video_spu_palette">video_spu_palette_t</a>; 193 194 195typedef struct <a class="link" href="dvb_video.html#video-navi-pack" title="struct video_navi_pack">video_navi_pack</a> { 196 int length; /* 0 ... 1024 */ 197 __u8 data[1024]; 198} <a class="link" href="dvb_video.html#video-navi-pack" title="struct video_navi_pack">video_navi_pack_t</a>; 199 200 201typedef __u16 video_attributes_t; 202/* bits: descr. */ 203/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ 204/* 13-12 TV system (0=525/60, 1=625/50) */ 205/* 11-10 Aspect ratio (0=4:3, 3=16:9) */ 206/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ 207/* 7 line 21-1 data present in GOP (1=yes, 0=no) */ 208/* 6 line 21-2 data present in GOP (1=yes, 0=no) */ 209/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ 210/* 2 source letterboxed (1=yes, 0=no) */ 211/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ 212 213 214/* bit definitions for capabilities: */ 215/* can the hardware decode MPEG1 and/or MPEG2? */ 216#define VIDEO_CAP_MPEG1 1 217#define VIDEO_CAP_MPEG2 2 218/* can you send a system and/or program stream to video device? 219 (you still have to open the video and the audio device but only 220 send the stream to the video device) */ 221#define VIDEO_CAP_SYS 4 222#define VIDEO_CAP_PROG 8 223/* can the driver also handle SPU, NAVI and CSS encoded data? 224 (CSS API is not present yet) */ 225#define VIDEO_CAP_SPU 16 226#define VIDEO_CAP_NAVI 32 227#define VIDEO_CAP_CSS 64 228 229 230#define <a class="link" href="video_function_calls.html#VIDEO_STOP" title="VIDEO_STOP">VIDEO_STOP</a> _IO('o', 21) 231#define <a class="link" href="video_function_calls.html#VIDEO_PLAY" title="VIDEO_PLAY">VIDEO_PLAY</a> _IO('o', 22) 232#define <a class="link" href="video_function_calls.html#VIDEO_FREEZE" title="VIDEO_FREEZE">VIDEO_FREEZE</a> _IO('o', 23) 233#define <a class="link" href="video_function_calls.html#VIDEO_CONTINUE" title="VIDEO_CONTINUE">VIDEO_CONTINUE</a> _IO('o', 24) 234#define <a class="link" href="video_function_calls.html#VIDEO_SELECT_SOURCE" title="VIDEO_SELECT_SOURCE">VIDEO_SELECT_SOURCE</a> _IO('o', 25) 235#define <a class="link" href="video_function_calls.html#VIDEO_SET_BLANK" title="VIDEO_SET_BLANK">VIDEO_SET_BLANK</a> _IO('o', 26) 236#define <a class="link" href="video_function_calls.html#VIDEO_GET_STATUS" title="VIDEO_GET_STATUS">VIDEO_GET_STATUS</a> _IOR('o', 27, struct video_status) 237#define <a class="link" href="video_function_calls.html#VIDEO_GET_EVENT" title="VIDEO_GET_EVENT">VIDEO_GET_EVENT</a> _IOR('o', 28, struct video_event) 238#define <a class="link" href="video_function_calls.html#VIDEO_SET_DISPLAY_FORMAT" title="VIDEO_SET_DISPLAY_FORMAT">VIDEO_SET_DISPLAY_FORMAT</a> _IO('o', 29) 239#define <a class="link" href="video_function_calls.html#VIDEO_STILLPICTURE" title="VIDEO_STILLPICTURE">VIDEO_STILLPICTURE</a> _IOW('o', 30, struct video_still_picture) 240#define <a class="link" href="video_function_calls.html#VIDEO_FAST_FORWARD" title="VIDEO_FAST_FORWARD">VIDEO_FAST_FORWARD</a> _IO('o', 31) 241#define <a class="link" href="video_function_calls.html#VIDEO_SLOWMOTION" title="VIDEO_SLOWMOTION">VIDEO_SLOWMOTION</a> _IO('o', 32) 242#define <a class="link" href="video_function_calls.html#VIDEO_GET_CAPABILITIES" title="VIDEO_GET_CAPABILITIES">VIDEO_GET_CAPABILITIES</a> _IOR('o', 33, unsigned int) 243#define <a class="link" href="video_function_calls.html#VIDEO_CLEAR_BUFFER" title="VIDEO_CLEAR_BUFFER">VIDEO_CLEAR_BUFFER</a> _IO('o', 34) 244#define <a class="link" href="video_function_calls.html#VIDEO_SET_ID" title="VIDEO_SET_ID">VIDEO_SET_ID</a> _IO('o', 35) 245#define <a class="link" href="video_function_calls.html#VIDEO_SET_STREAMTYPE" title="VIDEO_SET_STREAMTYPE">VIDEO_SET_STREAMTYPE</a> _IO('o', 36) 246#define <a class="link" href="video_function_calls.html#VIDEO_SET_FORMAT" title="VIDEO_SET_FORMAT">VIDEO_SET_FORMAT</a> _IO('o', 37) 247#define <a class="link" href="video_function_calls.html#VIDEO_SET_SYSTEM" title="VIDEO_SET_SYSTEM">VIDEO_SET_SYSTEM</a> _IO('o', 38) 248#define <a class="link" href="video_function_calls.html#VIDEO_SET_HIGHLIGHT" title="VIDEO_SET_HIGHLIGHT">VIDEO_SET_HIGHLIGHT</a> _IOW('o', 39, video_highlight_t) 249#define <a class="link" href="video_function_calls.html#VIDEO_SET_SPU" title="VIDEO_SET_SPU">VIDEO_SET_SPU</a> _IOW('o', 50, video_spu_t) 250#define <a class="link" href="video_function_calls.html#VIDEO_SET_SPU_PALETTE" title="VIDEO_SET_SPU_PALETTE">VIDEO_SET_SPU_PALETTE</a> _IOW('o', 51, video_spu_palette_t) 251#define <a class="link" href="video_function_calls.html#VIDEO_GET_NAVI" title="VIDEO_GET_NAVI">VIDEO_GET_NAVI</a> _IOR('o', 52, video_navi_pack_t) 252#define <a class="link" href="video_function_calls.html#VIDEO_SET_ATTRIBUTES" title="VIDEO_SET_ATTRIBUTES">VIDEO_SET_ATTRIBUTES</a> _IO('o', 53) 253#define <a class="link" href="video_function_calls.html#VIDEO_GET_SIZE" title="VIDEO_GET_SIZE">VIDEO_GET_SIZE</a> _IOR('o', 55, video_size_t) 254#define <a class="link" href="video_function_calls.html#VIDEO_GET_FRAME_RATE" title="VIDEO_GET_FRAME_RATE">VIDEO_GET_FRAME_RATE</a> _IOR('o', 56, unsigned int) 255 256/** 257 * VIDEO_GET_PTS 258 * 259 * Read the 33 bit presentation time stamp as defined 260 * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. 261 * 262 * The PTS should belong to the currently played 263 * frame if possible, but may also be a value close to it 264 * like the PTS of the last decoded frame or the last PTS 265 * extracted by the PES parser. 266 */ 267#define <a class="link" href="video_function_calls.html#VIDEO_GET_PTS" title="VIDEO_GET_PTS">VIDEO_GET_PTS</a> _IOR('o', 57, __u64) 268 269/* Read the number of displayed frames since the decoder was started */ 270#define <a class="link" href="video_function_calls.html#VIDEO_GET_FRAME_COUNT" title="VIDEO_GET_FRAME_COUNT">VIDEO_GET_FRAME_COUNT</a> _IOR('o', 58, __u64) 271 272#define <a class="link" href="video_function_calls.html#VIDEO_COMMAND" title="VIDEO_COMMAND">VIDEO_COMMAND</a> _IOWR('o', 59, struct video_command) 273#define <a class="link" href="video_function_calls.html#VIDEO_TRY_COMMAND" title="VIDEO_TRY_COMMAND">VIDEO_TRY_COMMAND</a> _IOWR('o', 60, struct video_command) 274 275#endif /* _UAPI_DVBVIDEO_H_ */ 276</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="net_h.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dvbapi.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="remotes.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix J. DVB Network Header File </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part III. Remote Controller API</td></tr></table></div></body></html> 277