Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
.. -*- coding: utf-8; mode: rst -*-

.. _media-controller-types:

Types and flags used to represent the media graph elements
==========================================================

..  tabularcolumns:: |p{8.0cm}|p{10.5cm}|

.. _media-entity-type:

.. cssclass:: longtable

.. flat-table:: Media entity types
    :header-rows:  0
    :stub-columns: 0


    -  .. row 1

       .. _MEDIA-ENT-F-UNKNOWN:
       .. _MEDIA-ENT-F-V4L2-SUBDEV-UNKNOWN:

       -  ``MEDIA_ENT_F_UNKNOWN`` and

	  ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``

       -  Unknown entity. That generally indicates that a driver didn't
	  initialize properly the entity, with is a Kernel bug

    -  .. row 2

       ..  _MEDIA-ENT-F-IO-V4L:

       -  ``MEDIA_ENT_F_IO_V4L``

       -  Data streaming input and/or output entity.

    -  .. row 3

       ..  _MEDIA-ENT-F-IO-VBI:

       -  ``MEDIA_ENT_F_IO_VBI``

       -  V4L VBI streaming input or output entity

    -  .. row 4

       ..  _MEDIA-ENT-F-IO-SWRADIO:

       -  ``MEDIA_ENT_F_IO_SWRADIO``

       -  V4L Software Digital Radio (SDR) streaming input or output entity

    -  .. row 5

       ..  _MEDIA-ENT-F-IO-DTV:

       -  ``MEDIA_ENT_F_IO_DTV``

       -  DVB Digital TV streaming input or output entity

    -  .. row 6

       ..  _MEDIA-ENT-F-DTV-DEMOD:

       -  ``MEDIA_ENT_F_DTV_DEMOD``

       -  Digital TV demodulator entity.

    -  .. row 7

       ..  _MEDIA-ENT-F-TS-DEMUX:

       -  ``MEDIA_ENT_F_TS_DEMUX``

       -  MPEG Transport stream demux entity. Could be implemented on
	  hardware or in Kernelspace by the Linux DVB subsystem.

    -  .. row 8

       ..  _MEDIA-ENT-F-DTV-CA:

       -  ``MEDIA_ENT_F_DTV_CA``

       -  Digital TV Conditional Access module (CAM) entity

    -  .. row 9

       ..  _MEDIA-ENT-F-DTV-NET-DECAP:

       -  ``MEDIA_ENT_F_DTV_NET_DECAP``

       -  Digital TV network ULE/MLE desencapsulation entity. Could be
	  implemented on hardware or in Kernelspace

    -  .. row 10

       ..  _MEDIA-ENT-F-CONN-RF:

       -  ``MEDIA_ENT_F_CONN_RF``

       -  Connector for a Radio Frequency (RF) signal.

    -  .. row 11

       ..  _MEDIA-ENT-F-CONN-SVIDEO:

       -  ``MEDIA_ENT_F_CONN_SVIDEO``

       -  Connector for a S-Video signal.

    -  .. row 12

       ..  _MEDIA-ENT-F-CONN-COMPOSITE:

       -  ``MEDIA_ENT_F_CONN_COMPOSITE``

       -  Connector for a RGB composite signal.

    -  .. row 13

       ..  _MEDIA-ENT-F-CAM-SENSOR:

       -  ``MEDIA_ENT_F_CAM_SENSOR``

       -  Camera video sensor entity.

    -  .. row 14

       ..  _MEDIA-ENT-F-FLASH:

       -  ``MEDIA_ENT_F_FLASH``

       -  Flash controller entity.

    -  .. row 15

       ..  _MEDIA-ENT-F-LENS:

       -  ``MEDIA_ENT_F_LENS``

       -  Lens controller entity.

    -  .. row 16

       ..  _MEDIA-ENT-F-ATV-DECODER:

       -  ``MEDIA_ENT_F_ATV_DECODER``

       -  Analog 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.

    -  .. row 17

       ..  _MEDIA-ENT-F-TUNER:

       -  ``MEDIA_ENT_F_TUNER``

       -  Digital 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.

    -  .. row 18

       ..  _MEDIA-ENT-F-IF-VID-DECODER:

       -  ``MEDIA_ENT_F_IF_VID_DECODER``

       -  IF-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.

    -  .. row 19

       ..  _MEDIA-ENT-F-IF-AUD-DECODER:

       -  ``MEDIA_ENT_F_IF_AUD_DECODER``

       -  IF-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.

    -  .. row 20

       ..  _MEDIA-ENT-F-AUDIO-CAPTURE:

       -  ``MEDIA_ENT_F_AUDIO_CAPTURE``

       -  Audio Capture Function Entity.

    -  .. row 21

       ..  _MEDIA-ENT-F-AUDIO-PLAYBACK:

       -  ``MEDIA_ENT_F_AUDIO_PLAYBACK``

       -  Audio Playback Function Entity.

    -  .. row 22

       ..  _MEDIA-ENT-F-AUDIO-MIXER:

       -  ``MEDIA_ENT_F_AUDIO_MIXER``

       -  Audio Mixer Function Entity.

    -  .. row 23

       ..  _MEDIA-ENT-F-PROC-VIDEO-COMPOSER:

       -  ``MEDIA_ENT_F_PROC_VIDEO_COMPOSER``

       -  Video 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.

    -  ..  row 24

       ..  _MEDIA-ENT-F-PROC-VIDEO-PIXEL-FORMATTER:

       -  ``MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER``

       -  Video 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.

    -  ..  row 25

       ..  _MEDIA-ENT-F-PROC-VIDEO-PIXEL-ENC-CONV:

       -  ``MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV``

       -  Video 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.

    -  ..  row 26

       ..  _MEDIA-ENT-F-PROC-VIDEO-LUT:

       -  ``MEDIA_ENT_F_PROC_VIDEO_LUT``

       -  Video 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.

    -  ..  row 27

       ..  _MEDIA-ENT-F-PROC-VIDEO-SCALER:

       -  ``MEDIA_ENT_F_PROC_VIDEO_SCALER``

       -  Video 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.

    -  ..  row 28

       ..  _MEDIA-ENT-F-PROC-VIDEO-STATISTICS:

       -  ``MEDIA_ENT_F_PROC_VIDEO_STATISTICS``

       -  Video 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.


