pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/ffmpeg4 ffmpeg4: Add native Solaris/NetBSD ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/03e48fac2a3a
branches:  trunk
changeset: 413568:03e48fac2a3a
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Mar 20 21:19:54 2020 +0000

description:
ffmpeg4: Add native Solaris/NetBSD audio support.

Work by Yorick Hardy and myself.

Also submitted to ffmpeg-devel, but they didn't take much notice.

To record audio:

$ ffmpeg4 -f sunau -i /dev/audio0 recording.wav

To play audio:

$ ffmpeg4 -i recording.wav -f sunau /dev/audio0

Bump PKGREVISION

diffstat:

 multimedia/ffmpeg4/Makefile                               |    4 +-
 multimedia/ffmpeg4/distinfo                               |   13 +-
 multimedia/ffmpeg4/patches/patch-configure                |   42 +++-
 multimedia/ffmpeg4/patches/patch-doc_general.texi         |   12 +
 multimedia/ffmpeg4/patches/patch-doc_indevs.texi          |   40 +++
 multimedia/ffmpeg4/patches/patch-doc_outdevs.texi         |   22 ++
 multimedia/ffmpeg4/patches/patch-libavdevice_Makefile     |   15 +
 multimedia/ffmpeg4/patches/patch-libavdevice_alldevices.c |   15 +
 multimedia/ffmpeg4/patches/patch-libavdevice_sunau.c      |  109 ++++++++++
 multimedia/ffmpeg4/patches/patch-libavdevice_sunau.h      |   55 +++++
 multimedia/ffmpeg4/patches/patch-libavdevice_sunau__dec.c |  145 ++++++++++++++
 multimedia/ffmpeg4/patches/patch-libavdevice_sunau__enc.c |  121 +++++++++++
 12 files changed, 582 insertions(+), 11 deletions(-)

diffs (truncated from 693 to 300 lines):

diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/Makefile
--- a/multimedia/ffmpeg4/Makefile       Fri Mar 20 20:46:40 2020 +0000
+++ b/multimedia/ffmpeg4/Makefile       Fri Mar 20 21:19:54 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.23 2020/03/10 22:10:38 wiz Exp $
+# $NetBSD: Makefile,v 1.24 2020/03/20 21:19:54 nia Exp $
 
 PKGNAME=       ${DISTNAME:S/ffmpeg/ffmpeg4/}
-PKGREVISION=   3
+PKGREVISION=   4
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://ffmpeg.mplayerhq.hu/
 COMMENT=       Decoding, encoding and streaming software (v4.x)
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/distinfo
--- a/multimedia/ffmpeg4/distinfo       Fri Mar 20 20:46:40 2020 +0000
+++ b/multimedia/ffmpeg4/distinfo       Fri Mar 20 21:19:54 2020 +0000
@@ -1,12 +1,21 @@
-$NetBSD: distinfo,v 1.13 2020/01/02 10:26:31 adam Exp $
+$NetBSD: distinfo,v 1.14 2020/03/20 21:19:54 nia Exp $
 
 SHA1 (ffmpeg-4.2.2.tar.xz) = 2557ec7d1dee31169980a8a10404129f94bd5809
 RMD160 (ffmpeg-4.2.2.tar.xz) = 2f1ff99e3a2db7a17bb6b692dd394e6f3afd803d
 SHA512 (ffmpeg-4.2.2.tar.xz) = 381cd6732fa699eb89000621cf34256920596ed1f9de3c2194dbad35fdf2165269eb7d3a147a0eb75dc18fbb6d601382b5801750e09fc63547766842f84208e3
 Size (ffmpeg-4.2.2.tar.xz) = 9094140 bytes
 SHA1 (patch-Makefile) = 2d27f218ee49179fdea14bb5c86c506dfb64dbd6
-SHA1 (patch-configure) = 5f9acc5a62fe20774e63e8f4d2367174104f2774
+SHA1 (patch-configure) = 4c4290dacc0fb19b6001f1a5778580bb76dd0e60
 SHA1 (patch-doc_Makefile) = 3b86307323fa565f9ad19c5bcb6ea71d323062fc
