libav: add avdevice support

This commit is contained in:
Martin Stein
2019-12-19 10:46:31 +01:00
committed by Norman Feske
parent 1e2324c7fa
commit 000dd13860
20 changed files with 137 additions and 28 deletions

View File

@@ -0,0 +1,3 @@
include $(call select_from_repositories,lib/import/import-av.inc)
REP_INC_DIR += contrib/$(LIBAV)/libavdevice

11
lib/mk/avdevice.mk Normal file
View File

@@ -0,0 +1,11 @@
include $(REP_DIR)/lib/mk/av.inc
include $(REP_DIR)/lib/import/import-avdevice.mk
LIBAVDEVICE_DIR = $(call select_from_ports,libav)/src/lib/libav/libavdevice
-include $(LIBAVDEVICE_DIR)/Makefile
LIBS += avformat
vpath % $(LIBAVDEVICE_DIR)

3
lib/symbols/avdevice Normal file
View File

@@ -0,0 +1,3 @@
avdevice_register_all T
avdevice_version T
avdevice_configuration T

View File

@@ -1 +1 @@
5441b0c6f799190b13b3ba1db6e60b5a2d13a6bb
50ddddd55494974ac7ef3c1102667f7cfd778a9c

View File

@@ -8,7 +8,8 @@ DIR(libav) := src/lib/libav
SIG(libav) := ${URL(libav)}.asc
PATCHES := src/app/avplay/avplay.patch \
src/lib/libav/avcodec.patch
src/lib/libav/avcodec.patch \
src/lib/libav/avdevice.patch
include_subdirs := . libavcodec libavdevice libavfilter libavutil libavformat libswscale \
libavutil/x86 libavutil/arm libavutil/ppc libavcodec/x86 \

View File

@@ -1,10 +1,12 @@
MIRROR_FROM_REP_DIR := lib/symbols/avcodec \
lib/symbols/avdevice \
lib/symbols/avfilter \
lib/symbols/avformat \
lib/symbols/avresample \
lib/symbols/avutil \
lib/import/import-av.inc \
lib/import/import-avcodec.mk \
lib/import/import-avdevice.mk \
lib/import/import-avfilter.mk \
lib/import/import-avformat.mk \
lib/import/import-avresample.mk \

View File

@@ -1 +1 @@
2018-01-10 6e494745c06e22be75779d1d953d112ee24f2ab6
2019-12-19 c064d35a45087303ca90896151f1998ea6133470

View File

@@ -1 +1 @@
2019-03-21 c31c5af8df6d6607e9d434a52226071753e82a59
2020-04-28 cae85f8b522646cf2c988a11401a37568d6b81a0

View File

@@ -20,6 +20,7 @@
<rom label="avformat.lib.so"/>
<rom label="swscale.lib.so"/>
<rom label="avresample.lib.so"/>
<rom label="avdevice.lib.so"/>
</content>
<config>

View File

@@ -1 +1 @@
2019-01-02 254978760fef3136f72e19723dc834a8e0e254a7
2020-04-28 e70ec524da0140b7e29d69c38253d00fbdce00dd

View File

