The DVB video device controls the MPEG2 video decoder of the DVB hardware. It can be accessed through /dev/dvb/adapter0/video0. Data types and and ioctl definitions can be accessed by including linux/dvb/video.h in your application. Note that the DVB video device only controls decoding of the MPEG video stream, not its presentation on the TV or computer screen. On PCs this is typically handled by an associated video4linux device, e.g. /dev/video, which allows scaling and defining output windows. Some DVB cards don’t have their own MPEG decoder, which results in the omission of the audio and video device as well as the video4linux device. The ioctls that deal with SPUs (sub picture units) and navigation packets are only supported on some MPEG decoders made for DVD playback. These ioctls were also used by V4L2 to control MPEG decoders implemented in V4L2. The use of these ioctls for that purpose has been made obsolete and proper V4L2 ioctls or controls have been created to replace that functionality.
Video Data Types
video_format_t The video_format_t data type defined by typedef enum { VIDEO_FORMAT_4_3, /⋆ Select 4:3 format ⋆/ VIDEO_FORMAT_16_9, /⋆ Select 16:9 format. ⋆/ VIDEO_FORMAT_221_1 /⋆ 2.21:1 ⋆/ } 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.
video_displayformat_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_PAN_SCAN, /⋆ use pan and scan format ⋆/ VIDEO_LETTER_BOX, /⋆ use letterbox format ⋆/ VIDEO_CENTER_CUT_OUT /⋆ use center cut out format ⋆/ } video_displayformat_t; as argument.
video_stream_source_t 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_SOURCE_DEMUX, /⋆ Select the demux as the main source ⋆/ VIDEO_SOURCE_MEMORY /⋆ If this source is selected, the stream comes from the user through the write system call ⋆/ } 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.
video_play_state_t The following values can be returned by the VIDEO_GET_STATUS call representing the state of video playback. typedef enum { VIDEO_STOPPED, /⋆ Video is stopped ⋆/ VIDEO_PLAYING, /⋆ Video is currently playing ⋆/ VIDEO_FREEZED /⋆ Video is freezed ⋆/ } video_play_state_t;
struct video_command The structure must be zeroed before use by the application This ensures it can be extended safely in the future. struct video_command { __u32 cmd; __u32 flags; union { struct { __u64 pts; } stop; struct { /⋆ 0 or 1000 specifies normal speed, 1 specifies forward single stepping, -1 specifies backward single stepping, >>1: playback at speed/1000 of the normal speed, <-1: reverse playback at (-speed/1000) of the normal speed. ⋆/ __s32 speed; __u32 format; } play; struct { __u32 data[16]; } raw; }; };
video_size_t typedef struct { int w; int h; video_format_t aspect_ratio; } video_size_t;
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 { __s32 type; #define VIDEO_EVENT_SIZE_CHANGED 1 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 #define VIDEO_EVENT_DECODER_STOPPED 3 #define VIDEO_EVENT_VSYNC 4 __kernel_time_t timestamp; union { video_size_t size; unsigned int frame_rate; /⋆ in frames per 1000sec ⋆/ unsigned char vsync_field; /⋆ unknown/odd/even/progressive ⋆/ } u; };
struct video_status The VIDEO_GET_STATUS call returns the following structure informing about various states of the playback operation. struct video_status { int video_blank; /⋆ blank video on freeze? ⋆/ video_play_state_t play_state; /⋆ current state of playback ⋆/ video_stream_source_t stream_source; /⋆ current source (demux/memory) ⋆/ video_format_t video_format; /⋆ current aspect ratio of stream ⋆/ video_displayformat_t display_format;/⋆ selected cropping mode ⋆/ }; 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.
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; /⋆ pointer to a single iframe in memory ⋆/ int32_t size; };
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
video_system_t 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_PAL, VIDEO_SYSTEM_NTSC, VIDEO_SYSTEM_PALN, VIDEO_SYSTEM_PALNc, VIDEO_SYSTEM_PALM, VIDEO_SYSTEM_NTSC60, VIDEO_SYSTEM_PAL60, VIDEO_SYSTEM_PALM60 } video_system_t;
struct video_highlight Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight information. The call expects the following format for that information: typedef 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
##############################################################################
# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
classes:
  - system.maas.region.single
  - service.maas.cluster.single
  - cluster.baremetal-mcp-pike-common-ha.infra.lab_proxy_pdf
