1 /*
2 * Linux audio grab interface
3 * Copyright (c) 2000, 2001 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
23
24 #if HAVE_UNISTD_H
25 #include <unistd.h>
26 #endif
27 #include <fcntl.h>
28 #include <sys/ioctl.h>
29 #include <sys/soundcard.h>
30
32
34
37
39
41 {
44 int ret;
45
50 if (ret < 0) {
52 } else {
53 return 0;
54 }
55 }
56
58 {
63
64 while (size > 0) {
69 for(;;) {
71 if (ret > 0)
72 break;
73 if (ret < 0 && (errno != EAGAIN && errno != EINTR))
75 }
77 }
80 }
81 return 0;
82 }
83
85 {
87
89 return 0;
90 }
91
97 };
98
103 /* XXX: we make the assumption that the soundcard accepts this format */
104 /* XXX: find better solution with "preinit" method, needed also in
105 other formats */
113 };
static int audio_write_trailer(AVFormatContext *s1)
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
AVOutputFormat ff_oss_muxer
uint8_t buffer[OSS_AUDIO_BLOCK_SIZE]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream ** streams
A list of all streams in the file.
#define OSS_AUDIO_BLOCK_SIZE
int ff_oss_audio_open(AVFormatContext *s1, int is_output, const char *audio_device)
Main libavdevice API header.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
char * url
input or output URL.
common internal API header
Libavcodec external API header.
Describe the class of an AVClass context structure.
static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
int sample_rate
Audio only.
static int audio_write_header(AVFormatContext *s1)
int ff_oss_audio_close(OSSAudioData *s)
void * priv_data
Format private data.
static const AVClass oss_muxer_class
AVCodecParameters * codecpar
Codec parameters associated with this stream.
This structure stores compressed data.