annotate libdlna-0.2.3/src/audio_amr.c @ 130:cc3e3f370aec

tune for streaming.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Sun, 10 Oct 2010 22:44:28 +0900
parents 4f6d9621ee00
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
1 /*
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
2 * libdlna: reference DLNA standards implementation.
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org>
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
4 *
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
5 * This file is part of libdlna.
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
6 *
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
7 * libdlna is free software; you can redistribute it and/or
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
11 *
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
12 * libdlna is distributed in the hope that it will be useful,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
15 * Lesser General Public License for more details.
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
16 *
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
18 * License along with libdlna; if not, write to the Free Software
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
19 * Foundation, Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
20 */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
21
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
22 #include <stdlib.h>
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
23 #include <string.h>
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
24
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
25 #include "dlna_internals.h"
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
26 #include "profiles.h"
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
27 #include "containers.h"
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
28
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
29 /* Profile for audio media class content */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
30 static dlna_profile_t amr = {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
31 .id = "AMR_3GPP",
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
32 .mime = MIME_AUDIO_MPEG_4,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
33 .label = LABEL_AUDIO_MONO
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
34 };
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
35
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
36 /* Profile for audio media class content */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
37 static dlna_profile_t three_gpp = {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
38 .id = "AMR_3GPP",
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
39 .mime = MIME_AUDIO_3GP,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
40 .label = LABEL_AUDIO_MONO
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
41 };
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
42
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
43 /* Profile for audio media class content */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
44 static dlna_profile_t amr_wbplus = {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
45 .id = "AMR_WBplus",
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
46 .mime = MIME_AUDIO_3GP,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
47 .label = LABEL_AUDIO_2CH
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
48 };
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
49
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
50 static int
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
51 audio_is_valid_amr (AVCodecContext *ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
52 {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
53 if (!ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
54 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
55
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
56 if (ac->codec_id != CODEC_ID_AMR_NB)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
57 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
58
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
59 /* only mono is supported */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
60 if (ac->channels != 1)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
61 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
62
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
63 /* only supports 8 kHz sampling rate */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
64 if (ac->sample_rate != 8000)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
65 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
66
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
67 /* valid CBR bitrates: 4.75, 5.15, 5.9, 6.7, 7.4, 7.95, 10.2, 12.2 Kbps */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
68 switch (ac->bit_rate)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
69 {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
70 case 4750:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
71 case 5150:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
72 case 5900:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
73 case 6700:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
74 case 7400:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
75 case 7950:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
76 case 10200:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
77 case 12200:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
78 return 1;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
79 default:
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
80 break;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
81 }
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
82
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
83 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
84 }
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
85
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
86 static int
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
87 audio_is_valid_amr_wb (AVCodecContext *ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
88 {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
89 if (!ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
90 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
91
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
92 if (ac->codec_id != CODEC_ID_AMR_WB)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
93 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
94
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
95 /* valid sampling rates: 8, 16, 24, 32 and 48 kHz */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
96 if (ac->sample_rate != 8000 &&
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
97 ac->sample_rate != 16000 &&
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
98 ac->sample_rate != 24000 &&
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
99 ac->sample_rate != 32000 &&
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
100 ac->sample_rate != 48000)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
101 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
102
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
103 /* supported bit rates: 5.2 Kbps - 48 Kbps */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
104 if (ac->bit_rate < 5200 || ac->bit_rate > 48000)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
105 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
106
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
107 /* only mono and stereo are supported */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
108 if (ac->channels > 2)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
109 return 0;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
110
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
111 return 1;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
112 }
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
113
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
114 audio_profile_t
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
115 audio_profile_guess_amr (AVCodecContext *ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
116 {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
117 if (!ac)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
118 return AUDIO_PROFILE_INVALID;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
119
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
120 if (audio_is_valid_amr (ac))
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
121 return AUDIO_PROFILE_AMR;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
122 else if (audio_is_valid_amr_wb (ac))
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
123 return AUDIO_PROFILE_AMR_WB;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
124
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
125 return AUDIO_PROFILE_INVALID;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
126 }
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
127
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
128 static dlna_profile_t *
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
129 probe_amr (AVFormatContext *ctx dlna_unused,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
130 dlna_container_type_t st,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
131 av_codecs_t *codecs)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
132 {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
133 if (!stream_ctx_is_audio (codecs))
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
134 return NULL;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
135
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
136 /* check for supported container */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
137 if (st != CT_AMR && st != CT_3GP && st != CT_MP4)
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
138 return NULL;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
139
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
140 /* check for AMR NB/WB audio codec */
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
141 if (audio_is_valid_amr (codecs->ac))
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
142 return (st == CT_3GP) ? &three_gpp : &amr;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
143
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
144 if (audio_is_valid_amr_wb (codecs->ac))
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
145 return &amr_wbplus;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
146
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
147 return NULL;
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
148 }
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
149
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
150 dlna_registered_profile_t dlna_profile_audio_amr = {
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
151 .id = DLNA_PROFILE_AUDIO_AMR,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
152 .class = DLNA_CLASS_AUDIO,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
153 .extensions = "amr,3gp,mp4",
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
154 .probe = probe_amr,
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
155 .next = NULL
4f6d9621ee00 add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff changeset
156 };