summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-07 00:17:24 +0200
committerwm4 <wm4@nowhere>2012-08-07 01:09:30 +0200
commitc113e6ed7de00dcee53f94871985a33dca9c7c29 (patch)
treeee601fc4e4f4d0b3ed712282450dcb658fcf0f29 /libao2
parent229380d9bd1995583c38d2cc061d5264e3afb020 (diff)
downloadmpv-c113e6ed7de00dcee53f94871985a33dca9c7c29.tar.bz2
mpv-c113e6ed7de00dcee53f94871985a33dca9c7c29.tar.xz
Remove V4L2 decoder support (vo_v4l2 and ao_v4l2)
The removed VO and AO took MPEG data and decoded it with V4L2. I'm not exactly sure what's the use of this today, but get rid of it. As far as feeding video data to V4L2 is concerned, there are other ways. For example, there is this script, that feeds yuv4mpeg formatted raw video data to V4L2: https://raw.github.com/umlaeute/v4l2loopback/master/examples/yuv4mpeg_to_v4l2.c
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_v4l2.c158
-rw-r--r--libao2/audio_out.c4
2 files changed, 0 insertions, 162 deletions
diff --git a/libao2/ao_v4l2.c b/libao2/ao_v4l2.c
deleted file mode 100644
index 2bc74379a0..0000000000
--- a/libao2/ao_v4l2.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * audio output for V4L2 hardware MPEG decoders
- *
- * WARNING: You need to force -ac hwmpa for audio output to work.
- *
- * Copyright (C) 2007 Benjamin Zores
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <inttypes.h>
-
-#include "config.h"
-
-#include "mp_msg.h"
-
-#include "audio_out.h"
-#include "audio_out_internal.h"
-#include "libaf/af_format.h"
-#include "libmpdemux/mpeg_packetizer.h"
-#include "libvo/vo_v4l2.h"
-
-#define MPEG_AUDIO_ID 0x1C0
-
-static int freq = 0;
-
-static const ao_info_t info =
-{
- "V4L2 MPEG Audio Decoder output",
- "v4l2",
- "Benjamin Zores",
- ""
-};
-
-LIBAO_EXTERN (v4l2)
-
-/* to set/get/query special features/parameters */
-static int
-control (int cmd,void *arg)
-{
- return CONTROL_UNKNOWN;
-}
-
-/* open & setup audio device */
-static int
-init (int rate, int channels, int format, int flags)
-{
- if (v4l2_fd < 0)
- return 0;
-
- if (format != AF_FORMAT_MPEG2)
- {
- mp_msg (MSGT_AO, MSGL_FATAL,
- "AO: [v4l2] can only handle MPEG audio streams.\n");
- return 0;
- }
-
- ao_data.outburst = 2048;
- ao_data.samplerate = rate;
- ao_data.channels = channels;
- ao_data.format = AF_FORMAT_MPEG2;
- ao_data.buffersize = 2048;
- ao_data.bps = rate * 2 * 2;
- ao_data.brokenpts = 0;
- freq = rate;
-
- /* check for supported audio rate */
- if (rate != 32000 || rate != 41000 || rate != 48000)
- {
- mp_tmsg (MSGT_AO, MSGL_ERR, "[AO MPEGPES] %d Hz not supported, try to resample.\n", rate);
- rate = 48000;
- }
-
- return 1;
-}
-
-/* close audio device */
-static void
-uninit (int immed)
-{
- /* nothing to do */
-}
-
-/* stop playing and empty buffers (for seeking/pause) */
-static void
-reset (void)
-{
- /* nothing to do */
-}
-
-/* stop playing, keep buffers (for pause) */
-static void
-audio_pause (void)
-{
- reset ();
-}
-
-/* resume playing, after audio_pause() */
-static void
-audio_resume (void)
-{
- /* nothing to do */
-}
-
-/* how many bytes can be played without blocking */
-static int
-get_space (void)
-{
- extern int vo_pts;
- float x;
- int y;
-
- x = (float) (vo_pts - ao_data.brokenpts) / 90000.0;
- if (x <= 0)
- return 0;
-
- y = freq * 4 * x;
- y /= ao_data.outburst;
- y *= ao_data.outburst;
-
- if (y > 32000)
- y = 32000;
-
- return y;
-}
-
-/* number of bytes played */
-static int
-play (void *data, int len, int flags)
-{
- if (ao_data.format != AF_FORMAT_MPEG2)
- return 0;
-
- send_mpeg_pes_packet (data, len, MPEG_AUDIO_ID, ao_data.brokenpts, 2, v4l2_write);
-
- return len;
-}
-
-/* delay in seconds between first and last sample in buffer */
-static float
-get_delay (void)
-{
- return 0.0;
-}
diff --git a/libao2/audio_out.c b/libao2/audio_out.c
index 744bcaf9bd..740ee94a63 100644
--- a/libao2/audio_out.c
+++ b/libao2/audio_out.c
@@ -41,7 +41,6 @@ extern const struct ao_driver audio_out_openal;
extern const struct ao_driver audio_out_null;
extern const struct ao_driver audio_out_alsa;
extern const struct ao_driver audio_out_dsound;
-extern const struct ao_driver audio_out_v4l2;
extern const struct ao_driver audio_out_pcm;
extern const struct ao_driver audio_out_pss;
extern const struct ao_driver audio_out_portaudio;
@@ -73,9 +72,6 @@ static const struct ao_driver * const audio_out_drivers[] = {
#ifdef CONFIG_OPENAL
&audio_out_openal,
#endif
-#ifdef CONFIG_V4L2_DECODER
- &audio_out_v4l2,
-#endif
&audio_out_null,
// should not be auto-selected:
&audio_out_pcm,