Skip to content

Conversation

@rzerres
Copy link
Contributor

@rzerres rzerres commented Mar 16, 2019

autodetect / media-driver scan

[v3] autoprobing devices
in default mode user needs to provide working video- and media-device names.
This patch will introduce needed infrastructure to autoscan suitable devices.

  • introduce libudev support: scan the class 'media' for available v4l2 devices
  • introduce topologie scan: parse entities and interfaces that do provide
    video-decoding functionality
  • introduce decoder vector: store v4l2 entities from capable decoder drivers
  • preset config values for 'video_path' and 'media_path'
    using the first named 'cedrus'
  • given commandline config options have precedence
  • update meson build:
    • project: v4l2-request-test
    • test: decoder_vector
    • dependencies: libs, cflags
  • introduce const struct codec (.name, .type)
    use a descriptive name when referencing codecs by enum type
  • clang: overcome compiler warnings 'missing braces'
    use pragma defines push/pop just around the frames.h content
  • update: rebase parsing for 'long options'

[v2] autoprobing media devices via libudev

  • if target system did register multiple v4l2 devices,
    the user needs to select a cedrus aware video and media path.
    This patch will use libudev, to scan the classes 'video4linux'
    and 'media'.
  • will preset the config values for 'video_path' and 'media_path'
    using the first match corresponding to driver named 'cedrus'.
  • respect user selected config options, which will have precedence
  • update build systems to include needed symbols (libs, cflags)
  • extend output on error messages
    beside the literal string, also output the error int number

[v1] autoscan for video_path

  • scan via sys-path (using dirent.h)

@rzerres rzerres changed the title autoscan for video_path [v2] autoprobe media devicwes via libudev Mar 17, 2019
@rzerres rzerres changed the title [v2] autoprobe media devicwes via libudev [v2] autoprobe media devices via libudev Mar 17, 2019
- indentation struct buffer_type
- spaces

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
rzerres added 11 commits April 10, 2019 01:32
in default mode user needs to provide working video- and media-device names.
This patch will introduce libudev, to scan the classes 'video4linux'
and 'media' for suitable devices.

- parse topologie and find entities and interfaces that
  do provide video-decoding functionality
- will preset the config values for 'video_path' and 'media_path'
  using the first match corresponding to driver named 'cedrus'
- given commandline config options have precedence
- update build systems to include needed symbols (libs, cflags)

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- build for project 'v4l2-request-test'
- respect dependencies (libdrm, libudev)
- test: decoder_vector

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- since crtc_id is defined as unsigned int *,
  update printf conversion specifier
- beside the literal strin, also output the error int number

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- const struct codec (.name, .type)
  use a descriptive name when referencing codecs by enum type

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- define a V4L2 buffer type structure (.name, .type)
- refer 'v4l2_buf_type' enum values to their lexical names

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- media_scan_topology():
  parse v4l2 media topologie and find entities and interfaces that
  do provide video-decoding functionality (MEDIA_G_TOPOLOGY)
  - pick video decoder entities (function: 'MEDIA_ENT_F_PROC_VIDEO_DECODER')
  - pick interfaces (type 'MEDIA_INTF_T_V4L_VIDEO')
- assign struct v4l2_decoder
  holding entities of capable video decoder / media devices
- provide helper functions
  convert v4l2 symbols to human readable strings

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
The decoder vector is used to store v4l2 entities from capable decoder drivers.
It will offer access to the corresponding interfaces and media devices.

Patch v1:
- implement useful methods to dynamic manage the array elements
  (methods: initialize, append, delete, extend, get, num_entities, print,
  reduce, set, free)
- integrate into meson build system
- implemnt meson test (decoder_test)

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- update header-file
- update c-file

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- use prama defines push/pop just around the frames.h content
- enable getopt_long supporting long option style
  (e.g --video-path, --fps, etc.)
- try to be consistent which 'v4l2-compliance' binary when
  choosing option names
- adapt help message
- to adopt the slice-path you need to explicitly prepend an
  argument-option (-s or --slice-path) with the path as an option-string
- adopt summary output to be in line with long options
- typo corrections
- update code style (tabify vs whitespace, alingement)

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
@rzerres rzerres changed the title [v2] autoprobe media devices via libudev [v3] autodetect / driver scan Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant