Mercurial > mplayer.hg
annotate libaf/reorder_ch.h @ 29684:23c0da51c660
Call set_osd_subtitle also for external subs (i.e. in find_subs).
This does not yet seem to work for audio-only files, subtitles seem
not to be loaded then.
author | reimar |
---|---|
date | Mon, 28 Sep 2009 11:10:11 +0000 |
parents | 869c68891fde |
children | 816c1f02ebfe |
rev | line source |
---|---|
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1 /* |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
2 * common functions for reordering audio channels |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
3 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
4 * Copyright (C) 2007 Ulion <ulion A gmail P com> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
5 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
6 * This file is part of MPlayer. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
7 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
11 * (at your option) any later version. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
12 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
17 * |
26740
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
21 */ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
22 |
26029 | 23 #ifndef MPLAYER_REORDER_CH_H |
24 #define MPLAYER_REORDER_CH_H | |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
25 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
26 // L - Left |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
27 // R - Right |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
28 // C - Center |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
29 // Ls - Left Surround |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
30 // Rs - Right Surround |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
31 // Cs - Center Surround |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
32 // Rls - Rear Left Surround |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
33 // Rrs - Rear Right Surround |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
34 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
35 #define AF_LFE (1<<7) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
36 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
37 #define AF_CHANNEL_LAYOUT_MONO ((100<<8)|1) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
38 #define AF_CHANNEL_LAYOUT_STEREO ((101<<8)|2) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
39 #define AF_CHANNEL_LAYOUT_1_0 AF_CHANNEL_LAYOUT_MONO // C |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
40 #define AF_CHANNEL_LAYOUT_2_0 AF_CHANNEL_LAYOUT_STEREO // L R |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
41 #define AF_CHANNEL_LAYOUT_2_1 ((102<<8)|3) // L R LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
42 #define AF_CHANNEL_LAYOUT_3_0_A ((103<<8)|3) // L R C |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
43 #define AF_CHANNEL_LAYOUT_3_0_B ((104<<8)|3) // C L R |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
44 #define AF_CHANNEL_LAYOUT_4_0_A ((105<<8)|4) // L R C Cs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
45 #define AF_CHANNEL_LAYOUT_4_0_B ((106<<8)|4) // C L R Cs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
46 #define AF_CHANNEL_LAYOUT_4_0_C ((107<<8)|4) // L R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
47 #define AF_CHANNEL_LAYOUT_5_0_A ((108<<8)|5) // L R C Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
48 #define AF_CHANNEL_LAYOUT_5_0_B ((109<<8)|5) // L R Ls Rs C |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
49 #define AF_CHANNEL_LAYOUT_5_0_C ((110<<8)|5) // L C R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
50 #define AF_CHANNEL_LAYOUT_5_0_D ((111<<8)|5) // C L R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
51 #define AF_CHANNEL_LAYOUT_5_1_A ((112<<8)|6|AF_LFE) // L R C LFE Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
52 #define AF_CHANNEL_LAYOUT_5_1_B ((113<<8)|6|AF_LFE) // L R Ls Rs C LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
53 #define AF_CHANNEL_LAYOUT_5_1_C ((114<<8)|6|AF_LFE) // L C R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
54 #define AF_CHANNEL_LAYOUT_5_1_D ((115<<8)|6|AF_LFE) // C L R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
55 #define AF_CHANNEL_LAYOUT_5_1_E ((116<<8)|6|AF_LFE) // LFE L C R Ls Rs |
29491
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
56 #define AF_CHANNEL_LAYOUT_5_1_F ((117<<8)|6|AF_LFE) // C L R LFE Ls Rs |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
57 #define AF_CHANNEL_LAYOUT_6_1_A ((118<<8)|7|AF_LFE) // L R C LFE Ls Rs Cs |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
58 #define AF_CHANNEL_LAYOUT_7_1_A ((119<<8)|8|AF_LFE) // L R C LFE Ls Rs Rls Rrs |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
59 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
60 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
61 #define AF_CHANNEL_LAYOUT_ALSA_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_B |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
62 #define AF_CHANNEL_LAYOUT_ALSA_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_B |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
63 #define AF_CHANNEL_LAYOUT_MPLAYER_5CH_DEFAULT AF_CHANNEL_LAYOUT_ALSA_5CH_DEFAULT |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
64 #define AF_CHANNEL_LAYOUT_MPLAYER_6CH_DEFAULT AF_CHANNEL_LAYOUT_ALSA_6CH_DEFAULT |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
65 #define AF_CHANNEL_LAYOUT_AAC_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_D |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
66 #define AF_CHANNEL_LAYOUT_AAC_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_D |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
67 #define AF_CHANNEL_LAYOUT_WAVEEX_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_A |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
68 #define AF_CHANNEL_LAYOUT_WAVEEX_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_A |
29491
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
69 #define AF_CHANNEL_LAYOUT_LAVC_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_A |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
70 #define AF_CHANNEL_LAYOUT_LAVC_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_A |
26987
d3a0f537dbe8
rename AF_CHANNEL_LAYOUT_LAVC_VORBIS* => AF_CHANNEL_LAYOUT_VORBIS*.
ulion
parents:
26740
diff
changeset
|
71 #define AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_C |
d3a0f537dbe8
rename AF_CHANNEL_LAYOUT_LAVC_VORBIS* => AF_CHANNEL_LAYOUT_VORBIS*.
ulion
parents:
26740
diff
changeset
|
72 #define AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_C |
29491
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
73 #define AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_5CH_DEFAULT AF_CHANNEL_LAYOUT_5_0_D |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
74 #define AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_6CH_DEFAULT AF_CHANNEL_LAYOUT_5_1_F |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
75 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
76 #define AF_CHANNEL_MASK 0xFF |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
77 #define AF_GET_CH_NUM(A) ((A)&0x7F) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
78 #define AF_GET_CH_NUM_WITH_LFE(A) ((A)&0xFF) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
79 #define AF_IS_SAME_CH_NUM(A,B) (((A)&0xFF)==((B)&0xFF)) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
80 #define AF_IS_LAYOUT_SPECIFIED(A) ((A)&0xFFFFF800) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
81 #define AF_IS_LAYOUT_UNSPECIFIED(A) (!AF_IS_LAYOUT_SPECIFIED(A)) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
82 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
83 /// Optimized channel reorder between channel layouts with same channel number. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
84 void reorder_channel_copy(void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
85 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
86 void *dest, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
87 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
88 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
89 int samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
90 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
91 /// Same with reorder_channel_copy, but works on single buffer. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
92 void reorder_channel(void *buf, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
93 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
94 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
95 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
96 int samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
97 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
98 // Channel layout definitions for different audio sources or targets |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
99 // When specified channel number, they will be map to the specific layouts. |
29492 | 100 #define AF_CHANNEL_LAYOUT_ALSA_DEFAULT 0 |
101 #define AF_CHANNEL_LAYOUT_AAC_DEFAULT 1 | |
102 #define AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT 2 | |
29491
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
103 #define AF_CHANNEL_LAYOUT_LAVC_DEFAULT 3 |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
104 #define AF_CHANNEL_LAYOUT_VORBIS_DEFAULT 4 |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
105 #define AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_DEFAULT 5 |
99eda963d27a
Fix incorrect channel ordering for lavc audio codecs (specifically ffac3,
tack
parents:
27700
diff
changeset
|
106 #define AF_CHANNEL_LAYOUT_SOURCE_NUM 6 |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
107 #define AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT AF_CHANNEL_LAYOUT_ALSA_DEFAULT |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
108 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
109 /// Optimized channel reorder between different audio sources and targets. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
110 void reorder_channel_copy_nch(void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
111 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
112 void *dest, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
113 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
114 int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
115 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
116 int samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
117 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
118 /// Same with reorder_channel_copy_nch, but works on single buffer. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
119 void reorder_channel_nch(void *buf, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
120 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
121 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
122 int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
123 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
124 int samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
125 |
26029 | 126 #endif /* MPLAYER_REORDER_CH_H */ |