mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-13 05:25:03 +00:00
Compare commits
1502 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bd3a43dbe | ||
|
|
5fa83394a0 | ||
|
|
51537e8725 | ||
|
|
071386d552 | ||
|
|
ec9a0985ce | ||
|
|
71dffd6eb3 | ||
|
|
560a88b0b9 | ||
|
|
626717cc28 | ||
|
|
8dc1964f8c | ||
|
|
d72e946213 | ||
|
|
24edbff859 | ||
|
|
77da2dc873 | ||
|
|
d9414782b2 | ||
|
|
d1b127164e | ||
|
|
db8d9c67b6 | ||
|
|
c9a3a0c7f2 | ||
|
|
0e4d211eaf | ||
|
|
57daaf3e4d | ||
|
|
bc1e309b13 | ||
|
|
09778b2d14 | ||
|
|
89c00a7e21 | ||
|
|
bb026a7318 | ||
|
|
566d1284f2 | ||
|
|
b5b2a7d70d | ||
|
|
93e407f4a5 | ||
|
|
ad7b141cc6 | ||
|
|
f23beab07e | ||
|
|
c582175d35 | ||
|
|
1b1a572f73 | ||
|
|
7c9ffbbde9 | ||
|
|
5404108cc1 | ||
|
|
5c2d6956fd | ||
|
|
fad623ed6a | ||
|
|
263dd2cb40 | ||
|
|
2d56d067e3 | ||
|
|
759507f196 | ||
|
|
e048c65cdb | ||
|
|
41cd5f00bc | ||
|
|
7ab968c4a6 | ||
|
|
462f63a294 | ||
|
|
f75793c5e4 | ||
|
|
521ee29ab8 | ||
|
|
91690f9453 | ||
|
|
aa0db3c528 | ||
|
|
a727d2df26 | ||
|
|
8f818051b0 | ||
|
|
1fb98118c6 | ||
|
|
967e2bc695 | ||
|
|
0855c0a41d | ||
|
|
bff384e677 | ||
|
|
3b2545cf82 | ||
|
|
762ab7ce36 | ||
|
|
ab31e7b4d4 | ||
|
|
cd17aa3a53 | ||
|
|
d99fda59a3 | ||
|
|
ddbd03760b | ||
|
|
7078f10150 | ||
|
|
6c733e96c9 | ||
|
|
720008f9fb | ||
|
|
ade11eb80f | ||
|
|
d8a6642d5f | ||
|
|
2464064226 | ||
|
|
591d74d0c5 | ||
|
|
14286a0025 | ||
|
|
ddce5829d5 | ||
|
|
ebd9fc4bfe | ||
|
|
6f8d99b39e | ||
|
|
65634a18d1 | ||
|
|
827ace8dca | ||
|
|
baa5b0d14f | ||
|
|
b633491b91 | ||
|
|
9f331b6a92 | ||
|
|
b5de22ff13 | ||
|
|
e4c9a95f7c | ||
|
|
90001b6c23 | ||
|
|
19fec61902 | ||
|
|
acc63cc478 | ||
|
|
7a4bcd3b52 | ||
|
|
4017b59f97 | ||
|
|
407a40e32e | ||
|
|
714700f6b5 | ||
|
|
d60baf1895 | ||
|
|
14418d6fa1 | ||
|
|
2db16f09c7 | ||
|
|
178aa1de9c | ||
|
|
6716704dc3 | ||
|
|
d7d7d62971 | ||
|
|
737c0f4205 | ||
|
|
766145275a | ||
|
|
7517a5448e | ||
|
|
80a0f1a1c1 | ||
|
|
898ce5bf87 | ||
|
|
6f11230a87 | ||
|
|
a63acf4f45 | ||
|
|
a41cd3f0c4 | ||
|
|
9fc0402b0f | ||
|
|
4852987aae | ||
|
|
83632761a4 | ||
|
|
2229a51b66 | ||
|
|
86a826edaf | ||
|
|
b6dc6dd876 | ||
|
|
4ed60073d2 | ||
|
|
7d01c963b8 | ||
|
|
80047e536d | ||
|
|
4bcabff630 | ||
|
|
be4ad97832 | ||
|
|
f2b8b43bae | ||
|
|
00f1ec7906 | ||
|
|
f8aae84bc4 | ||
|
|
2a7df734de | ||
|
|
4308247624 | ||
|
|
5f19a9f89d | ||
|
|
34a21a931d | ||
|
|
2b0c8ba7a0 | ||
|
|
2c30f5eb5b | ||
|
|
dfb7d8472c | ||
|
|
d87b269bae | ||
|
|
c84c7b5fa0 | ||
|
|
03de867572 | ||
|
|
483540488a | ||
|
|
f55876514f | ||
|
|
bf7ec06957 | ||
|
|
874a850087 | ||
|
|
4b0a455147 | ||
|
|
624f1722b6 | ||
|
|
72f12bbff5 | ||
|
|
57ef958250 | ||
|
|
2814599943 | ||
|
|
2942e84a6f | ||
|
|
148a70ccb8 | ||
|
|
5f0c6cb961 | ||
|
|
bb3ae7eb88 | ||
|
|
64d2805c72 | ||
|
|
533599e5d4 | ||
|
|
cec527453a | ||
|
|
2d35bbb4da | ||
|
|
7091101b04 | ||
|
|
848ad08efc | ||
|
|
2620373fb6 | ||
|
|
afc8a3d764 | ||
|
|
6c1ba95f89 | ||
|
|
c5cd400eb8 | ||
|
|
bd2868746d | ||
|
|
cc7692d7eb | ||
|
|
fd01232a26 | ||
|
|
5fa93764b2 | ||
|
|
588ed3c77e | ||
|
|
6e3f669c13 | ||
|
|
23a9c5da4d | ||
|
|
344a3e633a | ||
|
|
0a0881017a | ||
|
|
76e0987c57 | ||
|
|
e0b6ae275d | ||
|
|
c9fe87014e | ||
|
|
2b94b5e316 | ||
|
|
0c4bf2a6b1 | ||
|
|
b9448026d7 | ||
|
|
90745b07ac | ||
|
|
40d97292d2 | ||
|
|
06fdd51104 | ||
|
|
a09a7e4930 | ||
|
|
121ac2bdfe | ||
|
|
e9c088a86b | ||
|
|
d4e03ec759 | ||
|
|
2d767569c9 | ||
|
|
eecec39725 | ||
|
|
99ec42bf35 | ||
|
|
e2f6fce850 | ||
|
|
9f2cd33a82 | ||
|
|
556cc482d8 | ||
|
|
fe9cd61d1d | ||
|
|
08b2bcb88b | ||
|
|
0072e98fad | ||
|
|
0befb3c5b1 | ||
|
|
5e0f9a4898 | ||
|
|
331a64e387 | ||
|
|
f40781a9eb | ||
|
|
490fedf463 | ||
|
|
12466ef9cb | ||
|
|
c75fc7f1eb | ||
|
|
4c78e47404 | ||
|
|
4b80441164 | ||
|
|
e2cc2f9fd7 | ||
|
|
b669733bd8 | ||
|
|
5a769fa22b | ||
|
|
8bbf27526e | ||
|
|
4270450a03 | ||
|
|
802360b008 | ||
|
|
ccd11d38f8 | ||
|
|
996c18fca0 | ||
|
|
19f12038cd | ||
|
|
ebc7c070f3 | ||
|
|
7acb3c3874 | ||
|
|
e3ca2c3fbc | ||
|
|
ac1accce96 | ||
|
|
c39185abab | ||
|
|
6729c9c33f | ||
|
|
4e4a7aa19e | ||
|
|
5d8ce8bfb8 | ||
|
|
92b811b329 | ||
|
|
8c8a357aa7 | ||
|
|
f2770b4609 | ||
|
|
7c21754b74 | ||
|
|
547a9e9fbf | ||
|
|
fd6a223876 | ||
|
|
2fd71f00d6 | ||
|
|
0301a40560 | ||
|
|
05da03a259 | ||
|
|
6e1763332a | ||
|
|
5bbf27de9c | ||
|
|
54f628f7a6 | ||
|
|
4743eb46c1 | ||
|
|
66393a80f2 | ||
|
|
c6c8de7357 | ||
|
|
cbbbb20751 | ||
|
|
604f4d8046 | ||
|
|
579d5e0844 | ||
|
|
5c3e1d06c0 | ||
|
|
d1663de1d7 | ||
|
|
1571040eae | ||
|
|
8221a26c2d | ||
|
|
9996836253 | ||
|
|
7aaa1e3edb | ||
|
|
532ecbd449 | ||
|
|
e66059f621 | ||
|
|
3344040630 | ||
|
|
6afe786cad | ||
|
|
5f4307932a | ||
|
|
4978c3e648 | ||
|
|
f0223a2505 | ||
|
|
727c407435 | ||
|
|
c63a250f2b | ||
|
|
161b98ef43 | ||
|
|
2417b74ea5 | ||
|
|
620ed70246 | ||
|
|
847dc0080a | ||
|
|
d12600e076 | ||
|
|
7d60f558d5 | ||
|
|
5602e420fc | ||
|
|
7a25006fa5 | ||
|
|
5846093a7f | ||
|
|
88bd1d9c16 | ||
|
|
dc4797bb59 | ||
|
|
15b5bddab8 | ||
|
|
2b8444b78f | ||
|
|
f1d276c988 | ||
|
|
b695a8c469 | ||
|
|
0d0cb83ed6 | ||
|
|
943bb576a9 | ||
|
|
08e9c3d596 | ||
|
|
209e6ebb08 | ||
|
|
202e539cca | ||
|
|
edcd2df6bc | ||
|
|
3f679d72cf | ||
|
|
2e09541c84 | ||
|
|
6885f41b61 | ||
|
|
69d33e7483 | ||
|
|
d175082520 | ||
|
|
2ef31d2e08 | ||
|
|
eab439d450 | ||
|
|
27417cda70 | ||
|
|
2959d2a2ae | ||
|
|
289aecc1ed | ||
|
|
01d2ce36d1 | ||
|
|
cbea9ee045 | ||
|
|
ea980a4150 | ||
|
|
2910b10f99 | ||
|
|
d5f14d56f3 | ||
|
|
c3a80b086c | ||
|
|
7616cef9cc | ||
|
|
1f54d88867 | ||
|
|
12c388093f | ||
|
|
190a4203eb | ||
|
|
0fdd608828 | ||
|
|
697132baf9 | ||
|
|
7b55f61396 | ||
|
|
f3faaf06f8 | ||
|
|
6dc941d4e6 | ||
|
|
ce15155956 | ||
|
|
8ab68b94ac | ||
|
|
0753f23078 | ||
|
|
859296885f | ||
|
|
a37961ef9c | ||
|
|
8802c7ccc3 | ||
|
|
941d5544cf | ||
|
|
d453d9327e | ||
|
|
ac00131153 | ||
|
|
796cc6c1bb | ||
|
|
8709e30841 | ||
|
|
8f9f9a48a6 | ||
|
|
cfeb63b855 | ||
|
|
904a3c26df | ||
|
|
764c890892 | ||
|
|
3553b4da51 | ||
|
|
0f6a24a2fb | ||
|
|
3704111fb0 | ||
|
|
f8e378863e | ||
|
|
9526df1b84 | ||
|
|
e9ea1ce659 | ||
|
|
9f4e6c3f06 | ||
|
|
4292ceb062 | ||
|
|
2609124346 | ||
|
|
902da70ee3 | ||
|
|
dd9243d459 | ||
|
|
014181a653 | ||
|
|
92bf709d65 | ||
|
|
842ec2728e | ||
|
|
b8d0751509 | ||
|
|
514909aa05 | ||
|
|
85922dbad7 | ||
|
|
a7b70df915 | ||
|
|
36237ef658 | ||
|
|
743d3209e8 | ||
|
|
814eaab300 | ||
|
|
40d277b666 | ||
|
|
a1411968b8 | ||
|
|
2ba25a5922 | ||
|
|
e54a5982e3 | ||
|
|
203cf029d1 | ||
|
|
dac7e45651 | ||
|
|
0dc07384eb | ||
|
|
e58e166428 | ||
|
|
4ad45db655 | ||
|
|
2683896f41 | ||
|
|
2e13d9f7a4 | ||
|
|
1f90648347 | ||
|
|
6bf2185257 | ||
|
|
6f2becc42e | ||
|
|
cf21a1daee | ||
|
|
79501bceec | ||
|
|
64d300d15e | ||
|
|
eead25896f | ||
|
|
2f4fb88e07 | ||
|
|
2ac200cdb2 | ||
|
|
7f589ecade | ||
|
|
0b4a368d03 | ||
|
|
e8da9bce72 | ||
|
|
e488c43eb7 | ||
|
|
b1cb94ef71 | ||
|
|
56a6658bf1 | ||
|
|
4be8324767 | ||
|
|
09a5593e2f | ||
|
|
c987b72033 | ||
|
|
cbd894a634 | ||
|
|
33273e3954 | ||
|
|
f28698f71a | ||
|
|
56719e7bcd | ||
|
|
febc9727bf | ||
|
|
2ae3b8bca0 | ||
|
|
352283d0b6 | ||
|
|
f0696d396f | ||
|
|
8729ae1210 | ||
|
|
17c0d8125e | ||
|
|
67a3ed3b57 | ||
|
|
342238325e | ||
|
|
080280c268 | ||
|
|
17dd6696df | ||
|
|
d0a4851a67 | ||
|
|
a09ba7c603 | ||
|
|
a734aa2b26 | ||
|
|
1987951014 | ||
|
|
c8f6e8c084 | ||
|
|
4101fe3880 | ||
|
|
9833090318 | ||
|
|
8169d9863b | ||
|
|
ecac87dc6a | ||
|
|
4865649d0f | ||
|
|
fe20494d30 | ||
|
|
b356b1b0d6 | ||
|
|
fc3c841d03 | ||
|
|
3d0d1df324 | ||
|
|
789ae74e0a | ||
|
|
bcccc5d1d5 | ||
|
|
5c7a766658 | ||
|
|
abdf5423f5 | ||
|
|
8775436cdb | ||
|
|
3557ea50c6 | ||
|
|
2c4ae3ea42 | ||
|
|
e5e62fd2d9 | ||
|
|
f3b2b05169 | ||
|
|
b00f8e75f6 | ||
|
|
b604fe74b5 | ||
|
|
3082fb7a15 | ||
|
|
41ff65162b | ||
|
|
f778beaafd | ||
|
|
a018b55038 | ||
|
|
03b600fb67 | ||
|
|
358b8ef579 | ||
|
|
b2c11f5984 | ||
|
|
fc14c61ac1 | ||
|
|
c4073d1813 | ||
|
|
5d19fe127c | ||
|
|
a78f7d2a05 | ||
|
|
78fa5c92bc | ||
|
|
cfa8f5ac31 | ||
|
|
4b239fd2ee | ||
|
|
676539cf8c | ||
|
|
9bd4f5acdb | ||
|
|
438ce2f33a | ||
|
|
cd4dfa5f76 | ||
|
|
0ad7ae6f66 | ||
|
|
625b477c23 | ||
|
|
a75ba7edd4 | ||
|
|
3a24024aaf | ||
|
|
e4769fd0e6 | ||
|
|
cd706068c8 | ||
|
|
05767df99d | ||
|
|
00a2dcfa77 | ||
|
|
a27c8019a6 | ||
|
|
3f27fd7dc1 | ||
|
|
a83467f595 | ||
|
|
45d8c63a45 | ||
|
|
0fd7967e7f | ||
|
|
e2f850192f | ||
|
|
5a6dfd0c18 | ||
|
|
ef8141c8a9 | ||
|
|
ebd2afa43f | ||
|
|
89e98a6797 | ||
|
|
5a4aa337b3 | ||
|
|
7687576e1f | ||
|
|
8ca63e02eb | ||
|
|
b924f7a323 | ||
|
|
606a5a56bc | ||
|
|
3ee6aa61a7 | ||
|
|
af8a79757e | ||
|
|
a047262eb6 | ||
|
|
e920c06dc0 | ||
|
|
c208c2aed2 | ||
|
|
ed8592f5f8 | ||
|
|
8c85870c25 | ||
|
|
f5bb5fba27 | ||
|
|
43acdce578 | ||
|
|
92b899dc2a | ||
|
|
6fa1dc7b30 | ||
|
|
f4c60c3aed | ||
|
|
35ae5599c1 | ||
|
|
057a1d11b1 | ||
|
|
5fe2c8c8a7 | ||
|
|
030635a86b | ||
|
|
af248ffd24 | ||
|
|
6b52cabbac | ||
|
|
fa60e2ad68 | ||
|
|
b2784bd3da | ||
|
|
8bfcb24d15 | ||
|
|
1aaf8b465f | ||
|
|
ffb85d90a3 | ||
|
|
6a4f196940 | ||
|
|
37d9f93eb5 | ||
|
|
39559413f5 | ||
|
|
8c845f5135 | ||
|
|
ef7ad10fdb | ||
|
|
e6ca4274ec | ||
|
|
d97c51139f | ||
|
|
52dfc82054 | ||
|
|
773fb63f92 | ||
|
|
7ce4c4008c | ||
|
|
178db0a085 | ||
|
|
bc833c47dc | ||
|
|
617b4658b4 | ||
|
|
98a79e0e55 | ||
|
|
e21f787125 | ||
|
|
878106386c | ||
|
|
3c870eef7d | ||
|
|
4f3d61a7eb | ||
|
|
470e80a194 | ||
|
|
e44852a7e4 | ||
|
|
92885635ed | ||
|
|
722cecf0d3 | ||
|
|
6a9d7e7da2 | ||
|
|
22ec6b96b2 | ||
|
|
0c8471438a | ||
|
|
3a74381318 | ||
|
|
0fcf9298bb | ||
|
|
c8bd4e22a5 | ||
|
|
a918bc2798 | ||
|
|
9d81498bd9 | ||
|
|
45a37f390b | ||
|
|
a2eced9201 | ||
|
|
36b08c5d74 | ||
|
|
5c0ee9ca53 | ||
|
|
f280feff65 | ||
|
|
f37e944ac4 | ||
|
|
cf281c22ce | ||
|
|
4d8cb4d4d4 | ||
|
|
7426841b5e | ||
|
|
89efdb6178 | ||
|
|
a37a08ef70 | ||
|
|
db80caf74a | ||
|
|
672010711d | ||
|
|
a4cea54db8 | ||
|
|
ddbf8124a8 | ||
|
|
5655db6cd2 | ||
|
|
c764ced536 | ||
|
|
9f4bff884f | ||
|
|
b002d58259 | ||
|
|
bdf3f6d833 | ||
|
|
7f183193d5 | ||
|
|
d3ae186f6b | ||
|
|
18cd92e5a8 | ||
|
|
0e4281d4a2 | ||
|
|
7d19fa971d | ||
|
|
a66c5aae06 | ||
|
|
eea1792f0e | ||
|
|
e6bd773762 | ||
|
|
2cc8ecf20a | ||
|
|
9ca3dc91ee | ||
|
|
98f1e15666 | ||
|
|
c61e787bca | ||
|
|
89eba5e3e8 | ||
|
|
8bc1782589 | ||
|
|
93a55bff8c | ||
|
|
39dec02dc4 | ||
|
|
24dc763c4f | ||
|
|
38f9f65ad8 | ||
|
|
eaed758aa0 | ||
|
|
705766a5ee | ||
|
|
23a99c04e9 | ||
|
|
1a1e9732b9 | ||
|
|
2dfa3778cb | ||
|
|
d99dc4c6f8 | ||
|
|
8507a842be | ||
|
|
4cafcc053e | ||
|
|
30e2c7117c | ||
|
|
8e5b9b2655 | ||
|
|
954724e12a | ||
|
|
97dd511452 | ||
|
|
93b1e64896 | ||
|
|
933dc50c62 | ||
|
|
8b740f4af2 | ||
|
|
13db1dfbfa | ||
|
|
03cd838ff4 | ||
|
|
c8aa7b17a7 | ||
|
|
67fb6235f4 | ||
|
|
7d5f8031ca | ||
|
|
b8eec82f2a | ||
|
|
04be7be06b | ||
|
|
b224b57a43 | ||
|
|
f764e23881 | ||
|
|
8fefe8c1b3 | ||
|
|
dd93e9d672 | ||
|
|
7b69100de9 | ||
|
|
9819dbe0c1 | ||
|
|
6a5bb8bab4 | ||
|
|
48878185de | ||
|
|
9c5d3cdde1 | ||
|
|
6ea677cd7a | ||
|
|
05e451d41e | ||
|
|
ff41c56e82 | ||
|
|
554c1077a0 | ||
|
|
bc40119b72 | ||
|
|
65587815ff | ||
|
|
c3eabcfd96 | ||
|
|
fa563c6542 | ||
|
|
7219f91648 | ||
|
|
8d22988808 | ||
|
|
6f249c92d6 | ||
|
|
204543af9a | ||
|
|
c8345643c6 | ||
|
|
4a61570a50 | ||
|
|
57b060b15d | ||
|
|
c31b3e823f | ||
|
|
5d3aa26cdc | ||
|
|
0b2e12ce0c | ||
|
|
3a6ed7a243 | ||
|
|
2541666333 | ||
|
|
5bcb974b96 | ||
|
|
5c65ccc12b | ||
|
|
61ee4b25fe | ||
|
|
35017de391 | ||
|
|
5efe51720c | ||
|
|
410c39986b | ||
|
|
928f57bd4c | ||
|
|
6b0e57f07d | ||
|
|
111258d2f0 | ||
|
|
db1fab51f4 | ||
|
|
04893f4347 | ||
|
|
e1083a030c | ||
|
|
fa373115ad | ||
|
|
4b8f14eab1 | ||
|
|
653795ceef | ||
|
|
115a6103d4 | ||
|
|
a238352fb3 | ||
|
|
1322f89fcd | ||
|
|
c1ec393bed | ||
|
|
243cd64d56 | ||
|
|
e06be2d2f1 | ||
|
|
8cfbf87420 | ||
|
|
ff3be07df5 | ||
|
|
a0787e740e | ||
|
|
e5b21a3a91 | ||
|
|
f694c95510 | ||
|
|
b5731a279a | ||
|
|
6bb86efa97 | ||
|
|
c54027562f | ||
|
|
a2163adc95 | ||
|
|
73c35ccb30 | ||
|
|
bcfdda5f8d | ||
|
|
1dd5e3089c | ||
|
|
74c1d6d30d | ||
|
|
0579d7d8d7 | ||
|
|
1d31c784e7 | ||
|
|
0de521f22b | ||
|
|
c027b449cf | ||
|
|
b385fa74b0 | ||
|
|
0427878dbd | ||
|
|
93797023e3 | ||
|
|
02cd11ec7c | ||
|
|
edc3d85cd5 | ||
|
|
0e9d0e6e46 | ||
|
|
07e9d8a04e | ||
|
|
524ec68a63 | ||
|
|
046fd4c435 | ||
|
|
2fb03f3af3 | ||
|
|
cd4267bc2e | ||
|
|
48c4306cdc | ||
|
|
63fd4ad847 | ||
|
|
2cf86d46ff | ||
|
|
3c3f7afb32 | ||
|
|
a046be0ebb | ||
|
|
dc2af919eb | ||
|
|
23b7470daf | ||
|
|
78585c84b4 | ||
|
|
02b93fa73f | ||
|
|
3c6aff704c | ||
|
|
beeb797b6e | ||
|
|
d275463039 | ||
|
|
51dae0ba8d | ||
|
|
850f5f98b6 | ||
|
|
0424a474bc | ||
|
|
37496f8a1a | ||
|
|
02593c9867 | ||
|
|
79ab53876c | ||
|
|
a917695029 | ||
|
|
b2bfebce6f | ||
|
|
5b5f358919 | ||
|
|
92df11162c | ||
|
|
6feef59d75 | ||
|
|
944c6d25a2 | ||
|
|
9e94520a54 | ||
|
|
d249b1cf1b | ||
|
|
5661e4f37b | ||
|
|
e8ae2874d6 | ||
|
|
f3c386f729 | ||
|
|
03b8f93e04 | ||
|
|
2a583883dc | ||
|
|
1cee9200b2 | ||
|
|
c634cf5ada | ||
|
|
804c6414ee | ||
|
|
0cc9642851 | ||
|
|
286398c15d | ||
|
|
d0b57ecb1f | ||
|
|
5b11c6a5c6 | ||
|
|
90c8da76bd | ||
|
|
e87ed5ba1c | ||
|
|
1aa9a7c4d9 | ||
|
|
509cb9839d | ||
|
|
0089901b07 | ||
|
|
877ee7b2c7 | ||
|
|
d117dacf0f | ||
|
|
1ea58bd200 | ||
|
|
dcc8af915f | ||
|
|
4d4af9ff7f | ||
|
|
a9a861e8f2 | ||
|
|
ab70c8b382 | ||
|
|
d8e99ef810 | ||
|
|
c92e92f73d | ||
|
|
d3862ba88b | ||
|
|
0023c6545b | ||
|
|
2ca835ea1b | ||
|
|
20859d3ee7 | ||
|
|
e79700ea93 | ||
|
|
e02d9bd98b | ||
|
|
d7136a8390 | ||
|
|
e1d8da9d37 | ||
|
|
cfecd67500 | ||
|
|
26623b2428 | ||
|
|
44d9117d8d | ||
|
|
31de878ea7 | ||
|
|
9768555e7c | ||
|
|
72e422d76e | ||
|
|
8860be13e4 | ||
|
|
3b7ad97f0a | ||
|
|
5e305f2769 | ||
|
|
0a798606ee | ||
|
|
3775daf36c | ||
|
|
8c5de01034 | ||
|
|
1c352e67e4 | ||
|
|
79838077f2 | ||
|
|
058bb83a25 | ||
|
|
d2f840bb36 | ||
|
|
a576c90f4e | ||
|
|
a1bd01de5f | ||
|
|
9a5e817f36 | ||
|
|
bc20bc3f45 | ||
|
|
783a6e2aa0 | ||
|
|
992c56b262 | ||
|
|
c674cef79e | ||
|
|
509ed756fd | ||
|
|
152b69ddba | ||
|
|
c2eedab33d | ||
|
|
677fee4145 | ||
|
|
72dad743dc | ||
|
|
e262b0699a | ||
|
|
6942089a32 | ||
|
|
993adc3dec | ||
|
|
fe7a39c0cb | ||
|
|
3bd704e495 | ||
|
|
6992e54f8e | ||
|
|
4d5ab77fed | ||
|
|
1b2328d728 | ||
|
|
2944e12541 | ||
|
|
763972ca4b | ||
|
|
01fe0c1fc9 | ||
|
|
8d160a70ff | ||
|
|
fc90b9c9f5 | ||
|
|
0a803df23f | ||
|
|
d3a1ed4b06 | ||
|
|
ad89e0074b | ||
|
|
169a39eb3e | ||
|
|
a6145af7f3 | ||
|
|
03b60ef140 | ||
|
|
1b7ef1e198 | ||
|
|
72de68a575 | ||
|
|
24e7b94599 | ||
|
|
c5dc4531ae | ||
|
|
a3e07b4a63 | ||
|
|
d48555b849 | ||
|
|
a1f05caddf | ||
|
|
669eb36603 | ||
|
|
ce379bcfda | ||
|
|
00657ffdcd | ||
|
|
d9e0ba027f | ||
|
|
a7279e3d8a | ||
|
|
61ae7e9f10 | ||
|
|
548d323ca1 | ||
|
|
d2d7a17f3b | ||
|
|
65b0ed0038 | ||
|
|
2b0523d34c | ||
|
|
5bef6bd5a4 | ||
|
|
5ca3965c7b | ||
|
|
e855665c87 | ||
|
|
e9bf8dad9f | ||
|
|
54c2b21a4c | ||
|
|
afe5cba480 | ||
|
|
8c34f4cbb2 | ||
|
|
e422e7075a | ||
|
|
cc0ee507dd | ||
|
|
540850f0b9 | ||
|
|
a973c0a9c3 | ||
|
|
ae27b3411b | ||
|
|
89c4ac091a | ||
|
|
843ca9b60a | ||
|
|
d135362d40 | ||
|
|
2f1b9df6e9 | ||
|
|
7190af4e79 | ||
|
|
2898584ee3 | ||
|
|
5ef2519bf5 | ||
|
|
f258d317cc | ||
|
|
4d3fcd6779 | ||
|
|
f1b0aff789 | ||
|
|
6e9a30b354 | ||
|
|
37091708b7 | ||
|
|
0885aae79c | ||
|
|
5e5d30d154 | ||
|
|
a614db1e20 | ||
|
|
f7f29e558b | ||
|
|
ddc1bfe74f | ||
|
|
18b95d9564 | ||
|
|
b012f87d87 | ||
|
|
73f277fe95 | ||
|
|
bd3df850a5 | ||
|
|
73b52462c0 | ||
|
|
267d7b4a2e | ||
|
|
35cdeda56c | ||
|
|
0f90eebdf6 | ||
|
|
962357ed0f | ||
|
|
69d077df9e | ||
|
|
e2b0534374 | ||
|
|
4204b7878d | ||
|
|
1e2237f7ec | ||
|
|
6bfe3b3f86 | ||
|
|
940bee33a4 | ||
|
|
7c787157d8 | ||
|
|
7514886199 | ||
|
|
ad5b917f3b | ||
|
|
66408fc950 | ||
|
|
94ec02eea9 | ||
|
|
5e33e2e2ac | ||
|
|
34613037fc | ||
|
|
f2b24f13af | ||
|
|
c718d21d0f | ||
|
|
a2828f0060 | ||
|
|
4b3b846a2c | ||
|
|
b232945c71 | ||
|
|
f91d1cb9b7 | ||
|
|
fadd8aad8b | ||
|
|
b0479b247a | ||
|
|
a659544bd2 | ||
|
|
9ce4c99180 | ||
|
|
52f51147b8 | ||
|
|
34836b50a1 | ||
|
|
7179796365 | ||
|
|
966c90eece | ||
|
|
3281bf929a | ||
|
|
906a0704bc | ||
|
|
20785c095c | ||
|
|
dee2280d06 | ||
|
|
f6b69b64c3 | ||
|
|
2f09b37f7c | ||
|
|
20cf0f5151 | ||
|
|
860e926b5a | ||
|
|
9f81a4b5c1 | ||
|
|
5d85220121 | ||
|
|
6423efa2d7 | ||
|
|
932cb77265 | ||
|
|
691244a00e | ||
|
|
440c59a5fd | ||
|
|
8a3e2b5efc | ||
|
|
119a4361df | ||
|
|
6c93b6dcf4 | ||
|
|
4d76cd30c0 | ||
|
|
96fd051e01 | ||
|
|
2fe0da30be | ||
|
|
890e045a88 | ||
|
|
b333df4317 | ||
|
|
33d91a979c | ||
|
|
b3614f592f | ||
|
|
3bdb5f3863 | ||
|
|
ad6346f802 | ||
|
|
66f41438be | ||
|
|
647a91eafa | ||
|
|
ecf200e290 | ||
|
|
da576bff2b | ||
|
|
fcbf113526 | ||
|
|
b90d144ff6 | ||
|
|
2ac0ed2032 | ||
|
|
0afefc0392 | ||
|
|
9efe2b4b22 | ||
|
|
d54d881390 | ||
|
|
58b496a434 | ||
|
|
41a8803860 | ||
|
|
4146423878 | ||
|
|
1c35dcae03 | ||
|
|
3bcdbce709 | ||
|
|
250ee1f29b | ||
|
|
fd1a86b2f5 | ||
|
|
3433ed2e5c | ||
|
|
c7606beae1 | ||
|
|
d639323e4c | ||
|
|
72e780f175 | ||
|
|
651dc67a5d | ||
|
|
6cfd7710a7 | ||
|
|
adc1d4662d | ||
|
|
5c51b582bf | ||
|
|
16e794163c | ||
|
|
4e25d80b48 | ||
|
|
2949918ed1 | ||
|
|
46ea522ecb | ||
|
|
f571a04ffc | ||
|
|
610b811d53 | ||
|
|
e5c4053c05 | ||
|
|
0b9bf16850 | ||
|
|
8489edf966 | ||
|
|
22127cccb0 | ||
|
|
57eb42c7bb | ||
|
|
0a6630f7ab | ||
|
|
b89dd8d401 | ||
|
|
778e66f951 | ||
|
|
7a06d99443 | ||
|
|
3fff94a555 | ||
|
|
b65cc8ad8e | ||
|
|
28ddfef2b1 | ||
|
|
f23cc1f41e | ||
|
|
1ca63ba125 | ||
|
|
af66ace345 | ||
|
|
c0079aee6f | ||
|
|
21a88f9cc1 | ||
|
|
9923ef98ee | ||
|
|
abce1dd873 | ||
|
|
308d500308 | ||
|
|
ae6cf97bce | ||
|
|
53bedd30c1 | ||
|
|
764d251986 | ||
|
|
1bfb96151f | ||
|
|
741e87e00e | ||
|
|
098bff1230 | ||
|
|
0374c5ec78 | ||
|
|
e7bec67c93 | ||
|
|
b9e0f67dec | ||
|
|
acd96d44d2 | ||
|
|
4e4da44c39 | ||
|
|
bb0f836e84 | ||
|
|
5f6a8c7f54 | ||
|
|
0c6bf5d8b1 | ||
|
|
f8210f94f2 | ||
|
|
243674ed96 | ||
|
|
322d352ca0 | ||
|
|
c8c71085e1 | ||
|
|
4969e6a8fd | ||
|
|
ece4a5fa8a | ||
|
|
7d034f44e4 | ||
|
|
c12d3856f2 | ||
|
|
24f9106cde | ||
|
|
58503141c3 | ||
|
|
3b214f491b | ||
|
|
f83ca18c7d | ||
|
|
1261cee8dc | ||
|
|
92ecaa9434 | ||
|
|
fd66228b26 | ||
|
|
bfd7556b50 | ||
|
|
3174e3dc9e | ||
|
|
ec26080bd2 | ||
|
|
5ea83ccf9d | ||
|
|
5af65d941a | ||
|
|
0d79ad3cb6 | ||
|
|
8499a6b426 | ||
|
|
577a79de47 | ||
|
|
6133b9c26d | ||
|
|
c4e91f8ccc | ||
|
|
589fd91d8e | ||
|
|
03eba6114b | ||
|
|
56f0786cc3 | ||
|
|
aff591fd9b | ||
|
|
bdaa3a1352 | ||
|
|
f3b104584d | ||
|
|
e47315e423 | ||
|
|
43335e30a9 | ||
|
|
79c4a48d60 | ||
|
|
a5538902ec | ||
|
|
1b9d905b28 | ||
|
|
89c8b018c8 | ||
|
|
cde69fdd88 | ||
|
|
a798fdf57e | ||
|
|
8b89ad0c5a | ||
|
|
309f4130e0 | ||
|
|
0f2ccdbe4f | ||
|
|
eeb33de590 | ||
|
|
91a8997826 | ||
|
|
5fb7bc434c | ||
|
|
77540355ed | ||
|
|
c5362b682e | ||
|
|
e0f3751fe8 | ||
|
|
54583f95a3 | ||
|
|
990e653e91 | ||
|
|
9d2fb48d3d | ||
|
|
e5e51c4389 | ||
|
|
74dbd4d7e5 | ||
|
|
784a46d165 | ||
|
|
83e1959db8 | ||
|
|
e0bf79f28b | ||
|
|
5c1f4772c7 | ||
|
|
deca14c2c2 | ||
|
|
8023ebe8e2 | ||
|
|
0e98604267 | ||
|
|
7e68c8e823 | ||
|
|
601dbfd062 | ||
|
|
35983534f1 | ||
|
|
f88330c7c9 | ||
|
|
a0bf7dadf8 | ||
|
|
f2added8d1 | ||
|
|
9f78a843ee | ||
|
|
3e78fdd675 | ||
|
|
c5dfd52eb9 | ||
|
|
08df39c3d4 | ||
|
|
9fad88fee3 | ||
|
|
6ae94fdbab | ||
|
|
8d5f0e5505 | ||
|
|
11b614cedf | ||
|
|
fc79649c9c | ||
|
|
b85e93a2cb | ||
|
|
dd8923b2e4 | ||
|
|
1437aea328 | ||
|
|
1fdad2314f | ||
|
|
6aac9dad43 | ||
|
|
fc248dd41f | ||
|
|
a2394df838 | ||
|
|
306d60ccf9 | ||
|
|
d78a722260 | ||
|
|
4a34799e09 | ||
|
|
489622fb0b | ||
|
|
9689dd8c19 | ||
|
|
d29f6817c6 | ||
|
|
f9ea7009fe | ||
|
|
ddd8381440 | ||
|
|
964b8c1165 | ||
|
|
0541a2fb62 | ||
|
|
f3654174fc | ||
|
|
0fc1055da6 | ||
|
|
a654b133e5 | ||
|
|
3a886c6a5b | ||
|
|
4a8d51aed1 | ||
|
|
70f5723c89 | ||
|
|
b85702a706 | ||
|
|
0bf1e83fa1 | ||
|
|
67d62631aa | ||
|
|
43f276abca | ||
|
|
7cea808f46 | ||
|
|
adbe8ed934 | ||
|
|
a3eba7cf45 | ||
|
|
3f26290614 | ||
|
|
d63660468a | ||
|
|
3daecf66a3 | ||
|
|
16db90a630 | ||
|
|
c1d7f82819 | ||
|
|
f8ee9504a8 | ||
|
|
c75d056b76 | ||
|
|
6c38f1b73b | ||
|
|
00b61a291d | ||
|
|
fcdc5f852b | ||
|
|
0424b0f119 | ||
|
|
82559fd572 | ||
|
|
3837ffae59 | ||
|
|
2e4cda0383 | ||
|
|
dc6ef18c21 | ||
|
|
bf3790183a | ||
|
|
bfa8b593ab | ||
|
|
401d679f80 | ||
|
|
157faaf0b5 | ||
|
|
cb49812d17 | ||
|
|
d88fa2a3ce | ||
|
|
5716ab7cfc | ||
|
|
04b9e40cc5 | ||
|
|
2f92036557 | ||
|
|
6aaa4fe2d4 | ||
|
|
ab0f54bb57 | ||
|
|
6642084132 | ||
|
|
c5ca7c7e1a | ||
|
|
5b24334b43 | ||
|
|
df93801021 | ||
|
|
64285879db | ||
|
|
0523f0bcd5 | ||
|
|
c6721ebc3e | ||
|
|
9d22f9a466 | ||
|
|
d58fb00970 | ||
|
|
62e189a9cb | ||
|
|
dc17946a55 | ||
|
|
78d8d858d2 | ||
|
|
30e7f95f38 | ||
|
|
8026d2e671 | ||
|
|
c98e00201a | ||
|
|
9b0ba130f1 | ||
|
|
83aa9709f4 | ||
|
|
340549e916 | ||
|
|
6d41964bba | ||
|
|
71f030f4ee | ||
|
|
67653d06d3 | ||
|
|
ab9f3a4b4a | ||
|
|
d9e9305e2c | ||
|
|
2bcc0c5561 | ||
|
|
cd03d8a658 | ||
|
|
589074886b | ||
|
|
c6ca493752 | ||
|
|
aef649d23a | ||
|
|
610b7323f4 | ||
|
|
eb6f6a9000 | ||
|
|
f3fe829d48 | ||
|
|
cb39d12615 | ||
|
|
5d52026736 | ||
|
|
48dce9c7ce | ||
|
|
2032a754e6 | ||
|
|
aa353140ef | ||
|
|
ee47e8458f | ||
|
|
081f127c85 | ||
|
|
7169c71360 | ||
|
|
5c3a757e5b | ||
|
|
673cadc6bf | ||
|
|
2318e714db | ||
|
|
a6d27a2de5 | ||
|
|
dc842b0312 | ||
|
|
3879f5c7ef | ||
|
|
e01d93afa8 | ||
|
|
6ec8086b0a | ||
|
|
b80572c3b6 | ||
|
|
3f6fd51f45 | ||
|
|
87af82f022 | ||
|
|
020ca9a1cf | ||
|
|
beccc3d5b7 | ||
|
|
1d03bd7d13 | ||
|
|
13290294a6 | ||
|
|
1eef500c73 | ||
|
|
ca5135c8aa | ||
|
|
740a1d798e | ||
|
|
b68a086698 | ||
|
|
0e60ceb4d0 | ||
|
|
2030c16b22 | ||
|
|
79b1bca8f7 | ||
|
|
76b3d3e4d1 | ||
|
|
90d8731a03 | ||
|
|
85270c7047 | ||
|
|
c9e596e60a | ||
|
|
24d83e130a | ||
|
|
4fc19d4289 | ||
|
|
74ad11b44f | ||
|
|
051a6f1f67 | ||
|
|
3f7eb981e6 | ||
|
|
8ca152262e | ||
|
|
f17501f0e5 | ||
|
|
6cc8d7de05 | ||
|
|
d4f6db8479 | ||
|
|
7b22a8d966 | ||
|
|
c5cebeaa4f | ||
|
|
f1cf6c7be8 | ||
|
|
80303ddde5 | ||
|
|
89ee62ea14 | ||
|
|
a1959d20f3 | ||
|
|
810cb73203 | ||
|
|
38b9ed7fcd | ||
|
|
35b8f2375f | ||
|
|
aa619b5f93 | ||
|
|
c03d3032aa | ||
|
|
191cdd2bdc | ||
|
|
9d5c8759e5 | ||
|
|
a4b5c6e028 | ||
|
|
113b606091 | ||
|
|
a69e031835 | ||
|
|
ba38055bed | ||
|
|
3c086e8ff0 | ||
|
|
f9c26d8684 | ||
|
|
2ed9789f9c | ||
|
|
282108942b | ||
|
|
6c107a0d4e | ||
|
|
6e4ab6faae | ||
|
|
e8016edfc1 | ||
|
|
30839f7c2c | ||
|
|
89459a6c2e | ||
|
|
c49db8c083 | ||
|
|
fa6588fa80 | ||
|
|
7d74256664 | ||
|
|
2210660ae4 | ||
|
|
f2fc93b7f8 | ||
|
|
d54a2d9486 | ||
|
|
88015d6d4b | ||
|
|
f1ff75b846 | ||
|
|
1123755dc7 | ||
|
|
6a4f379ab7 | ||
|
|
9369cde9a3 | ||
|
|
a1d985b4ca | ||
|
|
b26854d3d7 | ||
|
|
cbb4b4c7bb | ||
|
|
1a1aa746d5 | ||
|
|
b4f5b5b98e | ||
|
|
fa3b651ee1 | ||
|
|
91d079be1e | ||
|
|
d16ea0a7ea | ||
|
|
6133bf6297 | ||
|
|
14e1420b7e | ||
|
|
10568a0270 | ||
|
|
53da058fe1 | ||
|
|
4d199fb03b | ||
|
|
f04cbbd99c | ||
|
|
e572ba8b6e | ||
|
|
45974e88be | ||
|
|
8140bf3e52 | ||
|
|
4570965af2 | ||
|
|
fcd250a557 | ||
|
|
b92e42e685 | ||
|
|
5daccf4268 | ||
|
|
e0903a0789 | ||
|
|
bcf1546fc2 | ||
|
|
92f53be666 | ||
|
|
8ae0bd7f16 | ||
|
|
754159e2bc | ||
|
|
3f817d655c | ||
|
|
572837d7ba | ||
|
|
fb8dcf4025 | ||
|
|
c7b77b5555 | ||
|
|
fe1ac8564a | ||
|
|
9230390937 | ||
|
|
14f926124d | ||
|
|
76e8489304 | ||
|
|
0e0b1973f0 | ||
|
|
a6666a4fbd | ||
|
|
3a66db200d | ||
|
|
4f3e5fe677 | ||
|
|
ad99ccdfec | ||
|
|
1bc174efa2 | ||
|
|
983db8c92d | ||
|
|
b4ce115f7c | ||
|
|
cb7f31ef8c | ||
|
|
1a5d78b1b4 | ||
|
|
c873ff6a06 | ||
|
|
454024808d | ||
|
|
0a22e1e429 | ||
|
|
3fb288357d | ||
|
|
966d88fc10 | ||
|
|
c91aa79852 | ||
|
|
04ccb477f1 | ||
|
|
10ea570229 | ||
|
|
551c3d0e2f | ||
|
|
49530b079b | ||
|
|
02986fe7a8 | ||
|
|
a230ec5f6f | ||
|
|
7902b85d1b | ||
|
|
77d275d6a5 | ||
|
|
4c2a4a59a2 | ||
|
|
d80455a408 | ||
|
|
27e2bb9017 | ||
|
|
9358978a61 | ||
|
|
cffd02c106 | ||
|
|
b45370cbb4 | ||
|
|
56e15a3be0 | ||
|
|
7b4d93988f | ||
|
|
0e803eba95 | ||
|
|
8c9bfa17dd | ||
|
|
413173f5e5 | ||
|
|
1a050c76a5 | ||
|
|
c3d00d80f5 | ||
|
|
c989c941df | ||
|
|
dc9f6d250a | ||
|
|
9f00cec9c0 | ||
|
|
b7d2754518 | ||
|
|
94675b2dac | ||
|
|
2c9faa70ea | ||
|
|
b7616fcb17 | ||
|
|
eb93345544 | ||
|
|
e6024c1cb1 | ||
|
|
ecc4c2520e | ||
|
|
a83c686f6a | ||
|
|
c4a8135b4d | ||
|
|
004f9d512a | ||
|
|
53df68b4c3 | ||
|
|
74bb91aa5b | ||
|
|
453bb56520 | ||
|
|
db50730a00 | ||
|
|
36a266e43c | ||
|
|
354c52ec61 | ||
|
|
2b65419bfb | ||
|
|
740365db7e | ||
|
|
03dc0498ea | ||
|
|
e9a7474f3d | ||
|
|
1ecb2abd62 | ||
|
|
d3b4b8ff03 | ||
|
|
29aa63c23c | ||
|
|
7083a36ecb | ||
|
|
38421e886e | ||
|
|
b0de53c351 | ||
|
|
09dcb8b7c0 | ||
|
|
13ab9e6a4e | ||
|
|
08ae34bc24 | ||
|
|
f5f1a70eb8 | ||
|
|
471c130928 | ||
|
|
4db37e7ac3 | ||
|
|
3953f806b0 | ||
|
|
cf0ebd27f7 | ||
|
|
559d05c478 | ||
|
|
4d7e629ba5 | ||
|
|
866c4ea159 | ||
|
|
cf508653f2 | ||
|
|
b3b683aa83 | ||
|
|
9f6309ef14 | ||
|
|
b95e06c21c | ||
|
|
7ed99097ba | ||
|
|
3f4bbbde25 | ||
|
|
5828f50210 | ||
|
|
b5931e8749 | ||
|
|
c588b42e0a | ||
|
|
f9ee9570a4 | ||
|
|
55e408bbb7 | ||
|
|
93a5ae9728 | ||
|
|
5c7430cff5 | ||
|
|
fecf14bc15 | ||
|
|
a4275eba62 | ||
|
|
3873e8fd30 | ||
|
|
5e22be2576 | ||
|
|
0b568cb168 | ||
|
|
017d539710 | ||
|
|
06c8f69056 | ||
|
|
b06654b760 | ||
|
|
4ff49c2010 | ||
|
|
0c650711cf | ||
|
|
3128f10fb5 | ||
|
|
63b209929e | ||
|
|
5f68a9166f | ||
|
|
15616edea8 | ||
|
|
cce4ec5e1a | ||
|
|
72ecd279cf | ||
|
|
87f1a3845c | ||
|
|
4ae5f3483c | ||
|
|
38876690f8 | ||
|
|
7bb4e842dd | ||
|
|
26d9584a93 | ||
|
|
9d5ce9aaae | ||
|
|
47264425df | ||
|
|
e8f8d04369 | ||
|
|
78cb26c9cb | ||
|
|
2f5d45df01 | ||
|
|
53be44dfdb | ||
|
|
48b5a0b384 | ||
|
|
a08c7b1871 | ||
|
|
0a2a00f883 | ||
|
|
2125e58e1f | ||
|
|
5bdd6971f7 | ||
|
|
051bc7138d | ||
|
|
e6dca329ee | ||
|
|
6cfddb12a6 | ||
|
|
c9c063b8d8 | ||
|
|
e0cd8b2e56 | ||
|
|
38d2088db5 | ||
|
|
8e940b050a | ||
|
|
5733b40ca6 | ||
|
|
22c40675a6 | ||
|
|
a3ef46c21d | ||
|
|
93a546bab4 | ||
|
|
ec427fd82c | ||
|
|
70cc3c2046 | ||
|
|
5634960813 | ||
|
|
c7a49e80e3 | ||
|
|
617d2d30dc | ||
|
|
18f781d099 | ||
|
|
84db812769 | ||
|
|
7763f8aeab | ||
|
|
faa879801e | ||
|
|
4635329a5b | ||
|
|
b89cc3b6df | ||
|
|
e9f8313f7c | ||
|
|
324cd84ffe | ||
|
|
9d7518c9ec | ||
|
|
32e0d6023d | ||
|
|
c9465e476b | ||
|
|
45d237da40 | ||
|
|
631ae2e02f | ||
|
|
695aa14cd7 | ||
|
|
b638bb1d3a | ||
|
|
28950bf90e | ||
|
|
77f8289ca6 | ||
|
|
cece92a828 | ||
|
|
bd08454d66 | ||
|
|
c6e5dd5cf7 | ||
|
|
bd8e3ad137 | ||
|
|
8a2e71fcfb | ||
|
|
301c2a7138 | ||
|
|
5368d7292f | ||
|
|
29689b10aa | ||
|
|
4d8883d0f1 | ||
|
|
efe6fceb3a | ||
|
|
d9a998b95f | ||
|
|
bf94c2997d | ||
|
|
6405a3973d | ||
|
|
9270e22a65 | ||
|
|
02e19cf617 | ||
|
|
1493b6c4f5 | ||
|
|
74ab732999 | ||
|
|
5961d1b56e | ||
|
|
87d6a6bf91 | ||
|
|
456d23f547 | ||
|
|
02da93d0e4 | ||
|
|
597304e932 | ||
|
|
918889c890 | ||
|
|
47bfe6bffc | ||
|
|
5789a0a224 | ||
|
|
b15f54c7f9 | ||
|
|
bc3794eb14 | ||
|
|
4e66d290a6 | ||
|
|
7b48b01fd1 | ||
|
|
883dfaae4a | ||
|
|
884a25a7cd | ||
|
|
8cc8767634 | ||
|
|
90a6902ad4 | ||
|
|
b334acb426 | ||
|
|
9c847aa4f1 | ||
|
|
c3397d1949 | ||
|
|
41ad0b4006 | ||
|
|
7fa59a14f7 | ||
|
|
170a57b9c6 | ||
|
|
0a15c2d16e | ||
|
|
c52283676a | ||
|
|
ce3c2b5ae2 | ||
|
|
48e030d94c | ||
|
|
afaa7c8b76 | ||
|
|
4e6c0352b0 | ||
|
|
f84b69aca7 | ||
|
|
cc7ebbc4d7 | ||
|
|
7a74b815fa | ||
|
|
331038634d | ||
|
|
aa2c316093 | ||
|
|
3347f5d345 | ||
|
|
141792a299 | ||
|
|
183e613981 | ||
|
|
19e2912a71 | ||
|
|
dc82154a03 | ||
|
|
2029dab3bf | ||
|
|
405d808d0b | ||
|
|
783e889634 | ||
|
|
a32c8a3b7f | ||
|
|
5618df35c6 | ||
|
|
c054594383 | ||
|
|
c58f99378f | ||
|
|
45d1dfe425 | ||
|
|
a5dcf9242d | ||
|
|
ecc0714f48 | ||
|
|
26410b991d | ||
|
|
19b1bff7f4 | ||
|
|
bc1aff78d7 | ||
|
|
2df8931d00 | ||
|
|
b765198d53 | ||
|
|
22f620400a | ||
|
|
a68add78d0 | ||
|
|
14d866e8a2 | ||
|
|
335bca4507 | ||
|
|
f31425e9f0 | ||
|
|
3f54fab5f4 | ||
|
|
59c62d48b3 | ||
|
|
a926766478 | ||
|
|
cc233c61f2 | ||
|
|
e9fcdf392f | ||
|
|
c42f039297 | ||
|
|
8cbaf09b4f | ||
|
|
ee8d5dff66 | ||
|
|
ec0873f5a2 | ||
|
|
29515bfcd5 | ||
|
|
c85ebb0c1e | ||
|
|
d6e66d5c7f | ||
|
|
f65f2b229a | ||
|
|
5094351469 | ||
|
|
5d6a770ce8 | ||
|
|
010d7f9ce4 | ||
|
|
fb49e680a6 | ||
|
|
6b98856892 | ||
|
|
1a479a7199 | ||
|
|
2894bcd7ff | ||
|
|
1ae8040bd7 | ||
|
|
57a80084ce | ||
|
|
e35b4ea62c | ||
|
|
3546526177 | ||
|
|
12efb6166a | ||
|
|
9beee068ce | ||
|
|
9efcba5c02 | ||
|
|
947333ea64 | ||
|
|
7e527fc62a | ||
|
|
9f78c595b3 | ||
|
|
fa03442c85 | ||
|
|
e664c035a1 | ||
|
|
c522e3b054 | ||
|
|
b3c037ab21 | ||
|
|
097fdb643b | ||
|
|
43094a9897 | ||
|
|
aefa623cd4 | ||
|
|
1be11738eb | ||
|
|
5a09c116f6 | ||
|
|
bb700db08e | ||
|
|
2e8582b14c | ||
|
|
8d47dc2f82 | ||
|
|
6a3c736195 | ||
|
|
9463999325 | ||
|
|
e50c30eaaa | ||
|
|
45a3e21897 | ||
|
|
47dbcdff9c | ||
|
|
dc164f81e5 | ||
|
|
bab0ec8b60 | ||
|
|
f543e3f4e2 | ||
|
|
43d4b9abaa | ||
|
|
f5bbb6aef5 | ||
|
|
25b666c2ae | ||
|
|
78087073ac | ||
|
|
12c2ced497 | ||
|
|
87954419ba | ||
|
|
0add0bc2e9 | ||
|
|
7858afb837 | ||
|
|
69c0b2e223 | ||
|
|
855ca48220 | ||
|
|
02bee86397 | ||
|
|
315d466da8 | ||
|
|
d4597e0094 | ||
|
|
b8ff3414c0 | ||
|
|
2206cc1f78 | ||
|
|
00433467be | ||
|
|
1000e33e7f | ||
|
|
a64245fb5b | ||
|
|
2f784f00ff | ||
|
|
136012c558 | ||
|
|
874abf6442 | ||
|
|
20975957ee | ||
|
|
1fabae2870 | ||
|
|
abb3523ee3 | ||
|
|
ec63a06e25 | ||
|
|
8b4353f08c | ||
|
|
8bfb3b87c3 | ||
|
|
f1a493b999 | ||
|
|
3afcfa79e1 | ||
|
|
adaa436f6b | ||
|
|
37135762c5 | ||
|
|
e6aa7128df | ||
|
|
da8d4a290c | ||
|
|
4d11a727d9 | ||
|
|
3c232bfca0 | ||
|
|
b3fe96477a | ||
|
|
5f87544a0d | ||
|
|
f0c0ca4566 | ||
|
|
23719526cd | ||
|
|
67ffe22460 | ||
|
|
08996a3253 | ||
|
|
95e2f7665b | ||
|
|
a5ef2d1574 | ||
|
|
cc0a786004 | ||
|
|
4d6693d948 | ||
|
|
9c0792c5a0 | ||
|
|
0f06f47ab4 | ||
|
|
5371f854fc | ||
|
|
bd49f0f959 | ||
|
|
63d3071233 | ||
|
|
015a50bafd | ||
|
|
1ee4b9bd01 |
38
.gitignore
vendored
38
.gitignore
vendored
@@ -1,3 +1,9 @@
|
||||
####
|
||||
# Ignore tests tmp files and results
|
||||
tests/runtest
|
||||
tests/**/*.gcda
|
||||
tests/**/*.gcno
|
||||
|
||||
####
|
||||
# Ignore CVS related files
|
||||
|
||||
@@ -9,10 +15,40 @@ CVS
|
||||
*.o
|
||||
linux/ccextractor
|
||||
linux/depend
|
||||
windows/debug/*
|
||||
windows/Debug/**
|
||||
windows/Debug-OCR/**
|
||||
windows/Release/**
|
||||
windows/Release-Full/**
|
||||
windows/Release-OCR/**
|
||||
windows/Debug-Full/**
|
||||
windows/x64/**
|
||||
windows/ccextractor.VC.db
|
||||
build/
|
||||
|
||||
####
|
||||
# Visual Studio project Ignored files
|
||||
|
||||
*.suo
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.user
|
||||
*.opendb
|
||||
|
||||
####
|
||||
# Ignore the header file that is updated upon build
|
||||
src/lib_ccx/compile_info_real.h
|
||||
|
||||
#### Ignore windows OCR libraries and folders
|
||||
windows/libs/leptonica/**
|
||||
windows/libs/tesseract/**
|
||||
|
||||
# Ctags
|
||||
*.tags*
|
||||
|
||||
# Vagrant
|
||||
.vagrant/
|
||||
|
||||
# Eclipse stuff
|
||||
.cproject
|
||||
.project
|
||||
.settings/
|
||||
|
||||
637
Dictionary/dict_Arrow.txt
Normal file
637
Dictionary/dict_Arrow.txt
Normal file
@@ -0,0 +1,637 @@
|
||||
A.R.G.U.S Tech
|
||||
A.R.G.U.S. Agent
|
||||
A.R.G.U.S. Guard
|
||||
A.R.G.U.S. Tech
|
||||
Adam Castwidth
|
||||
Adam Donner
|
||||
Adam Hoffman
|
||||
Adam Hunt
|
||||
Additional
|
||||
Adrian Chase
|
||||
Agent
|
||||
Aglin
|
||||
Aide
|
||||
Akio Yamashiro
|
||||
Al Ow-Al
|
||||
Alan Chang
|
||||
Alan Durand
|
||||
Albie
|
||||
Alderman Richard Ford
|
||||
Alex Davis
|
||||
Alex Salese
|
||||
Alexi Leonov
|
||||
Allison Lee
|
||||
Alvarez
|
||||
Amanda Waller
|
||||
Ambushed Soldier
|
||||
Anastasia
|
||||
Anatoly Knyazev
|
||||
Andy Diggle
|
||||
Andy Jr.
|
||||
Angry Crowd Riot
|
||||
Angry Woman
|
||||
Ankov
|
||||
Anthony Venza
|
||||
Anthony Walker
|
||||
Armed Citizen
|
||||
Armed Citizen #2
|
||||
Armed Guard
|
||||
Armored Truck Driver
|
||||
Asian Driver
|
||||
Assassin
|
||||
Attendant
|
||||
Attorney
|
||||
Attractive Woman
|
||||
Badass Inmate
|
||||
Baker
|
||||
Bank Guard
|
||||
Bank Guard #1
|
||||
Bank Guard #2
|
||||
Bank Manager
|
||||
Bar Guy
|
||||
Barman
|
||||
Baron Reiter
|
||||
Barry Allen
|
||||
Bartender
|
||||
Barton Mathis
|
||||
Bean Pole
|
||||
Becky
|
||||
Ben Turner
|
||||
Benefit Patron
|
||||
Benefit Security
|
||||
Bertinelli's Thug
|
||||
Bethany Snow
|
||||
Big Donor
|
||||
Biker
|
||||
Biker Leader
|
||||
Billy Malone
|
||||
Black Hawk Guard
|
||||
Blaine
|
||||
Blake
|
||||
Bo Travis
|
||||
Bodyguard
|
||||
Bodyguard #1
|
||||
Bomb Squad Officer
|
||||
Boss
|
||||
Bouncer
|
||||
Bouncer #1
|
||||
Boy
|
||||
Bratva Thug
|
||||
Brick Thug #1
|
||||
Brick Thug #2
|
||||
Brie Larvan
|
||||
Briefcase Man
|
||||
Burly Guard
|
||||
Business Suit
|
||||
Businesswoman
|
||||
Bystander
|
||||
CSI Tech
|
||||
CSU Tech Kelton
|
||||
Caitlin Snow
|
||||
Camille Declan
|
||||
Captain
|
||||
Captain Stein
|
||||
Carl
|
||||
Carl Roberto
|
||||
Carly Diggle
|
||||
Carrie Cutter
|
||||
Carter Bowen
|
||||
Carter Hall
|
||||
Cass Derenick
|
||||
Certo
|
||||
Chase
|
||||
Chauffeur
|
||||
China White
|
||||
Chinese Man
|
||||
Chinese Pilot
|
||||
Christopher Chance
|
||||
Cisco Ramon
|
||||
Claire Abbott
|
||||
Clinton Hogue
|
||||
Clock King
|
||||
Cocktail Waitress
|
||||
College Kid
|
||||
Colonel Walker
|
||||
Colton
|
||||
Commissioner Brian Nudocerdo
|
||||
Comptroller
|
||||
Conklin
|
||||
Constantine Drakon
|
||||
Controller
|
||||
Cooper Seldon
|
||||
Cop
|
||||
Cop #1
|
||||
Cop's Wife
|
||||
Coroner
|
||||
Corrupt Cop #1
|
||||
Costa
|
||||
Councillor
|
||||
Councilman Kullons
|
||||
Count Vertigo
|
||||
Counterfeiter
|
||||
Courier
|
||||
Court Clerk
|
||||
Crewman
|
||||
Cronan
|
||||
Curtis Holt
|
||||
Customs Agent
|
||||
Cyrus Gold
|
||||
Cyrus Vanch
|
||||
D.B. Gavin Carnahan
|
||||
D.O.C. Guard
|
||||
DJ
|
||||
Damian Darhk's Assistant
|
||||
Damien Darhk
|
||||
Dance Partner
|
||||
Danny Brickwell
|
||||
Danny De La Vega
|
||||
Dark Archer
|
||||
Dark Archer Stick
|
||||
Daughter
|
||||
Dead Girl
|
||||
Dead Girl in Photograph
|
||||
Deadshot
|
||||
Dealer
|
||||
Deathbolt
|
||||
Deathstroke
|
||||
Declan Lin
|
||||
Delivery Clerk
|
||||
Dennis
|
||||
Dennis Fisk
|
||||
Derek Reston
|
||||
Derek Sampson
|
||||
Desk Guard
|
||||
Detective
|
||||
Detective Lucas Hilton
|
||||
Detective McKenna Hall
|
||||
Deveau
|
||||
Digger Harkness
|
||||
Dignitary's Wife
|
||||
Dina Salvati
|
||||
Dinah Lance
|
||||
District Attorney
|
||||
Doctor
|
||||
Dominic Alonzo
|
||||
Donna Smoak
|
||||
Double Down
|
||||
Dr. Aldus Boardman
|
||||
Dr. Anthony Ivo
|
||||
Dr. Avery Pressnall
|
||||
Dr. Douglas Miller
|
||||
Dr. Lockhart
|
||||
Dr. Neil Lamb
|
||||
Dr. Schwartz
|
||||
Dr. Vaca
|
||||
Dr. Webb
|
||||
Driver
|
||||
Drug Dealer
|
||||
Drug Dealer's Girlfriend
|
||||
Drunk Guy
|
||||
Drunk Partier
|
||||
Dying Culebra Member
|
||||
ESU Officer
|
||||
ESU Sergeant
|
||||
Eddie Walczak
|
||||
Edward Fyers
|
||||
Edward Rasmus
|
||||
Elite Man
|
||||
Emergency Services
|
||||
Emily Nocenti
|
||||
Engineer Antonov
|
||||
Eric Dunn
|
||||
Eric Moore
|
||||
Erica Vendel
|
||||
Erlich Kelso
|
||||
Esrin Fortuna
|
||||
Evan Wender
|
||||
Evelyn Sharp
|
||||
Ezra Barnes
|
||||
FBI Agent
|
||||
Federal Marshal
|
||||
Felicity Smoak
|
||||
Female Clubber
|
||||
Female Hostage
|
||||
Female Scientist
|
||||
Fence
|
||||
Field Reporter
|
||||
Fire Chief Raynes
|
||||
Firefly
|
||||
Firestorm
|
||||
First Mate
|
||||
Fitzmartin
|
||||
Frank Bertinelli
|
||||
Frank Chen
|
||||
Fred
|
||||
Friendly Bratva
|
||||
Galina
|
||||
Gambler
|
||||
Gang Leader
|
||||
Gang Member
|
||||
Gangbanger
|
||||
Gangbanger #1
|
||||
Gangbanger #2
|
||||
Gardener
|
||||
Gary
|
||||
General Matthew Shrieve
|
||||
General Vadimov
|
||||
George Wolfman
|
||||
German
|
||||
Gerry Conway
|
||||
Gholem Qadir
|
||||
Gholem Security
|
||||
Ghost
|
||||
Ghost #2
|
||||
Gideon
|
||||
Girl
|
||||
Glass Banger
|
||||
Gora
|
||||
Grandmother
|
||||
Gravano
|
||||
Greg Osborne
|
||||
Grizzled Man
|
||||
Guard
|
||||
Guard #1
|
||||
Guard #2
|
||||
Guillermo Barrera
|
||||
Gun Dealer
|
||||
Gunman #2
|
||||
Gus Sabatoni
|
||||
Halcones Gang Member
|
||||
Hardhat
|
||||
Harley Quinn
|
||||
Harold Backman
|
||||
Hawkgirl
|
||||
Heat Wave
|
||||
Helena Bertinelli
|
||||
Hendrick Von Arnim
|
||||
Hive Scientist
|
||||
Homeless Man
|
||||
Hooded Man
|
||||
Hoodie
|
||||
Hoodlum
|
||||
Hot Chick
|
||||
Hot Girl
|
||||
Housewife
|
||||
Husband
|
||||
Ian
|
||||
Infected Man
|
||||
Injured Chemist
|
||||
Inmate
|
||||
Intern
|
||||
Isaac Stanzler
|
||||
Isabel Rochev
|
||||
Ishmael Gregor
|
||||
Izzy Declan
|
||||
Jackhammer
|
||||
James Holder
|
||||
Jana Washington
|
||||
Janet Carroll
|
||||
Janice Bowen
|
||||
Jason Brodeur
|
||||
Jean Loring
|
||||
Jenn
|
||||
Jenny Russo
|
||||
Jermaine Fisher
|
||||
Jessica Danforth
|
||||
Jim Huffman
|
||||
Joanna De La Vega
|
||||
John Constantine
|
||||
John Diggle
|
||||
John Jr.
|
||||
John Le
|
||||
John Nickel
|
||||
Jordan Kern
|
||||
Jose Anton
|
||||
Joseph Falk
|
||||
Josiah Hudson
|
||||
Judge
|
||||
Judge Brackett
|
||||
Judge Mandelbaum
|
||||
Judge Moss
|
||||
Judge Sakow
|
||||
Junior Gangbanger
|
||||
Junkie
|
||||
Kandy Kane
|
||||
Kara Danvers
|
||||
Karla Groves
|
||||
Kate Spencer
|
||||
Katherine
|
||||
Katsu Cheng
|
||||
Keating
|
||||
Kendrick Weller
|
||||
Kirby Bates
|
||||
Klaus Markos
|
||||
Konstantin Kovar
|
||||
Kyle Reston
|
||||
LOA Soldier
|
||||
Lady in Red
|
||||
Landmine Soldier
|
||||
Laura - Skull A
|
||||
Laura Hoffman
|
||||
Laura Washington
|
||||
Laurel Lance
|
||||
Lead Gangbanger
|
||||
Lead Gunman
|
||||
Lead Soldier
|
||||
League Assassin
|
||||
Leo Mueller
|
||||
Li Khuan Hui
|
||||
Lieutenant
|
||||
Lieutenant Joyner
|
||||
Liling
|
||||
Linda Park
|
||||
Little Boy
|
||||
Liza Warner
|
||||
Lonnie Machin
|
||||
Lowlife
|
||||
Lt. Conahan
|
||||
Lt. Dave Ellet
|
||||
Lt. Frank Pike
|
||||
Lyla Michaels
|
||||
M.I.T Student
|
||||
MP #1
|
||||
MP #2
|
||||
MP #3
|
||||
MP #4
|
||||
Maddie
|
||||
Madison Danforth
|
||||
Maitre'd
|
||||
Malcolm Merlyn
|
||||
Malcolm's Friend
|
||||
Male Scientist
|
||||
Man
|
||||
Man #2
|
||||
Man in Suit
|
||||
Man on Bus
|
||||
Manny
|
||||
Marcus Redmond
|
||||
Margo
|
||||
Mari McCabe
|
||||
Mark Francis
|
||||
Mark Scheffer
|
||||
Mark Shaw
|
||||
Markov
|
||||
Martin Somers
|
||||
Maseo Yamashiro
|
||||
Matt Istook
|
||||
Max Fuller
|
||||
Maya Resik
|
||||
Mayor Altman
|
||||
Mayor Celia Castle
|
||||
Mayor Queen's Assistant
|
||||
Mercenary
|
||||
Mercenary #3
|
||||
Merlyn Security #1
|
||||
Merlyn Security #2
|
||||
Michael Amar
|
||||
Michael Ancona
|
||||
Middle Aged Woman
|
||||
Milo Armitage
|
||||
Mina Fayad
|
||||
Minister
|
||||
Mirakuru Soldier
|
||||
Model
|
||||
Moderator
|
||||
Moira Queen
|
||||
Morgan
|
||||
Mother at Mall
|
||||
Motorcycle Cop
|
||||
Mouthpiece
|
||||
Mr. Blank
|
||||
Mr. Gardner
|
||||
Mr. Russo
|
||||
Mrs. Gardner
|
||||
Mrs. Merlyn
|
||||
Mrs. Reston
|
||||
Mrs. Volodarsky
|
||||
Myron Forest
|
||||
Nancy Moore
|
||||
Nate Heywood
|
||||
Nathan Sierra
|
||||
Ned Foster
|
||||
Nelson Ravich
|
||||
News Caster
|
||||
News Reporter
|
||||
Nick Salvati
|
||||
Nico
|
||||
Noah Kuttler
|
||||
Nora Darhk
|
||||
Nurse
|
||||
Nyssa al Ghul
|
||||
Obnoxious Clubber
|
||||
Officer
|
||||
Officer Benton
|
||||
Officer Daily
|
||||
Officer Jones
|
||||
Officer Lopez
|
||||
Officer Thompson
|
||||
Officiant
|
||||
Oliver Queen
|
||||
Oliver's Security Detail
|
||||
Ops Leader
|
||||
Orderly
|
||||
Orphan
|
||||
Overlapping Personnel #1
|
||||
Overlapping Personnel #2
|
||||
Pablo Estevez
|
||||
Palmer Tech Guard
|
||||
Paparazzi
|
||||
Parole Officer
|
||||
Partner
|
||||
Paul
|
||||
Paul Copani
|
||||
Paul Knox
|
||||
Pedestrian
|
||||
Peter
|
||||
Peter Declan
|
||||
Peter Kang
|
||||
Petrov
|
||||
Phaedra Nixon
|
||||
Pharmacist
|
||||
Phil
|
||||
Pilot
|
||||
Pino Bertinelli
|
||||
Pirate
|
||||
Pit Boss
|
||||
Pretty Girl
|
||||
Prison Guard
|
||||
Prison Guard #1
|
||||
Prison Guard #2
|
||||
Prisoner
|
||||
Prisoner #1
|
||||
Prisoner #2
|
||||
Private Collins
|
||||
Protester
|
||||
Pudgy Emcee
|
||||
Pyotr Friedkin
|
||||
QC Security Guard
|
||||
Queen Family Lawyer
|
||||
Quentin Lance
|
||||
Ra's al Ghul
|
||||
Ragman
|
||||
Raisa
|
||||
Rameses II
|
||||
Raven
|
||||
Ray Palmer
|
||||
Real Estate Woman
|
||||
Rebecca Merlyn
|
||||
Recruit #1
|
||||
Recruit #2
|
||||
Redhead Girl
|
||||
Refugee Woman
|
||||
Rene Ramirez
|
||||
Reporter
|
||||
Reporter #1
|
||||
Reporter #2
|
||||
Reporter #3
|
||||
Reporter #5
|
||||
Richard
|
||||
Rickie - Skull Man
|
||||
Ripped
|
||||
Rob Scott
|
||||
Robert Joyce
|
||||
Robert Queen
|
||||
Rookie
|
||||
Rosie
|
||||
Roy Harper
|
||||
Russian Cop #1
|
||||
Russian Drugs Buyer
|
||||
Russian Fight Arranger
|
||||
Russian Policeman
|
||||
Ruvé Adams
|
||||
SCPD Clerk
|
||||
SCPD Detective
|
||||
SCPD Officer
|
||||
SCPD Officer #1
|
||||
SWAT #2
|
||||
SWAT #3
|
||||
SWAT #4
|
||||
Samantha Clayton
|
||||
Sara Lance
|
||||
Scared Girl
|
||||
Scientist
|
||||
Screaming Woman
|
||||
Sebastian Blood
|
||||
Secretary
|
||||
Security Guard
|
||||
Security Guard #1
|
||||
Security Guard #2
|
||||
Senator Joseph Cray
|
||||
Sentry
|
||||
Sergei
|
||||
Sergio
|
||||
Servant
|
||||
Sexy Hostess
|
||||
Shado
|
||||
Shadowspire Soldier
|
||||
Shane Colvin
|
||||
Shannon Groff
|
||||
Sharp Gangster
|
||||
Shimosawa
|
||||
Shooter
|
||||
Silhouetted Man
|
||||
Simon
|
||||
Simon Lacroix
|
||||
Sin
|
||||
Sin's Father
|
||||
Skel
|
||||
Skull B
|
||||
Slade Wilson
|
||||
Sleazy Businessman
|
||||
Sleazy Clerk
|
||||
Slim
|
||||
Sobbing Man
|
||||
Social Worker
|
||||
Soldier
|
||||
Soldier #2
|
||||
Staffer #1
|
||||
Staffer #2
|
||||
Station Attendant
|
||||
Steve Aoki
|
||||
Street Kid
|
||||
Street Tough
|
||||
Striking Woman
|
||||
Suited Bratva
|
||||
Supporter #1
|
||||
Supporter #2
|
||||
Survivor
|
||||
Susan Williams
|
||||
Susie Lawton
|
||||
Swat Team Leader
|
||||
TV Host
|
||||
Taiana
|
||||
Talibah
|
||||
Talking Head
|
||||
Task Force Agent
|
||||
Task Force Leader
|
||||
Tatsu Yamashiro
|
||||
Tattooed Inmate
|
||||
Taylor Moore
|
||||
Technician
|
||||
Technician #2
|
||||
Ted Gaynor
|
||||
Ted Grant
|
||||
Teddy Reston
|
||||
Terrified Prisoner
|
||||
The Butcher
|
||||
The Captain
|
||||
The Count
|
||||
The Dodger
|
||||
The Mayor
|
||||
The Mechanic
|
||||
The Priestess
|
||||
Thea Queen
|
||||
Thomas Flynn
|
||||
Thomas Kemp
|
||||
Thug
|
||||
Thug #1
|
||||
Tim Kaufman
|
||||
Tim Sullivan
|
||||
Tobias Church
|
||||
Tom Weston
|
||||
Tomas
|
||||
Tommy Merlyn
|
||||
Tony Daniel
|
||||
Torque
|
||||
Triad Accountant
|
||||
Triad Thug
|
||||
Turk
|
||||
US Ambassador
|
||||
Uniform
|
||||
Uniform Cop
|
||||
Untouchable #2
|
||||
Untouchable #3
|
||||
Vandal Savage
|
||||
Vendor
|
||||
Veronica Sparks
|
||||
Victor Nocenti
|
||||
Victor Swanstrom
|
||||
Vigilante
|
||||
Viktor
|
||||
Viktor's Henchman
|
||||
Vivian
|
||||
Vixen
|
||||
Vlad
|
||||
Volkov
|
||||
Volunteer
|
||||
Waiter
|
||||
Waitress
|
||||
Walter Steele
|
||||
Warehouse Worker
|
||||
Wealthy Patron
|
||||
Wheelman
|
||||
Wife
|
||||
William
|
||||
Woman
|
||||
Woman on Bus
|
||||
Yao Fei
|
||||
Young Boy
|
||||
Young Girl with Glasses
|
||||
Young Guard
|
||||
Young Mother
|
||||
Young Nyssa
|
||||
Young Oliver
|
||||
Young Thug
|
||||
Young Tommy
|
||||
Zhishan
|
||||
Zoe Lawton
|
||||
370
Dictionary/dict_Breaking_Bad.txt
Normal file
370
Dictionary/dict_Breaking_Bad.txt
Normal file
@@ -0,0 +1,370 @@
|
||||
ABQ Detective #1
|
||||
ABQ Detective #2
|
||||
APD Detective Tim Roberts
|
||||
APD Officer
|
||||
ASAC George Merkert
|
||||
AUSA
|
||||
Addict
|
||||
Agent Buddy
|
||||
Airport Traveler
|
||||
Albuquerque Police Officer
|
||||
Amber
|
||||
Anchor #1
|
||||
Anchor #2
|
||||
Anchor #3
|
||||
Anchor #4
|
||||
Andrea Cantillo
|
||||
Arms Dealer
|
||||
Asst. US Attorney
|
||||
Backhoe Operator
|
||||
Bad Girl
|
||||
Badger
|
||||
Banger #1
|
||||
Bank Customer
|
||||
Bank Teller
|
||||
Bar Fighter
|
||||
Barfly
|
||||
Barry
|
||||
Bartender
|
||||
Ben
|
||||
Beneke Employee #1
|
||||
Beneke Employee #2
|
||||
Benicio Fuentes
|
||||
Beto
|
||||
Big Biker
|
||||
Biker
|
||||
Bingo Caller
|
||||
Bingo Lady
|
||||
Bob
|
||||
Bogdan Wolynetz
|
||||
Boy in Museum
|
||||
Brock Cantillo
|
||||
Burnout
|
||||
Business Community Leader #1
|
||||
Business Community Leader #2
|
||||
Businessman
|
||||
CID Special Agent
|
||||
Cab Driver
|
||||
Cancer Patient
|
||||
Car Wash Attendant
|
||||
Car Wash Customer
|
||||
Car Wash Patron
|
||||
CarWash Patron
|
||||
Cara
|
||||
Caregiver
|
||||
Carmen Molina
|
||||
Carol
|
||||
Carpet Cleaner
|
||||
Carpet Cleaner #2
|
||||
Cartel Gunman #1
|
||||
Cartel Gunman #2
|
||||
Cartel Gunman #3
|
||||
Cartel Gunman #4
|
||||
Cartel Henchman
|
||||
Carwash Customer
|
||||
Chad
|
||||
Chad's Girlfriend
|
||||
Charlie Rose
|
||||
Chemical Plant Guard
|
||||
Chemistry Student
|
||||
Chief Food Technician
|
||||
Chris Mara
|
||||
Chuck
|
||||
Clovis
|
||||
Colleen
|
||||
Combo
|
||||
Commercial Narrator
|
||||
Commercial Voice Over
|
||||
Concerned Parent
|
||||
Conductor
|
||||
Cop
|
||||
Cop #1
|
||||
Cop #2
|
||||
Corpse
|
||||
Customer
|
||||
DEA
|
||||
DEA Agent
|
||||
DEA Agent #1
|
||||
DEA Agent Artie
|
||||
DEA Agent Scott
|
||||
DEA Agent Tom
|
||||
DEA Agent Vanco
|
||||
DEA Point Man
|
||||
Dan Wachsberger
|
||||
Darla
|
||||
Daughter
|
||||
Dave
|
||||
Declan
|
||||
Declan's Crew Member
|
||||
Declan's Driver
|
||||
Delivery Man
|
||||
Delores
|
||||
Dennis Markowski
|
||||
Deputy #1
|
||||
Deputy Kee
|
||||
Detective
|
||||
Detective #1
|
||||
Detective #2
|
||||
Detective Kalanchoe
|
||||
Detective Munn
|
||||
Doctor
|
||||
Dog Handler
|
||||
Don Eladio
|
||||
Donald Margolis
|
||||
Dorothy Yobs
|
||||
Dr. Barry Goodman
|
||||
Dr. Belknap
|
||||
Dr. Chavez
|
||||
Dr. Delcavoli
|
||||
Dr. Soper
|
||||
Dr. Victor Bravenec
|
||||
Drew Sharp
|
||||
Duane Chow
|
||||
Duty Officer
|
||||
EMT
|
||||
ER Doctor #1
|
||||
ER Doctor #2
|
||||
Ed
|
||||
El Paso DEA Agent
|
||||
Elliott Schwartz
|
||||
Emilio Koyama
|
||||
Emotional Woman
|
||||
Engineer
|
||||
Farley
|
||||
Father
|
||||
Federale
|
||||
Female Employee
|
||||
Female Homeowner
|
||||
Fernando
|
||||
Fireman
|
||||
First Realtor
|
||||
Fran
|
||||
Francesca
|
||||
Frankie
|
||||
Friendly Agent
|
||||
Friendly Guy
|
||||
GYN
|
||||
Gaff
|
||||
Gale Boetticher
|
||||
Garduño's Diner
|
||||
Getz
|
||||
Gonzo
|
||||
Good Samaritan
|
||||
Government Lawyer
|
||||
Grandma
|
||||
Gretchen Schwartz
|
||||
Group Leader
|
||||
Gunman #1
|
||||
Gunman #2
|
||||
Gus' Operative
|
||||
Gustavo 'Gus' Fring
|
||||
Hank Schrader
|
||||
Henry Tyree
|
||||
Herr Herzog
|
||||
High School Student
|
||||
Homeless Man
|
||||
Homeless Man's Wife
|
||||
Homeowner
|
||||
Hospital Administrator
|
||||
Hospital Patient
|
||||
Hot Chick Cop
|
||||
Huell
|
||||
Hugo Archuleta
|
||||
Ira
|
||||
Irving
|
||||
Jack's Henchman
|
||||
Jake Pinkman
|
||||
James Edward Kilkelly
|
||||
Jane Margolis
|
||||
Janice
|
||||
Jeffrey
|
||||
Jesse Pinkman
|
||||
Jewelry Store Owner
|
||||
Jock
|
||||
Jock's Friend #1
|
||||
Jock's Friend #2
|
||||
Juan Bolsa
|
||||
Kaylee Ehrmantraut
|
||||
Ken Wins
|
||||
Kenny
|
||||
Kid
|
||||
Kiira
|
||||
Krazy-8
|
||||
Kuby
|
||||
Lady in Car
|
||||
Laundry Woman 1
|
||||
Laundry Woman 2
|
||||
Laundry Woman 3
|
||||
Laundry Worker
|
||||
Lawson
|
||||
Lawyer
|
||||
Lead Doctor
|
||||
Leonel Salamanca
|
||||
Lester
|
||||
Little Old Lady
|
||||
Local Correspondant
|
||||
Locksmith
|
||||
Look out
|
||||
Lookout
|
||||
Los Pollos Hermanos Cook
|
||||
Los Pollos Hermanos Patron
|
||||
Louis
|
||||
Lt. Adam Estiguez
|
||||
Lucy
|
||||
Lydia Rodarte-Quayle
|
||||
Ma Kettle
|
||||
Madrigal Suit
|
||||
Magnet Guy #2
|
||||
Mail Lady
|
||||
Male Homeowner
|
||||
Manager
|
||||
Marco Salamanca
|
||||
Mariano
|
||||
Marie Schrader
|
||||
Matt
|
||||
Max Arsiniega
|
||||
Medical Technician
|
||||
Meth Cook
|
||||
Meth Drug Dealer
|
||||
Miguel
|
||||
Mike Ehrmantraut
|
||||
Mike's Security Team 1
|
||||
Mike's Security Team 2
|
||||
Min-Ye
|
||||
Morning After Girl
|
||||
Mortgage Broker
|
||||
Mother
|
||||
Mr. Gardiner
|
||||
Mr. Pinkman
|
||||
Mr. Wilson
|
||||
Mrs. Ortega
|
||||
Mrs. Pinkman
|
||||
Mrs. Pope
|
||||
Ms. Tromel
|
||||
Music Producer
|
||||
NA Sponsor
|
||||
Narcocorridos Band #1
|
||||
Narcocorridos Band #2
|
||||
Native American Man
|
||||
Neighbor
|
||||
Neighborhood Boy
|
||||
Neighborhood Kid
|
||||
News Reporter
|
||||
No-Doze
|
||||
Nurse
|
||||
O.M.I. Attendant
|
||||
O.M.I. Officer
|
||||
OPR Official #1
|
||||
Ob-Gyn
|
||||
Off Duty Cop
|
||||
Office Manager
|
||||
Office Worker
|
||||
Old Crawler
|
||||
Old Joe
|
||||
Old Man
|
||||
Orderly
|
||||
Pa Kettle
|
||||
Pamela
|
||||
Parent
|
||||
Party Girl
|
||||
Partygoer
|
||||
Paul Tyree
|
||||
Pedestrian
|
||||
Pediatric Nurse
|
||||
Peng
|
||||
Peter Schuler
|
||||
Physical Therapist
|
||||
Police Officer
|
||||
Policeman
|
||||
Pollos Manager
|
||||
Preppy Shopper
|
||||
Prison Guard
|
||||
Prospective Buyer
|
||||
Public Defender
|
||||
Radio DJ #1
|
||||
Radio DJ #2
|
||||
Realtor
|
||||
Receptionist
|
||||
Rehab Group Girl
|
||||
Rehab Patient
|
||||
Restaurant Employee
|
||||
Restaurant Patron
|
||||
Rival Dealer #1
|
||||
Rival Dealer #2
|
||||
Ron Forenall
|
||||
Rookie Officer
|
||||
Rowdy Prisoner
|
||||
SAC Ramey
|
||||
Sad Faced Girl
|
||||
Sales Girl
|
||||
Salesman
|
||||
Sara Tyree
|
||||
Saul Goodman
|
||||
Saul's Client
|
||||
Scary Skell
|
||||
Schlubby Guy #1
|
||||
Schlubby Guy #2
|
||||
School Office Worker
|
||||
Scientist
|
||||
Screaming Shopper
|
||||
Secretary
|
||||
Senior DEA Agent
|
||||
Server
|
||||
Sexy Cartel Girl
|
||||
Sexy Neighbor
|
||||
Skater
|
||||
Skell
|
||||
Sketchy
|
||||
Skinny Pete
|
||||
Skycap
|
||||
Skyler White
|
||||
Soren
|
||||
Spooge
|
||||
Spooge's Woman
|
||||
Stephanie Doswell
|
||||
Steven Gomez
|
||||
Stew
|
||||
Stripper #1
|
||||
Stripper #2
|
||||
Student
|
||||
Supermarket Clerk
|
||||
Support Group Leader
|
||||
Support Group Member
|
||||
TV Reporter
|
||||
Tattooed Biker
|
||||
Tattooed Woman
|
||||
Teacher
|
||||
Technician
|
||||
Ted Beneke
|
||||
The Assassin
|
||||
Thug Buddy
|
||||
Tio Salamanca
|
||||
Tio's Nurse
|
||||
Todd
|
||||
Tomas
|
||||
Tortuga
|
||||
Trent
|
||||
Truck Guard 1
|
||||
Truck Guard 2
|
||||
Tucker
|
||||
Tuco Salamanca
|
||||
Tweaker Thief
|
||||
Tweaky Dude
|
||||
Tyrus Kitt
|
||||
Uncle Jack
|
||||
Union Rep
|
||||
Urinal Guy
|
||||
Victor
|
||||
Waiter
|
||||
Waitress
|
||||
Walter White
|
||||
Walter White, Jr.
|
||||
Warehouse Worker
|
||||
Wendy
|
||||
Wide Eyed Boy
|
||||
Wino
|
||||
Woman in Denny's
|
||||
Young Boy
|
||||
Young Leonel
|
||||
Young Marco
|
||||
Yuppie Woman
|
||||
614
Dictionary/dict_Game_of_Thrones.txt
Normal file
614
Dictionary/dict_Game_of_Thrones.txt
Normal file
@@ -0,0 +1,614 @@
|
||||
|
||||
'That's Right' Man
|
||||
Addam Marbrand
|
||||
Adrack Humble
|
||||
Aeron Greyjoy
|
||||
Aerys Targaryen
|
||||
Aggo
|
||||
Alliser Thorne
|
||||
Alton Lannister
|
||||
Amory Lorch
|
||||
Anara
|
||||
Anguy
|
||||
Anya Waynwood
|
||||
Areo Hotah
|
||||
Armeca
|
||||
Arthur
|
||||
Arthur Dayne
|
||||
Arya Stark
|
||||
Ash
|
||||
Axell Florent
|
||||
Aya
|
||||
Baby Sam
|
||||
Balon Greyjoy
|
||||
Baratheon Archer
|
||||
Baratheon General
|
||||
Baratheon Guard
|
||||
Baratheon Officer
|
||||
Baratheon Soldier
|
||||
Baratheon Soldier #1
|
||||
Baratheon Soldier #2
|
||||
Barristan Selmy
|
||||
Bathhouse Boy
|
||||
Bathhouse Prostitute
|
||||
Bear Island Maester
|
||||
Beggar Woman
|
||||
Belicho Paenymion
|
||||
Benjen Stark
|
||||
Beric Dondarrion
|
||||
Bianca
|
||||
Biter
|
||||
Black Jack Bulwer
|
||||
Black Lorren
|
||||
Black Walder Rivers
|
||||
Boat Commander
|
||||
Bobono
|
||||
Bolton General
|
||||
Bolton Guard
|
||||
Bolton Officer
|
||||
Bolton Soldier
|
||||
Bowen Marsh
|
||||
Braavosi Captain
|
||||
Braavosi Madam
|
||||
Braavosi Theatre Server
|
||||
Braavosi Theatre Sound Artist
|
||||
Braavosi Woman #1
|
||||
Braavosi Woman #2
|
||||
Bran Stark
|
||||
Brant
|
||||
Brea
|
||||
Brienne of Tarth
|
||||
Bronn
|
||||
Brothel Child #1
|
||||
Brothel Child #2
|
||||
Brothel Customer
|
||||
Brothel Guard
|
||||
Brother Ray
|
||||
Brotherhood Member
|
||||
Brusco
|
||||
Brynden 'Blackfish' Tully
|
||||
Camello
|
||||
Captain of the Archers
|
||||
Captain of the Bolton Archers
|
||||
Captain's Daughter
|
||||
Catelyn Stark
|
||||
Catspaw Assassin
|
||||
Cersei Body Double
|
||||
Cersei Lannister
|
||||
Chella
|
||||
Child of the Forest
|
||||
Citadel Maester
|
||||
Clarenzo
|
||||
Clea
|
||||
Cley Cerwyn
|
||||
Colen of Greenpools
|
||||
Cooper
|
||||
Craster
|
||||
Craster's Wife
|
||||
Craster's Wife #2
|
||||
Craster's Wife #3
|
||||
Craster's Younger Wife
|
||||
Daario Naharis
|
||||
Daenerys Targaryen
|
||||
Dagmer Cleftjaw
|
||||
Daisy
|
||||
Davos Seaworth
|
||||
Denys Mallister
|
||||
Derek
|
||||
Desmond Crakehall
|
||||
Despondent Man
|
||||
Dickon Tarly
|
||||
Dim Dalba
|
||||
Donnel Hill
|
||||
Donnel Waynwood
|
||||
Dontos Hollard
|
||||
Doran Martell
|
||||
Doreah
|
||||
Dothraki
|
||||
Dothraki Bloodrider #1
|
||||
Dothraki Bloodrider #2
|
||||
Dothraki Crone
|
||||
Dothraki Man Having Sex
|
||||
Dothraki Widow #1
|
||||
Dothraki Widow #2
|
||||
Dothraki Woman Having Sex
|
||||
Dragonstone waiter
|
||||
Drennan
|
||||
Drowned Priest
|
||||
Drummer
|
||||
Drunk Patron
|
||||
Dwarf Hunter #1
|
||||
Dwarf Hunter #2
|
||||
Dying Man
|
||||
Eddard 'Ned' Stark
|
||||
Eddison Tollett
|
||||
Edmure Tully
|
||||
Elder Meereen Slave
|
||||
Ellaria Sand
|
||||
Eon Hunter
|
||||
Euron Greyjoy
|
||||
Eyrie Guard
|
||||
Faceless Man
|
||||
Faith Militant
|
||||
Faith Militant #1
|
||||
Faith Militant #2
|
||||
Farlen
|
||||
Farmer Hamlet
|
||||
Farmer's Daughter
|
||||
Fennesz
|
||||
Fighter
|
||||
First Mate
|
||||
Foreign Merchant
|
||||
Frances
|
||||
Frey Guard
|
||||
Frey Guardsman
|
||||
Frey Soldier #1
|
||||
Frey Soldier #2
|
||||
Frey Wedding Guest
|
||||
Fruit Vendor
|
||||
Gared
|
||||
Gatins
|
||||
Gendry
|
||||
Genna
|
||||
Gerald
|
||||
Gerold Hightower
|
||||
Ghita
|
||||
Gilly
|
||||
Glover General
|
||||
Goatherd
|
||||
Goatherd's Son
|
||||
Goldcloak
|
||||
Goldcloak #1
|
||||
Goldcloak #2
|
||||
Gordy
|
||||
Grand Maester Pycelle
|
||||
Great Master #1
|
||||
Great Master #2
|
||||
Great Master #3
|
||||
Great Master #4
|
||||
Great Master #5
|
||||
Great Master #6
|
||||
Great Master #7
|
||||
Greatjon Umber
|
||||
Gregor Clegane
|
||||
Greizhen mo Ullhor
|
||||
Grenn
|
||||
Grey Worm
|
||||
Guymon
|
||||
Hallyne
|
||||
Handmaid
|
||||
Harald Karstark
|
||||
Healtor Troop
|
||||
High Priestess
|
||||
High Septon
|
||||
High Sparrow
|
||||
Hizdahr zo Loraq
|
||||
Hodor
|
||||
Hog Farmer
|
||||
Hoster Tully
|
||||
Hot Pie
|
||||
Howland Reed
|
||||
Hugh of the Vale
|
||||
Iggo
|
||||
Illyrio Mopatis
|
||||
Ilyn Payne
|
||||
Imry Florent
|
||||
Inn Waitress
|
||||
Innkeeper
|
||||
Innkeeper's Daughter
|
||||
Ironborn #1
|
||||
Ironborn #2
|
||||
Ironborn #3
|
||||
Ironborn Abusing a Volantene Whore
|
||||
Ironborn at Brothel
|
||||
Ironborn in Skiff
|
||||
Irri
|
||||
Izembaro
|
||||
Jacks
|
||||
Jaime Lannister
|
||||
Janos Slynt
|
||||
Jaqen H'ghar
|
||||
Jaqen's Disguise
|
||||
Jaremy Rykker
|
||||
Jeor Mormont
|
||||
Jhiqui
|
||||
Joffrey Baratheon
|
||||
Johnna
|
||||
Jojen Reed
|
||||
Jon Arryn
|
||||
Jon Snow
|
||||
Jon Snow Soldier
|
||||
Jonos Bracken
|
||||
Jorah Mormont
|
||||
Jory Cassel
|
||||
Joss
|
||||
Joyeuse Erenford
|
||||
Karl Tanner
|
||||
Karsi
|
||||
Karstark Lead Archer
|
||||
Karstark Lookout
|
||||
Karstark Soldier
|
||||
Karstark Soldier #1
|
||||
Karstark Soldier #2
|
||||
Kayla
|
||||
Kegs
|
||||
Kesh
|
||||
Kevan Lannister
|
||||
Khal Brozho
|
||||
Khal Drogo
|
||||
Khal Forzho
|
||||
Khal Moro
|
||||
Khal Qorro
|
||||
Khal Rhalko
|
||||
Khaleesi Handmaiden #1
|
||||
King Balon Greyjoy Dwarf
|
||||
King Joffrey Baratheon Dwarf
|
||||
King Renly Baratheon Dwarf
|
||||
King Robb Stark Dwarf
|
||||
King Stannis Baratheon Dwarf
|
||||
King's Guard
|
||||
King's Landing Baker
|
||||
King's Landing Boaster
|
||||
King's Landing Drunkard
|
||||
King's Landing Flasher #1
|
||||
King's Landing Flasher #2
|
||||
King's Landing Handmaiden
|
||||
King's Landing Rioter #1
|
||||
King's Landing Rioter #2
|
||||
King's Landing Rioter #3
|
||||
King's Landing Tailor
|
||||
King's Landing Urchin
|
||||
King's Landing Whore
|
||||
Kinvara
|
||||
Knight of House Frey
|
||||
Knight of House Lynderly
|
||||
Kovarro
|
||||
Kraznys mo Nakloz
|
||||
Kurleket
|
||||
Lady Crane
|
||||
Lady Kitty Frey
|
||||
Lancel Lannister
|
||||
Lannister Archer
|
||||
Lannister Army Member
|
||||
Lannister Captain
|
||||
Lannister Guard
|
||||
Lannister Guard #1
|
||||
Lannister Guard #2
|
||||
Lannister Guard #3
|
||||
Lannister Guardsman
|
||||
Lannister Lord
|
||||
Lannister Messenger
|
||||
Lannister Scout
|
||||
Lannister Soldier
|
||||
Lannister Torturer
|
||||
Lead Dornish Guard
|
||||
Lead Kingsguard
|
||||
Leaf
|
||||
Lem Lemoncloak
|
||||
Leo Lefford
|
||||
Lhara
|
||||
Little Bird
|
||||
Little Bird #3
|
||||
Little Bird #4
|
||||
Little Bird #5
|
||||
Little Bird #6
|
||||
Little Bird #7
|
||||
Loboda
|
||||
Locke
|
||||
Lollys Stokeworth
|
||||
Lommy Greenhands
|
||||
Loras Tyrell
|
||||
Lord Blackmont
|
||||
Lord Galbart Glover
|
||||
Lord Portan
|
||||
Lord Varys
|
||||
Lord of Bones
|
||||
Lordsport Dockhand
|
||||
Lothar Frey
|
||||
Loyal Night's Watchman #1
|
||||
Loyal Night's Watchman #2
|
||||
Lyanna Mormont
|
||||
Lyanna Stark
|
||||
Lysa Arryn
|
||||
Mace Tyrell
|
||||
Maester Aemon
|
||||
Maester Caleotte
|
||||
Maester Cressen
|
||||
Maester Helliweg
|
||||
Maester Luwin
|
||||
Maester Wolkan
|
||||
Mag the Mighty
|
||||
Maggy
|
||||
Mago
|
||||
Male Prostitute
|
||||
Malko
|
||||
Mallister Supporter
|
||||
Mance Rayder
|
||||
Mandon Moore
|
||||
Manservant
|
||||
Marei
|
||||
Margaery Tyrell
|
||||
Margaery Tyrell Mummer
|
||||
Margaery's Handmaiden
|
||||
Marianne Frey
|
||||
Marillion
|
||||
Masha Heddle
|
||||
Master Torturer
|
||||
Matthos Seaworth
|
||||
Meera Reed
|
||||
Meereen Guard
|
||||
Meereen Slave
|
||||
Meereenese Homeless Mother
|
||||
Melara Hetherspoon
|
||||
Melessa Tarly
|
||||
Melisandre
|
||||
Merchant Captain
|
||||
Merchant in Tavern
|
||||
Mero
|
||||
Merry Frey
|
||||
Meryn Trant
|
||||
Mhaegen
|
||||
Mikken
|
||||
Mirelle
|
||||
Mirri Maz Duur
|
||||
Missandei
|
||||
Mole's Town Madam
|
||||
Mole's Town Whore
|
||||
Morag
|
||||
Mord
|
||||
Morgan
|
||||
Morgan's Friend
|
||||
Moro's Wife #1
|
||||
Moro's Wife #2
|
||||
Mossador
|
||||
Mully
|
||||
Mummer #2
|
||||
Mummer #3
|
||||
Mummer #4
|
||||
Musician #1
|
||||
Musician #2
|
||||
Musician #3
|
||||
Musician #4
|
||||
Musician #5
|
||||
Mycah
|
||||
Myranda
|
||||
Myrcella Baratheon
|
||||
Night's Watch
|
||||
Night's Watch Archer
|
||||
Night's Watch Deserter
|
||||
Night's Watch Messenger
|
||||
Night's Watch Officer
|
||||
Night's Watchman
|
||||
Night's Watchman #1
|
||||
Night's Watchman #2
|
||||
Nobel Man
|
||||
Noble Lady
|
||||
Noble Man
|
||||
Northern Lord
|
||||
Northman Archer
|
||||
Northman Rider
|
||||
Northman Rioter
|
||||
Nymeria Sand
|
||||
Obara Sand
|
||||
Oberyn Martell
|
||||
Old Man
|
||||
Old Nan
|
||||
Old Woman
|
||||
Old Woman Prisoner
|
||||
Olenna Tyrell
|
||||
Olly
|
||||
Olly's Mother
|
||||
Olyvar
|
||||
Orell
|
||||
Ornela
|
||||
Orphan Kid
|
||||
Osha
|
||||
Othell Yarwyck
|
||||
Oznak zo Pahl
|
||||
Peasant
|
||||
Pentoshi Servant
|
||||
Petyr 'Littlefinger' Baelish
|
||||
Pit Announcer
|
||||
Pit Fighter
|
||||
Podrick Payne
|
||||
Polliver
|
||||
Prendahl na Ghezn
|
||||
Prisoner
|
||||
Protestor
|
||||
Pyat Pree
|
||||
Pypar
|
||||
Qartheen Woman
|
||||
Qhono
|
||||
Qhorin Halfhand
|
||||
Qotho
|
||||
Quaithe
|
||||
Quent
|
||||
Qyburn
|
||||
Rakharo
|
||||
Ralf Kenning
|
||||
Ramsay Bolton
|
||||
Randyll Tarly
|
||||
Rast
|
||||
Rattleshirt
|
||||
Razdal mo Eraz
|
||||
Red Keep Stableboy
|
||||
Red Priestess
|
||||
Reginald Lannister
|
||||
Renly Baratheon
|
||||
Rennick
|
||||
Rhaego
|
||||
Rickard Karstark
|
||||
Rickard Stark
|
||||
Rickon Stark
|
||||
Riddell
|
||||
Riverlands Traveller
|
||||
Riverrun Nobleman
|
||||
Robb Stark
|
||||
Robert Baratheon
|
||||
Robett Glover
|
||||
Robin Arryn
|
||||
Rodrik Cassel
|
||||
Roose Bolton
|
||||
Rorge
|
||||
Ros
|
||||
Roslin Frey
|
||||
Royal Steward
|
||||
Ryger Rivers
|
||||
Sailor
|
||||
Salladhor Saan
|
||||
Samwell Tarly
|
||||
Sandor 'The Hound' Clegane
|
||||
Sansa Stark
|
||||
Second Son
|
||||
Sellsword #1
|
||||
Sellsword #2
|
||||
Selyse Baratheon
|
||||
Septa Moelle
|
||||
Septa Mordane
|
||||
Septa Scolera
|
||||
Septa Unella
|
||||
Septon
|
||||
Ser Endrew Tarth
|
||||
Shae
|
||||
Shagga
|
||||
Shireen Baratheon
|
||||
Silk King
|
||||
Simpson
|
||||
Singing Lannister Soldier
|
||||
Sissy
|
||||
Slaver
|
||||
Smalljon Umber
|
||||
Soldier
|
||||
Son of the Harpy
|
||||
Sorcerer
|
||||
Sparring Boy
|
||||
Spice King
|
||||
Stannis Baratheon
|
||||
Stark Guard
|
||||
Stark Messenger
|
||||
Stark Soldier
|
||||
Steelshanks Walton
|
||||
Steve
|
||||
Stevron Frey
|
||||
Stiv
|
||||
Stone Man
|
||||
Street Tough #1
|
||||
Street Tough #2
|
||||
Strong Fighter
|
||||
Strong Sam Stone
|
||||
Styr
|
||||
Syrio Forel
|
||||
Talisa Stark
|
||||
Talla Tarly
|
||||
Tansy
|
||||
Ternesio Terys
|
||||
The Bear
|
||||
The Crone
|
||||
The Maiden
|
||||
The Mother
|
||||
The Night King
|
||||
The Tickler
|
||||
The Waif
|
||||
The Waif's Disguise
|
||||
Thenn Warg
|
||||
Theon Greyjoy
|
||||
Theon's Master of Hounds
|
||||
Thin Man
|
||||
Thoros of Myr
|
||||
Three-Eyed Raven
|
||||
Timett
|
||||
Tobho Mott
|
||||
Todder
|
||||
Tomard
|
||||
Tommen Baratheon
|
||||
Tommen's Attendant
|
||||
Tommen's Manservant
|
||||
Tommy
|
||||
Tormund Giantsbane
|
||||
Torrhen Karstark
|
||||
Tortured Prisoner
|
||||
Tortured Slave
|
||||
Tourney Herald
|
||||
Trystane Martell
|
||||
Tully Bannerman
|
||||
Tully Soldier
|
||||
Tycho Nestoris
|
||||
Tyene Sand
|
||||
Tyrell Bannerman
|
||||
Tyrell Guard
|
||||
Tyrell Lady
|
||||
Tyrell Servant
|
||||
Tyrell Soldier
|
||||
Tyrion Lannister
|
||||
Tywin Lannister
|
||||
Unsullied
|
||||
Vala
|
||||
Valyrian Slave
|
||||
Vance Corbray
|
||||
Vardis Egen
|
||||
Varly
|
||||
Vayon Poole
|
||||
Violet
|
||||
Viserys Targaryen
|
||||
Volantene Whore
|
||||
Volantene Whore #1
|
||||
Volantene Whore #2
|
||||
Volantene Whore #3
|
||||
Volantene Whore #4
|
||||
Volantene Whore #5
|
||||
Waitress
|
||||
Walda Bolton
|
||||
Walder Frey
|
||||
Warlock
|
||||
Waymar Royce
|
||||
Wedding Band
|
||||
Wedding Guest
|
||||
Wendel Manderly
|
||||
Westerosi Trader
|
||||
White Rat
|
||||
White Walker
|
||||
White Walker #2
|
||||
Whore
|
||||
Whore #1
|
||||
Whore #2
|
||||
Wight
|
||||
Wight Wildling Girl
|
||||
Wilding Gladiator
|
||||
Wildling
|
||||
Wildling Rioter
|
||||
Will
|
||||
Willa
|
||||
Willem Lannister
|
||||
Willis Wode
|
||||
Wine Merchant
|
||||
Winter Town Man
|
||||
Winterfell Beekeeper
|
||||
Winterfell Shepherd
|
||||
Woodcutter
|
||||
Wounded Lannister
|
||||
Wun Wun
|
||||
Wyllis
|
||||
Wyman Manderly
|
||||
Xaro Xhoan Daxos
|
||||
Yara Greyjoy
|
||||
Yezzan zo Qaggaz
|
||||
Ygritte
|
||||
Yohn Royce
|
||||
Yoren
|
||||
Young Benjen Stark
|
||||
Young Braavosi
|
||||
Young Cersei Lannister
|
||||
Young Lyanna Stark
|
||||
Young Nan
|
||||
Young Ned
|
||||
Young Ned Stark
|
||||
Young Nobleman
|
||||
Young Rodrik Cassel
|
||||
Yunkai Citizen
|
||||
Yunkai'i Slave #1
|
||||
Yunkai'i Slave #2
|
||||
Yunkai'i Slave #3
|
||||
Yunkai'i Slave #4
|
||||
Yunkai'i Slave #5
|
||||
Yunkai'i Whore
|
||||
Zanrush
|
||||
1380
Dictionary/dict_House.txt
Normal file
1380
Dictionary/dict_House.txt
Normal file
File diff suppressed because it is too large
Load Diff
54
Dictionary/dict_adventure_time.txt
Normal file
54
Dictionary/dict_adventure_time.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
Ancient Psychic Tandem War Elephant
|
||||
Banana Guard
|
||||
Candy Kingdom
|
||||
Candy People
|
||||
Choose Goose
|
||||
Cinnamon Bun
|
||||
City of Thieves
|
||||
Colonel Candycorn
|
||||
Cosmic Owl
|
||||
Crab Princess
|
||||
Dr. Donut
|
||||
Dr. Ice Cream
|
||||
Duchess of Nuts
|
||||
Earl of Lemongrab
|
||||
Everything Burrito
|
||||
Finn the Human
|
||||
Fire Kingdom
|
||||
Flame Princess
|
||||
Flying Lettuce Bros.
|
||||
Ghost Princess
|
||||
Hotdog Knight
|
||||
Ice King
|
||||
Ice Kingdom
|
||||
Jake the Dog
|
||||
Lady Rainicorn
|
||||
Lake Butterscotch
|
||||
Land of Ooo
|
||||
Lumpy Space Princess
|
||||
Marauder Village
|
||||
Marshmallow Kid
|
||||
Mr. Cream Puff
|
||||
Muscle Princess
|
||||
Nice King
|
||||
Nice Knights
|
||||
Nightosphere
|
||||
Nurse Poundcake
|
||||
Old Lady Princess
|
||||
Party Pat
|
||||
Peppermint Butler
|
||||
Pillow World
|
||||
Princess Bubblegum
|
||||
Raggedy Princess
|
||||
Root Beer Guy
|
||||
Sir Slicer
|
||||
Skeleton Princess
|
||||
Slime Princess
|
||||
Snow Golem
|
||||
The Enchiridion
|
||||
The Lich
|
||||
Toast Princess
|
||||
Tree Fort
|
||||
Tree Trunks
|
||||
Wildberry Princess
|
||||
Wizard Battle
|
||||
25
Dictionary/dict_doctor_who.txt
Normal file
25
Dictionary/dict_doctor_who.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
Adipose
|
||||
Amy Pond
|
||||
Clara Oswin Oswald
|
||||
Cybermen
|
||||
Dalek
|
||||
Davros
|
||||
Donna Noble
|
||||
Jack Harkness
|
||||
Judoon
|
||||
K-9
|
||||
Martha Jones
|
||||
Master
|
||||
Mickey Smith
|
||||
Missy
|
||||
Ood
|
||||
River Song
|
||||
Rory Williams
|
||||
Rose Tyler
|
||||
Sontarans
|
||||
Tardis
|
||||
Time Lord
|
||||
The Doctor
|
||||
The Silence
|
||||
Weeping Angel
|
||||
Zygon
|
||||
97
Dictionary/dict_glee.txt
Normal file
97
Dictionary/dict_glee.txt
Normal file
@@ -0,0 +1,97 @@
|
||||
Glee Club
|
||||
New Directions
|
||||
Will Schuester
|
||||
Sue Sylvester
|
||||
Emma Pillsbury
|
||||
Terri Schuester
|
||||
Arthur Abrams
|
||||
Artie Abrams
|
||||
Tina Cohen-Chang
|
||||
Brittany Pierce
|
||||
Glease
|
||||
Finn Hudson
|
||||
Film School
|
||||
Lima
|
||||
Unique Adams
|
||||
Vocal Adrenaline
|
||||
Glee Club Regionals
|
||||
Jesse St. James
|
||||
Nationals
|
||||
William McKinley High School
|
||||
Rizzo
|
||||
Grease
|
||||
Ryder Lynn
|
||||
Mr. Shue
|
||||
Coach Shannon Beiste
|
||||
Blaine Devon Anderson
|
||||
Dalton Academy
|
||||
The Warblers
|
||||
Sectionals
|
||||
NYADA
|
||||
June Dolloway
|
||||
Dave Karofsky
|
||||
McKinley High Titans
|
||||
Principal Figgins
|
||||
Cooter Menkins
|
||||
Roz Washington
|
||||
Rachel Barbra Berry
|
||||
Jesse St. James
|
||||
Shelby Corcoran
|
||||
Cassandra July
|
||||
Brody Weston
|
||||
Funny Girl
|
||||
Michel Robert "Mike" Chang, Jr.
|
||||
Joffrey Ballet
|
||||
Asian Camp
|
||||
Sam Evans
|
||||
Lucy Quinn Fabray
|
||||
Cheerios
|
||||
Beth
|
||||
Skanks
|
||||
Finn Hudson
|
||||
Marley Rose
|
||||
Burt Hummel
|
||||
Mercedes Jones
|
||||
Santana Lopez
|
||||
Ryder Lynn
|
||||
Jake Puckerman
|
||||
Noah Puckerman
|
||||
Kitty Wilde
|
||||
Alistair
|
||||
Azimio
|
||||
Jacob Ben Israel
|
||||
Rory Flanagan
|
||||
Joe Hart
|
||||
Jane Hayward
|
||||
Becky Jackson
|
||||
Madison McCarthy
|
||||
Sugar Motta
|
||||
Myron Muskovitz
|
||||
Bob Harris
|
||||
Spencer Porter
|
||||
Roderick
|
||||
Matt Rutherford
|
||||
Lauren Zizes
|
||||
Jazz Ensemble
|
||||
Hank Saunders
|
||||
Suzy Pepper
|
||||
Shane Tinsley
|
||||
Rick "The Stick" Nelson
|
||||
Lillian Adler
|
||||
Holly Holliday
|
||||
Acafellas
|
||||
Sandy Ryerson
|
||||
Ken Tanaka
|
||||
Sunshine Corazón
|
||||
Dustin Goolsby
|
||||
Harmony
|
||||
Grace Hitchens
|
||||
Sebastian Smythe
|
||||
Kendra Giardi
|
||||
Carl Howell
|
||||
Carole Hudson
|
||||
Millie Rose
|
||||
April Rhodes
|
||||
Bryan Ryan
|
||||
|
||||
|
||||
59
Dictionary/dict_greys.anatomy.txt
Normal file
59
Dictionary/dict_greys.anatomy.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
Grey’s Anatomy
|
||||
Meredith Grey
|
||||
Lexie Grey
|
||||
Ellis Grey
|
||||
Thatcher Grey
|
||||
Derek Shepherd
|
||||
Amelia Shepherd
|
||||
Owen Hunt
|
||||
Dr. Margaret Pierce
|
||||
Dr. Teddy Altman
|
||||
Alex Karev
|
||||
Callie Torres
|
||||
Izzie Stevens
|
||||
Christina Yang
|
||||
Mark Sloan
|
||||
Jackson Avery
|
||||
Leah Murphy
|
||||
April Kepner
|
||||
Arizona Robbins
|
||||
George O'Malley
|
||||
Preston Bruke
|
||||
Miranda Bailey
|
||||
Denny Duquette
|
||||
Dr. Addison Montgomery
|
||||
Richard Webber
|
||||
Adele Webber
|
||||
Jo Wilson
|
||||
Andrew Deluca
|
||||
Nathan Riggs
|
||||
Erica Hahn
|
||||
Sadie Harris
|
||||
Stephanie Edwards
|
||||
Jason Myers
|
||||
Dr. Nicole Herman
|
||||
Hannah Davies
|
||||
Shane Ross
|
||||
Seattle Grace Hospital
|
||||
Mercy West Medical Center
|
||||
Seattle Grace Mercy West Hospital
|
||||
Denny Duquette Memorial Clinic
|
||||
Grey Sloan Memorial Hospital
|
||||
Mayo Clinic
|
||||
Cleveland Clinic
|
||||
Portland General Hospital
|
||||
Seattle Presbyterian Hospital
|
||||
Klausman Institute for Medical Research
|
||||
Roseridge Home for Extended Care
|
||||
Veterans Rehabilitation Center
|
||||
Trauma Center
|
||||
Emergency Room
|
||||
Intensive Care Unit
|
||||
Neonatal Intensive Care Unit
|
||||
Operating Room
|
||||
On-Call Room
|
||||
Chasing Cars
|
||||
Snow Patrol
|
||||
|
||||
|
||||
|
||||
42
Dictionary/dict_how_to_get_away_with_murder.txt
Normal file
42
Dictionary/dict_how_to_get_away_with_murder.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
Annalise Keating
|
||||
Anna Mae Harkness
|
||||
Nate Lahey
|
||||
Wes Gibbins
|
||||
Connor Walsh
|
||||
Michaela Pratt
|
||||
Asher Millstone
|
||||
Laurel Castillo
|
||||
Frank Delfino
|
||||
Bonnie Winterbottom
|
||||
Oliver Hampton
|
||||
Rebecca Sutter
|
||||
Sam Keating
|
||||
Caleb Hapstall
|
||||
Catherine Hapstall
|
||||
Emily Sinclair
|
||||
Meggy Travers
|
||||
Simon Drake
|
||||
Soraya Hargrove
|
||||
Phillip Jessup
|
||||
Eve Rothlow
|
||||
Lila Stangard
|
||||
Bill Millstone
|
||||
A.D.A. Rene Atwood
|
||||
Kan
|
||||
Griffin O'Reilly
|
||||
Rose
|
||||
Detective Mumford
|
||||
A.D.A. Todd Denver
|
||||
D.A. Wendy Parks
|
||||
Levi Sutter
|
||||
Wallace Mahoney
|
||||
Charles Mahoney
|
||||
Vince Levin
|
||||
Christophe
|
||||
Hannah Keating
|
||||
Middleton University
|
||||
Keating 5
|
||||
Who's Under the Sheet
|
||||
Keating House
|
||||
HTGAWM
|
||||
pro-bono law clinic
|
||||
11
Dictionary/dict_master_of_none.txt
Normal file
11
Dictionary/dict_master_of_none.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Dev
|
||||
Rachel
|
||||
Go-Gurt
|
||||
Arnold
|
||||
Brian
|
||||
Denise
|
||||
The Sickening
|
||||
Nina
|
||||
Nashville
|
||||
Paro
|
||||
Benjamin
|
||||
36
Dictionary/dict_mr_robot.txt
Normal file
36
Dictionary/dict_mr_robot.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
Elliot Alderson
|
||||
Mr. Robot
|
||||
Darlene
|
||||
Angela Moss
|
||||
Tyrell Wellick
|
||||
Joanna Wellick
|
||||
Phillip Price
|
||||
Federal Bureau of Investigation
|
||||
Fun Society
|
||||
Gideon Goddard
|
||||
Lloyd Chung
|
||||
Ollie Parker
|
||||
E Corp
|
||||
Evil Corp
|
||||
Terry Colby
|
||||
Scott Knowles
|
||||
Sharon Knowles
|
||||
Mr. Sutherland
|
||||
Antara Nayar
|
||||
Krista Gordon
|
||||
Shayla Nico
|
||||
Fernando Vera
|
||||
Elliot's Mother
|
||||
The Hackers
|
||||
fsociety
|
||||
Romero
|
||||
Trenton
|
||||
Mobley
|
||||
The Dark Army
|
||||
Whiterose
|
||||
Cisco
|
||||
New York
|
||||
Evil Corp Headquarters
|
||||
Allsafe Cybersecurity
|
||||
Ron’s Coffee
|
||||
Python
|
||||
11
Dictionary/dict_new_girl.txt
Normal file
11
Dictionary/dict_new_girl.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Jess
|
||||
Jessica Day
|
||||
Nick Miller
|
||||
Winston Bishop
|
||||
Schmidt
|
||||
Cece Parekh
|
||||
Coach
|
||||
Latvian Basketball League
|
||||
Ferguson
|
||||
True American
|
||||
Los Angeles middle school
|
||||
59
Dictionary/dict_sense8.txt
Normal file
59
Dictionary/dict_sense8.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
Sense8
|
||||
Abraham
|
||||
Amanita
|
||||
Amondi Kabaka
|
||||
Angelica Turing
|
||||
Anton Bogdanow
|
||||
Bug
|
||||
Capheus "Van Damme"
|
||||
Daniela Velasquez
|
||||
Daya Dandekar
|
||||
Diego Morales
|
||||
Dr. Metzger
|
||||
Felix Berner
|
||||
Githu
|
||||
Grace
|
||||
Gunnar
|
||||
Hassan Bogdanow
|
||||
Hernando
|
||||
Jacks
|
||||
Janet Marks
|
||||
Jela
|
||||
Joaquin Flores
|
||||
Jonas Maliki
|
||||
Joong-Ki Bak
|
||||
Kala Dandekar
|
||||
Kang-Dae Bak
|
||||
Wolfgang Bogdanow
|
||||
Lina
|
||||
Lito Rodriguez
|
||||
Lúna Magnúsdóttir
|
||||
Magnús Þórsson
|
||||
Manendra Rasal
|
||||
Mi-Cha
|
||||
Michael Gorski
|
||||
Min-Jung
|
||||
Mr. Whispers
|
||||
Niles Bolger
|
||||
Nomi Marks
|
||||
Nyx
|
||||
Prisoner 818
|
||||
Priya Dandekar
|
||||
Purab Kohli
|
||||
Rajan Rasal
|
||||
Riley Blue
|
||||
Sahana Rasal
|
||||
Sanyam Dandekar
|
||||
Sanyam Dendekar
|
||||
Sara Patrell
|
||||
Sergei Bogdanow
|
||||
Shiro
|
||||
Silas Kabaka
|
||||
Soo-Jin
|
||||
Steiner Bogdanow
|
||||
Sun Bak
|
||||
Sven
|
||||
Teagan Marks
|
||||
Will Gorski
|
||||
Yrsa
|
||||
Sensates
|
||||
37
Dictionary/dict_sherlock.txt
Normal file
37
Dictionary/dict_sherlock.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
Ajay
|
||||
Alex
|
||||
Anderson
|
||||
Baker Street
|
||||
Bill Wiggins
|
||||
Charles Augustus Magnussen
|
||||
Charlie Welsborough
|
||||
Detective Inspector Lestrade
|
||||
Gabriel
|
||||
Greg Lestrade
|
||||
Irene Adler
|
||||
James Moriarty
|
||||
Jim Moriarty
|
||||
John Watson
|
||||
John Hamish Watson
|
||||
Karim
|
||||
Lady Smallwood
|
||||
Lestrade
|
||||
Magnussen
|
||||
Margaret Thatcher
|
||||
Mary Morstan
|
||||
Mary Watson
|
||||
Mike Stamford
|
||||
Molly Hooper
|
||||
Moriarty
|
||||
Mrs. Hudson
|
||||
Mycroft Holmes
|
||||
Norbury
|
||||
Philip Anderson
|
||||
Rosamund Mary
|
||||
Rosie
|
||||
Sally Donovan
|
||||
Samarra
|
||||
Sergeant Donovan
|
||||
Sherlock Holmes
|
||||
Tbilisi
|
||||
Vivian Norbury
|
||||
42
Dictionary/dict_smash.txt
Normal file
42
Dictionary/dict_smash.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
Smash
|
||||
Julia Houston
|
||||
Derek Wills
|
||||
Karen Cartwright
|
||||
Tom Levitt
|
||||
Ivy Lynn
|
||||
Eileen Rand
|
||||
Jimmy Collins
|
||||
Sam Strickland
|
||||
Kyle Bishop
|
||||
Ana Vargas
|
||||
Ellis Boyd
|
||||
Dev Sundaram
|
||||
Frank Houston
|
||||
Lyle West
|
||||
Leigh Conroy
|
||||
Rebecca Duvall
|
||||
Veronica Moore
|
||||
Terrence Falls
|
||||
Linda
|
||||
Lisa McMann
|
||||
Roger Cartwright
|
||||
Mrs. Cartwright
|
||||
Jerry Rand
|
||||
Leo Houston
|
||||
Bobby
|
||||
Dennis
|
||||
Jessica
|
||||
Sue
|
||||
Nick Felder
|
||||
Michael Swift
|
||||
John Goodwin
|
||||
Daisy Parker
|
||||
R.J.
|
||||
Monica Swift
|
||||
Scott Nichols
|
||||
Margot
|
||||
Agnes
|
||||
Bombshell
|
||||
Hit List
|
||||
Heaven on Earth
|
||||
Liaisons
|
||||
41
Dictionary/dict_soul_eater.txt
Normal file
41
Dictionary/dict_soul_eater.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
Arachne
|
||||
Arachnophobia
|
||||
Asura
|
||||
Azusa
|
||||
Black Star
|
||||
Blair
|
||||
Crona
|
||||
Death City
|
||||
Death the Kid
|
||||
Death Weapon Meister Academy
|
||||
DWMA
|
||||
Eibon
|
||||
Eruka
|
||||
Excalibur
|
||||
Franken Stein
|
||||
Free
|
||||
Giriko
|
||||
Joe Buttataki
|
||||
Justin
|
||||
Kilik
|
||||
Kishin
|
||||
Liz
|
||||
Lord Death
|
||||
Maka
|
||||
Maka Albarn
|
||||
Marie
|
||||
Masamune
|
||||
Medusa
|
||||
Meister
|
||||
Mifune
|
||||
Mizune
|
||||
Mosquito
|
||||
Ox Ford
|
||||
Patty
|
||||
Professor Stein
|
||||
Sid
|
||||
Soul
|
||||
Soul Eater
|
||||
Spirit
|
||||
Tsubaki
|
||||
Weapon
|
||||
16
Dictionary/dict_steven_universe.txt
Normal file
16
Dictionary/dict_steven_universe.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Amethyst
|
||||
Beach City
|
||||
Cookie Cat
|
||||
Crying Breakfast Friends
|
||||
Crystal Gems
|
||||
Crystal Temple
|
||||
Earthlings
|
||||
Fryman
|
||||
Garnet
|
||||
Lion
|
||||
Pearl
|
||||
Peridot
|
||||
Rose Quartz
|
||||
Ruby
|
||||
Sapphire
|
||||
Steven Universe
|
||||
84
Dictionary/dict_stranger_things.txt
Normal file
84
Dictionary/dict_stranger_things.txt
Normal file
@@ -0,0 +1,84 @@
|
||||
Stranger Things
|
||||
Murray Bauman
|
||||
Becky Ives
|
||||
Benny Hammond
|
||||
Bill
|
||||
Billy
|
||||
Martin Brenner
|
||||
Jonathan Byers
|
||||
Joyce Byers
|
||||
Lonnie Byers
|
||||
Will Byers
|
||||
Callahan
|
||||
Carol
|
||||
Russell Coleman
|
||||
Connie Frazier
|
||||
Cynthia
|
||||
Dark dimension creature
|
||||
David O'Bannon
|
||||
Diane
|
||||
Donald Melvald
|
||||
Earl
|
||||
Eel-like creature
|
||||
Elevator Scientist
|
||||
Eleven
|
||||
El
|
||||
011
|
||||
The Weirdo
|
||||
Eleanor
|
||||
Florence
|
||||
Tommy H.
|
||||
Steve Harrington
|
||||
Dustin Henderson
|
||||
Barbara Holland
|
||||
Jim Hopper
|
||||
Sarah Hopper
|
||||
James
|
||||
Jeffrey
|
||||
Jen
|
||||
Jennifer Hayes
|
||||
Lead Agent
|
||||
Marissa
|
||||
Max
|
||||
The Monster
|
||||
Mrs. Holland
|
||||
Bob Newby
|
||||
Nicole
|
||||
Dr. Owens
|
||||
Pastor Charles
|
||||
Patrick
|
||||
Powell
|
||||
Roman
|
||||
Russian Agent
|
||||
Sandra
|
||||
Scott Clarke
|
||||
Shepard
|
||||
Lucas Sinclair
|
||||
Slug-like creature
|
||||
Terry Ives
|
||||
Troy
|
||||
Troy's mother
|
||||
Holly Wheeler
|
||||
Karen Wheeler
|
||||
Mike Wheeler
|
||||
Nancy Wheeler
|
||||
Ted Wheeler
|
||||
Demogorgon
|
||||
Hawkins National Laboratory
|
||||
Upside Down
|
||||
Hawkins Middle School
|
||||
Project MKUltra
|
||||
Dungeons & Dragons
|
||||
Operation Mirkwood
|
||||
Heathkit ham shack
|
||||
Castle Byers
|
||||
Hawkins General Hospital
|
||||
Hawkins Police Station
|
||||
Hawkins High School
|
||||
Quarry
|
||||
Etowah
|
||||
Benny's Burgers
|
||||
Bradley's Big Buy
|
||||
Byers house
|
||||
Downtown Hawkins
|
||||
Roane County Coroner
|
||||
30
Dictionary/dict_the.big.bang.theory.txt
Normal file
30
Dictionary/dict_the.big.bang.theory.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
The Big Bang Theory
|
||||
Penny
|
||||
Leonard Hofstadter
|
||||
Sheldon Cooper
|
||||
Raj Koothrappali
|
||||
Bernadette Rostenkowski
|
||||
Howard Wolowitz
|
||||
Amy Farrah Fowler
|
||||
Leslie Winkle
|
||||
Stuart Bloom
|
||||
Arthur Jeffries
|
||||
Mrs. Wolowitz
|
||||
Barry Kripke
|
||||
Priya Koothrappali
|
||||
Mrs. Koothrappali
|
||||
Mr. Koothrappali
|
||||
Lucy
|
||||
Sheldon’s Spot
|
||||
The Apartment Building
|
||||
Apartment 4A/B
|
||||
The Laundry Room
|
||||
The Roof
|
||||
Wolowitzs' House
|
||||
Capitol Comics
|
||||
The Cheesecake Factory
|
||||
The Comic Center of Pasadena
|
||||
California Institute of Technology
|
||||
Massachusetts Institute of Technology
|
||||
Jet Propulsion Laboratory
|
||||
Pasadena
|
||||
23
Dictionary/dict_the_it_crowd.txt
Normal file
23
Dictionary/dict_the_it_crowd.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
Arsenal Football Club
|
||||
Aunt Irma
|
||||
Big Ben
|
||||
Countdown
|
||||
Dragon's Den
|
||||
Emergency Services
|
||||
Employee of the Month
|
||||
Friendface
|
||||
Gay: A Gay Musical
|
||||
Information Technology
|
||||
Jen Barber
|
||||
Lonely Hearts
|
||||
Maurice Moss
|
||||
Random Access Memory
|
||||
Sea Parks
|
||||
Spaceology
|
||||
The Banner
|
||||
The Evening Informer
|
||||
The Internet
|
||||
The London Echo
|
||||
Tnetennba
|
||||
Windows Vista
|
||||
Word
|
||||
37
Dictionary/dict_white_collar.txt
Normal file
37
Dictionary/dict_white_collar.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
Neal Caffrey
|
||||
Mozzie
|
||||
Peter Burke
|
||||
Sara Ellis
|
||||
Elizabeth Burke
|
||||
Diana Berrigan
|
||||
Lauren Cruz
|
||||
Clinton Jones
|
||||
Kate Moreau
|
||||
Garrett Fowler
|
||||
Alex Hunter
|
||||
Vincent Adler
|
||||
Special Agent
|
||||
White Collar Division
|
||||
June Ellington
|
||||
Reese Hughes
|
||||
Matthew Keller
|
||||
Rebecca Lowe
|
||||
Rachel Turner
|
||||
Cindy
|
||||
Christie
|
||||
Senator Terrence Pratt
|
||||
Amanda Callaway
|
||||
David Siegel
|
||||
Operation Mentor
|
||||
Office of Professional Responsibility
|
||||
Samantha
|
||||
Sterling-Bosch
|
||||
Kali
|
||||
Teddy Winters
|
||||
Detroit Mob
|
||||
Burke's Seven
|
||||
Mrs. Suit
|
||||
Special Agent in Charge
|
||||
Satchmo
|
||||
Dutchman
|
||||
|
||||
@@ -4,7 +4,7 @@ MAINTAINER = Marc Espie <espie@openbsd.org>
|
||||
CATEGORIES = multimedia
|
||||
COMMENT = closed caption subtitles extractor
|
||||
HOMEPAGE = http://ccextractor.sourceforge.net/
|
||||
V = 0.70
|
||||
V = 0.77
|
||||
DISTFILES = ccextractor.${V:S/.//}-src.zip
|
||||
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=ccextractor/}
|
||||
DISTNAME = ccextractor-$V
|
||||
|
||||
83
README.md
83
README.md
@@ -1,21 +1,68 @@
|
||||
ccextractor
|
||||
===========
|
||||

|
||||
|
||||
# CCExtractor
|
||||
|
||||
CCExtractor - Carlos' version (mainstream).
|
||||
CCExtractor is a tool that produces subtitles from TV use. Global accessibility (all users, all content, all countries) is the goal. With so many different formats, this is a constantly moving target, but we intend to keep up with all sources and formats.
|
||||
|
||||
0.70 - GSOC
|
||||
-----------
|
||||
This is the first release that is part of Google's Summer of Code.
|
||||
Anshul, Ruslan and Willem joined CCExtractor to work on a number of things
|
||||
over the summer, and their work is already reaching the mainstream
|
||||
version of CCExtractor.
|
||||
Carlos' version (mainstream) is the most stable branch.
|
||||
|
||||
- Added a huge dictionary submitted by Matt Stockard.
|
||||
- Added DVB subtitles decoder, spupng in output
|
||||
- Added support for cdt2 media atoms in QT video files. Now multiple atoms in
|
||||
a single sample sequence are supported.
|
||||
- Changed Makefile.
|
||||
- Fixed some bugs.
|
||||
- Added feature to print info about file's subtitles and streams.
|
||||
- Support Long PMT.
|
||||
- Support Configuration file.
|
||||
## Installation and Usage
|
||||
|
||||
Downloads for precompiled binaries and source code can be found [on our website](http://www.ccextractor.org/doku.php?id=public:general:downloads).
|
||||
|
||||
Extracting subtitles is relatively simple. Just run the following command:
|
||||
|
||||
```ccextractor <input>```
|
||||
|
||||
This will extract the subtitles.
|
||||
|
||||
More usage information can be found on our website:
|
||||
|
||||
- [Using the command line tool](http://www.ccextractor.org/doku.php?id=public:general:command_line_usage)
|
||||
- [Using the Windows GUI](http://www.ccextractor.org/doku.php?id=public:general:win_gui_usage)
|
||||
|
||||
|
||||
## Compiling
|
||||
|
||||
### Debian/Ubuntu
|
||||
|
||||
Install these packages in the terminal
|
||||
|
||||
sudo apt-get install -y gcc
|
||||
sudo apt-get install -y libcurl4-gnutls-dev
|
||||
sudo apt-get install -y tesseract-ocr
|
||||
sudo apt-get install -y tesseract-ocr-dev
|
||||
sudo apt-get install -y libleptonica-dev
|
||||
Then run script linux/build or linux/builddebug.
|
||||
|
||||
### Windows
|
||||
|
||||
Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it. Configurations "(Debug|Release)-Full" includes dependent libraries which are used for OCR.
|
||||
|
||||
## Support
|
||||
|
||||
By far the best way to get support is by opening a support ticket at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
|
||||
|
||||
When creating a ticket:
|
||||
|
||||
- Make sure you are using the latest CCExtractor version.
|
||||
- If it's a new issue (for example a video file that a previous CCExtractor version processed fine but now causes a crash), mention the last version you know was working.
|
||||
- If the issue is about a specific file, make that file available for us. Don't just send us the output from CCExtractor, as we can't do anything about a screenshot that shows a crash. We need the input that actually causes it. You can upload the file to Dropbox, Google Drive, etc, and make it public so you get a download link to add to your ticket.
|
||||
- If you cannot make the file public for any (reasonable) reason you can send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository.
|
||||
- Do not upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc.
|
||||
- If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it.
|
||||
- Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
|
||||
- Please use English.
|
||||
- It goes without saying, we like polite people.
|
||||
|
||||
You can also [contact us by email or chat with the team in Slack](http://www.ccextractor.org/doku.php?id=public:general:support).
|
||||
|
||||
## Contributing
|
||||
|
||||
You can contribute to the project by forking it, modifying the code, and making a pull request to the repository.
|
||||
|
||||
## News & Other Information
|
||||
|
||||
News about releases and modifications to the code can be found in the `CHANGES.TXT` file.
|
||||
|
||||
For more information visit the CCExtractor website: [http://www.ccextractor.org](http://www.ccextractor.org)
|
||||
|
||||
16
Vagrantfile
vendored
Normal file
16
Vagrantfile
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "ubuntu/xenial64"
|
||||
|
||||
# Uncomment this line if you want to sync other folders
|
||||
# config.vm.synced_folder "/home/user/video", "/video"
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
sudo apt-get install -y gcc
|
||||
sudo apt-get install -y libcurl4-gnutls-dev
|
||||
sudo apt-get install -y tesseract-ocr
|
||||
sudo apt-get install -y tesseract-ocr-dev
|
||||
sudo apt-get install -y libleptonica-dev
|
||||
SHELL
|
||||
|
||||
end
|
||||
|
||||
@@ -28,4 +28,17 @@ To do:
|
||||
CCExtractor fully support Asian languages. I do need samples
|
||||
though. No samples, no support.
|
||||
- A few commands are not yet supported, specifically those related
|
||||
to delay.
|
||||
to delay.
|
||||
- Detect and extract captions from MP4 (MOV) files, handled by gpacmp4
|
||||
|
||||
Done (18.08.2015):
|
||||
|
||||
- Major refactoring
|
||||
- Librarized as much as possible (global vars moved to dtvcc context)
|
||||
- Added some control commands support
|
||||
- 16 bit charset support added (not "moved everything to 16-bit", but they could be successfully exported)
|
||||
- SAMI output added
|
||||
- Transcript output added
|
||||
- Timed transcript output added
|
||||
- Added colour support (only one colour/style can be applied for the whole screen at the moment)
|
||||
- Roll up captions handling
|
||||
|
||||
451
docs/CHANGES.TXT
451
docs/CHANGES.TXT
@@ -1,5 +1,206 @@
|
||||
0.70 - GSOC
|
||||
-----------
|
||||
0.85b (2017-1-26)
|
||||
-----------------
|
||||
- Fix: Base Windows binary (without OCR) compiled without DLL dependencies.
|
||||
|
||||
0.85 (2017-01-23)
|
||||
-----------------
|
||||
- New: Added FFMPEG 3.0 to Windows build - last one that is XP compatible.
|
||||
- New: Major improvements in CEA-608 to WebVTT (styles, etc).
|
||||
- New: Return a non-zero return code if no subtitles are found.
|
||||
- New: Windows build files updated to Visual Studio 2015, new target platform is 140_xp.
|
||||
- New: Added basic support of Tesseract 4.0.0.
|
||||
- New: Added build script for .deb.
|
||||
- New: Updated -debugdvbsub parameter to get the most relevant DVB traces for debugging.
|
||||
- New: SMPTE-TT files are now compatible with Adobe Premiere.
|
||||
- New: Updated libpng.
|
||||
- New: Added 3rd party (Tracy from archive.org) static linux build script.
|
||||
- New: Add chapter extraction for MP4 files.
|
||||
- New: Return code 10 if no captions are found at all.
|
||||
- Fix: Teletext duplicate lines in certain cases.
|
||||
- Fix: Improved teletext timing.
|
||||
- Fix: DVB timing is finally good.
|
||||
- Fix: A few minor memory leaks.
|
||||
- Fix: tesseract library file included in mac build command.
|
||||
- Fix: Bad WTV timings in some cases.
|
||||
- Fix: Mac build script.
|
||||
- Fix: Memory optimization in HARDSUBX edit_distance.
|
||||
- Fix: SubStation Alpha subtitles in bitmap.
|
||||
- Fix: lept msg severity in linux.
|
||||
- Fix: SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML.
|
||||
- Fix: SMPTE-TT : Added support for font color.
|
||||
- Fix: SAMI unnecessary empty subtitle when extracting DVB subs.
|
||||
- Fix: Skip the packet if the adaptation field length is broken.
|
||||
- Fix: 708 - lots of work done in the decoder. Implementation of more commands. Better timing.
|
||||
|
||||
|
||||
|
||||
0.84 (2016-12-16)
|
||||
-----------------
|
||||
- New: In Windows, both with and without-OCR binaries are bundled, since the OCR one causes problems due to
|
||||
dependencies in some system. So unless you need the OCR just use the non-OCR version.
|
||||
- New: Added -sbs (sentence by sentence) for DVB output. Each frame in the output file contains a complete
|
||||
sentence (experimental).
|
||||
- New: Added -curlposturl. If used each output frame will be sent with libcurl by doing a POST to that URL.
|
||||
- Fix: More code consistency checking in function names.
|
||||
- Fix: linux build script now tries to verify dependencies.
|
||||
- Fix: Mac build script was missing a directory.
|
||||
|
||||
|
||||
0.83 (2016-12-13)
|
||||
-----------------
|
||||
- Fix: Duplicate lines in mp4 (specifically affects itunes).
|
||||
- Fix: Timing in .mp4, timing now calculated for each CC pair instead of per atom.
|
||||
- Fix: Typos everywhere in the documentation and source code.
|
||||
- Fix: CMakeLists for build in cmake.
|
||||
- Fix: -unixts option.
|
||||
- Fix: FPS switching messages.
|
||||
- Fix: Removed ugly debug statement with local path in HardsubX.
|
||||
- Fix: Changed platform target to v120_xp in Visual Studio (so XP is supported again).
|
||||
- Fix: Added detail in many error messages.
|
||||
- Fix: Memory leaks in videos with XDS.
|
||||
- Fix: Makefile compatibility issues with Raspberry pi.
|
||||
- Fix: missing separation between WebVTT header and body.
|
||||
- Fix: Stupid bug in M2TS that preventing it from working.
|
||||
- Fix: OCR libraries dependencies for the release version in Windows.
|
||||
- Fix: non-buffered reading from pipes.
|
||||
- Fix: --stream option with stdin.
|
||||
- New: terminate_asap to buffered_read_opt
|
||||
- New: Added some TV-show specific spelling dictionaries.
|
||||
- New: Updated GPAC library.
|
||||
- New: ASS/SSA.
|
||||
- New: Capture sigterm to do some clean up before terminating.
|
||||
- New: Work on 708: Changed DefineWindow behavior, only clear text of an existing window is style has changed.
|
||||
|
||||
0.82 (2016-08-15)
|
||||
-----------------
|
||||
- New: HardsubX - Burned in subtitle extraction subsystem.
|
||||
- New: Color Detection in DVB Subtitles
|
||||
- Fix: Corrected sentence capitalization
|
||||
- Fix: Skipping redundant bytes at the end of tx3g atom in MP4
|
||||
- Fix: Illegal SRT files being created from DVB subtitles
|
||||
- Fix: Incorrect Progress Display
|
||||
|
||||
0.81 (2016-06-13)
|
||||
-----------------
|
||||
- New: --version parameter for extensive version information (version number, compile date, executable hash, git commit (if appropriate))
|
||||
- New: Add -sem (semaphore) to create a .sem file when an output file is open and delete it when it's closed.
|
||||
- New: Add --append parameter. This will prevent overwriting of existing files.
|
||||
- New: File Rotation support added. The user has to send a USR1 signal to rotate.
|
||||
- Fix: Issues with files <1 Mb
|
||||
- Fix: Preview of generated transcript.
|
||||
- Fix: Statistics were not generated anymore.
|
||||
- Fix: Correcting display of sub mode and info in transcripts.
|
||||
- Fix: Teletext page number displayed in -UCLA.
|
||||
- Fix: Removal of excessive XDS notices about aspect ratio info.
|
||||
- Fix: Force Flushing of file buffers works for all files now.
|
||||
- Fix: mp4 void atoms that was causing some .mp4 files to fail.
|
||||
- Fix: Memory usage caused by EPG processing was high due to many non-dynamic buffers.
|
||||
- Fix: Project files for Visual Studio now include OCR support in Windows.
|
||||
|
||||
0.80 (2016-04-24)
|
||||
-----------------
|
||||
- Fix: "Premature end of file" (one of the scenarios)
|
||||
- Fix: XDS data is always parsed again (needed to extract information such as program name)
|
||||
- Fix: Teletext parsing: @ was incorrectly exported as * - X/26 packet specifications in ETS 300 706 v1.2.1 now better followed
|
||||
- Fix: Teletext parsing: Latin G2 subsets and accented characters not displaying properly
|
||||
- Fix: Timing in -ucla
|
||||
- Fix: Timing in ISDB (some instances)
|
||||
- Fix: "mfra" mp4 box weight changed to 1 (this helps with correct file format detection)
|
||||
- Fix: Fix for TARGET File is null.
|
||||
- Fix: Fixed SegFaults while parsing parameters (if mandatory parameter is not present in -outinterval, -codec or -nocodec)
|
||||
- Fix: Crash when input small is too small
|
||||
- Fix: Update some URLs in code (references to docs)
|
||||
- Fix: -delay now updates final timestamp in ISDB, too
|
||||
- Fix: Removed minor compiler warnings
|
||||
- Fix: Visual Studio solution files working again
|
||||
- Fix: ffmpeg integration working again
|
||||
- New: Added --forceflush (-ff). If used, output file descriptors will be flushed immediately after being written to
|
||||
- New: Hexdump XDS packets that we cannot parse (shouldn't be many of those anyway)
|
||||
- New: If input file cannot be open, provide a decent human readable explanation
|
||||
- New: GXF support
|
||||
|
||||
0.79 (2016-01-09)
|
||||
-----------------
|
||||
- Support for Grid Format (g608)
|
||||
- Show Correct number of teletext packet processed
|
||||
- Removed Segfault on incorrect mp4 detection
|
||||
- Remove xml header from transcript format
|
||||
- Help message updated for Teletext
|
||||
- Added --help and -h for help message
|
||||
- Added --nohtmlescape option
|
||||
- Added --noscte20 option
|
||||
|
||||
0.78 (2015-12-12)
|
||||
-----------------
|
||||
- Support to extract Closed Caption from MultiProgram at once.
|
||||
- CEA-708: exporting to SAMI (.smi), Transcript (.txt), Timed Transcript (ttxt) and SubRip (.srt).
|
||||
- CEA-708: 16 bit charset support (tested on Korean).
|
||||
- CEA-708: Roll Up captions handling.
|
||||
- Changed TCP connection protocol (BIN data is now wrapped in packets, added EPG support and keep-alive packets).
|
||||
- TCP connection password prompt is removed. To set connection password use -tcppassword argument instead.
|
||||
- Support ISDB Closed Caption.
|
||||
- Added a new output format, simplexml (used internally by a CCExtractor user, may or may not be useful for
|
||||
anyone else).
|
||||
|
||||
0.77 (2015-06-20)
|
||||
-----------------
|
||||
- Fixed bug in capitalization code ('I' was not being capitalized).
|
||||
- GUI should now run in Windows 8 (using the include .Net runtime, since
|
||||
3.5 cannot be installed in Windows 8 apparently).
|
||||
- Fixed Mac build script, binary is now compiled with support for
|
||||
files over 2 GB.
|
||||
- Fixed bug in PMT code, damaged PMT sections could make CCExtractor
|
||||
crash.
|
||||
|
||||
0.76 (2015-03-28)
|
||||
-----------------
|
||||
- Added basic M2TS support
|
||||
- Added EPG support - you can now export the Program Guide to XML
|
||||
- Some bug fixes
|
||||
|
||||
0.75 (2015-01-15)
|
||||
-----------------
|
||||
- Fixed issue with teletext to other then srt.
|
||||
- CCExtractor can be used as library if compiled using cmake
|
||||
- By default the Windows version adds BOM to generated UTF files (this is
|
||||
because it's needed to open the files correctly) while all other
|
||||
builds don't add it (because it messes with text processing tools).
|
||||
You can use -bom and -nobom to change the behaviour.
|
||||
|
||||
0.74 (2014-09-24)
|
||||
-----------------
|
||||
- Fixed issue with -o1 -o2 and -12 parameters (where it would write output only in the o2 file)
|
||||
- Fixed UCLA parameter issue. Now the UCLA parameter settings can't be overwritten anymore by later parameters that affect the custom transcript
|
||||
- Switched order around for TLT and TT page number in custom transcript to match UCLA settings
|
||||
- Added nobom parameter, for when files are processed by tools that can't handle the BOM. If using this, files might be not readable under windows.
|
||||
- Segfault fix when no input files were given
|
||||
- No more bin output when sending to server + possibility to send TT to server for processing
|
||||
- Windows: Added the Microsoft redistributable MSVCR120.DLL to both the installation package and the application zip.
|
||||
|
||||
0.73 - GSOC (2014-08-19)
|
||||
------------------------
|
||||
- Added support of BIN format for Teletext
|
||||
- Added start of librarization. This will allow in the future for other programs to use encoder/decoder functions and more.
|
||||
|
||||
0.72 - GSOC (2014-08-12)
|
||||
------------------------
|
||||
- Fix for WTV files with incorrect timing
|
||||
- Added support for fps change using data from AVC video track in a H264 TS file.
|
||||
- Added FFMpeg Support to enable all encapsulator and decoder provided by ffmpeg
|
||||
|
||||
0.71 - GSOC (2014-07-31)
|
||||
------------------------
|
||||
- Added feature to receive captions in BIN format according to CCExtractor's own
|
||||
protocol over TCP (-tcp port [-tcppassword password])
|
||||
- Added ability to send captions to the server described above or to the
|
||||
online repository (-sendto host[:port])
|
||||
- Added -stdin parameter for reading input stream from standard input
|
||||
- Compilation in Cygwin using linux/Makefile
|
||||
- Fix for .bin files when not using latin1 charset
|
||||
- Correction of mp4 timing, when one timestamp points timing of two atom
|
||||
|
||||
0.70 - GSOC (2014-07-06)
|
||||
------------------------
|
||||
This is the first release that is part of Google's Summer of Code.
|
||||
Anshul, Ruslan and Willem joined CCExtractor to work on a number of things
|
||||
over the summer, and their work is already reaching the mainstream
|
||||
@@ -28,7 +229,7 @@ version of CCExtractor.
|
||||
- Display end time
|
||||
- Display caption mode
|
||||
- Display caption channel
|
||||
- Use a relative timestamp ( relative to the sample)
|
||||
- Use a relative timestamp (relative to the sample)
|
||||
- Display XDS info
|
||||
- Use colors
|
||||
Examples:
|
||||
@@ -37,9 +238,10 @@ version of CCExtractor.
|
||||
1111001 is the default setting for -ucla
|
||||
Make sure you use this parameter after others that might affect these
|
||||
settings (-out, -ucla, -xds, -txt, -ttxt, ...)
|
||||
- Fixed Negative timing Bug
|
||||
|
||||
0.69
|
||||
----
|
||||
0.69 (2014-04-05)
|
||||
-----------------
|
||||
- A few patches from Christopher Small, including proper support
|
||||
for multiple multicast clients listening on the same port.
|
||||
- GUI: Fixed teletext preview.
|
||||
@@ -58,8 +260,8 @@ version of CCExtractor.
|
||||
- Windows GUI: Some code refactoring, since the HDHomeRun support makes
|
||||
the code larger enough to require more than one source file :-)
|
||||
|
||||
0.68
|
||||
----
|
||||
0.68 (2013-12-24)
|
||||
-----------------
|
||||
- A couple of shared variables between 608 decoders were causing
|
||||
problems when both fields were processed at the same time with
|
||||
-12, fixed.
|
||||
@@ -73,14 +275,14 @@ version of CCExtractor.
|
||||
(Heleen Buus).
|
||||
- Some fixes (Chris Small).
|
||||
|
||||
0.67
|
||||
----
|
||||
0.67 (2013-10-09)
|
||||
-----------------
|
||||
- Padding bytes were being discarded early in the process in 0.66,
|
||||
which is convenient for debugging, but it messes with timing in
|
||||
.raw, which depends on padding. Fixed.
|
||||
- MythTV's branch had a fixed size buffer that could not be enough
|
||||
some times. Made dynamic.
|
||||
- Better support for PAT changing mid stream.
|
||||
- Better support for PAT changing mid-stream.
|
||||
- Removed quotes in Start in .smi (format fix).
|
||||
- Added multicast support (Chris Small)
|
||||
- Added ability to select IP address to bind in UDP (Chris Small)
|
||||
@@ -94,8 +296,8 @@ version of CCExtractor.
|
||||
roll-up mode.
|
||||
|
||||
|
||||
0.66
|
||||
----
|
||||
0.66 (2013-07-01)
|
||||
-----------------
|
||||
- Fixed bug in auto detection code that triggered a message
|
||||
about file being auto of sync.
|
||||
- Added -investigate_packets
|
||||
@@ -110,10 +312,10 @@ version of CCExtractor.
|
||||
their PMT entry.
|
||||
- Added -datastreamtype to manually selecting a stream based on
|
||||
its type instead of its PID. Useful if your recording program
|
||||
always hides the caption under the stream stream type.
|
||||
always hides the caption under the stream type.
|
||||
- Added -streamtype so if an elementary stream is selected manually
|
||||
for processing the streamtype can be selected too. This can be
|
||||
needed if you process for example a stream that is declared as
|
||||
for processing, the streamtype can be selected too. This can be
|
||||
needed if you process, for example a stream that is declared as
|
||||
"private MPEG" in the PMT, so CCExtractor can't tell what it is.
|
||||
Usually you'll want -streamtype 2 (MPEG video) or -streamtype 6
|
||||
(MPEG private data).
|
||||
@@ -122,10 +324,10 @@ version of CCExtractor.
|
||||
- Fixes in roll-up, cursor was being moved to column 1 if a
|
||||
RU2, RU3 or RU4 was received even if already in roll-up mode.
|
||||
- Added -autoprogram. If a multiprogram TS is processed and
|
||||
-autoprogram is used CCExtractor will analyze all PMTs and use
|
||||
-autoprogram is used, CCExtractor will analyze all PMTs and use
|
||||
the first program that has a suitable data stream.
|
||||
- Timed transcript (ttxt) now also exports the caption mode
|
||||
(roll-up, paint-on, etc) next to each line, as it's useful to
|
||||
(roll-up, paint-on, etc.) next to each line, as it's useful to
|
||||
detect things like commercials.
|
||||
- Content Advisory information from XDS is now decoded if it's
|
||||
transmitted in "US TV parental guidelines" or "MPA".
|
||||
@@ -173,8 +375,8 @@ version of CCExtractor.
|
||||
- Added -noautotimeref: Prevent UTC reference from being auto set from
|
||||
the stream data.
|
||||
|
||||
0.65
|
||||
----
|
||||
0.65 (2013-03-14)
|
||||
-----------------
|
||||
- Minor GUI changes for teletext
|
||||
- Added end timestamps in timed transcripts
|
||||
- Added support for SMPTE (patch by John Kemp)
|
||||
@@ -192,8 +394,8 @@ version of CCExtractor.
|
||||
display their contents (-parsePAT and -parsePMT) which makes
|
||||
troubleshooting easier.
|
||||
|
||||
0.64
|
||||
----
|
||||
0.64 (2012-10-29)
|
||||
-----------------
|
||||
- Changed Window GUI size (larger).
|
||||
- Added Teletext options to GUI.
|
||||
- Added -teletext to force teletext mode even if not detected
|
||||
@@ -213,8 +415,8 @@ version of CCExtractor.
|
||||
- Added --nogoptime to force PTS timing even when CCExtractor would
|
||||
use GOP timing otherwise.
|
||||
|
||||
0.63
|
||||
----
|
||||
0.63 (2012-08-17)
|
||||
-----------------
|
||||
- Telext support added, by integrating Petr Kutalek's telxcc. Integration is
|
||||
still quite basic (there's equivalent code from both CCExtractor and
|
||||
telxcc) and some clean up is needed, but it works. Petr has announced that
|
||||
@@ -222,8 +424,8 @@ version of CCExtractor.
|
||||
CCExtractor.
|
||||
- Some bug fixes, as usual.
|
||||
|
||||
0.62
|
||||
----
|
||||
0.62 (2012-05-23)
|
||||
-----------------
|
||||
- Corrected Mac build "script" (needed to add GPAC includes). Thanks to the
|
||||
Mac users that sent this.
|
||||
- Hauppauge mode now uses PES timing, needed for files that don't have
|
||||
@@ -245,8 +447,8 @@ version of CCExtractor.
|
||||
or certain samples (we had none like this in our test collection). Thanks,
|
||||
Rajesh.
|
||||
|
||||
0.61
|
||||
----
|
||||
0.61 (2012-03-08)
|
||||
-----------------
|
||||
- Fix: GCC 3.4.4 can now build CCExtractor.
|
||||
- Fix: Damaged TS packets (those that come with 'error in transport' bit
|
||||
on) are now skipped.
|
||||
@@ -256,8 +458,8 @@ version of CCExtractor.
|
||||
anything but please report).
|
||||
- Some non-interesting cleanup.
|
||||
|
||||
0.60
|
||||
----
|
||||
0.60 (unreleased)
|
||||
-----------------
|
||||
- Add: MP4 support, using GPAC (a media library). Integration is currently
|
||||
"enough so it works", but needs some more work. There's some duplicate
|
||||
code, the stream must be a file (no streaming), etc.
|
||||
@@ -267,8 +469,8 @@ version of CCExtractor.
|
||||
roll-up) was broken, with complete lines being missing.
|
||||
- Fix: bin format not working as input.
|
||||
|
||||
0.59
|
||||
----
|
||||
0.59 (2011-10-07)
|
||||
-----------------
|
||||
- More AVC/H.264 work. pic_order_cnt_type != 0 will be processed now.
|
||||
- Fix: Roll-up captions with interruptions for Text (with ResumeTextDisplay
|
||||
in the middle of the caption data) were missing complete lines.
|
||||
@@ -296,8 +498,8 @@ version of CCExtractor.
|
||||
- Some code clean up, minor refactoring.
|
||||
- Teletext detection (not yet processing).
|
||||
|
||||
0.58
|
||||
----
|
||||
0.58 (2011-08-21)
|
||||
-----------------
|
||||
- Implemented new PTS based mode to order the caption information
|
||||
of AVC/H.264 data streams. The old pic_order_cnt_lsb based method
|
||||
is still available via the -poc or --usepicorder command switches.
|
||||
@@ -321,18 +523,18 @@ version of CCExtractor.
|
||||
output are processed OK.
|
||||
- Updated Windows GUI.
|
||||
|
||||
0.57
|
||||
----
|
||||
- Bugfixes in the Windows version. Some debug code was unintentionally
|
||||
0.57 (2010-12-16)
|
||||
-----------------
|
||||
- Bug fixes in the Windows version. Some debug code was unintentionally
|
||||
left in the released version.
|
||||
|
||||
0.56
|
||||
----
|
||||
0.56 (2010-12-09)
|
||||
-----------------
|
||||
- H264 support
|
||||
- Other minor changes a lot less important
|
||||
|
||||
0.55
|
||||
----
|
||||
0.55 (2009-08-09)
|
||||
-----------------
|
||||
- Replace pattern matching code with improved parser for MPEG-2 elementary
|
||||
streams.
|
||||
- Fix parsing of ReplayTV 5000 captions.
|
||||
@@ -347,11 +549,11 @@ version of CCExtractor.
|
||||
because of the odd number of fields. I used top_field_first to tell when the channels
|
||||
are reversed. See Table 6-1 of the SCTE 20 [Paul Fernquist]
|
||||
|
||||
0.54
|
||||
----
|
||||
0.54 (2009-04-16)
|
||||
-----------------
|
||||
- Add -nosync and -fullbin switches for debugging purposes.
|
||||
- Remove -lg (--largegops) switch.
|
||||
- Improve syncronization of captions for source files with
|
||||
- Improve synchronization of captions for source files with
|
||||
jumps in their time information or gaps in the caption
|
||||
information.
|
||||
- [R. Abarca] Changed Mac script, it now compiles/link
|
||||
@@ -361,8 +563,8 @@ version of CCExtractor.
|
||||
- Added a feature to add start and end messages (for credits).
|
||||
See help screen for details.
|
||||
|
||||
0.53
|
||||
----
|
||||
0.53 (2009-02-24)
|
||||
-----------------
|
||||
- Force generated RCWT files to have the same length as source file.
|
||||
- Fix documentation for -startat / -endat switches.
|
||||
- Make -startat / -endat work with all output formats.
|
||||
@@ -388,17 +590,17 @@ version of CCExtractor.
|
||||
it (there's not .NET 3.5 for Windows 2000), as
|
||||
requested by a couple of key users.
|
||||
|
||||
0.51
|
||||
----
|
||||
0.51 (unreleased)
|
||||
-----------------
|
||||
- Removed -autopad and -goppad, no longer needed.
|
||||
- In preparation to a new binary format we have
|
||||
renamed the current .bin to .raw. Raw files
|
||||
have only CC data (with no header, timing, etc).
|
||||
have only CC data (with no header, timing, etc.).
|
||||
- The input file format (when forced) is now
|
||||
specified with
|
||||
-in=format
|
||||
such as -in=ts, -in=raw, -in=ps ...
|
||||
The old switches (-ts, -ps, etc) still work.
|
||||
The old switches (-ts, -ps, etc.) still work.
|
||||
The only exception is -bin which has been removed
|
||||
(reserved for the new binary format). Use
|
||||
-in=raw to process a raw file.
|
||||
@@ -414,14 +616,14 @@ version of CCExtractor.
|
||||
too.
|
||||
- [Volker] Dish Network clean-up
|
||||
|
||||
0.50
|
||||
----
|
||||
0.50 (2008-12-12)
|
||||
-----------------
|
||||
- [Volker] Fix in DVR-MS NTSC timing
|
||||
- [Volker] More clean-up
|
||||
- Minor fixes
|
||||
|
||||
0.49
|
||||
----
|
||||
0.49 (2008-12-10)
|
||||
-----------------
|
||||
- [Volker] Major MPEG parser rework. Code much
|
||||
cleaner now.
|
||||
- Some stations transmit broken roll-up captions,
|
||||
@@ -436,11 +638,11 @@ version of CCExtractor.
|
||||
is broken please let me know.
|
||||
- Added new debug options.
|
||||
- [Volker] Added support for DVR-MS NTSC files.
|
||||
- Other minor bugfixes and changes.
|
||||
- Other minor bug fixes and changes.
|
||||
|
||||
0.46
|
||||
----
|
||||
- Added support for live streaming, ccextractor
|
||||
0.46 (2008-11-24)
|
||||
-----------------
|
||||
- Added support for live streaming, CCExtractor
|
||||
can now process files that are being recorded
|
||||
at the same time.
|
||||
|
||||
@@ -452,14 +654,13 @@ version of CCExtractor.
|
||||
Note: For now, it's only ATSC recordings, not
|
||||
NTSC (analog) recordings.
|
||||
|
||||
|
||||
0.45
|
||||
----
|
||||
- Added autodetection of DVR-MS files.
|
||||
0.45 (2008-11-14)
|
||||
-----------------
|
||||
- Added auto-detection of DVR-MS files.
|
||||
- Added -asf to force DVR-MS mode.
|
||||
- Added some specific support for DVR-MS
|
||||
files. These format used to work
|
||||
correcty in 0.34 (pure luck) but the
|
||||
correctly in 0.34 (pure luck) but the
|
||||
MPEG code rework broke it. It should
|
||||
work as it used to.
|
||||
- Updated Windows GUI to support the
|
||||
@@ -474,8 +675,8 @@ version of CCExtractor.
|
||||
need ccextractor to use GOP timing in large
|
||||
GOPs.
|
||||
|
||||
0.44
|
||||
----
|
||||
0.44 (2008-09-10)
|
||||
-----------------
|
||||
- Added an option to the GUI to process
|
||||
individual files in batch, i.e. call
|
||||
ccextractor once per file. Use it if you
|
||||
@@ -483,28 +684,28 @@ version of CCExtractor.
|
||||
in one go.
|
||||
- Added an option to prevent duplicate
|
||||
lines in roll-up captions.
|
||||
- Several minor bugfixes.
|
||||
- Several minor bug fixes.
|
||||
- Updated the GUI to add the new options.
|
||||
|
||||
0.43
|
||||
----
|
||||
0.43 (2008-06-20)
|
||||
-----------------
|
||||
- Fixed a bug in the read loop (no less)
|
||||
that caused some files to fail when
|
||||
reading without buffering (which is
|
||||
the default in the linux build).
|
||||
the default in the Linux build).
|
||||
- Several improvements in the GUI, such as
|
||||
saving current options as default.
|
||||
|
||||
0.42
|
||||
----
|
||||
0.42 (2008-06-17)
|
||||
-----------------
|
||||
- The option switch "-transcript" has been
|
||||
changed to "--transcript". Also, "-txt"
|
||||
has been added as the short alias.
|
||||
- Windows GUI
|
||||
- Updated help screen
|
||||
|
||||
0.41
|
||||
----
|
||||
0.41 (2008-06-15)
|
||||
-----------------
|
||||
- Default output is now .srt instead of .bin,
|
||||
use -raw if you need the data dump instead of
|
||||
.srt.
|
||||
@@ -514,17 +715,17 @@ version of CCExtractor.
|
||||
deaf people know if the person talking is
|
||||
at the left or the right of the screen, i.e.
|
||||
there aren't useless. But if they annoy
|
||||
you go ahead...
|
||||
you, go ahead...
|
||||
|
||||
0.40
|
||||
----
|
||||
0.40 (2008-05-20)
|
||||
-----------------
|
||||
- Fixed a bug in the sanity check function
|
||||
that caused the Myth branch to abort.
|
||||
- Fixed the OSX build script, it needed a
|
||||
new #define to work.
|
||||
|
||||
0.39
|
||||
----
|
||||
0.39 (2008-05-11)
|
||||
-----------------
|
||||
- Added a -transcript. If used, the output will
|
||||
have no time information. Also, if in roll-up
|
||||
mode there will be no repeated lines.
|
||||
@@ -533,7 +734,7 @@ version of CCExtractor.
|
||||
- Fixed a bug in the CC decoder that could cause
|
||||
the first line not to be cleared in roll-up
|
||||
mode.
|
||||
- ccextractor can now follow number sequences in
|
||||
- CCExtractor can now follow number sequences in
|
||||
file names, by suffixing the name with +.
|
||||
For example,
|
||||
|
||||
@@ -557,20 +758,20 @@ version of CCExtractor.
|
||||
join the subs), use -ve.
|
||||
|
||||
|
||||
0.36
|
||||
----
|
||||
0.36 (unreleased)
|
||||
-----------------
|
||||
- Fixed bug in SMI, nbsp was missing a ;.
|
||||
- Footer for SAMI files was incorrect (<body> and
|
||||
<sami> tags were being opened again instead of
|
||||
being closed).
|
||||
- Displayed memory is now written to disk at end
|
||||
of stream even if there is no command requesting
|
||||
so (may prevent losing the last screenful).
|
||||
so (may prevent losing the last screen-full).
|
||||
- Important change that could break scripts, but
|
||||
that have been added because old behaviour was
|
||||
annoying to most people: _1 and _2 at the end
|
||||
of the output file names is now added ONLY if
|
||||
-12 is used (ie when there are two output
|
||||
-12 is used (i.e. when there are two output
|
||||
files to produce). So
|
||||
|
||||
ccextractor -srt sopranos.mpg
|
||||
@@ -588,8 +789,8 @@ version of CCExtractor.
|
||||
as usual.
|
||||
|
||||
|
||||
0.35
|
||||
----
|
||||
0.35 (unreleased)
|
||||
-----------------
|
||||
- Added --defaultcolor to the help screen. Code
|
||||
was already in 0.34 but the documentation wasn't
|
||||
updated.
|
||||
@@ -598,8 +799,8 @@ version of CCExtractor.
|
||||
- At the end of the process, a ratio between
|
||||
video length and time to process is displayed.
|
||||
|
||||
0.34
|
||||
----
|
||||
0.34 (2007-06-03)
|
||||
-----------------
|
||||
- Added some basic letter case and capitalization
|
||||
support. For captions that broadcast in ALL
|
||||
UPPERCASE (most of them), ccextractor can now
|
||||
@@ -650,8 +851,8 @@ version of CCExtractor.
|
||||
Number (0.0.0.34 in this version) in case
|
||||
you want to check for version info.
|
||||
|
||||
0.33
|
||||
----
|
||||
0.33 (unreleased)
|
||||
-----------------
|
||||
- Added -scr or --screenfuls, to select the
|
||||
number of screenfuls ccextractor should
|
||||
write before exiting. A screenful is
|
||||
@@ -670,9 +871,9 @@ version of CCExtractor.
|
||||
Use -nofc or --nofontcolor if you don't
|
||||
want these tags.
|
||||
|
||||
0.32
|
||||
----
|
||||
- Added -delay ms, which adds (or substracts)
|
||||
0.32 (unreleased)
|
||||
-----------------
|
||||
- Added -delay ms, which adds (or subtracts)
|
||||
a number of milliseconds to all times in
|
||||
.srt/.sami files. For example,
|
||||
|
||||
@@ -683,15 +884,15 @@ version of CCExtractor.
|
||||
|
||||
-delay -400
|
||||
|
||||
causes all substitles to appear 400 ms before
|
||||
causes all subtitles to appear 400 ms before
|
||||
they would normally do.
|
||||
- Added -startat at -endat which lets you
|
||||
select just a portion of data to be processed,
|
||||
such as from minute 3 to minute 5. Check
|
||||
help screen for exact syntax.
|
||||
|
||||
0.31
|
||||
----
|
||||
0.31 (unreleased)
|
||||
-----------------
|
||||
- Added -dru (direct rollup), which causes
|
||||
roll-up captions to be written as
|
||||
they would on TV instead of line by line.
|
||||
@@ -699,20 +900,20 @@ version of CCExtractor.
|
||||
and ugly too (each line is written many
|
||||
times, two characters at time).
|
||||
|
||||
0.30
|
||||
----
|
||||
0.30 (2007-05-24)
|
||||
-----------------
|
||||
- Fix in extended char decoding, I wasn't
|
||||
replacing the previous char.
|
||||
- When a sequence code was found before
|
||||
having a PTS, reported time was
|
||||
undefined.
|
||||
|
||||
0.29
|
||||
----
|
||||
- Minor bugfix.
|
||||
0.29 (unreleased)
|
||||
-----------------
|
||||
- Minor bug fix.
|
||||
|
||||
0.28
|
||||
----
|
||||
0.28 (unreleased)
|
||||
-----------------
|
||||
- Fixed a buffering related issue. Short version,
|
||||
the first 2 Mb in non-TS mode were being
|
||||
discarded.
|
||||
@@ -721,20 +922,20 @@ version of CCExtractor.
|
||||
they are not part of the .srt "standard"
|
||||
even if McPoodle add them.
|
||||
|
||||
0.27
|
||||
----
|
||||
- Modified sanitizing code, it's less aggresive
|
||||
0.27 (unreleased)
|
||||
-----------------
|
||||
- Modified sanitizing code, it's less aggressive
|
||||
now. Ideally it should mean that characters
|
||||
won't be missed anymore. We'll see.
|
||||
|
||||
0.26
|
||||
----
|
||||
0.26 (unreleased)
|
||||
-----------------
|
||||
- Added -gp (or -goppad) to make ccextractor use
|
||||
GOP timing. Try it for non TS files where
|
||||
subs start OK but desync as the video advances.
|
||||
|
||||
0.25
|
||||
----
|
||||
0.25 (unreleased)
|
||||
-----------------
|
||||
- Format detection is not perfect yet. I've added
|
||||
-nomyth to prevent the MytvTV code path to be
|
||||
called. I've seen apparently correct files that
|
||||
@@ -744,8 +945,8 @@ version of CCExtractor.
|
||||
options will work.
|
||||
|
||||
|
||||
0.24
|
||||
----
|
||||
0.24 (unreleased)
|
||||
-----------------
|
||||
- Fixed a bug that caused dvr-ms (Windows Media Center)
|
||||
files to be incorrectly processed (letters out of
|
||||
order all the time).
|
||||
@@ -759,8 +960,8 @@ version of CCExtractor.
|
||||
still can).
|
||||
|
||||
|
||||
0.22
|
||||
----
|
||||
0.22 (2007-05-15)
|
||||
-----------------
|
||||
- Added text mode handling into decoder, which gets rids
|
||||
of junk when text mode data is present.
|
||||
- Added support for certain (possibly non standard
|
||||
@@ -771,14 +972,14 @@ version of CCExtractor.
|
||||
- Other Minor bug fixes.
|
||||
|
||||
|
||||
0.20
|
||||
----
|
||||
0.20 (2007-05-07)
|
||||
-----------------
|
||||
- Unicode should be decent now.
|
||||
- Added support for Hauppauge PVR 250 cards, and (possibly)
|
||||
many others (bttv) with the same closed caption recording
|
||||
format.
|
||||
This is the result of hacking MythTV's MPEG parser into
|
||||
ccextractor. Integration is not very good (to put it
|
||||
CCExtractor. Integration is not very good (to put it
|
||||
midly) but it seems to work. Depending on the feedback I
|
||||
may continue working on this or just leave it 'as it'
|
||||
(good enough).
|
||||
@@ -789,20 +990,20 @@ version of CCExtractor.
|
||||
though. If you have a good CSS for .SAMI files let me
|
||||
know.
|
||||
|
||||
0.19
|
||||
----
|
||||
0.19 (2007-05-03)
|
||||
-----------------
|
||||
- Work on Dish Network streams, timing was completely broken.
|
||||
It's fixed now at least for the samples I have, if it's not
|
||||
completely fixed let me know. Credit for this goes to
|
||||
Jack Ha who sent me a couple of samples and a first
|
||||
implementation of a semiworking fix.
|
||||
implementation of a semi working-fix.
|
||||
- Added support for several input files (see help screen for
|
||||
details).
|
||||
- Added Unicode and Latin-1 encoding.
|
||||
|
||||
|
||||
0.17
|
||||
----
|
||||
0.17 (2007-04-29)
|
||||
-----------------
|
||||
- Extraction to .srt is almost complete - works correctly for
|
||||
pop-up and roll-up captions, possibly not yet for paint-on
|
||||
(mostly because I don't have any sample with paint-on captions
|
||||
@@ -810,8 +1011,8 @@ version of CCExtractor.
|
||||
- Minor bug fixes.
|
||||
- Automatic TS/non-TS mode detection.
|
||||
|
||||
0.14
|
||||
----
|
||||
0.14 (2007-04-25)
|
||||
-----------------
|
||||
- Work on handling special cases related to the MPEG reference
|
||||
clock: Roll over, jumps, etc.
|
||||
- Modified padding code a bit: In particular, padding occurs
|
||||
@@ -824,10 +1025,10 @@ version of CCExtractor.
|
||||
needs to start with a TS header).
|
||||
- Minor bug fixes.
|
||||
|
||||
0.07
|
||||
----
|
||||
0.07 (2007-04-19)
|
||||
-----------------
|
||||
- Added MPEG reference clock parsing.
|
||||
- Added autopadding in TS. Does miracles with timing.
|
||||
- Added auto padding in TS. Does miracles with timing.
|
||||
- Added video information (as extracted from sequence header).
|
||||
- Some code clean-up.
|
||||
- FF sanity check enabled by default.
|
||||
|
||||
58
docs/FFMPEG.TXT
Normal file
58
docs/FFMPEG.TXT
Normal file
@@ -0,0 +1,58 @@
|
||||
Overview
|
||||
========
|
||||
FFmpeg Integration was done to support multiple encapsulations.
|
||||
|
||||
Dependency
|
||||
=========
|
||||
FFmpeg library's
|
||||
|
||||
Download and Install FFmpeg on your Linux pc.
|
||||
---------------------------------------------
|
||||
|
||||
Download latest source code from following link
|
||||
https://ffmpeg.org/download.html
|
||||
|
||||
then following command to install ffmpeg
|
||||
./configure && make && make install
|
||||
|
||||
Note:If you installed ffmpeg on non-standard location, please change/update your
|
||||
environment variable $PATH and $LD_LIBRARY_PATH
|
||||
|
||||
Download and Install FFmpeg on your Windows pc.
|
||||
----------------------------------------------
|
||||
Download prebuild library from following link
|
||||
http://ffmpeg.zeranoe.com/builds/
|
||||
|
||||
You need to download Shared Versions to run the program and Dev Versions to compile.
|
||||
|
||||
How to compile ccextractor
|
||||
==========================
|
||||
|
||||
In Linux
|
||||
--------
|
||||
make ENABLE_FFMPEG=yes
|
||||
|
||||
On Windows
|
||||
----------
|
||||
put the path of libs/include of ffmpeg library in library paths.
|
||||
Step 1) In visual studio 2013 right click <Project> and select property.
|
||||
Step 2) Select Configuration properties in left panel(column) of property.
|
||||
Step 3) Select VC++ Directory.
|
||||
Step 4) In the right pane, in the right-hand column of the VC++ Directory property,
|
||||
open the drop-down menu and choose Edit.
|
||||
Step 5) Add path of Directory where you have kept uncompressed library of FFmpeg.
|
||||
|
||||
|
||||
Set preprocessor flag ENABLE_FFMPEG=1
|
||||
Step 1) In visual studio 2013 right click <Project> and select property.
|
||||
Step 2) In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
Step 3) In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
Step 4) In the Preprocessor Definitions dialog box, add ENABLE_FFMPEG=1. Choose OK to save your changes.
|
||||
|
||||
Add library in linker
|
||||
Step 1) Open property of project
|
||||
Step 2) Select Configuration properties
|
||||
Step 3) Select Linker in left panel(column)
|
||||
Step 4) Select Input
|
||||
Step 5) Select Additional dependencies in right panel
|
||||
Step 6) Add all FFmpeg's lib in new line
|
||||
@@ -1,4 +1,4 @@
|
||||
Starting with version 0.51, ccextractor has a mode
|
||||
Starting with version 0.51, CCExtractor has a mode
|
||||
that allows frontends and other programs know what
|
||||
the current progress is as well as get information
|
||||
on interesting events, such as a file being open
|
||||
@@ -80,7 +80,7 @@ VIDEOINFO - New video information found
|
||||
Horizontal resolution
|
||||
Vertical resolution
|
||||
Aspect ratio
|
||||
Framerate
|
||||
Frame rate
|
||||
|
||||
Example: ###VIDEOINFO#1980#1080#16:9#29.97
|
||||
|
||||
|
||||
58
docs/G608.TXT
Normal file
58
docs/G608.TXT
Normal file
@@ -0,0 +1,58 @@
|
||||
G608
|
||||
====
|
||||
G608 (for grid 608) is generated by CCExtractor by using -out=g608.
|
||||
|
||||
This is a verbose format that exports the contents of the 608 grid verbatim
|
||||
so there's no loss of positioning or colors due the limitations or complexity
|
||||
or other output formats.
|
||||
|
||||
G608 is a text file with a structure based on .srt and looks like this:
|
||||
|
||||
1
|
||||
00:00:02,019 --> 00:00:03,585
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
- Previously on The Tudors... 90000000000000000000000000000009RIIIIIIIIIIIIIIIIRRRRRRRRRRRRRRR
|
||||
- Your Holy Father offs you 99000000000000000000000000000999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
|
||||
|
||||
For each subtitle frame there's exactly 15 rows (which represent the 15 rows of the 608 screen)
|
||||
of 96 characters each.
|
||||
|
||||
Each row is divided in 3 blocks: 32 characters for the text, 32 characters for the color, and
|
||||
32 characters for the font.
|
||||
|
||||
The possible color values are:
|
||||
COL_WHITE = 0,
|
||||
COL_GREEN = 1,
|
||||
COL_BLUE = 2,
|
||||
COL_CYAN = 3,
|
||||
COL_RED = 4,
|
||||
COL_YELLOW = 5,
|
||||
COL_MAGENTA = 6,
|
||||
COL_USERDEFINED = 7,
|
||||
COL_BLACK = 8,
|
||||
COL_TRANSPARENT = 9
|
||||
|
||||
And the possible font values are:
|
||||
R => Regular
|
||||
I => Italics
|
||||
U => Underlined
|
||||
B => Underlined + Italics
|
||||
|
||||
If a 'E' is found in either color or font that means a bug in CCExtractor. Should you ever get
|
||||
an E please send us a .bin file that causes it.
|
||||
|
||||
This format is intended for post processing tools that need to represent the output of a 608
|
||||
decoder accurately but that don't want to deal with the madness of other more generic subtitle
|
||||
formats.
|
||||
47
docs/HARDSUBX.txt
Normal file
47
docs/HARDSUBX.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Overview
|
||||
========
|
||||
Subtitles which are burned into the video (or hard subbed) can be extracted using the -hardsubx flag.
|
||||
The system works by processing video frames and extracting only the subtitles from them, followed
|
||||
by an OCR recognition using Tesseract.
|
||||
|
||||
Dependencies
|
||||
============
|
||||
Tesseract (OCR library by Google)
|
||||
Leptonica (C Image processing library)
|
||||
FFMpeg (Video Processing Library)
|
||||
|
||||
Compilation
|
||||
===========
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
Make sure Tesseract, Leptonica and FFMPeg are installed, and that their libraries can be found using pkg-config.
|
||||
Refer to OCR.txt for installation details.
|
||||
|
||||
To install FFmpeg (libav), follow the steps at:-
|
||||
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu - For Ubuntu, Debian and Linux Mint
|
||||
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic - For generic Linux compilation
|
||||
|
||||
To validate your FFMpeg installation, make sure you can run the following commands on your terminal:-
|
||||
pkg-config --cflags libavcodec
|
||||
pkg-config --cflags libavformat
|
||||
pkg-config --cflags libavutil
|
||||
pkg-config --cflags libswscale
|
||||
pkg-config --libs libavcodec
|
||||
pkg-config --libs libavformat
|
||||
pkg-config --libs libavutil
|
||||
pkg-config --libs libswscale
|
||||
|
||||
On success, you should see the correct include directory path and the linker flags.
|
||||
|
||||
To build the program with hardsubx support, from the Linux directory run:-
|
||||
make ENABLE_HARDSUBX=yes
|
||||
|
||||
NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04.
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
Coming Soon
|
||||
@@ -3,7 +3,7 @@ A mailing list is now available from sourceforge:
|
||||
https://lists.sourceforge.net/lists/listinfo/ccextractor-users
|
||||
|
||||
I expect it to be very low traffic (right now there's around 10
|
||||
people actively helping with ccextractor in one way or
|
||||
people actively helping with CCExtractor in one way or
|
||||
another), so almost everything goes here:
|
||||
|
||||
- Bug reports
|
||||
|
||||
64
docs/OCR.txt
64
docs/OCR.txt
@@ -1,17 +1,17 @@
|
||||
|
||||
Overview
|
||||
========
|
||||
OCR (Optical Character Recognisation ) is an technique used to
|
||||
extract text from images. In the World of Subtile, subtitle stored
|
||||
in bitmap format are common and even neccassary. for converting subtile
|
||||
in bitmap format to subtilte in text format ocr is used.
|
||||
OCR (Optical Character Recognition) is a technique used to
|
||||
extract text from images. In the World of Subtitle, subtitle stored
|
||||
in bitmap format are common and even necessary for converting subtitle
|
||||
in bitmap format to subtitle in text format OCR is used.
|
||||
|
||||
Dependecy
|
||||
=========
|
||||
Tesseract (OCR library by google)
|
||||
Leptonica (image processing library)
|
||||
Dependency
|
||||
==========
|
||||
Tesseract (OCR library by Google)
|
||||
Leptonica (Image processing library)
|
||||
|
||||
How to compile ccextractor on linux with OCR
|
||||
How to compile CCExtractor on Linux with OCR
|
||||
=============================================
|
||||
|
||||
Download and Install Leptonnica.
|
||||
@@ -43,25 +43,23 @@ sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
Note:
|
||||
1) CCExtractor is tested with Tesseract 3.02.02 version.
|
||||
1) CCExtractor is tested with Tesseract 3.04 version but it works with older versions.
|
||||
|
||||
you can download tesseract from https://drive.google.com/folderview?id=0B7l10Bj_LprhQnpSRkpGMGV2eE0&usp=sharing
|
||||
you can download tesseract from https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
|
||||
you can download tesseract training data from https://github.com/tesseract-ocr/tessdata/archive/3.04.00.tar.gz
|
||||
|
||||
|
||||
|
||||
Compile CCextractor passing flags like following
|
||||
Compile CCExtractor passing flags like following
|
||||
-------------------------------------------------
|
||||
make ENABLE_OCR=yes
|
||||
|
||||
|
||||
How to compile ccextractor on Windows with OCR
|
||||
=============================================
|
||||
How to compile CCExtractor on Windows with OCR
|
||||
===============================================
|
||||
|
||||
Download prebuild library of leptonica from following link
|
||||
http://www.leptonica.com/source/leptonica-1.68-win32-lib-include-dirs.zip
|
||||
|
||||
Download prebuild library of tesseract from following tesseract official link
|
||||
https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-3.02.02-win32-lib-include-dirs.zip
|
||||
Download prebuild library of leptonica and tesseract from following link
|
||||
https://drive.google.com/file/d/0B2ou7ZfB-2nZOTRtc3hJMHBtUFk/view?usp=sharing
|
||||
|
||||
put the path of libs/include of leptonica and tesseract in library paths.
|
||||
step 1) In visual studio 2013 right click <Project> and select property.
|
||||
@@ -74,23 +72,23 @@ Step 5) Add path of Directory where you have kept uncompressed library of lepton
|
||||
|
||||
|
||||
Set preprocessor flag ENABLE_OCR=1
|
||||
Step 1)In visual studio 2013 right click <Project> and select property.
|
||||
Step 2)In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
Step 3)In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
Step 4)In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
|
||||
Step 1) In visual studio 2013 right click <Project> and select property.
|
||||
Step 2) In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
Step 3) In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
Step 4) In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
|
||||
|
||||
Add library in linker
|
||||
step 1)Open property of project
|
||||
Step 2)Select Configuration properties
|
||||
Step 3)Select Linker in left panel(column)
|
||||
Step 4)Select Input
|
||||
Step 5)Select Additional dependencies in right panel
|
||||
Step 6)Add libtesseract302.lib in new line
|
||||
Step 7)Add liblept168.lib in new line
|
||||
step 1) Open property of project
|
||||
Step 2) Select Configuration properties
|
||||
Step 3) Select Linker in left panel(column)
|
||||
Step 4) Select Input
|
||||
Step 5) Select Additional dependencies in right panel
|
||||
Step 6) Add libtesseract304d.lib in new line
|
||||
Step 7) Add liblept172.lib in new line
|
||||
|
||||
Download language data from following link
|
||||
https://code.google.com/p/tesseract-ocr/downloads/list
|
||||
after downloading the tesseract-ocr-3.02.eng.tar extract the tar file and put
|
||||
tessdata folder where you have kept ccextractor executable
|
||||
after downloading the tesseract-ocr-3.02.eng.tar.gz extract the tar file and put
|
||||
tessdata folder where you have kept CCExtractor executable
|
||||
|
||||
Copy the tesseract and leptonica dll in the folder of executable or in system32.
|
||||
Copy the tesseract and leptonica dll from lib folder downloaded from above link to folder of executable or in system32.
|
||||
|
||||
@@ -1,17 +1,41 @@
|
||||
ccextractor, 0.63
|
||||
ccextractor, 0.85
|
||||
-----------------
|
||||
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
|
||||
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
|
||||
Maintainer: cfsmp3
|
||||
|
||||
Lots of credit goes to other people, though:
|
||||
McPoodle (author of the original SCC_RIP), Neuron2, and others (see source
|
||||
code).
|
||||
|
||||
Home: http://ccextractor.sourceforge.net
|
||||
Home: http://www.ccextractor.org
|
||||
|
||||
Google Summer of Code 2014 students
|
||||
- Willem Van Iseghem
|
||||
- Ruslan KuchumoV
|
||||
- Anshul Maheshwari
|
||||
|
||||
Google Summer of Code 2015 students
|
||||
- Willem Van Iseghem
|
||||
- Ruslan Kuchumov
|
||||
- Anshul Maheshwari
|
||||
- Nurendra Choudhary
|
||||
- Oleg Kiselev
|
||||
- Vasanth Kalingeri
|
||||
|
||||
Google Summer of Code 2016 students
|
||||
- Willem Van Iseghem
|
||||
- Ruslan Kuchumov
|
||||
- Abhishek Vinjamoori
|
||||
- Abhinav Shukla
|
||||
- Rishabh Garg
|
||||
|
||||
Google Code-in 2016 students
|
||||
- Evgeny Shulgin
|
||||
- Manveer Basra
|
||||
- Alexandru Bratosin
|
||||
(more, but they forgot to add themselves...)
|
||||
|
||||
You can subscribe to new releases notifications at freshmeat:
|
||||
|
||||
http://freshmeat.net/projects/ccextractor
|
||||
|
||||
License
|
||||
-------
|
||||
@@ -67,21 +91,18 @@ If there are Spanish subtitles, one of them should work.
|
||||
|
||||
McPoodle's page
|
||||
---------------
|
||||
http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
|
||||
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
|
||||
|
||||
Essential CC related information and free (with source) tools.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
This version, in both its Linux and Windows builds generates by
|
||||
default Latin-1 encoded files. You can use -unicode and -utf8
|
||||
if you prefer these encodings (usually it just depends on what
|
||||
your specific player likes).
|
||||
This has changed from the previous UTF-8 default which vobsub
|
||||
can't handle.
|
||||
default Unicode files. You can use -latin1 and -utf8 if you prefer
|
||||
these encodings (usually it just depends on what your specific
|
||||
player likes).
|
||||
|
||||
Future work
|
||||
-----------
|
||||
- Finish EIA-708 decoder
|
||||
- Network support
|
||||
- Please check www.ccextractor.org for news and future work.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#
|
||||
|
||||
|
||||
# The Input Source tag option give ability to user
|
||||
# to take imput from file, standurd input or network
|
||||
# This tag take number in its input and there meanings
|
||||
# The Input Source tag option gives ability to user
|
||||
# to take input from file, standard input or network
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = file
|
||||
# 1 = stdin
|
||||
@@ -16,12 +16,12 @@
|
||||
INPUT_SOURCE=0
|
||||
|
||||
# The Buffer Input tag
|
||||
# This tag take number in its input.
|
||||
# This tag takes number in its input.
|
||||
|
||||
#BUFFER_INPUT=0
|
||||
|
||||
# The Direct Rollup tag
|
||||
# This tag take number in its input and there meanings
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = no
|
||||
# 1 = yes
|
||||
@@ -29,7 +29,7 @@ INPUT_SOURCE=0
|
||||
#DIRECT_ROLLUP=
|
||||
|
||||
#The No font Color Tag
|
||||
# This tag take number in its input and there meanings
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = no
|
||||
# 1 = yes
|
||||
@@ -37,16 +37,16 @@ INPUT_SOURCE=0
|
||||
#NOFONT_COLOR=
|
||||
|
||||
#The No type Setting Tag
|
||||
# This tag take number in its input and there meanings
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = no
|
||||
# 1 = yes
|
||||
|
||||
#NOTYPE_SETTING=
|
||||
|
||||
# The Codec Tag take the preference of codec
|
||||
# The Codec Tag takes the preference of codec
|
||||
# tag CCX_CODEC_ANY is by default
|
||||
# This tag take number in its input and there meaning
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_CODEC_ANY
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
@@ -56,7 +56,7 @@ INPUT_SOURCE=0
|
||||
|
||||
# The NO Codec Tag do not use codec specified
|
||||
# tag CCX_CODEC_NONE is by default
|
||||
# This tag take number in its input and there meaning
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
@@ -66,7 +66,7 @@ INPUT_SOURCE=0
|
||||
|
||||
# OUTPUT_FORMAT tag specify format of output
|
||||
# by default output format is srt
|
||||
# This tag take number in its input and there meaning
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_OF_RAW
|
||||
# 1 = CCX_OF_SRT (default)
|
||||
@@ -87,7 +87,7 @@ INPUT_SOURCE=0
|
||||
|
||||
#START_CREDIT_TEXT=
|
||||
|
||||
# Start credit do not start before apecified time in tag
|
||||
# Start credit do not start before specified time in tag
|
||||
# this tag only accepts SS, MM:SS or HH:MM:SS
|
||||
|
||||
#START_CREDIT_NOT_BEFORE=
|
||||
@@ -124,7 +124,7 @@ INPUT_SOURCE=0
|
||||
|
||||
#END_CREDITS_FOR_ATMOST
|
||||
|
||||
# Is Video edited or splitted by tool
|
||||
# Is Video edited or split by tool
|
||||
# By default its 1, ccextractor will process input files in
|
||||
# sequence as if they were all one large file i.e
|
||||
# split by a generic, non video-aware tool. If you
|
||||
@@ -140,7 +140,7 @@ INPUT_SOURCE=0
|
||||
# overrides the default PTS timing,GOP timing is always
|
||||
# used for Elementary Streams.
|
||||
#
|
||||
# This tag take number in its input and there meaning
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = use pts for time (when reasonable)
|
||||
# 1 = use gop for time (when reasonable)
|
||||
@@ -164,7 +164,7 @@ INPUT_SOURCE=0
|
||||
# emulation, you can have ccextractor write only one
|
||||
# line at a time, getting rid of these repeated lines.
|
||||
#
|
||||
# This tag take number in its input and there meaning
|
||||
# This tag take number in its input and their meanings
|
||||
# are following
|
||||
# 0 = no (default)
|
||||
# 1 = yes
|
||||
|
||||
339
docs/gpl-2.0.txt
Normal file
339
docs/gpl-2.0.txt
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
34
docs/using_cmake_build.txt
Normal file
34
docs/using_cmake_build.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
For building CCExtractor using cmake follow steps below..
|
||||
|
||||
Step 1) Check you have right version of cmake installed. ( version >= 3.0.2 )
|
||||
We are using CMP0037 policy of cmake which was introduced in 3.0.0
|
||||
since we have tested our system only with cmake version 3.0.2, I would
|
||||
suggest to use 3.0.2 or higher version.
|
||||
|
||||
|
||||
Step 2) create a separate directory where you want to build the target.
|
||||
In Unix you can do it using following commands.
|
||||
~> cd ccextractor
|
||||
~> mkdir build
|
||||
|
||||
Step 3) make the build system using cmake
|
||||
~> cmake ../src/
|
||||
|
||||
Step 4) Compile the code.
|
||||
~> make
|
||||
~> make install
|
||||
|
||||
Step 5) Use CCextractor as you would like
|
||||
|
||||
|
||||
If you want to build CCExtractor with FFMpeg you need to pass
|
||||
cmake -DWITH_FFMPEG=ON ../src/
|
||||
|
||||
If you want to build CCExtractor with OCR you need to pass
|
||||
cmake -DWITH_OCR=ON ../src/
|
||||
|
||||
If you want to build CCExtractor with Sharing and Translating service:
|
||||
cmake -DWITH_SHARING ../src/
|
||||
|
||||
Hint for looking all the things you want to set from outside
|
||||
cmake -LAH ../src/
|
||||
122
linux/Makefile
122
linux/Makefile
@@ -1,26 +1,37 @@
|
||||
SHELL = /bin/sh
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -O3 -std=gnu99
|
||||
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/zlib
|
||||
ALL_FLAGS = -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64
|
||||
LDFLAGS = -lm -zmuldefs
|
||||
SYS := $(shell gcc -dumpmachine)
|
||||
CFLAGS = -O3 -std=gnu99 -s
|
||||
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/lib_hash -I../src/protobuf-c -I../src/zlib -I../src/lib_ccx -I../src/.
|
||||
INCLUDE += -I../src/zvbi -I../src/utf8proc
|
||||
ALL_FLAGS = -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT
|
||||
LDFLAGS = -lm
|
||||
|
||||
ifneq (, $(findstring linux, $(SYS)))
|
||||
CFLAGS +=-DGPAC_CONFIG_LINUX
|
||||
endif
|
||||
TARGET = ccextractor
|
||||
|
||||
OBJS_DIR = objs
|
||||
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib
|
||||
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib:../src/lib_ccx:../src/zvbi:../src/lib_hash:../src/utf8proc:../src/protobuf-c
|
||||
|
||||
SRCS_DIR = ../src
|
||||
SRCS_C = $(wildcard $(SRCS_DIR)/*.c)
|
||||
OBJS = $(SRCS_C:$(SRCS_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_CCX_DIR = $(SRCS_DIR)/lib_ccx
|
||||
SRCS_CCX = $(wildcard $(SRCS_CCX_DIR)/*.c)
|
||||
OBJS_CCX = $(SRCS_CCX:$(SRCS_CCX_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_PNG_DIR = $(SRCS_DIR)/libpng
|
||||
SRCS_PNG = $(wildcard $(SRCS_PNG_DIR)/*.c)
|
||||
OBJS_PNG = $(SRCS_PNG:$(SRCS_PNG_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_ZVBI_DIR = $(SRCS_DIR)/zvbi
|
||||
SRCS_ZVBI = $(wildcard $(SRCS_ZVBI_DIR)/*.c)
|
||||
OBJS_ZVBI = $(SRCS_ZVBI:$(SRCS_ZVBI_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_GPACMP4_DIR = $(SRCS_DIR)/gpacmp4
|
||||
SRCS_GPACMP4_C = $(wildcard $(SRCS_GPACMP4_DIR)/*.c)
|
||||
SRCS_GPACMP4_CPP = $(wildcard $(SRCS_GPACMP4_DIR)/*.cpp)
|
||||
@@ -31,25 +42,93 @@ SRCS_ZLIB_DIR = $(SRCS_DIR)/zlib
|
||||
SRCS_ZLIB = $(wildcard $(SRCS_ZLIB_DIR)/*.c)
|
||||
OBJS_ZLIB = $(SRCS_ZLIB:$(SRCS_ZLIB_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_HASH_DIR = $(SRCS_DIR)/lib_hash
|
||||
SRCS_HASH = $(wildcard $(SRCS_HASH_DIR)/*.c)
|
||||
OBJS_HASH = $(SRCS_HASH:$(SRCS_HASH_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
SRCS_UTF8_DIR = $(SRCS_DIR)/utf8proc
|
||||
SRCS_UTF8 = $(SRCS_UTF8_DIR)/utf8proc.c
|
||||
OBJS_UTF8 = $(SRCS_UTF8:$(SRCS_UTF8_DIR)/%.c=$(OBJS_DIR)/%.o)
|
||||
|
||||
INSTLALL = cp -f -p
|
||||
INSTLALL_PROGRAM = $(INSTLALL)
|
||||
DESTDIR = /usr/bin
|
||||
|
||||
ifeq ($(ENABLE_HARDSUBX),yes)
|
||||
ENABLE_OCR=yes
|
||||
CFLAGS+=-DENABLE_HARDSUBX
|
||||
CFLAGS+= $(shell pkg-config --cflags libavcodec)
|
||||
CFLAGS+= $(shell pkg-config --cflags libavformat)
|
||||
CFLAGS+= $(shell pkg-config --cflags libavutil)
|
||||
CFLAGS+= $(shell pkg-config --cflags libswscale)
|
||||
AV_LDFLAGS+= $(shell pkg-config --libs libavcodec )
|
||||
AV_LDFLAGS+= $(shell pkg-config --libs libavformat )
|
||||
AV_LDFLAGS+= $(shell pkg-config --libs libavutil )
|
||||
AV_LDFLAGS+= $(shell pkg-config --libs libswscale )
|
||||
ifeq ($(AV_LDFLAGS),$(EMPTY))
|
||||
$(error **ERROR** "libav not found")
|
||||
else
|
||||
$(info "libav found")
|
||||
endif
|
||||
LDFLAGS+= $(AV_LDFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(ENABLE_OCR),yes)
|
||||
CFLAGS+=-I/usr/local/include/tesseract -I/usr/local/include/leptonica
|
||||
CFLAGS+=-DENABLE_OCR
|
||||
LDFLAGS+= $(shell pkg-config --libs tesseract)
|
||||
CFLAGS+=-DENABLE_OCR -DPNG_NO_CONFIG_H
|
||||
LEPT_LDFLAGS+= $(shell pkg-config --libs lept)
|
||||
|
||||
ifneq ($(shell pkg-config --exists tesseract), $(EMPTY))
|
||||
TESS_LDFLAGS+= $(shell pkg-config --libs tesseract)
|
||||
TESS_CFLAGS+= $(shell pkg-config --cflags tesseract)
|
||||
else
|
||||
#fix for raspberry pi not having a pkgconfig file for tesseract
|
||||
ifneq ($(wildcard /usr/include/tesseract/*),$(EMPTY))
|
||||
TESS_LDFLAGS+= -ltesseract
|
||||
TESS_CFLAGS+= -I/usr/include/tesseract
|
||||
endif
|
||||
endif
|
||||
|
||||
#error checking of library are there or not
|
||||
ifeq ($(TESS_LDFLAGS),$(EMPTY))
|
||||
$(error **ERROR** "tesseract not found")
|
||||
else
|
||||
#TODO print the version of library found
|
||||
$(info "tesseract found")
|
||||
endif
|
||||
|
||||
ifeq ($(LEPT_LDFLAGS),$(EMPTY))
|
||||
$(error **ERROR** "leptonica not found")
|
||||
else
|
||||
#TODO print the version of library found
|
||||
$(info "Leptonica found")
|
||||
endif
|
||||
|
||||
CFLAGS += $(TESS_CFLAGS)
|
||||
CFLAGS += $(shell pkg-config --cflags lept)
|
||||
LDFLAGS += $(TESS_LDFLAGS)
|
||||
LDFLAGS += $(LEPT_LDFLAGS)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(ENABLE_FFMPEG),yes)
|
||||
CFLAGS+=-DENABLE_FFMPEG
|
||||
CFLAGS+= $(shell pkg-config --cflags libavcodec)
|
||||
CFLAGS+= $(shell pkg-config --cflags libavformat)
|
||||
CFLAGS+= $(shell pkg-config --cflags libavutil)
|
||||
LDFLAGS+= $(shell pkg-config --libs libavcodec )
|
||||
LDFLAGS+= $(shell pkg-config --libs libavformat )
|
||||
LDFLAGS+= $(shell pkg-config --libs libavutil )
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: objs_dir $(TARGET)
|
||||
all: pre-build objs_dir $(TARGET)
|
||||
|
||||
.PHONY: objs_dir
|
||||
objs_dir:
|
||||
mkdir -p $(OBJS_DIR)
|
||||
|
||||
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZLIB)
|
||||
$(CXX) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(LDFLAGS) -o $@
|
||||
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZVBI) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_CCX) $(OBJS_UTF8)
|
||||
$(CC) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZVBI) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_UTF8) $(LDFLAGS) -o $@
|
||||
|
||||
$(OBJS_DIR)/%.o: %.c
|
||||
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@
|
||||
@@ -57,12 +136,15 @@ $(OBJS_DIR)/%.o: %.c
|
||||
$(OBJS_DIR)/%.o: %.cpp
|
||||
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@ -I../src/gpacmp4
|
||||
|
||||
$(OBJS_DIR)/ccextractor.o: ccextractor.c
|
||||
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) -O0 $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm $(TARGET) 2>/dev/null || true
|
||||
rm $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS) 2>/dev/null || true
|
||||
rm -rd $(OBJS_DIR) 2>/dev/null || true
|
||||
rm .depend 2>/dev/null || true
|
||||
rm -rf $(TARGET) 2>/dev/null || true
|
||||
rm -rf $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS_HASH) $(OBJS_UTF8) $(OBJS) 2>/dev/null || true
|
||||
rm -rdf $(OBJS_DIR) 2>/dev/null || true
|
||||
rm -rf .depend 2>/dev/null || true
|
||||
|
||||
.PHONY: install
|
||||
install: $(TARGET)
|
||||
@@ -74,8 +156,12 @@ uninstall:
|
||||
|
||||
.PHONY: depend dep
|
||||
depend dep:
|
||||
$(CXX) $(CXXFLAGS) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZLIB) \
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZVBI) $(SRCS_ZLIB) $(SRCS_HASH) $(SRCS_UTF8) $(SRCS_CCX) \
|
||||
$(SRCS_GPACMP4_C) $(SRCS_GPACMP4_CPP) |\
|
||||
sed 's/^[a-zA-Z_0-9]*.o/$(OBJS_DIR)\/&/' > .depend
|
||||
|
||||
.PHONY: pre-build
|
||||
pre-build:
|
||||
./pre-build.sh
|
||||
|
||||
-include .depend
|
||||
|
||||
45
linux/build
45
linux/build
@@ -1,2 +1,45 @@
|
||||
#!/bin/bash
|
||||
gcc -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c') -lm -zmuldefs
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
|
||||
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
|
||||
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
|
||||
./pre-build.sh
|
||||
|
||||
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER) 2>&1)
|
||||
res=$?
|
||||
if [[ $out == *"gcc: command not found"* ]]
|
||||
then
|
||||
echo "Error: please install gcc";
|
||||
exit 1
|
||||
fi
|
||||
if [[ $out == *"curl.h: No such file or directory"* ]]
|
||||
then
|
||||
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
|
||||
exit 2
|
||||
fi
|
||||
if [[ $out == *"capi.h: No such file or directory"* ]]
|
||||
then
|
||||
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
|
||||
exit 3
|
||||
fi
|
||||
if [[ $out == *"allheaders.h: No such file or directory"* ]]
|
||||
then
|
||||
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
|
||||
exit 4
|
||||
fi
|
||||
if [[ $res -ne 0 ]] # Unknown error
|
||||
then
|
||||
echo "Compiled with errors"
|
||||
>&2 echo "$out"
|
||||
exit 5
|
||||
fi
|
||||
echo "Compilation successful";
|
||||
|
||||
112
linux/build-static.sh
Executable file
112
linux/build-static.sh
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
####################################################################
|
||||
# setup by tracey apr 2012
|
||||
# updated version dec 2016
|
||||
# see: http://www.ccextractor.org/doku.php
|
||||
####################################################################
|
||||
|
||||
|
||||
# build it static!
|
||||
# simplest way is with linux alpine
|
||||
# hop onto box with docker on it and cd to dir of the file you are staring at
|
||||
# You will get a static-compiled binary and english language library file in the end.
|
||||
if [ ! -e /tmp/cc/ccextractor-README.txt ]; then
|
||||
rm -rf /tmp/cc;
|
||||
mkdir -p -m777 /tmp/cc;
|
||||
mkdir -p -m777 ../lib/tessdata/;
|
||||
cp ccextractor-README.txt /tmp/cc/;
|
||||
sudo docker run -v /tmp/cc:/tmp/cc --rm -it alpine:latest /tmp/cc/ccextractor-README.txt;
|
||||
# NOTE: _AFTER_ testing/validating, you can promote it from "ccextractor.next" to "ccextractor"... ;-)
|
||||
cp /tmp/cc/*traineddata ../lib/tessdata/;
|
||||
chmod go-w ../lib/tessdata/;
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
# NOW we are inside docker container...
|
||||
cd /tmp/cc;
|
||||
|
||||
|
||||
# we want tesseract (for OCR)
|
||||
echo '
|
||||
http://dl-cdn.alpinelinux.org/alpine/v3.5/main
|
||||
http://dl-cdn.alpinelinux.org/alpine/v3.5/community
|
||||
' >| /etc/apk/repositories;
|
||||
apk update; apk upgrade;
|
||||
|
||||
apk add --update bash zsh alpine-sdk perl;
|
||||
|
||||
# (needed by various static builds below)
|
||||
# Even though we're going to (re)builid tesseract from source statically, get its dependencies setup by
|
||||
# installing it now, too.
|
||||
apk add autoconf automake libtool tesseract-ocr-dev;
|
||||
|
||||
|
||||
# Now comes the not-so-fun parts... Many packages _only_ provide .so files in their distros -- not the .a
|
||||
# needed files for building something with it statically. Step through them now...
|
||||
|
||||
|
||||
# libgif
|
||||
wget https://sourceforge.net/projects/giflib/files/giflib-5.1.4.tar.gz;
|
||||
zcat giflib*tar.gz | tar xf -;
|
||||
cd giflib*/;
|
||||
./configure --disable-shared --enable-static; make; make install;
|
||||
hash -r;
|
||||
cd -;
|
||||
|
||||
|
||||
# libwebp
|
||||
git clone https://github.com/webmproject/libwebp;
|
||||
cd libwebp;
|
||||
./autogen.sh;
|
||||
./configure --disable-shared --enable-static; make; make install;
|
||||
cd -;
|
||||
|
||||
|
||||
# leptonica
|
||||
wget http://www.leptonica.org/source/leptonica-1.73.tar.gz;
|
||||
zcat leptonica*tar.gz | tar xf -;
|
||||
cd leptonica*/;
|
||||
./configure --disable-shared --enable-static; make; make install;
|
||||
hash -r;
|
||||
cd -;
|
||||
|
||||
|
||||
# tesseract
|
||||
git clone https://github.com/tesseract-ocr/tesseract;
|
||||
cd tesseract;
|
||||
./autogen.sh;
|
||||
./configure --disable-shared --enable-static; make; make install;
|
||||
cd -;
|
||||
|
||||
|
||||
# ccextractor -- build static
|
||||
git clone https://github.com/CCExtractor/ccextractor;
|
||||
cd ccextractor/linux/;
|
||||
# wget https://sourceforge.net/projects/ccextractor/files/ccextractor/0.82/ccextractor.src.0.82.zip;
|
||||
# unzip ccextractor*.zip;
|
||||
# cd ccextractor.*/linux/;
|
||||
perl -i -pe 's/O3 /O3 -static /' Makefile;
|
||||
# quick patch:
|
||||
perl -i -pe 's/(strchr|strstr)\(/$1((char *)/' ../src/gpacmp4/url.c ../src/gpacmp4/error.c;
|
||||
set +e; # this _will_ FAIL at the end..
|
||||
make ENABLE_OCR=yes;
|
||||
set -e;
|
||||
# I confess hand-compiling (cherrypicking which .a to use when there are 2, etc.) is fragile...
|
||||
# But it was the _only_ way I could get a fully static build after hours of thrashing...
|
||||
gcc -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -O3 -std=gnu99 -s -DGPAC_CONFIG_LINUX -DENABLE_OCR -DPNG_NO_CONFIG_H -I/usr/local/include/tesseract -I/usr/local/include/leptonica objs/*.o -o ccextractor \
|
||||
--static -lm \
|
||||
/usr/local/lib/libtesseract.a \
|
||||
/usr/local/lib/liblept.a \
|
||||
/usr/local/lib/libgif.a \
|
||||
/usr/local/lib/libwebp.a \
|
||||
/usr/lib/libjpeg.a \
|
||||
/usr/lib/libtiff.a \
|
||||
/usr/lib/libgomp.a \
|
||||
-lstdc++;
|
||||
|
||||
cp ccextractor /tmp/cc/ccextractor.next;
|
||||
cd -;
|
||||
|
||||
# get english lang trained data
|
||||
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata;
|
||||
17
linux/build_hardsubx
Executable file
17
linux/build_hardsubx
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX"
|
||||
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c"
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
|
||||
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
|
||||
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
|
||||
SRC_UTF8="../src/utf8proc/utf8proc.c"
|
||||
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
|
||||
protobuf-c
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -L/usr/local/lib -lswscale -lavutil -pthread -lavformat -lavcodec -lxcb-shm -lxcb -lX11 -llzma -lz -lswresample"
|
||||
|
||||
./pre-build.sh
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
@@ -1,2 +1,16 @@
|
||||
#!/bin/bash
|
||||
gcc -g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c') -lm -zmuldefs
|
||||
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
|
||||
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
|
||||
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
|
||||
./pre-build.sh
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
|
||||
1
linux/description-pak
Normal file
1
linux/description-pak
Normal file
@@ -0,0 +1 @@
|
||||
Best open source tool for a subtitled world
|
||||
34
linux/pre-build.sh
Executable file
34
linux/pre-build.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
echo "Git command not present, trying folder approach"
|
||||
if [ -d "../.git" ]; then
|
||||
echo "Git folder found, using HEAD file"
|
||||
head="`cat ../.git/HEAD`"
|
||||
ref_pos=(`expr match "$head" 'ref: '`)
|
||||
if [ $ref_pos -eq 5 ]; then
|
||||
echo "HEAD file contains a ref, following"
|
||||
commit=(`cat "../.git/${head:5}"`)
|
||||
echo "Extracted commit: $commit"
|
||||
else
|
||||
echo "HEAD contains a commit, using it"
|
||||
commit="$head"
|
||||
echo "Extracted commit: $commit"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_H" > ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "Stored all in compile_info_real.h"
|
||||
echo "Done."
|
||||
18
mac/build.command
Normal file → Executable file
18
mac/build.command
Normal file → Executable file
@@ -1 +1,17 @@
|
||||
g++ -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -I../src/gpacmp4 -I ../src/libpng -I ../src/zlib -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c')
|
||||
#!/bin/bash
|
||||
cd `dirname $0`
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
|
||||
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi -I /usr/local/include/leptonica/ -I /usr/local/include/tesseract/"
|
||||
SRC_CCX="$(find ../src/lib_ccx -name '*.c')"
|
||||
SRC_GPAC="$(find ../src/gpacmp4 -name '*.c')"
|
||||
SRC_LIB_HASH="$(find ../src/lib_hash -name '*.c')"
|
||||
SRC_LIBPNG="$(find ../src/libpng -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/protobuf-c -name '*.c')"
|
||||
SRC_UTF8="$(find ../src/utf8proc-c -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI"
|
||||
BLD_LINKER="-lm -liconv"
|
||||
|
||||
./pre-build.sh
|
||||
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
|
||||
34
mac/pre-build.sh
Executable file
34
mac/pre-build.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
echo "Git command not present, trying folder approach"
|
||||
if [ -d "../.git" ]; then
|
||||
echo "Git folder found, using HEAD file"
|
||||
head="`cat ../.git/HEAD`"
|
||||
ref_pos=(`expr match "$head" 'ref: '`)
|
||||
if [ $ref_pos -eq 5 ]; then
|
||||
echo "HEAD file contains a ref, following"
|
||||
commit=(`cat "../.git/${head:5}"`)
|
||||
echo "Extracted commit: $commit"
|
||||
else
|
||||
echo "HEAD contains a commit, using it"
|
||||
commit="$head"
|
||||
echo "Extracted commit: $commit"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_REAL_H" > ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
|
||||
echo "Stored all in compile_info_real.h"
|
||||
echo "Done."
|
||||
38
package_creators/debian.sh
Normal file
38
package_creators/debian.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
TYPE="debian" # can be one of 'slackware', 'debian', 'rpm'
|
||||
PROGRAM_NAME="ccextractor"
|
||||
VERSION="0.84"
|
||||
RELEASE="1"
|
||||
LICENSE="GPL-2.0"
|
||||
MAINTAINER="carlos@ccextractor.org"
|
||||
REQUIRES="gcc,libcurl4-gnutls-dev,tesseract-ocr,tesseract-ocr-dev,libleptonica-dev"
|
||||
|
||||
out=$((LC_ALL=C dpkg -s checkinstall) 2>&1)
|
||||
|
||||
if [[ $out == *"is not installed"* ]]
|
||||
then
|
||||
read -r -p "You have not installed the package 'checkinstall'. Would you like to install it? [Y/N] " response
|
||||
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
|
||||
then
|
||||
apt-get install -y checkinstall
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p ../linux/objs
|
||||
|
||||
(cd ../linux; checkinstall \
|
||||
-y \
|
||||
--pkgrelease=$RELEASE \
|
||||
--pkggroup="CCExtractor" \
|
||||
--backup=no \
|
||||
--install=no \
|
||||
--type $TYPE \
|
||||
--pkgname=$PROGRAM_NAME \
|
||||
--pkgversion=$VERSION \
|
||||
--pkglicense=$LICENSE \
|
||||
--pakdir="../package_creators/build" \
|
||||
--maintainer=$MAINTAINER \
|
||||
--nodoc \
|
||||
--requires=$REQUIRES)
|
||||
12
raspberrypi.md
Normal file
12
raspberrypi.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Installing on a Raspberry Pi
|
||||
|
||||
dependencies for ocr mode:
|
||||
|
||||
* libleptonica-dev
|
||||
* libtesseract-dev
|
||||
|
||||
```bash
|
||||
sudo apt-get install libleptonica-dev libtesseract-dev
|
||||
```
|
||||
|
||||
Other than this you just need to cd into the linux directory and run `make` or `make ENABLE_OCR=yes` if you want ocr enabled.
|
||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
151
src/608.h
151
src/608.h
@@ -1,151 +0,0 @@
|
||||
#ifndef __608_H__
|
||||
|
||||
enum cc_modes
|
||||
{
|
||||
MODE_POPON = 0,
|
||||
MODE_ROLLUP_2 = 1,
|
||||
MODE_ROLLUP_3 = 2,
|
||||
MODE_ROLLUP_4 = 3,
|
||||
MODE_TEXT = 4,
|
||||
MODE_PAINTON = 5,
|
||||
// Fake modes to emulate stuff
|
||||
MODE_FAKE_ROLLUP_1 = 100
|
||||
};
|
||||
|
||||
struct eia608_screen // A CC buffer
|
||||
{
|
||||
unsigned char characters[15][33];
|
||||
unsigned char colors[15][33];
|
||||
unsigned char fonts[15][33]; // Extra char at the end for a 0
|
||||
int row_used[15]; // Any data in row?
|
||||
int empty; // Buffer completely empty?
|
||||
};
|
||||
|
||||
struct s_context_cc608
|
||||
{
|
||||
struct eia608_screen buffer1;
|
||||
struct eia608_screen buffer2;
|
||||
int cursor_row, cursor_column;
|
||||
int visible_buffer;
|
||||
int srt_counter; // Number of subs currently written
|
||||
int screenfuls_counter; // Number of meaningful screenfuls written
|
||||
LLONG current_visible_start_ms; // At what time did the current visible buffer became so?
|
||||
// unsigned current_visible_start_cc; // At what time did the current visible buffer became so?
|
||||
enum cc_modes mode;
|
||||
unsigned char last_c1, last_c2;
|
||||
int channel; // Currently selected channel
|
||||
unsigned char color; // Color we are currently using to write
|
||||
unsigned char font; // Font we are currently using to write
|
||||
int rollup_base_row;
|
||||
LLONG ts_start_of_current_line; /* Time at which the first character for current line was received, =-1 no character received yet */
|
||||
LLONG ts_last_char_received; /* Time at which the last written character was received, =-1 no character received yet */
|
||||
int new_channel; // The new channel after a channel change
|
||||
int my_field; // Used for sanity checks
|
||||
long bytes_processed_608; // To be written ONLY by process_608
|
||||
struct ccx_s_write *out;
|
||||
int have_cursor_position;
|
||||
};
|
||||
|
||||
extern unsigned char *enc_buffer;
|
||||
extern unsigned char str[2048];
|
||||
extern unsigned enc_buffer_used;
|
||||
extern unsigned enc_buffer_capacity;
|
||||
|
||||
extern int new_sentence;
|
||||
extern const char *color_text[][2];
|
||||
|
||||
int write_cc_buffer_as_srt(struct eia608_screen *data, struct s_context_cc608 *context);
|
||||
void write_stringz_as_srt(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
|
||||
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data);
|
||||
void capitalize (int line_num, struct eia608_screen *data);
|
||||
void correct_case (int line_num, struct eia608_screen *data);
|
||||
int write_cc_buffer_as_sami(struct eia608_screen *data, struct s_context_cc608 *context);
|
||||
void write_stringz_as_sami(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
|
||||
int write_cc_buffer_as_smptett(struct eia608_screen *data, struct s_context_cc608 *context);
|
||||
void write_stringz_as_smptett(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
|
||||
void correct_case (int line_num, struct eia608_screen *data);
|
||||
void capitalize (int line_num, struct eia608_screen *data);
|
||||
void find_limit_characters (unsigned char *line, int *first_non_blank, int *last_non_blank);
|
||||
unsigned get_decoder_line_basic (unsigned char *buffer, int line_num, struct eia608_screen *data);
|
||||
unsigned get_decoder_line_encoded_for_gui (unsigned char *buffer, int line_num, struct eia608_screen *data);
|
||||
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data);
|
||||
void delete_all_lines_but_current (struct eia608_screen *data, int row);
|
||||
void try_to_add_start_credits(struct s_context_cc608 *context);
|
||||
void try_to_add_end_credits(struct s_context_cc608 *context);
|
||||
void write_cc_buffer_to_gui(struct eia608_screen *data, struct s_context_cc608 *context);
|
||||
|
||||
void handle_end_of_data(struct s_context_cc608 *context);
|
||||
void process608(const unsigned char *data, int length, struct s_context_cc608 *context);
|
||||
void get_char_in_latin_1 (unsigned char *buffer, unsigned char c);
|
||||
void get_char_in_unicode (unsigned char *buffer, unsigned char c);
|
||||
int get_char_in_utf_8 (unsigned char *buffer, unsigned char c);
|
||||
unsigned char cctolower (unsigned char c);
|
||||
unsigned char cctoupper (unsigned char c);
|
||||
int general_608_init (void);
|
||||
LLONG get_visible_end (void);
|
||||
|
||||
#define CC608_SCREEN_WIDTH 32
|
||||
|
||||
#define REQUEST_BUFFER_CAPACITY(length) if (length>enc_buffer_capacity) \
|
||||
{enc_buffer_capacity=length*2; enc_buffer=(unsigned char*) realloc (enc_buffer, enc_buffer_capacity); \
|
||||
if (enc_buffer==NULL) { fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory, bailing out\n"); } \
|
||||
}
|
||||
|
||||
|
||||
enum color_code
|
||||
{
|
||||
COL_WHITE = 0,
|
||||
COL_GREEN = 1,
|
||||
COL_BLUE = 2,
|
||||
COL_CYAN = 3,
|
||||
COL_RED = 4,
|
||||
COL_YELLOW = 5,
|
||||
COL_MAGENTA = 6,
|
||||
COL_USERDEFINED = 7,
|
||||
COL_BLACK = 8,
|
||||
COL_TRANSPARENT = 9
|
||||
};
|
||||
|
||||
|
||||
enum font_bits
|
||||
{
|
||||
FONT_REGULAR = 0,
|
||||
FONT_ITALICS = 1,
|
||||
FONT_UNDERLINED = 2,
|
||||
FONT_UNDERLINED_ITALICS = 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
enum command_code
|
||||
{
|
||||
COM_UNKNOWN = 0,
|
||||
COM_ERASEDISPLAYEDMEMORY = 1,
|
||||
COM_RESUMECAPTIONLOADING = 2,
|
||||
COM_ENDOFCAPTION = 3,
|
||||
COM_TABOFFSET1 = 4,
|
||||
COM_TABOFFSET2 = 5,
|
||||
COM_TABOFFSET3 = 6,
|
||||
COM_ROLLUP2 = 7,
|
||||
COM_ROLLUP3 = 8,
|
||||
COM_ROLLUP4 = 9,
|
||||
COM_CARRIAGERETURN = 10,
|
||||
COM_ERASENONDISPLAYEDMEMORY = 11,
|
||||
COM_BACKSPACE = 12,
|
||||
COM_RESUMETEXTDISPLAY = 13,
|
||||
COM_ALARMOFF =14,
|
||||
COM_ALARMON = 15,
|
||||
COM_DELETETOENDOFROW = 16,
|
||||
COM_RESUMEDIRECTCAPTIONING = 17,
|
||||
// Non existing commands we insert to have the decoder
|
||||
// special stuff for us.
|
||||
COM_FAKE_RULLUP1 = 18
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define __608_H__
|
||||
#endif
|
||||
@@ -1,438 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
#include "utility.h"
|
||||
//extern unsigned char encoded_crlf[16];
|
||||
|
||||
// Encodes a generic string. Note that since we use the encoders for closed caption
|
||||
// data, text would have to be encoded as CCs... so using special characters here
|
||||
// it's a bad idea.
|
||||
unsigned encode_line (unsigned char *buffer, unsigned char *text)
|
||||
{
|
||||
unsigned bytes=0;
|
||||
while (*text)
|
||||
{
|
||||
switch (ccx_options.encoding)
|
||||
{
|
||||
case CCX_ENC_UTF_8:
|
||||
case CCX_ENC_LATIN_1:
|
||||
*buffer=*text;
|
||||
bytes++;
|
||||
buffer++;
|
||||
break;
|
||||
case CCX_ENC_UNICODE:
|
||||
*buffer=*text;
|
||||
*(buffer+1)=0;
|
||||
bytes+=2;
|
||||
buffer+=2;
|
||||
break;
|
||||
}
|
||||
text++;
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
void correct_case(int line_num,struct eia608_screen *data)
|
||||
{
|
||||
char delim[64] = {
|
||||
' ' ,'\n','\r', 0x89,0x99,
|
||||
'!' , '"', '#', '%' , '&',
|
||||
'\'', '(', ')', ';' , '<',
|
||||
'=' , '>', '?', '[' ,'\\',
|
||||
']' , '*', '+', ',' , '-',
|
||||
'.' , '/', ':', '^' , '_',
|
||||
'{' , '|', '}', '~' ,'\0' };
|
||||
|
||||
char *line = strdup(((char*)data->characters[line_num]));
|
||||
char *oline = (char*)data->characters[line_num];
|
||||
char *c = strtok(line,delim);
|
||||
do
|
||||
{
|
||||
char **index = bsearch(&c,spell_lower,spell_words,sizeof(*spell_lower),string_cmp);
|
||||
|
||||
if(index)
|
||||
{
|
||||
char *correct_c = *(spell_correct + (index - spell_lower));
|
||||
size_t len=strlen (correct_c);
|
||||
memcpy(oline + (c - line),correct_c,len);
|
||||
}
|
||||
} while ( ( c = strtok(NULL,delim) ) != NULL );
|
||||
free(line);
|
||||
}
|
||||
|
||||
void capitalize (int line_num, struct eia608_screen *data)
|
||||
{
|
||||
for (int i=0;i<CC608_SCREEN_WIDTH;i++)
|
||||
{
|
||||
switch (data->characters[line_num][i])
|
||||
{
|
||||
case ' ':
|
||||
case 0x89: // This is a transparent space
|
||||
case '-':
|
||||
break;
|
||||
case '.': // Fallthrough
|
||||
case '?': // Fallthrough
|
||||
case '!':
|
||||
case ':':
|
||||
new_sentence=1;
|
||||
break;
|
||||
default:
|
||||
if (new_sentence)
|
||||
data->characters[line_num][i]=cctoupper (data->characters[line_num][i]);
|
||||
else
|
||||
data->characters[line_num][i]=cctolower (data->characters[line_num][i]);
|
||||
new_sentence=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void find_limit_characters (unsigned char *line, int *first_non_blank, int *last_non_blank)
|
||||
{
|
||||
*last_non_blank=-1;
|
||||
*first_non_blank=-1;
|
||||
for (int i=0;i<CC608_SCREEN_WIDTH;i++)
|
||||
{
|
||||
unsigned char c=line[i];
|
||||
if (c!=' ' && c!=0x89)
|
||||
{
|
||||
if (*first_non_blank==-1)
|
||||
*first_non_blank=i;
|
||||
*last_non_blank=i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned get_decoder_line_basic (unsigned char *buffer, int line_num, struct eia608_screen *data)
|
||||
{
|
||||
unsigned char *line = data->characters[line_num];
|
||||
int last_non_blank=-1;
|
||||
int first_non_blank=-1;
|
||||
unsigned char *orig=buffer; // Keep for debugging
|
||||
find_limit_characters (line, &first_non_blank, &last_non_blank);
|
||||
if (!ccx_options.trim_subs)
|
||||
first_non_blank=0;
|
||||
|
||||
if (first_non_blank==-1)
|
||||
{
|
||||
*buffer=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bytes=0;
|
||||
for (int i=first_non_blank;i<=last_non_blank;i++)
|
||||
{
|
||||
char c=line[i];
|
||||
switch (ccx_options.encoding)
|
||||
{
|
||||
case CCX_ENC_UTF_8:
|
||||
bytes=get_char_in_utf_8 (buffer,c);
|
||||
break;
|
||||
case CCX_ENC_LATIN_1:
|
||||
get_char_in_latin_1 (buffer,c);
|
||||
bytes=1;
|
||||
break;
|
||||
case CCX_ENC_UNICODE:
|
||||
get_char_in_unicode (buffer,c);
|
||||
bytes=2;
|
||||
break;
|
||||
}
|
||||
buffer+=bytes;
|
||||
}
|
||||
*buffer=0;
|
||||
return (unsigned) (buffer-orig); // Return length
|
||||
}
|
||||
|
||||
unsigned get_decoder_line_encoded_for_gui (unsigned char *buffer, int line_num, struct eia608_screen *data)
|
||||
{
|
||||
unsigned char *line = data->characters[line_num];
|
||||
unsigned char *orig=buffer; // Keep for debugging
|
||||
int first=0, last=31;
|
||||
find_limit_characters(line,&first,&last);
|
||||
for (int i=first;i<=last;i++)
|
||||
{
|
||||
get_char_in_latin_1 (buffer,line[i]);
|
||||
buffer++;
|
||||
}
|
||||
*buffer=0;
|
||||
return (unsigned) (buffer-orig); // Return length
|
||||
|
||||
}
|
||||
|
||||
unsigned char *close_tag (unsigned char *buffer, char *tagstack, char tagtype, int *punderlined, int *pitalics, int *pchanged_font)
|
||||
{
|
||||
for (int l=strlen (tagstack)-1; l>=0;l--)
|
||||
{
|
||||
char cur=tagstack[l];
|
||||
switch (cur)
|
||||
{
|
||||
case 'F':
|
||||
buffer+= encode_line (buffer,(unsigned char *) "</font>");
|
||||
(*pchanged_font)--;
|
||||
break;
|
||||
case 'U':
|
||||
buffer+=encode_line (buffer, (unsigned char *) "</u>");
|
||||
(*punderlined)--;
|
||||
break;
|
||||
case 'I':
|
||||
buffer+=encode_line (buffer, (unsigned char *) "</i>");
|
||||
(*pitalics)--;
|
||||
break;
|
||||
}
|
||||
tagstack[l]=0; // Remove from stack
|
||||
if (cur==tagtype) // We closed up to the required tag, done
|
||||
return buffer;
|
||||
}
|
||||
if (tagtype!='A') // All
|
||||
fatal (EXIT_BUG_BUG, "Mismatched tags in encoding, this is a bug, please report");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data)
|
||||
{
|
||||
int col = COL_WHITE;
|
||||
int underlined = 0;
|
||||
int italics = 0;
|
||||
int changed_font=0;
|
||||
char tagstack[128]=""; // Keep track of opening/closing tags
|
||||
|
||||
unsigned char *line = data->characters[line_num];
|
||||
unsigned char *orig=buffer; // Keep for debugging
|
||||
int first=0, last=31;
|
||||
if (ccx_options.trim_subs)
|
||||
find_limit_characters(line,&first,&last);
|
||||
for (int i=first;i<=last;i++)
|
||||
{
|
||||
// Handle color
|
||||
int its_col = data->colors[line_num][i];
|
||||
if (its_col != col && !ccx_options.nofontcolor &&
|
||||
!(col==COL_USERDEFINED && its_col==COL_WHITE)) // Don't replace user defined with white
|
||||
{
|
||||
if (changed_font)
|
||||
buffer = close_tag(buffer,tagstack,'F',&underlined,&italics,&changed_font);
|
||||
// Add new font tag
|
||||
buffer+=encode_line (buffer, (unsigned char*) color_text[its_col][1]);
|
||||
if (its_col==COL_USERDEFINED)
|
||||
{
|
||||
// The previous sentence doesn't copy the whole
|
||||
// <font> tag, just up to the quote before the color
|
||||
buffer+=encode_line (buffer, (unsigned char*) usercolor_rgb);
|
||||
buffer+=encode_line (buffer, (unsigned char*) "\">");
|
||||
}
|
||||
if (color_text[its_col][1][0]) // That means a <font> was added to the buffer
|
||||
{
|
||||
strcat (tagstack,"F");
|
||||
changed_font++;
|
||||
}
|
||||
col = its_col;
|
||||
}
|
||||
// Handle underlined
|
||||
int is_underlined = data->fonts[line_num][i] & FONT_UNDERLINED;
|
||||
if (is_underlined && underlined==0 && !ccx_options.notypesetting) // Open underline
|
||||
{
|
||||
buffer+=encode_line (buffer, (unsigned char *) "<u>");
|
||||
strcat (tagstack,"U");
|
||||
underlined++;
|
||||
}
|
||||
if (is_underlined==0 && underlined && !ccx_options.notypesetting) // Close underline
|
||||
{
|
||||
buffer = close_tag(buffer,tagstack,'U',&underlined,&italics,&changed_font);
|
||||
}
|
||||
// Handle italics
|
||||
int has_ita = data->fonts[line_num][i] & FONT_ITALICS;
|
||||
if (has_ita && italics==0 && !ccx_options.notypesetting) // Open italics
|
||||
{
|
||||
buffer+=encode_line (buffer, (unsigned char *) "<i>");
|
||||
strcat (tagstack,"I");
|
||||
italics++;
|
||||
}
|
||||
if (has_ita==0 && italics && !ccx_options.notypesetting) // Close italics
|
||||
{
|
||||
buffer = close_tag(buffer,tagstack,'I',&underlined,&italics,&changed_font);
|
||||
}
|
||||
int bytes=0;
|
||||
switch (ccx_options.encoding)
|
||||
{
|
||||
case CCX_ENC_UTF_8:
|
||||
bytes=get_char_in_utf_8 (buffer,line[i]);
|
||||
break;
|
||||
case CCX_ENC_LATIN_1:
|
||||
get_char_in_latin_1 (buffer,line[i]);
|
||||
bytes=1;
|
||||
break;
|
||||
case CCX_ENC_UNICODE:
|
||||
get_char_in_unicode (buffer,line[i]);
|
||||
bytes=2;
|
||||
break;
|
||||
}
|
||||
buffer+=bytes;
|
||||
}
|
||||
buffer = close_tag(buffer,tagstack,'A',&underlined,&italics,&changed_font);
|
||||
if (underlined || italics || changed_font)
|
||||
fatal (EXIT_BUG_BUG, "Not all tags closed in encoding, this is a bug, please report.\n");
|
||||
*buffer=0;
|
||||
return (unsigned) (buffer-orig); // Return length
|
||||
}
|
||||
|
||||
|
||||
void delete_all_lines_but_current (struct eia608_screen *data, int row)
|
||||
{
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (i!=row)
|
||||
{
|
||||
memset(data->characters[i],' ',CC608_SCREEN_WIDTH);
|
||||
data->characters[i][CC608_SCREEN_WIDTH]=0;
|
||||
memset (data->colors[i],ccx_options.cc608_default_color,CC608_SCREEN_WIDTH+1);
|
||||
memset (data->fonts[i],FONT_REGULAR,CC608_SCREEN_WIDTH+1);
|
||||
data->row_used[i]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fprintf_encoded (FILE *fh, const char *string)
|
||||
{
|
||||
REQUEST_BUFFER_CAPACITY(strlen (string)*3);
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) string);
|
||||
fwrite (enc_buffer,enc_buffer_used,1,fh);
|
||||
}
|
||||
|
||||
void write_cc_buffer_to_gui(struct eia608_screen *data, struct s_context_cc608 *context)
|
||||
{
|
||||
unsigned h1,m1,s1,ms1;
|
||||
unsigned h2,m2,s2,ms2;
|
||||
LLONG ms_start;
|
||||
int with_data=0;
|
||||
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
with_data=1;
|
||||
}
|
||||
if (!with_data)
|
||||
return;
|
||||
|
||||
ms_start= context->current_visible_start_ms;
|
||||
|
||||
ms_start+=subs_delay;
|
||||
if (ms_start<0) // Drop screens that because of subs_delay start too early
|
||||
return;
|
||||
int time_reported=0;
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
{
|
||||
fprintf (stderr, "###SUBTITLE#");
|
||||
if (!time_reported)
|
||||
{
|
||||
LLONG ms_end = get_fts()+subs_delay;
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
// Note, only MM:SS here as we need to save space in the preview window
|
||||
fprintf (stderr, "%02u:%02u#%02u:%02u#",
|
||||
h1*60+m1,s1, h2*60+m2,s2);
|
||||
time_reported=1;
|
||||
}
|
||||
else
|
||||
fprintf (stderr, "##");
|
||||
|
||||
// We don't capitalize here because whatever function that was used
|
||||
// before to write to file already took care of it.
|
||||
int length = get_decoder_line_encoded_for_gui (subline, i, data);
|
||||
fwrite (subline, 1, length, stderr);
|
||||
fwrite ("\n",1,1,stderr);
|
||||
}
|
||||
}
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
void try_to_add_end_credits(struct s_context_cc608 *context)
|
||||
{
|
||||
LLONG window, length, st, end;
|
||||
if (context->out->fh == -1)
|
||||
return;
|
||||
window=get_fts()-last_displayed_subs_ms-1;
|
||||
if (window<ccx_options.endcreditsforatleast.time_in_ms) // Won't happen, window is too short
|
||||
return;
|
||||
length=ccx_options.endcreditsforatmost.time_in_ms > window ?
|
||||
window : ccx_options.endcreditsforatmost.time_in_ms;
|
||||
|
||||
st=get_fts()-length-1;
|
||||
end=get_fts();
|
||||
|
||||
switch (ccx_options.write_format)
|
||||
{
|
||||
case CCX_OF_SRT:
|
||||
write_stringz_as_srt(ccx_options.end_credits_text, context, st, end);
|
||||
break;
|
||||
case CCX_OF_SAMI:
|
||||
write_stringz_as_sami(ccx_options.end_credits_text, context, st, end);
|
||||
break;
|
||||
case CCX_OF_SMPTETT:
|
||||
write_stringz_as_smptett(ccx_options.end_credits_text, context, st, end);
|
||||
break ;
|
||||
default:
|
||||
// Do nothing for the rest
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void try_to_add_start_credits(struct s_context_cc608 *context)
|
||||
{
|
||||
LLONG st, end, window, length;
|
||||
LLONG l = context->current_visible_start_ms + subs_delay;
|
||||
// We have a windows from last_displayed_subs_ms to l - we need to see if it fits
|
||||
|
||||
if (l<ccx_options.startcreditsnotbefore.time_in_ms) // Too early
|
||||
return;
|
||||
|
||||
if (last_displayed_subs_ms+1 > ccx_options.startcreditsnotafter.time_in_ms) // Too late
|
||||
return;
|
||||
|
||||
st = ccx_options.startcreditsnotbefore.time_in_ms>(last_displayed_subs_ms+1) ?
|
||||
ccx_options.startcreditsnotbefore.time_in_ms : (last_displayed_subs_ms+1); // When would credits actually start
|
||||
|
||||
end = ccx_options.startcreditsnotafter.time_in_ms<(l-1) ?
|
||||
ccx_options.startcreditsnotafter.time_in_ms : (l-1);
|
||||
|
||||
window = end-st; // Allowable time in MS
|
||||
|
||||
if (ccx_options.startcreditsforatleast.time_in_ms>window) // Window is too short
|
||||
return;
|
||||
|
||||
length=ccx_options.startcreditsforatmost.time_in_ms > window ?
|
||||
window : ccx_options.startcreditsforatmost.time_in_ms;
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Last subs: %lld Current position: %lld\n",
|
||||
last_displayed_subs_ms, l);
|
||||
dbg_print(CCX_DMT_VERBOSE, "Not before: %lld Not after: %lld\n",
|
||||
ccx_options.startcreditsnotbefore.time_in_ms,
|
||||
ccx_options.startcreditsnotafter.time_in_ms);
|
||||
dbg_print(CCX_DMT_VERBOSE, "Start of window: %lld End of window: %lld\n",st,end);
|
||||
|
||||
if (window>length+2)
|
||||
{
|
||||
// Center in time window
|
||||
LLONG pad=window-length;
|
||||
st+=(pad/2);
|
||||
}
|
||||
end=st+length;
|
||||
switch (ccx_options.write_format)
|
||||
{
|
||||
case CCX_OF_SRT:
|
||||
write_stringz_as_srt(ccx_options.start_credits_text,context,st,end);
|
||||
break;
|
||||
case CCX_OF_SAMI:
|
||||
write_stringz_as_sami(ccx_options.start_credits_text, context, st, end);
|
||||
break;
|
||||
case CCX_OF_SMPTETT:
|
||||
write_stringz_as_smptett(ccx_options.start_credits_text, context, st, end);
|
||||
break;
|
||||
default:
|
||||
// Do nothing for the rest
|
||||
break;
|
||||
}
|
||||
startcredits_displayed=1;
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
129
src/608_sami.c
129
src/608_sami.c
@@ -1,129 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
void write_stringz_as_sami(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
|
||||
{
|
||||
sprintf ((char *) str,
|
||||
"<SYNC start=%llu><P class=\"UNKNOWNCC\">\r\n",
|
||||
(unsigned long long)ms_start);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write (context->out->fh, enc_buffer,enc_buffer_used);
|
||||
int len=strlen (string);
|
||||
unsigned char *unescaped= (unsigned char *) malloc (len+1);
|
||||
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
|
||||
if (el==NULL || unescaped==NULL)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_sami() - not enough memory.\n");
|
||||
int pos_r=0;
|
||||
int pos_w=0;
|
||||
// Scan for \n in the string and replace it with a 0
|
||||
while (pos_r<len)
|
||||
{
|
||||
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
|
||||
{
|
||||
unescaped[pos_w]=0;
|
||||
pos_r+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
unescaped[pos_w]=string[pos_r];
|
||||
pos_r++;
|
||||
}
|
||||
pos_w++;
|
||||
}
|
||||
unescaped[pos_w]=0;
|
||||
// Now read the unescaped string (now several string'z and write them)
|
||||
unsigned char *begin=unescaped;
|
||||
while (begin<unescaped+len)
|
||||
{
|
||||
unsigned int u = encode_line (el, begin);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write(context->out->fh, el, u);
|
||||
write(context->out->fh, encoded_br, encoded_br_length);
|
||||
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
begin+= strlen ((const char *) begin)+1;
|
||||
}
|
||||
|
||||
sprintf ((char *) str,"</P></SYNC>\r\n");
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
sprintf ((char *) str,
|
||||
"<SYNC start=%llu><P class=\"UNKNOWNCC\"> </P></SYNC>\r\n\r\n",
|
||||
(unsigned long long)ms_end);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int write_cc_buffer_as_sami(struct eia608_screen *data, struct s_context_cc608 *context)
|
||||
{
|
||||
LLONG startms, endms;
|
||||
int wrote_something=0;
|
||||
startms = context->current_visible_start_ms;
|
||||
|
||||
startms+=subs_delay;
|
||||
if (startms<0) // Drop screens that because of subs_delay start too early
|
||||
return 0;
|
||||
|
||||
endms = get_visible_end()+subs_delay;
|
||||
endms--; // To prevent overlapping with next line.
|
||||
sprintf ((char *) str,
|
||||
"<SYNC start=%llu><P class=\"UNKNOWNCC\">\r\n",
|
||||
(unsigned long long)startms);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write (context->out->fh, enc_buffer,enc_buffer_used);
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
{
|
||||
int length = get_decoder_line_encoded (subline, i, data);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write (context->out->fh, subline, length);
|
||||
wrote_something=1;
|
||||
if (i!=14)
|
||||
write (context->out->fh, encoded_br, encoded_br_length);
|
||||
write (context->out->fh,encoded_crlf, encoded_crlf_length);
|
||||
}
|
||||
}
|
||||
sprintf ((char *) str,"</P></SYNC>\r\n");
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
sprintf ((char *) str,
|
||||
"<SYNC start=%llu><P class=\"UNKNOWNCC\"> </P></SYNC>\r\n\r\n",
|
||||
(unsigned long long)endms);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
return wrote_something;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
// Produces minimally-compliant SMPTE Timed Text (W3C TTML)
|
||||
// format-compatible output
|
||||
|
||||
// See http://www.w3.org/TR/ttaf1-dfxp/ and
|
||||
// https://www.smpte.org/sites/default/files/st2052-1-2010.pdf
|
||||
|
||||
// Copyright (C) 2012 John Kemp
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
void write_stringz_as_smptett(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
|
||||
{
|
||||
unsigned h1,m1,s1,ms1;
|
||||
unsigned h2,m2,s2,ms2;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2);
|
||||
|
||||
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\" end=\"%02u:%02u:%02u.%03u\">\r\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write (context->out->fh, enc_buffer,enc_buffer_used);
|
||||
int len=strlen (string);
|
||||
unsigned char *unescaped= (unsigned char *) malloc (len+1);
|
||||
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
|
||||
if (el==NULL || unescaped==NULL)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_sami() - not enough memory.\n");
|
||||
int pos_r=0;
|
||||
int pos_w=0;
|
||||
// Scan for \n in the string and replace it with a 0
|
||||
while (pos_r<len)
|
||||
{
|
||||
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
|
||||
{
|
||||
unescaped[pos_w]=0;
|
||||
pos_r+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
unescaped[pos_w]=string[pos_r];
|
||||
pos_r++;
|
||||
}
|
||||
pos_w++;
|
||||
}
|
||||
unescaped[pos_w]=0;
|
||||
// Now read the unescaped string (now several string'z and write them)
|
||||
unsigned char *begin=unescaped;
|
||||
while (begin<unescaped+len)
|
||||
{
|
||||
unsigned int u = encode_line (el, begin);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write(context->out->fh, el, u);
|
||||
//write (wb->fh, encoded_br, encoded_br_length);
|
||||
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
begin+= strlen ((const char *) begin)+1;
|
||||
}
|
||||
|
||||
sprintf ((char *) str,"</p>\n");
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\">\n\n",h2,m2,s2,ms2);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write (context->out->fh, enc_buffer,enc_buffer_used);
|
||||
sprintf ((char *) str,"</p>\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int write_cc_buffer_as_smptett(struct eia608_screen *data, struct s_context_cc608 *context)
|
||||
{
|
||||
unsigned h1,m1,s1,ms1;
|
||||
unsigned h2,m2,s2,ms2;
|
||||
LLONG endms;
|
||||
int wrote_something=0;
|
||||
LLONG startms = context->current_visible_start_ms;
|
||||
|
||||
startms+=subs_delay;
|
||||
if (startms<0) // Drop screens that because of subs_delay start too early
|
||||
return 0;
|
||||
|
||||
endms = get_visible_end()+subs_delay;
|
||||
endms--; // To prevent overlapping with next line.
|
||||
mstotime (startms,&h1,&m1,&s1,&ms1);
|
||||
mstotime (endms-1,&h2,&m2,&s2,&ms2);
|
||||
|
||||
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\" end=\"%02u:%02u:%02u,%03u\">\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
{
|
||||
int length = get_decoder_line_encoded (subline, i, data);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write(context->out->fh, subline, length);
|
||||
wrote_something=1;
|
||||
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
}
|
||||
}
|
||||
sprintf ((char *) str,"</p>\n");
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r%s\n", str);
|
||||
}
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
|
||||
//write (wb->fh, enc_buffer,enc_buffer_used);
|
||||
|
||||
return wrote_something;
|
||||
}
|
||||
279
src/608_spupng.c
279
src/608_spupng.c
@@ -1,279 +0,0 @@
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include "608_spupng.h"
|
||||
|
||||
void
|
||||
draw_row(struct eia608_screen* data, int row, uint8_t * canvas, int rowstride)
|
||||
{
|
||||
int column;
|
||||
int unicode = 0;
|
||||
uint8_t pen[2];
|
||||
uint8_t* cell;
|
||||
int first = -1;
|
||||
int last = 0;
|
||||
|
||||
pen[0] = COL_BLACK;
|
||||
|
||||
for (column = 0; column < COLUMNS ; column++) {
|
||||
|
||||
if (COL_TRANSPARENT != data->colors[row][column])
|
||||
{
|
||||
cell = canvas + ((column+1) * CCW);
|
||||
get_char_in_unicode((unsigned char*)&unicode, data->characters[row][column]);
|
||||
pen[1] = data->colors[row][column];
|
||||
|
||||
int attr = data->fonts[row][column];
|
||||
draw_char_indexed(cell, rowstride, pen, unicode, (attr & FONT_ITALICS) != 0, (attr & FONT_UNDERLINED) != 0);
|
||||
if (first < 0)
|
||||
{
|
||||
// draw a printable space before the first non-space char
|
||||
first = column;
|
||||
if (unicode != 0x20)
|
||||
{
|
||||
cell = canvas + ((first) * CCW);
|
||||
draw_char_indexed(cell, rowstride, pen, 0x20, 0, 0);
|
||||
}
|
||||
}
|
||||
last = column;
|
||||
}
|
||||
}
|
||||
// draw a printable space after the last non-space char
|
||||
// unicode should still contain the last character
|
||||
// check whether it is a space
|
||||
if (unicode != 0x20)
|
||||
{
|
||||
cell = canvas + ((last+2) * CCW);
|
||||
draw_char_indexed(cell, rowstride, pen, 0x20, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static png_color palette[10] =
|
||||
{
|
||||
{ 0xff, 0xff, 0xff }, // COL_WHITE = 0,
|
||||
{ 0x00, 0xff, 0x00 }, // COL_GREEN = 1,
|
||||
{ 0x00, 0x00, 0xff }, // COL_BLUE = 2,
|
||||
{ 0x00, 0xff, 0xff }, // COL_CYAN = 3,
|
||||
{ 0xff, 0x00, 0x00 }, // COL_RED = 4,
|
||||
{ 0xff, 0xff, 0x00 }, // COL_YELLOW = 5,
|
||||
{ 0xff, 0x00, 0xff }, // COL_MAGENTA = 6,
|
||||
{ 0xff, 0xff, 0xff }, // COL_USERDEFINED = 7,
|
||||
{ 0x00, 0x00, 0x00 }, // COL_BLACK = 8
|
||||
{ 0x00, 0x00, 0x00 } // COL_TRANSPARENT = 9
|
||||
};
|
||||
|
||||
static png_byte alpha[10] =
|
||||
{
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
0
|
||||
};
|
||||
|
||||
int
|
||||
spupng_write_png(struct spupng_t *sp, struct eia608_screen* data,
|
||||
png_structp png_ptr, png_infop info_ptr,
|
||||
png_bytep image,
|
||||
png_bytep* row_pointer,
|
||||
unsigned int ww, unsigned int wh)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
return 0;
|
||||
|
||||
png_init_io (png_ptr, sp->fppng);
|
||||
|
||||
png_set_IHDR (png_ptr,
|
||||
info_ptr,
|
||||
ww,
|
||||
wh,
|
||||
/* bit_depth */ 8,
|
||||
PNG_COLOR_TYPE_PALETTE,
|
||||
PNG_INTERLACE_NONE,
|
||||
PNG_COMPRESSION_TYPE_DEFAULT,
|
||||
PNG_FILTER_TYPE_DEFAULT);
|
||||
|
||||
png_set_PLTE (png_ptr, info_ptr, palette, sizeof(palette) / sizeof(palette[0]));
|
||||
png_set_tRNS (png_ptr, info_ptr, alpha, sizeof(alpha) / sizeof(alpha[0]), NULL);
|
||||
|
||||
png_set_gAMA (png_ptr, info_ptr, 1.0 / 2.2);
|
||||
|
||||
png_write_info (png_ptr, info_ptr);
|
||||
|
||||
for (i = 0; i < wh; i++)
|
||||
row_pointer[i] = image + i * ww;
|
||||
|
||||
png_write_image (png_ptr, row_pointer);
|
||||
|
||||
png_write_end (png_ptr, info_ptr);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
spupng_export_png(struct spupng_t *sp, struct eia608_screen* data)
|
||||
{
|
||||
png_structp png_ptr;
|
||||
png_infop info_ptr;
|
||||
png_bytep *row_pointer;
|
||||
png_bytep image;
|
||||
int ww, wh, rowstride, row_adv;
|
||||
int row;
|
||||
|
||||
assert ((sizeof(png_byte) == sizeof(uint8_t))
|
||||
&& (sizeof(*image) == sizeof(uint8_t)));
|
||||
|
||||
// Allow space at beginning and end of each row for a padding space
|
||||
ww = CCW * (COLUMNS+2);
|
||||
wh = CCH * ROWS;
|
||||
row_adv = (COLUMNS+2) * CCW * CCH;
|
||||
|
||||
rowstride = ww * sizeof(*image);
|
||||
|
||||
if (!(row_pointer = (png_bytep*)malloc(sizeof(*row_pointer) * wh))) {
|
||||
mprint("Unable to allocate %d byte buffer.\n",
|
||||
sizeof(*row_pointer) * wh);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(image = (png_bytep)malloc(wh * ww * sizeof(*image)))) {
|
||||
mprint("Unable to allocate %d KB image buffer.",
|
||||
wh * ww * sizeof(*image) / 1024);
|
||||
free(row_pointer);
|
||||
return 0;
|
||||
}
|
||||
// Initialize image to transparent
|
||||
memset(image, COL_TRANSPARENT, wh * ww * sizeof(*image));
|
||||
|
||||
/* draw the image */
|
||||
|
||||
for (row = 0; row < ROWS; row++) {
|
||||
if (data->row_used[row])
|
||||
draw_row(data, row, image + row * row_adv, rowstride);
|
||||
}
|
||||
|
||||
/* Now save the image */
|
||||
|
||||
if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
|
||||
NULL, NULL, NULL)))
|
||||
goto unknown_error;
|
||||
|
||||
if (!(info_ptr = png_create_info_struct(png_ptr))) {
|
||||
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
|
||||
goto unknown_error;
|
||||
}
|
||||
|
||||
if (!spupng_write_png (sp, data, png_ptr, info_ptr, image, row_pointer, ww, wh)) {
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
goto write_error;
|
||||
}
|
||||
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
|
||||
free (row_pointer);
|
||||
|
||||
free (image);
|
||||
|
||||
return 1;
|
||||
|
||||
write_error:
|
||||
|
||||
unknown_error:
|
||||
free (row_pointer);
|
||||
|
||||
free (image);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
spupng_write_ccbuffer(struct spupng_t *sp, struct eia608_screen* data,
|
||||
struct s_context_cc608 *context)
|
||||
{
|
||||
LLONG ms_start = context->current_visible_start_ms + subs_delay;
|
||||
if (ms_start < 0)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "Negative start\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int row;
|
||||
int empty_buf = 1;
|
||||
char str[256] = "";
|
||||
for (row = 0; row < 15; row++)
|
||||
{
|
||||
if (data->row_used[row])
|
||||
{
|
||||
empty_buf = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty_buf)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "Blank page\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
LLONG ms_end = get_visible_end() + subs_delay;
|
||||
|
||||
sprintf(sp->pngfile, "%s/sub%04d.png", sp->dirname, sp->fileIndex++);
|
||||
if ((sp->fppng = fopen(sp->pngfile, "wb")) == NULL)
|
||||
{
|
||||
fatal(EXIT_FILE_CREATION_FAILED, "Cannot open %s: %s\n",
|
||||
sp->pngfile, strerror(errno));
|
||||
}
|
||||
if (!spupng_export_png(sp, data))
|
||||
{
|
||||
fatal(EXIT_FILE_CREATION_FAILED, "Cannot write %s: %s\n",
|
||||
sp->pngfile, strerror(errno));
|
||||
}
|
||||
fclose(sp->fppng);
|
||||
write_sputag(sp,ms_start,ms_end);
|
||||
for (row = 0; row < ROWS; row++)
|
||||
{
|
||||
if (data->row_used[row])
|
||||
{
|
||||
int len = get_decoder_line_encoded(subline, row, data);
|
||||
// Check for characters that spumux won't parse
|
||||
// null chars will be changed to space
|
||||
// pairs of dashes will be changed to underscores
|
||||
for (unsigned char* ptr = subline; ptr < subline+len; ptr++)
|
||||
{
|
||||
switch (*ptr)
|
||||
{
|
||||
case 0:
|
||||
*ptr = ' ';
|
||||
break;
|
||||
case '-':
|
||||
if (*(ptr+1) == '-')
|
||||
{
|
||||
*ptr++ = '_';
|
||||
*ptr = '_';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
strncat(str,(const char*)subline,256);
|
||||
strncat(str,"\n",256);
|
||||
}
|
||||
}
|
||||
|
||||
write_spucomment(sp,str);
|
||||
return 1;
|
||||
}
|
||||
int write_cc_buffer_as_spupng(struct eia608_screen *data,struct s_context_cc608 *context)
|
||||
{
|
||||
if (0 != context->out->spupng_data)
|
||||
{
|
||||
struct spupng_t *sp = (struct spupng_t *) context->out->spupng_data;
|
||||
return spupng_write_ccbuffer(sp, data, context);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
195
src/608_srt.c
195
src/608_srt.c
@@ -1,195 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
|
||||
/* The timing here is not PTS based, but output based, i.e. user delay must be accounted for
|
||||
if there is any */
|
||||
void write_stringz_as_srt (char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
|
||||
{
|
||||
unsigned h1,m1,s1,ms1;
|
||||
unsigned h2,m2,s2,ms2;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
char timeline[128];
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u\r\n", context->srt_counter);
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
sprintf (timeline, "%02u:%02u:%02u,%03u --> %02u:%02u:%02u,%03u\r\n",
|
||||
h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
|
||||
dbg_print(CCX_DMT_608, "\n- - - SRT caption - - -\n");
|
||||
dbg_print(CCX_DMT_608, "%s",timeline);
|
||||
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
int len=strlen (string);
|
||||
unsigned char *unescaped= (unsigned char *) malloc (len+1);
|
||||
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
|
||||
if (el==NULL || unescaped==NULL)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_srt() - not enough memory.\n");
|
||||
int pos_r=0;
|
||||
int pos_w=0;
|
||||
// Scan for \n in the string and replace it with a 0
|
||||
while (pos_r<len)
|
||||
{
|
||||
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
|
||||
{
|
||||
unescaped[pos_w]=0;
|
||||
pos_r+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
unescaped[pos_w]=string[pos_r];
|
||||
pos_r++;
|
||||
}
|
||||
pos_w++;
|
||||
}
|
||||
unescaped[pos_w]=0;
|
||||
// Now read the unescaped string (now several string'z and write them)
|
||||
unsigned char *begin=unescaped;
|
||||
while (begin<unescaped+len)
|
||||
{
|
||||
unsigned int u = encode_line (el, begin);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write(context->out->fh, el, u);
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
begin+= strlen ((const char *) begin)+1;
|
||||
}
|
||||
|
||||
dbg_print(CCX_DMT_608, "- - - - - - - - - - - -\r\n");
|
||||
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
free(el);
|
||||
}
|
||||
|
||||
int write_cc_buffer_as_srt(struct eia608_screen *data, struct s_context_cc608 *context)
|
||||
{
|
||||
unsigned h1,m1,s1,ms1;
|
||||
unsigned h2,m2,s2,ms2;
|
||||
LLONG ms_start, ms_end;
|
||||
int wrote_something = 0;
|
||||
ms_start = context->current_visible_start_ms;
|
||||
|
||||
int prev_line_start=-1, prev_line_end=-1; // Column in which the previous line started and ended, for autodash
|
||||
int prev_line_center1=-1, prev_line_center2=-1; // Center column of previous line text
|
||||
int empty_buf=1;
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
{
|
||||
empty_buf=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty_buf) // Prevent writing empty screens. Not needed in .srt
|
||||
return 0;
|
||||
|
||||
ms_start+=subs_delay;
|
||||
if (ms_start<0) // Drop screens that because of subs_delay start too early
|
||||
return 0;
|
||||
|
||||
ms_end=get_visible_end()+subs_delay;
|
||||
|
||||
mstotime (ms_start,&h1,&m1,&s1,&ms1);
|
||||
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
|
||||
char timeline[128];
|
||||
context->srt_counter++;
|
||||
sprintf(timeline, "%u\r\n", context->srt_counter);
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
|
||||
write(context->out->fh, enc_buffer, enc_buffer_used);
|
||||
sprintf (timeline, "%02u:%02u:%02u,%03u --> %02u:%02u:%02u,%03u\r\n",
|
||||
h1,m1,s1,ms1, h2,m2,s2,ms2);
|
||||
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
|
||||
|
||||
dbg_print(CCX_DMT_608, "\n- - - SRT caption ( %d) - - -\n", context->srt_counter);
|
||||
dbg_print(CCX_DMT_608, "%s",timeline);
|
||||
|
||||
write (context->out->fh, enc_buffer,enc_buffer_used);
|
||||
for (int i=0;i<15;i++)
|
||||
{
|
||||
if (data->row_used[i])
|
||||
{
|
||||
if (ccx_options.sentence_cap)
|
||||
{
|
||||
capitalize (i,data);
|
||||
correct_case(i,data);
|
||||
}
|
||||
if (ccx_options.autodash && ccx_options.trim_subs)
|
||||
{
|
||||
int first=0, last=31, center1=-1, center2=-1;
|
||||
unsigned char *line = data->characters[i];
|
||||
int do_dash=1, colon_pos=-1;
|
||||
find_limit_characters(line,&first,&last);
|
||||
if (first==-1 || last==-1) // Probably a bug somewhere though
|
||||
break;
|
||||
// Is there a speaker named, for example: TOM: What are you doing?
|
||||
for (int j=first;j<=last;j++)
|
||||
{
|
||||
if (line[j]==':')
|
||||
{
|
||||
colon_pos=j;
|
||||
break;
|
||||
}
|
||||
if (!isupper (line[j]))
|
||||
break;
|
||||
}
|
||||
if (prev_line_start==-1)
|
||||
do_dash=0;
|
||||
if (first==prev_line_start) // Case of left alignment
|
||||
do_dash=0;
|
||||
if (last==prev_line_end) // Right align
|
||||
do_dash=0;
|
||||
if (first>prev_line_start && last<prev_line_end) // Fully contained
|
||||
do_dash=0;
|
||||
if ((first>prev_line_start && first<prev_line_end) || // Overlap
|
||||
(last>prev_line_start && last<prev_line_end))
|
||||
do_dash=0;
|
||||
|
||||
center1=(first+last)/2;
|
||||
if (colon_pos!=-1)
|
||||
{
|
||||
while (colon_pos<CC608_SCREEN_WIDTH &&
|
||||
(line[colon_pos]==':' ||
|
||||
line[colon_pos]==' ' ||
|
||||
line[colon_pos]==0x89))
|
||||
colon_pos++; // Find actual text
|
||||
center2=(colon_pos+last)/2;
|
||||
}
|
||||
else
|
||||
center2=center1;
|
||||
|
||||
if (center1>=prev_line_center1-1 && center1<=prev_line_center1+1 && center1!=-1) // Center align
|
||||
do_dash=0;
|
||||
if (center2>=prev_line_center2-2 && center1<=prev_line_center2+2 && center1!=-1) // Center align
|
||||
do_dash=0;
|
||||
|
||||
if (do_dash)
|
||||
write(context->out->fh, "- ", 2);
|
||||
prev_line_start=first;
|
||||
prev_line_end=last;
|
||||
prev_line_center1=center1;
|
||||
prev_line_center2=center2;
|
||||
|
||||
}
|
||||
int length = get_decoder_line_encoded (subline, i, data);
|
||||
if (ccx_options.encoding!=CCX_ENC_UNICODE)
|
||||
{
|
||||
dbg_print(CCX_DMT_608, "\r");
|
||||
dbg_print(CCX_DMT_608, "%s\n",subline);
|
||||
}
|
||||
write(context->out->fh, subline, length);
|
||||
write(context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
wrote_something=1;
|
||||
// fprintf (wb->fh,encoded_crlf);
|
||||
}
|
||||
}
|
||||
dbg_print(CCX_DMT_608, "- - - - - - - - - - - -\r\n");
|
||||
|
||||
// fprintf (wb->fh, encoded_crlf);
|
||||
write (context->out->fh, encoded_crlf, encoded_crlf_length);
|
||||
return wrote_something;
|
||||
}
|
||||
292
src/708.h
292
src/708.h
@@ -1,292 +0,0 @@
|
||||
#ifndef _INCLUDE_708_
|
||||
#define _INCLUDE_708_
|
||||
#define MAX_708_PACKET_LENGTH 128
|
||||
|
||||
#define I708_MAX_ROWS 15
|
||||
#define I708_MAX_COLUMNS 42
|
||||
|
||||
#define I708_SCREENGRID_ROWS 75
|
||||
#define I708_SCREENGRID_COLUMNS 210
|
||||
|
||||
#define I708_MAX_WINDOWS 8
|
||||
|
||||
enum COMMANDS_C0_CODES
|
||||
{
|
||||
NUL=0,
|
||||
ETX=3,
|
||||
BS=8,
|
||||
FF=0xC,
|
||||
CR=0xD,
|
||||
HCR=0xE,
|
||||
EXT1=0x10,
|
||||
P16=0x18
|
||||
};
|
||||
|
||||
enum COMMANDS_C1_CODES
|
||||
{
|
||||
CW0=0x80,
|
||||
CW1=0x81,
|
||||
CW2=0x82,
|
||||
CW3=0x83,
|
||||
CW4=0x84,
|
||||
CW5=0x85,
|
||||
CW6=0x86,
|
||||
CW7=0x87,
|
||||
CLW=0x88,
|
||||
DSW=0x89,
|
||||
HDW=0x8A,
|
||||
TGW=0x8B,
|
||||
DLW=0x8C,
|
||||
DLY=0x8D,
|
||||
DLC=0x8E,
|
||||
RST=0x8F,
|
||||
SPA=0x90,
|
||||
SPC=0x91,
|
||||
SPL=0x92,
|
||||
RSV93=0x93,
|
||||
RSV94=0x94,
|
||||
RSV95=0x95,
|
||||
RSV96=0x96,
|
||||
SWA=0x97,
|
||||
DF0=0x98,
|
||||
DF1=0x99,
|
||||
DF2=0x9A,
|
||||
DF3=0x9B,
|
||||
DF4=0x9C,
|
||||
DF5=0x9D,
|
||||
DF6=0x9E,
|
||||
DF7=0x9F
|
||||
};
|
||||
|
||||
struct S_COMMANDS_C1
|
||||
{
|
||||
int code;
|
||||
const char *name;
|
||||
const char *description;
|
||||
int length;
|
||||
};
|
||||
|
||||
|
||||
enum eWindowsAttribJustify
|
||||
{
|
||||
left=0,
|
||||
right=1,
|
||||
center=2,
|
||||
full=3
|
||||
};
|
||||
|
||||
enum eWindowsAttribPrintDirection
|
||||
{
|
||||
pd_left_to_right=0,
|
||||
pd_right_to_left=1,
|
||||
pd_top_to_bottom=2,
|
||||
pd_bottom_to_top=3
|
||||
};
|
||||
|
||||
enum eWindowsAttribScrollDirection
|
||||
{
|
||||
sd_left_to_right=0,
|
||||
sd_right_to_left=1,
|
||||
sd_top_to_bottom=2,
|
||||
sd_bottom_to_top=3
|
||||
};
|
||||
|
||||
enum eWindowsAttribScrollDisplayEffect
|
||||
{
|
||||
snap=0,
|
||||
fade=1,
|
||||
wipe=2
|
||||
};
|
||||
|
||||
enum eWindowsAttribEffectDirection
|
||||
{
|
||||
left_to_right=0,
|
||||
right_to_left=1,
|
||||
top_to_bottom=2,
|
||||
bottom_to_top=3
|
||||
};
|
||||
|
||||
enum eWindowsAttribFillOpacity
|
||||
{
|
||||
solid=0,
|
||||
flash=1,
|
||||
traslucent=2,
|
||||
transparent=3
|
||||
};
|
||||
|
||||
enum eWindowsAttribBorderType
|
||||
{
|
||||
none=0,
|
||||
raised=1,
|
||||
depressed=2,
|
||||
uniform=3,
|
||||
shadow_left=4,
|
||||
shadow_right=5
|
||||
};
|
||||
|
||||
enum ePenAttribSize
|
||||
{
|
||||
pensize_small=0,
|
||||
pensize_standard=1,
|
||||
pensize_large=2
|
||||
};
|
||||
|
||||
enum ePenAttribFontStyle
|
||||
{
|
||||
fontstyle_default_or_undefined=0,
|
||||
monospaced_with_serifs=1,
|
||||
proportionally_spaced_with_serifs=2,
|
||||
monospaced_without_serifs=3,
|
||||
proportionally_spaced_without_serifs=4,
|
||||
casual_font_type=5,
|
||||
cursive_font_type=6,
|
||||
small_capitals=7
|
||||
};
|
||||
|
||||
enum ePanAttribTextTag
|
||||
{
|
||||
texttag_dialog=0,
|
||||
texttag_source_or_speaker_id=1,
|
||||
texttag_electronic_voice=2,
|
||||
texttag_foreign_language=3,
|
||||
texttag_voiceover=4,
|
||||
texttag_audible_translation=5,
|
||||
texttag_subtitle_translation=6,
|
||||
texttag_voice_quality_description=7,
|
||||
texttag_song_lyrics=8,
|
||||
texttag_sound_effect_description=9,
|
||||
texttag_musical_score_description=10,
|
||||
texttag_expletitive=11,
|
||||
texttag_undefined_12=12,
|
||||
texttag_undefined_13=13,
|
||||
texttag_undefined_14=14,
|
||||
texttag_not_to_be_displayed=15
|
||||
};
|
||||
|
||||
enum ePanAttribOffset
|
||||
{
|
||||
offset_subscript=0,
|
||||
offset_normal=1,
|
||||
offset_superscript=2
|
||||
};
|
||||
|
||||
enum ePanAttribEdgeType
|
||||
{
|
||||
edgetype_none=0,
|
||||
edgetype_raised=1,
|
||||
edgetype_depressed=2,
|
||||
edgetype_uniform=3,
|
||||
edgetype_left_drop_shadow=4,
|
||||
edgetype_right_drop_shadow=5
|
||||
};
|
||||
|
||||
enum eAnchorPoints
|
||||
{
|
||||
anchorpoint_top_left = 0,
|
||||
anchorpoint_top_center = 1,
|
||||
anchorpoint_top_right =2,
|
||||
anchorpoint_middle_left = 3,
|
||||
anchorpoint_middle_center = 4,
|
||||
anchorpoint_middle_right = 5,
|
||||
anchorpoint_bottom_left = 6,
|
||||
anchorpoint_bottom_center = 7,
|
||||
anchorpoint_bottom_right = 8
|
||||
};
|
||||
|
||||
typedef struct e708Pen_color
|
||||
{
|
||||
int fg_color;
|
||||
int fg_opacity;
|
||||
int bg_color;
|
||||
int bg_opacity;
|
||||
int edge_color;
|
||||
} e708Pen_color;
|
||||
|
||||
typedef struct e708Pen_attribs
|
||||
{
|
||||
int pen_size;
|
||||
int offset;
|
||||
int text_tag;
|
||||
int font_tag;
|
||||
int edge_type;
|
||||
int underline;
|
||||
int italic;
|
||||
} e708Pen_attribs;
|
||||
|
||||
typedef struct e708Window_attribs
|
||||
{
|
||||
int fill_color;
|
||||
int fill_opacity;
|
||||
int border_color;
|
||||
int border_type01;
|
||||
int justify;
|
||||
int scroll_dir;
|
||||
int print_dir;
|
||||
int word_wrap;
|
||||
int border_type;
|
||||
int display_eff;
|
||||
int effect_dir;
|
||||
int effect_speed;
|
||||
} e708Window_attribs;
|
||||
|
||||
typedef struct e708Window
|
||||
{
|
||||
int is_defined;
|
||||
int number; // Handy, in case we only have a pointer to the window
|
||||
int priority;
|
||||
int col_lock;
|
||||
int row_lock;
|
||||
int visible;
|
||||
int anchor_vertical;
|
||||
int relative_pos;
|
||||
int anchor_horizontal;
|
||||
int row_count;
|
||||
int anchor_point;
|
||||
int col_count;
|
||||
int pen_style;
|
||||
int win_style;
|
||||
unsigned char commands[6]; // Commands used to create this window
|
||||
e708Window_attribs attribs;
|
||||
e708Pen_attribs pen;
|
||||
e708Pen_color pen_color;
|
||||
int pen_row;
|
||||
int pen_column;
|
||||
unsigned char *rows[I708_MAX_ROWS+1]; // Max is 15, but we define an extra one for convenience
|
||||
int memory_reserved;
|
||||
int is_empty;
|
||||
} e708Window;
|
||||
|
||||
typedef struct tvscreen
|
||||
{
|
||||
unsigned char chars[I708_SCREENGRID_ROWS][I708_SCREENGRID_COLUMNS+1];
|
||||
}
|
||||
tvscreen;
|
||||
|
||||
typedef struct cc708_service_decoder
|
||||
{
|
||||
e708Window windows[I708_MAX_WINDOWS];
|
||||
int current_window;
|
||||
int inited;
|
||||
LLONG current_visible_start_ms;
|
||||
tvscreen tv1, tv2; // Current and previous "screenfuls", note that we switch between them
|
||||
int is_empty_tv1, is_empty_tv2;
|
||||
int cur_tv; // 1 or 2 rather than 0 or 1, to at least be consistent with the decoder
|
||||
tvscreen *tv; // Pointer to the current TV buffer
|
||||
char *filename; // Where we are going to write our output
|
||||
int fh; // Handle to output file. -1 if not yet open
|
||||
int srt_counter;
|
||||
}
|
||||
cc708_service_decoder;
|
||||
|
||||
extern int resets_708;
|
||||
|
||||
void do_708 (const unsigned char *data, int datalength);
|
||||
void init_708(void);
|
||||
|
||||
unsigned char get_internal_from_G0 (unsigned char g0_char);
|
||||
unsigned char get_internal_from_G1 (unsigned char g1_char);
|
||||
unsigned char get_internal_from_G2 (unsigned char g2_char);
|
||||
unsigned char get_internal_from_G3 (unsigned char g3_char);
|
||||
void process_character (cc708_service_decoder *decoder, unsigned char internal_char);
|
||||
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
/********************************************************
|
||||
256 BYTES IS ENOUGH FOR ALL THE SUPPORTED CHARACTERS IN
|
||||
EIA-708, SO INTERNALLY WE USE THIS TABLE (FOR CONVENIENCE)
|
||||
|
||||
00-1F -> Characters that are in the G2 group in 20-3F,
|
||||
except for 06, which is used for the closed captions
|
||||
sign "CC" which is defined in group G3 as 00. (this
|
||||
is by the article 33).
|
||||
20-7F -> Group G0 as is - corresponds to the ASCII code
|
||||
80-9F -> Characters that are in the G2 group in 60-7F
|
||||
(there are several blank characters here, that's OK)
|
||||
A0-FF -> Group G1 as is - non-English characters and symbols
|
||||
*/
|
||||
|
||||
unsigned char get_internal_from_G0 (unsigned char g0_char)
|
||||
{
|
||||
return g0_char;
|
||||
}
|
||||
|
||||
unsigned char get_internal_from_G1 (unsigned char g1_char)
|
||||
{
|
||||
return g1_char;
|
||||
}
|
||||
|
||||
// TODO: Probably not right
|
||||
// G2: Extended Control Code Set 1
|
||||
unsigned char get_internal_from_G2 (unsigned char g2_char)
|
||||
{
|
||||
if (g2_char>=0x20 && g2_char<=0x3F)
|
||||
return g2_char-0x20;
|
||||
if (g2_char>=0x60 && g2_char<=0x7F)
|
||||
return g2_char+0x20;
|
||||
// Rest unmapped, so we return a blank space
|
||||
return 0x20;
|
||||
}
|
||||
|
||||
// TODO: Probably not right
|
||||
// G3: Future Characters and Icon Expansion
|
||||
unsigned char get_internal_from_G3 (unsigned char g3_char)
|
||||
{
|
||||
if (g3_char==0xa0) // The "CC" (closed captions) sign
|
||||
return 0x06;
|
||||
// Rest unmapped, so we return a blank space
|
||||
return 0x20;
|
||||
}
|
||||
6
src/CCExtractorConfig.h.in
Normal file
6
src/CCExtractorConfig.h.in
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* the configured options and settings for CCExtractor
|
||||
*/
|
||||
|
||||
#define CCExtractor_VERSION_MAJOR @CCEXTRACTOR_VERSION_MAJOR@
|
||||
#define CCExtractor_VERSION_MINOR @CCEXTRACTOR_VERSION_MINOR@
|
||||
118
src/CMakeLists.txt
Normal file
118
src/CMakeLists.txt
Normal file
@@ -0,0 +1,118 @@
|
||||
cmake_minimum_required (VERSION 3.0.2)
|
||||
|
||||
project (CCExtractor)
|
||||
|
||||
option (WITH_FFMPEG "Build using FFmpeg demuxer and decoder" OFF)
|
||||
option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF)
|
||||
option (WITH_SHARING "Build with sharing and translation support" OFF)
|
||||
|
||||
# Version number
|
||||
set (CCEXTRACTOR_VERSION_MAJOR 0)
|
||||
set (CCEXTRACTOR_VERSION_MINOR 77)
|
||||
|
||||
# configure a header file to pass some of the CMake settings
|
||||
# to the source code
|
||||
configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/CCExtractorConfig.h.in"
|
||||
"${PROJECT_BINARY_DIR}/CCExtractorConfig.h"
|
||||
)
|
||||
|
||||
|
||||
include_directories ("${PROJECT_SOURCE_DIR}")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/lib_ccx")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/utf8proc")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/gpacmp4/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/protobuf-c/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/zvbi")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash" SOURCEFILE)
|
||||
|
||||
# Adding some platform specific library path
|
||||
link_directories (/opt/local/lib)
|
||||
link_directories (/usr/local/lib)
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall -g -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64")
|
||||
add_subdirectory (lib_ccx)
|
||||
|
||||
aux_source_directory (${PROJECT_SOURCE_DIR} SOURCEFILE)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ccx)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} m)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} iconv)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
|
||||
find_package (PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PNG libpng )
|
||||
if(PNG_FOUND)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} png)
|
||||
else (PNG_FOUND)
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
|
||||
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
|
||||
endif(PNG_FOUND)
|
||||
else(PKG_CONFIG_FOUND)
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
|
||||
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
|
||||
########################################################
|
||||
# Build using FFmpeg libraries
|
||||
########################################################
|
||||
|
||||
if (PKG_CONFIG_FOUND AND WITH_FFMPEG)
|
||||
|
||||
pkg_check_modules (AVFORMAT REQUIRED libavformat)
|
||||
pkg_check_modules (AVUTIL REQUIRED libavutil)
|
||||
pkg_check_modules (AVCODEC REQUIRED libavcodec)
|
||||
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_STATIC_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_STATIC_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_STATIC_LIBRARIES})
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
|
||||
endif (PKG_CONFIG_FOUND AND WITH_FFMPEG)
|
||||
|
||||
########################################################
|
||||
# Build with OCR using leptonica and tesseract libraries
|
||||
########################################################
|
||||
|
||||
if (WITH_OCR)
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules (TESSERACT REQUIRED tesseract)
|
||||
pkg_check_modules (LEPTONICA REQUIRED lept)
|
||||
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES})
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR ${TESSERACT_CFLAGS} ${LEPTONICA_CFLAGS}")
|
||||
endif (WITH_OCR)
|
||||
|
||||
########################################################
|
||||
# Build with CC sharing and translation support
|
||||
########################################################
|
||||
|
||||
if (WITH_SHARING)
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules (NANOMSG REQUIRED libnanomsg)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${NANOMSG_STATIC_LIBRARIES})
|
||||
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/protobuf-c/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SHARING")
|
||||
endif (WITH_SHARING)
|
||||
|
||||
|
||||
add_executable (ccextractor ${SOURCEFILE})
|
||||
target_link_libraries (ccextractor ${EXTRA_LIBS})
|
||||
|
||||
install (TARGETS ccextractor DESTINATION bin)
|
||||
147
src/activity.c
147
src/activity.c
@@ -1,147 +0,0 @@
|
||||
/* This file contains functions that report the user of the GUI of
|
||||
relevant events. */
|
||||
|
||||
#include "ccextractor.h"
|
||||
|
||||
static int credits_shown=0;
|
||||
unsigned long net_activity_gui=0;
|
||||
|
||||
/* Print current progress. For percentaje, -1 -> streaming mode */
|
||||
void activity_progress (int percentaje, int cur_min, int cur_sec)
|
||||
{
|
||||
if (!ccx_options.no_progress_bar)
|
||||
{
|
||||
if (percentaje==-1)
|
||||
mprint ("\rStreaming | %02d:%02d", cur_min, cur_sec);
|
||||
else
|
||||
mprint ("\r%3d%% | %02d:%02d",percentaje, cur_min, cur_sec);
|
||||
}
|
||||
fflush (stdout);
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###PROGRESS#%d#%d#%d\n", percentaje, cur_min, cur_sec);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_input_file_open (const char *filename)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###INPUTFILEOPEN#%s\n", filename);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_xds_program_identification_number (unsigned minutes, unsigned hours, unsigned date, unsigned month)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###XDSPROGRAMIDENTIFICATIONNUMBER#%u#%u#%u#%u\n", minutes,hours,date,month);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_xds_network_call_letters (const char *program_name)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###XDSNETWORKCALLLETTERS#%s\n", program_name);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_xds_program_name (const char *program_name)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###XDSPROGRAMNAME#%s\n", program_name);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_xds_program_description (int line_num, const char *program_desc)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###XDSPROGRAMDESC#%d#%s\n", line_num, program_desc);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void activity_video_info (int hor_size,int vert_size,
|
||||
const char *aspect_ratio, const char *framerate)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###VIDEOINFO#%u#%u#%s#%s\n",
|
||||
hor_size,vert_size, aspect_ratio, framerate);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void activity_message (const char *fmt, ...)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
va_list args;
|
||||
fprintf (stderr, "###MESSAGE#");
|
||||
va_start(args, fmt);
|
||||
fprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_input_file_closed (void)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###INPUTFILECLOSED\n");
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_program_number (unsigned program_number)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###TSPROGRAMNUMBER#%u\n",program_number);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_report_version (void)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###VERSION#CCExtractor#%s\n",VERSION);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
void activity_report_data_read (void)
|
||||
{
|
||||
if (ccx_options.gui_mode_reports)
|
||||
{
|
||||
fprintf (stderr, "###DATAREAD#%lu\n",net_activity_gui/1000);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void activity_header (void)
|
||||
{
|
||||
if (!credits_shown)
|
||||
{
|
||||
credits_shown=1;
|
||||
mprint ("CCExtractor %s, Carlos Fernandez Sanz, Volker Quetschke.\n", VERSION);
|
||||
mprint ("Teletext portions taken from Petr Kutalek's telxcc\n");
|
||||
mprint ("--------------------------------------------------------------------------\n");
|
||||
}
|
||||
}
|
||||
|
||||
1041
src/asf_functions.c
1041
src/asf_functions.c
File diff suppressed because it is too large
Load Diff
1052
src/avc_functions.c
1052
src/avc_functions.c
File diff suppressed because it is too large
Load Diff
@@ -1,375 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
// Hold functions to read streams on a bit or byte oriented basis
|
||||
// plus some data related helper functions.
|
||||
|
||||
|
||||
// Guidelines for all bitsream functions:
|
||||
// * No function shall advance the pointer past the end marker
|
||||
// * If bitstream.bitsleft < 0 do not attempt any read access,
|
||||
// but decrease bitsleft by the number of bits that were
|
||||
// attempted to read.
|
||||
|
||||
// Initialize bitstream
|
||||
int init_bitstream(struct bitstream *bstr, unsigned char *start, unsigned char *end)
|
||||
{
|
||||
bstr->pos = start;
|
||||
bstr->bpos = 8;
|
||||
bstr->end = end;
|
||||
bstr->bitsleft = (bstr->end - bstr->pos)*8;
|
||||
bstr->error = 0;
|
||||
bstr->_i_pos = NULL;
|
||||
bstr->_i_bpos = 0;
|
||||
|
||||
if(bstr->bitsleft < 0)
|
||||
{
|
||||
// See if we can somehow recover of this disaster by reporting the problem instead of terminating.
|
||||
mprint ( "init_bitstream: bitstream has negative length!");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Read bnum bits from bitstream bstr with the most significant
|
||||
// bit read first without advancing the bitstream pointer.
|
||||
// A 64 bit unsigned integer is returned. 0 is returned when
|
||||
// there are not enough bits left in the bitstream.
|
||||
uint64_t next_bits(struct bitstream *bstr, unsigned bnum)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
|
||||
if(bnum > 64)
|
||||
fatal(EXIT_BUG_BUG, "next_bits: 64 is maximum bit number, argument: %u!", bnum);
|
||||
|
||||
// Sanity check
|
||||
if(bstr->end - bstr->pos < 0)
|
||||
fatal(EXIT_BUG_BUG, "next_bits: bitstream has negative length!");
|
||||
|
||||
// Keep a negative bitstream.bitsleft, but correct it.
|
||||
if (bstr->bitsleft <= 0)
|
||||
{
|
||||
bstr->bitsleft -= bnum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Calculate the remaining number of bits in bitstream after reading.
|
||||
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bnum;
|
||||
if (bstr->bitsleft < 0)
|
||||
return 0;
|
||||
|
||||
// Special case for reading zero bits. Return zero
|
||||
if(bnum == 0)
|
||||
return 0;
|
||||
|
||||
int vbit = bstr->bpos;
|
||||
unsigned char *vpos = bstr->pos;
|
||||
|
||||
if(vbit < 1 || vbit > 8)
|
||||
{
|
||||
fatal(EXIT_BUG_BUG, "next_bits: Illegal bit position value %d!", vbit);
|
||||
}
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
if(vpos >= bstr->end)
|
||||
{
|
||||
// We should not get here ...
|
||||
fatal(EXIT_BUG_BUG, "next_bits: Reading after end of data ...");
|
||||
}
|
||||
|
||||
res |= (*vpos & (0x01 << (vbit-1)) ? 1 : 0);
|
||||
vbit--;
|
||||
bnum--;
|
||||
|
||||
if(vbit == 0)
|
||||
{
|
||||
vpos++;
|
||||
vbit = 8;
|
||||
}
|
||||
|
||||
if(bnum)
|
||||
{
|
||||
res <<= 1;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember the bitstream position
|
||||
bstr->_i_bpos = vbit;
|
||||
bstr->_i_pos = vpos;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// Read bnum bits from bitstream bstr with the most significant
|
||||
// bit read first. A 64 bit unsigned integer is returned.
|
||||
uint64_t read_bits(struct bitstream *bstr, unsigned bnum)
|
||||
{
|
||||
uint64_t res = next_bits(bstr, bnum);
|
||||
|
||||
// Special case for reading zero bits. Also abort when not enough
|
||||
// bits are left. Return zero
|
||||
if(bnum == 0 || bstr->bitsleft < 0)
|
||||
return 0;
|
||||
|
||||
// Advance the bitstream
|
||||
bstr->bpos = bstr->_i_bpos;
|
||||
bstr->pos = bstr->_i_pos;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// This function will advance the bitstream by bnum bits, if possible.
|
||||
// Advancing of more than 64 bits is possible.
|
||||
// Return TRUE when successfull, otherwise FALSE
|
||||
int skip_bits(struct bitstream *bstr, unsigned bnum)
|
||||
{
|
||||
// Sanity check
|
||||
if(bstr->end - bstr->pos < 0)
|
||||
fatal(EXIT_BUG_BUG, "skip_bits: bitstream has negative length!");
|
||||
|
||||
// Keep a negative bstr->bitsleft, but correct it.
|
||||
if (bstr->bitsleft < 0)
|
||||
{
|
||||
bstr->bitsleft -= bnum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Calculate the remaining number of bits in bitstream after reading.
|
||||
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bnum;
|
||||
if (bstr->bitsleft < 0)
|
||||
return 0;
|
||||
|
||||
// Special case for reading zero bits. Return zero
|
||||
if(bnum == 0)
|
||||
return 1;
|
||||
|
||||
bstr->bpos -= bnum%8;
|
||||
bstr->pos += bnum/8;
|
||||
|
||||
if (bstr->bpos < 1)
|
||||
{
|
||||
bstr->bpos += 8;
|
||||
bstr->pos += 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Return TRUE if the current position in the bitstream is on a byte
|
||||
// boundary, i.e., the next bit in the bitstream is the first bit in
|
||||
// a byte, otherwise return FALSE
|
||||
int is_byte_aligned(struct bitstream *bstr)
|
||||
{
|
||||
// Sanity check
|
||||
if(bstr->end - bstr->pos < 0)
|
||||
fatal(EXIT_BUG_BUG, "is_byte_aligned: bitstream has negative length!");
|
||||
|
||||
int vbit = bstr->bpos;
|
||||
|
||||
if(vbit == 0 || vbit > 8)
|
||||
{
|
||||
fatal(EXIT_BUG_BUG, "is_byte_aligned: Illegal bit position value %d!\n", vbit);
|
||||
}
|
||||
|
||||
if (vbit == 8)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Move bitstream to next byte border. Adjust bitsleft.
|
||||
void make_byte_aligned(struct bitstream *bstr)
|
||||
{
|
||||
// Sanity check
|
||||
if(bstr->end - bstr->pos < 0)
|
||||
fatal(EXIT_BUG_BUG, "make_byte_aligned: bitstream has negative length!");
|
||||
|
||||
int vbit = bstr->bpos;
|
||||
|
||||
if(vbit == 0 || vbit > 8)
|
||||
{
|
||||
fatal(EXIT_BUG_BUG, "make_byte_aligned: Illegal bit position value %d!\n", vbit);
|
||||
}
|
||||
|
||||
// Keep a negative bstr->bitsleft, but correct it.
|
||||
if (bstr->bitsleft < 0)
|
||||
{
|
||||
// Pay attention to the bit alignment
|
||||
bstr->bitsleft = (bstr->bitsleft-7)/8 *8;
|
||||
return;
|
||||
}
|
||||
|
||||
if(bstr->bpos != 8)
|
||||
{
|
||||
bstr->bpos = 8;
|
||||
bstr->pos += 1;
|
||||
}
|
||||
// Reset, in case a next_???() function was used before
|
||||
bstr->bitsleft = 0LL + 8*(bstr->end-bstr->pos-1)+bstr->bpos;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Return pointer to first of bynum bytes from the bitstream if the
|
||||
// following conditions are TRUE:
|
||||
// The bitstream is byte aligned and there are enough bytes left in
|
||||
// it to read bynum bytes. Otherwise return NULL.
|
||||
// This function does not advance the bitstream pointer.
|
||||
unsigned char *next_bytes(struct bitstream *bstr, unsigned bynum)
|
||||
{
|
||||
// Sanity check
|
||||
if(bstr->end - bstr->pos < 0)
|
||||
fatal(EXIT_BUG_BUG, "next_bytes: bitstream has negative length!");
|
||||
|
||||
// Keep a negative bstr->bitsleft, but correct it.
|
||||
if (bstr->bitsleft < 0)
|
||||
{
|
||||
bstr->bitsleft -= bynum*8;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bynum*8;
|
||||
|
||||
if (!is_byte_aligned(bstr) || bstr->bitsleft < 0 || bynum < 1)
|
||||
return NULL;
|
||||
|
||||
// Remember the bitstream position
|
||||
bstr->_i_bpos = 8;
|
||||
bstr->_i_pos = bstr->pos + bynum;
|
||||
|
||||
return bstr->pos;
|
||||
}
|
||||
|
||||
|
||||
// Return pointer to first of bynum bytes from the bitstream if the
|
||||
// following conditions are TRUE:
|
||||
// The bitstream is byte aligned and there are enough bytes left in
|
||||
// it to read bynum bytes. Otherwise return NULL.
|
||||
// This function does advance the bitstream pointer.
|
||||
unsigned char *read_bytes(struct bitstream *bstr, unsigned bynum)
|
||||
{
|
||||
unsigned char *res = next_bytes(bstr, bynum);
|
||||
|
||||
// Advance the bitstream when a read was possible
|
||||
if(res)
|
||||
{
|
||||
bstr->bpos = bstr->_i_bpos;
|
||||
bstr->pos = bstr->_i_pos;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// Return an integer number with "bytes" precision from the current
|
||||
// bitstream position. Allowed "bytes" values are 1,2,4,8.
|
||||
// This function does advance the bitstream pointer when "advance" is
|
||||
// set to TRUE.
|
||||
// Numbers come MSB (most significant first), and we need to account for
|
||||
// little-endian and big-endian CPUs.
|
||||
uint64_t bitstream_get_num(struct bitstream *bstr, unsigned bytes, int advance)
|
||||
{
|
||||
void *bpos;
|
||||
uint64_t rval=0;
|
||||
|
||||
if (advance)
|
||||
bpos = read_bytes(bstr, bytes);
|
||||
else
|
||||
bpos = next_bytes(bstr, bytes);
|
||||
|
||||
if (!bpos)
|
||||
return 0;
|
||||
|
||||
switch (bytes)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 8:
|
||||
break;
|
||||
default:
|
||||
fatal (EXIT_BUG_BUG, "bitstream_get_num: Illegal precision value [%u]!",
|
||||
bytes);
|
||||
break;
|
||||
}
|
||||
for (unsigned i=0;i<bytes;i++)
|
||||
{
|
||||
unsigned char *ucpos=((unsigned char *)bpos) +bytes-i-1; // Read backwards
|
||||
unsigned char uc=*ucpos;
|
||||
rval=(rval<<8) + uc;
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
// Read unsigned Exp-Golomb code from bitstream
|
||||
uint64_t ue(struct bitstream *bstr)
|
||||
{
|
||||
uint64_t res = 0;
|
||||
int zeros=0;
|
||||
|
||||
while(!read_bits(bstr,1))
|
||||
zeros++;
|
||||
|
||||
res = (0x01 << zeros) - 1 + read_bits(bstr,zeros);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// Read signed Exp-Golomb code from bitstream
|
||||
int64_t se(struct bitstream *bstr)
|
||||
{
|
||||
int64_t res = 0;
|
||||
|
||||
res = ue(bstr);
|
||||
|
||||
// The following function might truncate when res+1 overflows
|
||||
//res = (res+1)/2 * (res % 2 ? 1 : -1);
|
||||
// Use this:
|
||||
res = (res/2+(res%2 ? 1 : 0)) * (res % 2 ? 1 : -1);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// Read unsigned integer with bnum bits length. Basically an
|
||||
// alias for read_bits().
|
||||
uint64_t u(struct bitstream *bstr, unsigned bnum)
|
||||
{
|
||||
return read_bits(bstr, bnum);
|
||||
}
|
||||
|
||||
|
||||
// Read signed integer with bnum bits length.
|
||||
int64_t i(struct bitstream *bstr, unsigned bnum)
|
||||
{
|
||||
uint64_t res = read_bits(bstr, bnum);
|
||||
|
||||
// Special case for reading zero bits. Return zero
|
||||
if(bnum == 0)
|
||||
return 0;
|
||||
|
||||
return (0xFFFFFFFFFFFFFFFFULL << bnum) | res;
|
||||
}
|
||||
|
||||
|
||||
// Return the value with the bit order reversed.
|
||||
uint8_t reverse8(uint8_t data)
|
||||
{
|
||||
uint8_t res = 0;
|
||||
|
||||
for (int k=0;k<8;k++)
|
||||
{
|
||||
res <<= 1;
|
||||
res |= (data & (0x01 << k) ? 1 : 0);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/* Functions used by both the 608 and 708 decoders. An effort should be
|
||||
made to reuse, not duplicate, as many functions as possible */
|
||||
|
||||
#include "ccextractor.h"
|
||||
|
||||
/* This function returns a FTS that is guaranteed to be at least 1 ms later than the end of the previous screen. It shouldn't be needed
|
||||
obviously but it guarantees there's no timing overlap */
|
||||
LLONG get_visible_start (void)
|
||||
{
|
||||
LLONG fts = get_fts();
|
||||
if (fts <= minimum_fts)
|
||||
fts = minimum_fts+1;
|
||||
dbg_print(CCX_DMT_608, "Visible Start time=%s\n", print_mstime(fts));
|
||||
return fts;
|
||||
}
|
||||
|
||||
/* This function returns the current FTS and saves it so it can be used by get_visible_start */
|
||||
LLONG get_visible_end (void)
|
||||
{
|
||||
LLONG fts = get_fts();
|
||||
if (fts>minimum_fts)
|
||||
minimum_fts=fts;
|
||||
dbg_print(CCX_DMT_608, "Visible End time=%s\n", print_mstime(fts));
|
||||
return fts;
|
||||
}
|
||||
1115
src/ccextractor.c
1115
src/ccextractor.c
File diff suppressed because it is too large
Load Diff
@@ -1,605 +0,0 @@
|
||||
#ifndef CCX_CCEXTRACTOR_H
|
||||
#define CCX_CCEXTRACTOR_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
// compatibility across platforms
|
||||
#include "platform.h"
|
||||
|
||||
#define VERSION "0.70"
|
||||
|
||||
extern int cc_buffer_saved; // Do we have anything in the CC buffer already?
|
||||
extern int ccblocks_in_avc_total; // Total CC blocks found by the AVC code
|
||||
extern int ccblocks_in_avc_lost; // CC blocks found by the AVC code lost due to overwrites (should be 0)
|
||||
|
||||
#include "608.h"
|
||||
#include "708.h"
|
||||
#include "bitstream.h"
|
||||
#include "constants.h"
|
||||
|
||||
#define TS_PMT_MAP_SIZE 128
|
||||
|
||||
struct ccx_boundary_time
|
||||
{
|
||||
int hh,mm,ss;
|
||||
LLONG time_in_ms;
|
||||
int set;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
// TODO: add more options, and (perhaps) reduce other ccextractor options?
|
||||
int showStartTime, showEndTime; // Show start and/or end time.
|
||||
int showMode; // Show which mode if available (E.G.: POP, RU1, ...)
|
||||
int showCC; // Show which CC channel has been captured.
|
||||
int relativeTimestamp; // Timestamps relative to start of sample or in UTC?
|
||||
int xds; // Show XDS or not
|
||||
int useColors; // Add colors or no colors
|
||||
|
||||
} ccx_transcript_format;
|
||||
|
||||
extern ccx_transcript_format ccx_default_transcript_settings;
|
||||
|
||||
struct ccx_s_options // Options from user parameters
|
||||
{
|
||||
int extract; // Extract 1st, 2nd or both fields
|
||||
int cc_channel; // Channel we want to dump in srt mode
|
||||
int buffer_input;
|
||||
int direct_rollup;
|
||||
int nofontcolor;
|
||||
int notypesetting;
|
||||
struct ccx_boundary_time extraction_start, extraction_end; // Segment we actually process
|
||||
int print_file_reports;
|
||||
|
||||
/* subtitle codec type */
|
||||
enum cxx_code_type codec;
|
||||
enum cxx_code_type nocodec;
|
||||
/* Credit stuff */
|
||||
char *start_credits_text;
|
||||
char *end_credits_text;
|
||||
struct ccx_boundary_time startcreditsnotbefore, startcreditsnotafter; // Where to insert start credits, if possible
|
||||
struct ccx_boundary_time startcreditsforatleast, startcreditsforatmost; // How long to display them?
|
||||
struct ccx_boundary_time endcreditsforatleast, endcreditsforatmost;
|
||||
int binary_concat; // Disabled by -ve or --videoedited
|
||||
int use_gop_as_pts; // Use GOP instead of PTS timing (0=do as needed, 1=always, -1=never)
|
||||
int fix_padding; // Replace 0000 with 8080 in HDTV (needed for some cards)
|
||||
int norollup; // If 1, write one line at a time
|
||||
int forced_ru; // 0=Disabled, 1, 2 or 3=max lines in roll-up mode
|
||||
int trim_subs; // " Remove spaces at sides? "
|
||||
int gui_mode_reports; // If 1, output in stderr progress updates so the GUI can grab them
|
||||
int no_progress_bar; // If 1, suppress the output of the progress to stdout
|
||||
int sentence_cap ; // FIX CASE? = Fix case?
|
||||
char *sentence_cap_file; // Extra words file?
|
||||
int live_stream; /* -1 -> Not a complete file but a live stream, without timeout
|
||||
0 -> A regular file
|
||||
>0 -> Live stream with a timeout of this value in seconds */
|
||||
int messages_target; // 0 = nowhere (quiet), 1=stdout, 2=stderr
|
||||
/* Levenshtein's parameters, for string comparison */
|
||||
int levdistmincnt, levdistmaxpct; // Means 2 fails or less is "the same", 10% or less is also "the same"
|
||||
int investigate_packets; // Look for captions in all packets when everything else fails
|
||||
int fullbin; // Disable pruning of padding cc blocks
|
||||
int nosync; // Disable syncing
|
||||
unsigned hauppauge_mode; // If 1, use PID=1003, process specially and so on
|
||||
int wtvconvertfix; // Fix broken Windows 7 conversion
|
||||
int wtvmpeg2;
|
||||
int auto_myth; // Use myth-tv mpeg code? 0=no, 1=yes, 2=auto
|
||||
/* MP4 related stuff */
|
||||
unsigned mp4vidtrack; // Process the video track even if a CC dedicated track exists.
|
||||
/* General settings */
|
||||
int usepicorder; // Force the use of pic_order_cnt_lsb in AVC/H.264 data streams
|
||||
int autodash; // Add dashes (-) before each speaker automatically?
|
||||
unsigned teletext_mode; // 0=Disabled, 1 = Not found, 2=Found
|
||||
ccx_transcript_format transcript_settings; // Keeps the settings for generating transcript output files.
|
||||
char millis_separator;
|
||||
LLONG screens_to_process; // How many screenfuls we want?
|
||||
enum ccx_encoding_type encoding;
|
||||
enum ccx_output_format write_format; // 0=Raw, 1=srt, 2=SMI
|
||||
enum ccx_output_date_format date_format;
|
||||
enum color_code cc608_default_color;
|
||||
char *output_filename;
|
||||
char *out_elementarystream_filename;
|
||||
LLONG debug_mask; // dbg_print will use this mask to print or ignore different types
|
||||
LLONG debug_mask_on_debug; // If we're using temp_debug to enable/disable debug "live", this is the mask when temp_debug=1
|
||||
unsigned ts_autoprogram ; // Try to find a stream with captions automatically (no -pn needed)
|
||||
unsigned ts_cappid ; // PID for stream that holds caption information
|
||||
unsigned ts_forced_cappid ; // If 1, never mess with the selected PID
|
||||
unsigned ts_forced_program; // Specific program to process in TS files, if ts_forced_program_selected==1
|
||||
unsigned ts_forced_program_selected;
|
||||
int ts_datastreamtype ; // User WANTED stream type (i.e. use the stream that has this type)
|
||||
unsigned ts_forced_streamtype; // User selected (forced) stream type
|
||||
/* Networking */
|
||||
in_addr_t udpaddr;
|
||||
unsigned udpport; // Non-zero => Listen for UDP packets on this port, no files.
|
||||
int line_terminator_lf; // 0 = CRLF, 1=LF
|
||||
int noautotimeref; // Do NOT set time automatically?
|
||||
enum ccx_datasource input_source; // Files, stdin or network
|
||||
|
||||
};
|
||||
|
||||
struct ts_payload
|
||||
{
|
||||
unsigned char *start; // Payload start
|
||||
unsigned length; // Payload length
|
||||
unsigned pesstart; // PES or PSI start
|
||||
unsigned pid; // Stream PID
|
||||
int counter; // continuity counter
|
||||
int transport_error; // 0 = packet OK, non-zero damaged
|
||||
unsigned char section_buf[1024];
|
||||
int section_index;
|
||||
int section_size;
|
||||
};
|
||||
|
||||
struct PAT_entry
|
||||
{
|
||||
unsigned program_number;
|
||||
unsigned PMT_PID;
|
||||
unsigned char *last_pmt_payload;
|
||||
unsigned last_pmt_length;
|
||||
};
|
||||
|
||||
struct PMT_entry
|
||||
{
|
||||
unsigned program_number;
|
||||
unsigned PMT_PID;
|
||||
unsigned elementary_PID;
|
||||
unsigned ccx_stream_type;
|
||||
unsigned printable_stream_type;
|
||||
};
|
||||
|
||||
|
||||
struct ccx_s_write
|
||||
{
|
||||
int fh;
|
||||
char *filename;
|
||||
void* spupng_data;
|
||||
};
|
||||
|
||||
|
||||
struct gop_time_code
|
||||
{
|
||||
int drop_frame_flag;
|
||||
int time_code_hours;
|
||||
int time_code_minutes;
|
||||
int marker_bit;
|
||||
int time_code_seconds;
|
||||
int time_code_pictures;
|
||||
int inited;
|
||||
LLONG ms;
|
||||
};
|
||||
|
||||
|
||||
/* Report information */
|
||||
#define SUB_STREAMS_CNT 10
|
||||
struct file_report_t
|
||||
{
|
||||
unsigned program_cnt;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
unsigned aspect_ratio;
|
||||
unsigned frame_rate;
|
||||
unsigned xds : 1;
|
||||
unsigned cc_channels_608[4];
|
||||
unsigned services708[63];
|
||||
unsigned dvb_sub_pid[SUB_STREAMS_CNT];
|
||||
unsigned tlt_sub_pid[SUB_STREAMS_CNT];
|
||||
unsigned mp4_cc_track_cnt;
|
||||
} file_report;
|
||||
|
||||
|
||||
// Stuff for telcc.c
|
||||
struct ccx_s_teletext_config {
|
||||
uint8_t verbose : 1; // should telxcc be verbose?
|
||||
uint16_t page; // teletext page containing cc we want to filter
|
||||
uint16_t tid; // 13-bit packet ID for teletext stream
|
||||
double offset; // time offset in seconds
|
||||
uint8_t bom : 1; // print UTF-8 BOM characters at the beginning of output
|
||||
uint8_t nonempty : 1; // produce at least one (dummy) frame
|
||||
// uint8_t se_mode : 1; // search engine compatible mode => Uses CCExtractor's write_format
|
||||
// uint64_t utc_refvalue; // UTC referential value => Moved to CCExtractor global, so can be used for 608 too
|
||||
uint16_t user_page; // Page selected by user, which MIGHT be different to 'page' depending on autodetection stuff
|
||||
};
|
||||
|
||||
#define buffered_skip(bytes) if (bytes<=bytesinbuffer-filebuffer_pos) { \
|
||||
filebuffer_pos+=bytes; \
|
||||
result=bytes; \
|
||||
} else result=buffered_read_opt (NULL,bytes);
|
||||
|
||||
#define buffered_read(buffer,bytes) if (bytes<=bytesinbuffer-filebuffer_pos) { \
|
||||
if (buffer!=NULL) memcpy (buffer,filebuffer+filebuffer_pos,bytes); \
|
||||
filebuffer_pos+=bytes; \
|
||||
result=bytes; \
|
||||
} else { result=buffered_read_opt (buffer,bytes); if (ccx_options.gui_mode_reports && ccx_options.input_source==CCX_DS_NETWORK) {net_activity_gui++; if (!(net_activity_gui%1000))activity_report_data_read();}}
|
||||
|
||||
#define buffered_read_4(buffer) if (4<=bytesinbuffer-filebuffer_pos) { \
|
||||
if (buffer) { buffer[0]=filebuffer[filebuffer_pos]; \
|
||||
buffer[1]=filebuffer[filebuffer_pos+1]; \
|
||||
buffer[2]=filebuffer[filebuffer_pos+2]; \
|
||||
buffer[3]=filebuffer[filebuffer_pos+3]; \
|
||||
filebuffer_pos+=4; \
|
||||
result=4; } \
|
||||
} else result=buffered_read_opt (buffer,4);
|
||||
|
||||
#define buffered_read_byte(buffer) if (bytesinbuffer-filebuffer_pos) { \
|
||||
if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
|
||||
filebuffer_pos++; \
|
||||
result=1; } \
|
||||
} else result=buffered_read_opt (buffer,1);
|
||||
|
||||
extern LLONG buffered_read_opt (unsigned char *buffer, unsigned int bytes);
|
||||
|
||||
//params.c
|
||||
void parse_parameters (int argc, char *argv[]);
|
||||
void usage (void);
|
||||
int atoi_hex (char *s);
|
||||
int stringztoms (const char *s, struct ccx_boundary_time *bt);
|
||||
|
||||
// general_loop.c
|
||||
void position_sanity_check ();
|
||||
int init_file_buffer( void );
|
||||
LLONG ps_getmoredata( void );
|
||||
LLONG general_getmoredata( void );
|
||||
void raw_loop (void);
|
||||
LLONG process_raw (void);
|
||||
void general_loop(void);
|
||||
void processhex (char *filename);
|
||||
void rcwt_loop( void );
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
// activity.c
|
||||
void activity_header (void);
|
||||
void activity_progress (int percentaje, int cur_min, int cur_sec);
|
||||
void activity_report_version (void);
|
||||
void activity_input_file_closed (void);
|
||||
void activity_input_file_open (const char *filename);
|
||||
void activity_message (const char *fmt, ...);
|
||||
void activity_video_info (int hor_size,int vert_size,
|
||||
const char *aspect_ratio, const char *framerate);
|
||||
void activity_program_number (unsigned program_number);
|
||||
void activity_xds_program_name (const char *program_name);
|
||||
void activity_xds_network_call_letters (const char *program_name);
|
||||
void activity_xds_program_identification_number (unsigned minutes, unsigned hours, unsigned date, unsigned month);
|
||||
void activity_xds_program_description (int line_num, const char *program_desc);
|
||||
void activity_report_data_read (void);
|
||||
|
||||
extern LLONG result;
|
||||
extern int end_of_file;
|
||||
extern LLONG inbuf;
|
||||
extern int ccx_bufferdatatype; // Can be RAW or PES
|
||||
|
||||
// asf_functions.c
|
||||
LLONG asf_getmoredata( void );
|
||||
|
||||
// wtv_functions.c
|
||||
LLONG wtv_getmoredata( void );
|
||||
|
||||
// avc_functions.c
|
||||
LLONG process_avc (unsigned char *avcbuf, LLONG avcbuflen);
|
||||
void init_avc(void);
|
||||
|
||||
// es_functions.c
|
||||
LLONG process_m2v (unsigned char *data, LLONG length);
|
||||
|
||||
extern unsigned top_field_first;
|
||||
|
||||
// es_userdata.c
|
||||
int user_data(struct bitstream *ustream, int udtype);
|
||||
|
||||
// bitstream.c - see bitstream.h
|
||||
|
||||
// 608.c
|
||||
int write_cc_buffer(struct s_context_cc608 *context);
|
||||
unsigned char *debug_608toASC (unsigned char *ccdata, int channel);
|
||||
|
||||
|
||||
// cc_decoders_common.c
|
||||
LLONG get_visible_start (void);
|
||||
LLONG get_visible_end (void);
|
||||
|
||||
// file_functions.c
|
||||
LLONG getfilesize (int in);
|
||||
LLONG gettotalfilessize (void);
|
||||
void prepare_for_new_file (void);
|
||||
void close_input_file (void);
|
||||
int switch_to_next_file (LLONG bytesinbuffer);
|
||||
int init_sockets (void);
|
||||
void return_to_buffer (unsigned char *buffer, unsigned int bytes);
|
||||
|
||||
// timing.c
|
||||
void set_fts(void);
|
||||
LLONG get_fts(void);
|
||||
LLONG get_fts_max(void);
|
||||
char *print_mstime( LLONG mstime );
|
||||
char *print_mstime2buf( LLONG mstime , char *buf );
|
||||
void print_debug_timing( void );
|
||||
int gop_accepted(struct gop_time_code* g );
|
||||
void calculate_ms_gop_time (struct gop_time_code *g);
|
||||
|
||||
// sequencing.c
|
||||
void init_hdcc (void);
|
||||
void store_hdcc(unsigned char *cc_data, int cc_count, int sequence_number, LLONG current_fts);
|
||||
void anchor_hdcc(int seq);
|
||||
void process_hdcc (void);
|
||||
int do_cb (unsigned char *cc_block);
|
||||
|
||||
// mp4.c
|
||||
int processmp4 (char *file);
|
||||
|
||||
// params_dump.c
|
||||
void params_dump(void);
|
||||
void print_file_report(void);
|
||||
|
||||
// output.c
|
||||
void init_write (struct ccx_s_write *wb);
|
||||
void writeraw (const unsigned char *data, int length, struct ccx_s_write *wb);
|
||||
void writedata(const unsigned char *data, int length, struct s_context_cc608 *context);
|
||||
void flushbuffer (struct ccx_s_write *wb, int closefile);
|
||||
void printdata (const unsigned char *data1, int length1,const unsigned char *data2, int length2);
|
||||
void writercwtdata (const unsigned char *data);
|
||||
|
||||
// stream_functions.c
|
||||
void detect_stream_type (void);
|
||||
int detect_myth( void );
|
||||
int read_video_pes_header (unsigned char *header, int *headerlength, int sbuflen);
|
||||
int read_pts_pes(unsigned char*header, int len);
|
||||
|
||||
// ts_functions.c
|
||||
void init_ts( void );
|
||||
int ts_readpacket(void);
|
||||
long ts_readstream(void);
|
||||
LLONG ts_getmoredata( void );
|
||||
int write_section(struct ts_payload *payload, unsigned char*buf, int size, int pos);
|
||||
int parse_PMT (unsigned char *buf,int len, int pos);
|
||||
int parse_PAT (void);
|
||||
|
||||
// myth.c
|
||||
void myth_loop(void);
|
||||
|
||||
// mp4_bridge2bento4.c
|
||||
void mp4_loop (char *filename);
|
||||
|
||||
// xds.c
|
||||
void process_xds_bytes (const unsigned char hi, int lo);
|
||||
void do_end_of_xds (unsigned char expected_checksum);
|
||||
void xds_init();
|
||||
|
||||
// ccextractor.c
|
||||
LLONG calculate_gop_mstime (struct gop_time_code *g);
|
||||
void set_fts(void);
|
||||
char *print_mstime( LLONG mstime );
|
||||
void print_debug_timing( void );
|
||||
int switch_to_next_file (LLONG bytesinbuffer);
|
||||
|
||||
// utility.c
|
||||
void fatal(int exit_code, const char *fmt, ...);
|
||||
void dvprint(const char *fmt, ...);
|
||||
void mprint (const char *fmt, ...);
|
||||
void subsprintf (const char *fmt, ...);
|
||||
void dbg_print(LLONG mask, const char *fmt, ...);
|
||||
void fdprintf (int fd, const char *fmt, ...);
|
||||
void init_boundary_time (struct ccx_boundary_time *bt);
|
||||
void sleep_secs (int secs);
|
||||
void dump (LLONG mask, unsigned char *start, int l, unsigned long abs_start, unsigned clear_high_bit);
|
||||
bool_t in_array(uint16_t *array, uint16_t length, uint16_t element) ;
|
||||
int hex2int (char high, char low);
|
||||
void timestamp_to_srttime(uint64_t timestamp, char *buffer);
|
||||
void millis_to_date (uint64_t timestamp, char *buffer) ;
|
||||
int levenshtein_dist (const uint64_t *s1, const uint64_t *s2, unsigned s1len, unsigned s2len);
|
||||
|
||||
void init_context_cc608(struct s_context_cc608 *data, int field);
|
||||
unsigned encode_line (unsigned char *buffer, unsigned char *text);
|
||||
void buffered_seek (int offset);
|
||||
void write_subtitle_file_header(struct ccx_s_write *out);
|
||||
void write_subtitle_file_footer(struct ccx_s_write *out);
|
||||
extern void build_parity_table(void);
|
||||
|
||||
void tlt_process_pes_packet(uint8_t *buffer, uint16_t size) ;
|
||||
void telxcc_init(void);
|
||||
void telxcc_close(void);
|
||||
void mstotime(LLONG milli, unsigned *hours, unsigned *minutes,
|
||||
unsigned *seconds, unsigned *ms);
|
||||
|
||||
extern struct gop_time_code gop_time, first_gop_time, printed_gop;
|
||||
extern int gop_rollover;
|
||||
extern LLONG min_pts, sync_pts, current_pts;
|
||||
extern unsigned rollover_bits;
|
||||
extern uint32_t global_timestamp, min_global_timestamp;
|
||||
extern int global_timestamp_inited;
|
||||
extern LLONG fts_now; // Time stamp of current file (w/ fts_offset, w/o fts_global)
|
||||
extern LLONG fts_offset; // Time before first sync_pts
|
||||
extern LLONG fts_fc_offset; // Time before first GOP
|
||||
extern LLONG fts_max; // Remember the maximum fts that we saw in current file
|
||||
extern LLONG fts_global; // Duration of previous files (-ve mode)
|
||||
// Count 608 (per field) and 708 blocks since last set_fts() call
|
||||
extern int cb_field1, cb_field2, cb_708;
|
||||
extern int saw_caption_block;
|
||||
|
||||
|
||||
extern unsigned char *buffer;
|
||||
extern LLONG past;
|
||||
extern LLONG total_inputsize, total_past; // Only in binary concat mode
|
||||
|
||||
extern char **inputfile;
|
||||
extern int current_file;
|
||||
extern LLONG result; // Number of bytes read/skipped in last read operation
|
||||
|
||||
|
||||
extern struct sockaddr_in servaddr, cliaddr;
|
||||
|
||||
extern int strangeheader;
|
||||
|
||||
extern unsigned char startbytes[STARTBYTESLENGTH];
|
||||
extern unsigned int startbytes_pos;
|
||||
extern int startbytes_avail; // Needs to be able to hold -1 result.
|
||||
|
||||
extern unsigned char *pesheaderbuf;
|
||||
extern int pts_set; //0 = No, 1 = received, 2 = min_pts set
|
||||
extern unsigned long long max_dif;
|
||||
|
||||
extern int MPEG_CLOCK_FREQ; // This is part of the standard
|
||||
|
||||
extern unsigned pts_big_change;
|
||||
extern unsigned total_frames_count;
|
||||
extern unsigned total_pulldownfields;
|
||||
extern unsigned total_pulldownframes;
|
||||
|
||||
extern int CaptionGap;
|
||||
|
||||
extern unsigned char *filebuffer;
|
||||
extern LLONG filebuffer_start; // Position of buffer start relative to file
|
||||
extern int filebuffer_pos; // Position of pointer relative to buffer start
|
||||
extern int bytesinbuffer; // Number of bytes we actually have on buffer
|
||||
|
||||
extern struct s_context_cc608 context_cc608_field_1, context_cc608_field_2;
|
||||
|
||||
extern const char *desc[256];
|
||||
|
||||
extern FILE *fh_out_elementarystream;
|
||||
extern int infd;
|
||||
extern int false_pict_header;
|
||||
|
||||
extern int stat_numuserheaders;
|
||||
extern int stat_dvdccheaders;
|
||||
extern int stat_scte20ccheaders;
|
||||
extern int stat_replay5000headers;
|
||||
extern int stat_replay4000headers;
|
||||
extern int stat_dishheaders;
|
||||
extern int stat_hdtv;
|
||||
extern int stat_divicom;
|
||||
extern enum ccx_stream_mode_enum stream_mode;
|
||||
extern int cc_stats[4];
|
||||
extern LLONG inputsize;
|
||||
|
||||
extern LLONG subs_delay;
|
||||
extern int startcredits_displayed, end_credits_displayed;
|
||||
extern LLONG last_displayed_subs_ms;
|
||||
extern int processed_enough;
|
||||
extern unsigned char usercolor_rgb[8];
|
||||
|
||||
extern const char *extension;
|
||||
extern long FILEBUFFERSIZE; // Uppercase because it used to be a define
|
||||
extern struct ccx_s_options ccx_options;
|
||||
extern int temp_debug;
|
||||
extern unsigned long net_activity_gui;
|
||||
|
||||
/* General (ES stream) video information */
|
||||
extern unsigned current_hor_size;
|
||||
extern unsigned current_vert_size;
|
||||
extern unsigned current_aspect_ratio;
|
||||
extern unsigned current_frame_rate;
|
||||
extern double current_fps;
|
||||
|
||||
extern int end_of_file;
|
||||
extern LLONG inbuf;
|
||||
extern enum ccx_bufferdata_type bufferdatatype; // Can be CCX_BUFFERDATA_TYPE_RAW or CCX_BUFFERDATA_TYPE_PES
|
||||
|
||||
extern unsigned top_field_first;
|
||||
|
||||
extern int firstcall;
|
||||
extern LLONG minimum_fts; // No screen should start before this FTS
|
||||
|
||||
#define MAXBFRAMES 50
|
||||
#define SORTBUF (2*MAXBFRAMES+1)
|
||||
extern int cc_data_count[SORTBUF];
|
||||
extern unsigned char cc_data_pkts[SORTBUF][10*31*3+1];
|
||||
extern int has_ccdata_buffered;
|
||||
extern int current_field;
|
||||
|
||||
extern int last_reported_progress;
|
||||
extern int cc_to_stdout;
|
||||
|
||||
extern unsigned hauppauge_warning_shown;
|
||||
extern unsigned char *subline;
|
||||
extern int saw_gop_header;
|
||||
extern int max_gop_length;
|
||||
extern int last_gop_length;
|
||||
extern int frames_since_last_gop;
|
||||
extern LLONG fts_at_gop_start;
|
||||
extern int frames_since_ref_time;
|
||||
extern enum ccx_stream_mode_enum auto_stream;
|
||||
extern int num_input_files;
|
||||
extern char *basefilename;
|
||||
extern int do_cea708; // Process 708 data?
|
||||
extern int cea708services[63]; // [] -> 1 for services to be processed
|
||||
extern struct ccx_s_write wbout1, wbout2, *wbxdsout;
|
||||
|
||||
extern char **spell_lower;
|
||||
extern char **spell_correct;
|
||||
extern int spell_words;
|
||||
extern int spell_capacity;
|
||||
|
||||
extern unsigned char encoded_crlf[16]; // We keep it encoded here so we don't have to do it many times
|
||||
extern unsigned int encoded_crlf_length;
|
||||
extern unsigned char encoded_br[16];
|
||||
extern unsigned int encoded_br_length;
|
||||
|
||||
|
||||
extern enum ccx_frame_type current_picture_coding_type;
|
||||
extern int current_tref; // Store temporal reference of current frame
|
||||
|
||||
extern int cc608_parity_table[256]; // From myth
|
||||
|
||||
// From ts_functions
|
||||
extern unsigned cap_stream_type;
|
||||
extern struct ts_payload payload;
|
||||
extern unsigned char tspacket[188];
|
||||
extern struct PAT_entry pmt_array[TS_PMT_MAP_SIZE];
|
||||
extern uint16_t pmt_array_length;
|
||||
extern unsigned pmtpid;
|
||||
extern unsigned TS_program_number;
|
||||
extern unsigned char *last_pat_payload;
|
||||
extern unsigned last_pat_length;
|
||||
extern long capbuflen;
|
||||
|
||||
|
||||
#define HAUPPAGE_CCPID 1003 // PID for CC's in some Hauppauge recordings
|
||||
|
||||
/* Exit codes. Take this seriously as the GUI depends on them.
|
||||
0 means OK as usual,
|
||||
<100 means display whatever was output to stderr as a warning
|
||||
>=100 means display whatever was output to stdout as an error
|
||||
*/
|
||||
|
||||
#define EXIT_OK 0
|
||||
#define EXIT_NO_INPUT_FILES 2
|
||||
#define EXIT_TOO_MANY_INPUT_FILES 3
|
||||
#define EXIT_INCOMPATIBLE_PARAMETERS 4
|
||||
#define EXIT_FILE_CREATION_FAILED 5
|
||||
#define EXIT_UNABLE_TO_DETERMINE_FILE_SIZE 6
|
||||
#define EXIT_MALFORMED_PARAMETER 7
|
||||
#define EXIT_READ_ERROR 8
|
||||
#define EXIT_UNSUPPORTED 9
|
||||
#define EXIT_NOT_CLASSIFIED 300
|
||||
#define EXIT_NOT_ENOUGH_MEMORY 500
|
||||
#define EXIT_ERROR_IN_CAPITALIZATION_FILE 501
|
||||
#define EXIT_BUFFER_FULL 502
|
||||
#define EXIT_BUG_BUG 1000
|
||||
#define EXIT_MISSING_ASF_HEADER 1001
|
||||
#define EXIT_MISSING_RCWT_HEADER 1002
|
||||
|
||||
extern int PIDs_seen[65536];
|
||||
extern struct PMT_entry *PIDs_programs[65536];
|
||||
|
||||
extern LLONG ts_start_of_xds;
|
||||
//extern int timestamps_on_transcript;
|
||||
|
||||
extern unsigned teletext_mode;
|
||||
|
||||
#define MAX_TLT_PAGES 1000
|
||||
extern short int seen_sub_page[MAX_TLT_PAGES];
|
||||
|
||||
extern uint64_t utc_refvalue; // UTC referential value
|
||||
extern struct ccx_s_teletext_config tlt_config;
|
||||
extern uint32_t tlt_packet_counter;
|
||||
extern uint32_t tlt_frames_produced;
|
||||
|
||||
#endif
|
||||
125
src/constants.c
125
src/constants.c
@@ -1,125 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
// RCWT header (11 bytes):
|
||||
//byte(s) value description (All values below are hex numbers, not
|
||||
// actual numbers or values
|
||||
//0-2 CCCCED magic number, for Closed Caption CC Extractor Data
|
||||
//3 CC Creating program. Legal values: CC = CC Extractor
|
||||
//4-5 0050 Program version number
|
||||
//6-7 0001 File format version
|
||||
//8-10 000000 Padding, required :-)
|
||||
const unsigned char rcwt_header[11]={0xCC, 0xCC, 0xED, 0xCC, 0x00, 0x50, 0, 1, 0, 0, 0};
|
||||
|
||||
const unsigned char BROADCAST_HEADER[]={0xff, 0xff, 0xff, 0xff};
|
||||
const unsigned char LITTLE_ENDIAN_BOM[]={0xff, 0xfe};
|
||||
const unsigned char UTF8_BOM[]={0xef, 0xbb,0xbf};
|
||||
|
||||
const unsigned char DVD_HEADER[8]={0x00,0x00,0x01,0xb2,0x43,0x43,0x01,0xf8};
|
||||
const unsigned char lc1[1]={0x8a};
|
||||
const unsigned char lc2[1]={0x8f};
|
||||
const unsigned char lc3[2]={0x16,0xfe};
|
||||
const unsigned char lc4[2]={0x1e,0xfe};
|
||||
const unsigned char lc5[1]={0xff};
|
||||
const unsigned char lc6[1]={0xfe};
|
||||
|
||||
const double framerates_values[16]=
|
||||
{
|
||||
0,
|
||||
24000.0/1001, /* 23.976 */
|
||||
24.0,
|
||||
25.0,
|
||||
30000.0/1001, /* 29.97 */
|
||||
30.0,
|
||||
50.0,
|
||||
60000.0/1001, /* 59.94 */
|
||||
60.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
const char *framerates_types[16]=
|
||||
{
|
||||
"00 - forbidden",
|
||||
"01 - 23.976",
|
||||
"02 - 24",
|
||||
"03 - 25",
|
||||
"04 - 29.97",
|
||||
"05 - 30",
|
||||
"06 - 50",
|
||||
"07 - 59.94",
|
||||
"08 - 60",
|
||||
"09 - reserved",
|
||||
"10 - reserved",
|
||||
"11 - reserved",
|
||||
"12 - reserved",
|
||||
"13 - reserved",
|
||||
"14 - reserved",
|
||||
"15 - reserved"
|
||||
};
|
||||
|
||||
const char *aspect_ratio_types[16]=
|
||||
{
|
||||
"00 - forbidden",
|
||||
"01 - 1:1",
|
||||
"02 - 4:3",
|
||||
"03 - 16:9",
|
||||
"04 - 2.21:1",
|
||||
"05 - reserved",
|
||||
"06 - reserved",
|
||||
"07 - reserved",
|
||||
"08 - reserved",
|
||||
"09 - reserved",
|
||||
"10 - reserved",
|
||||
"11 - reserved",
|
||||
"12 - reserved",
|
||||
"13 - reserved",
|
||||
"14 - reserved",
|
||||
"15 - reserved"
|
||||
};
|
||||
|
||||
|
||||
const char *pict_types[8]=
|
||||
{
|
||||
"00 - ilegal (0)",
|
||||
"01 - I",
|
||||
"02 - P",
|
||||
"03 - B",
|
||||
"04 - ilegal (D)",
|
||||
"05 - ilegal (5)",
|
||||
"06 - ilegal (6)",
|
||||
"07 - ilegal (7)"
|
||||
};
|
||||
|
||||
|
||||
const char *slice_types[10]=
|
||||
{
|
||||
"0 - P",
|
||||
"1 - B",
|
||||
"2 - I",
|
||||
"3 - SP",
|
||||
"4 - SI",
|
||||
"5 - P",
|
||||
"6 - B",
|
||||
"7 - I",
|
||||
"8 - SP",
|
||||
"9 - SI"
|
||||
};
|
||||
|
||||
const char *cc_types[4] =
|
||||
{
|
||||
"NTSC line 21 field 1 closed captions",
|
||||
"NTSC line 21 field 2 closed captions",
|
||||
"DTVCC Channel Packet Data",
|
||||
"DTVCC Channel Packet Start"
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NTSC_CC_f1 = 0,
|
||||
NTSC_CC_f2 = 1,
|
||||
DTVCC_PACKET_DATA = 2,
|
||||
DTVCC_PACKET_START = 3,
|
||||
};
|
||||
840
src/encoding.c
840
src/encoding.c
@@ -1,840 +0,0 @@
|
||||
#include <ctype.h>
|
||||
|
||||
void get_char_in_latin_1 (unsigned char *buffer, unsigned char c)
|
||||
{
|
||||
unsigned char c1='?';
|
||||
if (c<0x80)
|
||||
{
|
||||
// Regular line-21 character set, mostly ASCII except these exceptions
|
||||
switch (c)
|
||||
{
|
||||
case 0x2a: // lowercase a, acute accent
|
||||
c1=0xe1;
|
||||
break;
|
||||
case 0x5c: // lowercase e, acute accent
|
||||
c1=0xe9;
|
||||
break;
|
||||
case 0x5e: // lowercase i, acute accent
|
||||
c1=0xed;
|
||||
break;
|
||||
case 0x5f: // lowercase o, acute accent
|
||||
c1=0xf3;
|
||||
break;
|
||||
case 0x60: // lowercase u, acute accent
|
||||
c1=0xfa;
|
||||
break;
|
||||
case 0x7b: // lowercase c with cedilla
|
||||
c1=0xe7;
|
||||
break;
|
||||
case 0x7c: // division symbol
|
||||
c1=0xf7;
|
||||
break;
|
||||
case 0x7d: // uppercase N tilde
|
||||
c1=0xd1;
|
||||
break;
|
||||
case 0x7e: // lowercase n tilde
|
||||
c1=0xf1;
|
||||
break;
|
||||
default:
|
||||
c1=c;
|
||||
break;
|
||||
}
|
||||
*buffer=c1;
|
||||
return;
|
||||
}
|
||||
switch (c)
|
||||
{
|
||||
// THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
|
||||
case 0x80: // Registered symbol (R)
|
||||
c1=0xae;
|
||||
break;
|
||||
case 0x81: // degree sign
|
||||
c1=0xb0;
|
||||
break;
|
||||
case 0x82: // 1/2 symbol
|
||||
c1=0xbd;
|
||||
break;
|
||||
case 0x83: // Inverted (open) question mark
|
||||
c1=0xbf;
|
||||
break;
|
||||
case 0x84: // Trademark symbol (TM) - Does not exist in Latin 1
|
||||
break;
|
||||
case 0x85: // Cents symbol
|
||||
c1=0xa2;
|
||||
break;
|
||||
case 0x86: // Pounds sterling
|
||||
c1=0xa3;
|
||||
break;
|
||||
case 0x87: // Music note - Not in latin 1, so we use 'pilcrow'
|
||||
c1=0xb6;
|
||||
break;
|
||||
case 0x88: // lowercase a, grave accent
|
||||
c1=0xe0;
|
||||
break;
|
||||
case 0x89: // transparent space, we make it regular
|
||||
c1=0x20;
|
||||
break;
|
||||
case 0x8a: // lowercase e, grave accent
|
||||
c1=0xe8;
|
||||
break;
|
||||
case 0x8b: // lowercase a, circumflex accent
|
||||
c1=0xe2;
|
||||
break;
|
||||
case 0x8c: // lowercase e, circumflex accent
|
||||
c1=0xea;
|
||||
break;
|
||||
case 0x8d: // lowercase i, circumflex accent
|
||||
c1=0xee;
|
||||
break;
|
||||
case 0x8e: // lowercase o, circumflex accent
|
||||
c1=0xf4;
|
||||
break;
|
||||
case 0x8f: // lowercase u, circumflex accent
|
||||
c1=0xfb;
|
||||
break;
|
||||
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
|
||||
case 0x90: // capital letter A with acute
|
||||
c1=0xc1;
|
||||
break;
|
||||
case 0x91: // capital letter E with acute
|
||||
c1=0xc9;
|
||||
break;
|
||||
case 0x92: // capital letter O with acute
|
||||
c1=0xd3;
|
||||
break;
|
||||
case 0x93: // capital letter U with acute
|
||||
c1=0xda;
|
||||
break;
|
||||
case 0x94: // capital letter U with diaresis
|
||||
c1=0xdc;
|
||||
break;
|
||||
case 0x95: // lowercase letter U with diaeresis
|
||||
c1=0xfc;
|
||||
break;
|
||||
case 0x96: // apostrophe
|
||||
c1=0x27;
|
||||
break;
|
||||
case 0x97: // inverted exclamation mark
|
||||
c1=0xa1;
|
||||
break;
|
||||
case 0x98: // asterisk
|
||||
c1=0x2a;
|
||||
break;
|
||||
case 0x99: // apostrophe (yes, duped). See CCADI source code.
|
||||
c1=0x27;
|
||||
break;
|
||||
case 0x9a: // em dash
|
||||
c1=0x2d;
|
||||
break;
|
||||
case 0x9b: // copyright sign
|
||||
c1=0xa9;
|
||||
break;
|
||||
case 0x9c: // Service Mark - not available in latin 1
|
||||
break;
|
||||
case 0x9d: // Full stop (.)
|
||||
c1=0x2e;
|
||||
break;
|
||||
case 0x9e: // Quoatation mark
|
||||
c1=0x22;
|
||||
break;
|
||||
case 0x9f: // Quoatation mark
|
||||
c1=0x22;
|
||||
break;
|
||||
case 0xa0: // uppercase A, grave accent
|
||||
c1=0xc0;
|
||||
break;
|
||||
case 0xa1: // uppercase A, circumflex
|
||||
c1=0xc2;
|
||||
break;
|
||||
case 0xa2: // uppercase C with cedilla
|
||||
c1=0xc7;
|
||||
break;
|
||||
case 0xa3: // uppercase E, grave accent
|
||||
c1=0xc8;
|
||||
break;
|
||||
case 0xa4: // uppercase E, circumflex
|
||||
c1=0xca;
|
||||
break;
|
||||
case 0xa5: // capital letter E with diaresis
|
||||
c1=0xcb;
|
||||
break;
|
||||
case 0xa6: // lowercase letter e with diaresis
|
||||
c1=0xeb;
|
||||
break;
|
||||
case 0xa7: // uppercase I, circumflex
|
||||
c1=0xce;
|
||||
break;
|
||||
case 0xa8: // uppercase I, with diaresis
|
||||
c1=0xcf;
|
||||
break;
|
||||
case 0xa9: // lowercase i, with diaresis
|
||||
c1=0xef;
|
||||
break;
|
||||
case 0xaa: // uppercase O, circumflex
|
||||
c1=0xd4;
|
||||
break;
|
||||
case 0xab: // uppercase U, grave accent
|
||||
c1=0xd9;
|
||||
break;
|
||||
case 0xac: // lowercase u, grave accent
|
||||
c1=0xf9;
|
||||
break;
|
||||
case 0xad: // uppercase U, circumflex
|
||||
c1=0xdb;
|
||||
break;
|
||||
case 0xae: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
c1=0xab;
|
||||
break;
|
||||
case 0xaf: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
c1=0xbb;
|
||||
break;
|
||||
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
|
||||
case 0xb0: // Uppercase A, tilde
|
||||
c1=0xc3;
|
||||
break;
|
||||
case 0xb1: // Lowercase a, tilde
|
||||
c1=0xe3;
|
||||
break;
|
||||
case 0xb2: // Uppercase I, acute accent
|
||||
c1=0xcd;
|
||||
break;
|
||||
case 0xb3: // Uppercase I, grave accent
|
||||
c1=0xcc;
|
||||
break;
|
||||
case 0xb4: // Lowercase i, grave accent
|
||||
c1=0xec;
|
||||
break;
|
||||
case 0xb5: // Uppercase O, grave accent
|
||||
c1=0xd2;
|
||||
break;
|
||||
case 0xb6: // Lowercase o, grave accent
|
||||
c1=0xf2;
|
||||
break;
|
||||
case 0xb7: // Uppercase O, tilde
|
||||
c1=0xd5;
|
||||
break;
|
||||
case 0xb8: // Lowercase o, tilde
|
||||
c1=0xf5;
|
||||
break;
|
||||
case 0xb9: // Open curly brace
|
||||
c1=0x7b;
|
||||
break;
|
||||
case 0xba: // Closing curly brace
|
||||
c1=0x7d;
|
||||
break;
|
||||
case 0xbb: // Backslash
|
||||
c1=0x5c;
|
||||
break;
|
||||
case 0xbc: // Caret
|
||||
c1=0x5e;
|
||||
break;
|
||||
case 0xbd: // Underscore
|
||||
c1=0x5f;
|
||||
break;
|
||||
case 0xbe: // Pipe (broken bar)
|
||||
c1=0xa6;
|
||||
break;
|
||||
case 0xbf: // Tilde
|
||||
c1=0x7e;
|
||||
break;
|
||||
case 0xc0: // Uppercase A, umlaut
|
||||
c1=0xc4;
|
||||
break;
|
||||
case 0xc1: // Lowercase A, umlaut
|
||||
c1=0xe3;
|
||||
break;
|
||||
case 0xc2: // Uppercase O, umlaut
|
||||
c1=0xd6;
|
||||
break;
|
||||
case 0xc3: // Lowercase o, umlaut
|
||||
c1=0xf6;
|
||||
break;
|
||||
case 0xc4: // Esszett (sharp S)
|
||||
c1=0xdf;
|
||||
break;
|
||||
case 0xc5: // Yen symbol
|
||||
c1=0xa5;
|
||||
break;
|
||||
case 0xc6: // Currency symbol
|
||||
c1=0xa4;
|
||||
break;
|
||||
case 0xc7: // Vertical bar
|
||||
c1=0x7c;
|
||||
break;
|
||||
case 0xc8: // Uppercase A, ring
|
||||
c1=0xc5;
|
||||
break;
|
||||
case 0xc9: // Lowercase A, ring
|
||||
c1=0xe5;
|
||||
break;
|
||||
case 0xca: // Uppercase O, slash
|
||||
c1=0xd8;
|
||||
break;
|
||||
case 0xcb: // Lowercase o, slash
|
||||
c1=0xf8;
|
||||
break;
|
||||
case 0xcc: // Upper left corner
|
||||
case 0xcd: // Upper right corner
|
||||
case 0xce: // Lower left corner
|
||||
case 0xcf: // Lower right corner
|
||||
default: // For those that don't have representation
|
||||
*buffer='?'; // I'll do it eventually, I promise
|
||||
break; // This are weird chars anyway
|
||||
}
|
||||
*buffer=c1;
|
||||
}
|
||||
|
||||
void get_char_in_unicode (unsigned char *buffer, unsigned char c)
|
||||
{
|
||||
unsigned char c1,c2;
|
||||
switch (c)
|
||||
{
|
||||
case 0x84: // Trademark symbol (TM)
|
||||
c2=0x21;
|
||||
c1=0x22;
|
||||
break;
|
||||
case 0x87: // Music note
|
||||
c2=0x26;
|
||||
c1=0x6a;
|
||||
break;
|
||||
case 0x9c: // Service Mark
|
||||
c2=0x21;
|
||||
c1=0x20;
|
||||
break;
|
||||
case 0xcc: // Upper left corner
|
||||
c2=0x23;
|
||||
c1=0x1c;
|
||||
break;
|
||||
case 0xcd: // Upper right corner
|
||||
c2=0x23;
|
||||
c1=0x1d;
|
||||
break;
|
||||
case 0xce: // Lower left corner
|
||||
c2=0x23;
|
||||
c1=0x1e;
|
||||
break;
|
||||
case 0xcf: // Lower right corner
|
||||
c2=0x23;
|
||||
c1=0x1f;
|
||||
break;
|
||||
default: // Everything else, same as latin-1 followed by 00
|
||||
get_char_in_latin_1 (&c1,c);
|
||||
c2=0;
|
||||
break;
|
||||
}
|
||||
*buffer=c1;
|
||||
*(buffer+1)=c2;
|
||||
}
|
||||
|
||||
int get_char_in_utf_8 (unsigned char *buffer, unsigned char c) // Returns number of bytes used
|
||||
{
|
||||
if (c<0x80) // Regular line-21 character set, mostly ASCII except these exceptions
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 0x2a: // lowercase a, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa1;
|
||||
return 2;
|
||||
case 0x5c: // lowercase e, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa9;
|
||||
return 2;
|
||||
case 0x5e: // lowercase i, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xad;
|
||||
return 2;
|
||||
case 0x5f: // lowercase o, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb3;
|
||||
return 2;
|
||||
case 0x60: // lowercase u, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xba;
|
||||
return 2;
|
||||
case 0x7b: // lowercase c with cedilla
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa7;
|
||||
return 2;
|
||||
case 0x7c: // division symbol
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb7;
|
||||
return 2;
|
||||
case 0x7d: // uppercase N tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x91;
|
||||
return 2;
|
||||
case 0x7e: // lowercase n tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb1;
|
||||
return 2;
|
||||
case 0x7f: // Solid block
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x96;
|
||||
*(buffer+2)=0xa0;
|
||||
return 3;
|
||||
default:
|
||||
*buffer=c;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
switch (c)
|
||||
{
|
||||
// THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
|
||||
case 0x80: // Registered symbol (R)
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xae;
|
||||
return 2;
|
||||
case 0x81: // degree sign
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xb0;
|
||||
return 2;
|
||||
case 0x82: // 1/2 symbol
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xbd;
|
||||
return 2;
|
||||
case 0x83: // Inverted (open) question mark
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xbf;
|
||||
return 2;
|
||||
case 0x84: // Trademark symbol (TM)
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x84;
|
||||
*(buffer+2)=0xa2;
|
||||
return 3;
|
||||
case 0x85: // Cents symbol
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa2;
|
||||
return 2;
|
||||
case 0x86: // Pounds sterling
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa3;
|
||||
return 2;
|
||||
case 0x87: // Music note
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x99;
|
||||
*(buffer+2)=0xaa;
|
||||
return 3;
|
||||
case 0x88: // lowercase a, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa0;
|
||||
return 2;
|
||||
case 0x89: // transparent space, we make it regular
|
||||
*buffer=0x20;
|
||||
return 1;
|
||||
case 0x8a: // lowercase e, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa8;
|
||||
return 2;
|
||||
case 0x8b: // lowercase a, circumflex accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa2;
|
||||
return 2;
|
||||
case 0x8c: // lowercase e, circumflex accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xaa;
|
||||
return 2;
|
||||
case 0x8d: // lowercase i, circumflex accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xae;
|
||||
return 2;
|
||||
case 0x8e: // lowercase o, circumflex accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb4;
|
||||
return 2;
|
||||
case 0x8f: // lowercase u, circumflex accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xbb;
|
||||
return 2;
|
||||
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
|
||||
case 0x90: // capital letter A with acute
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x81;
|
||||
return 2;
|
||||
case 0x91: // capital letter E with acute
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x89;
|
||||
return 2;
|
||||
case 0x92: // capital letter O with acute
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x93;
|
||||
return 2;
|
||||
case 0x93: // capital letter U with acute
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x9a;
|
||||
return 2;
|
||||
case 0x94: // capital letter U with diaresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x9c;
|
||||
return 2;
|
||||
case 0x95: // lowercase letter U with diaeresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xbc;
|
||||
return 2;
|
||||
case 0x96: // apostrophe
|
||||
*buffer=0x27;
|
||||
return 1;
|
||||
case 0x97: // inverted exclamation mark
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa1;
|
||||
return 2;
|
||||
case 0x98: // asterisk
|
||||
*buffer=0x2a;
|
||||
return 1;
|
||||
case 0x99: // Plain single quote
|
||||
*buffer=0x27;
|
||||
return 1;
|
||||
case 0x9a: // em dash
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x80;
|
||||
*(buffer+2)=0x94;
|
||||
return 3;
|
||||
case 0x9b: // copyright sign
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa9;
|
||||
return 2;
|
||||
case 0x9c: // Service mark
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x84;
|
||||
*(buffer+2)=0xa0;
|
||||
return 3;
|
||||
case 0x9d: // Round bullet
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x80;
|
||||
*(buffer+2)=0xa2;
|
||||
return 3;
|
||||
case 0x9e: // Opening double quotes
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x80;
|
||||
*(buffer+2)=0x9c;
|
||||
return 3;
|
||||
case 0x9f: // Closing double quotes
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x80;
|
||||
*(buffer+2)=0x9d;
|
||||
return 3;
|
||||
case 0xa0: // uppercase A, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x80;
|
||||
return 2;
|
||||
case 0xa1: // uppercase A, circumflex
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x82;
|
||||
return 2;
|
||||
case 0xa2: // uppercase C with cedilla
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x87;
|
||||
return 2;
|
||||
case 0xa3: // uppercase E, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x88;
|
||||
return 2;
|
||||
case 0xa4: // uppercase E, circumflex
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8a;
|
||||
return 2;
|
||||
case 0xa5: // capital letter E with diaresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8b;
|
||||
return 2;
|
||||
case 0xa6: // lowercase letter e with diaresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xab;
|
||||
return 2;
|
||||
case 0xa7: // uppercase I, circumflex
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8e;
|
||||
return 2;
|
||||
case 0xa8: // uppercase I, with diaresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8f;
|
||||
return 2;
|
||||
case 0xa9: // lowercase i, with diaresis
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xaf;
|
||||
return 2;
|
||||
case 0xaa: // uppercase O, circumflex
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x94;
|
||||
return 2;
|
||||
case 0xab: // uppercase U, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x99;
|
||||
return 2;
|
||||
case 0xac: // lowercase u, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb9;
|
||||
return 2;
|
||||
case 0xad: // uppercase U, circumflex
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x9b;
|
||||
return 2;
|
||||
case 0xae: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xab;
|
||||
return 2;
|
||||
case 0xaf: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xbb;
|
||||
return 2;
|
||||
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
|
||||
// THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
|
||||
case 0xb0: // Uppercase A, tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x83;
|
||||
return 2;
|
||||
case 0xb1: // Lowercase a, tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa3;
|
||||
return 2;
|
||||
case 0xb2: // Uppercase I, acute accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8d;
|
||||
return 2;
|
||||
case 0xb3: // Uppercase I, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x8c;
|
||||
return 2;
|
||||
case 0xb4: // Lowercase i, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xac;
|
||||
return 2;
|
||||
case 0xb5: // Uppercase O, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x92;
|
||||
return 2;
|
||||
case 0xb6: // Lowercase o, grave accent
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb2;
|
||||
return 2;
|
||||
case 0xb7: // Uppercase O, tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x95;
|
||||
return 2;
|
||||
case 0xb8: // Lowercase o, tilde
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb5;
|
||||
return 2;
|
||||
case 0xb9: // Open curly brace
|
||||
*buffer=0x7b;
|
||||
return 1;
|
||||
case 0xba: // Closing curly brace
|
||||
*buffer=0x7d;
|
||||
return 1;
|
||||
case 0xbb: // Backslash
|
||||
*buffer=0x5c;
|
||||
return 1;
|
||||
case 0xbc: // Caret
|
||||
*buffer=0x5e;
|
||||
return 1;
|
||||
case 0xbd: // Underscore
|
||||
*buffer=0x5f;
|
||||
return 1;
|
||||
case 0xbe: // Pipe (broken bar)
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa6;
|
||||
return 2;
|
||||
case 0xbf: // Tilde
|
||||
*buffer=0x7e; // Not sure
|
||||
return 1;
|
||||
case 0xc0: // Uppercase A, umlaut
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x84;
|
||||
return 2;
|
||||
case 0xc1: // Lowercase A, umlaut
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa4;
|
||||
return 2;
|
||||
case 0xc2: // Uppercase O, umlaut
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x96;
|
||||
return 2;
|
||||
case 0xc3: // Lowercase o, umlaut
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb6;
|
||||
return 2;
|
||||
case 0xc4: // Esszett (sharp S)
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x9f;
|
||||
return 2;
|
||||
case 0xc5: // Yen symbol
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa5;
|
||||
return 2;
|
||||
case 0xc6: // Currency symbol
|
||||
*buffer=0xc2;
|
||||
*(buffer+1)=0xa4;
|
||||
return 2;
|
||||
case 0xc7: // Vertical bar
|
||||
*buffer=0x7c;
|
||||
return 1;
|
||||
case 0xc8: // Uppercase A, ring
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x85;
|
||||
return 2;
|
||||
case 0xc9: // Lowercase A, ring
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xa5;
|
||||
return 2;
|
||||
case 0xca: // Uppercase O, slash
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0x98;
|
||||
return 2;
|
||||
case 0xcb: // Lowercase o, slash
|
||||
*buffer=0xc3;
|
||||
*(buffer+1)=0xb8;
|
||||
return 2;
|
||||
case 0xcc: // Top left corner
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x8c;
|
||||
*(buffer+2)=0x9c;
|
||||
return 3;
|
||||
case 0xcd: // Top right corner
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x8c;
|
||||
*(buffer+2)=0x9d;
|
||||
return 3;
|
||||
case 0xce: // Bottom left corner
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x8c;
|
||||
*(buffer+2)=0x9e;
|
||||
return 3;
|
||||
case 0xcf: // Bottom right corner
|
||||
*buffer=0xe2;
|
||||
*(buffer+1)=0x8c;
|
||||
*(buffer+2)=0x9f;
|
||||
return 3;
|
||||
default: //
|
||||
*buffer='?'; // I'll do it eventually, I promise
|
||||
return 1; // This are weird chars anyway
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char cctolower (unsigned char c)
|
||||
{
|
||||
if (c>='A' && c<='Z')
|
||||
return tolower(c);
|
||||
switch (c)
|
||||
{
|
||||
case 0x7d: // uppercase N tilde
|
||||
return 0x7e;
|
||||
case 0x90: // capital letter A with acute
|
||||
return 0x2a;
|
||||
case 0x91: // capital letter E with acute
|
||||
return 0x5c;
|
||||
case 0x92: // capital letter O with acute
|
||||
return 0x5f;
|
||||
case 0x93: // capital letter U with acute
|
||||
return 0x60;
|
||||
case 0xa2: // uppercase C with cedilla
|
||||
return 0x7b;
|
||||
case 0xa0: // uppercase A, grave accent
|
||||
return 0x88;
|
||||
case 0xa3: // uppercase E, grave accent
|
||||
return 0x8a;
|
||||
case 0xa1: // uppercase A, circumflex
|
||||
return 0x8b;
|
||||
case 0xa4: // uppercase E, circumflex
|
||||
return 0x8c;
|
||||
case 0xa7: // uppercase I, circumflex
|
||||
return 0x8d;
|
||||
case 0xaa: // uppercase O, circumflex
|
||||
return 0x8e;
|
||||
case 0xad: // uppercase U, circumflex
|
||||
return 0x8f;
|
||||
case 0x94: // capital letter U with diaresis
|
||||
return 0x95;
|
||||
case 0xa5: // capital letter E with diaresis
|
||||
return 0xa6;
|
||||
case 0xa8: // uppercase I, with diaresis
|
||||
return 0xa9;
|
||||
case 0xab: // uppercase U, grave accent
|
||||
return 0xac;
|
||||
case 0xb0: // Uppercase A, tilde
|
||||
return 0xb1;
|
||||
case 0xb2: // Uppercase I, acute accent
|
||||
return 0x5e;
|
||||
case 0xb3: // Uppercase I, grave accent
|
||||
return 0xb4;
|
||||
case 0xb5: // Uppercase O, grave accent
|
||||
return 0xb6;
|
||||
case 0xb7: // Uppercase O, tilde
|
||||
return 0xb8;
|
||||
case 0xc0: // Uppercase A, umlaut
|
||||
return 0xc1;
|
||||
case 0xc2: // Uppercase O, umlaut
|
||||
return 0xc3;
|
||||
case 0xc8: // Uppercase A, ring
|
||||
return 0xc9;
|
||||
case 0xca: // Uppercase O, slash
|
||||
return 0xcb;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
unsigned char cctoupper (unsigned char c)
|
||||
{
|
||||
if (c>='a' && c<='z')
|
||||
return toupper(c);
|
||||
switch (c)
|
||||
{
|
||||
case 0x7e: // lowercase n tilde
|
||||
return 0x7d;
|
||||
case 0x2a: // lowercase a, acute accent
|
||||
return 0x90;
|
||||
case 0x5c: // lowercase e, acute accent
|
||||
return 0x91;
|
||||
case 0x5e: // lowercase i, acute accent
|
||||
return 0xb2;
|
||||
case 0x5f: // lowercase o, acute accent
|
||||
return 0x92;
|
||||
case 0x60: // lowercase u, acute accent
|
||||
return 0x93;
|
||||
case 0x7b: // lowercase c with cedilla
|
||||
return 0xa2;
|
||||
case 0x88: // lowercase a, grave accent
|
||||
return 0xa0;
|
||||
case 0x8a: // lowercase e, grave accent
|
||||
return 0xa3;
|
||||
case 0x8b: // lowercase a, circumflex accent
|
||||
return 0xa1;
|
||||
case 0x8c: // lowercase e, circumflex accent
|
||||
return 0xa4;
|
||||
case 0x8d: // lowercase i, circumflex accent
|
||||
return 0xa7;
|
||||
case 0x8e: // lowercase o, circumflex accent
|
||||
return 0xaa;
|
||||
case 0x8f: // lowercase u, circumflex accent
|
||||
return 0xad;
|
||||
case 0x95: // lowercase letter U with diaeresis
|
||||
return 0x94;
|
||||
case 0xa6: // lowercase letter e with diaresis
|
||||
return 0xa5;
|
||||
case 0xa9: // lowercase i, with diaresis
|
||||
return 0xa8;
|
||||
case 0xac: // lowercase u, grave accent
|
||||
return 0xab;
|
||||
case 0xb1: // Lowercase a, tilde
|
||||
return 0xb0;
|
||||
case 0xb4: // Lowercase i, grave accent
|
||||
return 0xb3;
|
||||
case 0xb6: // Lowercase o, grave accent
|
||||
return 0xb5;
|
||||
case 0xb8: // Lowercase o, tilde
|
||||
return 0xb7;
|
||||
case 0xc1: // Lowercase A, umlaut
|
||||
return 0xc0;
|
||||
case 0xc3: // Lowercase o, umlaut
|
||||
return 0xc2;
|
||||
case 0xc9: // Lowercase A, ring
|
||||
return 0xc8;
|
||||
case 0xcb: // Lowercase o, slash
|
||||
return 0xca;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
1132
src/es_functions.c
1132
src/es_functions.c
File diff suppressed because it is too large
Load Diff
@@ -1,479 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
|
||||
// Parse the user data for captions. The udtype variable denotes
|
||||
// to which type of data it belongs:
|
||||
// 0 .. sequence header
|
||||
// 1 .. GOP header
|
||||
// 2 .. picture header
|
||||
// Return TRUE if the data parsing finished, FALSE otherwise.
|
||||
// estream->pos is advanced. Data is only processed if ustream->error
|
||||
// is FALSE, parsing can set ustream->error to TRUE.
|
||||
int user_data(struct bitstream *ustream, int udtype)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "user_data(%d)\n", udtype);
|
||||
|
||||
// Shall not happen
|
||||
if (ustream->error || ustream->bitsleft <= 0)
|
||||
{
|
||||
// ustream->error=1;
|
||||
return 0; // Actually discarded on call.
|
||||
// CFS: Seen in a Wobble edited file.
|
||||
// fatal(EXIT_BUG_BUG, "user_data: Impossible!");
|
||||
}
|
||||
|
||||
// Do something
|
||||
stat_numuserheaders++;
|
||||
//header+=4;
|
||||
|
||||
unsigned char *ud_header = next_bytes(ustream, 4);
|
||||
if (ustream->error || ustream->bitsleft <= 0)
|
||||
{
|
||||
return 0; // Actually discarded on call.
|
||||
// CFS: Seen in Stick_VHS.mpg.
|
||||
// fatal(EXIT_BUG_BUG, "user_data: Impossible!");
|
||||
}
|
||||
|
||||
// DVD CC header, see
|
||||
// <http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_FORMAT.HTML>
|
||||
if ( !memcmp(ud_header,"\x43\x43", 2 ) )
|
||||
{
|
||||
stat_dvdccheaders++;
|
||||
|
||||
// Probably unneeded, but keep looking for extra caption blocks
|
||||
int maybeextracb = 1;
|
||||
|
||||
read_bytes(ustream, 4); // "43 43 01 F8"
|
||||
|
||||
unsigned char pattern_flag = (unsigned char) read_bits(ustream,1);
|
||||
read_bits(ustream,1);
|
||||
int capcount=(int) read_bits(ustream,5);
|
||||
int truncate_flag = (int) read_bits(ustream,1); // truncate_flag - one CB extra
|
||||
|
||||
int field1packet = 0; // expect Field 1 first
|
||||
if (pattern_flag == 0x00)
|
||||
field1packet=1; // expect Field 1 second
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading %d%s DVD CC segments\n",
|
||||
capcount, (truncate_flag?"+1":""));
|
||||
|
||||
capcount += truncate_flag;
|
||||
|
||||
// This data comes before the first frame header, so
|
||||
// in order to get the correct timing we need to set the
|
||||
// current time to one frame after the maximum time of the
|
||||
// last GOP. Only usefull when there are frames before
|
||||
// the GOP.
|
||||
if (fts_max > 0)
|
||||
fts_now = fts_max + (LLONG) (1000.0/current_fps);
|
||||
|
||||
int rcbcount = 0;
|
||||
for (int i=0; i<capcount; i++)
|
||||
{
|
||||
for (int j=0;j<2;j++)
|
||||
{
|
||||
unsigned char data[3];
|
||||
data[0]=read_u8(ustream);
|
||||
data[1]=read_u8(ustream);
|
||||
data[2]=read_u8(ustream);
|
||||
|
||||
// Obey the truncate flag.
|
||||
if ( truncate_flag && i == capcount-1 && j == 1 )
|
||||
{
|
||||
maybeextracb = 0;
|
||||
break;
|
||||
}
|
||||
/* Field 1 and 2 data can be in either order,
|
||||
with marker bytes of \xff and \xfe
|
||||
Since markers can be repeated, use pattern as well */
|
||||
if ((data[0]&0xFE) == 0xFE) // Check if valid
|
||||
{
|
||||
if (data[0]==0xff && j==field1packet)
|
||||
data[0]=0x04; // Field 1
|
||||
else
|
||||
data[0]=0x05; // Field 2
|
||||
do_cb(data);
|
||||
rcbcount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "Illegal caption segment - stop here.\n");
|
||||
maybeextracb = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Theoretically this should not happen, oh well ...
|
||||
// Deal with extra closed captions some DVD have.
|
||||
int ecbcount = 0;
|
||||
while ( maybeextracb && (next_u8(ustream)&0xFE) == 0xFE )
|
||||
{
|
||||
for (int j=0;j<2;j++)
|
||||
{
|
||||
unsigned char data[3];
|
||||
data[0]=read_u8(ustream);
|
||||
data[1]=read_u8(ustream);
|
||||
data[2]=read_u8(ustream);
|
||||
/* Field 1 and 2 data can be in either order,
|
||||
with marker bytes of \xff and \xfe
|
||||
Since markers can be repeated, use pattern as well */
|
||||
if ((data[0]&0xFE) == 0xFE) // Check if valid
|
||||
{
|
||||
if (data[0]==0xff && j==field1packet)
|
||||
data[0]=0x04; // Field 1
|
||||
else
|
||||
data[0]=0x05; // Field 2
|
||||
do_cb(data);
|
||||
ecbcount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "Illegal (extra) caption segment - stop here.\n");
|
||||
maybeextracb = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Read %d/%d DVD CC blocks\n", rcbcount, ecbcount);
|
||||
}
|
||||
// SCTE 20 user data
|
||||
else if (ud_header[0] == 0x03)
|
||||
{
|
||||
if ((ud_header[1]&0x7F) == 0x01)
|
||||
{
|
||||
unsigned char cc_data[3*31+1]; // Maximum cc_count is 31
|
||||
|
||||
stat_scte20ccheaders++;
|
||||
read_bytes(ustream, 2); // "03 01"
|
||||
|
||||
unsigned cc_count = (unsigned int) read_bits(ustream,5);
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading %d SCTE 20 CC blocks\n", cc_count);
|
||||
|
||||
unsigned field_number;
|
||||
unsigned cc_data1;
|
||||
unsigned cc_data2;
|
||||
/* unsigned marker; */
|
||||
for (unsigned j=0;j<cc_count;j++)
|
||||
{
|
||||
skip_bits(ustream,2); // priority - unused
|
||||
field_number = (unsigned int) read_bits(ustream,2);
|
||||
skip_bits(ustream,5); // line_offset - unused
|
||||
cc_data1 = (unsigned int) read_bits(ustream,8);
|
||||
cc_data2 = (unsigned int) read_bits(ustream,8);
|
||||
/* marker = (unsigned int)read_bits(ustream,1); // TODO: Add syntax check */
|
||||
|
||||
if (ustream->bitsleft < 0)
|
||||
fatal(EXIT_BUG_BUG, "Oops!");
|
||||
|
||||
// Field_number is either
|
||||
// 0 .. forbiden
|
||||
// 1 .. field 1 (odd)
|
||||
// 2 .. field 2 (even)
|
||||
// 3 .. repeated, from repeat_first_field, effectively field 1
|
||||
if (field_number < 1)
|
||||
{
|
||||
// 0 is invalid
|
||||
cc_data[j*3]=0x00; // Set to invalid
|
||||
cc_data[j*3+1]=0x00;
|
||||
cc_data[j*3+2]=0x00;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Treat field_number 3 as 1
|
||||
field_number = (field_number - 1) & 0x01;
|
||||
// top_field_first also affects to which field the caption
|
||||
// belongs.
|
||||
if(!top_field_first)
|
||||
field_number ^= 0x01;
|
||||
cc_data[j*3]=0x04|(field_number);
|
||||
cc_data[j*3+1]=reverse8(cc_data1);
|
||||
cc_data[j*3+2]=reverse8(cc_data2);
|
||||
}
|
||||
}
|
||||
cc_data[cc_count*3]=0xFF;
|
||||
store_hdcc(cc_data, cc_count, current_tref, fts_now);
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading SCTE 20 CC blocks - done\n");
|
||||
}
|
||||
// reserved - unspecified
|
||||
}
|
||||
// ReplayTV 4000/5000 caption header - parsing information
|
||||
// derived from CCExtract.bdl
|
||||
else if ( (ud_header[0] == 0xbb //ReplayTV 4000
|
||||
|| ud_header[0] == 0x99) //ReplayTV 5000
|
||||
&& ud_header[1] == 0x02 )
|
||||
{
|
||||
unsigned char data[3];
|
||||
if (ud_header[0]==0xbb)
|
||||
stat_replay4000headers++;
|
||||
else
|
||||
stat_replay5000headers++;
|
||||
|
||||
read_bytes(ustream, 2); // "BB 02" or "99 02"
|
||||
data[0]=0x05; // Field 2
|
||||
data[1]=read_u8(ustream);
|
||||
data[2]=read_u8(ustream);
|
||||
do_cb(data);
|
||||
read_bytes(ustream, 2); // Skip "CC 02" for R4000 or "AA 02" for R5000
|
||||
data[0]=0x04; // Field 1
|
||||
data[1]=read_u8(ustream);
|
||||
data[2]=read_u8(ustream);
|
||||
do_cb(data);
|
||||
}
|
||||
// HDTV - see A/53 Part 4 (Video)
|
||||
else if ( !memcmp(ud_header,"\x47\x41\x39\x34", 4 ) )
|
||||
{
|
||||
stat_hdtv++;
|
||||
|
||||
read_bytes(ustream, 4); // "47 41 39 34"
|
||||
|
||||
unsigned char type_code = read_u8(ustream);
|
||||
if (type_code==0x03) // CC data.
|
||||
{
|
||||
skip_bits(ustream,1); // reserved
|
||||
unsigned char process_cc_data = (unsigned char) read_bits(ustream,1);
|
||||
skip_bits(ustream,1); // additional_data - unused
|
||||
unsigned char cc_count = (unsigned char) read_bits(ustream,5);
|
||||
read_bytes(ustream, 1); // "FF"
|
||||
if (process_cc_data)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading %d HDTV CC blocks\n", cc_count);
|
||||
|
||||
int proceed = 1;
|
||||
unsigned char *cc_data = read_bytes(ustream, cc_count*3);
|
||||
if (ustream->bitsleft < 0)
|
||||
fatal(EXIT_BUG_BUG, "Not enough for CC captions!");
|
||||
|
||||
// Check for proper marker - This read makes sure that
|
||||
// cc_count*3+1 bytes are read and available in cc_data.
|
||||
if (read_u8(ustream)!=0xFF)
|
||||
proceed=0;
|
||||
|
||||
if (!proceed)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "\rThe following payload is not properly terminated.\n");
|
||||
dump (CCX_DMT_VERBOSE, cc_data, cc_count*3+1, 0, 0);
|
||||
}
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading %d HD CC blocks\n", cc_count);
|
||||
|
||||
// B-frames might be (temporal) before or after the anchor
|
||||
// frame they belong to. Store the buffer until the next anchor
|
||||
// frame occurs. The buffer will be flushed (sorted) in the
|
||||
// picture header (or GOP) section when the next anchor occurs.
|
||||
// Please note we store the current value of the global
|
||||
// fts_now variable (and not get_fts()) as we are going to
|
||||
// re-create the timeline in process_hdcc() (Slightly ugly).
|
||||
store_hdcc(cc_data, cc_count, current_tref, fts_now);
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading HDTV blocks - done\n");
|
||||
}
|
||||
}
|
||||
// reserved - additional_cc_data
|
||||
}
|
||||
// DVB closed caption header for Dish Network (Field 1 only) */
|
||||
else if ( !memcmp(ud_header,"\x05\x02", 2 ) )
|
||||
{
|
||||
// Like HDTV (above) Dish Network captions can be stored at each
|
||||
// frame, but maximal two caption blocks per frame and only one
|
||||
// field is stored.
|
||||
// To process this with the HDTV framework we create a "HDTV" caption
|
||||
// format compatible array. Two times 3 bytes plus one for the 0xFF
|
||||
// marker at the end. Pre-init to field 1 and set the 0xFF marker.
|
||||
static unsigned char dishdata[7] = {0x04, 0, 0, 0x04, 0, 0, 0xFF};
|
||||
int cc_count;
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading Dish Network user data\n");
|
||||
|
||||
stat_dishheaders++;
|
||||
|
||||
read_bytes(ustream, 2); // "05 02"
|
||||
|
||||
// The next bytes are like this:
|
||||
// header[2] : ID: 0x04 (MPEG?), 0x03 (H264?)
|
||||
// header[3-4]: Two byte counter (counting (sub-)GOPs?)
|
||||
// header[5-6]: Two bytes, maybe checksum?
|
||||
// header[7]: Pattern type
|
||||
// on B-frame: 0x02, 0x04
|
||||
// on I-/P-frame: 0x05
|
||||
unsigned char id = read_u8(ustream);
|
||||
unsigned dishcount = read_u16(ustream);
|
||||
unsigned something = read_u16(ustream);
|
||||
unsigned char type = read_u8(ustream);
|
||||
dbg_print(CCX_DMT_PARSE, "DN ID: %02X Count: %5u Unknown: %04X Pattern: %X",
|
||||
id, dishcount, something, type);
|
||||
|
||||
unsigned char hi;
|
||||
|
||||
// The following block needs 4 to 6 bytes starting from the
|
||||
// current position
|
||||
unsigned char *dcd = ustream->pos; // dish caption data
|
||||
switch (type)
|
||||
{
|
||||
case 0x02:
|
||||
// Two byte caption - always on B-frame
|
||||
// The following 4 bytes are:
|
||||
// 0 : 0x09
|
||||
// 1-2: caption block
|
||||
// 3 : REPEAT - 02: two bytes
|
||||
// - 04: four bytes (repeat first two)
|
||||
dbg_print(CCX_DMT_PARSE, "\n02 %02X %02X:%02X - R:%02X :",
|
||||
dcd[0], dcd[1], dcd[2], dcd[3]);
|
||||
|
||||
cc_count = 1;
|
||||
dishdata[1]=dcd[1];
|
||||
dishdata[2]=dcd[2];
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
|
||||
|
||||
type=dcd[3]; // repeater (0x02 or 0x04)
|
||||
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
|
||||
if (type==0x04 && hi<32) // repeat (only for non-character pairs)
|
||||
{
|
||||
cc_count = 2;
|
||||
dishdata[3]=0x04; // Field 1
|
||||
dishdata[4]=dishdata[1];
|
||||
dishdata[5]=dishdata[2];
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_print(CCX_DMT_PARSE, ":\n");
|
||||
}
|
||||
|
||||
dishdata[cc_count*3] = 0xFF; // Set end marker
|
||||
|
||||
store_hdcc(dishdata, cc_count, current_tref, fts_now);
|
||||
|
||||
// Ignore 3 (0x0A, followed by two unknown) bytes.
|
||||
break;
|
||||
case 0x04:
|
||||
// Four byte caption - always on B-frame
|
||||
// The following 5 bytes are:
|
||||
// 0 : 0x09
|
||||
// 1-2: caption block
|
||||
// 3-4: caption block
|
||||
dbg_print(CCX_DMT_PARSE, "\n04 %02X %02X:%02X:%02X:%02X :",
|
||||
dcd[0], dcd[1], dcd[2], dcd[3], dcd[4]);
|
||||
|
||||
cc_count = 2;
|
||||
dishdata[1]=dcd[1];
|
||||
dishdata[2]=dcd[2];
|
||||
|
||||
dishdata[3]=0x04; // Field 1
|
||||
dishdata[4]=dcd[3];
|
||||
dishdata[5]=dcd[4];
|
||||
dishdata[6] = 0xFF; // Set end marker
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
|
||||
store_hdcc(dishdata, cc_count, current_tref, fts_now);
|
||||
|
||||
// Ignore 4 (0x020A, followed by two unknown) bytes.
|
||||
break;
|
||||
case 0x05:
|
||||
// Buffered caption - always on I-/P-frame
|
||||
// The following six bytes are:
|
||||
// 0 : 0x04
|
||||
// - the following are from previous 0x05 caption header -
|
||||
// 1 : prev dcd[2]
|
||||
// 2-3: prev dcd[3-4]
|
||||
// 4-5: prev dcd[5-6]
|
||||
dbg_print(CCX_DMT_PARSE, " - %02X pch: %02X %5u %02X:%02X\n",
|
||||
dcd[0], dcd[1],
|
||||
(unsigned)dcd[2]*256+dcd[3],
|
||||
dcd[4], dcd[5]);
|
||||
dcd+=6; // Skip these 6 bytes
|
||||
|
||||
// Now one of the "regular" 0x02 or 0x04 captions follows
|
||||
dbg_print(CCX_DMT_PARSE, "%02X %02X %02X:%02X",
|
||||
dcd[0], dcd[1], dcd[2], dcd[3]);
|
||||
|
||||
type=dcd[0]; // Number of caption bytes (0x02 or 0x04)
|
||||
|
||||
cc_count = 1;
|
||||
dishdata[1]=dcd[2];
|
||||
dishdata[2]=dcd[3];
|
||||
|
||||
dcd+=4; // Skip the first 4 bytes.
|
||||
if (type==0x02)
|
||||
{
|
||||
type=dcd[0]; // repeater (0x02 or 0x04)
|
||||
dcd++; // Skip the repeater byte.
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, " - R:%02X :%s", type, debug_608toASC( dishdata, 0) );
|
||||
|
||||
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
|
||||
if (type==0x04 && hi<32)
|
||||
{
|
||||
cc_count = 2;
|
||||
dishdata[3]=0x04; // Field 1
|
||||
dishdata[4]=dishdata[1];
|
||||
dishdata[5]=dishdata[2];
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_print(CCX_DMT_PARSE, ":\n");
|
||||
}
|
||||
dishdata[cc_count*3] = 0xFF; // Set end marker
|
||||
}
|
||||
else
|
||||
{
|
||||
dbg_print(CCX_DMT_PARSE, ":%02X:%02X ",
|
||||
dcd[0], dcd[1]);
|
||||
cc_count = 2;
|
||||
dishdata[3]=0x04; // Field 1
|
||||
dishdata[4]=dcd[0];
|
||||
dishdata[5]=dcd[1];
|
||||
dishdata[6] = 0xFF; // Set end marker
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, ":%s", debug_608toASC( dishdata, 0) );
|
||||
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
|
||||
}
|
||||
|
||||
store_hdcc(dishdata, cc_count, current_tref, fts_now);
|
||||
|
||||
// Ignore 3 (0x0A, followed by 2 unknown) bytes.
|
||||
break;
|
||||
default:
|
||||
// printf ("Unknown?\n");
|
||||
break;
|
||||
} // switch
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "Reading Dish Network user data - done\n");
|
||||
}
|
||||
// CEA 608 / aka "Divicom standard", see:
|
||||
// http://www.pixeltools.com/tech_tip_closed_captioning.html
|
||||
else if ( !memcmp(ud_header,"\x02\x09", 2 ) )
|
||||
{
|
||||
// Either a documentation or more examples are needed.
|
||||
stat_divicom++;
|
||||
|
||||
unsigned char data[3];
|
||||
|
||||
read_bytes(ustream, 2); // "02 09"
|
||||
read_bytes(ustream, 2); // "80 80" ???
|
||||
read_bytes(ustream, 2); // "02 0A" ???
|
||||
data[0]=0x04; // Field 1
|
||||
data[1]=read_u8(ustream);
|
||||
data[2]=read_u8(ustream);
|
||||
do_cb(data);
|
||||
// This is probably incomplete!
|
||||
}
|
||||
else
|
||||
{
|
||||
// Some other user data
|
||||
// 06 02 ... Seems to be DirectTV
|
||||
dbg_print(CCX_DMT_VERBOSE, "Unrecognized user data:\n");
|
||||
int udatalen = ustream->end - ustream->pos;
|
||||
dump (CCX_DMT_VERBOSE, ustream->pos, (udatalen > 128 ? 128 : udatalen),0 ,0);
|
||||
}
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "User data - processed\n");
|
||||
|
||||
// Read complete
|
||||
return 1;
|
||||
}
|
||||
@@ -1,501 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
|
||||
long FILEBUFFERSIZE = 1024*1024*16; // 16 Mbytes no less. Minimize number of real read calls()
|
||||
LLONG buffered_read_opt_file (unsigned char *buffer, unsigned int bytes);
|
||||
|
||||
#ifdef _WIN32
|
||||
WSADATA wsaData = {0};
|
||||
int iResult = 0;
|
||||
#endif
|
||||
|
||||
LLONG getfilesize (int in)
|
||||
{
|
||||
LLONG current=LSEEK (in, 0, SEEK_CUR);
|
||||
LLONG length = LSEEK (in,0,SEEK_END);
|
||||
LSEEK (in,current,SEEK_SET);
|
||||
return length;
|
||||
}
|
||||
|
||||
LLONG gettotalfilessize (void) // -1 if one or more files failed to open
|
||||
{
|
||||
LLONG ts=0;
|
||||
int h;
|
||||
for (int i=0;i<num_input_files;i++)
|
||||
{
|
||||
if (0 == strcmp(inputfile[i],"-")) // Skip stdin
|
||||
continue;
|
||||
#ifdef _WIN32
|
||||
h=OPEN (inputfile[i],O_RDONLY | O_BINARY);
|
||||
#else
|
||||
h=OPEN (inputfile[i],O_RDONLY);
|
||||
#endif
|
||||
if (h==-1)
|
||||
{
|
||||
mprint ("\rUnable to open %s\r\n",inputfile[i]);
|
||||
return -1;
|
||||
}
|
||||
if (!ccx_options.live_stream)
|
||||
ts+=getfilesize (h);
|
||||
close (h);
|
||||
}
|
||||
return ts;
|
||||
}
|
||||
|
||||
void prepare_for_new_file (void)
|
||||
{
|
||||
// Init per file variables
|
||||
min_pts=0x01FFFFFFFFLL; // 33 bit
|
||||
sync_pts=0;
|
||||
pts_set = 0;
|
||||
// inputsize=0; Now responsibility of switch_to_next_file()
|
||||
last_reported_progress=-1;
|
||||
stat_numuserheaders = 0;
|
||||
stat_dvdccheaders = 0;
|
||||
stat_scte20ccheaders = 0;
|
||||
stat_replay5000headers = 0;
|
||||
stat_replay4000headers = 0;
|
||||
stat_dishheaders = 0;
|
||||
stat_hdtv = 0;
|
||||
stat_divicom = 0;
|
||||
total_frames_count = 0;
|
||||
total_pulldownfields = 0;
|
||||
total_pulldownframes = 0;
|
||||
cc_stats[0]=0; cc_stats[1]=0; cc_stats[2]=0; cc_stats[3]=0;
|
||||
false_pict_header=0;
|
||||
frames_since_last_gop=0;
|
||||
frames_since_ref_time=0;
|
||||
gop_time.inited=0;
|
||||
first_gop_time.inited=0;
|
||||
gop_rollover=0;
|
||||
printed_gop.inited=0;
|
||||
saw_caption_block=0;
|
||||
past=0;
|
||||
pts_big_change=0;
|
||||
startbytes_pos=0;
|
||||
startbytes_avail=0;
|
||||
init_file_buffer();
|
||||
anchor_hdcc(-1);
|
||||
firstcall = 1;
|
||||
}
|
||||
|
||||
/* Close input file if there is one and let the GUI know */
|
||||
void close_input_file (void)
|
||||
{
|
||||
if (infd!=-1 && ccx_options.input_source==CCX_DS_FILE)
|
||||
{
|
||||
close (infd);
|
||||
infd=-1;
|
||||
activity_input_file_closed();
|
||||
}
|
||||
}
|
||||
|
||||
int init_sockets (void)
|
||||
{
|
||||
static int socket_inited=0;
|
||||
if (!socket_inited)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WSADATA wsaData = {0};
|
||||
// Initialize Winsock
|
||||
iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (iResult != 0) {
|
||||
wprintf(L"WSAStartup failed: %d\n", iResult);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
socket_inited=1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close current file and open next one in list -if any- */
|
||||
/* bytesinbuffer is the number of bytes read (in some buffer) that haven't been added
|
||||
to 'past' yet. We provide this number to switch_to_next_file() so a final sanity check
|
||||
can be done */
|
||||
|
||||
int switch_to_next_file (LLONG bytesinbuffer)
|
||||
{
|
||||
if (current_file==-1 || !ccx_options.binary_concat)
|
||||
{
|
||||
memset (PIDs_seen,0,65536*sizeof (int));
|
||||
memset (PIDs_programs,0,65536*sizeof (struct PMT_entry *));
|
||||
}
|
||||
|
||||
if (ccx_options.input_source==CCX_DS_STDIN)
|
||||
{
|
||||
if (infd!=-1) // Means we had already processed stdin. So we're done.
|
||||
{
|
||||
if (ccx_options.print_file_reports)
|
||||
print_file_report();
|
||||
return 0;
|
||||
}
|
||||
infd=0;
|
||||
mprint ("\n\r-----------------------------------------------------------------\n");
|
||||
mprint ("\rReading from standard input\n");
|
||||
return 1;
|
||||
}
|
||||
if (ccx_options.input_source==CCX_DS_NETWORK)
|
||||
{
|
||||
if (infd!=-1) // Means we have already bound a socket.
|
||||
{
|
||||
if (ccx_options.print_file_reports)
|
||||
print_file_report();
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (init_sockets())
|
||||
return 1;
|
||||
infd=socket(AF_INET,SOCK_DGRAM,0);
|
||||
if (IN_MULTICAST(ccx_options.udpaddr))
|
||||
{
|
||||
int on = 1;
|
||||
(void)setsockopt(infd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on));
|
||||
}
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_addr.s_addr=htonl(IN_MULTICAST(ccx_options.udpaddr) ? ccx_options.udpaddr : INADDR_ANY);
|
||||
servaddr.sin_port=htons(ccx_options.udpport);
|
||||
if (bind(infd,(struct sockaddr *)&servaddr,sizeof(servaddr)))
|
||||
{
|
||||
fatal (EXIT_BUG_BUG, "bind() failed.");
|
||||
}
|
||||
if (IN_MULTICAST(ccx_options.udpaddr)) {
|
||||
struct ip_mreq group;
|
||||
group.imr_multiaddr.s_addr = htonl(ccx_options.udpaddr);
|
||||
group.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||
if (setsockopt(infd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&group, sizeof(group)) < 0)
|
||||
{
|
||||
fatal (EXIT_BUG_BUG, "cannot join multicast group.");
|
||||
}
|
||||
}
|
||||
|
||||
mprint ("\n\r-----------------------------------------------------------------\n");
|
||||
if (ccx_options.udpaddr == INADDR_ANY)
|
||||
{
|
||||
mprint ("\rReading from UDP socket %u\n",ccx_options.udpport);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = htonl(ccx_options.udpaddr);
|
||||
mprint ("\rReading from UDP socket %s:%u\n", inet_ntoa(in), ccx_options.udpport);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Close current and make sure things are still sane */
|
||||
if (infd!=-1)
|
||||
{
|
||||
if (ccx_options.print_file_reports)
|
||||
print_file_report();
|
||||
close_input_file ();
|
||||
if (inputsize>0 && ((past+bytesinbuffer) < inputsize) && !processed_enough)
|
||||
{
|
||||
mprint("\n\n\n\nATTENTION!!!!!!\n");
|
||||
mprint("In switch_to_next_file(): Processing of %s %d ended prematurely %lld < %lld, please send bug report.\n\n",
|
||||
inputfile[current_file], current_file, past, inputsize);
|
||||
}
|
||||
if (ccx_options.binary_concat)
|
||||
{
|
||||
total_past+=inputsize;
|
||||
past=0; // Reset always or at the end we'll have double the size
|
||||
}
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
current_file++;
|
||||
if (current_file>=num_input_files)
|
||||
break;
|
||||
|
||||
// The following \n keeps the progress percentage from being overwritten.
|
||||
mprint ("\n\r-----------------------------------------------------------------\n");
|
||||
mprint ("\rOpening file: %s\n", inputfile[current_file]);
|
||||
#ifdef _WIN32
|
||||
infd=OPEN (inputfile[current_file],O_RDONLY | O_BINARY);
|
||||
#else
|
||||
infd=OPEN (inputfile[current_file],O_RDONLY);
|
||||
#endif
|
||||
if (infd == -1)
|
||||
mprint ("\rWarning: Unable to open input file [%s]\n", inputfile[current_file]);
|
||||
else
|
||||
{
|
||||
activity_input_file_open (inputfile[current_file]);
|
||||
if (!ccx_options.live_stream)
|
||||
{
|
||||
inputsize = getfilesize (infd);
|
||||
if (!ccx_options.binary_concat)
|
||||
total_inputsize=inputsize;
|
||||
}
|
||||
return 1; // Succeeded
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void position_sanity_check ()
|
||||
{
|
||||
#ifdef SANITY_CHECK
|
||||
if (in!=-1)
|
||||
{
|
||||
LLONG realpos=LSEEK (in,0,SEEK_CUR);
|
||||
if (realpos!=past-filebuffer_pos+bytesinbuffer)
|
||||
{
|
||||
fatal (EXIT_BUG_BUG, "Position desync, THIS IS A BUG. Real pos =%lld, past=%lld.\n",realpos,past);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int init_file_buffer(void)
|
||||
{
|
||||
filebuffer_start=0;
|
||||
filebuffer_pos=0;
|
||||
if (filebuffer==NULL)
|
||||
{
|
||||
filebuffer=(unsigned char *) malloc (FILEBUFFERSIZE);
|
||||
bytesinbuffer=0;
|
||||
}
|
||||
if (filebuffer==NULL)
|
||||
{
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void buffered_seek (int offset)
|
||||
{
|
||||
position_sanity_check();
|
||||
if (offset<0)
|
||||
{
|
||||
filebuffer_pos+=offset;
|
||||
if (filebuffer_pos<0)
|
||||
{
|
||||
// We got into the start buffer (hopefully)
|
||||
if (startbytes_pos+filebuffer_pos < 0)
|
||||
{
|
||||
fatal (EXIT_BUG_BUG, "PANIC: Attempt to seek before buffer start, this is a bug!");
|
||||
}
|
||||
startbytes_pos+=filebuffer_pos;
|
||||
filebuffer_pos=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffered_read_opt (NULL, offset);
|
||||
position_sanity_check();
|
||||
}
|
||||
}
|
||||
|
||||
void sleepandchecktimeout (time_t start)
|
||||
{
|
||||
if (ccx_options.input_source==CCX_DS_STDIN)
|
||||
{
|
||||
// CFS: Not 100% sure about this. Fine for files, not so sure what happens if stdin is
|
||||
// real time input from hardware.
|
||||
sleep_secs (1);
|
||||
ccx_options.live_stream=0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ccx_options.live_stream==-1) // Just sleep, no timeout to check
|
||||
{
|
||||
sleep_secs (1);
|
||||
return;
|
||||
}
|
||||
if (time(NULL)>start+ccx_options.live_stream) // More than live_stream seconds elapsed. No more live
|
||||
ccx_options.live_stream=0;
|
||||
else
|
||||
sleep_secs(1);
|
||||
}
|
||||
|
||||
void return_to_buffer (unsigned char *buffer, unsigned int bytes)
|
||||
{
|
||||
if (bytes == filebuffer_pos)
|
||||
{
|
||||
// Usually we're just going back in the buffer and memcpy would be
|
||||
// unnecessary, but we do it in case we intentionally messed with the
|
||||
// buffer
|
||||
memcpy (filebuffer, buffer, bytes);
|
||||
filebuffer_pos=0;
|
||||
return;
|
||||
}
|
||||
if (filebuffer_pos>0) // Discard old bytes, because we may need the space
|
||||
{
|
||||
// Non optimal since data is moved later again but we don't care since
|
||||
// we're never here in ccextractor.
|
||||
memmove (filebuffer,filebuffer+filebuffer_pos,bytesinbuffer-filebuffer_pos);
|
||||
bytesinbuffer-=filebuffer_pos;
|
||||
bytesinbuffer=0;
|
||||
filebuffer_pos=0;
|
||||
}
|
||||
|
||||
if (bytesinbuffer + bytes > FILEBUFFERSIZE)
|
||||
fatal (EXIT_BUG_BUG, "Invalid return_to_buffer() - please submit a bug report.");
|
||||
memmove (filebuffer+bytes,filebuffer,bytesinbuffer);
|
||||
memcpy (filebuffer,buffer,bytes);
|
||||
bytesinbuffer+=bytes;
|
||||
}
|
||||
|
||||
LLONG buffered_read_opt (unsigned char *buffer, unsigned int bytes)
|
||||
{
|
||||
LLONG copied=0;
|
||||
position_sanity_check();
|
||||
time_t seconds=0;
|
||||
if (ccx_options.live_stream>0)
|
||||
time (&seconds);
|
||||
if (ccx_options.buffer_input || filebuffer_pos<bytesinbuffer)
|
||||
{
|
||||
// Needs to return data from filebuffer_start+pos to filebuffer_start+pos+bytes-1;
|
||||
int eof = (infd==-1);
|
||||
|
||||
while ((!eof || ccx_options.live_stream) && bytes)
|
||||
{
|
||||
if (eof)
|
||||
{
|
||||
// No more data available inmediately, we sleep a while to give time
|
||||
// for the data to come up
|
||||
sleepandchecktimeout (seconds);
|
||||
}
|
||||
size_t ready = bytesinbuffer-filebuffer_pos;
|
||||
if (ready==0) // We really need to read more
|
||||
{
|
||||
if (!ccx_options.buffer_input)
|
||||
{
|
||||
// We got in the buffering code because of the initial buffer for
|
||||
// detection stuff. However we don't want more buffering so
|
||||
// we do the rest directly on the final buffer.
|
||||
int i;
|
||||
do
|
||||
{
|
||||
// No code for network support here, because network is always
|
||||
// buffered - if here, then it must be files.
|
||||
if (buffer!=NULL) // Read
|
||||
{
|
||||
i=read (infd,buffer,bytes);
|
||||
if( i == -1)
|
||||
fatal (EXIT_READ_ERROR, "Error reading input file!\n");
|
||||
buffer+=i;
|
||||
}
|
||||
else // Seek
|
||||
{
|
||||
LLONG op, np;
|
||||
op =LSEEK (infd,0,SEEK_CUR); // Get current pos
|
||||
if (op+bytes<0) // Would mean moving beyond start of file: Not supported
|
||||
return 0;
|
||||
np =LSEEK (infd,bytes,SEEK_CUR); // Pos after moving
|
||||
i=(int) (np-op);
|
||||
}
|
||||
if (i==0 && ccx_options.live_stream)
|
||||
{
|
||||
if (ccx_options.input_source==CCX_DS_STDIN)
|
||||
{
|
||||
ccx_options.live_stream = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sleepandchecktimeout (seconds);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
copied+=i;
|
||||
bytes-=i;
|
||||
}
|
||||
|
||||
}
|
||||
while ((i || ccx_options.live_stream ||
|
||||
(ccx_options.binary_concat && switch_to_next_file(copied))) && bytes);
|
||||
return copied;
|
||||
}
|
||||
// Keep the last 8 bytes, so we have a guaranteed
|
||||
// working seek (-8) - needed by mythtv.
|
||||
int keep = bytesinbuffer > 8 ? 8 : bytesinbuffer;
|
||||
memmove (filebuffer,filebuffer+(FILEBUFFERSIZE-keep),keep);
|
||||
int i;
|
||||
if (ccx_options.input_source==CCX_DS_FILE || ccx_options.input_source==CCX_DS_STDIN)
|
||||
i=read (infd, filebuffer+keep,FILEBUFFERSIZE-keep);
|
||||
else
|
||||
{
|
||||
socklen_t len = sizeof(cliaddr);
|
||||
i = recvfrom(infd,(char *) filebuffer+keep,FILEBUFFERSIZE-keep,0,(struct sockaddr *)&cliaddr,&len);
|
||||
}
|
||||
if( i == -1)
|
||||
fatal (EXIT_READ_ERROR, "Error reading input stream!\n");
|
||||
if (i==0)
|
||||
{
|
||||
/* If live stream, don't try to switch - acknowledge eof here as it won't
|
||||
cause a loop end */
|
||||
if (ccx_options.live_stream || !(ccx_options.binary_concat && switch_to_next_file(copied)))
|
||||
eof=1;
|
||||
}
|
||||
filebuffer_pos=keep;
|
||||
bytesinbuffer=(int) i+keep;
|
||||
ready=i;
|
||||
}
|
||||
int copy = (int) (ready>=bytes ? bytes:ready);
|
||||
if (copy)
|
||||
{
|
||||
if (buffer!=NULL)
|
||||
{
|
||||
memcpy (buffer, filebuffer+filebuffer_pos, copy);
|
||||
buffer+=copy;
|
||||
}
|
||||
filebuffer_pos+=copy;
|
||||
bytes-=copy;
|
||||
copied+=copy;
|
||||
}
|
||||
}
|
||||
return copied;
|
||||
}
|
||||
else // Read without buffering
|
||||
{
|
||||
|
||||
if (buffer!=NULL)
|
||||
{
|
||||
int i;
|
||||
while (bytes>0 && infd!=-1 &&
|
||||
((i=read(infd,buffer,bytes))!=0 || ccx_options.live_stream ||
|
||||
(ccx_options.binary_concat && switch_to_next_file(copied))))
|
||||
{
|
||||
if( i == -1)
|
||||
fatal (EXIT_READ_ERROR, "Error reading input file!\n");
|
||||
else if (i==0)
|
||||
sleepandchecktimeout (seconds);
|
||||
else
|
||||
{
|
||||
copied+=i;
|
||||
bytes-=i;
|
||||
buffer+=i;
|
||||
}
|
||||
}
|
||||
return copied;
|
||||
}
|
||||
// return fread(buffer,1,bytes,in);
|
||||
//return FSEEK (in,bytes,SEEK_CUR);
|
||||
while (bytes!=0 && infd!=-1)
|
||||
{
|
||||
LLONG op, np;
|
||||
op =LSEEK (infd,0,SEEK_CUR); // Get current pos
|
||||
if (op+bytes<0) // Would mean moving beyond start of file: Not supported
|
||||
return 0;
|
||||
np =LSEEK (infd,bytes,SEEK_CUR); // Pos after moving
|
||||
copied=copied+(np-op);
|
||||
bytes=bytes-(unsigned int) copied;
|
||||
if (copied==0)
|
||||
{
|
||||
if (ccx_options.live_stream)
|
||||
sleepandchecktimeout (seconds);
|
||||
else
|
||||
{
|
||||
if (ccx_options.binary_concat)
|
||||
switch_to_next_file(0);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return copied;
|
||||
}
|
||||
}
|
||||
@@ -1,826 +0,0 @@
|
||||
#include "ccextractor.h"
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "708.h"
|
||||
#include "dvb_subtitle_decoder.h"
|
||||
|
||||
// IMPORTED TRASH INFO, REMOVE
|
||||
extern long num_nal_unit_type_7;
|
||||
extern long num_vcl_hrd;
|
||||
extern long num_nal_hrd;
|
||||
extern long num_jump_in_frames;
|
||||
extern long num_unexpected_sei_length;
|
||||
|
||||
/* General video information */
|
||||
unsigned current_hor_size = 0;
|
||||
unsigned current_vert_size = 0;
|
||||
unsigned current_aspect_ratio = 0;
|
||||
unsigned current_frame_rate = 4; // Assume standard fps, 29.97
|
||||
double current_fps = (double) 30000.0 / 1001; /* 29.97 */ // TODO: Get from framerates_values[] instead
|
||||
LLONG current_pts = 0;
|
||||
unsigned rollover_bits = 0; // The PTS rolls over every 26 hours and that can happen in the middle of a stream.
|
||||
LLONG result; // Number of bytes read/skipped in last read operation
|
||||
int end_of_file=0; // End of file?
|
||||
|
||||
|
||||
const static unsigned char DO_NOTHING[] = {0x80, 0x80};
|
||||
LLONG inbuf = 0; // Number of bytes loaded in buffer
|
||||
int ccx_bufferdatatype = CCX_PES; // Can be RAW, PES, H264 or Hauppage
|
||||
|
||||
int current_tref = 0; // Store temporal reference of current frame
|
||||
enum ccx_frame_type current_picture_coding_type = CCX_FRAME_TYPE_RESET_OR_UNKNOWN;
|
||||
|
||||
// Remember if the last header was valid. Used to suppress too much output
|
||||
// and the expected unrecognized first header for TiVo files.
|
||||
int strangeheader=0;
|
||||
|
||||
unsigned char *filebuffer;
|
||||
LLONG filebuffer_start; // Position of buffer start relative to file
|
||||
int filebuffer_pos; // Position of pointer relative to buffer start
|
||||
int bytesinbuffer; // Number of bytes we actually have on buffer
|
||||
extern void *cxx_dvb_context;
|
||||
|
||||
LLONG process_raw_with_field (void);
|
||||
|
||||
// Program stream specific data grabber
|
||||
LLONG ps_getmoredata(void)
|
||||
{
|
||||
int enough = 0;
|
||||
int payload_read = 0;
|
||||
|
||||
static unsigned vpesnum=0;
|
||||
|
||||
unsigned char nextheader[512]; // Next header in PS
|
||||
int falsepack=0;
|
||||
|
||||
// Read and return the next video PES payload
|
||||
do
|
||||
{
|
||||
if (BUFSIZE-inbuf<500)
|
||||
{
|
||||
mprint("Less than 500 left\n");
|
||||
enough=1; // Stop when less than 500 bytes are left in buffer
|
||||
}
|
||||
else
|
||||
{
|
||||
buffered_read(nextheader,6);
|
||||
past+=result;
|
||||
if (result!=6)
|
||||
{
|
||||
// Consider this the end of the show.
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
|
||||
// Search for a header that is not a picture header (nextheader[3]!=0x00)
|
||||
while ( !(nextheader[0]==0x00 && nextheader[1]==0x00
|
||||
&& nextheader[2]==0x01 && nextheader[3]!=0x00) )
|
||||
{
|
||||
if( !strangeheader )
|
||||
{
|
||||
mprint ("\nNot a recognized header. Searching for next header.\n");
|
||||
dump (CCX_DMT_GENERIC_NOTICES, nextheader,6,0,0);
|
||||
// Only print the message once per loop / unrecognized header
|
||||
strangeheader = 1;
|
||||
}
|
||||
|
||||
unsigned char *newheader;
|
||||
// The amount of bytes read into nextheader by the buffered_read above
|
||||
int hlen = 6;
|
||||
// Find first 0x00
|
||||
// If there is a 00 in the first element we need to advance
|
||||
// one step as clearly bytes 1,2,3 are wrong
|
||||
newheader = (unsigned char *) memchr (nextheader+1, 0, hlen-1);
|
||||
if (newheader != NULL )
|
||||
{
|
||||
int atpos = newheader-nextheader;
|
||||
|
||||
memmove (nextheader,newheader,(size_t)(hlen-atpos));
|
||||
buffered_read(nextheader+(hlen-atpos),atpos);
|
||||
past+=result;
|
||||
if (result!=atpos)
|
||||
{
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
buffered_read(nextheader,hlen);
|
||||
past+=result;
|
||||
if (result!=hlen)
|
||||
{
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (end_of_file)
|
||||
{
|
||||
// No more headers
|
||||
break;
|
||||
}
|
||||
// Found 00-00-01 in nextheader, assume a regular header
|
||||
strangeheader=0;
|
||||
|
||||
// PACK header
|
||||
if ( nextheader[3]==0xBA)
|
||||
{
|
||||
dbg_print(CCX_DMT_VERBOSE, "PACK header\n");
|
||||
buffered_read(nextheader+6,8);
|
||||
past+=result;
|
||||
if (result!=8)
|
||||
{
|
||||
// Consider this the end of the show.
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (nextheader[4]&0xC4)!=0x44 || !(nextheader[6]&0x04)
|
||||
|| !(nextheader[8]&0x04) || !(nextheader[9]&0x01)
|
||||
|| (nextheader[12]&0x03)!=0x03 )
|
||||
{
|
||||
// broken pack header
|
||||
falsepack=1;
|
||||
}
|
||||
// We don't need SCR/SCR_ext
|
||||
int stufflen=nextheader[13]&0x07;
|
||||
|
||||
if (falsepack)
|
||||
{
|
||||
mprint ("Warning: Defective Pack header\n");
|
||||
}
|
||||
|
||||
// If not defect, load stuffing
|
||||
buffered_skip ((int) stufflen);
|
||||
past+=stufflen;
|
||||
// fake a result value as something was skipped
|
||||
result=1;
|
||||
continue;
|
||||
}
|
||||
// Some PES stream
|
||||
else if (nextheader[3]>=0xBB && nextheader[3]<=0xDF)
|
||||
{
|
||||
// System header
|
||||
// nextheader[3]==0xBB
|
||||
// 0xBD Private 1
|
||||
// 0xBE PAdding
|
||||
// 0xBF Private 2
|
||||
// 0xC0-0DF audio
|
||||
|
||||
unsigned headerlen=nextheader[4]<<8 | nextheader[5];
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "non Video PES (type 0x%2X) - len %u\n",
|
||||
nextheader[3], headerlen);
|
||||
|
||||
// The 15000 here is quite arbitrary, the longest packages I
|
||||
// know of are 12302 bytes (Private 1 data in RTL recording).
|
||||
if ( headerlen > 15000 )
|
||||
{
|
||||
mprint("Suspicious non Video PES (type 0x%2X) - len %u\n",
|
||||
nextheader[3], headerlen);
|
||||
mprint("Do not skip over, search for next.\n");
|
||||
headerlen = 2;
|
||||
}
|
||||
|
||||
// Skip over it
|
||||
buffered_skip ((int) headerlen);
|
||||
past+=headerlen;
|
||||
// fake a result value as something was skipped
|
||||
result=1;
|
||||
|
||||
continue;
|
||||
}
|
||||
// Read the next video PES
|
||||
else if ((nextheader[3]&0xf0)==0xe0)
|
||||
{
|
||||
int hlen; // Dummy variable, unused
|
||||
int peslen = read_video_pes_header(nextheader, &hlen, 0);
|
||||
if (peslen < 0)
|
||||
{
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
|
||||
vpesnum++;
|
||||
dbg_print(CCX_DMT_VERBOSE, "PES video packet #%u\n", vpesnum);
|
||||
|
||||
|
||||
int want = (int) ((BUFSIZE-inbuf)>peslen ? peslen : (BUFSIZE-inbuf));
|
||||
|
||||
if (want != peslen) {
|
||||
fatal(EXIT_BUFFER_FULL, "Oh Oh, PES longer than remaining buffer space\n");
|
||||
}
|
||||
if (want == 0) // Found package with header but without payload
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
buffered_read (buffer+inbuf,want);
|
||||
past=past+result;
|
||||
if (result>0) {
|
||||
payload_read+=(int) result;
|
||||
}
|
||||
inbuf+=result;
|
||||
|
||||
if (result!=want) { // Not complete - EOF
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
enough = 1; // We got one PES
|
||||
|
||||
} else {
|
||||
// If we are here this is an unknown header type
|
||||
mprint("Unknown header %02X\n", nextheader[3]);
|
||||
strangeheader=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (result!=0 && !enough && BUFSIZE!=inbuf);
|
||||
|
||||
dbg_print(CCX_DMT_VERBOSE, "PES data read: %d\n", payload_read);
|
||||
|
||||
return payload_read;
|
||||
}
|
||||
|
||||
|
||||
// Returns number of bytes read, or zero for EOF
|
||||
LLONG general_getmoredata(void)
|
||||
{
|
||||
int bytesread = 0;
|
||||
int want;
|
||||
|
||||
do
|
||||
{
|
||||
want = (int) (BUFSIZE-inbuf);
|
||||
buffered_read (buffer+inbuf,want); // This is a macro.
|
||||
// 'result' HAS the number of bytes read
|
||||
past=past+result;
|
||||
inbuf+=result;
|
||||
bytesread+=(int) result;
|
||||
} while (result!=0 && result!=want);
|
||||
return bytesread;
|
||||
}
|
||||
|
||||
// Hexadecimal dump process
|
||||
void processhex (char *filename)
|
||||
{
|
||||
size_t max=(size_t) inputsize+1; // Enough for the whole thing. Hex dumps are small so we can be lazy here
|
||||
char *line=(char *) malloc (max);
|
||||
/* const char *mpeg_header="00 00 01 b2 43 43 01 f8 "; // Always present */
|
||||
FILE *fr = fopen (filename, "rt");
|
||||
unsigned char *bytes=NULL;
|
||||
unsigned byte_count=0;
|
||||
int warning_shown=0;
|
||||
while(fgets(line, max-1, fr) != NULL)
|
||||
{
|
||||
char *c1, *c2=NULL; // Positions for first and second colons
|
||||
/* int len; */
|
||||
long timing;
|
||||
if (line[0]==';') // Skip comments
|
||||
continue;
|
||||
c1=strchr (line,':');
|
||||
if (c1) c2=strchr (c1+1,':');
|
||||
if (!c2) // Line doesn't contain what we want
|
||||
continue;
|
||||
*c1=0;
|
||||
*c2=0;
|
||||
/* len=atoi (line); */
|
||||
timing=atol (c1+2)*(MPEG_CLOCK_FREQ/1000);
|
||||
current_pts=timing;
|
||||
if (pts_set==0)
|
||||
pts_set=1;
|
||||
set_fts();
|
||||
c2++;
|
||||
/*
|
||||
if (strlen (c2)==8)
|
||||
{
|
||||
unsigned char high1=c2[1];
|
||||
unsigned char low1=c2[2];
|
||||
int value1=hex2int (high1,low1);
|
||||
unsigned char high2=c2[4];
|
||||
unsigned char low2=c2[5];
|
||||
int value2=hex2int (high2,low2);
|
||||
buffer[0]=value1;
|
||||
buffer[1]=value2;
|
||||
inbuf=2;
|
||||
process_raw();
|
||||
continue;
|
||||
}
|
||||
if (strlen (c2)<=(strlen (mpeg_header)+1))
|
||||
continue; */
|
||||
c2++; // Skip blank
|
||||
/*
|
||||
if (strncmp (c2,mpeg_header,strlen (mpeg_header))) // No idea how to deal with this.
|
||||
{
|
||||
if (!warning_shown)
|
||||
{
|
||||
warning_shown=1;
|
||||
mprint ("\nWarning: This file contains data I can't process: Please submit .hex for analysis!\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// OK, seems like a decent chunk of CCdata.
|
||||
c2+=strlen (mpeg_header);
|
||||
*/
|
||||
byte_count=strlen (c2)/3;
|
||||
/*
|
||||
if (atoi (line)!=byte_count+strlen (mpeg_header)/3) // Number of bytes reported don't match actual contents
|
||||
continue;
|
||||
*/
|
||||
if (atoi (line)!=byte_count) // Number of bytes reported don't match actual contents
|
||||
continue;
|
||||
if (!byte_count) // Nothing to get from this line except timing info, already done.
|
||||
continue;
|
||||
bytes=(unsigned char *) malloc (byte_count);
|
||||
if (!bytes)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "Out of memory.\n");
|
||||
unsigned char *bytes=(unsigned char *) malloc (byte_count);
|
||||
for (unsigned i=0;i<byte_count;i++)
|
||||
{
|
||||
unsigned char high=c2[0];
|
||||
unsigned char low=c2[1];
|
||||
int value=hex2int (high,low);
|
||||
if (value==-1)
|
||||
fatal (EXIT_FAILURE, "Incorrect format, unexpected non-hex string.");
|
||||
bytes[i]=value;
|
||||
c2+=3;
|
||||
}
|
||||
memcpy (buffer, bytes, byte_count);
|
||||
inbuf=byte_count;
|
||||
process_raw();
|
||||
continue;
|
||||
// New wtv format, everything else hopefully obsolete
|
||||
|
||||
int ok=0; // Were we able to process the line?
|
||||
// Attempt to detect how the data is encoded.
|
||||
// Case 1 (seen in all elderman's samples):
|
||||
// 18 : 467 : 00 00 01 b2 43 43 01 f8 03 42 ff fd 54 80 fc 94 2c ff
|
||||
// Always 03 after header, then something unknown (seen 42, 43, c2, c3...),
|
||||
// then ff, then data with field info, and terminated with ff.
|
||||
if (byte_count>3 && bytes[0]==0x03 &&
|
||||
bytes[2]==0xff && bytes[byte_count-1]==0xff)
|
||||
{
|
||||
ok=1;
|
||||
for (unsigned i=3; i<byte_count-2; i+=3)
|
||||
{
|
||||
inbuf=3;
|
||||
buffer[0]=bytes[i];
|
||||
buffer[1]=bytes[i+1];
|
||||
buffer[2]=bytes[i+2];
|
||||
process_raw_with_field();
|
||||
}
|
||||
}
|
||||
// Case 2 (seen in P2Pfiend samples):
|
||||
// Seems to match McPoodle's descriptions on DVD encoding
|
||||
else
|
||||
{
|
||||
unsigned char magic=bytes[0];
|
||||
/* unsigned extra_field_flag=magic&1; */
|
||||
unsigned caption_count=((magic>>1)&0x1F);
|
||||
unsigned filler=((magic>>6)&1);
|
||||
/* unsigned pattern=((magic>>7)&1); */
|
||||
int always_ff=1;
|
||||
int current_field=0;
|
||||
if (filler==0 && caption_count*6==byte_count-1) // Note that we are ignoring the extra field for now...
|
||||
{
|
||||
ok=1;
|
||||
for (unsigned i=1; i<byte_count-2; i+=3)
|
||||
if (bytes[i]!=0xff)
|
||||
{
|
||||
// If we only find FF in the first byte then either there's only field 1 data, OR
|
||||
// there's alternating field 1 and field 2 data. Don't know how to tell apart. For now
|
||||
// let's assume that always FF means alternating.
|
||||
always_ff=0;
|
||||
break;
|
||||
}
|
||||
|
||||
for (unsigned i=1; i<byte_count-2; i+=3)
|
||||
{
|
||||
inbuf=3;
|
||||
if (always_ff) // Try to tell apart the fields based on the pattern field.
|
||||
{
|
||||
buffer[0]=current_field | 4; // | 4 to enable the 'valid' bit
|
||||
current_field = !current_field;
|
||||
}
|
||||
else
|
||||
buffer[0]=bytes[i];
|
||||
|
||||
buffer[1]=bytes[i+1];
|
||||
buffer[2]=bytes[i+2];
|
||||
process_raw_with_field();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ok && !warning_shown)
|
||||
{
|
||||
warning_shown=1;
|
||||
mprint ("\nWarning: This file contains data I can't process: Please submit .hex for analysis!\n");
|
||||
}
|
||||
free (bytes);
|
||||
}
|
||||
fclose(fr);
|
||||
}
|
||||
|
||||
// Raw file process
|
||||
void raw_loop ()
|
||||
{
|
||||
LLONG got;
|
||||
LLONG processed;
|
||||
|
||||
current_pts = 90; // Pick a valid PTS time
|
||||
pts_set = 1;
|
||||
set_fts(); // Now set the FTS related variables
|
||||
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
|
||||
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
|
||||
(unsigned) (current_pts));
|
||||
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
|
||||
|
||||
do
|
||||
{
|
||||
inbuf=0;
|
||||
|
||||
got=general_getmoredata();
|
||||
|
||||
if (got == 0) // Shortcircuit if we got nothing to process
|
||||
break;
|
||||
|
||||
processed=process_raw();
|
||||
|
||||
int ccblocks = cb_field1;
|
||||
current_pts += cb_field1*1001/30*(MPEG_CLOCK_FREQ/1000);
|
||||
set_fts(); // Now set the FTS related variables including fts_max
|
||||
|
||||
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
|
||||
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
|
||||
(unsigned) (current_pts));
|
||||
dbg_print(CCX_DMT_VIDES, " FTS: %s incl. %d CB\n",
|
||||
print_mstime(get_fts()), ccblocks);
|
||||
|
||||
if (processed<got)
|
||||
{
|
||||
mprint ("BUG BUG\n");
|
||||
}
|
||||
}
|
||||
while (inbuf);
|
||||
}
|
||||
|
||||
/* Process inbuf bytes in buffer holding raw caption data (three byte packets, the first being the field).
|
||||
* The number of processed bytes is returned. */
|
||||
LLONG process_raw_with_field (void)
|
||||
{
|
||||
unsigned char data[3];
|
||||
data[0]=0x04; // Field 1
|
||||
current_field=1;
|
||||
|
||||
for (unsigned long i=0; i<inbuf; i=i+3)
|
||||
{
|
||||
if ( !saw_caption_block && *(buffer+i)==0xff && *(buffer+i+1)==0xff)
|
||||
{
|
||||
// Skip broadcast header
|
||||
}
|
||||
else
|
||||
{
|
||||
data[0]=buffer[i];
|
||||
data[1]=buffer[i+1];
|
||||
data[2]=buffer[i+2];
|
||||
|
||||
// do_cb increases the cb_field1 counter so that get_fts()
|
||||
// is correct.
|
||||
do_cb(data);
|
||||
}
|
||||
}
|
||||
return inbuf;
|
||||
}
|
||||
|
||||
|
||||
/* Process inbuf bytes in buffer holding raw caption data (two byte packets).
|
||||
* The number of processed bytes is returned. */
|
||||
LLONG process_raw (void)
|
||||
{
|
||||
unsigned char data[3];
|
||||
data[0]=0x04; // Field 1
|
||||
current_field=1;
|
||||
|
||||
for (unsigned long i=0; i<inbuf; i=i+2)
|
||||
{
|
||||
if ( !saw_caption_block && *(buffer+i)==0xff && *(buffer+i+1)==0xff)
|
||||
{
|
||||
// Skip broadcast header
|
||||
}
|
||||
else
|
||||
{
|
||||
data[1]=buffer[i];
|
||||
data[2]=buffer[i+1];
|
||||
|
||||
// do_cb increases the cb_field1 counter so that get_fts()
|
||||
// is correct.
|
||||
do_cb(data);
|
||||
}
|
||||
}
|
||||
return inbuf;
|
||||
}
|
||||
|
||||
|
||||
void general_loop(void)
|
||||
{
|
||||
LLONG overlap=0;
|
||||
LLONG pos = 0; /* Current position in buffer */
|
||||
inbuf = 0; // No data yet
|
||||
|
||||
end_of_file = 0;
|
||||
current_picture_coding_type = CCX_FRAME_TYPE_RESET_OR_UNKNOWN;
|
||||
|
||||
while (!end_of_file && !processed_enough)
|
||||
{
|
||||
/* Get rid of the bytes we already processed */
|
||||
overlap=inbuf-pos;
|
||||
if ( pos != 0 ) {
|
||||
// Only when needed as memmove has been seen crashing
|
||||
// for dest==source and n >0
|
||||
memmove (buffer,buffer+pos,(size_t) (inbuf-pos));
|
||||
inbuf-=pos;
|
||||
}
|
||||
pos = 0;
|
||||
|
||||
// GET MORE DATA IN BUFFER
|
||||
LLONG i;
|
||||
position_sanity_check();
|
||||
switch (stream_mode)
|
||||
{
|
||||
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
|
||||
i = general_getmoredata();
|
||||
break;
|
||||
case CCX_SM_TRANSPORT:
|
||||
i = ts_getmoredata();
|
||||
break;
|
||||
case CCX_SM_PROGRAM:
|
||||
i = ps_getmoredata();
|
||||
break;
|
||||
case CCX_SM_ASF:
|
||||
i = asf_getmoredata();
|
||||
break;
|
||||
case CCX_SM_WTV:
|
||||
i = wtv_getmoredata();
|
||||
break;
|
||||
default:
|
||||
fatal(EXIT_BUG_BUG, "Impossible stream_mode");
|
||||
}
|
||||
|
||||
position_sanity_check();
|
||||
if (fh_out_elementarystream!=NULL)
|
||||
fwrite (buffer+overlap,1,(size_t) (inbuf-overlap),fh_out_elementarystream);
|
||||
|
||||
if (i==0)
|
||||
{
|
||||
end_of_file = 1;
|
||||
memset (buffer+inbuf, 0, (size_t) (BUFSIZE-inbuf)); /* Clear buffer at the end */
|
||||
}
|
||||
|
||||
if (inbuf == 0)
|
||||
{
|
||||
/* Done: Get outta here */
|
||||
break;
|
||||
}
|
||||
|
||||
LLONG got; // Means 'consumed' from buffer actually
|
||||
|
||||
static LLONG last_pts = 0x01FFFFFFFFLL;
|
||||
|
||||
if (ccx_options.hauppauge_mode)
|
||||
{
|
||||
got = process_raw_with_field();
|
||||
if (pts_set)
|
||||
set_fts(); // Try to fix timing from TS data
|
||||
}
|
||||
else if(ccx_bufferdatatype == CCX_DVB_SUBTITLE)
|
||||
{
|
||||
int out_size = 0;
|
||||
dvbsub_decode(cxx_dvb_context,NULL,&out_size,buffer + 2,inbuf);
|
||||
set_fts();
|
||||
got = inbuf;
|
||||
}
|
||||
else if (ccx_bufferdatatype == CCX_PES)
|
||||
{
|
||||
got = process_m2v (buffer, inbuf);
|
||||
}
|
||||
else if (ccx_bufferdatatype == CCX_TELETEXT)
|
||||
{
|
||||
// Dispatch to Petr Kutalek 's telxcc.
|
||||
tlt_process_pes_packet (buffer, (uint16_t) inbuf);
|
||||
got = inbuf;
|
||||
}
|
||||
else if (ccx_bufferdatatype == CCX_PRIVATE_MPEG2_CC)
|
||||
{
|
||||
got = inbuf; // Do nothing. Still don't know how to process it
|
||||
}
|
||||
else if (ccx_bufferdatatype == CCX_RAW) // Raw two byte 608 data from DVR-MS/ASF
|
||||
{
|
||||
// The asf_getmoredata() loop sets current_pts when possible
|
||||
if (pts_set == 0)
|
||||
{
|
||||
mprint("DVR-MS/ASF file without useful time stamps - count blocks.\n");
|
||||
// Otherwise rely on counting blocks
|
||||
current_pts = 12345; // Pick a valid PTS time
|
||||
pts_set = 1;
|
||||
}
|
||||
|
||||
if (current_pts != last_pts)
|
||||
{
|
||||
// Only initialize the FTS values and reset the cb
|
||||
// counters when the PTS is different. This happens frequently
|
||||
// with ASF files.
|
||||
|
||||
if (min_pts==0x01FFFFFFFFLL)
|
||||
{
|
||||
// First call
|
||||
fts_at_gop_start = 0;
|
||||
}
|
||||
else
|
||||
fts_at_gop_start = get_fts();
|
||||
|
||||
frames_since_ref_time = 0;
|
||||
set_fts();
|
||||
|
||||
last_pts = current_pts;
|
||||
}
|
||||
|
||||
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
|
||||
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
|
||||
(unsigned) (current_pts));
|
||||
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
|
||||
|
||||
got = process_raw();
|
||||
}
|
||||
else if (ccx_bufferdatatype == CCX_H264) // H.264 data from TS file
|
||||
{
|
||||
got = process_avc(buffer, inbuf);
|
||||
}
|
||||
else
|
||||
fatal(EXIT_BUG_BUG, "Unknown data type!");
|
||||
|
||||
if (got>inbuf)
|
||||
{
|
||||
mprint ("BUG BUG\n");
|
||||
}
|
||||
pos+=got;
|
||||
|
||||
if (ccx_options.live_stream)
|
||||
{
|
||||
int cur_sec = (int) (get_fts() / 1000);
|
||||
int th=cur_sec/10;
|
||||
if (last_reported_progress!=th)
|
||||
{
|
||||
activity_progress (-1,cur_sec/60, cur_sec%60);
|
||||
last_reported_progress = th;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (total_inputsize>255) // Less than 255 leads to division by zero below.
|
||||
{
|
||||
int progress = (int) ((((total_past+past)>>8)*100)/(total_inputsize>>8));
|
||||
if (last_reported_progress != progress)
|
||||
{
|
||||
LLONG t=get_fts();
|
||||
if (!t && global_timestamp_inited)
|
||||
t=global_timestamp-min_global_timestamp;
|
||||
int cur_sec = (int) (t / 1000);
|
||||
activity_progress(progress, cur_sec/60, cur_sec%60);
|
||||
last_reported_progress = progress;
|
||||
}
|
||||
}
|
||||
}
|
||||
position_sanity_check();
|
||||
}
|
||||
// Flush remaining HD captions
|
||||
if (has_ccdata_buffered)
|
||||
process_hdcc();
|
||||
|
||||
if (total_past!=total_inputsize && ccx_options.binary_concat && !processed_enough)
|
||||
{
|
||||
mprint("\n\n\n\nATTENTION!!!!!!\n");
|
||||
mprint("Processing of %s %d ended prematurely %lld < %lld, please send bug report.\n\n",
|
||||
inputfile[current_file], current_file, past, inputsize);
|
||||
}
|
||||
mprint ("\nNumber of NAL_type_7: %ld\n",num_nal_unit_type_7);
|
||||
mprint ("Number of VCL_HRD: %ld\n",num_vcl_hrd);
|
||||
mprint ("Number of NAL HRD: %ld\n",num_nal_hrd);
|
||||
mprint ("Number of jump-in-frames: %ld\n",num_jump_in_frames);
|
||||
mprint ("Number of num_unexpected_sei_length: %ld", num_unexpected_sei_length);
|
||||
}
|
||||
|
||||
// Raw caption with FTS file process
|
||||
void rcwt_loop( void )
|
||||
{
|
||||
static unsigned char *parsebuf;
|
||||
static long parsebufsize = 1024;
|
||||
|
||||
// As BUFSIZE is a macro this is just a reminder
|
||||
if (BUFSIZE < (3*0xFFFF + 10))
|
||||
fatal (EXIT_BUG_BUG, "BUFSIZE too small for RCWT caption block.\n");
|
||||
|
||||
// Generic buffer to hold some data
|
||||
parsebuf = (unsigned char*)malloc(1024);
|
||||
|
||||
|
||||
LLONG currfts;
|
||||
uint16_t cbcount = 0;
|
||||
|
||||
int bread = 0; // Bytes read
|
||||
|
||||
buffered_read(parsebuf,11);
|
||||
past+=result;
|
||||
bread+=(int) result;
|
||||
if (result!=11)
|
||||
{
|
||||
mprint("Premature end of file!\n");
|
||||
end_of_file=1;
|
||||
return;
|
||||
}
|
||||
|
||||
// Expecting RCWT header
|
||||
if( !memcmp(parsebuf, "\xCC\xCC\xED", 3 ) )
|
||||
{
|
||||
dbg_print(CCX_DMT_PARSE, "\nRCWT header\n");
|
||||
dbg_print(CCX_DMT_PARSE, "File created by %02X version %02X%02X\nFile format revision: %02X%02X\n",
|
||||
parsebuf[3], parsebuf[4], parsebuf[5],
|
||||
parsebuf[6], parsebuf[7]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
fatal(EXIT_MISSING_RCWT_HEADER, "Missing RCWT header. Abort.\n");
|
||||
}
|
||||
|
||||
// Initialize first time. As RCWT files come with the correct FTS the
|
||||
// initial (minimal) time needs to be set to 0.
|
||||
current_pts = 0;
|
||||
pts_set=1;
|
||||
set_fts(); // Now set the FTS related variables
|
||||
|
||||
// Loop until no more data is found
|
||||
while(1)
|
||||
{
|
||||
// Read the data header
|
||||
buffered_read(parsebuf,10);
|
||||
past+=result;
|
||||
bread+=(int) result;
|
||||
|
||||
if (result!=10)
|
||||
{
|
||||
if (result!=0)
|
||||
mprint("Premature end of file!\n");
|
||||
|
||||
// We are done
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
currfts = *((LLONG*)(parsebuf));
|
||||
cbcount = *((uint16_t*)(parsebuf+8));
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "RCWT data header FTS: %s blocks: %u\n",
|
||||
print_mstime(currfts), cbcount);
|
||||
|
||||
if ( cbcount > 0 )
|
||||
{
|
||||
if ( cbcount*3 > parsebufsize) {
|
||||
parsebuf = (unsigned char*)realloc(parsebuf, cbcount*3);
|
||||
if (!parsebuf)
|
||||
fatal(EXIT_NOT_ENOUGH_MEMORY, "Out of memory");
|
||||
parsebufsize = cbcount*3;
|
||||
}
|
||||
buffered_read(parsebuf,cbcount*3);
|
||||
past+=result;
|
||||
bread+=(int) result;
|
||||
if (result!=cbcount*3)
|
||||
{
|
||||
mprint("Premature end of file!\n");
|
||||
end_of_file=1;
|
||||
break;
|
||||
}
|
||||
|
||||
// Process the data
|
||||
current_pts = currfts*(MPEG_CLOCK_FREQ/1000);
|
||||
if (pts_set==0)
|
||||
pts_set=1;
|
||||
set_fts(); // Now set the FTS related variables
|
||||
|
||||
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
|
||||
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
|
||||
(unsigned) (current_pts));
|
||||
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
|
||||
|
||||
for (int j=0; j<cbcount*3; j=j+3)
|
||||
{
|
||||
do_cb(parsebuf+j);
|
||||
}
|
||||
}
|
||||
} // end while(1)
|
||||
|
||||
dbg_print(CCX_DMT_PARSE, "Processed %d bytes\n", bread);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4457
src/gpacmp4/avilib.c
4457
src/gpacmp4/avilib.c
File diff suppressed because it is too large
Load Diff
@@ -1,59 +1,64 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/base_coding.h>
|
||||
#include <gpac/constants.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_CORE_TOOLS
|
||||
|
||||
static const char base_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
GF_EXPORT
|
||||
u32 gf_base64_encode(char *_in, u32 inSize, char *_out, u32 outSize)
|
||||
u32 gf_base64_encode(const char *_in, u32 inSize, char *_out, u32 outSize)
|
||||
{
|
||||
s32 padding;
|
||||
u32 i = 0, j = 0;
|
||||
unsigned char *in = (unsigned char *)_in;
|
||||
unsigned char *out = (unsigned char *)_out;
|
||||
|
||||
|
||||
if (outSize < (inSize * 4 / 3)) return 0;
|
||||
|
||||
while (i < inSize) {
|
||||
padding = 3 - (inSize - i);
|
||||
if (padding == 2) {
|
||||
out[j] = base_64[in[i]>>2];
|
||||
out[j+1] = base_64[(in[i] & 0x03) << 4];
|
||||
out[j+2] = '=';
|
||||
out[j+3] = '=';
|
||||
} else if (padding == 1) {
|
||||
out[j] = base_64[in[i]>>2];
|
||||
out[j+1] = base_64[((in[i] & 0x03) << 4) | ((in[i+1] & 0xf0) >> 4)];
|
||||
out[j+2] = base_64[(in[i+1] & 0x0f) << 2];
|
||||
out[j+3] = '=';
|
||||
} else{
|
||||
out[j] = base_64[in[i]>>2];
|
||||
out[j+1] = base_64[((in[i] & 0x03) << 4) | ((in[i+1] & 0xf0) >> 4)];
|
||||
out[j+2] = base_64[((in[i+1] & 0x0f) << 2) | ((in[i+2] & 0xc0) >> 6)];
|
||||
out[j+3] = base_64[in[i+2] & 0x3f];
|
||||
out[j] = base_64[in[i] >> 2];
|
||||
out[j + 1] = base_64[(in[i] & 0x03) << 4];
|
||||
out[j + 2] = '=';
|
||||
out[j + 3] = '=';
|
||||
}
|
||||
else if (padding == 1) {
|
||||
out[j] = base_64[in[i] >> 2];
|
||||
out[j + 1] = base_64[((in[i] & 0x03) << 4) | ((in[i + 1] & 0xf0) >> 4)];
|
||||
out[j + 2] = base_64[(in[i + 1] & 0x0f) << 2];
|
||||
out[j + 3] = '=';
|
||||
}
|
||||
else {
|
||||
out[j] = base_64[in[i] >> 2];
|
||||
out[j + 1] = base_64[((in[i] & 0x03) << 4) | ((in[i + 1] & 0xf0) >> 4)];
|
||||
out[j + 2] = base_64[((in[i + 1] & 0x0f) << 2) | ((in[i + 2] & 0xc0) >> 6)];
|
||||
out[j + 3] = base_64[in[i + 2] & 0x3f];
|
||||
}
|
||||
i += 3;
|
||||
j += 4;
|
||||
@@ -62,38 +67,41 @@ u32 gf_base64_encode(char *_in, u32 inSize, char *_out, u32 outSize)
|
||||
}
|
||||
|
||||
static const unsigned char index_64[128] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 62, 0xff, 0xff, 0xff, 63,
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 62, 0xff, 0xff, 0xff, 63,
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
#define char64(c) ((c > 127) ? (char) 0xff : index_64[(c)])
|
||||
|
||||
/*denoise input*/
|
||||
u32 load_block(char *in, u32 size, u32 pos, char *out)
|
||||
{
|
||||
u32 i, len;
|
||||
u32 load_block(char *in, u32 size, u32 pos, char *out)
|
||||
{
|
||||
u32 i, len;
|
||||
u8 c;
|
||||
len = i = 0;
|
||||
while ((len<4) && ((pos+i)<size)) {
|
||||
c = in[pos+i];
|
||||
if ( ((c>='A') && (c<='Z'))
|
||||
|| ((c>='a') && (c<='z'))
|
||||
|| ((c>='0') && (c<='9'))
|
||||
|| (c=='=') || (c=='+') || (c=='/')
|
||||
) {
|
||||
while ((len<4) && ((pos + i)<size)) {
|
||||
c = in[pos + i];
|
||||
if (((c >= 'A') && (c <= 'Z'))
|
||||
|| ((c >= 'a') && (c <= 'z'))
|
||||
|| ((c >= '0') && (c <= '9'))
|
||||
|| (c == '=') || (c == '+') || (c == '/')
|
||||
) {
|
||||
out[len] = c;
|
||||
len++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
while (len<4) { out[len] = (char) 0xFF; len++; }
|
||||
return pos+i;
|
||||
while (len<4) {
|
||||
out[len] = (char)0xFF;
|
||||
len++;
|
||||
}
|
||||
return pos + i;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
@@ -107,22 +115,24 @@ u32 gf_base64_decode(char *in_buf, u32 inSize, char *out, u32 outSize)
|
||||
while ((i + 3) < inSize) {
|
||||
padding = 0;
|
||||
i = load_block(in_buf, inSize, i, (char*)in);
|
||||
c[0] = char64(in[0]);
|
||||
c[0] = char64(in[0]);
|
||||
padding += (c[0] == 0xff);
|
||||
c[1] = char64(in[1]);
|
||||
padding += (c[1] == 0xff);
|
||||
c[2] = char64(in[2]);
|
||||
padding += (c[2] == 0xff);
|
||||
c[3] = char64(in[3]);
|
||||
c[3] = char64(in[3]);
|
||||
padding += (c[3] == 0xff);
|
||||
if (padding == 2) {
|
||||
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
|
||||
out[j] = (c[1] & 0x0f) << 4;
|
||||
} else if (padding == 1) {
|
||||
out[j] = (c[1] & 0x0f) << 4;
|
||||
}
|
||||
else if (padding == 1) {
|
||||
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
|
||||
out[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
|
||||
out[j] = (c[2] & 0x03) << 6;
|
||||
} else {
|
||||
out[j] = (c[2] & 0x03) << 6;
|
||||
}
|
||||
else {
|
||||
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
|
||||
out[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
|
||||
out[j++] = ((c[2] & 0x03) << 6) | (c[3] & 0x3f);
|
||||
@@ -132,11 +142,6 @@ u32 gf_base64_decode(char *in_buf, u32 inSize, char *out, u32 outSize)
|
||||
return j;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) ENST 2004 - Philippe de Cuetos
|
||||
*/
|
||||
|
||||
static const char base_16[] = "0123456789abcdef";
|
||||
|
||||
GF_EXPORT
|
||||
@@ -146,14 +151,14 @@ u32 gf_base16_encode(char *_in, u32 inSize, char *_out, u32 outSize)
|
||||
unsigned char *in = (unsigned char *)_in;
|
||||
unsigned char *out = (unsigned char *)_out;
|
||||
|
||||
if (outSize < (inSize * 2)+1) return 0;
|
||||
if (outSize < (inSize * 2) + 1) return 0;
|
||||
|
||||
for (i=0;i<inSize;i++) {
|
||||
out[2*i] = base_16[((in[i] & 0xf0) >> 4)];
|
||||
out[2*i+1] = base_16[(in[i] & 0x0f)];
|
||||
for (i = 0; i<inSize; i++) {
|
||||
out[2 * i] = base_16[((in[i] & 0xf0) >> 4)];
|
||||
out[2 * i + 1] = base_16[(in[i] & 0x0f)];
|
||||
}
|
||||
out[(inSize * 2)] = 0;
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -162,91 +167,89 @@ u32 gf_base16_encode(char *_in, u32 inSize, char *_out, u32 outSize)
|
||||
GF_EXPORT
|
||||
u32 gf_base16_decode(char *in, u32 inSize, char *out, u32 outSize)
|
||||
{
|
||||
u32 j=0;
|
||||
u32 c[2] = {0,0};
|
||||
u32 j = 0;
|
||||
u32 c[2] = { 0,0 };
|
||||
|
||||
if (outSize < (inSize / 2)) return 0;
|
||||
if ((inSize % 2) != 0) return 0;
|
||||
|
||||
for (j=0;j<inSize/2;j++) {
|
||||
c[0] = char16(in[2*j]);
|
||||
c[1] = char16(in[2*j+1]);
|
||||
out[j] = ((c[0] << 4)&0xf0) | (c[1]&0x0f);
|
||||
|
||||
for (j = 0; j<inSize / 2; j++) {
|
||||
c[0] = char16(in[2 * j]);
|
||||
c[1] = char16(in[2 * j + 1]);
|
||||
out[j] = ((c[0] << 4) & 0xf0) | (c[1] & 0x0f);
|
||||
}
|
||||
out[inSize/2] = 0;
|
||||
|
||||
out[inSize / 2] = 0;
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
// #include <gpac/zlib.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_ZLIB
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#define ZLIB_COMPRESS_SAFE 4
|
||||
|
||||
#define HAVE_ZLIB 0
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_gz_compress_payload(char **data, u32 data_len, u32 *max_size)
|
||||
{
|
||||
#if HAVE_ZLIB
|
||||
z_stream stream;
|
||||
int err;
|
||||
char *dest = (char *)gf_malloc(sizeof(char)*data_len*ZLIB_COMPRESS_SAFE);
|
||||
stream.next_in = (Bytef*)(*data) ;
|
||||
stream.avail_in = (uInt)data_len ;
|
||||
stream.next_out = ( Bytef*)dest;
|
||||
stream.avail_out = (uInt)data_len*ZLIB_COMPRESS_SAFE;
|
||||
stream.zalloc = (alloc_func)NULL;
|
||||
stream.zfree = (free_func)NULL;
|
||||
stream.opaque = (voidpf)NULL;
|
||||
z_stream stream;
|
||||
int err;
|
||||
char *dest = (char *)gf_malloc(sizeof(char)*data_len*ZLIB_COMPRESS_SAFE);
|
||||
stream.next_in = (Bytef*)(*data);
|
||||
stream.avail_in = (uInt)data_len;
|
||||
stream.next_out = (Bytef*)dest;
|
||||
stream.avail_out = (uInt)data_len*ZLIB_COMPRESS_SAFE;
|
||||
stream.zalloc = (alloc_func)NULL;
|
||||
stream.zfree = (free_func)NULL;
|
||||
stream.opaque = (voidpf)NULL;
|
||||
|
||||
err = deflateInit(&stream, 9);
|
||||
if (err != Z_OK) {
|
||||
err = deflateInit(&stream, 9);
|
||||
if (err != Z_OK) {
|
||||
gf_free(dest);
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
err = deflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
err = deflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
gf_free(dest);
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
if (data_len <stream.total_out) {
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CORE, ("[GZ] compressed data (%d) larger than input (%d)\n", (u32) stream.total_out, (u32) data_len ));
|
||||
}
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
if (data_len <stream.total_out) {
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CORE, ("[GZ] compressed data (%d) larger than input (%d)\n", (u32)stream.total_out, (u32)data_len));
|
||||
}
|
||||
|
||||
if (*max_size < stream.total_out) {
|
||||
if (*max_size < stream.total_out) {
|
||||
*max_size = data_len*ZLIB_COMPRESS_SAFE;
|
||||
*data = gf_realloc(*data, *max_size * sizeof(char));
|
||||
}
|
||||
*data = (char*)gf_realloc(*data, *max_size * sizeof(char));
|
||||
}
|
||||
|
||||
memcpy((*data) , dest, sizeof(char)*stream.total_out);
|
||||
*max_size = stream.total_out;
|
||||
gf_free(dest);
|
||||
memcpy((*data), dest, sizeof(char)*stream.total_out);
|
||||
*max_size = (u32)stream.total_out;
|
||||
gf_free(dest);
|
||||
|
||||
deflateEnd(&stream);
|
||||
return GF_OK;
|
||||
#else
|
||||
return GF_IO_ERR;
|
||||
#endif
|
||||
deflateEnd(&stream);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_gz_decompress_payload(char *data, u32 data_len, char **uncompressed_data, u32 *out_size)
|
||||
{
|
||||
#if HAVE_ZLIB
|
||||
z_stream d_stream;
|
||||
GF_Err e = GF_OK;
|
||||
int err;
|
||||
u32 size = 4096;
|
||||
|
||||
*uncompressed_data = gf_malloc(sizeof(char)*4096);
|
||||
*uncompressed_data = (char*)gf_malloc(sizeof(char) * 4096);
|
||||
if (!*uncompressed_data) return GF_OUT_OF_MEM;
|
||||
|
||||
d_stream.zalloc = (alloc_func)0;
|
||||
d_stream.zfree = (free_func)0;
|
||||
d_stream.opaque = (voidpf)0;
|
||||
d_stream.next_in = (Bytef*)data;
|
||||
d_stream.next_in = (Bytef*)data;
|
||||
d_stream.avail_in = data_len;
|
||||
d_stream.next_out = (Bytef*) *uncompressed_data;
|
||||
d_stream.next_out = (Bytef*)*uncompressed_data;
|
||||
d_stream.avail_out = 4096;
|
||||
|
||||
err = inflateInit(&d_stream);
|
||||
@@ -257,24 +260,25 @@ GF_Err gf_gz_decompress_payload(char *data, u32 data_len, char **uncompressed_da
|
||||
e = GF_NON_COMPLIANT_BITSTREAM;
|
||||
break;
|
||||
}
|
||||
if (err==Z_STREAM_END) break;
|
||||
if (err == Z_STREAM_END) break;
|
||||
|
||||
size *= 2;
|
||||
*uncompressed_data = gf_realloc(*uncompressed_data, sizeof(char)*size);
|
||||
*uncompressed_data = (char*)gf_realloc(*uncompressed_data, sizeof(char)*size);
|
||||
if (!*uncompressed_data) return GF_OUT_OF_MEM;
|
||||
d_stream.avail_out = (size - d_stream.total_out);
|
||||
d_stream.next_out = (Bytef*) ( *uncompressed_data + d_stream.total_out);
|
||||
d_stream.avail_out = (u32)(size - d_stream.total_out);
|
||||
d_stream.next_out = (Bytef*)(*uncompressed_data + d_stream.total_out);
|
||||
}
|
||||
*out_size = d_stream.total_out;
|
||||
*out_size = (u32)d_stream.total_out;
|
||||
inflateEnd(&d_stream);
|
||||
return e;
|
||||
}
|
||||
if (e!=GF_OK) {
|
||||
if (e != GF_OK) {
|
||||
gf_free(*uncompressed_data);
|
||||
*uncompressed_data = NULL;
|
||||
}
|
||||
return e;
|
||||
#else
|
||||
return GF_IO_ERR;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ZLIB*/
|
||||
|
||||
#endif /* GPAC_DISABLE_CORE_TOOLS*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,27 +1,28 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
#include "../disable_warnings.h"
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM
|
||||
@@ -30,8 +31,9 @@ void gppa_del(GF_Box *s)
|
||||
{
|
||||
GF_3GPPAudioSampleEntryBox *ptr = (GF_3GPPAudioSampleEntryBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)ptr);
|
||||
|
||||
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
|
||||
if (ptr->protection_info) gf_isom_box_del((GF_Box *)ptr->protection_info);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
@@ -50,11 +52,8 @@ GF_Err gppa_Read(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
GF_Box *gppa_New(u32 type)
|
||||
{
|
||||
GF_3GPPAudioSampleEntryBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_3GPPAudioSampleEntryBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
ISOM_DECL_BOX_ALLOC(GF_3GPPAudioSampleEntryBox, type);
|
||||
gf_isom_audio_sample_entry_init((GF_AudioSampleEntryBox*)tmp);
|
||||
tmp->type = type;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -89,19 +88,16 @@ GF_Err gppa_Size(GF_Box *s)
|
||||
|
||||
GF_Box *gppv_New(u32 type)
|
||||
{
|
||||
GF_3GPPVisualSampleEntryBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_3GPPVisualSampleEntryBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
ISOM_DECL_BOX_ALLOC(GF_3GPPVisualSampleEntryBox, type);
|
||||
gf_isom_video_sample_entry_init((GF_VisualSampleEntryBox *)tmp);
|
||||
tmp->type = type;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
void gppv_del(GF_Box *s)
|
||||
{
|
||||
GF_3GPPVisualSampleEntryBox *ptr = (GF_3GPPVisualSampleEntryBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)ptr);
|
||||
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
|
||||
if (ptr->protection_info) gf_isom_box_del((GF_Box *)ptr->protection_info);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
@@ -148,10 +144,7 @@ GF_Err gppv_Size(GF_Box *s)
|
||||
|
||||
GF_Box *gppc_New(u32 type)
|
||||
{
|
||||
GF_3GPPConfigBox *tmp = (GF_3GPPConfigBox *) gf_malloc(sizeof(GF_3GPPConfigBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_3GPPConfigBox));
|
||||
tmp->type = type;
|
||||
ISOM_DECL_BOX_ALLOC(GF_3GPPConfigBox, type);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -182,7 +175,7 @@ GF_Err gppc_Read(GF_Box *s, GF_BitStream *bs)
|
||||
ptr->cfg.AMR_mode_change_period = gf_bs_read_u8(bs);
|
||||
ptr->cfg.frames_per_sample = gf_bs_read_u8(bs);
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_DEVC:
|
||||
case GF_ISOM_BOX_TYPE_DEVC:
|
||||
case GF_ISOM_BOX_TYPE_DQCP:
|
||||
case GF_ISOM_BOX_TYPE_DSMV:
|
||||
ptr->cfg.frames_per_sample = gf_bs_read_u8(bs);
|
||||
@@ -252,18 +245,15 @@ GF_Err gppc_Size(GF_Box *s)
|
||||
|
||||
GF_Box *ftab_New()
|
||||
{
|
||||
GF_FontTableBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_FontTableBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_FTAB;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_FontTableBox, GF_ISOM_BOX_TYPE_FTAB);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
void ftab_del(GF_Box *s)
|
||||
{
|
||||
GF_FontTableBox *ptr = (GF_FontTableBox *)s;
|
||||
if (ptr->fonts) {
|
||||
u32 i;
|
||||
for (i=0; i<ptr->entry_count; i++)
|
||||
for (i = 0; i<ptr->entry_count; i++)
|
||||
if (ptr->fonts[i].fontName) gf_free(ptr->fonts[i].fontName);
|
||||
gf_free(ptr->fonts);
|
||||
}
|
||||
@@ -274,13 +264,20 @@ GF_Err ftab_Read(GF_Box *s, GF_BitStream *bs)
|
||||
u32 i;
|
||||
GF_FontTableBox *ptr = (GF_FontTableBox *)s;
|
||||
ptr->entry_count = gf_bs_read_u16(bs);
|
||||
ptr->fonts = (GF_FontRecord *) gf_malloc(sizeof(GF_FontRecord)*ptr->entry_count);
|
||||
for (i=0; i<ptr->entry_count; i++) {
|
||||
ptr->size -= 2;
|
||||
if (ptr->size<ptr->entry_count * 3) {
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] Corrupted ftap box, skipping\n"));
|
||||
ptr->entry_count = 0;
|
||||
return GF_OK;
|
||||
}
|
||||
ptr->fonts = (GF_FontRecord *)gf_malloc(sizeof(GF_FontRecord)*ptr->entry_count);
|
||||
memset(ptr->fonts, 0, sizeof(GF_FontRecord)*ptr->entry_count);
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
u32 len;
|
||||
ptr->fonts[i].fontID = gf_bs_read_u16(bs);
|
||||
len = gf_bs_read_u8(bs);
|
||||
if (len) {
|
||||
ptr->fonts[i].fontName = (char *)gf_malloc(sizeof(char)*(len+1));
|
||||
ptr->fonts[i].fontName = (char *)gf_malloc(sizeof(char)*(len + 1));
|
||||
gf_bs_read_data(bs, ptr->fonts[i].fontName, len);
|
||||
ptr->fonts[i].fontName[len] = 0;
|
||||
}
|
||||
@@ -297,13 +294,14 @@ GF_Err ftab_Write(GF_Box *s, GF_BitStream *bs)
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_u16(bs, ptr->entry_count);
|
||||
for (i=0; i<ptr->entry_count; i++) {
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
gf_bs_write_u16(bs, ptr->fonts[i].fontID);
|
||||
if (ptr->fonts[i].fontName) {
|
||||
u32 len = strlen(ptr->fonts[i].fontName);
|
||||
u32 len = (u32)strlen(ptr->fonts[i].fontName);
|
||||
gf_bs_write_u8(bs, len);
|
||||
gf_bs_write_data(bs, ptr->fonts[i].fontName, len);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u8(bs, 0);
|
||||
}
|
||||
}
|
||||
@@ -316,7 +314,7 @@ GF_Err ftab_Size(GF_Box *s)
|
||||
GF_Err e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
s->size += 2;
|
||||
for (i=0; i<ptr->entry_count; i++) {
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
s->size += 3;
|
||||
if (ptr->fonts[i].fontName) s->size += strlen(ptr->fonts[i].fontName);
|
||||
}
|
||||
@@ -329,17 +327,15 @@ GF_Err ftab_Size(GF_Box *s)
|
||||
|
||||
GF_Box *text_New()
|
||||
{
|
||||
GF_TextSampleEntryBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextSampleEntryBox);
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_TEXT;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextSampleEntryBox, GF_ISOM_BOX_TYPE_TEXT);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void text_del(GF_Box *s)
|
||||
{
|
||||
GF_TextSampleEntryBox *ptr = (GF_TextSampleEntryBox*)s;
|
||||
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
|
||||
|
||||
if (ptr->textName)
|
||||
gf_free(ptr->textName);
|
||||
gf_free(ptr);
|
||||
@@ -347,17 +343,16 @@ void text_del(GF_Box *s)
|
||||
|
||||
GF_Box *tx3g_New()
|
||||
{
|
||||
GF_Tx3gSampleEntryBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_Tx3gSampleEntryBox);
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_TX3G;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_Tx3gSampleEntryBox, GF_ISOM_BOX_TYPE_TX3G);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void tx3g_del(GF_Box *s)
|
||||
{
|
||||
GF_Tx3gSampleEntryBox *ptr = (GF_Tx3gSampleEntryBox*)s;
|
||||
|
||||
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
|
||||
|
||||
if (ptr->font_table)
|
||||
gf_isom_box_del((GF_Box *)ptr->font_table);
|
||||
gf_free(ptr);
|
||||
@@ -371,9 +366,12 @@ static u32 gpp_read_rgba(GF_BitStream *bs)
|
||||
g = gf_bs_read_u8(bs);
|
||||
b = gf_bs_read_u8(bs);
|
||||
a = gf_bs_read_u8(bs);
|
||||
col = a; col<<=8;
|
||||
col |= r; col<<=8;
|
||||
col |= g; col<<=8;
|
||||
col = a;
|
||||
col <<= 8;
|
||||
col |= r;
|
||||
col <<= 8;
|
||||
col |= g;
|
||||
col <<= 8;
|
||||
col |= b;
|
||||
return col;
|
||||
}
|
||||
@@ -416,16 +414,24 @@ GF_Err tx3g_Read(GF_Box *s, GF_BitStream *bs)
|
||||
gpp_read_style(bs, &ptr->default_style);
|
||||
ptr->size -= 18 + GPP_BOX_SIZE + GPP_STYLE_SIZE;
|
||||
|
||||
while (ptr->size) {
|
||||
while (ptr->size >= 8) {
|
||||
e = gf_isom_parse_box(&a, bs);
|
||||
if (e) return e;
|
||||
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
|
||||
ptr->size -= a->size;
|
||||
if (a->type==GF_ISOM_BOX_TYPE_FTAB) {
|
||||
if (ptr->font_table) gf_isom_box_del((GF_Box *) ptr->font_table);
|
||||
ptr->font_table = (GF_FontTableBox *)a;
|
||||
} else {
|
||||
if (ptr->size<a->size) {
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] Box \"%s\" larger than remaining bytes in tx3g - ignoring box\n", gf_4cc_to_str(a->type)));
|
||||
ptr->size = 0;
|
||||
gf_isom_box_del(a);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
ptr->size -= a->size;
|
||||
if (a->type == GF_ISOM_BOX_TYPE_FTAB) {
|
||||
if (ptr->font_table) gf_isom_box_del((GF_Box *)ptr->font_table);
|
||||
ptr->font_table = (GF_FontTableBox *)a;
|
||||
}
|
||||
else {
|
||||
e = gf_isom_box_add_default(s, a);
|
||||
if (e) return e;
|
||||
}
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -445,9 +451,9 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
|
||||
gpp_read_box(bs, &ptr->default_box); /*Default text box*/
|
||||
gf_bs_read_data(bs, ptr->reserved1, 8); /*Reserved*/
|
||||
ptr->fontNumber = gf_bs_read_u16(bs); /*Font number*/
|
||||
ptr->fontFace = gf_bs_read_u16(bs); /*Font face*/
|
||||
ptr->reserved2 = gf_bs_read_u8(bs); /*Reserved*/
|
||||
ptr->reserved3 = gf_bs_read_u16(bs); /*Reserved*/
|
||||
ptr->fontFace = gf_bs_read_u16(bs); /*Font face*/
|
||||
ptr->reserved2 = gf_bs_read_u8(bs); /*Reserved*/
|
||||
ptr->reserved3 = gf_bs_read_u16(bs); /*Reserved*/
|
||||
gf_bs_read_data(bs, ptr->foreground_color, 6); /*Foreground color*/
|
||||
if (ptr->size < 51)
|
||||
return GF_ISOM_INVALID_FILE;
|
||||
@@ -457,10 +463,38 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
pSize = gf_bs_read_u8(bs); /*a Pascal string begins with its size: get textName size*/
|
||||
ptr->size -= 1;
|
||||
if (ptr->size < pSize)
|
||||
return GF_ISOM_INVALID_FILE;
|
||||
if (ptr->size < pSize) {
|
||||
u32 s = pSize;
|
||||
size_t i = 0;
|
||||
GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string: trying to decode anyway.\n"));
|
||||
ptr->textName = (char*)gf_malloc((u32)ptr->size + 1 + 1);
|
||||
do {
|
||||
char c = (char)s;
|
||||
if (c == '\0') {
|
||||
break;
|
||||
}
|
||||
else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
|
||||
ptr->textName[i] = c;
|
||||
}
|
||||
else {
|
||||
gf_free(ptr->textName);
|
||||
ptr->textName = NULL;
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string and contains non-chars. Abort.\n"));
|
||||
return GF_ISOM_INVALID_FILE;
|
||||
}
|
||||
i++;
|
||||
if (!ptr->size)
|
||||
break;
|
||||
ptr->size--;
|
||||
s = gf_bs_read_u8(bs);
|
||||
} while (s);
|
||||
|
||||
ptr->textName[i] = '\0'; /*Font name*/
|
||||
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string: \"%s\" detected.\n", ptr->textName));
|
||||
return GF_OK;
|
||||
}
|
||||
if (pSize) {
|
||||
ptr->textName = (char*) gf_malloc(pSize+1 * sizeof(char));
|
||||
ptr->textName = (char*)gf_malloc(pSize + 1 * sizeof(char));
|
||||
if (gf_bs_read_data(bs, ptr->textName, pSize) != pSize) {
|
||||
gf_free(ptr->textName);
|
||||
ptr->textName = NULL;
|
||||
@@ -475,10 +509,10 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
void gpp_write_rgba(GF_BitStream *bs, u32 col)
|
||||
{
|
||||
gf_bs_write_u8(bs, (col>>16) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col>>8) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col >> 16) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col >> 8) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col>>24) & 0xFF);
|
||||
gf_bs_write_u8(bs, (col >> 24) & 0xFF);
|
||||
}
|
||||
|
||||
void gpp_write_box(GF_BitStream *bs, GF_BoxRecord *rec)
|
||||
@@ -517,7 +551,7 @@ GF_Err tx3g_Write(GF_Box *s, GF_BitStream *bs)
|
||||
gpp_write_rgba(bs, ptr->back_color);
|
||||
gpp_write_box(bs, &ptr->default_box);
|
||||
gpp_write_style(bs, &ptr->default_style);
|
||||
return gf_isom_box_write((GF_Box *) ptr->font_table, bs);
|
||||
return gf_isom_box_write((GF_Box *)ptr->font_table, bs);
|
||||
}
|
||||
|
||||
GF_Err text_Write(GF_Box *s, GF_BitStream *bs)
|
||||
@@ -540,10 +574,12 @@ GF_Err text_Write(GF_Box *s, GF_BitStream *bs)
|
||||
gf_bs_write_u8(bs, ptr->reserved2); /*Reserved*/
|
||||
gf_bs_write_u16(bs, ptr->reserved3); /*Reserved*/
|
||||
gf_bs_write_data(bs, ptr->foreground_color, 6); /*Foreground color*/
|
||||
if (ptr->textName && (pSize=strlen(ptr->textName))) {
|
||||
//pSize assignment below is not a mistake
|
||||
if (ptr->textName && (pSize = (u16)strlen(ptr->textName))) {
|
||||
gf_bs_write_u8(bs, pSize); /*a Pascal string begins with its size*/
|
||||
gf_bs_write_data(bs, ptr->textName, pSize); /*Font name*/
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u8(bs, 0);
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -557,7 +593,7 @@ GF_Err tx3g_Size(GF_Box *s)
|
||||
/*base + this + box + style*/
|
||||
s->size += 18 + GPP_BOX_SIZE + GPP_STYLE_SIZE;
|
||||
if (ptr->font_table) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->font_table);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->font_table);
|
||||
if (e) return e;
|
||||
s->size += ptr->font_table->size;
|
||||
}
|
||||
@@ -580,11 +616,8 @@ GF_Err text_Size(GF_Box *s)
|
||||
|
||||
GF_Box *styl_New()
|
||||
{
|
||||
GF_TextStyleBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextStyleBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_STYL;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextStyleBox, GF_ISOM_BOX_TYPE_STYL);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void styl_del(GF_Box *s)
|
||||
@@ -601,7 +634,7 @@ GF_Err styl_Read(GF_Box *s, GF_BitStream *bs)
|
||||
ptr->entry_count = gf_bs_read_u16(bs);
|
||||
if (ptr->entry_count) {
|
||||
ptr->styles = (GF_StyleRecord*)gf_malloc(sizeof(GF_StyleRecord)*ptr->entry_count);
|
||||
for (i=0; i<ptr->entry_count; i++) {
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
gpp_read_style(bs, &ptr->styles[i]);
|
||||
}
|
||||
}
|
||||
@@ -615,10 +648,10 @@ GF_Err styl_Write(GF_Box *s, GF_BitStream *bs)
|
||||
u32 i;
|
||||
GF_TextStyleBox*ptr = (GF_TextStyleBox*)s;
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
assert(e == GF_OK);
|
||||
if (e) return e;
|
||||
|
||||
gf_bs_write_u16(bs, ptr->entry_count);
|
||||
for (i=0; i<ptr->entry_count; i++) gpp_write_style(bs, &ptr->styles[i]);
|
||||
for (i = 0; i<ptr->entry_count; i++) gpp_write_style(bs, &ptr->styles[i]);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -635,11 +668,8 @@ GF_Err styl_Size(GF_Box *s)
|
||||
|
||||
GF_Box *hlit_New()
|
||||
{
|
||||
GF_TextHighlightBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextHighlightBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_HLIT;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextHighlightBox, GF_ISOM_BOX_TYPE_HLIT);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void hlit_del(GF_Box *s)
|
||||
@@ -679,11 +709,8 @@ GF_Err hlit_Size(GF_Box *s)
|
||||
|
||||
GF_Box *hclr_New()
|
||||
{
|
||||
GF_TextHighlightColorBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextHighlightColorBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_HCLR;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextHighlightColorBox, GF_ISOM_BOX_TYPE_HCLR);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void hclr_del(GF_Box *s)
|
||||
@@ -721,11 +748,8 @@ GF_Err hclr_Size(GF_Box *s)
|
||||
|
||||
GF_Box *krok_New()
|
||||
{
|
||||
GF_TextKaraokeBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextKaraokeBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_KROK;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextKaraokeBox, GF_ISOM_BOX_TYPE_KROK);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void krok_del(GF_Box *s)
|
||||
@@ -744,7 +768,7 @@ GF_Err krok_Read(GF_Box *s, GF_BitStream *bs)
|
||||
if (ptr->nb_entries) {
|
||||
u32 i;
|
||||
ptr->records = (KaraokeRecord*)gf_malloc(sizeof(KaraokeRecord)*ptr->nb_entries);
|
||||
for (i=0; i<ptr->nb_entries; i++) {
|
||||
for (i = 0; i<ptr->nb_entries; i++) {
|
||||
ptr->records[i].highlight_endtime = gf_bs_read_u32(bs);
|
||||
ptr->records[i].start_charoffset = gf_bs_read_u16(bs);
|
||||
ptr->records[i].end_charoffset = gf_bs_read_u16(bs);
|
||||
@@ -764,7 +788,7 @@ GF_Err krok_Write(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
gf_bs_write_u32(bs, ptr->highlight_starttime);
|
||||
gf_bs_write_u16(bs, ptr->nb_entries);
|
||||
for (i=0; i<ptr->nb_entries; i++) {
|
||||
for (i = 0; i<ptr->nb_entries; i++) {
|
||||
gf_bs_write_u32(bs, ptr->records[i].highlight_endtime);
|
||||
gf_bs_write_u16(bs, ptr->records[i].start_charoffset);
|
||||
gf_bs_write_u16(bs, ptr->records[i].end_charoffset);
|
||||
@@ -777,7 +801,7 @@ GF_Err krok_Size(GF_Box *s)
|
||||
GF_TextKaraokeBox*ptr = (GF_TextKaraokeBox*)s;
|
||||
GF_Err e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
s->size += 6 * 8*ptr->nb_entries;
|
||||
s->size += 6 * 8 * ptr->nb_entries;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -785,11 +809,8 @@ GF_Err krok_Size(GF_Box *s)
|
||||
|
||||
GF_Box *dlay_New()
|
||||
{
|
||||
GF_TextScrollDelayBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextScrollDelayBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_DLAY;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextScrollDelayBox, GF_ISOM_BOX_TYPE_DLAY);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void dlay_del(GF_Box *s)
|
||||
@@ -827,11 +848,8 @@ GF_Err dlay_Size(GF_Box *s)
|
||||
|
||||
GF_Box *href_New()
|
||||
{
|
||||
GF_TextHyperTextBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextHyperTextBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_HREF;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextHyperTextBox, GF_ISOM_BOX_TYPE_HREF);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void href_del(GF_Box *s)
|
||||
@@ -850,15 +868,15 @@ GF_Err href_Read(GF_Box *s, GF_BitStream *bs)
|
||||
ptr->endcharoffset = gf_bs_read_u16(bs);
|
||||
len = gf_bs_read_u8(bs);
|
||||
if (len) {
|
||||
ptr->URL = (char *) gf_malloc(sizeof(char) * (len+1));
|
||||
ptr->URL = (char *)gf_malloc(sizeof(char) * (len + 1));
|
||||
gf_bs_read_data(bs, ptr->URL, len);
|
||||
ptr->URL[len] = 0;
|
||||
}
|
||||
len = gf_bs_read_u8(bs);
|
||||
if (len) {
|
||||
ptr->URL_hint = (char *) gf_malloc(sizeof(char) * (len+1));
|
||||
ptr->URL_hint = (char *)gf_malloc(sizeof(char) * (len + 1));
|
||||
gf_bs_read_data(bs, ptr->URL_hint, len);
|
||||
ptr->URL_hint[len]= 0;
|
||||
ptr->URL_hint[len] = 0;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -875,17 +893,19 @@ GF_Err href_Write(GF_Box *s, GF_BitStream *bs)
|
||||
gf_bs_write_u16(bs, ptr->startcharoffset);
|
||||
gf_bs_write_u16(bs, ptr->endcharoffset);
|
||||
if (ptr->URL) {
|
||||
len = strlen(ptr->URL);
|
||||
len = (u32)strlen(ptr->URL);
|
||||
gf_bs_write_u8(bs, len);
|
||||
gf_bs_write_data(bs, ptr->URL, len);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u8(bs, 0);
|
||||
}
|
||||
if (ptr->URL_hint) {
|
||||
len = strlen(ptr->URL_hint);
|
||||
len = (u32)strlen(ptr->URL_hint);
|
||||
gf_bs_write_u8(bs, len);
|
||||
gf_bs_write_data(bs, ptr->URL_hint, len);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u8(bs, 0);
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -907,11 +927,8 @@ GF_Err href_Size(GF_Box *s)
|
||||
|
||||
GF_Box *tbox_New()
|
||||
{
|
||||
GF_TextBoxBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextBoxBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_TBOX;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextBoxBox, GF_ISOM_BOX_TYPE_TBOX);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void tbox_del(GF_Box *s)
|
||||
@@ -950,11 +967,8 @@ GF_Err tbox_Size(GF_Box *s)
|
||||
|
||||
GF_Box *blnk_New()
|
||||
{
|
||||
GF_TextBlinkBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextBlinkBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_BLNK;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextBlinkBox, GF_ISOM_BOX_TYPE_BLNK);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void blnk_del(GF_Box *s)
|
||||
@@ -994,11 +1008,8 @@ GF_Err blnk_Size(GF_Box *s)
|
||||
|
||||
GF_Box *twrp_New()
|
||||
{
|
||||
GF_TextWrapBox*tmp;
|
||||
GF_SAFEALLOC(tmp, GF_TextWrapBox);
|
||||
if (!tmp) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_TWRP;
|
||||
return (GF_Box *) tmp;
|
||||
ISOM_DECL_BOX_ALLOC(GF_TextWrapBox, GF_ISOM_BOX_TYPE_TWRP);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void twrp_del(GF_Box *s)
|
||||
@@ -1036,27 +1047,27 @@ GF_Err twrp_Size(GF_Box *s)
|
||||
void tsel_del(GF_Box *s)
|
||||
{
|
||||
GF_TrackSelectionBox *ptr;
|
||||
ptr = (GF_TrackSelectionBox *) s;
|
||||
ptr = (GF_TrackSelectionBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->attributeList) gf_free(ptr->attributeList);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err tsel_Read(GF_Box *s,GF_BitStream *bs)
|
||||
GF_Err tsel_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 i;
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
ptr->switchGroup = gf_bs_read_u32(bs);
|
||||
ptr->size -= 4;
|
||||
if (ptr->size % 4) return GF_ISOM_INVALID_FILE;
|
||||
ptr->attributeListCount = (u32)ptr->size/4;
|
||||
ptr->attributeList = (u32 * ) gf_malloc(ptr->attributeListCount*sizeof(u32));
|
||||
ptr->attributeListCount = (u32)ptr->size / 4;
|
||||
ptr->attributeList = gf_malloc(ptr->attributeListCount * sizeof(u32));
|
||||
if (ptr->attributeList == NULL) return GF_OUT_OF_MEM;
|
||||
|
||||
for (i=0; i< ptr->attributeListCount; i++) {
|
||||
|
||||
for (i = 0; i< ptr->attributeListCount; i++) {
|
||||
ptr->attributeList[i] = gf_bs_read_u32(bs);
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -1064,13 +1075,8 @@ GF_Err tsel_Read(GF_Box *s,GF_BitStream *bs)
|
||||
|
||||
GF_Box *tsel_New()
|
||||
{
|
||||
GF_TrackSelectionBox *tmp;
|
||||
|
||||
tmp = (GF_TrackSelectionBox *) gf_malloc(sizeof(GF_TrackSelectionBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_TrackSelectionBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_TrackSelectionBox, GF_ISOM_BOX_TYPE_TSEL);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_TSEL;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -1081,26 +1087,26 @@ GF_Err tsel_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 i;
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
|
||||
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_u32(bs,ptr->switchGroup);
|
||||
gf_bs_write_u32(bs, ptr->switchGroup);
|
||||
|
||||
for (i = 0; i < ptr->attributeListCount; i++ ) {
|
||||
for (i = 0; i < ptr->attributeListCount; i++) {
|
||||
gf_bs_write_u32(bs, ptr->attributeList[i]);
|
||||
}
|
||||
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err tsel_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
|
||||
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 4 + (4*ptr->attributeListCount);
|
||||
ptr->size += 4 + (4 * ptr->attributeListCount);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -1109,12 +1115,8 @@ GF_Err tsel_Size(GF_Box *s)
|
||||
|
||||
GF_Box *dimC_New()
|
||||
{
|
||||
GF_DIMSSceneConfigBox *tmp;
|
||||
|
||||
GF_SAFEALLOC(tmp, GF_DIMSSceneConfigBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
ISOM_DECL_BOX_ALLOC(GF_DIMSSceneConfigBox, GF_ISOM_BOX_TYPE_DIMC);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_DIMC;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
void dimC_del(GF_Box *s)
|
||||
@@ -1140,9 +1142,9 @@ GF_Err dimC_Read(GF_Box *s, GF_BitStream *bs)
|
||||
p->streamType = gf_bs_read_int(bs, 1);
|
||||
p->containsRedundant = gf_bs_read_int(bs, 2);
|
||||
s->size -= 3;
|
||||
|
||||
i=0;
|
||||
str[0]=0;
|
||||
|
||||
i = 0;
|
||||
str[0] = 0;
|
||||
while (1) {
|
||||
str[i] = gf_bs_read_u8(bs);
|
||||
if (!str[i]) break;
|
||||
@@ -1152,8 +1154,8 @@ GF_Err dimC_Read(GF_Box *s, GF_BitStream *bs)
|
||||
s->size -= i;
|
||||
p->textEncoding = gf_strdup(str);
|
||||
|
||||
i=0;
|
||||
str[0]=0;
|
||||
i = 0;
|
||||
str[0] = 0;
|
||||
while (1) {
|
||||
str[i] = gf_bs_read_u8(bs);
|
||||
if (!str[i]) break;
|
||||
@@ -1177,8 +1179,8 @@ GF_Err dimC_Write(GF_Box *s, GF_BitStream *bs)
|
||||
gf_bs_write_int(bs, p->fullRequestHost, 1);
|
||||
gf_bs_write_int(bs, p->streamType, 1);
|
||||
gf_bs_write_int(bs, p->containsRedundant, 2);
|
||||
gf_bs_write_data(bs, p->textEncoding, strlen(p->textEncoding)+1);
|
||||
gf_bs_write_data(bs, p->contentEncoding, strlen(p->contentEncoding)+1);
|
||||
gf_bs_write_data(bs, p->textEncoding, (u32)strlen(p->textEncoding) + 1);
|
||||
gf_bs_write_data(bs, p->contentEncoding, (u32)strlen(p->contentEncoding) + 1);
|
||||
return GF_OK;
|
||||
}
|
||||
GF_Err dimC_Size(GF_Box *s)
|
||||
@@ -1195,11 +1197,7 @@ GF_Err dimC_Size(GF_Box *s)
|
||||
|
||||
GF_Box *diST_New()
|
||||
{
|
||||
GF_DIMSScriptTypesBox *tmp;
|
||||
|
||||
GF_SAFEALLOC(tmp, GF_DIMSScriptTypesBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_DIST;
|
||||
ISOM_DECL_BOX_ALLOC(GF_DIMSScriptTypesBox, GF_ISOM_BOX_TYPE_DIST);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
void diST_del(GF_Box *s)
|
||||
@@ -1215,8 +1213,8 @@ GF_Err diST_Read(GF_Box *s, GF_BitStream *bs)
|
||||
char str[1024];
|
||||
GF_DIMSScriptTypesBox *p = (GF_DIMSScriptTypesBox *)s;
|
||||
|
||||
i=0;
|
||||
str[0]=0;
|
||||
i = 0;
|
||||
str[0] = 0;
|
||||
while (1) {
|
||||
str[i] = gf_bs_read_u8(bs);
|
||||
if (!str[i]) break;
|
||||
@@ -1235,7 +1233,7 @@ GF_Err diST_Write(GF_Box *s, GF_BitStream *bs)
|
||||
GF_Err e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
if (p->content_script_types)
|
||||
gf_bs_write_data(bs, p->content_script_types, strlen(p->content_script_types)+1);
|
||||
gf_bs_write_data(bs, p->content_script_types, (u32)strlen(p->content_script_types) + 1);
|
||||
else
|
||||
gf_bs_write_u8(bs, 0);
|
||||
return GF_OK;
|
||||
@@ -1245,7 +1243,7 @@ GF_Err diST_Size(GF_Box *s)
|
||||
GF_Err e = gf_isom_box_get_size(s);
|
||||
GF_DIMSScriptTypesBox *p = (GF_DIMSScriptTypesBox *)s;
|
||||
if (e) return e;
|
||||
s->size += p->content_script_types ? (strlen(p->content_script_types)+1) : 1;
|
||||
s->size += p->content_script_types ? (strlen(p->content_script_types) + 1) : 1;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
@@ -1253,44 +1251,36 @@ GF_Err diST_Size(GF_Box *s)
|
||||
|
||||
GF_Box *dims_New()
|
||||
{
|
||||
GF_DIMSSampleEntryBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_DIMSSampleEntryBox);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_DIMS;
|
||||
ISOM_DECL_BOX_ALLOC(GF_DIMSSampleEntryBox, GF_ISOM_BOX_TYPE_DIMS);
|
||||
return (GF_Box*)tmp;
|
||||
}
|
||||
void dims_del(GF_Box *s)
|
||||
{
|
||||
GF_DIMSSampleEntryBox *p = (GF_DIMSSampleEntryBox *)s;
|
||||
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
|
||||
|
||||
if (p->config) gf_isom_box_del((GF_Box *)p->config);
|
||||
if (p->bitrate ) gf_isom_box_del((GF_Box *)p->bitrate);
|
||||
if (p->protection_info) gf_isom_box_del((GF_Box *)p->protection_info);
|
||||
if (p->scripts) gf_isom_box_del((GF_Box *)p->scripts);
|
||||
gf_free(p);
|
||||
}
|
||||
|
||||
static GF_Err dims_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
{
|
||||
GF_DIMSSampleEntryBox *ptr = (GF_DIMSSampleEntryBox *)s;
|
||||
switch (a->type) {
|
||||
case GF_ISOM_BOX_TYPE_DIMC:
|
||||
if (ptr->config) ERROR_ON_DUPLICATED_BOX(a, ptr)
|
||||
ptr->config = (GF_DIMSSceneConfigBox*)a;
|
||||
ptr->config = (GF_DIMSSceneConfigBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_DIST:
|
||||
if (ptr->scripts) ERROR_ON_DUPLICATED_BOX(a, ptr)
|
||||
ptr->scripts = (GF_DIMSScriptTypesBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_BTRT:
|
||||
if (ptr->bitrate) ERROR_ON_DUPLICATED_BOX(a, ptr)
|
||||
ptr->bitrate = (GF_MPEG4BitRateBox*)a;
|
||||
ptr->scripts = (GF_DIMSScriptTypesBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_SINF:
|
||||
if (ptr->protection_info) ERROR_ON_DUPLICATED_BOX(a, ptr)
|
||||
ptr->protection_info = (GF_ProtectionInfoBox*)a;
|
||||
gf_list_add(ptr->protections, a);
|
||||
break;
|
||||
default:
|
||||
gf_isom_box_del(a);
|
||||
break;
|
||||
return gf_isom_box_add_default(s, a);
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -1319,15 +1309,7 @@ GF_Err dims_Write(GF_Box *s, GF_BitStream *bs)
|
||||
e = gf_isom_box_write((GF_Box *)p->scripts, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (p->bitrate) {
|
||||
e = gf_isom_box_write((GF_Box *)p->bitrate, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (p->protection_info) {
|
||||
e = gf_isom_box_write((GF_Box *)p->protection_info, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
return GF_OK;
|
||||
return gf_isom_box_array_write(s, p->protections, bs);
|
||||
}
|
||||
|
||||
GF_Err dims_Size(GF_Box *s)
|
||||
@@ -1336,28 +1318,18 @@ GF_Err dims_Size(GF_Box *s)
|
||||
GF_DIMSSampleEntryBox *p = (GF_DIMSSampleEntryBox *)s;
|
||||
if (e) return e;
|
||||
s->size += 8;
|
||||
|
||||
|
||||
if (p->config) {
|
||||
e = gf_isom_box_size((GF_Box *) p->config);
|
||||
e = gf_isom_box_size((GF_Box *)p->config);
|
||||
if (e) return e;
|
||||
p->size += p->config->size;
|
||||
}
|
||||
if (p->protection_info) {
|
||||
e = gf_isom_box_size((GF_Box *) p->protection_info);
|
||||
if (e) return e;
|
||||
p->size += p->protection_info->size;
|
||||
}
|
||||
if (p->bitrate) {
|
||||
e = gf_isom_box_size((GF_Box *) p->bitrate);
|
||||
if (e) return e;
|
||||
p->size += p->bitrate->size;
|
||||
}
|
||||
if (p->scripts) {
|
||||
e = gf_isom_box_size((GF_Box *) p->scripts);
|
||||
e = gf_isom_box_size((GF_Box *)p->scripts);
|
||||
if (e) return e;
|
||||
p->size += p->scripts->size;
|
||||
}
|
||||
return GF_OK;
|
||||
return gf_isom_box_array_size(s, p->protections);
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
700
src/gpacmp4/box_code_adobe.c
Normal file
700
src/gpacmp4/box_code_adobe.c
Normal file
@@ -0,0 +1,700 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Author: Romain Bouqueau
|
||||
* Copyright (c) Romain Bouqueau 2012-
|
||||
* All rights reserved
|
||||
*
|
||||
* Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_ADOBE
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
|
||||
|
||||
void abst_del(GF_Box *s)
|
||||
{
|
||||
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
|
||||
if (ptr->movie_identifier)
|
||||
gf_free(ptr->movie_identifier);
|
||||
if (ptr->drm_data)
|
||||
gf_free(ptr->drm_data);
|
||||
if (ptr->meta_data)
|
||||
gf_free(ptr->meta_data);
|
||||
|
||||
while (gf_list_count(ptr->server_entry_table)) {
|
||||
gf_free(gf_list_get(ptr->server_entry_table, 0));
|
||||
gf_list_rem(ptr->server_entry_table, 0);
|
||||
}
|
||||
gf_list_del(ptr->server_entry_table);
|
||||
|
||||
while (gf_list_count(ptr->quality_entry_table)) {
|
||||
gf_free(gf_list_get(ptr->quality_entry_table, 0));
|
||||
gf_list_rem(ptr->quality_entry_table, 0);
|
||||
}
|
||||
gf_list_del(ptr->quality_entry_table);
|
||||
|
||||
while (gf_list_count(ptr->segment_run_table_entries)) {
|
||||
gf_isom_box_del((GF_Box *)gf_list_get(ptr->segment_run_table_entries, 0));
|
||||
gf_list_rem(ptr->segment_run_table_entries, 0);
|
||||
}
|
||||
gf_list_del(ptr->segment_run_table_entries);
|
||||
|
||||
while (gf_list_count(ptr->fragment_run_table_entries)) {
|
||||
gf_isom_box_del((GF_Box *)gf_list_get(ptr->fragment_run_table_entries, 0));
|
||||
gf_list_rem(ptr->fragment_run_table_entries, 0);
|
||||
}
|
||||
gf_list_del(ptr->fragment_run_table_entries);
|
||||
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err abst_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
|
||||
int i;
|
||||
u32 tmp_strsize = (u32)ptr->size - 8;
|
||||
char *tmp_str = gf_malloc(sizeof(char)*tmp_strsize);
|
||||
|
||||
GF_Err e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
ptr->bootstrapinfo_version = gf_bs_read_u32(bs);
|
||||
ptr->profile = gf_bs_read_int(bs, 2);
|
||||
ptr->live = gf_bs_read_int(bs, 1);
|
||||
ptr->update = gf_bs_read_int(bs, 1);
|
||||
ptr->reserved = gf_bs_read_int(bs, 4);
|
||||
ptr->time_scale = gf_bs_read_u32(bs);
|
||||
ptr->current_media_time = gf_bs_read_u64(bs);
|
||||
ptr->smpte_time_code_offset = gf_bs_read_u64(bs);
|
||||
i = 0;
|
||||
tmp_strsize = (u32)ptr->size - 8;
|
||||
while (tmp_strsize) {
|
||||
tmp_str[i] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[i])
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
if (i)
|
||||
ptr->movie_identifier = gf_strdup(tmp_str);
|
||||
|
||||
ptr->server_entry_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->server_entry_count; i++) {
|
||||
int j = 0;
|
||||
tmp_strsize = (u32)ptr->size - 8;
|
||||
while (tmp_strsize) {
|
||||
tmp_str[j] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[j])
|
||||
break;
|
||||
j++;
|
||||
}
|
||||
gf_list_insert(ptr->server_entry_table, gf_strdup(tmp_str), i);
|
||||
}
|
||||
|
||||
ptr->quality_entry_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
int j = 0;
|
||||
tmp_strsize = (u32)ptr->size - 8;
|
||||
while (tmp_strsize) {
|
||||
tmp_str[j] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[j])
|
||||
break;
|
||||
j++;
|
||||
}
|
||||
gf_list_insert(ptr->quality_entry_table, gf_strdup(tmp_str), i);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
tmp_strsize = (u32)ptr->size - 8;
|
||||
while (tmp_strsize) {
|
||||
tmp_str[i] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[i])
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
if (i)
|
||||
ptr->drm_data = gf_strdup(tmp_str);
|
||||
|
||||
i = 0;
|
||||
tmp_strsize = (u32)ptr->size - 8;
|
||||
while (tmp_strsize) {
|
||||
tmp_str[i] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[i])
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
if (i)
|
||||
ptr->meta_data = gf_strdup(tmp_str);
|
||||
|
||||
ptr->segment_run_table_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->segment_run_table_count; i++) {
|
||||
GF_AdobeSegmentRunTableBox *asrt;
|
||||
e = gf_isom_parse_box((GF_Box **)&asrt, bs);
|
||||
if (e) return e;
|
||||
gf_list_insert(ptr->segment_run_table_entries, asrt, i);
|
||||
}
|
||||
|
||||
ptr->fragment_run_table_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->fragment_run_table_count; i++) {
|
||||
GF_AdobeFragmentRunTableBox *afrt;
|
||||
e = gf_isom_parse_box((GF_Box **)&afrt, bs);
|
||||
if (e) return e;
|
||||
gf_list_insert(ptr->fragment_run_table_entries, afrt, i);
|
||||
}
|
||||
|
||||
gf_free(tmp_str);
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Box *abst_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_AdobeBootstrapInfoBox, GF_ISOM_BOX_TYPE_ABST);
|
||||
tmp->server_entry_table = gf_list_new();
|
||||
tmp->quality_entry_table = gf_list_new();
|
||||
tmp->segment_run_table_entries = gf_list_new();
|
||||
tmp->fragment_run_table_entries = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err abst_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
unsigned int i;
|
||||
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
gf_bs_write_u32(bs, ptr->bootstrapinfo_version);
|
||||
gf_bs_write_int(bs, ptr->profile, 2);
|
||||
gf_bs_write_int(bs, ptr->live, 1);
|
||||
gf_bs_write_int(bs, ptr->update, 1);
|
||||
gf_bs_write_int(bs, ptr->reserved, 4);
|
||||
gf_bs_write_u32(bs, ptr->time_scale);
|
||||
gf_bs_write_u64(bs, ptr->current_media_time);
|
||||
gf_bs_write_u64(bs, ptr->smpte_time_code_offset);
|
||||
if (ptr->movie_identifier)
|
||||
gf_bs_write_data(bs, ptr->movie_identifier, (u32)strlen(ptr->movie_identifier) + 1);
|
||||
else
|
||||
gf_bs_write_u8(bs, 0);
|
||||
|
||||
gf_bs_write_u8(bs, ptr->server_entry_count);
|
||||
for (i = 0; i<ptr->server_entry_count; i++) {
|
||||
char *str = (char*)gf_list_get(ptr->server_entry_table, i);
|
||||
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
|
||||
}
|
||||
|
||||
gf_bs_write_u8(bs, ptr->quality_entry_count);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
char *str = (char*)gf_list_get(ptr->quality_entry_table, i);
|
||||
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
|
||||
}
|
||||
|
||||
if (ptr->drm_data)
|
||||
gf_bs_write_data(bs, ptr->drm_data, (u32)strlen(ptr->drm_data) + 1);
|
||||
else
|
||||
gf_bs_write_u8(bs, 0);
|
||||
|
||||
if (ptr->meta_data)
|
||||
gf_bs_write_data(bs, ptr->meta_data, (u32)strlen(ptr->meta_data) + 1);
|
||||
else
|
||||
gf_bs_write_u8(bs, 0);
|
||||
|
||||
gf_bs_write_u8(bs, ptr->segment_run_table_count);
|
||||
for (i = 0; i<ptr->segment_run_table_count; i++) {
|
||||
e = gf_isom_box_write((GF_Box *)gf_list_get(ptr->segment_run_table_entries, i), bs);
|
||||
if (e) return e;
|
||||
}
|
||||
|
||||
gf_bs_write_u8(bs, ptr->fragment_run_table_count);
|
||||
for (i = 0; i<ptr->fragment_run_table_count; i++) {
|
||||
e = gf_isom_box_write((GF_Box *)gf_list_get(ptr->fragment_run_table_entries, i), bs);
|
||||
if (e) return e;
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err abst_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
int i;
|
||||
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
|
||||
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
s->size += 25
|
||||
+ (ptr->movie_identifier ? (strlen(ptr->movie_identifier) + 1) : 1)
|
||||
+ 1;
|
||||
|
||||
for (i = 0; i<ptr->server_entry_count; i++)
|
||||
s->size += strlen(gf_list_get(ptr->server_entry_table, i)) + 1;
|
||||
|
||||
s->size += 1;
|
||||
|
||||
for (i = 0; i<ptr->quality_entry_count; i++)
|
||||
s->size += strlen(gf_list_get(ptr->quality_entry_table, i)) + 1;
|
||||
|
||||
s->size += (ptr->drm_data ? (strlen(ptr->drm_data) + 1) : 1)
|
||||
+ (ptr->meta_data ? (strlen(ptr->meta_data) + 1) : 1)
|
||||
+ 1;
|
||||
|
||||
for (i = 0; i<ptr->segment_run_table_count; i++) {
|
||||
GF_Box *box = (GF_Box *)gf_list_get(ptr->segment_run_table_entries, i);
|
||||
e = gf_isom_box_size(box);
|
||||
if (e) return e;
|
||||
s->size += box->size;
|
||||
}
|
||||
|
||||
s->size += 1;
|
||||
for (i = 0; i<ptr->fragment_run_table_count; i++) {
|
||||
GF_Box *box = (GF_Box *)gf_list_get(ptr->fragment_run_table_entries, i);
|
||||
e = gf_isom_box_size(box);
|
||||
if (e) return e;
|
||||
s->size += box->size;
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
void afra_del(GF_Box *s)
|
||||
{
|
||||
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
|
||||
while (gf_list_count(ptr->local_access_entries)) {
|
||||
gf_free(gf_list_get(ptr->local_access_entries, 0));
|
||||
gf_list_rem(ptr->local_access_entries, 0);
|
||||
}
|
||||
gf_list_del(ptr->local_access_entries);
|
||||
|
||||
while (gf_list_count(ptr->global_access_entries)) {
|
||||
gf_free(gf_list_get(ptr->global_access_entries, 0));
|
||||
gf_list_rem(ptr->global_access_entries, 0);
|
||||
}
|
||||
gf_list_del(ptr->global_access_entries);
|
||||
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err afra_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
unsigned int i;
|
||||
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
|
||||
|
||||
GF_Err e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
ptr->long_ids = gf_bs_read_int(bs, 1);
|
||||
ptr->long_offsets = gf_bs_read_int(bs, 1);
|
||||
ptr->global_entries = gf_bs_read_int(bs, 1);
|
||||
ptr->reserved = gf_bs_read_int(bs, 5);
|
||||
ptr->time_scale = gf_bs_read_u32(bs);
|
||||
|
||||
ptr->entry_count = gf_bs_read_u32(bs);
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
GF_AfraEntry *ae = gf_malloc(sizeof(GF_AfraEntry));
|
||||
|
||||
ae->time = gf_bs_read_u64(bs);
|
||||
if (ptr->long_offsets)
|
||||
ae->offset = gf_bs_read_u64(bs);
|
||||
else
|
||||
ae->offset = gf_bs_read_u32(bs);
|
||||
|
||||
gf_list_insert(ptr->local_access_entries, ae, i);
|
||||
}
|
||||
|
||||
if (ptr->global_entries) {
|
||||
ptr->global_entry_count = gf_bs_read_u32(bs);
|
||||
for (i = 0; i<ptr->global_entry_count; i++) {
|
||||
GF_GlobalAfraEntry *ae = gf_malloc(sizeof(GF_GlobalAfraEntry));
|
||||
|
||||
ae->time = gf_bs_read_u64(bs);
|
||||
if (ptr->long_ids) {
|
||||
ae->segment = gf_bs_read_u32(bs);
|
||||
ae->fragment = gf_bs_read_u32(bs);
|
||||
}
|
||||
else {
|
||||
ae->segment = gf_bs_read_u16(bs);
|
||||
ae->fragment = gf_bs_read_u16(bs);
|
||||
}
|
||||
if (ptr->long_offsets) {
|
||||
ae->afra_offset = gf_bs_read_u64(bs);
|
||||
ae->offset_from_afra = gf_bs_read_u64(bs);
|
||||
}
|
||||
else {
|
||||
ae->afra_offset = gf_bs_read_u32(bs);
|
||||
ae->offset_from_afra = gf_bs_read_u32(bs);
|
||||
}
|
||||
|
||||
gf_list_insert(ptr->global_access_entries, ae, i);
|
||||
}
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Box *afra_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_AdobeFragRandomAccessBox, GF_ISOM_BOX_TYPE_AFRA);
|
||||
tmp->local_access_entries = gf_list_new();
|
||||
tmp->global_access_entries = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_Err afra_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
unsigned int i;
|
||||
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
gf_bs_write_int(bs, ptr->long_ids, 1);
|
||||
gf_bs_write_int(bs, ptr->long_offsets, 1);
|
||||
gf_bs_write_int(bs, ptr->global_entries, 1);
|
||||
gf_bs_write_int(bs, 0, 5);
|
||||
gf_bs_write_u32(bs, ptr->time_scale);
|
||||
|
||||
gf_bs_write_u32(bs, ptr->entry_count);
|
||||
for (i = 0; i<ptr->entry_count; i++) {
|
||||
GF_AfraEntry *ae = (GF_AfraEntry *)gf_list_get(ptr->local_access_entries, i);
|
||||
gf_bs_write_u64(bs, ae->time);
|
||||
if (ptr->long_offsets)
|
||||
gf_bs_write_u64(bs, ae->offset);
|
||||
else
|
||||
gf_bs_write_u32(bs, (u32)ae->offset);
|
||||
}
|
||||
|
||||
if (ptr->global_entries) {
|
||||
gf_bs_write_u32(bs, ptr->global_entry_count);
|
||||
for (i = 0; i<ptr->global_entry_count; i++) {
|
||||
GF_GlobalAfraEntry *gae = (GF_GlobalAfraEntry *)gf_list_get(ptr->global_access_entries, i);
|
||||
gf_bs_write_u64(bs, gae->time);
|
||||
if (ptr->long_ids) {
|
||||
gf_bs_write_u32(bs, gae->segment);
|
||||
gf_bs_write_u32(bs, gae->fragment);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u16(bs, (u16)gae->segment);
|
||||
gf_bs_write_u16(bs, (u16)gae->fragment);
|
||||
}
|
||||
if (ptr->long_offsets) {
|
||||
gf_bs_write_u64(bs, gae->afra_offset);
|
||||
gf_bs_write_u64(bs, gae->offset_from_afra);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u32(bs, (u32)gae->afra_offset);
|
||||
gf_bs_write_u32(bs, (u32)gae->offset_from_afra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
|
||||
GF_Err afra_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
|
||||
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
s->size += 9
|
||||
+ ptr->entry_count * (ptr->long_offsets ? 16 : 12)
|
||||
+ (ptr->global_entries ? 4 + ptr->global_entry_count * (4 + (ptr->long_offsets ? 16 : 8) + (ptr->long_ids ? 8 : 4)) : 0);
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
void asrt_del(GF_Box *s)
|
||||
{
|
||||
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
|
||||
while (gf_list_count(ptr->quality_segment_url_modifiers)) {
|
||||
gf_free(gf_list_get(ptr->quality_segment_url_modifiers, 0));
|
||||
gf_list_rem(ptr->quality_segment_url_modifiers, 0);
|
||||
}
|
||||
gf_list_del(ptr->quality_segment_url_modifiers);
|
||||
|
||||
while (gf_list_count(ptr->segment_run_entry_table)) {
|
||||
gf_free(gf_list_get(ptr->segment_run_entry_table, 0));
|
||||
gf_list_rem(ptr->segment_run_entry_table, 0);
|
||||
}
|
||||
gf_list_del(ptr->segment_run_entry_table);
|
||||
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err asrt_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
unsigned int i;
|
||||
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
|
||||
|
||||
GF_Err e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
ptr->quality_entry_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
int j = 0;
|
||||
u32 tmp_strsize = (u32)ptr->size - 8;
|
||||
char *tmp_str = (char*)gf_malloc(tmp_strsize);
|
||||
while (tmp_strsize) {
|
||||
tmp_str[j] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[j])
|
||||
break;
|
||||
j++;
|
||||
}
|
||||
gf_list_insert(ptr->quality_segment_url_modifiers, tmp_str, i);
|
||||
}
|
||||
|
||||
ptr->segment_run_entry_count = gf_bs_read_u32(bs);
|
||||
for (i = 0; i<ptr->segment_run_entry_count; i++) {
|
||||
GF_AdobeSegmentRunEntry *sre = gf_malloc(sizeof(GF_AdobeSegmentRunEntry));
|
||||
sre->first_segment = gf_bs_read_u32(bs);
|
||||
sre->fragment_per_segment = gf_bs_read_u32(bs);
|
||||
gf_list_insert(ptr->segment_run_entry_table, sre, i);
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Box *asrt_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_AdobeSegmentRunTableBox, GF_ISOM_BOX_TYPE_ASRT);
|
||||
tmp->quality_segment_url_modifiers = gf_list_new();
|
||||
tmp->segment_run_entry_table = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_Err asrt_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
unsigned int i;
|
||||
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
gf_bs_write_u8(bs, ptr->quality_entry_count);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
char *str = (char*)gf_list_get(ptr->quality_segment_url_modifiers, i);
|
||||
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
|
||||
}
|
||||
|
||||
gf_bs_write_u32(bs, ptr->segment_run_entry_count);
|
||||
for (i = 0; i<ptr->segment_run_entry_count; i++) {
|
||||
GF_AdobeSegmentRunEntry *sre = (GF_AdobeSegmentRunEntry *)gf_list_get(ptr->segment_run_entry_table, i);
|
||||
gf_bs_write_u32(bs, sre->first_segment);
|
||||
gf_bs_write_u32(bs, sre->fragment_per_segment);
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
|
||||
GF_Err asrt_Size(GF_Box *s)
|
||||
{
|
||||
int i;
|
||||
GF_Err e;
|
||||
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
|
||||
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
s->size += 5;
|
||||
|
||||
for (i = 0; i<ptr->quality_entry_count; i++)
|
||||
s->size += strlen(gf_list_get(ptr->quality_segment_url_modifiers, i)) + 1;
|
||||
|
||||
s->size += ptr->segment_run_entry_count * sizeof(GF_AdobeSegmentRunEntry);
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
void afrt_del(GF_Box *s)
|
||||
{
|
||||
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
|
||||
while (gf_list_count(ptr->quality_segment_url_modifiers)) {
|
||||
gf_free(gf_list_get(ptr->quality_segment_url_modifiers, 0));
|
||||
gf_list_rem(ptr->quality_segment_url_modifiers, 0);
|
||||
}
|
||||
gf_list_del(ptr->quality_segment_url_modifiers);
|
||||
|
||||
while (gf_list_count(ptr->fragment_run_entry_table)) {
|
||||
gf_free(gf_list_get(ptr->fragment_run_entry_table, 0));
|
||||
gf_list_rem(ptr->fragment_run_entry_table, 0);
|
||||
}
|
||||
gf_list_del(ptr->fragment_run_entry_table);
|
||||
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err afrt_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
unsigned int i;
|
||||
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
|
||||
|
||||
GF_Err e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
ptr->timescale = gf_bs_read_u32(bs);
|
||||
|
||||
ptr->quality_entry_count = gf_bs_read_u8(bs);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
int j = 0;
|
||||
u32 tmp_strsize = (u32)ptr->size - 8;
|
||||
char *tmp_str = (char*)gf_malloc(tmp_strsize);
|
||||
while (tmp_strsize) {
|
||||
tmp_str[j] = gf_bs_read_u8(bs);
|
||||
tmp_strsize--;
|
||||
if (!tmp_str[j])
|
||||
break;
|
||||
j++;
|
||||
}
|
||||
gf_list_insert(ptr->quality_segment_url_modifiers, tmp_str, i);
|
||||
}
|
||||
|
||||
ptr->fragment_run_entry_count = gf_bs_read_u32(bs);
|
||||
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
|
||||
GF_AdobeFragmentRunEntry *fre = gf_malloc(sizeof(GF_AdobeFragmentRunEntry));
|
||||
fre->first_fragment = gf_bs_read_u32(bs);
|
||||
fre->first_fragment_timestamp = gf_bs_read_u64(bs);
|
||||
fre->fragment_duration = gf_bs_read_u32(bs);
|
||||
if (!fre->fragment_duration)
|
||||
fre->discontinuity_indicator = gf_bs_read_u8(bs);
|
||||
gf_list_insert(ptr->fragment_run_entry_table, fre, i);
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Box *afrt_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_AdobeFragmentRunTableBox, GF_ISOM_BOX_TYPE_AFRT);
|
||||
tmp->quality_segment_url_modifiers = gf_list_new();
|
||||
tmp->fragment_run_entry_table = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_Err afrt_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
unsigned int i;
|
||||
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
gf_bs_write_u32(bs, ptr->timescale);
|
||||
gf_bs_write_u8(bs, ptr->quality_entry_count);
|
||||
for (i = 0; i<ptr->quality_entry_count; i++) {
|
||||
char *str = (char*)gf_list_get(ptr->quality_segment_url_modifiers, i);
|
||||
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
|
||||
}
|
||||
|
||||
gf_bs_write_u32(bs, ptr->fragment_run_entry_count);
|
||||
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
|
||||
GF_AdobeFragmentRunEntry *fre = (GF_AdobeFragmentRunEntry *)gf_list_get(ptr->fragment_run_entry_table, i);
|
||||
gf_bs_write_u32(bs, fre->first_fragment);
|
||||
gf_bs_write_u64(bs, fre->first_fragment_timestamp);
|
||||
gf_bs_write_u32(bs, fre->fragment_duration);
|
||||
if (!fre->fragment_duration)
|
||||
gf_bs_write_u8(bs, fre->discontinuity_indicator);
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
|
||||
GF_Err afrt_Size(GF_Box *s)
|
||||
{
|
||||
u32 i;
|
||||
GF_Err e;
|
||||
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
|
||||
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
s->size += 5;
|
||||
|
||||
for (i = 0; i<ptr->quality_entry_count; i++)
|
||||
s->size += strlen(gf_list_get(ptr->quality_segment_url_modifiers, i)) + 1;
|
||||
|
||||
s->size += 4;
|
||||
|
||||
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
|
||||
GF_AdobeFragmentRunEntry *fre = (GF_AdobeFragmentRunEntry *)gf_list_get(ptr->fragment_run_entry_table, i);
|
||||
if (fre->fragment_duration)
|
||||
s->size += 16;
|
||||
else
|
||||
s->size += 17;
|
||||
}
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_FRAGMENTS*/
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM*/
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_ADOBE*/
|
||||
@@ -1,11 +1,26 @@
|
||||
/*
|
||||
Author: Andrew Voznytsa <av@polynet.lviv.ua>
|
||||
|
||||
Project: GPAC - Multimedia Framework C SDK
|
||||
Module: ISO Media File Format sub-project
|
||||
|
||||
Copyright: (c) 2006, Andrew Voznytsa
|
||||
License: see License.txt in the top level directory.
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2006-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
@@ -16,7 +31,6 @@ void ilst_del(GF_Box *s)
|
||||
{
|
||||
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_box_array_del(ptr->tags);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
@@ -34,8 +48,9 @@ GF_Err ilst_Read(GF_Box *s, GF_BitStream *bs)
|
||||
if (e) return e;
|
||||
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
|
||||
ptr->size -= a->size;
|
||||
gf_list_add(ptr->tags, a);
|
||||
} else {
|
||||
gf_list_add(ptr->other_boxes, a);
|
||||
}
|
||||
else {
|
||||
gf_bs_read_u32(bs);
|
||||
ptr->size -= 4;
|
||||
}
|
||||
@@ -45,11 +60,8 @@ GF_Err ilst_Read(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
GF_Box *ilst_New()
|
||||
{
|
||||
GF_ItemListBox *tmp = (GF_ItemListBox *) gf_malloc(sizeof(GF_ItemListBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ItemListBox));
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ILST;
|
||||
tmp->tags = gf_list_new();
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemListBox, GF_ISOM_BOX_TYPE_ILST);
|
||||
tmp->other_boxes = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -58,31 +70,31 @@ GF_Box *ilst_New()
|
||||
GF_Err ilst_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
|
||||
// GF_ItemListBox *ptr = (GF_ItemListBox *)s;
|
||||
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
return gf_isom_box_array_write(s, ptr->tags, bs);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
|
||||
GF_Err ilst_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
|
||||
|
||||
// GF_ItemListBox *ptr = (GF_ItemListBox *)s;
|
||||
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
return gf_isom_box_array_size(s, ptr->tags);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
void ListItem_del(GF_Box *s)
|
||||
{
|
||||
GF_ListItemBox *ptr = (GF_ListItemBox *) s;
|
||||
GF_ListItemBox *ptr = (GF_ListItemBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->data != NULL) {
|
||||
if (ptr->data->data) gf_free(ptr->data->data);
|
||||
@@ -91,7 +103,7 @@ void ListItem_del(GF_Box *s)
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
|
||||
GF_Err ListItem_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 sub_type;
|
||||
@@ -100,13 +112,13 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
|
||||
|
||||
/*iTunes way: there's a data atom containing the data*/
|
||||
sub_type = gf_bs_peek_bits(bs, 32, 4);
|
||||
if (sub_type == GF_ISOM_BOX_TYPE_DATA ) {
|
||||
if (sub_type == GF_ISOM_BOX_TYPE_DATA) {
|
||||
e = gf_isom_parse_box(&a, bs);
|
||||
if (e) return e;
|
||||
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
|
||||
ptr->size -= a->size;
|
||||
|
||||
if (a && ptr->data) gf_isom_box_del((GF_Box *) ptr->data);
|
||||
if (a && ptr->data) gf_isom_box_del((GF_Box *)ptr->data);
|
||||
ptr->data = (GF_DataBox *)a;
|
||||
}
|
||||
/*QT way*/
|
||||
@@ -114,7 +126,7 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
|
||||
ptr->data->type = 0;
|
||||
ptr->data->dataSize = gf_bs_read_u16(bs);
|
||||
gf_bs_read_u16(bs);
|
||||
ptr->data->data = (char *) gf_malloc(sizeof(char)*(ptr->data->dataSize + 1));
|
||||
ptr->data->data = (char *)gf_malloc(sizeof(char)*(ptr->data->dataSize + 1));
|
||||
gf_bs_read_data(bs, ptr->data->data, ptr->data->dataSize);
|
||||
ptr->data->data[ptr->data->dataSize] = 0;
|
||||
ptr->size -= ptr->data->dataSize;
|
||||
@@ -124,17 +136,11 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
|
||||
|
||||
GF_Box *ListItem_New(u32 type)
|
||||
{
|
||||
GF_ListItemBox *tmp;
|
||||
|
||||
tmp = (GF_ListItemBox *) gf_malloc(sizeof(GF_ListItemBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ListItemBox));
|
||||
|
||||
tmp->type = type;
|
||||
ISOM_DECL_BOX_ALLOC(GF_ListItemBox, type);
|
||||
|
||||
tmp->data = (GF_DataBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_DATA);
|
||||
|
||||
if (tmp->data == NULL){
|
||||
if (tmp->data == NULL) {
|
||||
gf_free(tmp);
|
||||
return NULL;
|
||||
}
|
||||
@@ -147,13 +153,13 @@ GF_Box *ListItem_New(u32 type)
|
||||
GF_Err ListItem_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ListItemBox *ptr = (GF_ListItemBox *) s;
|
||||
GF_ListItemBox *ptr = (GF_ListItemBox *)s;
|
||||
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
/*iTune way*/
|
||||
if (ptr->data->type) return gf_isom_box_write((GF_Box* )ptr->data, bs);
|
||||
if (ptr->data->type) return gf_isom_box_write((GF_Box*)ptr->data, bs);
|
||||
/*QT way*/
|
||||
gf_bs_write_u16(bs, ptr->data->dataSize);
|
||||
gf_bs_write_u16(bs, 0);
|
||||
@@ -176,7 +182,7 @@ GF_Err ListItem_Size(GF_Box *s)
|
||||
ptr->size += ptr->data->size;
|
||||
}
|
||||
/*QT way*/
|
||||
else {
|
||||
else if (ptr->data) {
|
||||
ptr->size += ptr->data->dataSize + 4;
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -186,7 +192,7 @@ GF_Err ListItem_Size(GF_Box *s)
|
||||
|
||||
void data_del(GF_Box *s)
|
||||
{
|
||||
GF_DataBox *ptr = (GF_DataBox *) s;
|
||||
GF_DataBox *ptr = (GF_DataBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->data)
|
||||
gf_free(ptr->data);
|
||||
@@ -194,7 +200,7 @@ void data_del(GF_Box *s)
|
||||
|
||||
}
|
||||
|
||||
GF_Err data_Read(GF_Box *s,GF_BitStream *bs)
|
||||
GF_Err data_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_DataBox *ptr = (GF_DataBox *)s;
|
||||
@@ -204,26 +210,21 @@ GF_Err data_Read(GF_Box *s,GF_BitStream *bs)
|
||||
ptr->reserved = gf_bs_read_int(bs, 32);
|
||||
ptr->size -= 4;
|
||||
if (ptr->size) {
|
||||
ptr->dataSize = (u32) ptr->size;
|
||||
ptr->dataSize = (u32)ptr->size;
|
||||
ptr->data = (char*)gf_malloc(ptr->dataSize * sizeof(ptr->data[0]) + 1);
|
||||
if (ptr->data == NULL) return GF_OUT_OF_MEM;
|
||||
ptr->data[ptr->dataSize] = 0;
|
||||
gf_bs_read_data(bs, ptr->data, ptr->dataSize);
|
||||
}
|
||||
|
||||
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Box *data_New()
|
||||
{
|
||||
GF_DataBox *tmp;
|
||||
|
||||
tmp = (GF_DataBox *) gf_malloc(sizeof(GF_DataBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_DataBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_DataBox, GF_ISOM_BOX_TYPE_DATA);
|
||||
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_DATA;
|
||||
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
@@ -233,12 +234,12 @@ GF_Box *data_New()
|
||||
GF_Err data_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_DataBox *ptr = (GF_DataBox *) s;
|
||||
GF_DataBox *ptr = (GF_DataBox *)s;
|
||||
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_int(bs, ptr->reserved, 32);
|
||||
if(ptr->data != NULL && ptr->dataSize > 0){
|
||||
if (ptr->data != NULL && ptr->dataSize > 0) {
|
||||
gf_bs_write_data(bs, ptr->data, ptr->dataSize);
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -251,7 +252,7 @@ GF_Err data_Size(GF_Box *s)
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 4;
|
||||
if(ptr->data != NULL && ptr->dataSize > 0){
|
||||
if (ptr->data != NULL && ptr->dataSize > 0) {
|
||||
ptr->size += ptr->dataSize;
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -271,10 +272,10 @@ GF_MetaBox *gf_isom_apple_get_meta_extensions(GF_ISOFile *mov)
|
||||
map = udta_getEntry(mov->moov->udta, GF_ISOM_BOX_TYPE_META, NULL);
|
||||
if (!map) return NULL;
|
||||
|
||||
for(i = 0; i < gf_list_count(map->boxList); i++){
|
||||
meta = (GF_MetaBox*)gf_list_get(map->boxList, i);
|
||||
for (i = 0; i < gf_list_count(map->other_boxes); i++) {
|
||||
meta = (GF_MetaBox*)gf_list_get(map->other_boxes, i);
|
||||
|
||||
if(meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
|
||||
if (meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -290,29 +291,30 @@ GF_MetaBox *gf_isom_apple_create_meta_extensions(GF_ISOFile *mov)
|
||||
|
||||
if (!mov || !mov->moov) return NULL;
|
||||
|
||||
if (!mov->moov->udta){
|
||||
if (!mov->moov->udta) {
|
||||
e = moov_AddBox((GF_Box*)mov->moov, gf_isom_box_new(GF_ISOM_BOX_TYPE_UDTA));
|
||||
if (e) return NULL;
|
||||
}
|
||||
|
||||
map = udta_getEntry(mov->moov->udta, GF_ISOM_BOX_TYPE_META, NULL);
|
||||
if (map){
|
||||
for(i = 0; i < gf_list_count(map->boxList); i++){
|
||||
meta = (GF_MetaBox*)gf_list_get(map->boxList, i);
|
||||
if (map) {
|
||||
for (i = 0; i < gf_list_count(map->other_boxes); i++) {
|
||||
meta = (GF_MetaBox*)gf_list_get(map->other_boxes, i);
|
||||
|
||||
if(meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
|
||||
if (meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
|
||||
}
|
||||
}
|
||||
|
||||
meta = (GF_MetaBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_META);
|
||||
|
||||
if(meta != NULL){
|
||||
if (meta != NULL) {
|
||||
meta->handler = (GF_HandlerBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_HDLR);
|
||||
if(meta->handler == NULL){
|
||||
if (meta->handler == NULL) {
|
||||
gf_isom_box_del((GF_Box *)meta);
|
||||
return NULL;
|
||||
}
|
||||
meta->handler->handlerType = GF_ISOM_HANDLER_TYPE_MDIR;
|
||||
if (!meta->other_boxes) meta->other_boxes = gf_list_new();
|
||||
gf_list_add(meta->other_boxes, gf_isom_box_new(GF_ISOM_BOX_TYPE_ILST));
|
||||
udta_AddBox(mov->moov->udta, (GF_Box *)meta);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1961
src/gpacmp4/box_code_drm.c
Normal file
1961
src/gpacmp4/box_code_drm.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,889 +0,0 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Cyril Concolato 2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM
|
||||
|
||||
/* ProtectionInfo Box */
|
||||
GF_Box *sinf_New()
|
||||
{
|
||||
GF_ProtectionInfoBox *tmp = (GF_ProtectionInfoBox *) gf_malloc(sizeof(GF_ProtectionInfoBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ProtectionInfoBox));
|
||||
tmp->type = GF_ISOM_BOX_TYPE_SINF;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void sinf_del(GF_Box *s)
|
||||
{
|
||||
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->original_format) gf_isom_box_del((GF_Box *)ptr->original_format);
|
||||
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
|
||||
if (ptr->scheme_type) gf_isom_box_del((GF_Box *)ptr->scheme_type);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err sinf_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
|
||||
switch (a->type) {
|
||||
case GF_ISOM_BOX_TYPE_FRMA:
|
||||
if (ptr->original_format) return GF_ISOM_INVALID_FILE;
|
||||
ptr->original_format = (GF_OriginalFormatBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_SCHM:
|
||||
if (ptr->scheme_type) return GF_ISOM_INVALID_FILE;
|
||||
ptr->scheme_type = (GF_SchemeTypeBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_SCHI:
|
||||
if (ptr->info) return GF_ISOM_INVALID_FILE;
|
||||
ptr->info = (GF_SchemeInformationBox*)a;
|
||||
break;
|
||||
default:
|
||||
gf_isom_box_del(a);
|
||||
break;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err sinf_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
return gf_isom_read_box_list(s, bs, sinf_AddBox);
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err sinf_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
//frma
|
||||
e = gf_isom_box_write((GF_Box *) ptr->original_format, bs);
|
||||
if (e) return e;
|
||||
// schm
|
||||
e = gf_isom_box_write((GF_Box *) ptr->scheme_type, bs);
|
||||
if (e) return e;
|
||||
// schi
|
||||
e = gf_isom_box_write((GF_Box *) ptr->info, bs);
|
||||
if (e) return e;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err sinf_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
e = gf_isom_box_size((GF_Box *) ptr->original_format);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->original_format->size;
|
||||
e = gf_isom_box_size((GF_Box *) ptr->scheme_type);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->scheme_type->size;
|
||||
e = gf_isom_box_size((GF_Box *) ptr->info);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->info->size;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
/* OriginalFormat Box */
|
||||
GF_Box *frma_New()
|
||||
{
|
||||
GF_OriginalFormatBox *tmp = (GF_OriginalFormatBox *) gf_malloc(sizeof(GF_OriginalFormatBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_OriginalFormatBox));
|
||||
tmp->type = GF_ISOM_BOX_TYPE_FRMA;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void frma_del(GF_Box *s)
|
||||
{
|
||||
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err frma_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
|
||||
ptr->data_format = gf_bs_read_u32(bs);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err frma_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_u32(bs, ptr->data_format);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err frma_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 4;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
/* SchemeType Box */
|
||||
GF_Box *schm_New()
|
||||
{
|
||||
GF_SchemeTypeBox *tmp = (GF_SchemeTypeBox *) gf_malloc(sizeof(GF_SchemeTypeBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_SchemeTypeBox));
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_SCHM;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void schm_del(GF_Box *s)
|
||||
{
|
||||
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->URI) gf_free(ptr->URI);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err schm_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *)s;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
ptr->scheme_type = gf_bs_read_u32(bs);
|
||||
ptr->scheme_version = gf_bs_read_u32(bs);
|
||||
ptr->size -= 8;
|
||||
if (ptr->size && (ptr->flags & 0x000001)) {
|
||||
u32 len = (u32) (ptr->size);
|
||||
ptr->URI = (char*)gf_malloc(sizeof(char)*len);
|
||||
if (!ptr->URI) return GF_OUT_OF_MEM;
|
||||
gf_bs_read_data(bs, ptr->URI, len);
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err schm_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *) s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
assert(e == GF_OK);
|
||||
gf_bs_write_u32(bs, ptr->scheme_type);
|
||||
gf_bs_write_u32(bs, ptr->scheme_version);
|
||||
if (ptr->flags & 0x000001) gf_bs_write_data(bs, ptr->URI, strlen(ptr->URI)+1);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err schm_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *) s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 8;
|
||||
if (ptr->flags & 0x000001) ptr->size += strlen(ptr->URI)+1;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
/* SchemeInformation Box */
|
||||
GF_Box *schi_New()
|
||||
{
|
||||
GF_SchemeInformationBox *tmp = (GF_SchemeInformationBox *) gf_malloc(sizeof(GF_SchemeInformationBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_SchemeInformationBox));
|
||||
tmp->type = GF_ISOM_BOX_TYPE_SCHI;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void schi_del(GF_Box *s)
|
||||
{
|
||||
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->ikms) gf_isom_box_del((GF_Box *)ptr->ikms);
|
||||
if (ptr->isfm) gf_isom_box_del((GF_Box *)ptr->isfm);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err schi_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
|
||||
switch (a->type) {
|
||||
case GF_ISOM_BOX_TYPE_IKMS:
|
||||
if (ptr->ikms) return GF_ISOM_INVALID_FILE;
|
||||
ptr->ikms = (GF_ISMAKMSBox*)a;
|
||||
return GF_OK;
|
||||
case GF_ISOM_BOX_TYPE_ISFM:
|
||||
if (ptr->isfm) return GF_ISOM_INVALID_FILE;
|
||||
ptr->isfm = (GF_ISMASampleFormatBox*)a;
|
||||
return GF_OK;
|
||||
case GF_ISOM_BOX_TYPE_ODKM:
|
||||
if (ptr->okms) return GF_ISOM_INVALID_FILE;
|
||||
ptr->okms = (GF_OMADRMKMSBox*)a;
|
||||
return GF_OK;
|
||||
default:
|
||||
gf_isom_box_del(a);
|
||||
return GF_OK;
|
||||
}
|
||||
}
|
||||
|
||||
GF_Err schi_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
return gf_isom_read_box_list(s, bs, schi_AddBox);
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err schi_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
if (ptr->ikms) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->ikms, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->isfm) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->isfm, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->okms) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->okms, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err schi_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
if (ptr->ikms) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->ikms);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->ikms->size;
|
||||
}
|
||||
if (ptr->isfm) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->isfm);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->isfm->size;
|
||||
}
|
||||
if (ptr->okms) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->okms);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->okms->size;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
/* ISMAKMS Box */
|
||||
GF_Box *iKMS_New()
|
||||
{
|
||||
GF_ISMAKMSBox *tmp = (GF_ISMAKMSBox *) gf_malloc(sizeof(GF_ISMAKMSBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ISMAKMSBox));
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_IKMS;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void iKMS_del(GF_Box *s)
|
||||
{
|
||||
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->URI) gf_free(ptr->URI);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err iKMS_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 len;
|
||||
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
|
||||
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
len = (u32) (ptr->size);
|
||||
ptr->URI = (char*) gf_malloc(sizeof(char)*len);
|
||||
if (!ptr->URI) return GF_OUT_OF_MEM;
|
||||
gf_bs_read_data(bs, ptr->URI, len);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err iKMS_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_data(bs, ptr->URI, strlen(ptr->URI)+1);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err iKMS_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += strlen(ptr->URI)+1;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
/* ISMASampleFormat Box */
|
||||
GF_Box *iSFM_New()
|
||||
{
|
||||
GF_ISMASampleFormatBox *tmp = (GF_ISMASampleFormatBox *) gf_malloc(sizeof(GF_ISMASampleFormatBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ISMASampleFormatBox));
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ISFM;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void iSFM_del(GF_Box *s)
|
||||
{
|
||||
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
|
||||
GF_Err iSFM_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
ptr->selective_encryption = gf_bs_read_int(bs, 1);
|
||||
gf_bs_read_int(bs, 7);
|
||||
ptr->key_indicator_length = gf_bs_read_u8(bs);
|
||||
ptr->IV_length = gf_bs_read_u8(bs);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err iSFM_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_int(bs, ptr->selective_encryption, 1);
|
||||
gf_bs_write_int(bs, 0, 7);
|
||||
gf_bs_write_u8(bs, ptr->key_indicator_length);
|
||||
gf_bs_write_u8(bs, ptr->IV_length);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err iSFM_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 3;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
|
||||
/* OMADRMCommonHeader Box */
|
||||
GF_Box *ohdr_New()
|
||||
{
|
||||
GF_OMADRMCommonHeaderBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMCommonHeaderBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_OHDR;
|
||||
tmp->ExtendedHeaders = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void ohdr_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_box_array_del(ptr->ExtendedHeaders);
|
||||
if (ptr->ContentID) gf_free(ptr->ContentID);
|
||||
if (ptr->RightsIssuerURL) gf_free(ptr->RightsIssuerURL);
|
||||
if (ptr->TextualHeaders) gf_free(ptr->TextualHeaders);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err ohdr_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
|
||||
return gf_list_add(ptr->ExtendedHeaders, a);
|
||||
}
|
||||
|
||||
GF_Err ohdr_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
u16 cid_len, ri_len;
|
||||
GF_Err e;
|
||||
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
ptr->EncryptionMethod = gf_bs_read_u8(bs);
|
||||
ptr->PaddingScheme = gf_bs_read_u8(bs);
|
||||
ptr->PlaintextLength = gf_bs_read_u64(bs);
|
||||
cid_len = gf_bs_read_u16(bs);
|
||||
ri_len = gf_bs_read_u16(bs);
|
||||
ptr->TextualHeadersLen = gf_bs_read_u16(bs);
|
||||
ptr->size -= 1+1+8+2+2+2;
|
||||
if (ptr->size<cid_len+ri_len+ptr->TextualHeadersLen) return GF_ISOM_INVALID_FILE;
|
||||
|
||||
if (cid_len) {
|
||||
ptr->ContentID = (char *)gf_malloc(sizeof(char)*(cid_len+1));
|
||||
gf_bs_read_data(bs, ptr->ContentID, cid_len);
|
||||
ptr->ContentID[cid_len]=0;
|
||||
}
|
||||
|
||||
if (ri_len) {
|
||||
ptr->RightsIssuerURL = (char *)gf_malloc(sizeof(char)*(ri_len+1));
|
||||
gf_bs_read_data(bs, ptr->RightsIssuerURL, ri_len);
|
||||
ptr->RightsIssuerURL[ri_len]=0;
|
||||
}
|
||||
|
||||
if (ptr->TextualHeadersLen) {
|
||||
ptr->TextualHeaders = (char *)gf_malloc(sizeof(char)*(ptr->TextualHeadersLen+1));
|
||||
gf_bs_read_data(bs, ptr->TextualHeaders, ptr->TextualHeadersLen);
|
||||
ptr->TextualHeaders[ptr->TextualHeadersLen] = 0;
|
||||
}
|
||||
|
||||
ptr->size -= cid_len+ri_len+ptr->TextualHeadersLen;
|
||||
|
||||
return gf_isom_read_box_list(s, bs, ohdr_AddBox);
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err ohdr_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
u16 cid_len, ri_len;
|
||||
GF_Err e;
|
||||
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_u8(bs, ptr->EncryptionMethod);
|
||||
gf_bs_write_u8(bs, ptr->PaddingScheme);
|
||||
gf_bs_write_u64(bs, ptr->PlaintextLength);
|
||||
|
||||
cid_len = ptr->ContentID ? strlen(ptr->ContentID) : 0;
|
||||
gf_bs_write_u16(bs, cid_len);
|
||||
ri_len = ptr->RightsIssuerURL ? strlen(ptr->RightsIssuerURL) : 0;
|
||||
gf_bs_write_u16(bs, ri_len);
|
||||
gf_bs_write_u16(bs, ptr->TextualHeadersLen);
|
||||
|
||||
if (cid_len) gf_bs_write_data(bs, ptr->ContentID, strlen(ptr->ContentID));
|
||||
if (ri_len) gf_bs_write_data(bs, ptr->RightsIssuerURL, strlen(ptr->RightsIssuerURL));
|
||||
if (ptr->TextualHeadersLen) gf_bs_write_data(bs, ptr->TextualHeaders, ptr->TextualHeadersLen);
|
||||
ptr->size -= cid_len+ri_len+ptr->TextualHeadersLen;
|
||||
return gf_isom_box_array_write(s, ptr->ExtendedHeaders, bs);
|
||||
}
|
||||
|
||||
GF_Err ohdr_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 1+1+8+2+2+2;
|
||||
if (ptr->ContentID) ptr->size += strlen(ptr->ContentID);
|
||||
if (ptr->RightsIssuerURL) ptr->size += strlen(ptr->RightsIssuerURL);
|
||||
if (ptr->TextualHeadersLen) ptr->size += ptr->TextualHeadersLen;
|
||||
return gf_isom_box_array_size(s, ptr->ExtendedHeaders);
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
/* OMADRMGroupID Box */
|
||||
GF_Box *grpi_New()
|
||||
{
|
||||
GF_OMADRMGroupIDBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMGroupIDBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_GRPI;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void grpi_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
if (ptr->GroupID) gf_free(ptr->GroupID);
|
||||
if (ptr->GroupKey) gf_free(ptr->GroupKey);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err grpi_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
u16 gid_len;
|
||||
GF_Err e;
|
||||
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox*)s;
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
gid_len = gf_bs_read_u16(bs);
|
||||
ptr->GKEncryptionMethod = gf_bs_read_u8(bs);
|
||||
ptr->GKLength = gf_bs_read_u16(bs);
|
||||
|
||||
ptr->size -= 1+2+2;
|
||||
if (ptr->size<gid_len+ptr->GKLength) return GF_ISOM_INVALID_FILE;
|
||||
|
||||
ptr->GroupID = (char *) gf_malloc(sizeof(char)*(gid_len+1));
|
||||
gf_bs_read_data(bs, ptr->GroupID, gid_len);
|
||||
ptr->GroupID[gid_len]=0;
|
||||
|
||||
ptr->GroupKey = (char *)gf_malloc(sizeof(char)*ptr->GKLength);
|
||||
gf_bs_read_data(bs, ptr->GroupKey, ptr->GKLength);
|
||||
ptr->size -= gid_len+ptr->GKLength;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err grpi_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u16 gid_len;
|
||||
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gid_len = ptr->GroupID ? strlen(ptr->GroupID) : 0;
|
||||
gf_bs_write_u16(bs, gid_len);
|
||||
gf_bs_write_u8(bs, ptr->GKEncryptionMethod);
|
||||
gf_bs_write_u16(bs, ptr->GKLength);
|
||||
gf_bs_write_data(bs, ptr->GroupID, gid_len);
|
||||
gf_bs_write_data(bs, ptr->GroupKey, ptr->GKLength);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err grpi_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 2+2+1 + ptr->GKLength;
|
||||
if (ptr->GroupID) ptr->size += strlen(ptr->GroupID);
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* OMADRMMutableInformation Box */
|
||||
GF_Box *mdri_New()
|
||||
{
|
||||
GF_OMADRMMutableInformationBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMMutableInformationBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
tmp->type = GF_ISOM_BOX_TYPE_MDRI;
|
||||
tmp->boxes = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void mdri_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMMutableInformationBox*ptr = (GF_OMADRMMutableInformationBox*)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_box_array_del(ptr->boxes);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err mdri_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_OMADRMMutableInformationBox *ptr = (GF_OMADRMMutableInformationBox *)s;
|
||||
return gf_list_add(ptr->boxes, a);
|
||||
}
|
||||
|
||||
GF_Err mdri_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
return gf_isom_read_box_list(s, bs, mdri_AddBox);
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err mdri_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_OMADRMMutableInformationBox*ptr = (GF_OMADRMMutableInformationBox*)s;
|
||||
GF_Err e = gf_isom_box_write_header(s, bs);
|
||||
if (e) return e;
|
||||
return gf_isom_box_array_write(s, ptr->boxes, bs);
|
||||
}
|
||||
|
||||
GF_Err mdri_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMMutableInformationBox *ptr = (GF_OMADRMMutableInformationBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
|
||||
return gf_isom_box_array_size(s, ptr->boxes);
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
/* OMADRMTransactionTracking Box */
|
||||
GF_Box *odtt_New()
|
||||
{
|
||||
GF_OMADRMTransactionTrackingBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMTransactionTrackingBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ODTT;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void odtt_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox*)s;
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err odtt_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox *)s;
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_read_data(bs, ptr->TransactionID, 16);
|
||||
ptr->size -= 16;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err odtt_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox*)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_data(bs, ptr->TransactionID, 16);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err odtt_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
s->size += 16;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
|
||||
/* OMADRMRightsObject Box */
|
||||
GF_Box *odrb_New()
|
||||
{
|
||||
GF_OMADRMRightsObjectBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMRightsObjectBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ODRB;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void odrb_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox*)s;
|
||||
if (ptr->oma_ro) gf_free(ptr->oma_ro);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err odrb_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
ptr->oma_ro_size = (u32) ptr->size;
|
||||
ptr->oma_ro = (char*) gf_malloc(sizeof(char)*ptr->oma_ro_size);
|
||||
gf_bs_read_data(bs, ptr->oma_ro, ptr->oma_ro_size);
|
||||
ptr->size = 0;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err odrb_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_data(bs, ptr->oma_ro, ptr->oma_ro_size);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err odrb_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
s->size += ptr->oma_ro_size;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* OMADRMKMS Box */
|
||||
GF_Box *odkm_New()
|
||||
{
|
||||
GF_OMADRMKMSBox *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_OMADRMKMSBox);
|
||||
if (tmp == NULL) return NULL;
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ODKM;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void odkm_del(GF_Box *s)
|
||||
{
|
||||
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
|
||||
if (ptr->hdr) gf_isom_box_del((GF_Box*)ptr->hdr);
|
||||
if (ptr->fmt) gf_isom_box_del((GF_Box*)ptr->fmt);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err odkm_Add(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
|
||||
switch (a->type) {
|
||||
case GF_ISOM_BOX_TYPE_OHDR:
|
||||
if (ptr->hdr) gf_isom_box_del((GF_Box*)ptr->hdr);
|
||||
ptr->hdr = (GF_OMADRMCommonHeaderBox *)a;
|
||||
return GF_OK;
|
||||
case GF_ISOM_BOX_TYPE_ODAF:
|
||||
if (ptr->fmt) gf_isom_box_del((GF_Box*)ptr->fmt);
|
||||
ptr->fmt = (GF_OMADRMAUFormatBox*)a;
|
||||
return GF_OK;
|
||||
default:
|
||||
gf_isom_box_del(a);
|
||||
return GF_OK;
|
||||
}
|
||||
}
|
||||
|
||||
GF_Err odkm_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
if (s == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
return gf_isom_read_box_list(s, bs, odkm_Add);
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err odkm_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
if (ptr->hdr) {
|
||||
e = gf_isom_box_write((GF_Box*)ptr->hdr, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->fmt) {
|
||||
e = gf_isom_box_write((GF_Box*)ptr->fmt, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err odkm_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
if (ptr->hdr) {
|
||||
e = gf_isom_box_size((GF_Box*)ptr->hdr);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->hdr->size;
|
||||
}
|
||||
if (ptr->fmt) {
|
||||
e = gf_isom_box_size((GF_Box*)ptr->fmt);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->fmt->size;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM*/
|
||||
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Cyril Concolato / Jean Le Feuvre 2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Cyril Concolato / Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2005-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
|
||||
@@ -28,18 +29,14 @@
|
||||
|
||||
GF_Box *meta_New()
|
||||
{
|
||||
GF_MetaBox *tmp = (GF_MetaBox *) gf_malloc(sizeof(GF_MetaBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_MetaBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_MetaBox, GF_ISOM_BOX_TYPE_META);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_META;
|
||||
tmp->other_boxes = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void meta_del(GF_Box *s)
|
||||
{
|
||||
u32 count, i;
|
||||
GF_MetaBox *ptr = (GF_MetaBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
gf_isom_box_del((GF_Box *)ptr->handler);
|
||||
@@ -49,12 +46,8 @@ void meta_del(GF_Box *s)
|
||||
if (ptr->protections) gf_isom_box_del((GF_Box *)ptr->protections);
|
||||
if (ptr->item_infos) gf_isom_box_del((GF_Box *)ptr->item_infos);
|
||||
if (ptr->IPMP_control) gf_isom_box_del((GF_Box *)ptr->IPMP_control);
|
||||
count = gf_list_count(ptr->other_boxes);
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
|
||||
gf_isom_box_del(a);
|
||||
}
|
||||
gf_list_del(ptr->other_boxes);
|
||||
if (ptr->item_refs) gf_isom_box_del((GF_Box *)ptr->item_refs);
|
||||
if (ptr->item_props) gf_isom_box_del((GF_Box *)ptr->item_props);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
@@ -62,38 +55,44 @@ GF_Err meta_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_MetaBox *ptr = (GF_MetaBox *)s;
|
||||
switch (a->type) {
|
||||
case GF_ISOM_BOX_TYPE_HDLR:
|
||||
case GF_ISOM_BOX_TYPE_HDLR:
|
||||
if (ptr->handler) return GF_ISOM_INVALID_FILE;
|
||||
ptr->handler = (GF_HandlerBox*)a;
|
||||
ptr->handler = (GF_HandlerBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_PITM:
|
||||
case GF_ISOM_BOX_TYPE_PITM:
|
||||
if (ptr->primary_resource) return GF_ISOM_INVALID_FILE;
|
||||
ptr->primary_resource = (GF_PrimaryItemBox*)a;
|
||||
ptr->primary_resource = (GF_PrimaryItemBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_DINF:
|
||||
case GF_ISOM_BOX_TYPE_DINF:
|
||||
if (ptr->file_locations) return GF_ISOM_INVALID_FILE;
|
||||
ptr->file_locations = (GF_DataInformationBox*)a;
|
||||
ptr->file_locations = (GF_DataInformationBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_ILOC:
|
||||
case GF_ISOM_BOX_TYPE_ILOC:
|
||||
if (ptr->item_locations) return GF_ISOM_INVALID_FILE;
|
||||
ptr->item_locations = (GF_ItemLocationBox*)a;
|
||||
ptr->item_locations = (GF_ItemLocationBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_IPRO:
|
||||
case GF_ISOM_BOX_TYPE_IPRO:
|
||||
if (ptr->protections) return GF_ISOM_INVALID_FILE;
|
||||
ptr->protections = (GF_ItemProtectionBox*)a;
|
||||
ptr->protections = (GF_ItemProtectionBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_IINF:
|
||||
case GF_ISOM_BOX_TYPE_IINF:
|
||||
if (ptr->item_infos) return GF_ISOM_INVALID_FILE;
|
||||
ptr->item_infos = (GF_ItemInfoBox*)a;
|
||||
ptr->item_infos = (GF_ItemInfoBox*)a;
|
||||
break;
|
||||
//case ???: ptr->IPMP_control = (???*)a; break;
|
||||
case GF_ISOM_BOX_TYPE_XML:
|
||||
case GF_ISOM_BOX_TYPE_BXML:
|
||||
case GF_ISOM_BOX_TYPE_ILST:
|
||||
gf_list_add(ptr->other_boxes, a); break;
|
||||
default:
|
||||
gf_isom_box_del(a);
|
||||
case GF_ISOM_BOX_TYPE_IREF:
|
||||
if (ptr->item_refs) return GF_ISOM_INVALID_FILE;
|
||||
ptr->item_refs = (GF_ItemReferenceBox*)a;
|
||||
break;
|
||||
case GF_ISOM_BOX_TYPE_IPRP:
|
||||
if (ptr->item_props) return GF_ISOM_INVALID_FILE;
|
||||
ptr->item_props = (GF_ItemPropertiesBox*)a;
|
||||
break;
|
||||
//case ???: ptr->IPMP_control = (???*)a; break;
|
||||
case GF_ISOM_BOX_TYPE_XML:
|
||||
case GF_ISOM_BOX_TYPE_BXML:
|
||||
case GF_ISOM_BOX_TYPE_ILST:
|
||||
default:
|
||||
return gf_isom_box_add_default(s, a);
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -113,96 +112,101 @@ GF_Err meta_Read(GF_Box *s, GF_BitStream *bs)
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
GF_Err meta_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
u32 count, i;
|
||||
GF_Err e;
|
||||
GF_MetaBox *ptr = (GF_MetaBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
e = gf_isom_box_write((GF_Box *) ptr->handler, bs);
|
||||
if (e) return e;
|
||||
if (ptr->handler) {
|
||||
e = gf_isom_box_write((GF_Box *)ptr->handler, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->primary_resource) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->primary_resource, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->primary_resource, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->file_locations) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->file_locations, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->file_locations, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->item_locations) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->item_locations, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->item_locations, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->protections) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->protections, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->protections, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->item_infos) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->item_infos, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->item_infos, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->IPMP_control) {
|
||||
e = gf_isom_box_write((GF_Box *) ptr->IPMP_control, bs);
|
||||
e = gf_isom_box_write((GF_Box *)ptr->IPMP_control, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if ((count = gf_list_count(ptr->other_boxes))) {
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
|
||||
e = gf_isom_box_write(a, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->item_refs) {
|
||||
e = gf_isom_box_write((GF_Box *)ptr->item_refs, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
if (ptr->item_props) {
|
||||
e = gf_isom_box_write((GF_Box *)ptr->item_props, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Err meta_Size(GF_Box *s)
|
||||
{
|
||||
u32 i, count;
|
||||
GF_Err e;
|
||||
GF_MetaBox *ptr = (GF_MetaBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
e = gf_isom_box_size((GF_Box *) ptr->handler);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->handler->size;
|
||||
if (ptr->handler) {
|
||||
e = gf_isom_box_size((GF_Box *)ptr->handler);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->handler->size;
|
||||
}
|
||||
if (ptr->primary_resource) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->primary_resource);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->primary_resource);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->primary_resource->size;
|
||||
}
|
||||
if (ptr->file_locations) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->file_locations);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->file_locations);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->file_locations->size;
|
||||
}
|
||||
if (ptr->item_locations) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->item_locations);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->item_locations);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->item_locations->size;
|
||||
}
|
||||
if (ptr->protections) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->protections);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->protections);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->protections->size;
|
||||
}
|
||||
if (ptr->item_infos) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->item_infos);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->item_infos);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->item_infos->size;
|
||||
}
|
||||
if (ptr->IPMP_control) {
|
||||
e = gf_isom_box_size((GF_Box *) ptr->IPMP_control);
|
||||
e = gf_isom_box_size((GF_Box *)ptr->IPMP_control);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->IPMP_control->size;
|
||||
}
|
||||
if ((count = gf_list_count(ptr->other_boxes))) {
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
|
||||
e = gf_isom_box_size(a);
|
||||
if (e) return e;
|
||||
ptr->size += a->size;
|
||||
}
|
||||
if (ptr->item_refs) {
|
||||
e = gf_isom_box_size((GF_Box *)ptr->item_refs);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->item_refs->size;
|
||||
}
|
||||
if (ptr->item_props) {
|
||||
e = gf_isom_box_size((GF_Box *)ptr->item_props);
|
||||
if (e) return e;
|
||||
ptr->size += ptr->item_props->size;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -210,11 +214,8 @@ GF_Err meta_Size(GF_Box *s)
|
||||
|
||||
GF_Box *xml_New()
|
||||
{
|
||||
GF_XMLBox *tmp = (GF_XMLBox *) gf_malloc(sizeof(GF_XMLBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_XMLBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_XMLBox, GF_ISOM_BOX_TYPE_XML);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_XML;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -266,11 +267,8 @@ GF_Err xml_Size(GF_Box *s)
|
||||
|
||||
GF_Box *bxml_New()
|
||||
{
|
||||
GF_BinaryXMLBox *tmp = (GF_BinaryXMLBox *) gf_malloc(sizeof(GF_BinaryXMLBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_BinaryXMLBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_BinaryXMLBox, GF_ISOM_BOX_TYPE_BXML);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_BXML;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -321,34 +319,35 @@ GF_Err bxml_Size(GF_Box *s)
|
||||
|
||||
GF_Box *iloc_New()
|
||||
{
|
||||
GF_ItemLocationBox *tmp = (GF_ItemLocationBox *) gf_malloc(sizeof(GF_ItemLocationBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ItemLocationBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemLocationBox, GF_ISOM_BOX_TYPE_ILOC);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_ILOC;
|
||||
tmp->location_entries = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
void iloc_entry_del(GF_ItemLocationEntry *location)
|
||||
{
|
||||
u32 j, extent_count;
|
||||
extent_count = gf_list_count(location->extent_entries);
|
||||
for (j = 0; j < extent_count; j++) {
|
||||
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
|
||||
gf_free(extent);
|
||||
}
|
||||
gf_list_del(location->extent_entries);
|
||||
gf_free(location);
|
||||
}
|
||||
|
||||
void iloc_del(GF_Box *s)
|
||||
{
|
||||
u32 i, j, item_count, extent_count;
|
||||
u32 i, item_count;
|
||||
GF_ItemLocationBox *ptr = (GF_ItemLocationBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
item_count = gf_list_count(ptr->location_entries);
|
||||
if (item_count) {
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
|
||||
extent_count = gf_list_count(location->extent_entries);
|
||||
for (j = 0; j < extent_count; j++) {
|
||||
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
|
||||
gf_free(extent);
|
||||
}
|
||||
gf_list_del(location->extent_entries);
|
||||
gf_free(location);
|
||||
}
|
||||
gf_list_del(ptr->location_entries);
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
|
||||
iloc_entry_del(location);
|
||||
}
|
||||
gf_list_del(ptr->location_entries);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
@@ -362,14 +361,35 @@ GF_Err iloc_Read(GF_Box *s, GF_BitStream *bs)
|
||||
ptr->offset_size = gf_bs_read_int(bs, 4);
|
||||
ptr->length_size = gf_bs_read_int(bs, 4);
|
||||
ptr->base_offset_size = gf_bs_read_int(bs, 4);
|
||||
gf_bs_read_int(bs, 4);
|
||||
item_count = gf_bs_read_u16(bs);
|
||||
if (ptr->version == 1 || ptr->version == 2) {
|
||||
ptr->index_size = gf_bs_read_int(bs, 4);
|
||||
}
|
||||
else {
|
||||
gf_bs_read_int(bs, 4);
|
||||
}
|
||||
if (ptr->version < 2) {
|
||||
item_count = gf_bs_read_u16(bs);
|
||||
}
|
||||
else {
|
||||
item_count = gf_bs_read_u32(bs);
|
||||
}
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location_entry = (GF_ItemLocationEntry *)gf_malloc(sizeof(GF_ItemLocationEntry));
|
||||
gf_list_add(ptr->location_entries, location_entry);
|
||||
location_entry->item_ID = gf_bs_read_u16(bs);
|
||||
if (ptr->version < 2) {
|
||||
location_entry->item_ID = gf_bs_read_u16(bs);
|
||||
}
|
||||
else {
|
||||
location_entry->item_ID = gf_bs_read_u32(bs);
|
||||
}
|
||||
if (ptr->version == 1 || ptr->version == 2) {
|
||||
location_entry->construction_method = gf_bs_read_u16(bs);
|
||||
}
|
||||
else {
|
||||
location_entry->construction_method = 0;
|
||||
}
|
||||
location_entry->data_reference_index = gf_bs_read_u16(bs);
|
||||
location_entry->base_offset = gf_bs_read_int(bs, 8*ptr->base_offset_size);
|
||||
location_entry->base_offset = gf_bs_read_int(bs, 8 * ptr->base_offset_size);
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
location_entry->original_base_offset = location_entry->base_offset;
|
||||
#endif
|
||||
@@ -379,8 +399,14 @@ GF_Err iloc_Read(GF_Box *s, GF_BitStream *bs)
|
||||
for (j = 0; j < extent_count; j++) {
|
||||
GF_ItemExtentEntry *extent_entry = (GF_ItemExtentEntry *)gf_malloc(sizeof(GF_ItemExtentEntry));
|
||||
gf_list_add(location_entry->extent_entries, extent_entry);
|
||||
extent_entry->extent_offset = gf_bs_read_int(bs, 8*ptr->offset_size);
|
||||
extent_entry->extent_length = gf_bs_read_int(bs, 8*ptr->length_size);
|
||||
if ((ptr->version == 1 || ptr->version == 2) && ptr->index_size > 0) {
|
||||
extent_entry->extent_index = gf_bs_read_int(bs, 8 * ptr->index_size);;
|
||||
}
|
||||
else {
|
||||
extent_entry->extent_index = 0;
|
||||
}
|
||||
extent_entry->extent_offset = gf_bs_read_int(bs, 8 * ptr->offset_size);
|
||||
extent_entry->extent_length = gf_bs_read_int(bs, 8 * ptr->length_size);
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
extent_entry->original_extent_offset = extent_entry->extent_offset;
|
||||
#endif
|
||||
@@ -401,20 +427,36 @@ GF_Err iloc_Write(GF_Box *s, GF_BitStream *bs)
|
||||
gf_bs_write_int(bs, ptr->offset_size, 4);
|
||||
gf_bs_write_int(bs, ptr->length_size, 4);
|
||||
gf_bs_write_int(bs, ptr->base_offset_size, 4);
|
||||
gf_bs_write_int(bs, 0, 4);
|
||||
gf_bs_write_int(bs, ptr->index_size, 4);
|
||||
item_count = gf_list_count(ptr->location_entries);
|
||||
gf_bs_write_u16(bs, item_count);
|
||||
if (ptr->version < 2) {
|
||||
gf_bs_write_u16(bs, item_count);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u32(bs, item_count);
|
||||
}
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
|
||||
gf_bs_write_u16(bs, location->item_ID);
|
||||
if (ptr->version < 2) {
|
||||
gf_bs_write_u16(bs, location->item_ID);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u32(bs, location->item_ID);
|
||||
}
|
||||
if (ptr->version == 1 || ptr->version == 2) {
|
||||
gf_bs_write_u16(bs, location->construction_method);
|
||||
}
|
||||
gf_bs_write_u16(bs, location->data_reference_index);
|
||||
gf_bs_write_long_int(bs, location->base_offset, 8*ptr->base_offset_size);
|
||||
gf_bs_write_long_int(bs, location->base_offset, 8 * ptr->base_offset_size);
|
||||
extent_count = gf_list_count(location->extent_entries);
|
||||
gf_bs_write_u16(bs, extent_count);
|
||||
for (j=0; j<extent_count; j++) {
|
||||
for (j = 0; j<extent_count; j++) {
|
||||
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
|
||||
gf_bs_write_long_int(bs, extent->extent_offset, 8*ptr->offset_size);
|
||||
gf_bs_write_long_int(bs, extent->extent_length, 8*ptr->length_size);
|
||||
if ((ptr->version == 1 || ptr->version == 2) && ptr->index_size > 0) {
|
||||
gf_bs_write_long_int(bs, extent->extent_index, 8 * ptr->index_size);
|
||||
}
|
||||
gf_bs_write_long_int(bs, extent->extent_offset, 8 * ptr->offset_size);
|
||||
gf_bs_write_long_int(bs, extent->extent_length, 8 * ptr->length_size);
|
||||
}
|
||||
}
|
||||
return GF_OK;
|
||||
@@ -428,12 +470,34 @@ GF_Err iloc_Size(GF_Box *s)
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 4;
|
||||
if (ptr->index_size) {
|
||||
ptr->version = 1;
|
||||
}
|
||||
item_count = gf_list_count(ptr->location_entries);
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
|
||||
if (location->construction_method) {
|
||||
ptr->version = 1;
|
||||
}
|
||||
if (location->item_ID > 0xFFFF) {
|
||||
ptr->version = 2;
|
||||
}
|
||||
}
|
||||
ptr->size += 4;
|
||||
if (ptr->version == 2) {
|
||||
ptr->size += 2; // 32 bits item count instead of 16 bits
|
||||
}
|
||||
for (i = 0; i < item_count; i++) {
|
||||
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
|
||||
extent_count = gf_list_count(location->extent_entries);
|
||||
ptr->size += 6 + ptr->base_offset_size + extent_count*(ptr->offset_size + ptr->length_size);
|
||||
if (ptr->version == 2) {
|
||||
ptr->size += 2; //32 bits item ID instead of 16 bits
|
||||
}
|
||||
if (ptr->version == 1 || ptr->version == 2) {
|
||||
ptr->size += 2; // construction_method
|
||||
ptr->size += extent_count*ptr->index_size;
|
||||
}
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -441,11 +505,8 @@ GF_Err iloc_Size(GF_Box *s)
|
||||
|
||||
GF_Box *pitm_New()
|
||||
{
|
||||
GF_PrimaryItemBox *tmp = (GF_PrimaryItemBox *) gf_malloc(sizeof(GF_PrimaryItemBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_PrimaryItemBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_PrimaryItemBox, GF_ISOM_BOX_TYPE_PITM);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_PITM;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -461,7 +522,7 @@ GF_Err pitm_Read(GF_Box *s, GF_BitStream *bs)
|
||||
GF_Err e;
|
||||
GF_PrimaryItemBox *ptr = (GF_PrimaryItemBox *)s;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
if (e) return e;
|
||||
ptr->item_ID = gf_bs_read_u16(bs);
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -485,18 +546,15 @@ GF_Err pitm_Size(GF_Box *s)
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 16;
|
||||
ptr->size += 2;
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
GF_Box *ipro_New()
|
||||
{
|
||||
GF_ItemProtectionBox *tmp = (GF_ItemProtectionBox *) gf_malloc(sizeof(GF_ItemProtectionBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ItemProtectionBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemProtectionBox, GF_ISOM_BOX_TYPE_IPRO);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_IPRO;
|
||||
tmp->protection_information = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
@@ -518,11 +576,10 @@ void ipro_del(GF_Box *s)
|
||||
GF_Err ipro_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_ItemProtectionBox *ptr = (GF_ItemProtectionBox *)s;
|
||||
if (a->type == GF_ISOM_BOX_TYPE_SINF)
|
||||
gf_list_add(ptr->protection_information, a);
|
||||
else
|
||||
gf_isom_box_del(a);
|
||||
return GF_OK;
|
||||
if (a->type == GF_ISOM_BOX_TYPE_SINF)
|
||||
return gf_list_add(ptr->protection_information, a);
|
||||
else
|
||||
return gf_isom_box_add_default(s, a);
|
||||
}
|
||||
GF_Err ipro_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
@@ -576,11 +633,8 @@ GF_Err ipro_Size(GF_Box *s)
|
||||
|
||||
GF_Box *infe_New()
|
||||
{
|
||||
GF_ItemInfoEntryBox *tmp = (GF_ItemInfoEntryBox *) gf_malloc(sizeof(GF_ItemInfoEntryBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ItemInfoEntryBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemInfoEntryBox, GF_ISOM_BOX_TYPE_INFE);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_INFE;
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
@@ -604,29 +658,35 @@ GF_Err infe_Read(GF_Box *s, GF_BitStream *bs)
|
||||
if (ptr == NULL) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
|
||||
|
||||
ptr->item_ID = gf_bs_read_u16(bs);
|
||||
ptr->item_protection_index = gf_bs_read_u16(bs);
|
||||
ptr->size -= 4;
|
||||
buf_len = (u32) (ptr->size);
|
||||
if (ptr->version == 2) {
|
||||
ptr->item_type = gf_bs_read_u32(bs);
|
||||
ptr->size -= 4;
|
||||
}
|
||||
buf_len = (u32)(ptr->size);
|
||||
buf = (char*)gf_malloc(buf_len);
|
||||
if (buf_len != gf_bs_read_data(bs, buf, buf_len)) {
|
||||
gf_free(buf);
|
||||
return GF_ISOM_INVALID_FILE;
|
||||
}
|
||||
}
|
||||
string_len = 1;
|
||||
string_start = 0;
|
||||
for (i = 0; i < buf_len; i++) {
|
||||
if (buf[i] == 0) {
|
||||
if (!ptr->item_name) {
|
||||
ptr->item_name = (char*)gf_malloc(sizeof(char)*string_len);
|
||||
memcpy(ptr->item_name, buf+string_start, string_len);
|
||||
} else if (!ptr->content_type) {
|
||||
memcpy(ptr->item_name, buf + string_start, string_len);
|
||||
}
|
||||
else if (!ptr->content_type) {
|
||||
ptr->content_type = (char*)gf_malloc(sizeof(char)*string_len);
|
||||
memcpy(ptr->content_type, buf+string_start, string_len);
|
||||
} else {
|
||||
memcpy(ptr->content_type, buf + string_start, string_len);
|
||||
}
|
||||
else {
|
||||
ptr->content_encoding = (char*)gf_malloc(sizeof(char)*string_len);
|
||||
memcpy(ptr->content_encoding, buf+string_start, string_len);
|
||||
memcpy(ptr->content_encoding, buf + string_start, string_len);
|
||||
}
|
||||
string_start += string_len;
|
||||
string_len = 0;
|
||||
@@ -634,7 +694,7 @@ GF_Err infe_Read(GF_Box *s, GF_BitStream *bs)
|
||||
string_len++;
|
||||
}
|
||||
gf_free(buf);
|
||||
if (!ptr->item_name || !ptr->content_type) return GF_ISOM_INVALID_FILE;
|
||||
if (!ptr->item_name || (!ptr->content_type && ptr->version < 2)) return GF_ISOM_INVALID_FILE;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -647,19 +707,40 @@ GF_Err infe_Write(GF_Box *s, GF_BitStream *bs)
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
gf_bs_write_u16(bs, ptr->item_ID);
|
||||
if (ptr->version == 3) {
|
||||
gf_bs_write_u32(bs, ptr->item_ID);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_u16(bs, ptr->item_ID);
|
||||
}
|
||||
gf_bs_write_u16(bs, ptr->item_protection_index);
|
||||
if (ptr->version >= 2) {
|
||||
gf_bs_write_u32(bs, ptr->item_type);
|
||||
}
|
||||
if (ptr->item_name) {
|
||||
len = strlen(ptr->item_name)+1;
|
||||
len = (u32)strlen(ptr->item_name) + 1;
|
||||
gf_bs_write_data(bs, ptr->item_name, len);
|
||||
}
|
||||
if (ptr->content_type) {
|
||||
len = strlen(ptr->content_type)+1;
|
||||
gf_bs_write_data(bs, ptr->content_type, len);
|
||||
else {
|
||||
gf_bs_write_byte(bs, 0, 1);
|
||||
}
|
||||
if (ptr->content_encoding) {
|
||||
len = strlen(ptr->content_encoding)+1;
|
||||
gf_bs_write_data(bs, ptr->content_encoding, len);
|
||||
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e') || ptr->item_type == GF_4CC('u', 'r', 'i', ' ')) {
|
||||
if (ptr->content_type) {
|
||||
len = (u32)strlen(ptr->content_type) + 1;
|
||||
gf_bs_write_data(bs, ptr->content_type, len);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_byte(bs, 0, 1);
|
||||
}
|
||||
}
|
||||
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e')) {
|
||||
if (ptr->content_encoding) {
|
||||
len = (u32)strlen(ptr->content_encoding) + 1;
|
||||
gf_bs_write_data(bs, ptr->content_encoding, len);
|
||||
}
|
||||
else {
|
||||
gf_bs_write_byte(bs, 0, 1);
|
||||
}
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -671,21 +752,40 @@ GF_Err infe_Size(GF_Box *s)
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
if (ptr->item_type) {
|
||||
ptr->version = 2;
|
||||
if (ptr->item_ID > 0xFFFF) {
|
||||
ptr->version = 3;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ptr->version = 0;
|
||||
}
|
||||
ptr->size += 4;
|
||||
if (ptr->item_name) ptr->size += strlen(ptr->item_name)+1;
|
||||
if (ptr->content_type) ptr->size += strlen(ptr->content_type)+1;
|
||||
if (ptr->content_encoding) ptr->size += strlen(ptr->content_encoding)+1;
|
||||
if (ptr->version == 3) {
|
||||
ptr->size += 2; // item_ID on 32 bits (+2 bytes)
|
||||
}
|
||||
if (ptr->version >= 2) {
|
||||
ptr->size += 4; // item_type size
|
||||
}
|
||||
if (ptr->item_name) ptr->size += strlen(ptr->item_name) + 1;
|
||||
else ptr->size += 1;
|
||||
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e') || ptr->item_type == GF_4CC('u', 'r', 'i', ' ')) {
|
||||
if (ptr->content_type) ptr->size += strlen(ptr->content_type) + 1;
|
||||
else ptr->size += 1;
|
||||
}
|
||||
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e')) {
|
||||
if (ptr->content_encoding) ptr->size += strlen(ptr->content_encoding) + 1;
|
||||
else ptr->size += 1;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
GF_Box *iinf_New()
|
||||
{
|
||||
GF_ItemInfoBox *tmp = (GF_ItemInfoBox *) gf_malloc(sizeof(GF_ItemInfoBox));
|
||||
if (tmp == NULL) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_ItemInfoBox));
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemInfoBox, GF_ISOM_BOX_TYPE_IINF);
|
||||
gf_isom_full_box_init((GF_Box *)tmp);
|
||||
tmp->type = GF_ISOM_BOX_TYPE_IINF;
|
||||
tmp->item_infos = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
@@ -713,7 +813,12 @@ GF_Err iinf_Read(GF_Box *s, GF_BitStream *bs)
|
||||
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
count = gf_bs_read_u16(bs);
|
||||
if (ptr->version == 0) {
|
||||
count = gf_bs_read_u16(bs);
|
||||
}
|
||||
else {
|
||||
count = gf_bs_read_u32(bs);
|
||||
}
|
||||
|
||||
while (count) {
|
||||
e = gf_isom_parse_box(&a, bs);
|
||||
@@ -721,10 +826,10 @@ GF_Err iinf_Read(GF_Box *s, GF_BitStream *bs)
|
||||
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
|
||||
|
||||
if (a->type == GF_ISOM_BOX_TYPE_INFE)
|
||||
gf_list_add(ptr->item_infos, a);
|
||||
else
|
||||
gf_list_add(ptr->item_infos, a);
|
||||
else
|
||||
gf_isom_box_del(a);
|
||||
count --;
|
||||
count--;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -771,6 +876,145 @@ GF_Err iinf_Size(GF_Box *s)
|
||||
}
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
GF_Err iref_AddBox(GF_Box *s, GF_Box *a)
|
||||
{
|
||||
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
|
||||
return gf_list_add(ptr->references, a);
|
||||
}
|
||||
|
||||
void iref_del(GF_Box *s)
|
||||
{
|
||||
u32 count, i;
|
||||
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
|
||||
if (ptr == NULL) return;
|
||||
count = gf_list_count(ptr->references);
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
|
||||
gf_isom_box_del(a);
|
||||
}
|
||||
gf_list_del(ptr->references);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
|
||||
GF_Err iref_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
e = gf_isom_full_box_read(s, bs);
|
||||
if (e) return e;
|
||||
return gf_isom_read_box_list_ex(s, bs, iref_AddBox, s->type);
|
||||
}
|
||||
|
||||
GF_Box *iref_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemReferenceBox, GF_ISOM_BOX_TYPE_IREF);
|
||||
tmp->references = gf_list_new();
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_Err iref_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 count, i;
|
||||
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_write(s, bs);
|
||||
if (e) return e;
|
||||
count = gf_list_count(ptr->references);
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
|
||||
e = gf_isom_box_write(a, bs);
|
||||
if (e) return e;
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
GF_Err iref_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 count, i;
|
||||
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
|
||||
if (!s) return GF_BAD_PARAM;
|
||||
e = gf_isom_full_box_get_size(s);
|
||||
if (e) return e;
|
||||
count = gf_list_count(ptr->references);
|
||||
for (i = 0; i < count; i++) {
|
||||
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
|
||||
e = gf_isom_box_size(a);
|
||||
if (e) return e;
|
||||
s->size += a->size;
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
void ireftype_del(GF_Box *s)
|
||||
{
|
||||
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
|
||||
if (!ptr) return;
|
||||
if (ptr->to_item_IDs) gf_free(ptr->to_item_IDs);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
GF_Err ireftype_Read(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
u32 bytesToRead;
|
||||
u32 i;
|
||||
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
|
||||
|
||||
bytesToRead = (u32)(ptr->size);
|
||||
if (!bytesToRead) return GF_OK;
|
||||
|
||||
ptr->from_item_id = gf_bs_read_u16(bs);
|
||||
ptr->reference_count = gf_bs_read_u16(bs);
|
||||
ptr->to_item_IDs = (u32 *)gf_malloc(ptr->reference_count * sizeof(u32));
|
||||
if (!ptr->to_item_IDs) return GF_OUT_OF_MEM;
|
||||
|
||||
for (i = 0; i < ptr->reference_count; i++) {
|
||||
ptr->to_item_IDs[i] = gf_bs_read_u16(bs);
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_Box *ireftype_New()
|
||||
{
|
||||
ISOM_DECL_BOX_ALLOC(GF_ItemReferenceTypeBox, GF_ISOM_BOX_TYPE_REFI);
|
||||
return (GF_Box *)tmp;
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
GF_Err ireftype_Write(GF_Box *s, GF_BitStream *bs)
|
||||
{
|
||||
GF_Err e;
|
||||
u32 i;
|
||||
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
|
||||
ptr->type = ptr->reference_type;
|
||||
e = gf_isom_box_write_header(s, bs);
|
||||
ptr->type = GF_ISOM_BOX_TYPE_REFI;
|
||||
if (e) return e;
|
||||
gf_bs_write_u16(bs, ptr->from_item_id);
|
||||
gf_bs_write_u16(bs, ptr->reference_count);
|
||||
for (i = 0; i < ptr->reference_count; i++) {
|
||||
gf_bs_write_u16(bs, ptr->to_item_IDs[i]);
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
|
||||
GF_Err ireftype_Size(GF_Box *s)
|
||||
{
|
||||
GF_Err e;
|
||||
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
|
||||
e = gf_isom_box_get_size(s);
|
||||
if (e) return e;
|
||||
ptr->size += 4 + (ptr->reference_count * sizeof(u16));
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
#endif /*GPAC_DISABLE_ISOM*/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
505
src/gpacmp4/configfile.c
Normal file
505
src/gpacmp4/configfile.c
Normal file
@@ -0,0 +1,505 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/config_file.h>
|
||||
#include <gpac/list.h>
|
||||
|
||||
#define MAX_INI_LINE 2046
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
char *value;
|
||||
} IniKey;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *section_name;
|
||||
GF_List *keys;
|
||||
} IniSection;
|
||||
|
||||
struct __tag_config
|
||||
{
|
||||
char *fileName;
|
||||
GF_List *sections;
|
||||
Bool hasChanged, skip_changes;
|
||||
};
|
||||
|
||||
|
||||
static void DelSection(IniSection *ptr)
|
||||
{
|
||||
IniKey *k;
|
||||
if (!ptr) return;
|
||||
if (ptr->keys) {
|
||||
while (gf_list_count(ptr->keys)) {
|
||||
k = (IniKey *)gf_list_get(ptr->keys, 0);
|
||||
if (k->value) gf_free(k->value);
|
||||
if (k->name) gf_free(k->name);
|
||||
gf_free(k);
|
||||
gf_list_rem(ptr->keys, 0);
|
||||
}
|
||||
gf_list_del(ptr->keys);
|
||||
}
|
||||
if (ptr->section_name) gf_free(ptr->section_name);
|
||||
gf_free(ptr);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Clear the structure
|
||||
* \param iniFile The structure to clear
|
||||
*/
|
||||
static void gf_cfg_clear(GF_Config * iniFile) {
|
||||
IniSection *p;
|
||||
if (!iniFile) return;
|
||||
if (iniFile->sections) {
|
||||
while (gf_list_count(iniFile->sections)) {
|
||||
p = (IniSection *)gf_list_get(iniFile->sections, 0);
|
||||
DelSection(p);
|
||||
gf_list_rem(iniFile->sections, 0);
|
||||
}
|
||||
gf_list_del(iniFile->sections);
|
||||
}
|
||||
if (iniFile->fileName)
|
||||
gf_free(iniFile->fileName);
|
||||
memset((void *)iniFile, 0, sizeof(GF_Config));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Parses the config file if any and clears the existing structure
|
||||
*/
|
||||
GF_Err gf_cfg_parse_config_file(GF_Config * tmp, const char * filePath, const char * file_name)
|
||||
{
|
||||
IniSection *p;
|
||||
IniKey *k;
|
||||
FILE *file;
|
||||
char *ret;
|
||||
char *line;
|
||||
u32 line_alloc = MAX_INI_LINE;
|
||||
char fileName[GF_MAX_PATH];
|
||||
|
||||
gf_cfg_clear(tmp);
|
||||
|
||||
if (filePath && ((filePath[strlen(filePath) - 1] == '/') || (filePath[strlen(filePath) - 1] == '\\'))) {
|
||||
strcpy(fileName, filePath);
|
||||
strcat(fileName, file_name);
|
||||
}
|
||||
else if (filePath) {
|
||||
sprintf(fileName, "%s%c%s", filePath, GF_PATH_SEPARATOR, file_name);
|
||||
}
|
||||
else {
|
||||
strcpy(fileName, file_name);
|
||||
}
|
||||
|
||||
tmp->fileName = gf_strdup(fileName);
|
||||
tmp->sections = gf_list_new();
|
||||
file = gf_fopen(fileName, "rt");
|
||||
if (!file)
|
||||
return GF_IO_ERR;
|
||||
/* load the file */
|
||||
p = NULL;
|
||||
line = (char*)gf_malloc(sizeof(char)*line_alloc);
|
||||
memset(line, 0, sizeof(char)*line_alloc);
|
||||
|
||||
while (!feof(file)) {
|
||||
u32 read, nb_pass;
|
||||
ret = fgets(line, line_alloc, file);
|
||||
read = (u32)strlen(line);
|
||||
nb_pass = 1;
|
||||
while (read + nb_pass == line_alloc) {
|
||||
line_alloc += MAX_INI_LINE;
|
||||
line = (char*)gf_realloc(line, sizeof(char)*line_alloc);
|
||||
ret = fgets(line + read, MAX_INI_LINE, file);
|
||||
read = (u32)strlen(line);
|
||||
nb_pass++;
|
||||
}
|
||||
if (!ret) continue;
|
||||
|
||||
/* get rid of the end of line stuff */
|
||||
while (1) {
|
||||
u32 len = (u32)strlen(line);
|
||||
if (!len) break;
|
||||
if ((line[len - 1] != '\n') && (line[len - 1] != '\r')) break;
|
||||
line[len - 1] = 0;
|
||||
}
|
||||
if (!strlen(line)) continue;
|
||||
if (line[0] == '#') continue;
|
||||
|
||||
|
||||
/* new section */
|
||||
if (line[0] == '[') {
|
||||
p = (IniSection *)gf_malloc(sizeof(IniSection));
|
||||
p->keys = gf_list_new();
|
||||
p->section_name = gf_strdup(line + 1);
|
||||
p->section_name[strlen(line) - 2] = 0;
|
||||
while (p->section_name[strlen(p->section_name) - 1] == ']' || p->section_name[strlen(p->section_name) - 1] == ' ') p->section_name[strlen(p->section_name) - 1] = 0;
|
||||
gf_list_add(tmp->sections, p);
|
||||
}
|
||||
else if (strlen(line) && (strchr(line, '=') != NULL)) {
|
||||
if (!p) {
|
||||
gf_list_del(tmp->sections);
|
||||
gf_free(tmp->fileName);
|
||||
gf_free(tmp);
|
||||
gf_fclose(file);
|
||||
gf_free(line);
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
|
||||
k = (IniKey *)gf_malloc(sizeof(IniKey));
|
||||
memset((void *)k, 0, sizeof(IniKey));
|
||||
ret = strchr(line, '=');
|
||||
if (ret) {
|
||||
ret[0] = 0;
|
||||
k->name = gf_strdup(line);
|
||||
while (k->name[strlen(k->name) - 1] == ' ') k->name[strlen(k->name) - 1] = 0;
|
||||
ret[0] = '=';
|
||||
ret += 1;
|
||||
while (ret[0] == ' ') ret++;
|
||||
if (ret[0] != 0) {
|
||||
k->value = gf_strdup(ret);
|
||||
while (k->value[strlen(k->value) - 1] == ' ') k->value[strlen(k->value) - 1] = 0;
|
||||
}
|
||||
else {
|
||||
k->value = gf_strdup("");
|
||||
}
|
||||
}
|
||||
gf_list_add(p->keys, k);
|
||||
}
|
||||
}
|
||||
gf_free(line);
|
||||
gf_fclose(file);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Config *gf_cfg_force_new(const char *filePath, const char* file_name) {
|
||||
GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config));
|
||||
memset((void *)tmp, 0, sizeof(GF_Config));
|
||||
gf_cfg_parse_config_file(tmp, filePath, file_name);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
GF_EXPORT
|
||||
GF_Config *gf_cfg_new(const char *filePath, const char* file_name)
|
||||
{
|
||||
GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config));
|
||||
memset((void *)tmp, 0, sizeof(GF_Config));
|
||||
if (!filePath && !file_name) {
|
||||
tmp->sections = gf_list_new();
|
||||
return tmp;
|
||||
}
|
||||
|
||||
if (gf_cfg_parse_config_file(tmp, filePath, file_name)) {
|
||||
gf_cfg_clear(tmp);
|
||||
gf_free(tmp);
|
||||
tmp = NULL;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
char * gf_cfg_get_filename(GF_Config *iniFile)
|
||||
{
|
||||
if (!iniFile)
|
||||
return NULL;
|
||||
return iniFile->fileName ? gf_strdup(iniFile->fileName) : NULL;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_cfg_save(GF_Config *iniFile)
|
||||
{
|
||||
u32 i, j;
|
||||
IniSection *sec;
|
||||
IniKey *key;
|
||||
FILE *file;
|
||||
|
||||
if (!iniFile->hasChanged) return GF_OK;
|
||||
if (iniFile->skip_changes) return GF_OK;
|
||||
if (!iniFile->fileName) return GF_OK;
|
||||
|
||||
file = gf_fopen(iniFile->fileName, "wt");
|
||||
if (!file) return GF_IO_ERR;
|
||||
|
||||
i = 0;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
/*Temporary sections are not saved*/
|
||||
if (!strnicmp(sec->section_name, "Temp", 4)) continue;
|
||||
|
||||
fprintf(file, "[%s]\n", sec->section_name);
|
||||
j = 0;
|
||||
while ((key = (IniKey *)gf_list_enum(sec->keys, &j))) {
|
||||
fprintf(file, "%s=%s\n", key->name, key->value);
|
||||
}
|
||||
/* end of section */
|
||||
fprintf(file, "\n");
|
||||
}
|
||||
gf_fclose(file);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_cfg_discard_changes(GF_Config *iniFile)
|
||||
{
|
||||
if (!iniFile) return GF_BAD_PARAM;
|
||||
iniFile->skip_changes = GF_TRUE;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
void gf_cfg_del(GF_Config *iniFile)
|
||||
{
|
||||
if (!iniFile) return;
|
||||
gf_cfg_save(iniFile);
|
||||
gf_cfg_clear(iniFile);
|
||||
gf_free(iniFile);
|
||||
}
|
||||
|
||||
void gf_cfg_remove(GF_Config *iniFile)
|
||||
{
|
||||
if (!iniFile) return;
|
||||
gf_delete_file(iniFile->fileName);
|
||||
gf_cfg_clear(iniFile);
|
||||
gf_free(iniFile);
|
||||
}
|
||||
|
||||
|
||||
GF_EXPORT
|
||||
const char *gf_cfg_get_key(GF_Config *iniFile, const char *secName, const char *keyName)
|
||||
{
|
||||
u32 i;
|
||||
IniSection *sec;
|
||||
IniKey *key;
|
||||
|
||||
i = 0;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, sec->section_name)) goto get_key;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
get_key:
|
||||
i = 0;
|
||||
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
|
||||
if (!strcmp(key->name, keyName)) return key->value;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
const char *gf_cfg_get_ikey(GF_Config *iniFile, const char *secName, const char *keyName)
|
||||
{
|
||||
u32 i;
|
||||
IniSection *sec;
|
||||
IniKey *key;
|
||||
|
||||
i = 0;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!stricmp(secName, sec->section_name)) goto get_key;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
get_key:
|
||||
i = 0;
|
||||
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
|
||||
if (!stricmp(key->name, keyName)) return key->value;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_cfg_set_key(GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue)
|
||||
{
|
||||
u32 i;
|
||||
Bool has_changed = GF_TRUE;
|
||||
IniSection *sec;
|
||||
IniKey *key;
|
||||
|
||||
if (!iniFile || !secName || !keyName) return GF_BAD_PARAM;
|
||||
|
||||
if (!strnicmp(secName, "temp", 4)) has_changed = GF_FALSE;
|
||||
|
||||
i = 0;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, sec->section_name)) goto get_key;
|
||||
}
|
||||
/* need a new key */
|
||||
sec = (IniSection *)gf_malloc(sizeof(IniSection));
|
||||
sec->section_name = gf_strdup(secName);
|
||||
sec->keys = gf_list_new();
|
||||
if (has_changed) iniFile->hasChanged = GF_TRUE;
|
||||
gf_list_add(iniFile->sections, sec);
|
||||
|
||||
get_key:
|
||||
i = 0;
|
||||
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
|
||||
if (!strcmp(key->name, keyName)) goto set_value;
|
||||
}
|
||||
if (!keyValue) return GF_OK;
|
||||
/* need a new key */
|
||||
key = (IniKey *)gf_malloc(sizeof(IniKey));
|
||||
key->name = gf_strdup(keyName);
|
||||
key->value = gf_strdup("");
|
||||
if (has_changed) iniFile->hasChanged = GF_TRUE;
|
||||
gf_list_add(sec->keys, key);
|
||||
|
||||
set_value:
|
||||
if (!keyValue) {
|
||||
gf_list_del_item(sec->keys, key);
|
||||
if (key->name) gf_free(key->name);
|
||||
if (key->value) gf_free(key->value);
|
||||
gf_free(key);
|
||||
if (has_changed) iniFile->hasChanged = GF_TRUE;
|
||||
return GF_OK;
|
||||
}
|
||||
/* same value, don't update */
|
||||
if (!strcmp(key->value, keyValue)) return GF_OK;
|
||||
|
||||
if (key->value) gf_free(key->value);
|
||||
key->value = gf_strdup(keyValue);
|
||||
if (has_changed) iniFile->hasChanged = GF_TRUE;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
u32 gf_cfg_get_section_count(GF_Config *iniFile)
|
||||
{
|
||||
return gf_list_count(iniFile->sections);
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
const char *gf_cfg_get_section_name(GF_Config *iniFile, u32 secIndex)
|
||||
{
|
||||
IniSection *is = (IniSection *)gf_list_get(iniFile->sections, secIndex);
|
||||
if (!is) return NULL;
|
||||
return is->section_name;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
u32 gf_cfg_get_key_count(GF_Config *iniFile, const char *secName)
|
||||
{
|
||||
u32 i = 0;
|
||||
IniSection *sec;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, sec->section_name)) return gf_list_count(sec->keys);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
const char *gf_cfg_get_key_name(GF_Config *iniFile, const char *secName, u32 keyIndex)
|
||||
{
|
||||
u32 i = 0;
|
||||
IniSection *sec;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, sec->section_name)) {
|
||||
IniKey *key = (IniKey *)gf_list_get(sec->keys, keyIndex);
|
||||
return key ? key->name : NULL;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
void gf_cfg_del_section(GF_Config *iniFile, const char *secName)
|
||||
{
|
||||
u32 i;
|
||||
IniSection *p;
|
||||
if (!iniFile) return;
|
||||
|
||||
i = 0;
|
||||
while ((p = (IniSection*)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, p->section_name)) {
|
||||
DelSection(p);
|
||||
gf_list_rem(iniFile->sections, i - 1);
|
||||
iniFile->hasChanged = GF_TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_cfg_insert_key(GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue, u32 index)
|
||||
{
|
||||
u32 i;
|
||||
IniSection *sec;
|
||||
IniKey *key;
|
||||
|
||||
if (!iniFile || !secName || !keyName || !keyValue) return GF_BAD_PARAM;
|
||||
|
||||
i = 0;
|
||||
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
|
||||
if (!strcmp(secName, sec->section_name)) break;
|
||||
}
|
||||
if (!sec) return GF_BAD_PARAM;
|
||||
|
||||
i = 0;
|
||||
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
|
||||
if (!strcmp(key->name, keyName)) return GF_BAD_PARAM;
|
||||
}
|
||||
|
||||
key = (IniKey *)gf_malloc(sizeof(IniKey));
|
||||
key->name = gf_strdup(keyName);
|
||||
key->value = gf_strdup(keyValue);
|
||||
gf_list_insert(sec->keys, key, index);
|
||||
iniFile->hasChanged = GF_TRUE;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
const char *gf_cfg_get_sub_key(GF_Config *iniFile, const char *secName, const char *keyName, u32 sub_index)
|
||||
{
|
||||
u32 j;
|
||||
char *subKeyValue, *returnKey;
|
||||
char *keyValue;
|
||||
|
||||
|
||||
keyValue = gf_strdup(gf_cfg_get_key(iniFile, secName, keyName));
|
||||
if (!keyValue) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
j = 0;
|
||||
subKeyValue = strtok((char*)keyValue, ";");
|
||||
while (subKeyValue != NULL) {
|
||||
if (j == sub_index) {
|
||||
returnKey = gf_strdup(subKeyValue);
|
||||
gf_free(keyValue);
|
||||
return returnKey;
|
||||
}
|
||||
j++;
|
||||
subKeyValue = strtok(NULL, ";");
|
||||
}
|
||||
gf_free(keyValue);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_cfg_set_filename(GF_Config *iniFile, const char * fileName)
|
||||
{
|
||||
if (!fileName) return GF_OK;
|
||||
if (iniFile->fileName) gf_free(iniFile->fileName);
|
||||
iniFile->fileName = gf_strdup(fileName);
|
||||
return iniFile->fileName ? GF_OK : GF_OUT_OF_MEM;
|
||||
}
|
||||
@@ -1,46 +1,66 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
#include "../disable_warnings.h"
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / ISO Media File Format sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/isomedia_dev.h>
|
||||
#include <gpac/network.h>
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM
|
||||
|
||||
static u32 default_write_buffering_size = 0;
|
||||
|
||||
GF_EXPORT
|
||||
GF_Err gf_isom_set_output_buffering(GF_ISOFile *movie, u32 size)
|
||||
{
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
if (!movie) {
|
||||
default_write_buffering_size = size;
|
||||
return GF_OK;
|
||||
}
|
||||
if (!movie->editFileMap) return GF_BAD_PARAM;
|
||||
return gf_bs_set_output_buffering(movie->editFileMap->bs, size);
|
||||
#else
|
||||
return GF_NOT_SUPPORTED;
|
||||
#endif
|
||||
}
|
||||
|
||||
void gf_isom_datamap_del(GF_DataMap *ptr)
|
||||
{
|
||||
if (!ptr) return;
|
||||
|
||||
if (ptr->szName) gf_free(ptr->szName);
|
||||
|
||||
//then delete the structure itself....
|
||||
switch (ptr->type) {
|
||||
//file-based
|
||||
//file-based
|
||||
case GF_ISOM_DATA_FILE:
|
||||
gf_isom_fdm_del((GF_FileDataMap *)ptr);
|
||||
break;
|
||||
case GF_ISOM_DATA_FILE_MAPPING:
|
||||
gf_isom_fmo_del((GF_FileMappingDataMap *)ptr);
|
||||
break;
|
||||
//not implemented
|
||||
//not implemented
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -52,7 +72,7 @@ void gf_isom_datamap_close(GF_MediaInformationBox *minf)
|
||||
GF_DataEntryBox *ent;
|
||||
if (!minf || !minf->dataHandler) return;
|
||||
|
||||
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->boxList, minf->dataEntryIndex - 1);
|
||||
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->other_boxes, minf->dataEntryIndex - 1);
|
||||
|
||||
//if ent NULL, the data entry was not used (should never happen)
|
||||
if (ent == NULL) return;
|
||||
@@ -79,11 +99,11 @@ static Bool IsLargeFile(char *path)
|
||||
#ifndef _WIN32_WCE
|
||||
FILE *stream;
|
||||
s64 size;
|
||||
stream = gf_f64_open(path, "rb");
|
||||
stream = gf_fopen(path, "rb");
|
||||
if (!stream) return 0;
|
||||
gf_f64_seek(stream, 0, SEEK_END);
|
||||
size = gf_f64_tell(stream);
|
||||
fclose(stream);
|
||||
gf_fseek(stream, 0, SEEK_END);
|
||||
size = gf_ftell(stream);
|
||||
gf_fclose(stream);
|
||||
if (size == -1L) return 0;
|
||||
if (size > 0xFFFFFFFF) return 1;
|
||||
#endif
|
||||
@@ -109,12 +129,21 @@ GF_Err gf_isom_datamap_new(const char *location, const char *parentPath, u8 mode
|
||||
if (!strcmp(location, "mp4_tmp_edit")) {
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
*outDataMap = gf_isom_fdm_new_temp(parentPath);
|
||||
if (! (*outDataMap)) return GF_IO_ERR;
|
||||
if (!(*outDataMap)) {
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
return GF_OK;
|
||||
#else
|
||||
return GF_NOT_SUPPORTED;
|
||||
#endif
|
||||
}
|
||||
else if (!strncmp(location, "gmem://", 7)) {
|
||||
*outDataMap = gf_isom_fdm_new(location, GF_ISOM_DATA_MAP_READ);
|
||||
if (!(*outDataMap)) {
|
||||
return GF_IO_ERR;
|
||||
}
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
extern_file = !gf_url_is_local(location);
|
||||
|
||||
@@ -126,30 +155,45 @@ GF_Err gf_isom_datamap_new(const char *location, const char *parentPath, u8 mode
|
||||
}
|
||||
|
||||
//TEMP: however, only support for file right now (we'd have to add some callback functions at some point)
|
||||
if (extern_file) return GF_NOT_SUPPORTED;
|
||||
if (extern_file) {
|
||||
return GF_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
sPath = gf_url_get_absolute_path(location, parentPath);
|
||||
if (sPath == NULL) return GF_URL_ERROR;
|
||||
if (sPath == NULL) {
|
||||
return GF_URL_ERROR;
|
||||
}
|
||||
|
||||
if (mode == GF_ISOM_DATA_MAP_READ_ONLY) {
|
||||
mode = GF_ISOM_DATA_MAP_READ;
|
||||
/*It seems win32 file mapping is reported in prog mem usage -> large increases of occupancy. Should not be a pb
|
||||
/*It seems win32 file mapping is reported in prog mem usage -> large increases of occupancy. Should not be a pb
|
||||
but unless you want mapping, only regular IO will be used...*/
|
||||
#if 0
|
||||
if (IsLargeFile(sPath)) {
|
||||
*outDataMap = gf_isom_fdm_new(sPath, mode);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*outDataMap = gf_isom_fmo_new(sPath, mode);
|
||||
}
|
||||
#else
|
||||
*outDataMap = gf_isom_fdm_new(sPath, mode);
|
||||
#endif
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*outDataMap = gf_isom_fdm_new(sPath, mode);
|
||||
if (*outDataMap) {
|
||||
(*outDataMap)->szName = sPath;
|
||||
sPath = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (sPath) {
|
||||
gf_free(sPath);
|
||||
}
|
||||
if (!(*outDataMap)) {
|
||||
return GF_URL_ERROR;
|
||||
}
|
||||
|
||||
gf_free(sPath);
|
||||
if (! (*outDataMap)) return GF_URL_ERROR;
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -159,57 +203,67 @@ GF_Err gf_isom_datamap_open(GF_MediaBox *mdia, u32 dataRefIndex, u8 Edit)
|
||||
{
|
||||
GF_DataEntryBox *ent;
|
||||
GF_MediaInformationBox *minf;
|
||||
u32 SelfCont;
|
||||
u32 SelfCont, count;
|
||||
GF_Err e = GF_OK;
|
||||
if ((mdia == NULL) || (! mdia->information) || !dataRefIndex)
|
||||
if ((mdia == NULL) || (!mdia->information) || !dataRefIndex)
|
||||
return GF_ISOM_INVALID_MEDIA;
|
||||
|
||||
minf = mdia->information;
|
||||
|
||||
if (dataRefIndex > gf_list_count(minf->dataInformation->dref->boxList))
|
||||
return GF_BAD_PARAM;
|
||||
count = gf_list_count(minf->dataInformation->dref->other_boxes);
|
||||
if (!count) {
|
||||
SelfCont = 1;
|
||||
ent = NULL;
|
||||
}
|
||||
else {
|
||||
if (dataRefIndex > gf_list_count(minf->dataInformation->dref->other_boxes))
|
||||
return GF_BAD_PARAM;
|
||||
|
||||
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->boxList, dataRefIndex - 1);
|
||||
if (ent == NULL) return GF_ISOM_INVALID_MEDIA;
|
||||
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->other_boxes, dataRefIndex - 1);
|
||||
if (ent == NULL) return GF_ISOM_INVALID_MEDIA;
|
||||
|
||||
//if the current dataEntry is the desired one, and not self contained, return
|
||||
if ((minf->dataEntryIndex == dataRefIndex) && (ent->flags != 1)) {
|
||||
return GF_OK;
|
||||
//if the current dataEntry is the desired one, and not self contained, return
|
||||
if ((minf->dataEntryIndex == dataRefIndex) && (ent->flags != 1)) {
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
SelfCont = 0;
|
||||
switch (ent->type) {
|
||||
case GF_ISOM_BOX_TYPE_URL:
|
||||
case GF_ISOM_BOX_TYPE_URN:
|
||||
if (ent->flags == 1) SelfCont = 1;
|
||||
break;
|
||||
default:
|
||||
SelfCont = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//we need to open a new one
|
||||
//first close the existing one
|
||||
if (minf->dataHandler) gf_isom_datamap_close(minf);
|
||||
|
||||
SelfCont = 0;
|
||||
switch (ent->type) {
|
||||
case GF_ISOM_BOX_TYPE_URL:
|
||||
case GF_ISOM_BOX_TYPE_URN:
|
||||
if (ent->flags == 1) SelfCont = 1;
|
||||
break;
|
||||
default:
|
||||
SelfCont = 1;
|
||||
break;
|
||||
}
|
||||
//if self-contained, assign the input file
|
||||
if (SelfCont) {
|
||||
//if no edit, open the input file
|
||||
if (!Edit) {
|
||||
if (mdia->mediaTrack->moov->mov->movieFileMap == NULL) return GF_ISOM_INVALID_FILE;
|
||||
minf->dataHandler = mdia->mediaTrack->moov->mov->movieFileMap;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
if (mdia->mediaTrack->moov->mov->editFileMap == NULL) return GF_ISOM_INVALID_FILE;
|
||||
minf->dataHandler = mdia->mediaTrack->moov->mov->editFileMap;
|
||||
#else
|
||||
//this should never be the case in an read-only MP4 file
|
||||
return GF_BAD_PARAM;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
//else this is a URL (read mode only)
|
||||
} else {
|
||||
e = gf_isom_datamap_new(ent->location, mdia->mediaTrack->moov->mov->fileName, GF_ISOM_DATA_MAP_READ, & mdia->information->dataHandler);
|
||||
if (e) return (e==GF_URL_ERROR) ? GF_ISOM_UNKNOWN_DATA_REF : e;
|
||||
//else this is a URL (read mode only)
|
||||
}
|
||||
else {
|
||||
e = gf_isom_datamap_new(ent->location, mdia->mediaTrack->moov->mov->fileName, GF_ISOM_DATA_MAP_READ, &mdia->information->dataHandler);
|
||||
if (e) return (e == GF_URL_ERROR) ? GF_ISOM_UNKNOWN_DATA_REF : e;
|
||||
}
|
||||
//OK, set the data entry index
|
||||
minf->dataEntryIndex = dataRefIndex;
|
||||
@@ -233,6 +287,15 @@ u32 gf_isom_datamap_get_data(GF_DataMap *map, char *buffer, u32 bufferLength, u6
|
||||
}
|
||||
}
|
||||
|
||||
void gf_isom_datamap_flush(GF_DataMap *map)
|
||||
{
|
||||
if (!map) return;
|
||||
|
||||
if (map->type == GF_ISOM_DATA_FILE) {
|
||||
GF_FileDataMap *fdm = (GF_FileDataMap *)map;
|
||||
gf_bs_flush(fdm->bs);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
|
||||
@@ -255,7 +318,7 @@ u64 gf_isom_datamap_get_offset(GF_DataMap *map)
|
||||
|
||||
GF_Err gf_isom_datamap_add_data(GF_DataMap *ptr, char *data, u32 dataSize)
|
||||
{
|
||||
if (!ptr || !data|| !dataSize) return GF_BAD_PARAM;
|
||||
if (!ptr || !data || !dataSize) return GF_BAD_PARAM;
|
||||
|
||||
switch (ptr->type) {
|
||||
case GF_ISOM_DATA_FILE:
|
||||
@@ -267,22 +330,25 @@ GF_Err gf_isom_datamap_add_data(GF_DataMap *ptr, char *data, u32 dataSize)
|
||||
|
||||
GF_DataMap *gf_isom_fdm_new_temp(const char *sPath)
|
||||
{
|
||||
GF_FileDataMap *tmp = (GF_FileDataMap *) gf_malloc(sizeof(GF_FileDataMap));
|
||||
GF_FileDataMap *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_FileDataMap);
|
||||
if (!tmp) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_FileDataMap));
|
||||
|
||||
tmp->type = GF_ISOM_DATA_FILE;
|
||||
tmp->mode = GF_ISOM_DATA_MAP_WRITE;
|
||||
|
||||
if (!sPath) {
|
||||
tmp->stream = gf_temp_file_new();
|
||||
} else {
|
||||
tmp->stream = gf_temp_file_new(&tmp->temp_file);
|
||||
}
|
||||
else {
|
||||
char szPath[GF_MAX_PATH];
|
||||
if ((sPath[strlen(sPath)-1] != '\\') && (sPath[strlen(sPath)-1] != '/')) {
|
||||
sprintf(szPath, "%s%c%p_isotmp", sPath, GF_PATH_SEPARATOR, (void*) tmp);
|
||||
} else {
|
||||
sprintf(szPath, "%s%p_isotmp", sPath, (void*) tmp);
|
||||
if ((sPath[strlen(sPath) - 1] != '\\') && (sPath[strlen(sPath) - 1] != '/')) {
|
||||
sprintf(szPath, "%s%c%p_isotmp", sPath, GF_PATH_SEPARATOR, (void*)tmp);
|
||||
}
|
||||
tmp->stream = gf_f64_open(szPath, "w+b");
|
||||
else {
|
||||
sprintf(szPath, "%s%p_isotmp", sPath, (void*)tmp);
|
||||
}
|
||||
tmp->stream = gf_fopen(szPath, "w+b");
|
||||
tmp->temp_file = gf_strdup(szPath);
|
||||
}
|
||||
if (!tmp->stream) {
|
||||
@@ -292,49 +358,78 @@ GF_DataMap *gf_isom_fdm_new_temp(const char *sPath)
|
||||
}
|
||||
tmp->bs = gf_bs_from_file(tmp->stream, GF_BITSTREAM_WRITE);
|
||||
if (!tmp->bs) {
|
||||
fclose(tmp->stream);
|
||||
gf_fclose(tmp->stream);
|
||||
gf_free(tmp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (default_write_buffering_size) {
|
||||
gf_bs_set_output_buffering(tmp->bs, default_write_buffering_size);
|
||||
}
|
||||
|
||||
return (GF_DataMap *)tmp;
|
||||
}
|
||||
|
||||
#endif /*GPAC_DISABLE_ISOM_WRITE*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
GF_DataMap *gf_isom_fdm_new(const char *sPath, u8 mode)
|
||||
{
|
||||
u8 bs_mode;
|
||||
|
||||
GF_FileDataMap *tmp = (GF_FileDataMap *) gf_malloc(sizeof(GF_FileDataMap));
|
||||
GF_FileDataMap *tmp;
|
||||
GF_SAFEALLOC(tmp, GF_FileDataMap);
|
||||
if (!tmp) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_FileDataMap));
|
||||
|
||||
tmp->type = GF_ISOM_DATA_FILE;
|
||||
tmp->mode = mode;
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
//open a temp file
|
||||
if (!strcmp(sPath, "mp4_tmp_edit")) {
|
||||
//create a temp file (that only occurs in EDIT/WRITE mode)
|
||||
tmp->stream = gf_temp_file_new();
|
||||
bs_mode = GF_BITSTREAM_READ;
|
||||
//create a temp file (that only occurs in EDIT/WRITE mode)
|
||||
tmp->stream = gf_temp_file_new(&tmp->temp_file);
|
||||
// bs_mode = GF_BITSTREAM_READ;
|
||||
}
|
||||
#endif
|
||||
if (!strncmp(sPath, "gmem://", 7)) {
|
||||
u32 size;
|
||||
void *mem_address;
|
||||
if (sscanf(sPath, "gmem://%d@%p", &size, &mem_address) != 2)
|
||||
return NULL;
|
||||
tmp->bs = gf_bs_new((const char *)mem_address, size, GF_BITSTREAM_READ);
|
||||
if (!tmp->bs) {
|
||||
gf_free(tmp);
|
||||
return NULL;
|
||||
}
|
||||
return (GF_DataMap *)tmp;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case GF_ISOM_DATA_MAP_READ:
|
||||
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "rb");
|
||||
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "rb");
|
||||
bs_mode = GF_BITSTREAM_READ;
|
||||
break;
|
||||
///we open the file in READ/WRITE mode, in case
|
||||
///we open the file in READ/WRITE mode, in case
|
||||
case GF_ISOM_DATA_MAP_WRITE:
|
||||
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "w+b");
|
||||
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "wb");
|
||||
if (!strcmp(sPath, "std")) {
|
||||
tmp->stream = stdout;
|
||||
tmp->is_stdout = 1;
|
||||
}
|
||||
|
||||
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "w+b");
|
||||
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "wb");
|
||||
bs_mode = GF_BITSTREAM_WRITE;
|
||||
break;
|
||||
///we open the file in CAT mode, in case
|
||||
///we open the file in CAT mode, in case
|
||||
case GF_ISOM_DATA_MAP_CAT:
|
||||
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "a+b");
|
||||
if (tmp->stream) gf_f64_seek(tmp->stream, 0, SEEK_END);
|
||||
if (!strcmp(sPath, "std")) {
|
||||
tmp->stream = stdout;
|
||||
tmp->is_stdout = 1;
|
||||
}
|
||||
|
||||
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "a+b");
|
||||
if (tmp->stream) gf_fseek(tmp->stream, 0, SEEK_END);
|
||||
bs_mode = GF_BITSTREAM_WRITE;
|
||||
break;
|
||||
default:
|
||||
@@ -347,10 +442,13 @@ GF_DataMap *gf_isom_fdm_new(const char *sPath, u8 mode)
|
||||
}
|
||||
tmp->bs = gf_bs_from_file(tmp->stream, bs_mode);
|
||||
if (!tmp->bs) {
|
||||
fclose(tmp->stream);
|
||||
gf_fclose(tmp->stream);
|
||||
gf_free(tmp);
|
||||
return NULL;
|
||||
}
|
||||
if (default_write_buffering_size) {
|
||||
gf_bs_set_output_buffering(tmp->bs, default_write_buffering_size);
|
||||
}
|
||||
return (GF_DataMap *)tmp;
|
||||
}
|
||||
|
||||
@@ -358,7 +456,8 @@ void gf_isom_fdm_del(GF_FileDataMap *ptr)
|
||||
{
|
||||
if (!ptr || (ptr->type != GF_ISOM_DATA_FILE)) return;
|
||||
if (ptr->bs) gf_bs_del(ptr->bs);
|
||||
if (ptr->stream) fclose(ptr->stream);
|
||||
if (ptr->stream && !ptr->is_stdout)
|
||||
gf_fclose(ptr->stream);
|
||||
|
||||
#ifndef GPAC_DISABLE_ISOM_WRITE
|
||||
if (ptr->temp_file) {
|
||||
@@ -378,22 +477,30 @@ u32 gf_isom_fdm_get_data(GF_FileDataMap *ptr, char *buffer, u32 bufferLength, u6
|
||||
//can we seek till that point ???
|
||||
if (fileOffset > gf_bs_get_size(ptr->bs)) return 0;
|
||||
|
||||
//ouch, we are not at the previous location, do a seek
|
||||
if (ptr->curPos != fileOffset) {
|
||||
if (gf_bs_get_position(ptr->bs) != fileOffset) {
|
||||
//we are not at the previous location, do a seek
|
||||
if (gf_bs_seek(ptr->bs, fileOffset) != GF_OK) return 0;
|
||||
ptr->curPos = fileOffset;
|
||||
}
|
||||
ptr->curPos = fileOffset;
|
||||
|
||||
//read our data.
|
||||
bytesRead = gf_bs_read_data(ptr->bs, buffer, bufferLength);
|
||||
//update our cache
|
||||
if (bytesRead == bufferLength) {
|
||||
ptr->curPos += bytesRead;
|
||||
} else {
|
||||
//rewind to original (if seek fails, return 0 cause this means:
|
||||
//1- no support for seek on the platform
|
||||
//2- corrupted file for the OS
|
||||
fflush(ptr->stream);
|
||||
gf_bs_seek(ptr->bs, ptr->curPos);
|
||||
}
|
||||
else {
|
||||
gf_bs_get_refreshed_size(ptr->bs);
|
||||
gf_bs_seek(ptr->bs, fileOffset);
|
||||
bytesRead = gf_bs_read_data(ptr->bs, buffer, bufferLength);
|
||||
//update our cache
|
||||
if (bytesRead == bufferLength) {
|
||||
ptr->curPos += bytesRead;
|
||||
}
|
||||
else {
|
||||
gf_bs_seek(ptr->bs, ptr->curPos);
|
||||
bytesRead = 0;
|
||||
}
|
||||
}
|
||||
ptr->last_acces_was_read = 1;
|
||||
return bytesRead;
|
||||
@@ -438,7 +545,7 @@ GF_Err FDM_AddData(GF_FileDataMap *ptr, char *data, u32 dataSize)
|
||||
}
|
||||
ptr->curPos = gf_bs_get_position(ptr->bs);
|
||||
//flush the stream !!
|
||||
fflush(ptr->stream);
|
||||
if (ptr->stream) fflush(ptr->stream);
|
||||
return GF_OK;
|
||||
}
|
||||
|
||||
@@ -454,7 +561,6 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
|
||||
{
|
||||
GF_FileMappingDataMap *tmp;
|
||||
HANDLE fileH, fileMapH;
|
||||
DWORD err;
|
||||
#ifdef _WIN32_WCE
|
||||
unsigned short sWPath[MAX_PATH];
|
||||
#endif
|
||||
@@ -462,28 +568,28 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
|
||||
//only in read only
|
||||
if (mode != GF_ISOM_DATA_MAP_READ) return NULL;
|
||||
|
||||
tmp = (GF_FileMappingDataMap *) gf_malloc(sizeof(GF_FileMappingDataMap));
|
||||
GF_SAFEALLOC(tmp, GF_FileMappingDataMap);
|
||||
if (!tmp) return NULL;
|
||||
memset(tmp, 0, sizeof(GF_FileMappingDataMap));
|
||||
|
||||
tmp->type = GF_ISOM_DATA_FILE_MAPPING;
|
||||
tmp->mode = mode;
|
||||
tmp->mode = mode;
|
||||
tmp->name = gf_strdup(sPath);
|
||||
|
||||
//
|
||||
// Open the file
|
||||
// Open the file
|
||||
//
|
||||
#ifdef _WIN32_WCE
|
||||
//convert to WIDE
|
||||
CE_CharToWide((char *)sPath, sWPath);
|
||||
|
||||
fileH = CreateFileForMapping(sWPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
||||
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL );
|
||||
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL);
|
||||
#else
|
||||
fileH = CreateFile(sPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
||||
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL );
|
||||
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (fileH == INVALID_HANDLE_VALUE) {
|
||||
gf_free(tmp->name);
|
||||
gf_free(tmp);
|
||||
@@ -506,10 +612,9 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
|
||||
CloseHandle(fileH);
|
||||
gf_free(tmp->name);
|
||||
gf_free(tmp);
|
||||
err = GetLastError();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
tmp->byte_map = MapViewOfFile(fileMapH, FILE_MAP_READ, 0, 0, 0);
|
||||
if (tmp->byte_map == NULL) {
|
||||
CloseHandle(fileMapH);
|
||||
@@ -520,7 +625,7 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
|
||||
}
|
||||
|
||||
CloseHandle(fileH);
|
||||
CloseHandle(fileMapH);
|
||||
CloseHandle(fileMapH);
|
||||
|
||||
//finaly open our bitstream (from buffer)
|
||||
tmp->bs = gf_bs_new(tmp->byte_map, tmp->file_size, GF_BITSTREAM_READ);
|
||||
@@ -540,11 +645,8 @@ void gf_isom_fmo_del(GF_FileMappingDataMap *ptr)
|
||||
|
||||
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
|
||||
{
|
||||
u32 size;
|
||||
|
||||
//can we seek till that point ???
|
||||
if (fileOffset > ptr->file_size) return 0;
|
||||
size = (u32) fileOffset;
|
||||
|
||||
//we do only read operations, so trivial
|
||||
memcpy(buffer, ptr->byte_map + fileOffset, bufferLength);
|
||||
@@ -553,9 +655,13 @@ u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLen
|
||||
|
||||
#else
|
||||
|
||||
GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode) { return gf_isom_fdm_new(sPath, mode); }
|
||||
void gf_isom_fmo_del(GF_FileMappingDataMap *ptr) { gf_isom_fdm_del((GF_FileDataMap *)ptr); }
|
||||
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
|
||||
GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode) {
|
||||
return gf_isom_fdm_new(sPath, mode);
|
||||
}
|
||||
void gf_isom_fmo_del(GF_FileMappingDataMap *ptr) {
|
||||
gf_isom_fdm_del((GF_FileDataMap *)ptr);
|
||||
}
|
||||
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
|
||||
{
|
||||
return gf_isom_fdm_get_data((GF_FileDataMap *)ptr, buffer, bufferLength, fileOffset);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpac/internal/odf_dev.h>
|
||||
|
||||
@@ -73,7 +74,7 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
|
||||
case GF_ODF_MEDIATIME_TAG:
|
||||
return gf_odf_new_mediatime();
|
||||
|
||||
//File Format Specific
|
||||
//File Format Specific
|
||||
case GF_ODF_ISOM_IOD_TAG:
|
||||
return gf_odf_new_isom_iod();
|
||||
case GF_ODF_ISOM_OD_TAG:
|
||||
@@ -93,7 +94,7 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
|
||||
return gf_odf_new_sup_cid();
|
||||
case GF_ODF_IPI_PTR_TAG:
|
||||
return gf_odf_new_ipi_ptr();
|
||||
//special case for the file format
|
||||
//special case for the file format
|
||||
case GF_ODF_ISOM_IPI_PTR_TAG:
|
||||
desc = gf_odf_new_ipi_ptr();
|
||||
if (!desc) return desc;
|
||||
@@ -144,8 +145,8 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
|
||||
#endif /*GPAC_MINIMAL_ODF*/
|
||||
default:
|
||||
//ISO Reserved
|
||||
if ( (tag >= GF_ODF_ISO_RES_BEGIN_TAG) &&
|
||||
(tag <= GF_ODF_ISO_RES_END_TAG) ) {
|
||||
if ((tag >= GF_ODF_ISO_RES_BEGIN_TAG) &&
|
||||
(tag <= GF_ODF_ISO_RES_END_TAG)) {
|
||||
return NULL;
|
||||
}
|
||||
desc = gf_odf_new_default();
|
||||
@@ -161,13 +162,13 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
|
||||
GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
|
||||
{
|
||||
switch (desc->tag) {
|
||||
case GF_ODF_IOD_TAG :
|
||||
case GF_ODF_IOD_TAG:
|
||||
return gf_odf_del_iod((GF_InitialObjectDescriptor *)desc);
|
||||
case GF_ODF_OD_TAG:
|
||||
return gf_odf_del_od((GF_ObjectDescriptor *)desc);
|
||||
case GF_ODF_ESD_TAG :
|
||||
case GF_ODF_ESD_TAG:
|
||||
return gf_odf_del_esd((GF_ESD *)desc);
|
||||
case GF_ODF_DCD_TAG :
|
||||
case GF_ODF_DCD_TAG:
|
||||
return gf_odf_del_dcd((GF_DecoderConfig *)desc);
|
||||
case GF_ODF_SLC_TAG:
|
||||
return gf_odf_del_slc((GF_SLConfig *)desc);
|
||||
@@ -178,9 +179,9 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
|
||||
return gf_odf_del_isom_od((GF_IsomObjectDescriptor *)desc);
|
||||
|
||||
case GF_ODF_SEGMENT_TAG:
|
||||
return gf_odf_del_segment((GF_Segment *) desc);
|
||||
return gf_odf_del_segment((GF_Segment *)desc);
|
||||
case GF_ODF_MEDIATIME_TAG:
|
||||
return gf_odf_del_mediatime((GF_MediaTime *) desc);
|
||||
return gf_odf_del_mediatime((GF_MediaTime *)desc);
|
||||
|
||||
case GF_ODF_MUXINFO_TAG:
|
||||
return gf_odf_del_muxinfo((GF_MuxInfo *)desc);
|
||||
@@ -201,6 +202,11 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
|
||||
case GF_ODF_LANG_TAG:
|
||||
return gf_odf_del_lang((GF_Language *)desc);
|
||||
|
||||
case GF_ODF_ESD_INC_TAG:
|
||||
return gf_odf_del_esd_inc((GF_ES_ID_Inc *)desc);
|
||||
case GF_ODF_ESD_REF_TAG:
|
||||
return gf_odf_del_esd_ref((GF_ES_ID_Ref *)desc);
|
||||
|
||||
#ifndef GPAC_MINIMAL_ODF
|
||||
|
||||
case GF_ODF_CC_TAG:
|
||||
@@ -211,10 +217,6 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
|
||||
return gf_odf_del_cc_name((GF_CC_Name *)desc);
|
||||
case GF_ODF_CI_TAG:
|
||||
return gf_odf_del_ci((GF_CIDesc *)desc);
|
||||
case GF_ODF_ESD_INC_TAG:
|
||||
return gf_odf_del_esd_inc((GF_ES_ID_Inc *)desc);
|
||||
case GF_ODF_ESD_REF_TAG:
|
||||
return gf_odf_del_esd_ref((GF_ES_ID_Ref *)desc);
|
||||
case GF_ODF_TEXT_TAG:
|
||||
return gf_odf_del_exp_text((GF_ExpandedTextual *)desc);
|
||||
case GF_ODF_EXT_PL_TAG:
|
||||
@@ -269,18 +271,18 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
|
||||
GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSize)
|
||||
{
|
||||
switch (desc->tag) {
|
||||
case GF_ODF_IOD_TAG :
|
||||
case GF_ODF_IOD_TAG:
|
||||
return gf_odf_read_iod(bs, (GF_InitialObjectDescriptor *)desc, DescSize);
|
||||
case GF_ODF_ESD_TAG :
|
||||
case GF_ODF_ESD_TAG:
|
||||
return gf_odf_read_esd(bs, (GF_ESD *)desc, DescSize);
|
||||
case GF_ODF_DCD_TAG :
|
||||
case GF_ODF_DCD_TAG:
|
||||
return gf_odf_read_dcd(bs, (GF_DecoderConfig *)desc, DescSize);
|
||||
case GF_ODF_SLC_TAG :
|
||||
case GF_ODF_SLC_TAG:
|
||||
return gf_odf_read_slc(bs, (GF_SLConfig *)desc, DescSize);
|
||||
case GF_ODF_OD_TAG:
|
||||
return gf_odf_read_od(bs, (GF_ObjectDescriptor *)desc, DescSize);
|
||||
|
||||
//MP4 File Format
|
||||
//MP4 File Format
|
||||
case GF_ODF_ISOM_IOD_TAG:
|
||||
return gf_odf_read_isom_iod(bs, (GF_IsomInitialObjectDescriptor *)desc, DescSize);
|
||||
case GF_ODF_ISOM_OD_TAG:
|
||||
@@ -291,11 +293,11 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
|
||||
return gf_odf_read_esd_ref(bs, (GF_ES_ID_Ref *)desc, DescSize);
|
||||
|
||||
case GF_ODF_SEGMENT_TAG:
|
||||
return gf_odf_read_segment(bs, (GF_Segment *) desc, DescSize);
|
||||
return gf_odf_read_segment(bs, (GF_Segment *)desc, DescSize);
|
||||
case GF_ODF_MEDIATIME_TAG:
|
||||
return gf_odf_read_mediatime(bs, (GF_MediaTime *) desc, DescSize);
|
||||
return gf_odf_read_mediatime(bs, (GF_MediaTime *)desc, DescSize);
|
||||
case GF_ODF_MUXINFO_TAG:
|
||||
return gf_odf_read_muxinfo(bs, (GF_MuxInfo *) desc, DescSize);
|
||||
return gf_odf_read_muxinfo(bs, (GF_MuxInfo *)desc, DescSize);
|
||||
|
||||
case GF_ODF_AUX_VIDEO_DATA:
|
||||
return gf_odf_read_auxvid(bs, (GF_AuxVideoDescriptor *)desc, DescSize);
|
||||
@@ -344,14 +346,14 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
|
||||
return gf_odf_read_smpte_camera(bs, (GF_SMPTECamera *)desc, DescSize);
|
||||
case GF_ODF_SCI_TAG:
|
||||
return gf_odf_read_sup_cid(bs, (GF_SCIDesc *)desc, DescSize);
|
||||
|
||||
|
||||
case GF_ODF_IPMP_TL_TAG:
|
||||
return gf_odf_read_ipmp_tool_list(bs, (GF_IPMP_ToolList *)desc, DescSize);
|
||||
case GF_ODF_IPMP_TOOL_TAG:
|
||||
return gf_odf_read_ipmp_tool(bs, (GF_IPMP_Tool *)desc, DescSize);
|
||||
|
||||
#endif /*GPAC_MINIMAL_ODF*/
|
||||
//default:
|
||||
//default:
|
||||
case GF_ODF_DSI_TAG:
|
||||
default:
|
||||
return gf_odf_read_default(bs, (GF_DefaultDescriptor *)desc, DescSize);
|
||||
@@ -368,14 +370,14 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
|
||||
//
|
||||
GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
|
||||
{
|
||||
switch(desc->tag) {
|
||||
case GF_ODF_IOD_TAG :
|
||||
switch (desc->tag) {
|
||||
case GF_ODF_IOD_TAG:
|
||||
return gf_odf_size_iod((GF_InitialObjectDescriptor *)desc, outSize);
|
||||
case GF_ODF_ESD_TAG :
|
||||
case GF_ODF_ESD_TAG:
|
||||
return gf_odf_size_esd((GF_ESD *)desc, outSize);
|
||||
case GF_ODF_DCD_TAG :
|
||||
case GF_ODF_DCD_TAG:
|
||||
return gf_odf_size_dcd((GF_DecoderConfig *)desc, outSize);
|
||||
case GF_ODF_SLC_TAG :
|
||||
case GF_ODF_SLC_TAG:
|
||||
return gf_odf_size_slc((GF_SLConfig *)desc, outSize);
|
||||
|
||||
case GF_ODF_OD_TAG:
|
||||
@@ -390,12 +392,12 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
|
||||
return gf_odf_size_esd_ref((GF_ES_ID_Ref *)desc, outSize);
|
||||
|
||||
case GF_ODF_SEGMENT_TAG:
|
||||
return gf_odf_size_segment((GF_Segment *) desc, outSize);
|
||||
return gf_odf_size_segment((GF_Segment *)desc, outSize);
|
||||
case GF_ODF_MEDIATIME_TAG:
|
||||
return gf_odf_size_mediatime((GF_MediaTime *) desc, outSize);
|
||||
return gf_odf_size_mediatime((GF_MediaTime *)desc, outSize);
|
||||
case GF_ODF_MUXINFO_TAG:
|
||||
return gf_odf_size_muxinfo((GF_MuxInfo *) desc, outSize);
|
||||
|
||||
return gf_odf_size_muxinfo((GF_MuxInfo *)desc, outSize);
|
||||
|
||||
case GF_ODF_AUX_VIDEO_DATA:
|
||||
return gf_odf_size_auxvid((GF_AuxVideoDescriptor *)desc, outSize);
|
||||
|
||||
@@ -452,7 +454,7 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
|
||||
#endif /*GPAC_MINIMAL_ODF*/
|
||||
default:
|
||||
/*don't write out l descriptors*/
|
||||
if ((desc->tag>=GF_ODF_MUXINFO_TAG) && (desc->tag<=GF_ODF_LASER_CFG_TAG)) {
|
||||
if ((desc->tag >= GF_ODF_MUXINFO_TAG) && (desc->tag <= GF_ODF_LASER_CFG_TAG)) {
|
||||
*outSize = 0;
|
||||
return GF_OK;
|
||||
}
|
||||
@@ -467,14 +469,14 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
|
||||
//
|
||||
GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
|
||||
{
|
||||
switch(desc->tag) {
|
||||
case GF_ODF_IOD_TAG :
|
||||
switch (desc->tag) {
|
||||
case GF_ODF_IOD_TAG:
|
||||
return gf_odf_write_iod(bs, (GF_InitialObjectDescriptor *)desc);
|
||||
case GF_ODF_ESD_TAG :
|
||||
case GF_ODF_ESD_TAG:
|
||||
return gf_odf_write_esd(bs, (GF_ESD *)desc);
|
||||
case GF_ODF_DCD_TAG :
|
||||
case GF_ODF_DCD_TAG:
|
||||
return gf_odf_write_dcd(bs, (GF_DecoderConfig *)desc);
|
||||
case GF_ODF_SLC_TAG :
|
||||
case GF_ODF_SLC_TAG:
|
||||
return gf_odf_write_slc(bs, (GF_SLConfig *)desc);
|
||||
case GF_ODF_ESD_INC_TAG:
|
||||
return gf_odf_write_esd_inc(bs, (GF_ES_ID_Inc *)desc);
|
||||
@@ -489,11 +491,11 @@ GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
|
||||
case GF_ODF_OD_TAG:
|
||||
return gf_odf_write_od(bs, (GF_ObjectDescriptor *)desc);
|
||||
case GF_ODF_SEGMENT_TAG:
|
||||
return gf_odf_write_segment(bs, (GF_Segment *) desc);
|
||||
return gf_odf_write_segment(bs, (GF_Segment *)desc);
|
||||
case GF_ODF_MEDIATIME_TAG:
|
||||
return gf_odf_write_mediatime(bs, (GF_MediaTime *) desc);
|
||||
return gf_odf_write_mediatime(bs, (GF_MediaTime *)desc);
|
||||
case GF_ODF_MUXINFO_TAG:
|
||||
return gf_odf_write_muxinfo(bs, (GF_MuxInfo *) desc);
|
||||
return gf_odf_write_muxinfo(bs, (GF_MuxInfo *)desc);
|
||||
|
||||
case GF_ODF_AUX_VIDEO_DATA:
|
||||
return gf_odf_write_auxvid(bs, (GF_AuxVideoDescriptor *)desc);
|
||||
@@ -550,7 +552,7 @@ GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
|
||||
#endif /*GPAC_MINIMAL_ODF*/
|
||||
default:
|
||||
/*don't write out internal descriptors*/
|
||||
if ((desc->tag>=GF_ODF_MUXINFO_TAG) && (desc->tag<=GF_ODF_LASER_CFG_TAG))
|
||||
if ((desc->tag >= GF_ODF_MUXINFO_TAG) && (desc->tag <= GF_ODF_LASER_CFG_TAG))
|
||||
return GF_OK;
|
||||
return gf_odf_write_default(bs, (GF_DefaultDescriptor *)desc);
|
||||
}
|
||||
@@ -572,7 +574,7 @@ GF_ODCom *gf_odf_create_command(u8 tag)
|
||||
return gf_odf_new_esd_update();
|
||||
case GF_ODF_ESD_REMOVE_TAG:
|
||||
return gf_odf_new_esd_remove();
|
||||
//special case for ESDRemove in the file format...
|
||||
//special case for ESDRemove in the file format...
|
||||
case GF_ODF_ESD_REMOVE_REF_TAG:
|
||||
com = gf_odf_new_esd_remove();
|
||||
if (!com) return com;
|
||||
@@ -585,8 +587,8 @@ GF_ODCom *gf_odf_create_command(u8 tag)
|
||||
return gf_odf_new_ipmp_remove();
|
||||
|
||||
default:
|
||||
if ( (tag >= GF_ODF_COM_ISO_BEGIN_TAG) &&
|
||||
( tag <= GF_ODF_COM_ISO_END_TAG) ) {
|
||||
if ((tag >= GF_ODF_COM_ISO_BEGIN_TAG) &&
|
||||
(tag <= GF_ODF_COM_ISO_END_TAG)) {
|
||||
return NULL;
|
||||
}
|
||||
com = gf_odf_new_base_command();
|
||||
@@ -642,7 +644,7 @@ GF_Err gf_odf_read_command(GF_BitStream *bs, GF_ODCom *com, u32 gf_odf_size_comm
|
||||
case GF_ODF_IPMP_UPDATE_TAG:
|
||||
return gf_odf_read_ipmp_update(bs, (GF_IPMPUpdate *)com, gf_odf_size_command);
|
||||
case GF_ODF_IPMP_REMOVE_TAG:
|
||||
return gf_odf_read_ipmp_remove(bs, (GF_IPMPRemove *)com, gf_odf_size_command);
|
||||
return gf_odf_read_ipmp_remove(bs, (GF_IPMPRemove *)com, gf_odf_size_command);
|
||||
default:
|
||||
return gf_odf_read_base_command(bs, (GF_BaseODCom *)com, gf_odf_size_command);
|
||||
}
|
||||
@@ -697,7 +699,7 @@ GF_Err gf_odf_write_command(GF_BitStream *bs, GF_ODCom *com)
|
||||
return gf_odf_write_ipmp_update(bs, (GF_IPMPUpdate *)com);
|
||||
case GF_ODF_IPMP_REMOVE_TAG:
|
||||
return gf_odf_write_ipmp_remove(bs, (GF_IPMPRemove *)com);
|
||||
|
||||
|
||||
default:
|
||||
return gf_odf_write_base_command(bs, (GF_BaseODCom *)com);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1426
src/gpacmp4/drm_sample.c
Normal file
1426
src/gpacmp4/drm_sample.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / Authoring Tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / Authoring Tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GF_PARSERS_AV_H_
|
||||
#define _GF_PARSERS_AV_H_
|
||||
@@ -30,211 +31,292 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \file <gpac/avparse.h>
|
||||
* \brief Utility tools for audio and video raw media parsing.
|
||||
*/
|
||||
|
||||
/*! \defgroup media_grp Media Tools
|
||||
* You will find in this module the documentation of all media tools in GPAC.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
* \addtogroup avp_grp AV Parsing
|
||||
* \ingroup media_grp
|
||||
* \brief Utility tools for audio and video raw media parsing.
|
||||
*
|
||||
*This section documents the audio and video parsing functions of the GPAC framework.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#include <gpac/bitstream.h>
|
||||
|
||||
/*basic MPEG (1,2,4) visual object parser (DSI extraction and timing/framing)*/
|
||||
typedef struct
|
||||
{
|
||||
/*video PL*/
|
||||
u8 VideoPL;
|
||||
u8 RAP_stream, objectType, has_shape, enh_layer;
|
||||
/*video resolution*/
|
||||
u16 width, height;
|
||||
/*pixel aspect ratio*/
|
||||
u8 par_num, par_den;
|
||||
|
||||
u16 clock_rate;
|
||||
u8 NumBitsTimeIncrement;
|
||||
u32 time_increment;
|
||||
/*for MPEG 1/2*/
|
||||
Double fps;
|
||||
} GF_M4VDecSpecInfo;
|
||||
|
||||
|
||||
typedef struct __tag_m4v_parser GF_M4VParser;
|
||||
/*!
|
||||
Reduces input width/height to common aspect ration num/denum values
|
||||
\param width width of the aspect ratio
|
||||
\param height height of the aspect ratio
|
||||
*/
|
||||
void gf_media_reduce_aspect_ratio(u32 *width, u32 *height);
|
||||
|
||||
/*!
|
||||
Reduces input FPS to a more compact value (eg 25000/1000 -> 25/1)
|
||||
\param timescale timescale of the aspect ratio
|
||||
\param sample_dur sample duration of the aspect ratio in the given timescale
|
||||
*/
|
||||
void gf_media_get_reduced_frame_rate(u32 *timescale, u32 *sample_dur);
|
||||
|
||||
|
||||
/*basic MPEG (1,2,4) visual object parser (DSI extraction and timing/framing)*/
|
||||
typedef struct
|
||||
{
|
||||
/*video PL*/
|
||||
u8 VideoPL;
|
||||
u8 RAP_stream, objectType, has_shape, enh_layer;
|
||||
/*video resolution*/
|
||||
u16 width, height;
|
||||
/*pixel aspect ratio*/
|
||||
u8 par_num, par_den;
|
||||
|
||||
u16 clock_rate;
|
||||
u8 NumBitsTimeIncrement;
|
||||
u32 time_increment;
|
||||
/*for MPEG 1/2*/
|
||||
Double fps;
|
||||
|
||||
u32 next_object_start;
|
||||
} GF_M4VDecSpecInfo;
|
||||
|
||||
|
||||
typedef struct __tag_m4v_parser GF_M4VParser;
|
||||
|
||||
#ifndef GPAC_DISABLE_AV_PARSERS
|
||||
|
||||
GF_M4VParser *gf_m4v_parser_new(char *data, u64 data_size, Bool mpeg12video);
|
||||
GF_M4VParser *gf_m4v_parser_bs_new(GF_BitStream *bs, Bool mpeg12video);
|
||||
void gf_m4v_parser_del(GF_M4VParser *m4v);
|
||||
GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi);
|
||||
GF_M4VParser *gf_m4v_parser_new(char *data, u64 data_size, Bool mpeg12video);
|
||||
GF_M4VParser *gf_m4v_parser_bs_new(GF_BitStream *bs, Bool mpeg12video);
|
||||
void gf_m4v_parser_del(GF_M4VParser *m4v);
|
||||
GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi);
|
||||
|
||||
/*get a frame (can contain GOP). The parser ALWAYS resync on the next object in the bitstream
|
||||
thus you can seek the bitstream to copy the payload without re-seeking it */
|
||||
GF_Err gf_m4v_parse_frame(GF_M4VParser *m4v, GF_M4VDecSpecInfo dsi, u8 *frame_type, u32 *time_inc, u64 *size, u64 *start, Bool *is_coded);
|
||||
/*returns current object start in bitstream*/
|
||||
u64 gf_m4v_get_object_start(GF_M4VParser *m4v);
|
||||
/*returns 1 if current object is a valid MPEG-4 Visual object*/
|
||||
Bool gf_m4v_is_valid_object_type(GF_M4VParser *m4v);
|
||||
/*decodes DSI*/
|
||||
GF_Err gf_m4v_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
|
||||
/*rewrites PL code in DSI*/
|
||||
void gf_m4v_rewrite_pl(char **io_dsi, u32 *io_dsi_len, u8 PL);
|
||||
/*rewrites PAR code in DSI. Negative values will remove the par*/
|
||||
GF_Err gf_m4v_rewrite_par(char **o_data, u32 *o_dataLen, s32 par_n, s32 par_d);
|
||||
/*get a frame (can contain GOP). The parser ALWAYS resync on the next object in the bitstream
|
||||
thus you can seek the bitstream to copy the payload without re-seeking it */
|
||||
GF_Err gf_m4v_parse_frame(GF_M4VParser *m4v, GF_M4VDecSpecInfo dsi, u8 *frame_type, u32 *time_inc, u64 *size, u64 *start, Bool *is_coded);
|
||||
/*returns current object start in bitstream*/
|
||||
u64 gf_m4v_get_object_start(GF_M4VParser *m4v);
|
||||
/*returns 1 if current object is a valid MPEG-4 Visual object*/
|
||||
Bool gf_m4v_is_valid_object_type(GF_M4VParser *m4v);
|
||||
/*decodes DSI/VOSHeader for MPEG4*/
|
||||
GF_Err gf_m4v_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
|
||||
/*decodes DSI/VOSHeader for MPEG12*/
|
||||
GF_Err gf_mpegv12_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
|
||||
|
||||
/*rewrites PL code in DSI*/
|
||||
void gf_m4v_rewrite_pl(char **io_dsi, u32 *io_dsi_len, u8 PL);
|
||||
/*rewrites PAR code in DSI. Negative values will remove the par*/
|
||||
GF_Err gf_m4v_rewrite_par(char **o_data, u32 *o_dataLen, s32 par_n, s32 par_d);
|
||||
|
||||
#endif /*GPAC_DISABLE_AV_PARSERS*/
|
||||
|
||||
/*returns readable description of profile*/
|
||||
const char *gf_m4v_get_profile_name(u8 video_pl);
|
||||
/*returns readable description of profile*/
|
||||
const char *gf_m4v_get_profile_name(u8 video_pl);
|
||||
|
||||
#ifndef GPAC_DISABLE_AV_PARSERS
|
||||
s32 gf_mv12_next_start_code(unsigned char *pbuffer, u32 buflen, u32 *optr, u32 *scode);
|
||||
s32 gf_mv12_next_slice_start(unsigned char *pbuffer, u32 startoffset, u32 buflen, u32 *slice_offset);
|
||||
s32 gf_mv12_next_start_code(unsigned char *pbuffer, u32 buflen, u32 *optr, u32 *scode);
|
||||
s32 gf_mv12_next_slice_start(unsigned char *pbuffer, u32 startoffset, u32 buflen, u32 *slice_offset);
|
||||
|
||||
#endif /* GPAC_DISABLE_AV_PARSERS*/
|
||||
|
||||
#ifndef GPAC_DISABLE_AV_PARSERS
|
||||
|
||||
/*MP3 tools*/
|
||||
u8 gf_mp3_num_channels(u32 hdr);
|
||||
u16 gf_mp3_sampling_rate(u32 hdr);
|
||||
u16 gf_mp3_window_size(u32 hdr);
|
||||
u32 gf_mp3_bit_rate(u32 hdr);
|
||||
u8 gf_mp3_object_type_indication(u32 hdr);
|
||||
u8 gf_mp3_layer(u32 hdr);
|
||||
u16 gf_mp3_frame_size(u32 hdr);
|
||||
u32 gf_mp3_get_next_header(FILE* in);
|
||||
u32 gf_mp3_get_next_header_mem(const char *buffer, u32 size, u32 *pos);
|
||||
/*MP3 tools*/
|
||||
u8 gf_mp3_num_channels(u32 hdr);
|
||||
u16 gf_mp3_sampling_rate(u32 hdr);
|
||||
u16 gf_mp3_window_size(u32 hdr);
|
||||
u32 gf_mp3_bit_rate(u32 hdr);
|
||||
u8 gf_mp3_object_type_indication(u32 hdr);
|
||||
u8 gf_mp3_layer(u32 hdr);
|
||||
u16 gf_mp3_frame_size(u32 hdr);
|
||||
u32 gf_mp3_get_next_header(FILE* in);
|
||||
u32 gf_mp3_get_next_header_mem(const char *buffer, u32 size, u32 *pos);
|
||||
|
||||
#endif /*GPAC_DISABLE_AV_PARSERS*/
|
||||
|
||||
u8 gf_mp3_version(u32 hdr);
|
||||
const char *gf_mp3_version_name(u32 hdr);
|
||||
u8 gf_mp3_version(u32 hdr);
|
||||
const char *gf_mp3_version_name(u32 hdr);
|
||||
|
||||
|
||||
|
||||
#if !defined(GPAC_DISABLE_AV_PARSERS) && !defined (GPAC_DISABLE_OGG)
|
||||
|
||||
/*vorbis tools*/
|
||||
typedef struct
|
||||
{
|
||||
u32 sample_rate, channels, version;
|
||||
s32 max_r, avg_r, low_r;
|
||||
u32 min_block, max_block;
|
||||
/*vorbis tools*/
|
||||
typedef struct
|
||||
{
|
||||
u32 sample_rate, channels, version;
|
||||
s32 max_r, avg_r, low_r;
|
||||
u32 min_block, max_block;
|
||||
|
||||
/*do not touch, parser private*/
|
||||
Bool is_init;
|
||||
u32 modebits;
|
||||
Bool mode_flag[64];
|
||||
} GF_VorbisParser;
|
||||
/*do not touch, parser private*/
|
||||
Bool is_init;
|
||||
u32 modebits;
|
||||
Bool mode_flag[64];
|
||||
} GF_VorbisParser;
|
||||
|
||||
/*call with vorbis header packets - you MUST initialize the structure to 0 before!!
|
||||
returns 1 if success, 0 if error.*/
|
||||
Bool gf_vorbis_parse_header(GF_VorbisParser *vp, char *data, u32 data_len);
|
||||
/*returns 0 if init error or not a vorbis frame, otherwise returns the number of audio samples
|
||||
in this frame*/
|
||||
u32 gf_vorbis_check_frame(GF_VorbisParser *vp, char *data, u32 data_length);
|
||||
/*call with vorbis header packets - you MUST initialize the structure to 0 before!!
|
||||
returns 1 if success, 0 if error.*/
|
||||
Bool gf_vorbis_parse_header(GF_VorbisParser *vp, char *data, u32 data_len);
|
||||
/*returns 0 if init error or not a vorbis frame, otherwise returns the number of audio samples
|
||||
in this frame*/
|
||||
u32 gf_vorbis_check_frame(GF_VorbisParser *vp, char *data, u32 data_length);
|
||||
|
||||
#endif /*!defined(GPAC_DISABLE_AV_PARSERS) && !defined (GPAC_DISABLE_OGG)*/
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
GF_M4A_AAC_MAIN = 1,
|
||||
GF_M4A_AAC_LC = 2,
|
||||
GF_M4A_AAC_SSR = 3,
|
||||
GF_M4A_AAC_LTP = 4,
|
||||
GF_M4A_AAC_SBR = 5,
|
||||
GF_M4A_AAC_SCALABLE = 6,
|
||||
GF_M4A_TWINVQ = 7,
|
||||
GF_M4A_CELP = 8,
|
||||
GF_M4A_HVXC = 9,
|
||||
GF_M4A_TTSI = 12,
|
||||
GF_M4A_MAIN_SYNTHETIC = 13,
|
||||
GF_M4A_WAVETABLE_SYNTHESIS = 14,
|
||||
GF_M4A_GENERAL_MIDI = 15,
|
||||
GF_M4A_ALGO_SYNTH_AUDIO_FX = 16,
|
||||
GF_M4A_ER_AAC_LC = 17,
|
||||
GF_M4A_ER_AAC_LTP = 19,
|
||||
GF_M4A_ER_AAC_SCALABLE = 20,
|
||||
GF_M4A_ER_TWINVQ = 21,
|
||||
GF_M4A_ER_BSAC = 22,
|
||||
GF_M4A_ER_AAC_LD = 23,
|
||||
GF_M4A_ER_CELP = 24,
|
||||
GF_M4A_ER_HVXC = 25,
|
||||
GF_M4A_ER_HILN = 26,
|
||||
GF_M4A_ER_PARAMETRIC = 27,
|
||||
GF_M4A_SSC = 28,
|
||||
GF_M4A_AAC_PS = 29,
|
||||
GF_M4A_LAYER1 = 32,
|
||||
GF_M4A_LAYER2 = 33,
|
||||
GF_M4A_LAYER3 = 34,
|
||||
GF_M4A_DST = 35,
|
||||
GF_M4A_ALS = 36
|
||||
};
|
||||
enum
|
||||
{
|
||||
GF_M4A_AAC_MAIN = 1,
|
||||
GF_M4A_AAC_LC = 2,
|
||||
GF_M4A_AAC_SSR = 3,
|
||||
GF_M4A_AAC_LTP = 4,
|
||||
GF_M4A_AAC_SBR = 5,
|
||||
GF_M4A_AAC_SCALABLE = 6,
|
||||
GF_M4A_TWINVQ = 7,
|
||||
GF_M4A_CELP = 8,
|
||||
GF_M4A_HVXC = 9,
|
||||
GF_M4A_TTSI = 12,
|
||||
GF_M4A_MAIN_SYNTHETIC = 13,
|
||||
GF_M4A_WAVETABLE_SYNTHESIS = 14,
|
||||
GF_M4A_GENERAL_MIDI = 15,
|
||||
GF_M4A_ALGO_SYNTH_AUDIO_FX = 16,
|
||||
GF_M4A_ER_AAC_LC = 17,
|
||||
GF_M4A_ER_AAC_LTP = 19,
|
||||
GF_M4A_ER_AAC_SCALABLE = 20,
|
||||
GF_M4A_ER_TWINVQ = 21,
|
||||
GF_M4A_ER_BSAC = 22,
|
||||
GF_M4A_ER_AAC_LD = 23,
|
||||
GF_M4A_ER_CELP = 24,
|
||||
GF_M4A_ER_HVXC = 25,
|
||||
GF_M4A_ER_HILN = 26,
|
||||
GF_M4A_ER_PARAMETRIC = 27,
|
||||
GF_M4A_SSC = 28,
|
||||
GF_M4A_AAC_PS = 29,
|
||||
GF_M4A_LAYER1 = 32,
|
||||
GF_M4A_LAYER2 = 33,
|
||||
GF_M4A_LAYER3 = 34,
|
||||
GF_M4A_DST = 35,
|
||||
GF_M4A_ALS = 36
|
||||
};
|
||||
|
||||
#ifndef GPAC_DISABLE_AV_PARSERS
|
||||
|
||||
static const u32 GF_M4ASampleRates[] =
|
||||
{
|
||||
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
|
||||
16000, 12000, 11025, 8000, 7350, 0, 0, 0
|
||||
};
|
||||
static const u32 GF_M4ASampleRates[] =
|
||||
{
|
||||
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
|
||||
16000, 12000, 11025, 8000, 7350, 0, 0, 0
|
||||
};
|
||||
|
||||
/*get Audio type from dsi. return audio codec type:*/
|
||||
typedef struct
|
||||
{
|
||||
u32 nb_chan;
|
||||
u32 base_object_type, base_sr, base_sr_index;
|
||||
/*SBR*/
|
||||
Bool has_sbr;
|
||||
u32 sbr_object_type, sbr_sr, sbr_sr_index;
|
||||
/*PS*/
|
||||
Bool has_ps;
|
||||
/*PL indication*/
|
||||
u8 audioPL;
|
||||
} GF_M4ADecSpecInfo;
|
||||
/*parses dsi and updates audioPL*/
|
||||
GF_Err gf_m4a_get_config(char *dsi, u32 dsi_size, GF_M4ADecSpecInfo *cfg);
|
||||
/*gets audioPL for given cfg*/
|
||||
u32 gf_m4a_get_profile(GF_M4ADecSpecInfo *cfg);
|
||||
/*new values should now be defined in 23001-8*/
|
||||
static const u32 GF_M4ANumChannels[] =
|
||||
{
|
||||
1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14
|
||||
};
|
||||
|
||||
GF_Err gf_m4a_write_config(GF_M4ADecSpecInfo *cfg, char **dsi, u32 *dsi_size);
|
||||
GF_Err gf_m4a_write_config_bs(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg);
|
||||
GF_Err gf_m4a_parse_config(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg, Bool size_known);
|
||||
/*returns channel config value (as written in AAC DSI) for the given number of channels*/
|
||||
u32 gf_m4a_get_channel_cfg(u32 nb_chan);
|
||||
|
||||
/*get Audio type from dsi. return audio codec type:*/
|
||||
typedef struct
|
||||
{
|
||||
u32 nb_chan;
|
||||
u32 base_object_type, base_sr, base_sr_index;
|
||||
/*SBR*/
|
||||
Bool has_sbr;
|
||||
u32 sbr_object_type, sbr_sr, sbr_sr_index;
|
||||
/*PS*/
|
||||
Bool has_ps;
|
||||
/*PL indication*/
|
||||
u8 audioPL;
|
||||
|
||||
/*program config element*/
|
||||
Bool program_config_element_present, mono_mixdown_present, stereo_mixdown_present, matrix_mixdown_idx_present, pseudo_surround_enable;
|
||||
u8 element_instance_tag, object_type, sampling_frequency_index, num_front_channel_elements, num_side_channel_elements, num_back_channel_elements, num_lfe_channel_elements, num_assoc_data_elements, num_valid_cc_elements;
|
||||
u8 mono_mixdown_element_number, stereo_mixdown_element_number, matrix_mixdown_idx;
|
||||
|
||||
u8 front_element_is_cpe[15], front_element_tag_select[15];
|
||||
u8 side_element_is_cpe[15], side_element_tag_select[15];
|
||||
u8 back_element_is_cpe[15], back_element_tag_select[15];
|
||||
u8 lfe_element_tag_select[15];
|
||||
u8 assoc_data_element_tag_select[15];
|
||||
u8 cc_element_is_ind_sw[15], valid_cc_element_tag_select[15];
|
||||
u8 comment_field_bytes;
|
||||
u8 comments[255];
|
||||
} GF_M4ADecSpecInfo;
|
||||
|
||||
/*parses dsi and updates audioPL*/
|
||||
GF_Err gf_m4a_get_config(char *dsi, u32 dsi_size, GF_M4ADecSpecInfo *cfg);
|
||||
/*gets audioPL for given cfg*/
|
||||
u32 gf_m4a_get_profile(GF_M4ADecSpecInfo *cfg);
|
||||
|
||||
GF_Err gf_m4a_write_config(GF_M4ADecSpecInfo *cfg, char **dsi, u32 *dsi_size);
|
||||
GF_Err gf_m4a_write_config_bs(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg);
|
||||
GF_Err gf_m4a_parse_config(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg, Bool size_known);
|
||||
|
||||
#endif /*GPAC_DISABLE_AV_PARSERS*/
|
||||
|
||||
const char *gf_m4a_object_type_name(u32 objectType);
|
||||
const char *gf_m4a_get_profile_name(u8 audio_pl);
|
||||
const char *gf_m4a_object_type_name(u32 objectType);
|
||||
const char *gf_m4a_get_profile_name(u8 audio_pl);
|
||||
|
||||
#ifndef GPAC_DISABLE_AV_PARSERS
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 bitrate;
|
||||
u32 sample_rate;
|
||||
u32 framesize;
|
||||
u32 channels;
|
||||
/*only set if full parse*/
|
||||
u8 fscod, bsid, bsmod, acmod, lfon, brcode;
|
||||
} GF_AC3Header;
|
||||
typedef struct
|
||||
{
|
||||
u32 bitrate;
|
||||
u32 sample_rate;
|
||||
u32 framesize;
|
||||
u32 channels;
|
||||
u16 substreams; //bit-mask, used for channel map > 5.1
|
||||
/*only set if full parse*/
|
||||
u8 fscod, bsid, bsmod, acmod, lfon, brcode;
|
||||
} GF_AC3Header;
|
||||
|
||||
Bool gf_ac3_parser(u8 *buffer, u32 buffer_size, u32 *pos, GF_AC3Header *out_hdr, Bool full_parse);
|
||||
Bool gf_ac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
|
||||
u32 gf_ac3_get_channels(u32 acmod);
|
||||
u32 gf_ac3_get_bitrate(u32 brcode);
|
||||
Bool gf_ac3_parser(u8 *buffer, u32 buffer_size, u32 *pos, GF_AC3Header *out_hdr, Bool full_parse);
|
||||
Bool gf_ac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
|
||||
Bool gf_eac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
|
||||
u32 gf_ac3_get_channels(u32 acmod);
|
||||
u32 gf_ac3_get_bitrate(u32 brcode);
|
||||
|
||||
GF_Err gf_avc_get_sps_info(char *sps, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
|
||||
const char *gf_avc_get_profile_name(u8 video_prof);
|
||||
GF_Err gf_avc_get_sps_info(char *sps, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
|
||||
GF_Err gf_avc_get_pps_info(char *pps, u32 pps_size, u32 *pps_id, u32 *sps_id);
|
||||
|
||||
//hevc_state is optional but shall be used for layer extensions since all size info is in VPS and not SPS
|
||||
GF_Err gf_hevc_get_sps_info(char *sps_data, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
|
||||
#endif /*GPAC_DISABLE_AV_PARSERS*/
|
||||
|
||||
//get chroma format name from chroma format (1: 420, 2: 422, 3: 444
|
||||
const char * gf_avc_hevc_get_chroma_format_name(u8 chroma_format);
|
||||
/*get AVC profile name from profile indication*/
|
||||
const char *gf_avc_get_profile_name(u8 profile_idc);
|
||||
/*returns true if given profile is in range extensions*/
|
||||
Bool gf_avc_is_rext_profile(u8 profile_idc);
|
||||
/*get HEVC profile name from profile indication*/
|
||||
const char *gf_hevc_get_profile_name(u8 profile_idc);
|
||||
|
||||
|
||||
/*gets image size (bs must contain the whole image)
|
||||
@OTI: image type (JPEG=0x6C, PNG=0x6D)
|
||||
@width, height: image resolution - for jpeg max size if thumbnail included*/
|
||||
void gf_img_parse(GF_BitStream *bs, u8 *OTI, u32 *mtype, u32 *width, u32 *height, char **dsi, u32 *dsi_len);
|
||||
/*gets image size (bs must contain the whole image)
|
||||
@OTI: image type (JPEG=0x6C, PNG=0x6D)
|
||||
@width, height: image resolution - for jpeg max size if thumbnail included*/
|
||||
void gf_img_parse(GF_BitStream *bs, u8 *OTI, u32 *mtype, u32 *width, u32 *height, char **dsi, u32 *dsi_len);
|
||||
|
||||
GF_Err gf_img_jpeg_dec(char *jpg, u32 jpg_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size, u32 dst_nb_comp);
|
||||
GF_Err gf_img_jpeg_dec(char *jpg, u32 jpg_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size, u32 dst_nb_comp);
|
||||
|
||||
GF_Err gf_img_png_dec(char *png, u32 png_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size);
|
||||
GF_Err gf_img_file_dec(char *png_file, u32 *oti, u32 *width, u32 *height, u32 *pixel_format, char **dst, u32 *dst_size);
|
||||
GF_Err gf_img_png_enc(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst, u32 *dst_size);
|
||||
GF_Err gf_img_png_dec(char *png, u32 png_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size);
|
||||
GF_Err gf_img_file_dec(char *png_file, u32 *oti, u32 *width, u32 *height, u32 *pixel_format, char **dst, u32 *dst_size);
|
||||
GF_Err gf_img_png_enc(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst, u32 *dst_size);
|
||||
GF_Err gf_img_png_enc_file(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst_file);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GF_BASE_CODING_H_
|
||||
#define _GF_BASE_CODING_H_
|
||||
@@ -29,77 +30,79 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \file <gpac/base_coding.h>
|
||||
* \brief Base coding functions.
|
||||
*/
|
||||
/*!
|
||||
* \file <gpac/base_coding.h>
|
||||
* \brief Base 16 and 64 coding.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \addtogroup bascod_grp base coding
|
||||
* \ingroup utils_grp
|
||||
* \brief Base Coding functions
|
||||
*
|
||||
* This section documents the base encoding and decoding functions of the GPAC framework.
|
||||
* @{
|
||||
*/
|
||||
/*!
|
||||
* \addtogroup bascod_grp Base coding
|
||||
* \ingroup utils_grp
|
||||
* \brief Base 16 and 64 coding
|
||||
*
|
||||
* This section documents the base encoding and decoding functions of the GPAC framework.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gpac/tools.h>
|
||||
|
||||
/*!
|
||||
*\brief base64 encoder
|
||||
*
|
||||
*Encodes a data buffer to Base64
|
||||
*\param in_buffer input data buffer
|
||||
*\param in_buffer_size input data buffer size
|
||||
*\param out_buffer output Base64 buffer location
|
||||
*\param out_buffer_size output Base64 buffer allocated size
|
||||
*\return size of the encoded Base64 buffer
|
||||
*\note the encoded data buffer is not NULL-terminated.
|
||||
*/
|
||||
u32 gf_base64_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
/*!
|
||||
*\brief base64 decoder
|
||||
*
|
||||
*Decodes a Base64 buffer to data
|
||||
*\param in_buffer input Base64 buffer
|
||||
*\param in_buffer_size input Base64 buffer size
|
||||
*\param out_buffer output data buffer location
|
||||
*\param out_buffer_size output data buffer allocated size
|
||||
*\return size of the decoded buffer
|
||||
*/
|
||||
u32 gf_base64_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
#ifndef GPAC_DISABLE_CORE_TOOLS
|
||||
|
||||
/*!
|
||||
*\brief base16 encoder
|
||||
*
|
||||
*Encodes a data buffer to Base16
|
||||
*\param in_buffer input data buffer
|
||||
*\param in_buffer_size input data buffer size
|
||||
*\param out_buffer output Base16 buffer location
|
||||
*\param out_buffer_size output Base16 buffer allocated size
|
||||
*\return size of the encoded Base16 buffer
|
||||
*\note the encoded data buffer is not NULL-terminated.
|
||||
*/
|
||||
u32 gf_base16_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
/*!
|
||||
*\brief base64 encoder
|
||||
*
|
||||
*Encodes a data buffer to Base64
|
||||
*\param in_buffer input data buffer
|
||||
*\param in_buffer_size input data buffer size
|
||||
*\param out_buffer output Base64 buffer location
|
||||
*\param out_buffer_size output Base64 buffer allocated size
|
||||
*\return size of the encoded Base64 buffer
|
||||
*\note the encoded data buffer is not NULL-terminated.
|
||||
*/
|
||||
u32 gf_base64_encode(const char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
/*!
|
||||
*\brief base64 decoder
|
||||
*
|
||||
*Decodes a Base64 buffer to data
|
||||
*\param in_buffer input Base64 buffer
|
||||
*\param in_buffer_size input Base64 buffer size
|
||||
*\param out_buffer output data buffer location
|
||||
*\param out_buffer_size output data buffer allocated size
|
||||
*\return size of the decoded buffer
|
||||
*/
|
||||
u32 gf_base64_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
|
||||
/*!
|
||||
*\brief base16 decoder
|
||||
*
|
||||
*Decodes a Base16 buffer to data
|
||||
*\param in_buffer input Base16 buffer
|
||||
*\param in_buffer_size input Base16 buffer size
|
||||
*\param out_buffer output data buffer location
|
||||
*\param out_buffer_size output data buffer allocated size
|
||||
*\return size of the decoded buffer
|
||||
*/
|
||||
u32 gf_base16_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
/*!
|
||||
*\brief base16 encoder
|
||||
*
|
||||
*Encodes a data buffer to Base16
|
||||
*\param in_buffer input data buffer
|
||||
*\param in_buffer_size input data buffer size
|
||||
*\param out_buffer output Base16 buffer location
|
||||
*\param out_buffer_size output Base16 buffer allocated size
|
||||
*\return size of the encoded Base16 buffer
|
||||
*\note the encoded data buffer is not NULL-terminated.
|
||||
*/
|
||||
u32 gf_base16_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
|
||||
/*! @} */
|
||||
/*!
|
||||
*\brief base16 decoder
|
||||
*
|
||||
*Decodes a Base16 buffer to data
|
||||
*\param in_buffer input Base16 buffer
|
||||
*\param in_buffer_size input Base16 buffer size
|
||||
*\param out_buffer output data buffer location
|
||||
*\param out_buffer_size output data buffer allocated size
|
||||
*\return size of the decoded buffer
|
||||
*/
|
||||
u32 gf_base16_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*GPAC_DISABLE_CORE_TOOLS*/
|
||||
|
||||
#endif /*_GF_BASE_CODING_H_*/
|
||||
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) Jean Le Feuvre 2000-2005
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GF_BITSTREAM_H_
|
||||
#define _GF_BITSTREAM_H_
|
||||
@@ -29,436 +30,504 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \file <gpac/bitstream.h>
|
||||
* \brief bitstream functions.
|
||||
*/
|
||||
/*!
|
||||
* \file <gpac/bitstream.h>
|
||||
* \brief bitstream reading and writing.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \addtogroup bs_grp bitstream
|
||||
* \ingroup utils_grp
|
||||
* \brief BitStream object
|
||||
*
|
||||
* This section documents the bitstream object of the GPAC framework.
|
||||
* \note Unless specified, all functions assume Big-Endian ordering of data in the bitstream.
|
||||
* @{
|
||||
*/
|
||||
/*!
|
||||
* \addtogroup bs_grp Bitstream
|
||||
* \ingroup utils_grp
|
||||
* \brief BitStream object
|
||||
*
|
||||
* This section documents the bitstream object of the GPAC framework.
|
||||
* \note Unless specified, all functions assume Big-Endian ordering of data in the bitstream.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gpac/tools.h>
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
GF_BITSTREAM_READ = 0,
|
||||
GF_BITSTREAM_WRITE
|
||||
};
|
||||
enum
|
||||
{
|
||||
GF_BITSTREAM_READ = 0,
|
||||
GF_BITSTREAM_WRITE
|
||||
};
|
||||
|
||||
typedef struct __tag_bitstream GF_BitStream;
|
||||
typedef struct __tag_bitstream GF_BitStream;
|
||||
|
||||
/*!
|
||||
* \brief bitstream constructor
|
||||
*
|
||||
* Constructs a bitstream from a buffer (read or write mode)
|
||||
* \param buffer buffer to read or write. In WRITE mode, this can be NULL to let the bitstream object dynamically allocate memory, in which case the size param is ignored.
|
||||
* \param size size of the buffer given.
|
||||
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
|
||||
* \return new bitstream object
|
||||
* \note In write mode on an existing data buffer, data overflow is never signaled but simply ignored, it is the caller responsability to ensure it
|
||||
* does not write more than possible.
|
||||
*/
|
||||
GF_BitStream *gf_bs_new(const char *buffer, u64 size, u32 mode);
|
||||
/*!
|
||||
* \brief bitstream constructor from file handle
|
||||
*
|
||||
* Creates a bitstream from a file handle.
|
||||
* \param f handle of the file to use. This handle must be created with binary mode.
|
||||
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
|
||||
* \return new bitstream object
|
||||
* \note - You have to open your file in the appropriated mode:\n
|
||||
* - GF_BITSTREAM_READ: bitstream is constructed for reading\n
|
||||
* - GF_BITSTREAM_WRITE: bitstream is constructed for writing\n
|
||||
* \note - you may use any of these modes for a file with read/write access.
|
||||
* \warning RESULTS ARE UNEXPECTED IF YOU TOUCH THE FILE WHILE USING THE BITSTREAM.
|
||||
*/
|
||||
GF_BitStream *gf_bs_from_file(FILE *f, u32 mode);
|
||||
/*!
|
||||
* \brief bitstream constructor from file handle
|
||||
*
|
||||
* Deletes the bitstream object. If the buffer was created by the bitstream, it is deleted if still present.
|
||||
*/
|
||||
void gf_bs_del(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief bitstream constructor
|
||||
*
|
||||
* Constructs a bitstream from a buffer (read or write mode)
|
||||
* \param buffer buffer to read or write. In WRITE mode, this can be NULL to let the bitstream object dynamically allocate memory, in which case the size param is ignored.
|
||||
* \param size size of the buffer given.
|
||||
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
|
||||
* \return new bitstream object
|
||||
* \note In write mode on an existing data buffer, data overflow is never signaled but simply ignored, it is the caller responsability to ensure it
|
||||
* does not write more than possible.
|
||||
*/
|
||||
GF_BitStream *gf_bs_new(const char *buffer, u64 size, u32 mode);
|
||||
/*!
|
||||
* \brief bitstream constructor from file handle
|
||||
*
|
||||
* Creates a bitstream from a file handle.
|
||||
* \param f handle of the file to use. This handle must be created with binary mode.
|
||||
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
|
||||
* \return new bitstream object
|
||||
* \note - You have to open your file in the appropriated mode:\n
|
||||
* - GF_BITSTREAM_READ: bitstream is constructed for reading\n
|
||||
* - GF_BITSTREAM_WRITE: bitstream is constructed for writing\n
|
||||
* \note - you may use any of these modes for a file with read/write access.
|
||||
* \warning RESULTS ARE UNEXPECTED IF YOU TOUCH THE FILE WHILE USING THE BITSTREAM.
|
||||
*/
|
||||
GF_BitStream *gf_bs_from_file(FILE *f, u32 mode);
|
||||
/*!
|
||||
* \brief bitstream constructor from file handle
|
||||
*
|
||||
* Deletes the bitstream object. If the buffer was created by the bitstream, it is deleted if still present.
|
||||
*/
|
||||
void gf_bs_del(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief integer reading
|
||||
*
|
||||
* Reads an integer coded on a number of bit.
|
||||
* \param bs the target bitstream
|
||||
* \param nBits the number of bits to read
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_int(GF_BitStream *bs, u32 nBits);
|
||||
/*!
|
||||
* \brief large integer reading
|
||||
*
|
||||
* Reads a large integer coded on a number of bit bigger than 32.
|
||||
* \param bs the target bitstream
|
||||
* \param nBits the number of bits to read
|
||||
* \return the large integer value read.
|
||||
*/
|
||||
u64 gf_bs_read_long_int(GF_BitStream *bs, u32 nBits);
|
||||
/*!
|
||||
* \brief float reading
|
||||
*
|
||||
* Reads a float coded as IEEE 32 bit format.
|
||||
* \param bs the target bitstream
|
||||
* \return the float value read.
|
||||
*/
|
||||
Float gf_bs_read_float(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief double reading
|
||||
*
|
||||
* Reads a double coded as IEEE 64 bit format.
|
||||
* \param bs the target bitstream
|
||||
* \return the double value read.
|
||||
*/
|
||||
Double gf_bs_read_double(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief data reading
|
||||
*
|
||||
* Reads a data buffer
|
||||
* \param bs the target bitstream
|
||||
* \param data the data buffer to be filled
|
||||
* \param nbBytes the amount of bytes to read
|
||||
* \return the number of bytes actually read.
|
||||
* \warning the data buffer passed must be large enough to hold the desired amount of bytes.
|
||||
*/
|
||||
u32 gf_bs_read_data(GF_BitStream *bs, char *data, u32 nbBytes);
|
||||
|
||||
/*!
|
||||
* \brief align char reading
|
||||
*
|
||||
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the char value read.
|
||||
*/
|
||||
u32 gf_bs_read_u8(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align short reading
|
||||
*
|
||||
* Reads an integer coded on 16 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the short value read.
|
||||
*/
|
||||
u32 gf_bs_read_u16(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align 24-bit integer reading
|
||||
*
|
||||
* Reads an integer coded on 24 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u24(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align integer reading
|
||||
*
|
||||
* Reads an integer coded on 32 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u32(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align large integer reading
|
||||
*
|
||||
* Reads an integer coded on 64 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the large integer value read.
|
||||
*/
|
||||
u64 gf_bs_read_u64(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief little endian integer reading
|
||||
*
|
||||
* Reads an integer coded on 32 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u32_le(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief little endian integer reading
|
||||
*
|
||||
* Reads an integer coded on 16 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u16 gf_bs_read_u16_le(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief sets bitstream write cache size
|
||||
*
|
||||
* Sets the write cache size for file-based bitstreams.
|
||||
* \param bs the target bitstream
|
||||
* \param size size of the write cache in bytes
|
||||
* \return error if any.
|
||||
*/
|
||||
GF_Err gf_bs_set_output_buffering(GF_BitStream *bs, u32 size);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief variable length integer reading
|
||||
*
|
||||
* Reads an integer coded on a variable number of 4-bits chunks. The number of chunks is given by the number of non-0 bits at the begining.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_vluimsbf5(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief gets bitstream write cache size
|
||||
*
|
||||
* Gets the write cache size for file-based bitstreams.
|
||||
* \param bs the target bitstream
|
||||
* \return size of the write cache in bytes, 0 if no cache
|
||||
*/
|
||||
u32 gf_bs_get_output_buffering(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief bit position
|
||||
*
|
||||
* Returns current bit position in the bitstream - only works in memory mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_get_bit_offset(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief integer reading
|
||||
*
|
||||
* Reads an integer coded on a number of bit.
|
||||
* \param bs the target bitstream
|
||||
* \param nBits the number of bits to read
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_int(GF_BitStream *bs, u32 nBits);
|
||||
/*!
|
||||
* \brief large integer reading
|
||||
*
|
||||
* Reads a large integer coded on a number of bit bigger than 32.
|
||||
* \param bs the target bitstream
|
||||
* \param nBits the number of bits to read
|
||||
* \return the large integer value read.
|
||||
*/
|
||||
u64 gf_bs_read_long_int(GF_BitStream *bs, u32 nBits);
|
||||
/*!
|
||||
* \brief float reading
|
||||
*
|
||||
* Reads a float coded as IEEE 32 bit format.
|
||||
* \param bs the target bitstream
|
||||
* \return the float value read.
|
||||
*/
|
||||
Float gf_bs_read_float(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief double reading
|
||||
*
|
||||
* Reads a double coded as IEEE 64 bit format.
|
||||
* \param bs the target bitstream
|
||||
* \return the double value read.
|
||||
*/
|
||||
Double gf_bs_read_double(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief data reading
|
||||
*
|
||||
* Reads a data buffer
|
||||
* \param bs the target bitstream
|
||||
* \param data the data buffer to be filled
|
||||
* \param nbBytes the amount of bytes to read
|
||||
* \return the number of bytes actually read.
|
||||
* \warning the data buffer passed must be large enough to hold the desired amount of bytes.
|
||||
*/
|
||||
u32 gf_bs_read_data(GF_BitStream *bs, char *data, u32 nbBytes);
|
||||
|
||||
/*!
|
||||
* \brief current bit position
|
||||
*
|
||||
* Returns bit position in the current byte of the bitstream - only works in memory mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_get_bit_position(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align char reading
|
||||
*
|
||||
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the char value read.
|
||||
*/
|
||||
u32 gf_bs_read_u8(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief align char reading until reaching the given value
|
||||
*
|
||||
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream until
|
||||
* the given appears on the bitstream.
|
||||
* \note the bytes read in the bitstream will only be update if the delimiter is found
|
||||
* \param bs the target bitstream
|
||||
* \param delimiter the stop condition
|
||||
* \param out the resulting value
|
||||
* \param max_length the maximum length of the output
|
||||
* \return the number of value read.
|
||||
*/
|
||||
u32 gf_bs_read_u8_until_delimiter(GF_BitStream *bs, u8 delimiter, u8* out, u32 max_length);
|
||||
|
||||
/*!
|
||||
* \brief align short reading
|
||||
*
|
||||
* Reads an integer coded on 16 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the short value read.
|
||||
*/
|
||||
u32 gf_bs_read_u16(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align 24-bit integer reading
|
||||
*
|
||||
* Reads an integer coded on 24 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u24(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align integer reading
|
||||
*
|
||||
* Reads an integer coded on 32 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u32(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief align large integer reading
|
||||
*
|
||||
* Reads an integer coded on 64 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \return the large integer value read.
|
||||
*/
|
||||
u64 gf_bs_read_u64(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief little endian integer reading
|
||||
*
|
||||
* Reads an integer coded on 32 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_u32_le(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief little endian integer reading
|
||||
*
|
||||
* Reads an integer coded on 16 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u16 gf_bs_read_u16_le(GF_BitStream *bs);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief integer writing
|
||||
*
|
||||
* Writes an integer on a given number of bits.
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer to write
|
||||
* \param nBits number of bits used to code the integer
|
||||
*/
|
||||
void gf_bs_write_int(GF_BitStream *bs, s32 value, s32 nBits);
|
||||
/*!
|
||||
* \brief large integer writing
|
||||
*
|
||||
* Writes an integer on a given number of bits greater than 32.
|
||||
* \param bs the target bitstream
|
||||
* \param value the large integer to write
|
||||
* \param nBits number of bits used to code the integer
|
||||
*/
|
||||
void gf_bs_write_long_int(GF_BitStream *bs, s64 value, s32 nBits);
|
||||
/*!
|
||||
* \brief float writing
|
||||
*
|
||||
* Writes a float in IEEE 32 bits format.
|
||||
* \param bs the target bitstream
|
||||
* \param value the float to write
|
||||
*/
|
||||
void gf_bs_write_float(GF_BitStream *bs, Float value);
|
||||
/*!
|
||||
* \brief double writing
|
||||
*
|
||||
* Writes a double in IEEE 64 bits format.
|
||||
* \param bs the target bitstream
|
||||
* \param value the double to write
|
||||
*/
|
||||
void gf_bs_write_double(GF_BitStream *bs, Double value);
|
||||
/*!
|
||||
* \brief data writing
|
||||
*
|
||||
* Writes a data buffer.
|
||||
* \param bs the target bitstream
|
||||
* \param data the data to write
|
||||
* \param nbBytes number of data bytes to write
|
||||
*/
|
||||
u32 gf_bs_write_data(GF_BitStream *bs, const char *data, u32 nbBytes);
|
||||
/*!
|
||||
* \brief variable length integer reading
|
||||
*
|
||||
* Reads an integer coded on a variable number of 4-bits chunks. The number of chunks is given by the number of non-0 bits at the beginning.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_read_vluimsbf5(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief align char writing
|
||||
*
|
||||
* Writes an integer on 8 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the char value to write
|
||||
*/
|
||||
void gf_bs_write_u8(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align short writing
|
||||
*
|
||||
* Writes an integer on 16 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the short value to write
|
||||
*/
|
||||
void gf_bs_write_u16(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align 24-bits integer writing
|
||||
*
|
||||
* Writes an integer on 24 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u24(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align integer writing
|
||||
*
|
||||
* Writes an integer on 32 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u32(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align large integer writing
|
||||
*
|
||||
* Writes an integer on 64 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the large integer value to write
|
||||
*/
|
||||
void gf_bs_write_u64(GF_BitStream *bs, u64 value);
|
||||
/*!
|
||||
* \brief little endian integer writing
|
||||
*
|
||||
* Writes an integer on 32 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u32_le(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief little endian short writing
|
||||
*
|
||||
* Writes an integer on 16 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \param value the short value to write
|
||||
*/
|
||||
void gf_bs_write_u16_le(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief bit position
|
||||
*
|
||||
* Returns current bit position in the bitstream - only works in memory mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_get_bit_offset(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief write byte multiple times
|
||||
*
|
||||
* Writes a give byte multiple times.
|
||||
* \param bs the target bitstream
|
||||
* \param byte the byte value to write
|
||||
* \param count the number of times the byte should be written
|
||||
* \return the number of bytes written
|
||||
*/
|
||||
u32 gf_bs_write_byte(GF_BitStream *bs, u8 byte, u32 count);
|
||||
/*!
|
||||
* \brief current bit position
|
||||
*
|
||||
* Returns bit position in the current byte of the bitstream - only works in memory mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the integer value read.
|
||||
*/
|
||||
u32 gf_bs_get_bit_position(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
* \brief end of bitstream management
|
||||
*
|
||||
* Assigns a notification callback function for end of stream signaling in read mode
|
||||
* \param bs the target bitstream
|
||||
* \param EndOfStream the notification function to use
|
||||
* \param par opaque user data passed to the bitstream
|
||||
*/
|
||||
void gf_bs_set_eos_callback(GF_BitStream *bs, void (*EndOfStream)(void *par), void *par);
|
||||
|
||||
/*!
|
||||
* \brief bitstream alignment
|
||||
*
|
||||
* Aligns bitstream to next byte boundary. In write mode, this will write 0 bit values until alignment.
|
||||
* \param bs the target bitstream
|
||||
* \return the number of bits read/written until alignment
|
||||
*/
|
||||
u8 gf_bs_align(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief capacity query
|
||||
*
|
||||
* Returns the number of bytes still available in the bitstream in read mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the number of bytes still available in read mode, -1 in write modes.
|
||||
*/
|
||||
u64 gf_bs_available(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief buffer fetching
|
||||
*
|
||||
* Fetches the internal bitstream buffer in write mode. If a buffer was given at the bitstream construction, or if the bitstream is in read mode, this does nothing.
|
||||
* \param bs the target bitstream
|
||||
* \param output address of a memory block to be allocated for bitstream data.
|
||||
* \param outSize set to the size of the allocated memory block.
|
||||
* \note
|
||||
/*!
|
||||
* \brief integer writing
|
||||
*
|
||||
* Writes an integer on a given number of bits.
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer to write
|
||||
* \param nBits number of bits used to code the integer
|
||||
*/
|
||||
void gf_bs_write_int(GF_BitStream *bs, s32 value, s32 nBits);
|
||||
/*!
|
||||
* \brief large integer writing
|
||||
*
|
||||
* Writes an integer on a given number of bits greater than 32.
|
||||
* \param bs the target bitstream
|
||||
* \param value the large integer to write
|
||||
* \param nBits number of bits used to code the integer
|
||||
*/
|
||||
void gf_bs_write_long_int(GF_BitStream *bs, s64 value, s32 nBits);
|
||||
/*!
|
||||
* \brief float writing
|
||||
*
|
||||
* Writes a float in IEEE 32 bits format.
|
||||
* \param bs the target bitstream
|
||||
* \param value the float to write
|
||||
*/
|
||||
void gf_bs_write_float(GF_BitStream *bs, Float value);
|
||||
/*!
|
||||
* \brief double writing
|
||||
*
|
||||
* Writes a double in IEEE 64 bits format.
|
||||
* \param bs the target bitstream
|
||||
* \param value the double to write
|
||||
*/
|
||||
void gf_bs_write_double(GF_BitStream *bs, Double value);
|
||||
/*!
|
||||
* \brief data writing
|
||||
*
|
||||
* Writes a data buffer.
|
||||
* \param bs the target bitstream
|
||||
* \param data the data to write
|
||||
* \param nbBytes number of data bytes to write
|
||||
*/
|
||||
u32 gf_bs_write_data(GF_BitStream *bs, const char *data, u32 nbBytes);
|
||||
|
||||
/*!
|
||||
* \brief align char writing
|
||||
*
|
||||
* Writes an integer on 8 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the char value to write
|
||||
*/
|
||||
void gf_bs_write_u8(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align short writing
|
||||
*
|
||||
* Writes an integer on 16 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the short value to write
|
||||
*/
|
||||
void gf_bs_write_u16(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align 24-bits integer writing
|
||||
*
|
||||
* Writes an integer on 24 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u24(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief align integer writing
|
||||
*
|
||||
* Writes an integer on 32 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u32(GF_BitStream *bs, u32 value);
|
||||
|
||||
/*!
|
||||
* \brief align large integer writing
|
||||
*
|
||||
* Writes an integer on 64 bits starting at a byte boundary in the bitstream.
|
||||
* \warning you must not use this function if the bitstream is not aligned
|
||||
* \param bs the target bitstream
|
||||
* \param value the large integer value to write
|
||||
*/
|
||||
void gf_bs_write_u64(GF_BitStream *bs, u64 value);
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief little endian integer writing
|
||||
*
|
||||
* Writes an integer on 32 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \param value the integer value to write
|
||||
*/
|
||||
void gf_bs_write_u32_le(GF_BitStream *bs, u32 value);
|
||||
/*!
|
||||
* \brief little endian short writing
|
||||
*
|
||||
* Writes an integer on 16 bits in little-endian order.
|
||||
* \param bs the target bitstream
|
||||
* \param value the short value to write
|
||||
*/
|
||||
void gf_bs_write_u16_le(GF_BitStream *bs, u32 value);
|
||||
|
||||
/*!
|
||||
* \brief write byte multiple times
|
||||
*
|
||||
* Writes a give byte multiple times.
|
||||
* \param bs the target bitstream
|
||||
* \param byte the byte value to write
|
||||
* \param count the number of times the byte should be written
|
||||
* \return the number of bytes written
|
||||
*/
|
||||
u32 gf_bs_write_byte(GF_BitStream *bs, u8 byte, u32 count);
|
||||
|
||||
/*!
|
||||
* \brief end of bitstream management
|
||||
*
|
||||
* Assigns a notification callback function for end of stream signaling in read mode
|
||||
* \param bs the target bitstream
|
||||
* \param EndOfStream the notification function to use
|
||||
* \param par opaque user data passed to the bitstream
|
||||
*/
|
||||
void gf_bs_set_eos_callback(GF_BitStream *bs, void(*EndOfStream)(void *par), void *par);
|
||||
|
||||
/*!
|
||||
* \brief bitstream alignment
|
||||
*
|
||||
* Aligns bitstream to next byte boundary. In write mode, this will write 0 bit values until alignment.
|
||||
* \param bs the target bitstream
|
||||
* \return the number of bits read/written until alignment
|
||||
*/
|
||||
u8 gf_bs_align(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief capacity query
|
||||
*
|
||||
* Returns the number of bytes still available in the bitstream in read mode.
|
||||
* \param bs the target bitstream
|
||||
* \return the number of bytes still available in read mode, -1 in write modes.
|
||||
*/
|
||||
u64 gf_bs_available(GF_BitStream *bs);
|
||||
/*!
|
||||
* \brief buffer fetching
|
||||
*
|
||||
* Fetches the internal bitstream buffer in write mode. If a buffer was given at the bitstream construction, or if the bitstream is in read mode, this does nothing.
|
||||
* \param bs the target bitstream
|
||||
* \param output address of a memory block to be allocated for bitstream data.
|
||||
* \param outSize set to the size of the allocated memory block.
|
||||
* \note
|
||||
* It is the user responsability to destroy the allocated buffer
|
||||
* Once this function has been called, the internal bitstream buffer is reseted.
|
||||
*/
|
||||
void gf_bs_get_content(GF_BitStream *bs, char **output, u32 *outSize);
|
||||
/*!
|
||||
* \brief byte skipping
|
||||
*
|
||||
* Skips bytes in the bitstream. In Write mode, this will write the 0 integer value for memory-based bitstreams or seek the stream
|
||||
for file-based bitstream.
|
||||
* \param bs the target bitstream
|
||||
* \param nbBytes the number of bytes to skip
|
||||
*/
|
||||
void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes);
|
||||
*/
|
||||
void gf_bs_get_content(GF_BitStream *bs, char **output, u32 *outSize);
|
||||
/*!
|
||||
* \brief byte skipping
|
||||
*
|
||||
* Skips bytes in the bitstream. In Write mode, this will write the 0 integer value for memory-based bitstreams or seek the stream
|
||||
for file-based bitstream.
|
||||
* \param bs the target bitstream
|
||||
* \param nbBytes the number of bytes to skip
|
||||
*/
|
||||
void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes);
|
||||
|
||||
/*!
|
||||
*\brief bitstream seeking
|
||||
*
|
||||
*Seeks the bitstream to a given offset after the begining of the stream. This will perform alignment of the bitstream in all modes.
|
||||
*\warning Results are unpredictable if seeking beyond the bitstream end is performed.
|
||||
*\param bs the target bitstream
|
||||
*\param offset buffer/file offset to seek to
|
||||
*/
|
||||
GF_Err gf_bs_seek(GF_BitStream *bs, u64 offset);
|
||||
/*!
|
||||
*\brief bitstream seeking
|
||||
*
|
||||
*Seeks the bitstream to a given offset after the beginning of the stream. This will perform alignment of the bitstream in all modes.
|
||||
*\warning Results are unpredictable if seeking beyond the bitstream end is performed.
|
||||
*\param bs the target bitstream
|
||||
*\param offset buffer/file offset to seek to
|
||||
*/
|
||||
GF_Err gf_bs_seek(GF_BitStream *bs, u64 offset);
|
||||
|
||||
/*!
|
||||
*\brief bitstream truncation
|
||||
*
|
||||
*Truncates the bitstream at the current position
|
||||
*\param bs the target bitstream
|
||||
*/
|
||||
void gf_bs_truncate(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief bitstream truncation
|
||||
*
|
||||
*Truncates the bitstream at the current position
|
||||
*\param bs the target bitstream
|
||||
*/
|
||||
void gf_bs_truncate(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
*\brief bit peeking
|
||||
*
|
||||
*Peeks a given number of bits (read without moving the position indicator) for read modes only.
|
||||
*\param bs the target bitstream
|
||||
*\param numBits the number of bits to peek
|
||||
*\param byte_offset
|
||||
/*!
|
||||
*\brief bit peeking
|
||||
*
|
||||
*Peeks a given number of bits (read without moving the position indicator) for read modes only.
|
||||
*\param bs the target bitstream
|
||||
*\param numBits the number of bits to peek
|
||||
*\param byte_offset
|
||||
* if set, bitstream is aligned and moved from byte_offset before peeking (byte-aligned picking)
|
||||
* otherwise, bitstream is not aligned and bits are peeked from current state
|
||||
*\return the integer value read
|
||||
*/
|
||||
u32 gf_bs_peek_bits(GF_BitStream *bs, u32 numBits, u32 byte_offset);
|
||||
*\return the integer value read
|
||||
*/
|
||||
u32 gf_bs_peek_bits(GF_BitStream *bs, u32 numBits, u64 byte_offset);
|
||||
|
||||
/*!
|
||||
*\brief bit reservoir query
|
||||
*
|
||||
* Queries the number of bits available in read mode.
|
||||
*\param bs the target bitstream
|
||||
*\return number of available bits if position is in the last byte of the buffer/stream, 8 otherwise
|
||||
*/
|
||||
u8 gf_bs_bits_available(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief position query
|
||||
*
|
||||
*Returns the reading/writting position in the buffer/file.
|
||||
*\param bs the target bitstream
|
||||
*\return the read/write position of the bitstream
|
||||
*/
|
||||
u64 gf_bs_get_position(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief size query
|
||||
*
|
||||
*Returns the size of the associated buffer/file.
|
||||
*\param bs the target bitstream
|
||||
*\return the size of the bitstream
|
||||
*/
|
||||
u64 gf_bs_get_size(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief file-based size query
|
||||
*
|
||||
*Returns the size of a file-based bitstream and force a seek to end of file. This is used in case the file handle
|
||||
*describes a file being constructed on disk while being read?
|
||||
*
|
||||
*\param bs the target bitstream
|
||||
*\return the disk size of the associated file
|
||||
*/
|
||||
u64 gf_bs_get_refreshed_size(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief bit reservoir query
|
||||
*
|
||||
* Queries the number of bits available in read mode.
|
||||
*\param bs the target bitstream
|
||||
*\return number of available bits if position is in the last byte of the buffer/stream, 8 otherwise
|
||||
*/
|
||||
u8 gf_bs_bits_available(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
*\brief position query
|
||||
*
|
||||
*Returns the reading/writting position in the buffer/file.
|
||||
*\param bs the target bitstream
|
||||
*\return the read/write position of the bitstream
|
||||
*/
|
||||
u64 gf_bs_get_position(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
*\brief size query
|
||||
*
|
||||
*Returns the size of the associated buffer/file.
|
||||
*\param bs the target bitstream
|
||||
*\return the size of the bitstream
|
||||
*/
|
||||
u64 gf_bs_get_size(GF_BitStream *bs);
|
||||
/*!
|
||||
*\brief file-based size query
|
||||
*
|
||||
*Returns the size of a file-based bitstream and force a seek to end of file. This is used in case the file handle
|
||||
*describes a file being constructed on disk while being read?
|
||||
*
|
||||
*\param bs the target bitstream
|
||||
*\return the disk size of the associated file
|
||||
*/
|
||||
u64 gf_bs_get_refreshed_size(GF_BitStream *bs);
|
||||
|
||||
|
||||
/*!
|
||||
*\brief transfer content from source bitstream to destination bitstream
|
||||
*
|
||||
*Returns the size of the associated buffer/file.
|
||||
*\param dst the target bitstream
|
||||
*\param src the source bitstream. This bitstream is empty after calling teh function
|
||||
*\return error if any
|
||||
*/
|
||||
GF_Err gf_bs_transfer(GF_BitStream *dst, GF_BitStream *src);
|
||||
|
||||
/*! @} */
|
||||
|
||||
/*!
|
||||
*\brief Flushes bitstream contet to disk
|
||||
*
|
||||
*Flushes bitstream contet to disk
|
||||
*\param bs the target bitstream
|
||||
*/
|
||||
void gf_bs_flush(GF_BitStream *bs);
|
||||
|
||||
/*!
|
||||
*\brief Reassigns FILE object for stream-based bitstreams
|
||||
*
|
||||
*Reassigns FILE object for stream-based bitstreams. Automatically sets the stream position to the bitstream position
|
||||
*\param bs the target bitstream
|
||||
*\param stream the new stream to assign
|
||||
*/
|
||||
void gf_bs_reassign(GF_BitStream *bs, FILE *stream);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
235
src/gpacmp4/gpac/config_file.h
Normal file
235
src/gpacmp4/gpac/config_file.h
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / common tools sub-project
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _GF_CONFIG_FILE_H_
|
||||
#define _GF_CONFIG_FILE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \file <gpac/config_file.h>
|
||||
* \brief configuration file.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \addtogroup cfg_grp Configuration File
|
||||
* \ingroup utils_grp
|
||||
* \brief Configuration File object
|
||||
*
|
||||
* This section documents the configuration file object of the GPAC framework.
|
||||
* This file is formatted as the INI file mode of WIN32 in sections and keys.\n
|
||||
*\note For more information on the GPAC configuration file itself, please refer to the GPAC configuration help provided with GPAC.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <gpac/tools.h>
|
||||
|
||||
|
||||
typedef struct __tag_config GF_Config;
|
||||
|
||||
/*!
|
||||
* \brief configuration file initialization
|
||||
*
|
||||
* Constructs a configuration file from fileName. If fileName is NULL, the default GPAC configuration file is loaded with the
|
||||
* proper module directory, font directory and other default options. If fileName is non-NULL no configuration file is found,
|
||||
* a "light" default configuration file is created.
|
||||
*\param file name of the configuration file, or NULL for default file
|
||||
*\param new_cfg Boolean set to true if a new configuration file has been created
|
||||
*\return the configuration file object, NULL if the file could not be created
|
||||
*/
|
||||
GF_Config *gf_cfg_init(const char *file, Bool *new_cfg);
|
||||
|
||||
/*!
|
||||
* \brief configuration file constructor
|
||||
*
|
||||
* Constructs a configuration file.
|
||||
*\param filePath directory the file is located in
|
||||
*\param fileName name of the configuration file
|
||||
*\return the configuration file object, NULL if the file does not exist
|
||||
*/
|
||||
GF_Config *gf_cfg_new(const char *filePath, const char *fileName);
|
||||
/*!
|
||||
* \brief alternative configuration file constructor
|
||||
*
|
||||
* Constructs a configuration file. If file does not exist, configuration will be still created
|
||||
*\param filePath directory the file is located in
|
||||
*\param fileName name of the configuration file
|
||||
*\return the configuration file object, never NULL, even if file does not exist
|
||||
*/
|
||||
GF_Config *gf_cfg_force_new(const char *filePath, const char *fileName);
|
||||
/*!
|
||||
* \brief configuration file destructor
|
||||
*
|
||||
*Destroys the configuration file and saves it if needed.
|
||||
*\param cfgFile the target configuration file
|
||||
*/
|
||||
void gf_cfg_del(GF_Config *cfgFile);
|
||||
/*!
|
||||
* \brief configuration file destructor
|
||||
*
|
||||
*Destroys the configuration file and removes the file from disk.
|
||||
*\param cfgFile the target configuration file
|
||||
*/
|
||||
void gf_cfg_remove(GF_Config *cfgFile);
|
||||
/*!
|
||||
* \brief configuration saving
|
||||
*
|
||||
*Saves the configuration file if modified.
|
||||
*\param cfgFile the target configuration file
|
||||
*/
|
||||
GF_Err gf_cfg_save(GF_Config *cfgFile);
|
||||
/*!
|
||||
* \brief key value query
|
||||
*
|
||||
*Gets a key value from its section and name.
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the desired key parent section name
|
||||
*\param keyName the desired key name
|
||||
*\return the desired key value if found, NULL otherwise.
|
||||
*/
|
||||
const char *gf_cfg_get_key(GF_Config *cfgFile, const char *secName, const char *keyName);
|
||||
/*!
|
||||
* \brief key value query ignoring case
|
||||
*
|
||||
*Gets a key value from its section and name. Comparison is performed while ignoring case.
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the desired key parent section name (case ignored)
|
||||
*\param keyName the desired key name (case ignored)
|
||||
*\return the desired key value if found, NULL otherwise.
|
||||
*/
|
||||
const char *gf_cfg_get_ikey(GF_Config *cfgFile, const char *secName, const char *keyName);
|
||||
/*!
|
||||
* \brief key value update
|
||||
*
|
||||
*Sets a key value from its section and name.
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the desired key parent section name
|
||||
*\param keyName the desired key name
|
||||
*\param keyValue the desired key value
|
||||
*\note this will also create both section and key if they are not found in the configuration file
|
||||
*/
|
||||
GF_Err gf_cfg_set_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue);
|
||||
/*!
|
||||
* \brief section count query
|
||||
*
|
||||
*Gets the number of sections in the configuration file
|
||||
*\param cfgFile the target configuration file
|
||||
*\return the number of sections
|
||||
*/
|
||||
u32 gf_cfg_get_section_count(GF_Config *cfgFile);
|
||||
/*!
|
||||
* \brief section name query
|
||||
*
|
||||
*Gets a section name based on its index
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secIndex 0-based index of the section to query
|
||||
*\return the section name if found, NULL otherwise
|
||||
*/
|
||||
const char *gf_cfg_get_section_name(GF_Config *cfgFile, u32 secIndex);
|
||||
/*!
|
||||
* \brief key count query
|
||||
*
|
||||
*Gets the number of keys in a section of the configuration file
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the target section
|
||||
*\return the number of keys in the section
|
||||
*/
|
||||
u32 gf_cfg_get_key_count(GF_Config *cfgFile, const char *secName);
|
||||
/*!
|
||||
* \brief key count query
|
||||
*
|
||||
*Gets the number of keys in a section of the configuration file
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the target section
|
||||
*\param keyIndex 0-based index of the key in the section
|
||||
*\return the key name if found, NULL otherwise
|
||||
*/
|
||||
const char *gf_cfg_get_key_name(GF_Config *cfgFile, const char *secName, u32 keyIndex);
|
||||
|
||||
/*!
|
||||
* \brief key insertion
|
||||
*
|
||||
*Inserts a new key in a given section. Returns an error if a key with the given name
|
||||
*already exists in the section
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the target section
|
||||
*\param keyName the name of the target key
|
||||
*\param keyValue the value for the new key
|
||||
*\param index the 0-based index position of the new key
|
||||
*/
|
||||
GF_Err gf_cfg_insert_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index);
|
||||
|
||||
/*!
|
||||
* \brief section destrouction
|
||||
*
|
||||
*Removes all entries in the given section
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the target section
|
||||
*/
|
||||
void gf_cfg_del_section(GF_Config *cfgFile, const char *secName);
|
||||
|
||||
/*!
|
||||
* get a sub key (separator is ':') in a given key in a given section. Returns an error if the key does not exist
|
||||
*\param cfgFile the target configuration file
|
||||
*\param secName the target section
|
||||
*\param keyName the name of the target key
|
||||
*\param sub_index the 0-based index position of the sub key*/
|
||||
const char *gf_cfg_get_sub_key(GF_Config *cfgFile, const char *secName, const char *keyName, u32 sub_index);
|
||||
|
||||
/*!
|
||||
* Get the full filename associated with this config file
|
||||
* The caller is responsible for freeing memory
|
||||
* \param iniFile The Configuration
|
||||
* \return a newly allocated filename
|
||||
*/
|
||||
char * gf_cfg_get_filename(GF_Config *iniFile);
|
||||
|
||||
/*!
|
||||
* Set the full filename associated with this config file
|
||||
* \param iniFile The Configuration
|
||||
* \param fileName new filename for the config
|
||||
* \return erroro code
|
||||
*/
|
||||
GF_Err gf_cfg_set_filename(GF_Config *iniFile, const char * fileName);
|
||||
|
||||
|
||||
/*!
|
||||
* Do not save results to file
|
||||
* \param iniFile The Configuration
|
||||
* \return error code
|
||||
*/
|
||||
GF_Err gf_cfg_discard_changes(GF_Config *iniFile);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*_GF_CONFIG_FILE_H_*/
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Copyright (c) ENST 2008 -
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2008-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GF_CONFIG_H_
|
||||
@@ -29,7 +30,7 @@
|
||||
#define GPAC_CONFIGURATION "(static configuration file)"
|
||||
|
||||
/*this file defines all common macros for libgpac compilation
|
||||
except for symbian32 which uses .mmp directives ... */
|
||||
except for symbian32 which uses .mmp directives ... */
|
||||
#if defined(WIN32) || defined(_WIN32_WCE) || defined(GPAC_CONFIG_DARWIN) /*visual studio and xcode*/
|
||||
|
||||
/*enables GPAC fixed point*/
|
||||
@@ -215,5 +216,4 @@
|
||||
/*disables IETF RTP/SDP/RTSP*/
|
||||
//#define GPAC_DISABLE_STREAMING
|
||||
|
||||
#endif /*_GF_CONFIG_H_*/
|
||||
|
||||
#endif /*_GF_CONFIG_H_*/
|
||||
File diff suppressed because it is too large
Load Diff
534
src/gpacmp4/gpac/events_constants.h
Normal file
534
src/gpacmp4/gpac/events_constants.h
Normal file
@@ -0,0 +1,534 @@
|
||||
/*
|
||||
* GPAC - Multimedia Framework C SDK
|
||||
*
|
||||
* Authors: Jean Le Feuvre
|
||||
* Copyright (c) Telecom ParisTech 2000-2012
|
||||
* All rights reserved
|
||||
*
|
||||
* This file is part of GPAC / Events management
|
||||
*
|
||||
* GPAC is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* GPAC is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GF_EVENTS_CONSTANTS_H_
|
||||
#define _GF_EVENTS_CONSTANTS_H_
|
||||
|
||||
/*!
|
||||
* \file <gpac/events_constants.h>
|
||||
* \brief Constants for event system used by GPAC playback.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \addtogroup evt_grp
|
||||
* \ingroup playback_grp
|
||||
* \brief Constants for event system used by GPAC playback.
|
||||
*
|
||||
*This section documents the event types used by the terminal, the compositor, input modules and output rendering modules for communication.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
minimal event system
|
||||
|
||||
DO NOT CHANGE THEIR POSITION IN THE LIST, USED TO SPEED UP FILTERING OF USER INPUT EVENTS
|
||||
*/
|
||||
|
||||
/*events*/
|
||||
typedef enum {
|
||||
|
||||
/******************************************************
|
||||
|
||||
Events used for both GPAC internals and DOM Events
|
||||
|
||||
*******************************************************/
|
||||
/*MouseEvents*/
|
||||
GF_EVENT_CLICK,
|
||||
GF_EVENT_MOUSEUP,
|
||||
GF_EVENT_MOUSEDOWN,
|
||||
GF_EVENT_MOUSEOVER,
|
||||
GF_EVENT_MOUSEOUT,
|
||||
/*!! ALL MOUSE EVENTS SHALL BE DECLARED BEFORE MOUSEMOVE !! */
|
||||
GF_EVENT_MOUSEMOVE,
|
||||
/*mouse wheel event*/
|
||||
GF_EVENT_MOUSEWHEEL,
|
||||
|
||||
/*Key Events*/
|
||||
GF_EVENT_KEYUP,
|
||||
GF_EVENT_KEYDOWN, /* covers KeyDown, KeyPress and AccessKey */
|
||||
GF_EVENT_LONGKEYPRESS,
|
||||
/*character input*/
|
||||
GF_EVENT_TEXTINPUT,
|
||||
|
||||
|
||||
/******************************************************
|
||||
|
||||
Events used for DOM Events only
|
||||
|
||||
*******************************************************/
|
||||
GF_EVENT_TEXTSELECT,
|
||||
|
||||
/*DOM UIEvents*/
|
||||
GF_EVENT_FOCUSIN,
|
||||
GF_EVENT_FOCUSOUT,
|
||||
GF_EVENT_ACTIVATE,
|
||||
GF_EVENT_CHANGE,
|
||||
GF_EVENT_FOCUS,
|
||||
GF_EVENT_BLUR,
|
||||
/*SVG (HTML) Events*/
|
||||
GF_EVENT_LOAD,
|
||||
GF_EVENT_UNLOAD,
|
||||
GF_EVENT_ABORT,
|
||||
GF_EVENT_ERROR,
|
||||
GF_EVENT_RESIZE,
|
||||
GF_EVENT_SCROLL,
|
||||
GF_EVENT_ZOOM,
|
||||
GF_EVENT_BEGIN, /*this is a fake event, it is NEVER fired, only used in SMIL begin*/
|
||||
GF_EVENT_BEGIN_EVENT,
|
||||
GF_EVENT_END, /*this is a fake event, it is NEVER fired, only used in SMIL end*/
|
||||
GF_EVENT_END_EVENT,
|
||||
GF_EVENT_REPEAT, /*this is a fake event, it is NEVER fired, only used in SMIL repeat*/
|
||||
GF_EVENT_REPEAT_EVENT,
|
||||
|
||||
/*DOM MutationEvents - NOT SUPPORTED YET*/
|
||||
GF_EVENT_TREE_MODIFIED,
|
||||
GF_EVENT_NODE_INSERTED,
|
||||
GF_EVENT_NODE_REMOVED,
|
||||
GF_EVENT_NODE_INSERTED_DOC,
|
||||
GF_EVENT_NODE_REMOVED_DOC,
|
||||
GF_EVENT_ATTR_MODIFIED,
|
||||
GF_EVENT_CHAR_DATA_MODIFIED,
|
||||
GF_EVENT_NODE_NAME_CHANGED,
|
||||
GF_EVENT_ATTR_NAME_CHANGED,
|
||||
|
||||
GF_EVENT_DCCI_PROP_CHANGE,
|
||||
|
||||
/*LASeR events*/
|
||||
GF_EVENT_ACTIVATED,
|
||||
GF_EVENT_DEACTIVATED,
|
||||
GF_EVENT_PAUSE,
|
||||
GF_EVENT_PAUSED_EVENT,
|
||||
GF_EVENT_PLAY,
|
||||
GF_EVENT_REPEAT_KEY,
|
||||
GF_EVENT_RESUME_EVENT,
|
||||
GF_EVENT_SHORT_ACCESSKEY,
|
||||
/*pseudo-event, only used in LASeR coding*/
|
||||
GF_EVENT_EXECUTION_TIME,
|
||||
|
||||
/*HTML5 media events*/
|
||||
GF_EVENT_MEDIA_SETUP_BEGIN, /*not HTML5 but should be :)*/
|
||||
GF_EVENT_MEDIA_SETUP_DONE, /*not HTML5 but should be :)*/
|
||||
GF_EVENT_MEDIA_LOAD_START,
|
||||
GF_EVENT_MEDIA_LOAD_DONE, /*not HTML5 but should be :)*/
|
||||
GF_EVENT_MEDIA_PROGRESS,
|
||||
GF_EVENT_MEDIA_SUSPEND,
|
||||
GF_EVENT_MEDIA_EMPTIED,
|
||||
GF_EVENT_MEDIA_STALLED,
|
||||
GF_EVENT_MEDIA_LOADED_METADATA,
|
||||
GF_EVENT_MEDIA_LODADED_DATA,
|
||||
GF_EVENT_MEDIA_CANPLAY,
|
||||
GF_EVENT_MEDIA_CANPLAYTHROUGH,
|
||||
GF_EVENT_MEDIA_PLAYING,
|
||||
GF_EVENT_MEDIA_WAITING,
|
||||
GF_EVENT_MEDIA_SEEKING,
|
||||
GF_EVENT_MEDIA_SEEKED,
|
||||
GF_EVENT_MEDIA_ENDED,
|
||||
GF_EVENT_MEDIA_DURATION_CHANGED,
|
||||
GF_EVENT_MEDIA_TIME_UPDATE,
|
||||
GF_EVENT_MEDIA_RATECHANGE,
|
||||
GF_EVENT_MEDIA_VOLUME_CHANGED,
|
||||
|
||||
GF_EVENT_HTML_MSE_SOURCE_OPEN,
|
||||
GF_EVENT_HTML_MSE_SOURCE_ENDED,
|
||||
GF_EVENT_HTML_MSE_SOURCE_CLOSE,
|
||||
GF_EVENT_HTML_MSE_UPDATE_START,
|
||||
GF_EVENT_HTML_MSE_UPDATE,
|
||||
GF_EVENT_HTML_MSE_UPDATE_END,
|
||||
GF_EVENT_HTML_MSE_UPDATE_ERROR,
|
||||
GF_EVENT_HTML_MSE_UPDATE_ABORT,
|
||||
GF_EVENT_HTML_MSE_ADD_SOURCE_BUFFER,
|
||||
GF_EVENT_HTML_MSE_REMOVE_SOURCE_BUFFER,
|
||||
|
||||
GF_EVENT_BATTERY,
|
||||
GF_EVENT_CPU,
|
||||
GF_EVENT_UNKNOWN,
|
||||
|
||||
|
||||
/******************************************************
|
||||
|
||||
Events used for GPAC internals only
|
||||
|
||||
*******************************************************/
|
||||
|
||||
/*same as mousedown, generated internally by GPAC*/
|
||||
GF_EVENT_DBLCLICK,
|
||||
|
||||
/*scene attached event, dispatched when the root node of a scene is loaded and
|
||||
attached to the window or parent object (animation, inline, ...)*/
|
||||
GF_EVENT_SCENE_ATTACHED,
|
||||
|
||||
/*VP resize attached event, dispatched when viewport of a scene is being modified
|
||||
attached to the window or parent object (animation, inline, ...)*/
|
||||
GF_EVENT_VP_RESIZE,
|
||||
|
||||
/*window events*/
|
||||
/*size has changed - indicate new w & h in .x end .y fields of event.
|
||||
When sent from gpac to a video plugin, indicates the output size should be changed. This is only sent when the plugin
|
||||
manages the output video himself
|
||||
When sent from a video plugin to gpac, indicates the output size has been changed. This is only sent when the plugin
|
||||
manages the output video himself
|
||||
*/
|
||||
GF_EVENT_SIZE,
|
||||
/*signals the scene size (if indicated in scene) upon connection (sent to the user event proc only)
|
||||
if scene size hasn't changed (seeking or other) this event is not sent
|
||||
*/
|
||||
GF_EVENT_SCENE_SIZE,
|
||||
GF_EVENT_SHOWHIDE, /*window show/hide (minimized or other). */
|
||||
GF_EVENT_SHOWHIDE_NOTIF, /*window has been show/hide (minimized or other). This is sent to the user to signal focus switch in fullscreen*/
|
||||
GF_EVENT_SET_CURSOR, /*set mouse cursor*/
|
||||
GF_EVENT_SET_CAPTION, /*set window caption*/
|
||||
GF_EVENT_MOVE, /*move window*/
|
||||
GF_EVENT_MOVE_NOTIF, /*move window*/
|
||||
GF_EVENT_REFRESH, /*window needs repaint (whenever needed, eg restore, hide->show, background refresh, paint)*/
|
||||
GF_EVENT_QUIT, /*app is being closed - associated structure is evt.message to carry any potential reason for quiting*/
|
||||
/*video hw setup message:
|
||||
- when sent from gpac to plugin, indicates that the plugin should re-setup hardware context due to a window resize:
|
||||
* for 2D output, this means resizing the backbuffer if needed (depending on HW constraints)
|
||||
* for 3D output, this means re-setup of OpenGL context (depending on HW constraints). Depending on windowing systems
|
||||
and implementations, it could be possible to resize a window without destroying the GL context.
|
||||
|
||||
- when sent from plugin to gpac, indicates that hardware has been setup.
|
||||
- when sent from gpac to user, indicate aspect ratio has been modified and video output is ready
|
||||
*/
|
||||
GF_EVENT_VIDEO_SETUP,
|
||||
/*queries the list of system colors - only exchanged between compositor and video output*/
|
||||
GF_EVENT_SYS_COLORS,
|
||||
|
||||
/*indicates some text has been pasted - from video output to compositor only*/
|
||||
GF_EVENT_PASTE_TEXT,
|
||||
/*queries for text to be copied - from video output to compositor only*/
|
||||
GF_EVENT_COPY_TEXT,
|
||||
|
||||
/*terminal events*/
|
||||
GF_EVENT_CONNECT, /*signal URL is connected*/
|
||||
GF_EVENT_DURATION, /*signal duration of presentation*/
|
||||
GF_EVENT_EOS, /*signal End of scene playback*/
|
||||
GF_EVENT_AUTHORIZATION, /*indicates a user and pass is queried*/
|
||||
GF_EVENT_NAVIGATE, /*indicates the user app should load or jump to the given URL.*/
|
||||
GF_EVENT_NAVIGATE_INFO, /*indicates the link or its description under the mouse pointer*/
|
||||
GF_EVENT_MESSAGE, /*message from the MPEG-4 terminal*/
|
||||
GF_EVENT_PROGRESS, /*progress message from the MPEG-4 terminal*/
|
||||
GF_EVENT_FORWARDED, /*event forwarded by service (MPEG-2, RTP, ...)*/
|
||||
GF_EVENT_VIEWPOINTS, /*indicates viewpoint list has changed - no struct associated*/
|
||||
GF_EVENT_STREAMLIST, /*indicates stream list has changed - no struct associated - only used when no scene info is present*/
|
||||
GF_EVENT_METADATA, /*indicates a change in associated metadata*/
|
||||
GF_EVENT_MIGRATE, /*indicates a session migration request*/
|
||||
GF_EVENT_DISCONNECT, /*indicates the current url should be disconnected*/
|
||||
GF_EVENT_RESOLUTION, /*indicates the screen resolution has changed*/
|
||||
GF_EVENT_DROPFILE,
|
||||
/* Events for Keyboad */
|
||||
GF_EVENT_TEXT_EDITING_START,
|
||||
GF_EVENT_TEXT_EDITING_END,
|
||||
|
||||
GF_EVENT_QUALITY_SWITCHED,
|
||||
//fire when timeshift depth changes
|
||||
GF_EVENT_TIMESHIFT_DEPTH,
|
||||
//fire when position in timeshift buffer changes
|
||||
GF_EVENT_TIMESHIFT_UPDATE,
|
||||
//fire when position overflows the timeshift buffer
|
||||
GF_EVENT_TIMESHIFT_OVERFLOW,
|
||||
//fire when position underruns the timeshift buffer (eg fast forward / seek in the future)
|
||||
GF_EVENT_TIMESHIFT_UNDERRUN,
|
||||
GF_EVENT_MAIN_ADDON_STATE,
|
||||
|
||||
GF_EVENT_FROM_SERVICE,
|
||||
|
||||
GF_EVENT_ADDON_DETECTED,
|
||||
|
||||
GF_EVENT_RELOAD,
|
||||
|
||||
GF_EVENT_SENSOR_ORIENTATION,
|
||||
GF_EVENT_SENSOR_REQUEST,
|
||||
} GF_EventType;
|
||||
|
||||
/*GPAC/DOM3 key codes*/
|
||||
typedef enum {
|
||||
GF_KEY_UNIDENTIFIED = 0,
|
||||
GF_KEY_ACCEPT = 1, /* "Accept" The Accept (Commit) key.*/
|
||||
GF_KEY_AGAIN, /* "Again" The Again key.*/
|
||||
GF_KEY_ALLCANDIDATES, /* "AllCandidates" The All Candidates key.*/
|
||||
GF_KEY_ALPHANUM, /*"Alphanumeric" The Alphanumeric key.*/
|
||||
GF_KEY_ALT, /*"Alt" The Alt (Menu) key.*/
|
||||
GF_KEY_ALTGRAPH, /*"AltGraph" The Alt-Graph key.*/
|
||||
GF_KEY_APPS, /*"Apps" The Application key.*/
|
||||
GF_KEY_ATTN, /*"Attn" The ATTN key.*/
|
||||
GF_KEY_BROWSERBACK, /*"BrowserBack" The Browser Back key.*/
|
||||
GF_KEY_BROWSERFAVORITES, /*"BrowserFavorites" The Browser Favorites key.*/
|
||||
GF_KEY_BROWSERFORWARD, /*"BrowserForward" The Browser Forward key.*/
|
||||
GF_KEY_BROWSERHOME, /*"BrowserHome" The Browser Home key.*/
|
||||
GF_KEY_BROWSERREFRESH, /*"BrowserRefresh" The Browser Refresh key.*/
|
||||
GF_KEY_BROWSERSEARCH, /*"BrowserSearch" The Browser Search key.*/
|
||||
GF_KEY_BROWSERSTOP, /*"BrowserStop" The Browser Stop key.*/
|
||||
GF_KEY_CAPSLOCK, /*"CapsLock" The Caps Lock (Capital) key.*/
|
||||
GF_KEY_CLEAR, /*"Clear" The Clear key.*/
|
||||
GF_KEY_CODEINPUT, /*"CodeInput" The Code Input key.*/
|
||||
GF_KEY_COMPOSE, /*"Compose" The Compose key.*/
|
||||
GF_KEY_CONTROL, /*"Control" The Control (Ctrl) key.*/
|
||||
GF_KEY_CRSEL, /*"Crsel" The Crsel key.*/
|
||||
GF_KEY_CONVERT, /*"Convert" The Convert key.*/
|
||||
GF_KEY_COPY, /*"Copy" The Copy key.*/
|
||||
GF_KEY_CUT, /*"Cut" The Cut key.*/
|
||||
GF_KEY_DOWN, /*"Down" The Down Arrow key.*/
|
||||
GF_KEY_END, /*"End" The End key.*/
|
||||
GF_KEY_ENTER, /*"Enter" The Enter key.
|
||||
Note: This key identifier is also used for the Return (Macintosh numpad) key.*/
|
||||
GF_KEY_ERASEEOF, /*"EraseEof" The Erase EOF key.*/
|
||||
GF_KEY_EXECUTE, /*"Execute" The Execute key.*/
|
||||
GF_KEY_EXSEL, /*"Exsel" The Exsel key.*/
|
||||
GF_KEY_F1, /*"F1" The F1 key.*/
|
||||
GF_KEY_F2, /*"F2" The F2 key.*/
|
||||
GF_KEY_F3, /*"F3" The F3 key.*/
|
||||
GF_KEY_F4, /*"F4" The F4 key.*/
|
||||
GF_KEY_F5, /*"F5" The F5 key.*/
|
||||
GF_KEY_F6, /*"F6" The F6 key.*/
|
||||
GF_KEY_F7, /*"F7" The F7 key.*/
|
||||
GF_KEY_F8, /*"F8" The F8 key.*/
|
||||
GF_KEY_F9, /*"F9" The F9 key.*/
|
||||
GF_KEY_F10, /*"F10" The F10 key.*/
|
||||
GF_KEY_F11, /*"F11" The F11 key.*/
|
||||
GF_KEY_F12, /*"F12" The F12 key.*/
|
||||
GF_KEY_F13, /*"F13" The F13 key.*/
|
||||
GF_KEY_F14, /*"F14" The F14 key.*/
|
||||
GF_KEY_F15, /*"F15" The F15 key.*/
|
||||
GF_KEY_F16, /*"F16" The F16 key.*/
|
||||
GF_KEY_F17, /*"F17" The F17 key.*/
|
||||
GF_KEY_F18, /*"F18" The F18 key.*/
|
||||
GF_KEY_F19, /*"F19" The F19 key.*/
|
||||
GF_KEY_F20, /*"F20" The F20 key.*/
|
||||
GF_KEY_F21, /*"F21" The F21 key.*/
|
||||
GF_KEY_F22, /*"F22" The F22 key.*/
|
||||
GF_KEY_F23, /*"F23" The F23 key.*/
|
||||
GF_KEY_F24, /*"F24" The F24 key.*/
|
||||
GF_KEY_FINALMODE, /*"FinalMode" The Final Mode (Final) key used on some asian keyboards.*/
|
||||
GF_KEY_FIND, /*"Find" The Find key.*/
|
||||
GF_KEY_FULLWIDTH, /*"FullWidth" The Full-Width Characters key.*/
|
||||
GF_KEY_HALFWIDTH, /*"HalfWidth" The Half-Width Characters key.*/
|
||||
GF_KEY_HANGULMODE, /*"HangulMode" The Hangul (Korean characters) Mode key.*/
|
||||
GF_KEY_HANJAMODE, /*"HanjaMode" The Hanja (Korean characters) Mode key.*/
|
||||
GF_KEY_HELP, /*"Help" The Help key.*/
|
||||
GF_KEY_HIRAGANA, /*"Hiragana" The Hiragana (Japanese Kana characters) key.*/
|
||||
GF_KEY_HOME, /*"Home" The Home key.*/
|
||||
GF_KEY_INSERT, /*"Insert" The Insert (Ins) key.*/
|
||||
GF_KEY_JAPANESEHIRAGANA, /*"JapaneseHiragana" The Japanese-Hiragana key.*/
|
||||
GF_KEY_JAPANESEKATAKANA, /*"JapaneseKatakana" The Japanese-Katakana key.*/
|
||||
GF_KEY_JAPANESEROMAJI, /*"JapaneseRomaji" The Japanese-Romaji key.*/
|
||||
GF_KEY_JUNJAMODE, /*"JunjaMode" The Junja Mode key.*/
|
||||
GF_KEY_KANAMODE, /*"KanaMode" The Kana Mode (Kana Lock) key.*/
|
||||
GF_KEY_KANJIMODE, /*"KanjiMode" The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.*/
|
||||
GF_KEY_KATAKANA, /*"Katakana" The Katakana (Japanese Kana characters) key.*/
|
||||
GF_KEY_LAUNCHAPPLICATION1, /*"LaunchApplication1" The Start Application One key.*/
|
||||
GF_KEY_LAUNCHAPPLICATION2, /*"LaunchApplication2" The Start Application Two key.*/
|
||||
GF_KEY_LAUNCHMAIL, /*"LaunchMail" The Start Mail key.*/
|
||||
GF_KEY_LEFT, /*"Left" The Left Arrow key.*/
|
||||
GF_KEY_META, /*"Meta" The Meta key.*/
|
||||
GF_KEY_MEDIANEXTTRACK, /*"MediaNextTrack" The Media Next Track key.*/
|
||||
GF_KEY_MEDIAPLAYPAUSE, /*"MediaPlayPause" The Media Play Pause key.*/
|
||||
GF_KEY_MEDIAPREVIOUSTRACK, /*"MediaPreviousTrack" The Media Previous Track key.*/
|
||||
GF_KEY_MEDIASTOP, /*"MediaStop" The Media Stok key.*/
|
||||
GF_KEY_MODECHANGE, /*"ModeChange" The Mode Change key.*/
|
||||
GF_KEY_NONCONVERT, /*"Nonconvert" The Nonconvert (Don't Convert) key.*/
|
||||
GF_KEY_NUMLOCK, /*"NumLock" The Num Lock key.*/
|
||||
GF_KEY_PAGEDOWN, /*"PageDown" The Page Down (Next) key.*/
|
||||
GF_KEY_PAGEUP, /*"PageUp" The Page Up key.*/
|
||||
GF_KEY_PASTE, /*"Paste" The Paste key.*/
|
||||
GF_KEY_PAUSE, /*"Pause" The Pause key.*/
|
||||
GF_KEY_PLAY, /*"Play" The Play key.*/
|
||||
GF_KEY_PREVIOUSCANDIDATE, /*"PreviousCandidate" The Previous Candidate function key.*/
|
||||
GF_KEY_PRINTSCREEN, /*"PrintScreen" The Print Screen (PrintScrn, SnapShot) key.*/
|
||||
GF_KEY_PROCESS, /*"Process" The Process key.*/
|
||||
GF_KEY_PROPS, /*"Props" The Props key.*/
|
||||
GF_KEY_RIGHT, /*"Right" The Right Arrow key.*/
|
||||
GF_KEY_ROMANCHARACTERS, /*"RomanCharacters" The Roman Characters function key.*/
|
||||
GF_KEY_SCROLL, /*"Scroll" The Scroll Lock key.*/
|
||||
GF_KEY_SELECT, /*"Select" The Select key.*/
|
||||
GF_KEY_SELECTMEDIA, /*"SelectMedia" The Select Media key.*/
|
||||
GF_KEY_SHIFT, /*"Shift" The Shift key.*/
|
||||
GF_KEY_STOP, /*"Stop" The Stop key.*/
|
||||
GF_KEY_UP, /*"Up" The Up Arrow key.*/
|
||||
GF_KEY_UNDO, /*"Undo" The Undo key.*/
|
||||
GF_KEY_VOLUMEDOWN, /*"VolumeDown" The Volume Down key.*/
|
||||
GF_KEY_VOLUMEMUTE, /*"VolumeMute" The Volume Mute key.*/
|
||||
GF_KEY_VOLUMEUP, /*"VolumeUp" The Volume Up key.*/
|
||||
GF_KEY_WIN, /*"Win" The Windows Logo key.*/
|
||||
GF_KEY_ZOOM, /*"Zoom" The Zoom key.*/
|
||||
GF_KEY_BACKSPACE, /*"U+0008" The Backspace (Back) key.*/
|
||||
GF_KEY_TAB, /*"U+0009" The Horizontal Tabulation (Tab) key.*/
|
||||
GF_KEY_CANCEL, /*"U+0018" The Cancel key.*/
|
||||
GF_KEY_ESCAPE, /*"U+001B" The Escape (Esc) key.*/
|
||||
GF_KEY_SPACE, /*"U+0020" The Space (Spacebar) key.*/
|
||||
GF_KEY_EXCLAMATION, /*"U+0021" The Exclamation Mark (Factorial, Bang) key (!).*/
|
||||
GF_KEY_QUOTATION, /*"U+0022" The Quotation Mark (Quote Double) key (").*/
|
||||
GF_KEY_NUMBER, /*"U+0023" The Number Sign (Pound Sign, Hash, Crosshatch, Octothorpe) key (#).*/
|
||||
GF_KEY_DOLLAR, /*"U+0024" The Dollar Sign (milreis, escudo) key ($).*/
|
||||
GF_KEY_AMPERSAND, /*"U+0026" The Ampersand key (&).*/
|
||||
GF_KEY_APOSTROPHE, /*"U+0027" The Apostrophe (Apostrophe-Quote, APL Quote) key (').*/
|
||||
GF_KEY_LEFTPARENTHESIS, /*"U+0028" The Left Parenthesis (Opening Parenthesis) key (().*/
|
||||
GF_KEY_RIGHTPARENTHESIS, /*"U+0029" The Right Parenthesis (Closing Parenthesis) key ()).*/
|
||||
GF_KEY_STAR, /*"U+002A" The Asterix (Star) key (*).*/
|
||||
GF_KEY_PLUS, /*"U+002B" The Plus Sign (Plus) key (+).*/
|
||||
GF_KEY_COMMA, /*"U+002C" The Comma (decimal separator) sign key (,).*/
|
||||
GF_KEY_HYPHEN, /*"U+002D" The Hyphen-minus (hyphen or minus sign) key (-).*/
|
||||
GF_KEY_FULLSTOP, /*"U+002E" The Full Stop (period, dot, decimal point) key (.).*/
|
||||
GF_KEY_SLASH, /*"U+002F" The Solidus (slash, virgule, shilling) key (/).*/
|
||||
GF_KEY_0, /*"U+0030" The Digit Zero key (0).*/
|
||||
GF_KEY_1, /*"U+0031" The Digit One key (1).*/
|
||||
GF_KEY_2, /*"U+0032" The Digit Two key (2).*/
|
||||
GF_KEY_3, /*"U+0033" The Digit Three key (3).*/
|
||||
GF_KEY_4, /*"U+0034" The Digit Four key (4).*/
|
||||
GF_KEY_5, /*"U+0035" The Digit Five key (5).*/
|
||||
GF_KEY_6, /*"U+0036" The Digit Six key (6).*/
|
||||
GF_KEY_7, /*"U+0037" The Digit Seven key (7).*/
|
||||
GF_KEY_8, /*"U+0038" The Digit Eight key (8).*/
|
||||
GF_KEY_9, /*"U+0039" The Digit Nine key (9).*/
|
||||
GF_KEY_COLON, /*"U+003A" The Colon key (:).*/
|
||||
GF_KEY_SEMICOLON, /*"U+003B" The Semicolon key (;).*/
|
||||
GF_KEY_LESSTHAN, /*"U+003C" The Less-Than Sign key (<).*/
|
||||
GF_KEY_EQUALS, /*"U+003D" The Equals Sign key (=).*/
|
||||
GF_KEY_GREATERTHAN, /*"U+003E" The Greater-Than Sign key (>).*/
|
||||
GF_KEY_QUESTION, /*"U+003F" The Question Mark key (?).*/
|
||||
GF_KEY_AT, /*"U+0040" The Commercial At (@) key.*/
|
||||
GF_KEY_A, /*"U+0041" The Latin Capital Letter A key (A).*/
|
||||
GF_KEY_B, /*"U+0042" The Latin Capital Letter B key (B).*/
|
||||
GF_KEY_C, /*"U+0043" The Latin Capital Letter C key (C).*/
|
||||
GF_KEY_D, /*"U+0044" The Latin Capital Letter D key (D).*/
|
||||
GF_KEY_E, /*"U+0045" The Latin Capital Letter E key (E).*/
|
||||
GF_KEY_F, /*"U+0046" The Latin Capital Letter F key (F).*/
|
||||
GF_KEY_G, /*"U+0047" The Latin Capital Letter G key (G).*/
|
||||
GF_KEY_H, /*"U+0048" The Latin Capital Letter H key (H).*/
|
||||
GF_KEY_I, /*"U+0049" The Latin Capital Letter I key (I).*/
|
||||
GF_KEY_J, /*"U+004A" The Latin Capital Letter J key (J).*/
|
||||
GF_KEY_K, /*"U+004B" The Latin Capital Letter K key (K).*/
|
||||
GF_KEY_L, /*"U+004C" The Latin Capital Letter L key (L).*/
|
||||
GF_KEY_M, /*"U+004D" The Latin Capital Letter M key (M).*/
|
||||
GF_KEY_N, /*"U+004E" The Latin Capital Letter N key (N).*/
|
||||
GF_KEY_O, /*"U+004F" The Latin Capital Letter O key (O).*/
|
||||
GF_KEY_P, /*"U+0050" The Latin Capital Letter P key (P).*/
|
||||
GF_KEY_Q, /*"U+0051" The Latin Capital Letter Q key (Q).*/
|
||||
GF_KEY_R, /*"U+0052" The Latin Capital Letter R key (R).*/
|
||||
GF_KEY_S, /*"U+0053" The Latin Capital Letter S key (S).*/
|
||||
GF_KEY_T, /*"U+0054" The Latin Capital Letter T key (T).*/
|
||||
GF_KEY_U, /*"U+0055" The Latin Capital Letter U key (U).*/
|
||||
GF_KEY_V, /*"U+0056" The Latin Capital Letter V key (V).*/
|
||||
GF_KEY_W, /*"U+0057" The Latin Capital Letter W key (W).*/
|
||||
GF_KEY_X, /*"U+0058" The Latin Capital Letter X key (X).*/
|
||||
GF_KEY_Y, /*"U+0059" The Latin Capital Letter Y key (Y).*/
|
||||
GF_KEY_Z, /*"U+005A" The Latin Capital Letter Z key (Z).*/
|
||||
GF_KEY_LEFTSQUAREBRACKET, /*"U+005B" The Left Square Bracket (Opening Square Bracket) key ([).*/
|
||||
GF_KEY_BACKSLASH, /*"U+005C" The Reverse Solidus (Backslash) key (\).*/
|
||||
GF_KEY_RIGHTSQUAREBRACKET, /*"U+005D" The Right Square Bracket (Closing Square Bracket) key (]).*/
|
||||
GF_KEY_CIRCUM, /*"U+005E" The Circumflex Accent key (^).*/
|
||||
GF_KEY_UNDERSCORE, /*"U+005F" The Low Sign (Spacing Underscore, Underscore) key (_).*/
|
||||
GF_KEY_GRAVEACCENT, /*"U+0060" The Grave Accent (Back Quote) key (`).*/
|
||||
GF_KEY_LEFTCURLYBRACKET, /*"U+007B" The Left Curly Bracket (Opening Curly Bracket, Opening Brace, Brace Left) key ({).*/
|
||||
GF_KEY_PIPE, /*"U+007C" The Vertical Line (Vertical Bar, Pipe) key (|).*/
|
||||
GF_KEY_RIGHTCURLYBRACKET, /*"U+007D" The Right Curly Bracket (Closing Curly Bracket, Closing Brace, Brace Right) key (}).*/
|
||||
GF_KEY_DEL, /*"U+007F" The Delete (Del) Key.*/
|
||||
GF_KEY_INVERTEXCLAMATION, /*"U+00A1" The Inverted Exclamation Mark key (<28>).*/
|
||||
GF_KEY_DEADGRAVE, /*"U+0300" The Combining Grave Accent (Greek Varia, Dead Grave) key.*/
|
||||
GF_KEY_DEADEACUTE, /*"U+0301" The Combining Acute Accent (Stress Mark, Greek Oxia, Tonos, Dead Eacute) key.*/
|
||||
GF_KEY_DEADCIRCUM, /*"U+0302" The Combining Circumflex Accent (Hat, Dead Circumflex) key.*/
|
||||
GF_KEY_DEADTILDE, /*"U+0303" The Combining Tilde (Dead Tilde) key.*/
|
||||
GF_KEY_DEADMACRON, /*"U+0304" The Combining Macron (Long, Dead Macron) key.*/
|
||||
GF_KEY_DEADBREVE, /*"U+0306" The Combining Breve (Short, Dead Breve) key.*/
|
||||
GF_KEY_DEADABOVEDOT, /*"U+0307" The Combining Dot Above (Derivative, Dead Above Dot) key.*/
|
||||
GF_KEY_DEADDIARESIS, /*"U+0308" The Combining Diaeresis (Double Dot Abode, Umlaut, Greek Dialytika, Double Derivative, Dead Diaeresis) key.*/
|
||||
GF_KEY_DEADRINGABOVE, /*"U+030A" The Combining Ring Above (Dead Above Ring) key.*/
|
||||
GF_KEY_DEADDOUBLEACUTE, /*"U+030B" The Combining Double Acute Accent (Dead Doubleacute) key.*/
|
||||
GF_KEY_DEADCARON, /*"U+030C" The Combining Caron (Hacek, V Above, Dead Caron) key.*/
|
||||
GF_KEY_DEADCEDILLA, /*"U+0327" The Combining Cedilla (Dead Cedilla) key.*/
|
||||
GF_KEY_DEADOGONEK, /*"U+0328" The Combining Ogonek (Nasal Hook, Dead Ogonek) key.*/
|
||||
GF_KEY_DEADIOTA, /*"U+0345" The Combining Greek Ypogegrammeni (Greek Non-Spacing Iota Below, Iota Subscript, Dead Iota) key.*/
|
||||
GF_KEY_EURO, /*"U+20AC" The Euro Currency Sign key (<28>).*/
|
||||
GF_KEY_DEADVOICESOUND, /*"U+3099" The Combining Katakana-Hiragana Voiced Sound Mark (Dead Voiced Sound) key.*/
|
||||
GF_KEY_DEADSEMIVOICESOUND, /*"U+309A" The Combining Katakana-Hiragana Semi-Voiced Sound Mark (Dead Semivoiced Sound) key. */
|
||||
/* STB */
|
||||
GF_KEY_CHANNELUP, /*ChannelUp*/
|
||||
GF_KEY_CHANNELDOWN, /*ChannelDown*/
|
||||
GF_KEY_TEXT, /*Text*/
|
||||
GF_KEY_INFO, /*Info*/
|
||||
GF_KEY_EPG, /*EPG*/
|
||||
GF_KEY_RECORD, /*Record*/
|
||||
GF_KEY_BEGINPAGE, /*BeginPage*/
|
||||
/* end STB */
|
||||
|
||||
/*non-dom keys, used in LASeR*/
|
||||
GF_KEY_CELL_SOFT1, /*soft1 key of cell phones*/
|
||||
GF_KEY_CELL_SOFT2, /*soft2 key of cell phones*/
|
||||
|
||||
/*for joystick handling*/
|
||||
GF_KEY_JOYSTICK
|
||||
} GF_KeyCode;
|
||||
|
||||
|
||||
/*key modifiers state - set by terminal (not set by video driver)*/
|
||||
typedef enum
|
||||
{
|
||||
GF_KEY_MOD_SHIFT = (1),
|
||||
GF_KEY_MOD_CTRL = (1 << 2),
|
||||
GF_KEY_MOD_ALT = (1 << 3),
|
||||
|
||||
GF_KEY_EXT_NUMPAD = (1 << 4),
|
||||
GF_KEY_EXT_LEFT = (1 << 5),
|
||||
GF_KEY_EXT_RIGHT = (1 << 6)
|
||||
} GF_KeyModifier;
|
||||
|
||||
/*sensor signaling*/
|
||||
enum
|
||||
{
|
||||
GF_CURSOR_NORMAL = 0x00,
|
||||
GF_CURSOR_ANCHOR,
|
||||
GF_CURSOR_TOUCH,
|
||||
/*discSensor, cylinderSensor, sphereSensor*/
|
||||
GF_CURSOR_ROTATE,
|
||||
/*proximitySensor & proximitySensor2D*/
|
||||
GF_CURSOR_PROXIMITY,
|
||||
/*planeSensor & planeSensor2D*/
|
||||
GF_CURSOR_PLANE,
|
||||
/*collision*/
|
||||
GF_CURSOR_COLLIDE,
|
||||
GF_CURSOR_HIDE,
|
||||
};
|
||||
|
||||
/*Mutation AttrChangeType Signaling*/
|
||||
enum
|
||||
{
|
||||
GF_MUTATION_ATTRCHANGE_MODIFICATION = 0x01,
|
||||
GF_MUTATION_ATTRCHANGE_ADDITION = 0x02,
|
||||
GF_MUTATION_ATTRCHANGE_REMOVAL = 0x03,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
//regular even codes
|
||||
GF_EVT_REGULAR = 0,
|
||||
/*events forwarded from MPEG-2 stack*/
|
||||
GF_EVT_MPEG2 = 1,
|
||||
};
|
||||
|
||||
/*! @} */
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user