Types and flags used to represent the media graph elements

Table 16.1. Media entity types

MEDIA_ENT_F_UNKNOWN and MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWNUnknown entity. That generally indicates that a driver didn't initialize properly the entity, with is a Kernel bug
MEDIA_ENT_F_IO_V4LData streaming input and/or output entity.
MEDIA_ENT_F_IO_VBIV4L VBI streaming input or output entity
MEDIA_ENT_F_IO_SWRADIOV4L Software Digital Radio (SDR) streaming input or output entity
MEDIA_ENT_F_IO_DTVDVB Digital TV streaming input or output entity
MEDIA_ENT_F_DTV_DEMODDigital TV demodulator entity.
MEDIA_ENT_F_TS_DEMUXMPEG Transport stream demux entity. Could be implemented on hardware or in Kernelspace by the Linux DVB subsystem.
MEDIA_ENT_F_DTV_CADigital TV Conditional Access module (CAM) entity
MEDIA_ENT_F_DTV_NET_DECAPDigital TV network ULE/MLE desencapsulation entity. Could be implemented on hardware or in Kernelspace
MEDIA_ENT_F_CONN_RFConnector for a Radio Frequency (RF) signal.
MEDIA_ENT_F_CONN_SVIDEOConnector for a S-Video signal.
MEDIA_ENT_F_CONN_COMPOSITEConnector for a RGB composite signal.
MEDIA_ENT_F_CAM_SENSORCamera video sensor entity.
MEDIA_ENT_F_FLASHFlash controller entity.
MEDIA_ENT_F_LENSLens controller entity.
MEDIA_ENT_F_ATV_DECODERAnalog video decoder, the basic function of the video decoder is to accept analogue video from a wide variety of sources such as broadcast, DVD players, cameras and video cassette recorders, in either NTSC, PAL, SECAM or HD format, separating the stream into its component parts, luminance and chrominance, and output it in some digital video standard, with appropriate timing signals.
MEDIA_ENT_F_TUNERDigital TV, analog TV, radio and/or software radio tuner, with consists on a PLL tuning stage that converts radio frequency (RF) signal into an Intermediate Frequency (IF). Modern tuners have internally IF-PLL decoders for audio and video, but older models have those stages implemented on separate entities.
MEDIA_ENT_F_IF_VID_DECODERIF-PLL video decoder. It receives the IF from a PLL and decodes the analog TV video signal. This is commonly found on some very old analog tuners, like Philips MK3 designs. They all contain a tda9887 (or some software compatible similar chip, like tda9885). Those devices use a different I2C address than the tuner PLL.
MEDIA_ENT_F_IF_AUD_DECODERIF-PLL sound decoder. It receives the IF from a PLL and decodes the analog TV audio signal. This is commonly found on some very old analog hardware, like Micronas msp3400, Philips tda9840, tda985x, etc. Those devices use a different I2C address than the tuner PLL and should be controlled together with the IF-PLL video decoder.
MEDIA_ENT_F_AUDIO_CAPTUREAudio Capture Function Entity.
MEDIA_ENT_F_AUDIO_PLAYBACKAudio Playback Function Entity.
MEDIA_ENT_F_AUDIO_MIXERAudio Mixer Function Entity.
MEDIA_ENT_F_PROC_VIDEO_COMPOSERVideo composer (blender). An entity capable of video composing must have at least two sink pads and one source pad, and composes input video frames onto output video frames. Composition can be performed using alpha blending, color keying, raster operations (ROP), stitching or any other means.
MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTERVideo pixel formatter. An entity capable of pixel formatting must have at least one sink pad and one source pad. Read pixel formatters read pixels from memory and perform a subset of unpacking, cropping, color keying, alpha multiplication and pixel encoding conversion. Write pixel formatters perform a subset of dithering, pixel encoding conversion and packing and write pixels to memory.
MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONVVideo pixel encoding converter. An entity capable of pixel enconding conversion must have at least one sink pad and one source pad, and convert the encoding of pixels received on its sink pad(s) to a different encoding output on its source pad(s). Pixel encoding conversion includes but isn't limited to RGB to/from HSV, RGB to/from YUV and CFA (Bayer) to RGB conversions.
MEDIA_ENT_F_PROC_VIDEO_LUTVideo look-up table. An entity capable of video lookup table processing must have one sink pad and one source pad. It uses the values of the pixels received on its sink pad to look up entries in internal tables and output them on its source pad. The lookup processing can be performed on all components separately or combine them for multi-dimensional table lookups.
MEDIA_ENT_F_PROC_VIDEO_SCALERVideo scaler. An entity capable of video scaling must have at least one sink pad and one source pad, and scale the video frame(s) received on its sink pad(s) to a different resolution output on its source pad(s). The range of supported scaling ratios is entity-specific and can differ between the horizontal and vertical directions (in particular scaling can be supported in one direction only). Binning and skipping are considered as scaling.
MEDIA_ENT_F_PROC_VIDEO_STATISTICSVideo statistics computation (histogram, 3A, ...). An entity capable of statistics computation must have one sink pad and one source pad. It computes statistics over the frames received on its sink pad and outputs the statistics data on its source pad.