parameters:
  _param:
    dhcp_interface: ${_param:opnfv_fn_vm_primary_interface}
    primary_interface: ${_param:opnfv_fn_vm_secondary_interface}
    pxe_interface: ${_param:opnfv_fn_vm_tertiary_interface}
    interface_mtu: 1500
    # MaaS has issues using MTU > 1500 for PXE interface
    pxe_interface_mtu: 1500
    linux_system_codename: xenial
    maas_admin_username: opnfv
    maas_admin_password: opnfv_secret
    maas_db_password: opnfv_secret
    dns_server01: ${_param:opnfv_dns_server01}
    single_address: ${_param:infra_maas_node01_deploy_address}
    hwe_kernel: 'ga-16.04'
  maas:
    region:
      salt_master_ip: ${_param:reclass_config_master}
      domain: ${_param:cluster_domain}
      maas_config:
        commissioning_distro_series: 'xenial'
        default_distro_series: 'xenial'
        default_osystem: 'ubuntu'
        default_storage_layout: 'lvm'
        enable_http_proxy: true
        disk_erase_with_secure_erase: false
        dnssec_validation: 'no'
        enable_third_party_drivers: true
        network_discovery: 'enabled'
        default_min_hwe_kernel: ${_param:hwe_kernel}
      subnets:
        opnfv_maas_pxe:
          name: ${_param:opnfv_infra_maas_pxe_network_address}/24
          cidr: ${_param:opnfv_infra_maas_pxe_network_address}/24
          gateway_ip: ${_param:single_address}
          iprange:
            start: ${_param:opnfv_infra_maas_pxe_start_address}
            end: ${_param:opnfv_infra_maas_pxe_end_address}
            type: dynamic
          vlans:
            untagged:
              vid: 0
              dhcp_on: true
              primary_rack: ${_param:infra_maas_node01_hostname}
      machines:
        kvm01:
          interface:
            mac: ${_param:opnfv_maas_node01_interface_mac}
          power_parameters:
            power_address: ${_param:opnfv_maas_node01_power_address}
            power_password: ${_param:opnfv_maas_node01_power_password}
            power_type: ${_param:opnfv_maas_node01_power_type}
            power_user: ${_param:opnfv_maas_node01_power_user}
          architecture: ${_param:opnfv_maas_node01_architecture}
          distro_series: xenial
          hwe_kernel: ${_param:hwe_kernel}
        kvm02:
          interface:
            mac: ${_param:opnfv_maas_node02_interface_mac}
          power_parameters:
            power_address: ${_param:opnfv_maas_node02_power_address}
            power_password: ${_param:opnfv_maas_node02_power_password}
            power_type: ${_param:opnfv_maas_node02_power_type}
            power_user: ${_param:opnfv_maas_node02_power_user}
          architecture: ${_param:opnfv_maas_node02_architecture}
          distro_series: xenial
          hwe_kernel: ${_param:hwe_kernel}
        kvm03:
          interface:
            mac: ${_param:opnfv_maas_node03_interface_mac}
          power_parameters:
            power_address: ${_param:opnfv_maas_node03_power_address}
            power_password: ${_param:opnfv_maas_node03_power_password}
            power_type: ${_param:opnfv_maas_node03_power_type}
            power_user: ${_param:opnfv_maas_node03_power_user}
          architecture: ${_param:opnfv_maas_node03_architecture}
          distro_series: xenial
          hwe_kernel: ${_param:hwe_kernel}
        cmp001:
          interface:
            mac: ${_param:opnfv_maas_node04_interface_mac}
          power_parameters:
            power_address: ${_param:opnfv_maas_node04_power_address}
            power_password: ${_param:opnfv_maas_node04_power_password}
            power_type: ${_param:opnfv_maas_node04_power_type}
            power_user: ${_param:opnfv_maas_node04_power_user}
          architecture: ${_param:opnfv_maas_node04_architecture}
          distro_series: xenial
          hwe_kernel: ${_param:hwe_kernel}
        cmp002:
          interface:
            mac: ${_param:opnfv_maas_node05_interface_mac}
          power_parameters:
            power_address: ${_param:opnfv_maas_node05_power_address}
            power_password: ${_param:opnfv_maas_node05_power_password}
            power_type: ${_param:opnfv_maas_node05_power_type}
            power_user: ${_param:opnfv_maas_node05_power_user}
          architecture: ${_param:opnfv_maas_node05_architecture}
          distro_series: xenial
          hwe_kernel: ${_param:hwe_kernel}
    cluster:
      saltstack_repo_xenial: "http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.11/ xenial main"
  linux:
    network:
      interface:
        dhcp_interface:
          enabled: true
          name: ${_param:dhcp_interface}
          type: eth
          proto: dhcp
        primary_interface:
          enabled: true
          name: ${_param:primary_interface}
          mtu: ${_param:interface_mtu}
          proto: static
          address: ${_param:infra_maas_node01_address}
          netmask: 255.255.255.0
          type: eth
        pxe_interface:
          enabled: true
          name: ${_param:pxe_interface}
          mtu: ${_param:pxe_interface_mtu}
          proto: static
          address: ${_param:single_address}
          netmask: 255.255.255.0
          type: eth