@@ -8,7 +8,7 @@ src/lib/libav:
cp -r $(REP_DIR)/src/lib/libav/* $@
src/lib/libav/target.mk: src/lib/libav
echo "LIBS += avfilter avformat avcodec avutil avresample swscale" > $@
echo "LIBS += avfilter avformat avcodec avutil avresample swscale avdevice" > $@
lib/import:
mkdir -p $@

View File

@@ -1 +1 @@
2018-12-19 07a581adb879d499cb3cd43ee4e4ab013fbed44b
2020-04-28 d0b2291a03af52f9d7fb220e2c393d77bdb97215

View File

@@ -1,3 +1,4 @@
so
libc
zlib
base

View File

@@ -31,7 +31,7 @@ set boot_modules {
avplay
libc.lib.so vfs.lib.so vfs.lib.so vfs.lib.so libm.lib.so zlib.lib.so sdl.lib.so
avfilter.lib.so avutil.lib.so avcodec.lib.so avformat.lib.so swscale.lib.so
avresample.lib.so
avresample.lib.so avdevice.lib.so
mediafile
}

View File

@@ -5,11 +5,13 @@
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
* Copyright (C) 2012-2019 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
void feholdexcept() { }
void feupdateenv() { }
typedef struct fenv fenv_t;
int feholdexcept(fenv_t *envp) { }
int feupdateenv(const fenv_t *envp) { }

View File

@@ -2,7 +2,7 @@ include $(REP_DIR)/lib/import/import-av.inc
TARGET = avplay
SRC_C = avplay.c cmdutils.c libc_dummies.c
LIBS += avfilter avformat avcodec avutil avresample swscale
LIBS += avfilter avformat avcodec avutil avresample swscale avdevice
LIBS += base sdl libc libm
CC_WARN += -Wno-parentheses -Wno-switch -Wno-uninitialized \

View File

@@ -0,0 +1,11 @@
- support fbdev input devices with pixel format RGB565
+++ src/lib/libav/libavdevice/fbdev.c
@@ -58,6 +58,7 @@
{ 32, 3, 2, 8, 0, AV_PIX_FMT_ABGR },
{ 24, 0, 8, 16, 0, AV_PIX_FMT_RGB24 },
{ 24, 16, 8, 0, 0, AV_PIX_FMT_BGR24 },
+ { 16, 11, 5, 0, 0, AV_PIX_FMT_RGB565 },
};
static enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)

View File

@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef LIBAV_CONFIG_H
#define LIBAV_CONFIG_H
#define LIBAV_CONFIGURATION "--disable-avdevice --disable-mmxext --disable-mmx"
#define LIBAV_CONFIGURATION "--disable-avdevice --disable-mmxext --disable-mmx --disable-devices --enable-indev=fbdev"
#define LIBAV_LICENSE "LGPL version 2.1 or later"
#define AVCONV_DATADIR "/usr/local/share/avconv"
#define CC_IDENT "gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)"
@@ -386,7 +386,7 @@
#define CONFIG_NONFREE 0
#define CONFIG_VERSION3 0
#define CONFIG_AVCODEC 1
#define CONFIG_AVDEVICE 0
#define CONFIG_AVDEVICE 1
#define CONFIG_AVFILTER 1
#define CONFIG_AVFORMAT 1
#define CONFIG_AVRESAMPLE 1
@@ -1173,15 +1173,15 @@
#define CONFIG_WMV3_DXVA2_HWACCEL 0
#define CONFIG_WMV3_VAAPI_HWACCEL 0
#define CONFIG_WMV3_VDPAU_HWACCEL 0
#define CONFIG_ALSA_INDEV 1
#define CONFIG_ALSA_INDEV 0
#define CONFIG_BKTR_INDEV 0
#define CONFIG_DV1394_INDEV 1
#define CONFIG_DV1394_INDEV 0
#define CONFIG_FBDEV_INDEV 1
#define CONFIG_JACK_INDEV 0
#define CONFIG_OSS_INDEV 1
#define CONFIG_OSS_INDEV 0
#define CONFIG_PULSE_INDEV 0
#define CONFIG_SNDIO_INDEV 0
#define CONFIG_V4L2_INDEV 1
#define CONFIG_V4L2_INDEV 0
#define CONFIG_VFWCAP_INDEV 0
#define CONFIG_X11GRAB_INDEV 0
#define CONFIG_LIBCDIO_INDEV 0
@@ -1299,8 +1299,8 @@
#define CONFIG_WEBM_MUXER 1
#define CONFIG_WV_MUXER 1
#define CONFIG_YUV4MPEGPIPE_MUXER 1
#define CONFIG_ALSA_OUTDEV 1
#define CONFIG_OSS_OUTDEV 1
#define CONFIG_ALSA_OUTDEV 0
#define CONFIG_OSS_OUTDEV 0
#define CONFIG_SNDIO_OUTDEV 0
#define CONFIG_AAC_PARSER 1
#define CONFIG_AAC_LATM_PARSER 1

View File

@@ -402,7 +402,7 @@ CONFIG_FILTERS=yes
!CONFIG_HWACCELS=yes
CONFIG_INDEVS=yes
CONFIG_MUXERS=yes
CONFIG_OUTDEVS=yes
!CONFIG_OUTDEVS=yes
CONFIG_PARSERS=yes
CONFIG_PROTOCOLS=yes
CONFIG_AVCODEC_EXAMPLE=yes
@@ -465,7 +465,7 @@ CONFIG_SWSCALE_ALPHA=yes
!CONFIG_NONFREE=yes
!CONFIG_VERSION3=yes
CONFIG_AVCODEC=yes
!CONFIG_AVDEVICE=yes
CONFIG_AVDEVICE=yes
CONFIG_AVFILTER=yes
CONFIG_AVFORMAT=yes
CONFIG_AVRESAMPLE=yes
@@ -1252,15 +1252,27 @@ CONFIG_NULLSINK_FILTER=yes
!CONFIG_WMV3_DXVA2_HWACCEL=yes
!CONFIG_WMV3_VAAPI_HWACCEL=yes
!CONFIG_WMV3_VDPAU_HWACCEL=yes
CONFIG_ALSA_INDEV=yes
!CONFIG_ALSA_INDEV=yes
!CONFIG_BKTR_INDEV=yes
CONFIG_DV1394_INDEV=yes
!CONFIG_DV1394_INDEV=yes
CONFIG_FBDEV_INDEV=yes
!CONFIG_JACK_INDEV=yes
CONFIG_OSS_INDEV=yes
!CONFIG_OSS_INDEV=yes
!CONFIG_PULSE_INDEV=yes
!CONFIG_SNDIO_INDEV=yes
CONFIG_V4L2_INDEV=yes
!CONFIG_V4L2_INDEV=yes
!CONFIG_ALSA_INDEV=yes
!CONFIG_BKTR_INDEV=yes
!CONFIG_DV1394_INDEV=yes
CONFIG_FBDEV_INDEV=yes
!CONFIG_JACK_INDEV=yes
!CONFIG_OSS_INDEV=yes
!CONFIG_PULSE_INDEV=yes
!CONFIG_SNDIO_INDEV=yes
!CONFIG_V4L2_INDEV=yes
!CONFIG_VFWCAP_INDEV=yes
!CONFIG_X11GRAB_INDEV=yes
!CONFIG_LIBCDIO_INDEV=yes
@@ -1378,8 +1390,8 @@ CONFIG_WAV_MUXER=yes
CONFIG_WEBM_MUXER=yes
CONFIG_WV_MUXER=yes
CONFIG_YUV4MPEGPIPE_MUXER=yes
CONFIG_ALSA_OUTDEV=yes
CONFIG_OSS_OUTDEV=yes
!CONFIG_ALSA_OUTDEV=yes
!CONFIG_OSS_OUTDEV=yes
!CONFIG_SNDIO_OUTDEV=yes
CONFIG_AAC_PARSER=yes
CONFIG_AAC_LATM_PARSER=yes

62
src/lib/libav/linux/fb.h Normal file
View File

@@ -0,0 +1,62 @@
/*
* \brief Minimal definition of a Linux framebuffer device
* \author Martin Stein
* \date 2016-02-10
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _LINUX__FB_H_
#define _LINUX__FB_H_
/* Genode includes */
#include <base/fixed_stdint.h>
/**
* IOCTLs for Linux framebuffer devices
*/
enum {
FBIOGET_VSCREENINFO=17920,
FBIOGET_FSCREENINFO=17922,
};
/**
* Single channel descriptor within a pixel descriptor
*/
struct fb_bitfield
{
genode_uint32_t offset; /* bit offset in pixel descriptor */
};
/**
* Dynamic configuration of a framebuffer device file
*/
struct fb_var_screeninfo
{
genode_uint32_t xres; /* visible resolution, width */
genode_uint32_t yres; /* visible resolution, height */
genode_uint32_t xoffset; /* X offset from virtual to visible res. */
genode_uint32_t yoffset; /* Y offset from virtual to visible res. */
genode_uint32_t bits_per_pixel; /* length of a pixel descriptor */
struct fb_bitfield red; /* red channel bits in a pixel descr. */
struct fb_bitfield green; /* green channel bits in a pixel descr. */
struct fb_bitfield blue; /* blue channel bits in a pixel descr. */
};
/**
* Fixed configuration of a framebuffe device file
*/
struct fb_fix_screeninfo
{
unsigned long smem_start; /* base of framebuffer */
genode_uint32_t smem_len; /* length of framebuffer in bytes */
genode_uint32_t line_length; /* length of a framebuffer line in bytes */
};
#endif /* _INCLUDE__VFS__FB_H_ */