comparison libdlna-0.2.3/src/profiles.h @ 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 #ifndef _PROFILES_H_
23 #define _PROFILES_H_
24
25 #include <ffmpeg/avcodec.h>
26 #include <ffmpeg/avformat.h>
27
28 #include "dlna_internals.h"
29 #include "containers.h"
30
31 /* DLNA MIME types */
32 #define MIME_IMAGE_JPEG "image/jpeg"
33 #define MIME_IMAGE_PNG "image/png"
34
35 #define MIME_AUDIO_3GP "audio/3gpp"
36 #define MIME_AUDIO_ADTS "audio/vnd.dlna.adts"
37 #define MIME_AUDIO_ATRAC "audio/x-sony-oma"
38 #define MIME_AUDIO_DOLBY_DIGITAL "audio/vnd.dolby.dd-raw"
39 #define MIME_AUDIO_LPCM "audio/L16"
40 #define MIME_AUDIO_MPEG "audio/mpeg"
41 #define MIME_AUDIO_MPEG_4 "audio/mp4"
42 #define MIME_AUDIO_WMA "audio/x-ms-wma"
43
44 #define MIME_VIDEO_3GP "video/3gpp"
45 #define MIME_VIDEO_ASF "video/x-ms-asf"
46 #define MIME_VIDEO_MPEG "video/mpeg"
47 #define MIME_VIDEO_MPEG_4 "video/mp4"
48 #define MIME_VIDEO_MPEG_TS "video/vnd.dlna.mpeg-tts"
49 #define MIME_VIDEO_WMV "video/x-ms-wmv"
50
51 /* DLNA Labels */
52 #define LABEL_IMAGE_PICTURE "picture"
53 #define LABEL_IMAGE_ICON "icon"
54
55 #define LABEL_AUDIO_MONO "mono"
56 #define LABEL_AUDIO_2CH "2-ch"
57 #define LABEL_AUDIO_2CH_MULTI "2-ch multi"
58 #define LABEL_AUDIO_MULTI "multi"
59
60 #define LABEL_VIDEO_CIF15 "CIF15"
61 #define LABEL_VIDEO_CIF30 "CIF30"
62 #define LABEL_VIDEO_QCIF15 "QCIF15"
63 #define LABEL_VIDEO_SD "SD"
64 #define LABEL_VIDEO_HD "HD"
65
66 typedef struct av_codecs_s {
67 /* audio stream and codec */
68 AVStream *as;
69 AVCodecContext *ac;
70 /* video stream and codec */
71 AVStream *vs;
72 AVCodecContext *vc;
73 } av_codecs_t;
74
75 typedef struct dlna_registered_profile_s {
76 dlna_media_profile_t id;
77 dlna_media_class_t class;
78 char *extensions;
79 dlna_profile_t * (*probe) (AVFormatContext *ctx,
80 dlna_container_type_t st,
81 av_codecs_t *codecs);
82 struct dlna_registered_profile_s *next;
83 } dlna_registered_profile_t;
84
85 char * get_file_extension (const char *filename);
86
87 /* audio profile checks */
88
89 typedef enum {
90 AUDIO_PROFILE_INVALID = 0,
91
92 /* Advanced Audio Codec variants */
93 AUDIO_PROFILE_AAC,
94 AUDIO_PROFILE_AAC_320,
95 AUDIO_PROFILE_AAC_MULT5,
96 AUDIO_PROFILE_AAC_BSAC,
97 AUDIO_PROFILE_AAC_BSAC_MULT5,
98 AUDIO_PROFILE_AAC_HE_L2,
99 AUDIO_PROFILE_AAC_HE_L2_320,
100 AUDIO_PROFILE_AAC_HE_L3,
101 AUDIO_PROFILE_AAC_HE_MULT5,
102 AUDIO_PROFILE_AAC_HE_V2_L2,
103 AUDIO_PROFILE_AAC_HE_V2_L2_320,
104 AUDIO_PROFILE_AAC_HE_V2_L3,
105 AUDIO_PROFILE_AAC_HE_V2_MULT5,
106 AUDIO_PROFILE_AAC_LTP,
107 AUDIO_PROFILE_AAC_LTP_MULT5,
108 AUDIO_PROFILE_AAC_LTP_MULT7,
109
110 AUDIO_PROFILE_AC3,
111 AUDIO_PROFILE_AC3_EXTENDED,
112
113 AUDIO_PROFILE_AMR,
114 AUDIO_PROFILE_AMR_WB,
115
116 AUDIO_PROFILE_ATRAC,
117
118 AUDIO_PROFILE_G726,
119
120 AUDIO_PROFILE_LPCM,
121
122 /* MPEG audio variants */
123 AUDIO_PROFILE_MP2,
124 AUDIO_PROFILE_MP3,
125 AUDIO_PROFILE_MP3_EXTENDED,
126
127 /* Windows Media Audio variants */
128 AUDIO_PROFILE_WMA_BASELINE,
129 AUDIO_PROFILE_WMA_FULL,
130 AUDIO_PROFILE_WMA_PRO
131 } audio_profile_t;
132
133 audio_profile_t audio_profile_guess (AVCodecContext *ac);
134
135 audio_profile_t audio_profile_guess_aac (AVCodecContext *ac);
136 audio_profile_t audio_profile_guess_ac3 (AVCodecContext *ac);
137 audio_profile_t audio_profile_guess_amr (AVCodecContext *ac);
138 audio_profile_t audio_profile_guess_atrac (AVCodecContext *ac);
139 audio_profile_t audio_profile_guess_g726 (AVCodecContext *ac);
140 audio_profile_t audio_profile_guess_lpcm (AVCodecContext *ac);
141 audio_profile_t audio_profile_guess_mp2 (AVCodecContext *ac);
142 audio_profile_t audio_profile_guess_mp3 (AVCodecContext *ac);
143 audio_profile_t audio_profile_guess_wma (AVCodecContext *ac);
144
145 /* stream context check routines */
146 int stream_ctx_is_image (AVFormatContext *ctx,
147 av_codecs_t *codecs, dlna_container_type_t st);
148 int stream_ctx_is_audio (av_codecs_t *codecs);
149 int stream_ctx_is_av (av_codecs_t *codecs);
150
151 #endif /* _PROFILES_H_ */