+SHA1 (patch-doc_general.texi) = 4fd158cb76a6a9fec24d3dae5edb32c0531153a2
+SHA1 (patch-doc_indevs.texi) = 066a6ead2132ec05796bdcc000071dfca76d220c
+SHA1 (patch-doc_outdevs.texi) = 0a6930b835fb24e0008adeeb6c34990db1e16fc1
+SHA1 (patch-libavdevice_Makefile) = 526efd20021068245d8904c0d55508a540ae4054
+SHA1 (patch-libavdevice_alldevices.c) = 8f835f8ec7b057ddcd6303bc2178cdb6f4541e2a
+SHA1 (patch-libavdevice_sunau.c) = 44dba866c58d508c0f873ffdd9ad8d25c059cc8a
+SHA1 (patch-libavdevice_sunau.h) = 2678d87f81e7b3faa42b5cc9814e373c4ad812f6
+SHA1 (patch-libavdevice_sunau__dec.c) = d2fc01e941c68ab8b6f5e0b98ee536a32cc56bdc
+SHA1 (patch-libavdevice_sunau__enc.c) = efe765b99ad6379d0237c619ac0dce41306431be
 SHA1 (patch-libavformat_sctp.c) = 22bad9c7dc152aec3c60e0009899af241f495535
 SHA1 (patch-libavutil_common.h) = d0f1093bc82567807b39dde990ee347f90a082c9
 SHA1 (patch-libavutil_x86_asm.h) = 8f48f9e8ec08b5176bb40fc0021f3bb913dbef22
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-configure
--- a/multimedia/ffmpeg4/patches/patch-configure        Fri Mar 20 20:46:40 2020 +0000
+++ b/multimedia/ffmpeg4/patches/patch-configure        Fri Mar 20 21:19:54 2020 +0000
@@ -1,12 +1,23 @@
-$NetBSD: patch-configure,v 1.3 2018/11/06 19:31:09 adam Exp $
+$NetBSD: patch-configure,v 1.4 2020/03/20 21:19:54 nia Exp $
+
+Sun audio support.
 
 Enable PIC on NetBSD, even on i386 to avoid text relocations.
 Do not use 'rsync'.
+
 Portability fixes.
 
---- configure.orig     2018-11-05 23:22:33.000000000 +0000
+--- configure.orig     2020-03-20 20:53:47.977808652 +0000
 +++ configure
-@@ -2203,7 +2203,6 @@ TOOLCHAIN_FEATURES="
+@@ -2119,6 +2119,7 @@ HEADERS_LIST="
+     sys_resource_h
+     sys_select_h
+     sys_soundcard_h
++    sys_audioio_h
+     sys_time_h
+     sys_un_h
+     sys_videoio_h
+@@ -2257,7 +2258,6 @@ TOOLCHAIN_FEATURES="
      inline_asm_labels
      inline_asm_nonlocal_labels
      pragma_deprecated
@@ -14,7 +25,16 @@
      symver_asm_label
      symver_gnu_asm
      vfp_args
-@@ -4844,9 +4843,9 @@ elif enabled mips; then
+@@ -3336,6 +3336,8 @@ opengl_outdev_deps="opengl"
+ opengl_outdev_suggest="sdl2"
+ oss_indev_deps_any="sys_soundcard_h"
+ oss_outdev_deps_any="sys_soundcard_h"
++sunau_indev_deps_any="sys_audioio_h"
++sunau_outdev_deps_any="sys_audioio_h"
+ pulse_indev_deps="libpulse"
+ pulse_outdev_deps="libpulse"
+ sdl2_outdev_deps="sdl2"
+@@ -4950,9 +4952,9 @@ elif enabled mips; then
                  disable mipsdsp
                  disable mipsdspr2
                  # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
@@ -26,7 +46,7 @@
                          expensive_optimization_flag=""
                      else
                          expensive_optimization_flag="-fno-expensive-optimizations"
-@@ -5140,6 +5139,7 @@ case $target_os in
+@@ -5247,6 +5249,7 @@ case $target_os in
          ;;
      netbsd)
          disable symver
@@ -34,7 +54,7 @@
          oss_indev_extralibs="-lossaudio"
          oss_outdev_extralibs="-lossaudio"
          enabled gcc || check_ldflags -Wl,-zmuldefs
-@@ -5526,10 +5526,13 @@ done
+@@ -5639,10 +5642,13 @@ done
  check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
  
  # The global variable ensures the bits appear unchanged in the object file.
@@ -51,7 +71,15 @@
  
  check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
  
