4.1. Video Data Types

4.1.1. video_format_t

The video_format_t data type defined by

 typedef enum {
 } video_format_t;

is used in the VIDEO_SET_FORMAT function (??) to tell the driver which aspect ratio the output hardware (e.g. TV) has. It is also used in the data structures video_status (??) returned by VIDEO_GET_STATUS (??) and video_event (??) returned by VIDEO_GET_EVENT (??) which report about the display format of the current video stream.

4.1.2. video_display_format_t

In case the display format of the video stream and of the display hardware differ the application has to specify how to handle the cropping of the picture. This can be done using the VIDEO_SET_DISPLAY_FORMAT call (??) which accepts

 typedef enum {
 } video_display_format_t;

as argument.

4.1.3. video stream source

The video stream source is set through the VIDEO_SELECT_SOURCE call and can take the following values, depending on whether we are replaying from an internal (demuxer) or external (user write) source.

 typedef enum {
 } video_stream_source_t;

VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY is selected the stream comes from the application through the write() system call.

4.1.4. video play state

The following values can be returned by the VIDEO_GET_STATUS call representing the state of video playback.

 typedef enum {
 } video_play_state_t;

4.1.5. struct video_event

The following is the structure of a video event as it is returned by the VIDEO_GET_EVENT call.

 struct video_event {
	 int32_t type;
	 time_t timestamp;
	 union {
		 video_format_t video_format;
	 } u;

4.1.6. struct video_status

The VIDEO_GET_STATUS call returns the following structure informing about various states of the playback operation.

 struct video_status {
	 boolean video_blank;
	 video_play_state_t play_state;
	 video_stream_source_t stream_source;
	 video_format_t video_format;
	 video_displayformat_t display_format;

If video_blank is set video will be blanked out if the channel is changed or if playback is stopped. Otherwise, the last picture will be displayed. play_state indicates if the video is currently frozen, stopped, or being played back. The stream_source corresponds to the seleted source for the video stream. It can come either from the demultiplexer or from memory. The video_format indicates the aspect ratio (one of 4:3 or 16:9) of the currently played video stream. Finally, display_format corresponds to the selected cropping mode in case the source video format is not the same as the format of the output device.

4.1.7. struct video_still_picture

An I-frame displayed via the VIDEO_STILLPICTURE call is passed on within the following structure.

 /⋆ pointer to and size of a single iframe in memory ⋆/
 struct video_still_picture {
	 char ⋆iFrame;
	 int32_t size;

4.1.8. video capabilities

A call to VIDEO_GET_CAPABILITIES returns an unsigned integer with the following bits set according to the hardwares capabilities.

 /⋆ bit definitions for capabilities: ⋆/
 /⋆ can the hardware decode MPEG1 and/or MPEG2? ⋆/
 #define VIDEO_CAP_MPEG1   1
 #define VIDEO_CAP_MPEG2   2
 /⋆ can you send a system and/or program stream to video device?
    (you still have to open the video and the audio device but only
     send the stream to the video device) ⋆/
 #define VIDEO_CAP_SYS     4
 #define VIDEO_CAP_PROG    8
 /⋆ can the driver also handle SPU, NAVI and CSS encoded data?
    (CSS API is not present yet) ⋆/
 #define VIDEO_CAP_SPU    16
 #define VIDEO_CAP_NAVI   32
 #define VIDEO_CAP_CSS    64

4.1.9. video system

A call to VIDEO_SET_SYSTEM sets the desired video system for TV output. The following system types can be set:

 typedef enum {
 } video_system_t;

4.1.10. struct video_highlight

Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight information. The call expects the following format for that information:

 struct video_highlight {
	 boolean active;      /⋆    1=show highlight, 0=hide highlight ⋆/
	 uint8_t contrast1;   /⋆    7- 4  Pattern pixel contrast ⋆/
			      /⋆    3- 0  Background pixel contrast ⋆/
	 uint8_t contrast2;   /⋆    7- 4  Emphasis pixel-2 contrast ⋆/
			      /⋆    3- 0  Emphasis pixel-1 contrast ⋆/
	 uint8_t color1;      /⋆    7- 4  Pattern pixel color ⋆/
			      /⋆    3- 0  Background pixel color ⋆/
	 uint8_t color2;      /⋆    7- 4  Emphasis pixel-2 color ⋆/
			      /⋆    3- 0  Emphasis pixel-1 color ⋆/
	 uint32_t ypos;       /⋆   23-22  auto action mode ⋆/
			      /⋆   21-12  start y ⋆/
			      /⋆    9- 0  end y ⋆/
	 uint32_t xpos;       /⋆   23-22  button color number ⋆/
			      /⋆   21-12  start x ⋆/
			      /⋆    9- 0  end x ⋆/
 } video_highlight_t;

4.1.11. video SPU

Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according to the following format:

 struct video_spu {
	 boolean active;
	 int stream_id;
 } video_spu_t;

4.1.12. video SPU palette

The following structure is used to set the SPU palette by calling VIDEO_SPU_PALETTE:

 struct video_spu_palette{
	 int length;
	 uint8_t ⋆palette;
 } video_spu_palette_t;

4.1.13. video NAVI pack

In order to get the navigational data the following structure has to be passed to the ioctl VIDEO_GET_NAVI:

 struct video_navi_pack{
	 int length;         /⋆ 0 ... 1024 ⋆/
	 uint8_t data[1024];
 } video_navi_pack_t;

4.1.14. video attributes

The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:

 typedef uint16_t video_attributes_t;
 /⋆   bits: descr. ⋆/
 /⋆   15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) ⋆/
 /⋆   13-12 TV system (0=525/60, 1=625/50) ⋆/
 /⋆   11-10 Aspect ratio (0=4:3, 3=16:9) ⋆/
 /⋆    9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca ⋆/
 /⋆    7    line 21-1 data present in GOP (1=yes, 0=no) ⋆/
 /⋆    6    line 21-2 data present in GOP (1=yes, 0=no) ⋆/
 /⋆    5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 ⋆/
 /⋆    2    source letterboxed (1=yes, 0=no) ⋆/
 /⋆    0    film/camera mode (0=camera, 1=film (625/50 only)) ⋆/