ble> &return-value-dvb;
VIDEO_GET_SIZE DESCRIPTION This ioctl returns the size and aspect ratio. SYNOPSIS int ioctl(int fd, int request = VIDEO_GET_SIZE, video_size_t *size); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_GET_SIZE for this command. video_size_t *size Returns the size and aspect ratio. &return-value-dvb;
VIDEO_SET_DISPLAY_FORMAT DESCRIPTION This ioctl call asks the Video Device to select the video format to be applied by the MPEG chip on the video. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_DISPLAY_FORMAT, video_display_format_t format); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_DISPLAY_FORMAT for this command. video_display_format_t format Selects the video format to be used. &return-value-dvb;
VIDEO_STILLPICTURE DESCRIPTION This ioctl call asks the Video Device to display a still picture (I-frame). The input data shall contain an I-frame. If the pointer is NULL, then the current displayed still picture is blanked. SYNOPSIS int ioctl(fd, int request = VIDEO_STILLPICTURE, struct video_still_picture ⋆sp); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_STILLPICTURE for this command. struct video_still_picture *sp Pointer to a location where an I-frame and size is stored. &return-value-dvb;
VIDEO_FAST_FORWARD DESCRIPTION This ioctl call asks the Video Device to skip decoding of N number of I-frames. This call can only be used if VIDEO_SOURCE_MEMORY is selected. SYNOPSIS int ioctl(fd, int request = VIDEO_FAST_FORWARD, int nFrames); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_FAST_FORWARD for this command. int nFrames The number of frames to skip. &return-value-dvb; EPERM Mode VIDEO_SOURCE_MEMORY not selected.
VIDEO_SLOWMOTION DESCRIPTION This ioctl call asks the video device to repeat decoding frames N number of times. This call can only be used if VIDEO_SOURCE_MEMORY is selected. SYNOPSIS int ioctl(fd, int request = VIDEO_SLOWMOTION, int nFrames); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SLOWMOTION for this command. int nFrames The number of times to repeat each frame. &return-value-dvb; EPERM Mode VIDEO_SOURCE_MEMORY not selected.
VIDEO_GET_CAPABILITIES DESCRIPTION This ioctl call asks the video device about its decoding capabilities. On success it returns and integer which has bits set according to the defines in section ??. SYNOPSIS int ioctl(fd, int request = VIDEO_GET_CAPABILITIES, unsigned int ⋆cap); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_GET_CAPABILITIES for this command. unsigned int *cap Pointer to a location where to store the capability information. &return-value-dvb;
VIDEO_SET_ID DESCRIPTION This ioctl selects which sub-stream is to be decoded if a program or system stream is sent to the video device. SYNOPSIS int ioctl(int fd, int request = VIDEO_SET_ID, int id); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_ID for this command. int id video sub-stream id &return-value-dvb; EINVAL Invalid sub-stream id.
VIDEO_CLEAR_BUFFER DESCRIPTION This ioctl call clears all video buffers in the driver and in the decoder hardware. SYNOPSIS int ioctl(fd, int request = VIDEO_CLEAR_BUFFER); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_CLEAR_BUFFER for this command. &return-value-dvb;
VIDEO_SET_STREAMTYPE DESCRIPTION This ioctl tells the driver which kind of stream to expect being written to it. If this call is not used the default of video PES is used. Some drivers might not support this call and always expect PES. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_STREAMTYPE, int type); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_STREAMTYPE for this command. int type stream type &return-value-dvb;
VIDEO_SET_FORMAT DESCRIPTION This ioctl sets the screen format (aspect ratio) of the connected output device (TV) so that the output of the decoder can be adjusted accordingly. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_FORMAT, video_format_t format); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_FORMAT for this command. video_format_t format video format of TV as defined in section ??. &return-value-dvb; EINVAL format is not a valid video format.
VIDEO_SET_SYSTEM DESCRIPTION This ioctl sets the television output format. The format (see section ??) may vary from the color format of the displayed MPEG stream. If the hardware is not able to display the requested format the call will return an error. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_SYSTEM , video_system_t system); PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_FORMAT for this command. video_system_t system video system of TV output. &return-value-dvb; EINVAL system is not a valid or supported video system.
VIDEO_SET_HIGHLIGHT DESCRIPTION This ioctl sets the SPU highlight information for the menu access of a DVD. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_HIGHLIGHT ,video_highlight_t ⋆vhilite) PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_HIGHLIGHT for this command. video_highlight_t *vhilite SPU Highlight information according to section ??. &return-value-dvb;
VIDEO_SET_SPU DESCRIPTION This ioctl activates or deactivates SPU decoding in a DVD input stream. It can only be used, if the driver is able to handle a DVD stream. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_SPU , video_spu_t ⋆spu) PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_SPU for this command. video_spu_t *spu SPU decoding (de)activation and subid setting according to section ??. &return-value-dvb; EINVAL input is not a valid spu setting or driver cannot handle SPU.
VIDEO_SET_SPU_PALETTE DESCRIPTION This ioctl sets the SPU color palette. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_SPU_PALETTE ,video_spu_palette_t ⋆palette ) PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_SPU_PALETTE for this command. video_spu_palette_t *palette SPU palette according to section ??. &return-value-dvb; EINVAL input is not a valid palette or driver doesn’t handle SPU.
VIDEO_GET_NAVI DESCRIPTION This ioctl returns navigational information from the DVD stream. This is especially needed if an encoded stream has to be decoded by the hardware. SYNOPSIS int ioctl(fd, int request = VIDEO_GET_NAVI , video_navi_pack_t ⋆navipack) PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_GET_NAVI for this command. video_navi_pack_t *navipack PCI or DSI pack (private stream 2) according to section ??. &return-value-dvb; EFAULT driver is not able to return navigational information
VIDEO_SET_ATTRIBUTES DESCRIPTION This ioctl is intended for DVD playback and allows you to set certain information about the stream. Some hardware may not need this information, but the call also tells the hardware to prepare for DVD playback. SYNOPSIS int ioctl(fd, int request = VIDEO_SET_ATTRIBUTE ,video_attributes_t vattr) PARAMETERS int fd File descriptor returned by a previous call to open(). int request Equals VIDEO_SET_ATTRIBUTE for this command. video_attributes_t vattr video attributes according to section ??. &return-value-dvb; EINVAL input is not a valid attribute setting.