..  tabularcolumns:: |p{5.5cm}|p{12.0cm}|

.. _media-entity-flag:

.. flat-table:: Media entity flags
    :header-rows:  0
    :stub-columns: 0


    -  .. row 1

       ..  _MEDIA-ENT-FL-DEFAULT:

       -  ``MEDIA_ENT_FL_DEFAULT``

       -  Default entity for its type. Used to discover the default audio,
	  VBI and video devices, the default camera sensor, ...

    -  .. row 2

       ..  _MEDIA-ENT-FL-CONNECTOR:

       -  ``MEDIA_ENT_FL_CONNECTOR``

       -  The entity represents a data conector


..  tabularcolumns:: |p{6.5cm}|p{6.0cm}|p{5.0cm}|

.. _media-intf-type:

.. flat-table:: Media interface types
    :header-rows:  0
    :stub-columns: 0


    -  .. row 1

       ..  _MEDIA-INTF-T-DVB-FE:

       -  ``MEDIA_INTF_T_DVB_FE``

       -  Device node interface for the Digital TV frontend

       -  typically, /dev/dvb/adapter?/frontend?

    -  .. row 2

       ..  _MEDIA-INTF-T-DVB-DEMUX:

       -  ``MEDIA_INTF_T_DVB_DEMUX``

       -  Device node interface for the Digital TV demux

       -  typically, /dev/dvb/adapter?/demux?

    -  .. row 3

       ..  _MEDIA-INTF-T-DVB-DVR:

       -  ``MEDIA_INTF_T_DVB_DVR``

       -  Device node interface for the Digital TV DVR

       -  typically, /dev/dvb/adapter?/dvr?

    -  .. row 4

       ..  _MEDIA-INTF-T-DVB-CA:

       -  ``MEDIA_INTF_T_DVB_CA``

       -  Device node interface for the Digital TV Conditional Access

       -  typically, /dev/dvb/adapter?/ca?

    -  .. row 5

       ..  _MEDIA-INTF-T-DVB-NET:

       -  ``MEDIA_INTF_T_DVB_NET``

       -  Device node interface for the Digital TV network control

       -  typically, /dev/dvb/adapter?/net?

    -  .. row 6

       ..  _MEDIA-INTF-T-V4L-VIDEO:

       -  ``MEDIA_INTF_T_V4L_VIDEO``

       -  Device node interface for video (V4L)

       -  typically, /dev/video?

    -  .. row 7

       ..  _MEDIA-INTF-T-V4L-VBI:

       -  ``MEDIA_INTF_T_V4L_VBI``

       -  Device node interface for VBI (V4L)

       -  typically, /dev/vbi?

    -  .. row 8

       ..  _MEDIA-INTF-T-V4L-RADIO:

       -  ``MEDIA_INTF_T_V4L_RADIO``

       -  Device node interface for radio (V4L)

       -  typically, /dev/radio?

    -  .. row 9

       ..  _MEDIA-INTF-T-V4L-SUBDEV:

       -  ``MEDIA_INTF_T_V4L_SUBDEV``

       -  Device node interface for a V4L subdevice

       -  typically, /dev/v4l-subdev?

    -  .. row 10

       ..  _MEDIA-INTF-T-V4L-SWRADIO:

       -  ``MEDIA_INTF_T_V4L_SWRADIO``

       -  Device node interface for Software Defined Radio (V4L)

       -  typically, /dev/swradio?

    -  .. row 11

       ..  _MEDIA-INTF-T-V4L-TOUCH:

       -  ``MEDIA_INTF_T_V4L_TOUCH``

       -  Device node interface for Touch device (V4L)

       -  typically, /dev/v4l-touch?

    -  .. row 12

       ..  _MEDIA-INTF-T-ALSA-PCM-CAPTURE:

       -  ``MEDIA_INTF_T_ALSA_PCM_CAPTURE``

       -  Device node interface for ALSA PCM Capture

       -  typically, /dev/snd/pcmC?D?c

    -  .. row 13

       ..  _MEDIA-INTF-T-ALSA-PCM-PLAYBACK:

       -  ``MEDIA_INTF_T_ALSA_PCM_PLAYBACK``

       -  Device node interface for ALSA PCM Playback

       -  typically, /dev/snd/pcmC?D?p

    -  .. row 14

       ..  _MEDIA-INTF-T-ALSA-CONTROL:

       -  ``MEDIA_INTF_T_ALSA_CONTROL``

       -  Device node interface for ALSA Control

       -  typically, /dev/snd/controlC?

    -  .. row 15

       ..  _MEDIA-INTF-T-ALSA-COMPRESS:

       -  ``MEDIA_INTF_T_ALSA_COMPRESS``

       -  Device node interface for ALSA Compress

       -  typically, /dev/snd/compr?

    -  .. row 16

       ..  _MEDIA-INTF-T-ALSA-RAWMIDI:

       -  ``MEDIA_INTF_T_ALSA_RAWMIDI``

       -  Device node interface for ALSA Raw MIDI

       -  typically, /dev/snd/midi?

    -  .. row 17

       ..  _MEDIA-INTF-T-ALSA-HWDEP:

       -  ``MEDIA_INTF_T_ALSA_HWDEP``

       -  Device node interface for ALSA Hardware Dependent

       -  typically, /dev/snd/hwC?D?

    -  .. row 18

       ..  _MEDIA-INTF-T-ALSA-SEQUENCER:

       -  ``MEDIA_INTF_T_ALSA_SEQUENCER``

       -  Device node interface for ALSA Sequencer

       -  typically, /dev/snd/seq

    -  .. row 19

       ..  _MEDIA-INTF-T-ALSA-TIMER:

       -  ``MEDIA_INTF_T_ALSA_TIMER``

       -  Device node interface for ALSA Timer

       -  typically, /dev/snd/timer


