media-controller.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <partinfo>
  2. <authorgroup>
  3. <author>
  4. <firstname>Laurent</firstname>
  5. <surname>Pinchart</surname>
  6. <affiliation><address><email>laurent.pinchart@ideasonboard.com</email></address></affiliation>
  7. <contrib>Initial version.</contrib>
  8. </author>
  9. </authorgroup>
  10. <copyright>
  11. <year>2010</year>
  12. <holder>Laurent Pinchart</holder>
  13. </copyright>
  14. <revhistory>
  15. <!-- Put document revisions here, newest first. -->
  16. <revision>
  17. <revnumber>1.0.0</revnumber>
  18. <date>2010-11-10</date>
  19. <authorinitials>lp</authorinitials>
  20. <revremark>Initial revision</revremark>
  21. </revision>
  22. </revhistory>
  23. </partinfo>
  24. <title>Media Controller API</title>
  25. <chapter id="media_controller">
  26. <title>Media Controller</title>
  27. <section id="media-controller-intro">
  28. <title>Introduction</title>
  29. <para>Media devices increasingly handle multiple related functions. Many USB
  30. cameras include microphones, video capture hardware can also output video,
  31. or SoC camera interfaces also perform memory-to-memory operations similar to
  32. video codecs.</para>
  33. <para>Independent functions, even when implemented in the same hardware, can
  34. be modelled as separate devices. A USB camera with a microphone will be
  35. presented to userspace applications as V4L2 and ALSA capture devices. The
  36. devices' relationships (when using a webcam, end-users shouldn't have to
  37. manually select the associated USB microphone), while not made available
  38. directly to applications by the drivers, can usually be retrieved from
  39. sysfs.</para>
  40. <para>With more and more advanced SoC devices being introduced, the current
  41. approach will not scale. Device topologies are getting increasingly complex
  42. and can't always be represented by a tree structure. Hardware blocks are
  43. shared between different functions, creating dependencies between seemingly
  44. unrelated devices.</para>
  45. <para>Kernel abstraction APIs such as V4L2 and ALSA provide means for
  46. applications to access hardware parameters. As newer hardware expose an
  47. increasingly high number of those parameters, drivers need to guess what
  48. applications really require based on limited information, thereby
  49. implementing policies that belong to userspace.</para>
  50. <para>The media controller API aims at solving those problems.</para>
  51. </section>
  52. <section id="media-controller-model">
  53. <title>Media device model</title>
  54. <para>Discovering a device internal topology, and configuring it at runtime,
  55. is one of the goals of the media controller API. To achieve this, hardware
  56. devices are modelled as an oriented graph of building blocks called entities
  57. connected through pads.</para>
  58. <para>An entity is a basic media hardware or software building block. It can
  59. correspond to a large variety of logical blocks such as physical hardware
  60. devices (CMOS sensor for instance), logical hardware devices (a building
  61. block in a System-on-Chip image processing pipeline), DMA channels or
  62. physical connectors.</para>
  63. <para>A pad is a connection endpoint through which an entity can interact
  64. with other entities. Data (not restricted to video) produced by an entity
  65. flows from the entity's output to one or more entity inputs. Pads should not
  66. be confused with physical pins at chip boundaries.</para>
  67. <para>A link is a point-to-point oriented connection between two pads,
  68. either on the same entity or on different entities. Data flows from a source
  69. pad to a sink pad.</para>
  70. </section>
  71. </chapter>
  72. <appendix id="media-user-func">
  73. <title>Function Reference</title>
  74. <!-- Keep this alphabetically sorted. -->
  75. &sub-media-func-open;
  76. &sub-media-func-close;
  77. &sub-media-func-ioctl;
  78. <!-- All ioctls go here. -->
  79. &sub-media-ioc-device-info;
  80. &sub-media-ioc-enum-entities;
  81. &sub-media-ioc-enum-links;
  82. &sub-media-ioc-setup-link;
  83. </appendix>