-@@ -6299,7 +6302,6 @@ enabled makeinfo \
+@@ -6021,6 +6027,7 @@ check_headers libcrystalhd/libcrystalhd_
+ check_headers malloc.h
+ check_headers net/udplite.h
+ check_headers poll.h
++check_headers sys/audioio.h
+ check_headers sys/param.h
+ check_headers sys/resource.h
+ check_headers sys/select.h
+@@ -6427,7 +6434,6 @@ enabled makeinfo \
  disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  perl -v            > /dev/null 2>&1 && enable perl      || disable perl
  pod2man --help     > /dev/null 2>&1 && enable pod2man   || disable pod2man
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-doc_general.texi
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-doc_general.texi Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-doc_general.texi,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+--- doc/general.texi.orig      2019-12-31 21:35:22.000000000 +0000
++++ doc/general.texi
+@@ -1354,6 +1354,7 @@ performance on systems without hardware 
+ @item OSS               @tab X      @tab X
+ @item PulseAudio        @tab X      @tab X
+ @item SDL               @tab        @tab X
++@item Sun Audio         @tab        @tab X
+ @item Video4Linux2      @tab X      @tab X
+ @item VfW capture       @tab X      @tab
+ @item X11 grabbing      @tab X      @tab
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-doc_indevs.texi
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-doc_indevs.texi  Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-doc_indevs.texi,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+--- doc/indevs.texi.orig       2019-12-31 21:35:22.000000000 +0000
++++ doc/indevs.texi
+@@ -1282,6 +1282,35 @@ Set the number of channels. Default is 2
+ 
+ @end table
+ 
++@section sunau
++
++Solaris/NetBSD audio input device.
++
++The filename to provide to the input device is the device node
++representing the Sun input device, and is usually set to
++@file{/dev/audio0}.
++
++For example to grab from @file{/dev/audio0} using @command{ffmpeg} use the
++command:
++@example
++ffmpeg -f sunau -i /dev/audio0 /tmp/oss.wav
++@end example
++
++@subsection Options
++
++@table @option
++
++@item buffer_samples
++Set the size of the audio buffer in samples. Default is 32.
++
++@item sample_rate
++Set the sample rate in Hz. Default is 48000.
++
++@item channels
++Set the number of channels. Default is 2.
++
++@end table
++
+ @section video4linux2, v4l2
+ 
+ Video4Linux2 input video device.
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-doc_outdevs.texi
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-doc_outdevs.texi Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-doc_outdevs.texi,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+--- doc/outdevs.texi.orig      2019-12-31 21:35:22.000000000 +0000
++++ doc/outdevs.texi
+@@ -393,6 +393,17 @@ ffmpeg -i INPUT -c:v rawvideo -pix_fmt y
+ 
+ sndio audio output device.
+ 
++@section sunau
++
++Solaris/NetBSD audio output device.
++
++@subsection Options
++@table @option
++
++@item buffer_samples
++Set the size of the audio buffer in samples. Default is 32.
++@end table
++
+ @section v4l2
+ 
+ Video4Linux2 output device.
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-libavdevice_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-libavdevice_Makefile     Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-libavdevice_Makefile,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+Sun audio support.
+
+--- libavdevice/Makefile.orig  2019-12-31 21:35:24.000000000 +0000
++++ libavdevice/Makefile
+@@ -43,6 +43,8 @@ OBJS-$(CONFIG_PULSE_OUTDEV)             
+ OBJS-$(CONFIG_SDL2_OUTDEV)               += sdl2.o
+ OBJS-$(CONFIG_SNDIO_INDEV)               += sndio_dec.o sndio.o
+ OBJS-$(CONFIG_SNDIO_OUTDEV)              += sndio_enc.o sndio.o
++OBJS-$(CONFIG_SUNAU_INDEV)               += sunau_dec.o sunau.o
++OBJS-$(CONFIG_SUNAU_OUTDEV)              += sunau_enc.o sunau.o
+ OBJS-$(CONFIG_V4L2_INDEV)                += v4l2.o v4l2-common.o timefilter.o
+ OBJS-$(CONFIG_V4L2_OUTDEV)               += v4l2enc.o v4l2-common.o
+ OBJS-$(CONFIG_VFWCAP_INDEV)              += vfwcap.o
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-libavdevice_alldevices.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-libavdevice_alldevices.c Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-libavdevice_alldevices.c,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+Sun audio support.
+
+--- libavdevice/alldevices.c.orig      2019-12-31 21:35:24.000000000 +0000
++++ libavdevice/alldevices.c
+@@ -49,6 +49,8 @@ extern AVOutputFormat ff_pulse_muxer;
+ extern AVOutputFormat ff_sdl2_muxer;
+ extern AVInputFormat  ff_sndio_demuxer;
+ extern AVOutputFormat ff_sndio_muxer;
++extern AVInputFormat  ff_sunau_demuxer;
++extern AVOutputFormat ff_sunau_muxer;
+ extern AVInputFormat  ff_v4l2_demuxer;
+ extern AVOutputFormat ff_v4l2_muxer;
+ extern AVInputFormat  ff_vfwcap_demuxer;
diff -r 5f0f52f41722 -r 03e48fac2a3a multimedia/ffmpeg4/patches/patch-libavdevice_sunau.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg4/patches/patch-libavdevice_sunau.c      Fri Mar 20 21:19:54 2020 +0000
@@ -0,0 +1,109 @@
+$NetBSD: patch-libavdevice_sunau.c,v 1.1 2020/03/20 21:19:54 nia Exp $
+
+Sun audio support.
+
+--- libavdevice/sunau.c.orig   2020-03-20 20:53:01.554485424 +0000
++++ libavdevice/sunau.c
+@@ -0,0 +1,102 @@
++/*
++ * Solaris/NetBSD play and grab interface
++ * Copyright (c) 2020 Yorick Hardy
++ * Copyright (c) 2020 Nia Alarie <nia%NetBSD.org@localhost>
++ *
++ * This file is part of FFmpeg.
++ *
++ * FFmpeg is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * FFmpeg is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#include "config.h"
++
++#include <string.h>
++
++#include <unistd.h>
++#include <fcntl.h>
++#include <sys/audioio.h>
++#include <sys/ioctl.h>
++
++#include "libavutil/log.h"
++
++#include "libavcodec/avcodec.h"
++#include "avdevice.h"
++
++#include "sunau.h"
++
++int ff_sunau_audio_open(AVFormatContext *s1, int is_output,
++                          const char *audio_device)
++{
++    SunAudioData *s = s1->priv_data;



Home | Main Index | Thread Index | Old Index