.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|

.. _media-pad-flag:

.. flat-table:: Media pad flags
    :header-rows:  0
    :stub-columns: 0


    -  .. row 1

       ..  _MEDIA-PAD-FL-SINK:

       -  ``MEDIA_PAD_FL_SINK``

       -  Input pad, relative to the entity. Input pads sink data and are
	  targets of links.

    -  .. row 2

       ..  _MEDIA-PAD-FL-SOURCE:

       -  ``MEDIA_PAD_FL_SOURCE``

       -  Output pad, relative to the entity. Output pads source data and
	  are origins of links.

    -  .. row 3

       ..  _MEDIA-PAD-FL-MUST-CONNECT:

       -  ``MEDIA_PAD_FL_MUST_CONNECT``

       -  If 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.

.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|

.. _media-link-flag:

.. flat-table:: Media link flags
    :header-rows:  0
    :stub-columns: 0


    -  .. row 1

       ..  _MEDIA-LNK-FL-ENABLED:

       -  ``MEDIA_LNK_FL_ENABLED``

       -  The 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.

    -  .. row 2

       ..  _MEDIA-LNK-FL-IMMUTABLE:

       -  ``MEDIA_LNK_FL_IMMUTABLE``

       -  The link enabled state can't be modified at runtime. An immutable
	  link is always enabled.

    -  .. row 3

       ..  _MEDIA-LNK-FL-DYNAMIC:

       -  ``MEDIA_LNK_FL_DYNAMIC``

       -  The link enabled state can be modified during streaming. This flag
	  is set by drivers and is read-only for applications.

    -  .. row 4

       ..  _MEDIA-LNK-FL-LINK-TYPE:

       -  ``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:

	  ``MEDIA_LNK_FL_DATA_LINK`` if the link is between two pads

	  .. _MEDIA-LNK-FL-INTERFACE-LINK:

	  ``MEDIA_LNK_FL_INTERFACE_LINK`` if the link is between an
	  interface and an entity