Table 16.2. Media entity flags

MEDIA_ENT_FL_DEFAULTDefault entity for its type. Used to discover the default audio, VBI and video devices, the default camera sensor, ...
MEDIA_ENT_FL_CONNECTORThe entity represents a data conector

Table 16.3. Media interface types

MEDIA_INTF_T_DVB_FEDevice node interface for the Digital TV frontendtypically, /dev/dvb/adapter?/frontend?
MEDIA_INTF_T_DVB_DEMUXDevice node interface for the Digital TV demuxtypically, /dev/dvb/adapter?/demux?
MEDIA_INTF_T_DVB_DVRDevice node interface for the Digital TV DVRtypically, /dev/dvb/adapter?/dvr?
MEDIA_INTF_T_DVB_CADevice node interface for the Digital TV Conditional Accesstypically, /dev/dvb/adapter?/ca?
MEDIA_INTF_T_DVB_FEDevice node interface for the Digital TV network controltypically, /dev/dvb/adapter?/net?
MEDIA_INTF_T_V4L_VIDEODevice node interface for video (V4L)typically, /dev/video?
MEDIA_INTF_T_V4L_VBIDevice node interface for VBI (V4L)typically, /dev/vbi?
MEDIA_INTF_T_V4L_RADIODevice node interface for radio (V4L)typically, /dev/vbi?
MEDIA_INTF_T_V4L_SUBDEVDevice node interface for a V4L subdevicetypically, /dev/v4l-subdev?
MEDIA_INTF_T_V4L_SWRADIODevice node interface for Software Defined Radio (V4L)typically, /dev/swradio?
MEDIA_INTF_T_ALSA_PCM_CAPTUREDevice node interface for ALSA PCM Capturetypically, /dev/snd/pcmC?D?c
MEDIA_INTF_T_ALSA_PCM_PLAYBACKDevice node interface for ALSA PCM Playbacktypically, /dev/snd/pcmC?D?p
MEDIA_INTF_T_ALSA_CONTROLDevice node interface for ALSA Controltypically, /dev/snd/controlC?
MEDIA_INTF_T_ALSA_COMPRESSDevice node interface for ALSA Compresstypically, /dev/snd/compr?
MEDIA_INTF_T_ALSA_RAWMIDIDevice node interface for ALSA Raw MIDItypically, /dev/snd/midi?
MEDIA_INTF_T_ALSA_HWDEPDevice node interface for ALSA Hardware Dependenttypically, /dev/snd/hwC?D?
MEDIA_INTF_T_ALSA_SEQUENCERDevice node interface for ALSA Sequencertypically, /dev/snd/seq
MEDIA_INTF_T_ALSA_TIMERDevice node interface for ALSA Timertypically, /dev/snd/timer

Table 16.4. Media pad flags

MEDIA_PAD_FL_SINKInput pad, relative to the entity. Input pads sink data and are targets of links.
MEDIA_PAD_FL_SOURCEOutput pad, relative to the entity. Output pads source data and are origins of links.
MEDIA_PAD_FL_MUST_CONNECTIf this flag is set and the pad is linked to any other pad, then at least one of those links must be enabled for the entity to be able to stream. There could be temporary reasons (e.g. device configuration dependent) for the pad to need enabled links even when this flag isn't set; the absence of the flag doesn't imply there is none.

One and only one of MEDIA_PAD_FL_SINK and MEDIA_PAD_FL_SOURCE must be set for every pad.

Table 16.5. Media link flags

MEDIA_LNK_FL_ENABLEDThe link is enabled and can be used to transfer media data. When two or more links target a sink pad, only one of them can be enabled at a time.
MEDIA_LNK_FL_IMMUTABLEThe link enabled state can't be modified at runtime. An immutable link is always enabled.
MEDIA_LNK_FL_DYNAMICThe link enabled state can be modified during streaming. This flag is set by drivers and is read-only for applications.
MEDIA_LNK_FL_LINK_TYPE

This is a bitmask that defines the type of the link. Currently, two types of links are supported:

MEDIA_LNK_FL_DATA_LINK if the link is between two pads

MEDIA_LNK_FL_INTERFACE_LINK if the link is between an interface and an entity