diff --git a/recipes/pkg/avconv/README b/recipes/pkg/avconv/README new file mode 100644 index 0000000..404fd8c --- /dev/null +++ b/recipes/pkg/avconv/README @@ -0,0 +1,2 @@ + + Simple software-rendering demo application diff --git a/recipes/pkg/avconv/archives b/recipes/pkg/avconv/archives new file mode 100644 index 0000000..ab76bcf --- /dev/null +++ b/recipes/pkg/avconv/archives @@ -0,0 +1,6 @@ +_/src/avconv +_/src/libc +_/src/libav +_/src/vfs +_/src/posix +_/src/zlib diff --git a/recipes/pkg/avconv/hash b/recipes/pkg/avconv/hash new file mode 100644 index 0000000..3cfdee6 --- /dev/null +++ b/recipes/pkg/avconv/hash @@ -0,0 +1 @@ +2020-04-28 bf8ed8bc1c0676b5b46374063f1c41272c224d53 diff --git a/recipes/pkg/avconv/runtime b/recipes/pkg/avconv/runtime new file mode 100644 index 0000000..5a82459 --- /dev/null +++ b/recipes/pkg/avconv/runtime @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2018-01-01 00:01 + + + + + + + diff --git a/recipes/src/avconv/content.mk b/recipes/src/avconv/content.mk new file mode 100644 index 0000000..7a4e78d --- /dev/null +++ b/recipes/src/avconv/content.mk @@ -0,0 +1,20 @@ +content: src/app/avconv lib/import LICENSE + +PORT_DIR := $(call port_dir,$(REP_DIR)/ports/libav) + +lib/import: + mkdir -p $@ + cp $(REP_DIR)/$@/import-av.inc $@ + +src/app/avconv: + mkdir -p $@ + cp $(PORT_DIR)/src/lib/libav/avconv.c \ + $(PORT_DIR)/src/lib/libav/avconv_opt.c \ + $(PORT_DIR)/src/lib/libav/avconv_filter.c \ + $(PORT_DIR)/src/lib/libav/cmdutils.* $@ + cp $(REP_DIR)/src/app/avconv/* $@ + cp $(REP_DIR)/src/lib/libav/config.h $@ + rm $@/avconv.patch + +LICENSE: + cp $(PORT_DIR)/src/lib/libav/LICENSE $@ diff --git a/recipes/src/avconv/hash b/recipes/src/avconv/hash new file mode 100644 index 0000000..f50e793 --- /dev/null +++ b/recipes/src/avconv/hash @@ -0,0 +1 @@ +2020-04-28 befe86737c7e2a1fdf73acf4abc644fa875df38a diff --git a/recipes/src/avconv/used_apis b/recipes/src/avconv/used_apis new file mode 100644 index 0000000..1ffb0f9 --- /dev/null +++ b/recipes/src/avconv/used_apis @@ -0,0 +1,8 @@ +base +os +so +libc +vfs +libav +posix +framebuffer_session diff --git a/run/avconv.run b/run/avconv.run new file mode 100644 index 0000000..a0b8713 --- /dev/null +++ b/run/avconv.run @@ -0,0 +1,255 @@ +# +# Build +# + +# depends on genodelabs/genode#1806 + +if {[have_spec pbxa9] || (![have_spec nova] && ![have_spec foc])} { + puts "Platform is unsupported." + exit 0 +} + +set mke2fs [installed_command mke2fs] +set dd [installed_command dd] + +set build_components { + core init timer + app/avconv + drivers/ahci server/vfs + lib/vfs/rump + drivers/framebuffer drivers/input + server/nitpicker server/nit_fb + app/launchpad app/pointer + lib/mesa/swrast + test/mesa_demo/gears + server/fb_splitter +} + +source ${genode_dir}/repos/base/run/platform_drv.inc +append_platform_drv_build_components + +build $build_components + +# +# Build EXT2-file-system image +# +catch { exec $dd if=/dev/zero of=bin/ext2.raw bs=1M count=16 } +catch { exec $mke2fs -F bin/ext2.raw } + +# +# Generate config +# + +create_boot_directory + +set config { + + + + + + + + + + + + + + + + + + + +} + +append_platform_drv_config + +append config { + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + + + + } + +append_if [have_spec framebuffer] config { + + + + + + } + +append_if [have_spec ps2] config { + + + + + } + +append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2018-01-01 00:01 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2018-01-01 00:01 + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +set boot_modules { + core init timer + avconv vfs.lib.so avresample.lib.so + ld.lib.so libc.lib.so libm.lib.so posix.lib.so zlib.lib.so + avdevice.lib.so avfilter.lib.so avutil.lib.so avcodec.lib.so + avformat.lib.so swscale.lib.so + ahci_drv rump.lib.so rump_fs.lib.so vfs vfs_rump.lib.so + nitpicker nit_fb + launchpad pointer + gears egl.lib.so expat.lib.so glapi.lib.so mesa.lib.so stdcxx.lib.so egl_swrast.lib.so + fb_splitter +} + +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec linux] boot_modules sdl.lib.so +lappend_if [have_spec x86] boot_modules vesa_fb_drv +lappend_if [have_spec ps2] boot_modules ps2_drv + +append_platform_drv_boot_modules + +build_boot_image $boot_modules + +append qemu_args " -smp 4,cores=4 " +append qemu_args " -drive id=disk,file=bin/ext2.raw,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -boot d" + +run_genode_until {.*child "avconv" exited with exit value 0.*} 60 + +puts "Test succeeded" diff --git a/src/app/avconv/avconv.patch b/src/app/avconv/avconv.patch new file mode 100644 index 0000000..26500fb --- /dev/null +++ b/src/app/avconv/avconv.patch @@ -0,0 +1,21 @@ +- avoid compile error "‘for’ loop initial declarations are only + allowed in C99 or C11 mode" + ++++ src/lib/libav/avconv.c +@@ -426,6 +426,7 @@ static int alloc_buffer(InputStream *ist, FrameBuffer **pbuf) + int h_chroma_shift, v_chroma_shift; + int edge = 32; // XXX should be avcodec_get_edge_width(), but that fails on svq1 + int w = s->width, h = s->height; ++ int i; + + if (!buf) + return AVERROR(ENOMEM); +@@ -449,7 +450,7 @@ static int alloc_buffer(InputStream *ist, FrameBuffer **pbuf) + memset(buf->base[0], 128, ret); + + avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift); +- for (int i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) { ++ for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) { + const int h_shift = i==0 ? 0 : h_chroma_shift; + const int v_shift = i==0 ? 0 : v_chroma_shift; + if (s->flags & CODEC_FLAG_EMU_EDGE) diff --git a/src/app/avconv/target.mk b/src/app/avconv/target.mk new file mode 100644 index 0000000..303c042 --- /dev/null +++ b/src/app/avconv/target.mk @@ -0,0 +1,23 @@ +include $(REP_DIR)/lib/import/import-av.inc + +TARGET = avconv +SRC_C = avconv.c cmdutils.c avconv_opt.c avconv_filter.c +LIBS += avfilter avformat avcodec avutil avdevice swscale avresample +LIBS += base posix + +CC_WARN += -Wno-parentheses -Wno-switch -Wno-uninitialized \ + -Wno-format-zero-length -Wno-pointer-sign + +LIBAV_PORT_DIR := $(call select_from_ports,libav) + +# version.h +INC_DIR += $(PRG_DIR) + +# config.h +INC_DIR += $(REP_DIR)/src/lib/libav + +CC_C_OPT += -DLIBAV_VERSION=\"0.8\" + +vpath %.c $(LIBAV_PORT_DIR)/src/lib/libav + +CC_CXX_WARN_STRICT = diff --git a/src/app/avconv/version.h b/src/app/avconv/version.h new file mode 100644 index 0000000..e69de29