Mercurial > pt1.oyama
comparison libdlna-0.2.3/src/audio_atrac3.c @ 129:4f6d9621ee00
add multi session streaming & add depending librarys.
- libupnp-1.6.6
- libdlna-0.2.3
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Sun, 10 Oct 2010 15:33:18 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
128:3a7d8d2f0585 | 129:4f6d9621ee00 |
---|---|
1 /* | |
2 * libdlna: reference DLNA standards implementation. | |
3 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org> | |
4 * | |
5 * This file is part of libdlna. | |
6 * | |
7 * libdlna 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 * libdlna 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 libdlna; if not, write to the Free Software | |
19 * Foundation, Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 */ | |
21 | |
22 #include <stdlib.h> | |
23 #include <string.h> | |
24 | |
25 #include "dlna_internals.h" | |
26 #include "profiles.h" | |
27 | |
28 /* Profile for audio media class content */ | |
29 static dlna_profile_t atrac3 = { | |
30 .id = "ATRAC3plus", | |
31 .mime = MIME_AUDIO_ATRAC, | |
32 .label = LABEL_AUDIO_2CH_MULTI | |
33 }; | |
34 | |
35 audio_profile_t | |
36 audio_profile_guess_atrac (AVCodecContext *ac) | |
37 { | |
38 if (!ac) | |
39 return AUDIO_PROFILE_INVALID; | |
40 | |
41 #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4) | |
42 if (ac->codec_id == CODEC_ID_ATRAC3) | |
43 return AUDIO_PROFILE_ATRAC; | |
44 #endif | |
45 | |
46 return AUDIO_PROFILE_INVALID; | |
47 } | |
48 | |
49 static dlna_profile_t * | |
50 probe_atrac3 (AVFormatContext *ctx dlna_unused, | |
51 dlna_container_type_t st dlna_unused, | |
52 av_codecs_t *codecs) | |
53 { | |
54 if (!stream_ctx_is_audio (codecs)) | |
55 return NULL; | |
56 | |
57 if (audio_profile_guess_atrac (codecs->ac) == AUDIO_PROFILE_ATRAC) | |
58 return &atrac3; | |
59 | |
60 return NULL; | |
61 } | |
62 | |
63 dlna_registered_profile_t dlna_profile_audio_atrac3 = { | |
64 .id = DLNA_PROFILE_AUDIO_ATRAC3, | |
65 .class = DLNA_CLASS_AUDIO, | |
66 .extensions = "at3p,acm,wav", | |
67 .probe = probe_atrac3, | |
68 .next = NULL | |
69 }; |