head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.16 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.14 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.12 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.10 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.8 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.6 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.4 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.2 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.2.0.22 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.20 pkgsrc-2008Q1:1.2.0.18 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.16 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.14 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.12 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.10 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.8 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.6 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.4 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.2 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.1.0.12 pkgsrc-2005Q4-base:1.1 pkgsrc-2005Q3:1.1.0.10 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.8 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.6 pkgsrc-2005Q1-base:1.1 pkgsrc-2004Q4:1.1.0.4 pkgsrc-2004Q4-base:1.1 pkgsrc-2004Q3:1.1.0.2 pkgsrc-2004Q3-base:1.1; locks; strict; comment @# @; 1.3 date 2008.09.07.23.39.38; author ahoka; state dead; branches; next 1.2; 1.2 date 2006.02.16.10.26.30; author abs; state Exp; branches; next 1.1; 1.1 date 2004.08.29.22.43.50; author wiz; state Exp; branches; next ; desc @@ 1.3 log @Track FreeBSD's SVN snapshots of ffmpeg as there are no more stable releases produced by the ffmpeg team. Add v4l2 support for NetBSD. @ text @$NetBSD: patch-ag,v 1.2 2006/02/16 10:26:30 abs Exp $ --- libavformat/audio.c.orig 2004-06-19 05:59:34.000000000 +0200 +++ libavformat/audio.c @@@@ -18,10 +18,19 @@@@ */ #include "avformat.h" +#ifdef __NetBSD__ +#define USE_SUNAUDIO +#endif + #include #include #include +#ifndef USE_SUNAUDIO #include +#else +#include +#include +#endif #include #include #include @@@@ -47,9 +56,18 @@@@ static int audio_open(AudioData *s, int int tmp, err; char *flip = getenv("AUDIO_FLIP_LEFT"); +#ifdef USE_SUNAUDIO + audio_info_t info; + struct audio_prinfo *settings; + int mixer_fd; + + if (!audio_device) + audio_device = "/dev/audio"; +#else /* open linux audio device */ if (!audio_device) audio_device = "/dev/dsp"; +#endif if (is_output) audio_fd = open(audio_device, O_WRONLY); @@@@ -77,6 +95,7 @@@@ static int audio_open(AudioData *s, int } #endif +#ifndef USE_SUNAUDIO /* select format : favour native format */ err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp); @@@@ -124,14 +143,114 @@@@ static int audio_open(AudioData *s, int } if (tmp) s->channels = 2; +#else /* USE_SUNAUDIO */ + AUDIO_INITINFO(&info); + if (!is_output) { + info.mode = AUMODE_RECORD; + settings = &info.record; + } else { + info.mode = AUMODE_PLAY; + settings = &info.play; + } + + /* select format */ + /* Try native 16 bit format first */ +#ifdef WORDS_BIGENDIAN + settings->encoding = AUDIO_ENCODING_SLINEAR_BE; + s->codec_id = CODEC_ID_PCM_S16BE; +#else + settings->encoding = AUDIO_ENCODING_SLINEAR_LE; + s->codec_id = CODEC_ID_PCM_S16LE; +#endif + settings->precision = 16; + err = ioctl(audio_fd, AUDIO_SETINFO, &info); + if (err < 0) { + fprintf(stderr, "Soundcard does not support signed 16 bit sample format\n"); + close(audio_fd); + return -EIO; + } + /* set channels */ + AUDIO_INITINFO(&info); + settings->channels = s->channels; + err = ioctl(audio_fd, AUDIO_SETINFO, &info); + if (err < 0) { + fprintf(stderr, "stereo not supported, using mono"); + } + + /* set gain */ + AUDIO_INITINFO(&info); + settings->gain = AUDIO_MAX_GAIN; + err = ioctl(audio_fd, AUDIO_SETINFO, &info); + if (err < 0) { + fprintf(stderr, "setting gain to %d failed", AUDIO_MAX_GAIN); + } + +#ifndef MIXER_DEVICE +#define MIXER_DEVICE "/dev/mixer" +#endif + if ((mixer_fd=open(MIXER_DEVICE, O_RDONLY)) == -1) + fprintf(stderr, "can't open %s\n", MIXER_DEVICE); + else { + int n; + mixer_devinfo_t mdt; + /* get debuggin information about all mixer devices */ + mdt.index = n = 0; + while (ioctl(mixer_fd, AUDIO_MIXER_DEVINFO, &mdt) != -1) { + if (strcasecmp(mdt.label.name, "inputs") == 0) { + while (mdt.next != -1) { + printf("Mixer device %d: `%s' has type %d, class %d\n", + mdt.index, mdt.label.name, mdt.type, + mdt.mixer_class); + mdt.index = mdt.next; + if (ioctl(mixer_fd, AUDIO_MIXER_DEVINFO, &mdt) == -1) { + fprintf(stderr, "getting next mixer device " + "failed (%d)", mdt.index); + break; + } + printf("next device: "); + } + printf("Mixer device %d: `%s' has type %d, class %d\n", + mdt.index, mdt.label.name, mdt.type, + mdt.mixer_class); + } + n++; + mdt.index = n; + } + /* set input to line-in */ + AUDIO_INITINFO(&info); + settings->port = AUDIO_LINE_IN; + err = ioctl(audio_fd, AUDIO_SETINFO, &info); + if (err < 0) { + fprintf(stderr, "setting input to line-in failed"); + } + } + close(mixer_fd); +#endif + +#ifndef USE_SUNAUDIO tmp = s->sample_rate; err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp); if (err < 0) { perror("SNDCTL_DSP_SPEED"); goto fail; } + s->sample_rate = tmp; /* store real sample rate */ +#else + AUDIO_INITINFO(&info); + settings->sample_rate = s->sample_rate; + err = ioctl(audio_fd, AUDIO_SETINFO, &info); + if (err < 0) { + fprintf(stderr, "setting sample rate to %d failed", s->sample_rate); + err = ioctl(audio_fd, AUDIO_GETINFO, &info); + if (err < 0) { + perror("AUDIO_GETINFO"); + goto fail; + } + s->sample_rate = settings->sample_rate; + } +#endif s->fd = audio_fd; return 0; @@@@ -240,7 +359,11 @@@@ static int audio_read_packet(AVFormatCon AudioData *s = s1->priv_data; int ret, bdelay; int64_t cur_time; +#ifndef USE_SUNAUDIO struct audio_buf_info abufi; +#else + audio_info_t info; +#endif if (av_new_packet(pkt, s->frame_size) < 0) return AVERROR_IO; @@@@ -276,9 +399,15 @@@@ static int audio_read_packet(AVFormatCon /* compute pts of the start of the packet */ cur_time = av_gettime(); bdelay = ret; +#ifndef USE_SUNAUDIO if (ioctl(s->fd, SNDCTL_DSP_GETISPACE, &abufi) == 0) { bdelay += abufi.bytes; } +#else + if (ioctl(s->fd, AUDIO_GETINFO, &info) == 0) { + bdelay += info.record.seek * (info.record.precision/8); + } +#endif /* substract time represented by the number of bytes in the audio fifo */ cur_time -= (bdelay * 1000000LL) / (s->sample_rate * s->channels); @ 1.2 log @Update ffmpeg to 0.4.9pre1, and add patch for libavcodec buffer overflow http://secunia.com/advisories/17892/ version 0.4.9-pre1: - DV encoder, DV muxer - Microsoft RLE video decoder - Microsoft Video-1 decoder - Apple Animation (RLE) decoder - Apple Graphics (SMC) decoder - Apple Video (RPZA) decoder - Cinepak decoder - Sega FILM (CPK) file demuxer - Westwood multimedia support (VQA & AUD files) - Id Quake II CIN playback support - 8BPS video decoder - FLIC playback support - RealVideo 2.0 (RV20) decoder - Duck TrueMotion v1 (DUCK) video decoder - Sierra VMD demuxer and video decoder - MSZH and ZLIB decoder support - SVQ1 video encoder - AMR-WB support - PPC optimisations - rate distortion optimal cbp support - rate distorted optimal ac prediction for mpeg4 - rate distorted optimal lambda->qp support - AAC encoding with libfaac - Sunplus JPEG codec (SP5X) support - use lagrange multipler instead of qp for ratecontrol - theora/VP3 decoding support - XA and ADX ADPCM codecs - export mpeg2 active display area / pan scan - Add support for configuring with IBM XLC - floating point AAN DCT - initial support for zygovideo (not complete) - rgb ffv1 support - new audio/video parser API - av_log() system - av_read_frame() and av_seek_frame() support - missing last frame fixes - seek by mouse in ffplay - noise reduction of dct coefficients - h263 OBMC & 4MV support - h263 alternative inter vlc support - h263 loop filter - h263 slice structured mode - interlaced DCT support for MPEG2 encoding - stuffing to stay above min_bitrate - mb type & qp vissualization - frame stepping for ffplay - interlaced motion estimation - alternate scantable support - SVCD scan offset support - closed gop support - SSE2 fdct - quantizer noise shaping - G.726 ADPCM audio codec - MS ADPCM encoding - multithreaded/SMP motion estimation - multithreaded/SMP encoding for MPEG1/MPEG2/MPEG4/H263 - multithreaded/SMP decoding for MPEG2 - FLAC decoder - Metrowerks CodeWarrior suppport - h263+ custom pcf support - nicer output for 'ffmpeg -formats' - matroska demuxer - SGI image format, encoding and decoding - h264 loop filter support - h264 CABAC support - nicer looking arrows for the motion vector vissualization - improved VCD support - audio timestamp drift compensation - mpeg2 YUV 422/444 support - polyphase kaiser windowed sinc and blackman nuttall windowed sinc audio resample - better image scaling - h261 support - correctly interleave packets during encoding - VIS optimized motion compensation - intra_dc_precission>0 encoding support - support reuse of motion vectors/mb types/field select values of the source video - more accurate deblock filter - padding support - many optimizations and bugfixes @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.1.1.1 2006/01/24 04:00:37 xtraeme Exp $ @ 1.1 log @Convert to bsd.options.mk, and add three new options: bktr lame vorbis. The latter two add support for reading/writing mp3 and ogg files, while the first adds support for grabbing from bktr(4), based on a file from FreeBSD ports with some additional changes by me. Additionally, document how to use it in the man page. Also, add a patch (by me) to use the NetBSD native audio interface instead of libossaudio (on NetBSD). Based on PR 24691 and additional mails by Ove Soerensen (thanks!). Also addresses PR 20281. Bump PKGREVISION for the audio interface change. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- libavformat/audio.c.orig 2003-09-28 17:26:40.000000000 +0200 d167 1 a167 1 @@@@ -239,7 +358,11 @@@@ static int audio_read_packet(AVFormatCon d178 2 a179 2 return -EIO; @@@@ -274,9 +397,15 @@@@ static int audio_read_packet(AVFormatCon @