3 * Copyright (c) 2011 Luca Barbato <lu_zero@gentoo.org>
5 * This file is part of FFmpeg.
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.
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.
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
22 #include "pulse_audio_common.h"
23 #include "libavutil/attributes.h"
25 pa_sample_format_t av_cold ff_codec_id_to_pulse_format(enum AVCodecID codec_id)
28 case AV_CODEC_ID_PCM_U8: return PA_SAMPLE_U8;
29 case AV_CODEC_ID_PCM_ALAW: return PA_SAMPLE_ALAW;
30 case AV_CODEC_ID_PCM_MULAW: return PA_SAMPLE_ULAW;
31 case AV_CODEC_ID_PCM_S16LE: return PA_SAMPLE_S16LE;
32 case AV_CODEC_ID_PCM_S16BE: return PA_SAMPLE_S16BE;
33 case AV_CODEC_ID_PCM_F32LE: return PA_SAMPLE_FLOAT32LE;
34 case AV_CODEC_ID_PCM_F32BE: return PA_SAMPLE_FLOAT32BE;
35 case AV_CODEC_ID_PCM_S32LE: return PA_SAMPLE_S32LE;
36 case AV_CODEC_ID_PCM_S32BE: return PA_SAMPLE_S32BE;
37 case AV_CODEC_ID_PCM_S24LE: return PA_SAMPLE_S24LE;
38 case AV_CODEC_ID_PCM_S24BE: return PA_SAMPLE_S24BE;
39 default: return PA_SAMPLE_INVALID;