summaryrefslogtreecommitdiff
path: root/libavdevice/kmsgrab.c
Commit message (Collapse)AuthorAgeFilesLines
* avdevice: Constify all devicesAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avdevice: use av_gettime_relative() for elapsed time calculationsMarton Balint2021-02-271-2/+3
| | | | | | | | | | av_gettime_relative() is using the monotonic clock therefore more suitable for elapsed time calculations. Packet timestamps are still kept absolute, although that should be configurable in the future. Related to ticket #9089. Signed-off-by: Marton Balint <cus@passwd.hu>
* kmsgrab: Do not require the modifier to stay constant.Bas Nieuwenhuizen2021-01-131-7/+0
| | | | | | | | | | As we get a new set of objects each frame anyway, we do not gain anything by keeping the modifier constant. This helps with capturing when switching your setup a bit, e.g. from ingame to desktop or from X11 to wayland. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* kmsgrab: Use invalid modifier if modifiers weren't used.Bas Nieuwenhuizen2021-01-131-10/+17
| | | | | | | | | | | | The kernel defaults to initializing the field to 0 when modifiers are not used and this happens to be linear. If we end up actually passing the modifier to a driver, tiling issues happen. So if the kernel doesn't return a modifier set it explicitly to INVALID. That way later processing knows there is no explicit modifier. Signed-off-by: Mark Thompson <sw@jkqxz.net>
* kmsgrab: Add more supported formatsMark Thompson2020-08-091-0/+9
| | | | | | | X2RGB10 tested on both Intel Gen9 and AMD Polaris 11. NV12 tested on Intel Gen9 only - since it has multiple planes, this requires GetFB2. Also add some comments to split the list up a bit.
* kmsgrab: Don't require the user to set framebuffer formatMark Thompson2020-08-091-15/+40
| | | | | This is provided by GetFB2, but we still need the option for cases where that isn't available.
* kmsgrab: Use GetFB2 if availableMark Thompson2020-08-091-19/+199
| | | | | | | | | | | | The most useful feature here is the ability to automatically extract the framebuffer format and modifiers. It also makes support for multi-plane framebuffers possible, though none are added to the format table in this patch. This requires libdrm 2.4.101 (from April 2020) to build, so it includes a configure check to allow compatibility with existing distributions. Even with libdrm support, it still won't do anything at runtime if you are running Linux < 5.7 (before June 2020).
* kmsgrab: Refactor and clean error casesMark Thompson2020-08-091-61/+100
|
* kmsgrab: add category for kmsgrabJun Zhao2018-03-261-0/+1
| | | | | | | Makes kmsgrab visible in "ffmpeg -devices". Signed-off-by: Jun Zhao <mypopydev@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* lavd/kmsgrab: Remove the mapping for AV_PIX_FMT_RGB8.Carl Eugen Hoyos2017-09-201-1/+0
| | | | The definitions are different: 3:3:2 vs 2:3:3.
* kmsgrab: Add more DRM plane formatsCarl Eugen Hoyos2017-09-191-0/+11
|
* kmsgrab: Remove multiple-plane formatsMark Thompson2017-09-191-4/+0
| | | | | The planes are unlikely to be contiguous, assuming they are results in very broken output. (Tested with NV12/NV16 on Rockchip.)
* kmsgrab: Fix DRM format definitionsMark Thompson2017-09-191-8/+8
| | | | | | | | | All DRM formats are defined in terms of little-endian words, so RGB formats like XRGB actually have the elements in the opposite order order in memory to the order they are in the name. This does not affect YUYV and similar YUV 4:2:2 formats, which are in the expected order.
* kmsgrab: Fix build failure with old libdrmJun Zhao2017-09-141-0/+4
| | | | | | | | DRM_FORMAT_R8 was added in libdrm 2.4.68. DRM_FORMAT_R16 was added in libdrm 2.4.82. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* lavd/kmsgrab: Fix packet flag settingMark Thompson2017-09-141-4/+4
| | | | Found-by: James Almer <jamrial@gmail.com>
* lavd: Add KMS screen grabberMark Thompson2017-09-131-0/+455