Compare commits
386 Commits
v0.86
...
compatibil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fdf31238a | ||
|
|
1d7589e653 | ||
|
|
e09abe7a83 | ||
|
|
e86e8692a8 | ||
|
|
961bfda727 | ||
|
|
8218d5ff73 | ||
|
|
5850ef073d | ||
|
|
7347440277 | ||
|
|
4007198342 | ||
|
|
c09524d043 | ||
|
|
d81c692bbb | ||
|
|
6d366bfdc6 | ||
|
|
ceb0110378 | ||
|
|
f06436c1fe | ||
|
|
67e15aaf80 | ||
|
|
5b29ef281a | ||
|
|
24b90970c7 | ||
|
|
84e6891922 | ||
|
|
0dcdf72042 | ||
|
|
e3b939baad | ||
|
|
0e5910ebee | ||
|
|
8a81a57a24 | ||
|
|
02d84d27d0 | ||
|
|
a2af0d7044 | ||
|
|
4f5bd7bf37 | ||
|
|
91ef488dff | ||
|
|
1af107aef8 | ||
|
|
9a60796674 | ||
|
|
7f4acae74b | ||
|
|
fa8b0a3023 | ||
|
|
acb55470f6 | ||
|
|
97da554da6 | ||
|
|
a121823adc | ||
|
|
cb85740690 | ||
|
|
e91a13bb60 | ||
|
|
a063be996b | ||
|
|
19da837232 | ||
|
|
22a494d834 | ||
|
|
2e68e9f600 | ||
|
|
b1c22e5034 | ||
|
|
e3c54327e8 | ||
|
|
9e62f8c557 | ||
|
|
6216247ecb | ||
|
|
082100a0d4 | ||
|
|
cf828471d6 | ||
|
|
cf84757e02 | ||
|
|
f486efbb57 | ||
|
|
0db5b0c838 | ||
|
|
e411a75dcd | ||
|
|
33ecccedce | ||
|
|
28dd35b040 | ||
|
|
e82a492c94 | ||
|
|
4509b9daf5 | ||
|
|
d330b78f37 | ||
|
|
ab89f88aea | ||
|
|
0227c2787a | ||
|
|
84dec36845 | ||
|
|
b4f692807a | ||
|
|
1f5ec6cd8d | ||
|
|
6f375cd9b3 | ||
|
|
e959654c6f | ||
|
|
18484d555f | ||
|
|
1534d81ae7 | ||
|
|
84b5df2713 | ||
|
|
8e729cc62c | ||
|
|
0f1f4d889f | ||
|
|
487b521c9b | ||
|
|
1aed90e42c | ||
|
|
e2d387bfa9 | ||
|
|
b974a7ed81 | ||
|
|
522ebae65e | ||
|
|
1b17a04b25 | ||
|
|
588c4a8187 | ||
|
|
88830e6c58 | ||
|
|
db646f50ac | ||
|
|
b1c9540085 | ||
|
|
e98137e059 | ||
|
|
3c37d49764 | ||
|
|
a8d6b81baf | ||
|
|
b8321cac0f | ||
|
|
6697ed3496 | ||
|
|
722d52420c | ||
|
|
af6d8282cb | ||
|
|
732b20aefa | ||
|
|
54318d0402 | ||
|
|
5f61fae0c7 | ||
|
|
0afba56a26 | ||
|
|
0873953d9f | ||
|
|
75af5f2e8c | ||
|
|
8d8dc9ccc2 | ||
|
|
e37a21aace | ||
|
|
40a603d366 | ||
|
|
c5bed1e3b2 | ||
|
|
8db3398eb7 | ||
|
|
7b038ab649 | ||
|
|
7d0c2ede26 | ||
|
|
60773bb859 | ||
|
|
a919ef4410 | ||
|
|
424e67f5f4 | ||
|
|
4097831b9b | ||
|
|
1764aa1f92 | ||
|
|
19de49763a | ||
|
|
a0b4e389f9 | ||
|
|
2281051d3d | ||
|
|
fc21280857 | ||
|
|
746806dcef | ||
|
|
812734fd2a | ||
|
|
66d59e498b | ||
|
|
5599ce9eaf | ||
|
|
2e2075ca52 | ||
|
|
c69d2db52b | ||
|
|
54ecce8b86 | ||
|
|
82b60988bb | ||
|
|
ab1af7c678 | ||
|
|
84ba7c5238 | ||
|
|
676be1f193 | ||
|
|
e8cb55e739 | ||
|
|
30613b224a | ||
|
|
19241744d7 | ||
|
|
27288ccf89 | ||
|
|
34282c17b8 | ||
|
|
227f149670 | ||
|
|
27477e9f7c | ||
|
|
b3018e083e | ||
|
|
96de55429d | ||
|
|
863eacc440 | ||
|
|
78249045f8 | ||
|
|
dad108b7e1 | ||
|
|
79f18b996b | ||
|
|
987c5cd301 | ||
|
|
34d0df1d96 | ||
|
|
1db731a7a8 | ||
|
|
af67596e66 | ||
|
|
86f98ddf5f | ||
|
|
bba6c4fcfd | ||
|
|
af64fa8a3d | ||
|
|
e1d3060232 | ||
|
|
3a1815163f | ||
|
|
0954b47a24 | ||
|
|
594a83cc4e | ||
|
|
ecec3ea22b | ||
|
|
f9cfc7219d | ||
|
|
c854d25963 | ||
|
|
4fe32b1482 | ||
|
|
5fcb31d279 | ||
|
|
b2d3a2fefc | ||
|
|
70ac7f9a40 | ||
|
|
f739d54cbc | ||
|
|
fc78fc3192 | ||
|
|
b0e5eb03e1 | ||
|
|
84cff4d6d8 | ||
|
|
e5575a0f50 | ||
|
|
f4961a0bd8 | ||
|
|
e3e810f34e | ||
|
|
57eb1795aa | ||
|
|
37e4d4163f | ||
|
|
59a8c7a049 | ||
|
|
8ef89f6bf1 | ||
|
|
2739602575 | ||
|
|
a7d2264cc1 | ||
|
|
7d8499a7fb | ||
|
|
99a12b8737 | ||
|
|
5b29db341f | ||
|
|
777ce98aa5 | ||
|
|
fe9c94d50c | ||
|
|
6d074928b6 | ||
|
|
1e32bee8e5 | ||
|
|
6281e128aa | ||
|
|
c1c0627dab | ||
|
|
9cfc345041 | ||
|
|
f3a72bff3d | ||
|
|
e906585287 | ||
|
|
b27c6fe415 | ||
|
|
5e888ee895 | ||
|
|
c9f55f5a39 | ||
|
|
1e9939bc8a | ||
|
|
df66746e89 | ||
|
|
5dac23f156 | ||
|
|
a3148f07ac | ||
|
|
75e21feee3 | ||
|
|
334a87aed1 | ||
|
|
ee3418cd60 | ||
|
|
b9ca8a1291 | ||
|
|
280b4308f7 | ||
|
|
45eec1c919 | ||
|
|
7ad5859629 | ||
|
|
bdfe4ca25b | ||
|
|
3020fd24e7 | ||
|
|
0f2a5b3b96 | ||
|
|
8fec59e753 | ||
|
|
7598225ee1 | ||
|
|
8a9d924fc1 | ||
|
|
2bcd993c0f | ||
|
|
e461c14b48 | ||
|
|
c9a6707fdc | ||
|
|
6cb70be4a4 | ||
|
|
403581462e | ||
|
|
9e212fa104 | ||
|
|
b6978f2fd8 | ||
|
|
513372978c | ||
|
|
de9b198496 | ||
|
|
dac9de4d67 | ||
|
|
d56728bd7f | ||
|
|
7fe8ab767c | ||
|
|
403d2fd8a4 | ||
|
|
a9c3207773 | ||
|
|
bf478c0ee2 | ||
|
|
324667b3e6 | ||
|
|
3ccb250d18 | ||
|
|
15b42e2d0c | ||
|
|
181b8650ab | ||
|
|
724d756aa6 | ||
|
|
2f096879d5 | ||
|
|
d3543ff1a2 | ||
|
|
17a6779146 | ||
|
|
116f308a0b | ||
|
|
414a57d97e | ||
|
|
6d7c60fe14 | ||
|
|
718cf55131 | ||
|
|
4d24568a0b | ||
|
|
ab4f3d0d26 | ||
|
|
9f308271b9 | ||
|
|
b2d97eb627 | ||
|
|
6209c63ccf | ||
|
|
fbf99e8a5e | ||
|
|
ebcd2bc9ca | ||
|
|
0b76cc1991 | ||
|
|
9c20e0afb1 | ||
|
|
74eefaeea7 | ||
|
|
5a8758fdd2 | ||
|
|
7b4bf0b15a | ||
|
|
be34781a64 | ||
|
|
e3c14991b3 | ||
|
|
38fc6e5623 | ||
|
|
5dbbe654f0 | ||
|
|
5df1dbb922 | ||
|
|
ef3d25c25b | ||
|
|
d22ab6f9a1 | ||
|
|
b8a15f6f9d | ||
|
|
ebf06a9c2b | ||
|
|
04abf755c2 | ||
|
|
a99bc37d88 | ||
|
|
1807ea9098 | ||
|
|
0b29fc2329 | ||
|
|
ced636025e | ||
|
|
3cfe406a79 | ||
|
|
23a745dcec | ||
|
|
03b1f5bfd2 | ||
|
|
b8c1499111 | ||
|
|
3189fc915e | ||
|
|
127756b838 | ||
|
|
e0b909a67e | ||
|
|
475865b3be | ||
|
|
3a6fd3450d | ||
|
|
81a00ddf55 | ||
|
|
4ff40f1be8 | ||
|
|
8861f7b40a | ||
|
|
96edd9031e | ||
|
|
11f87f2b6d | ||
|
|
86de4151d2 | ||
|
|
edae5a3cea | ||
|
|
d3cc65ce4e | ||
|
|
6593fc1d32 | ||
|
|
633a1e8bb1 | ||
|
|
6a058e69e7 | ||
|
|
e3c5156de9 | ||
|
|
8d379f7b5c | ||
|
|
45ed8456ee | ||
|
|
ef63d61f3d | ||
|
|
6b1ad9951f | ||
|
|
c2c692fe0a | ||
|
|
662299b324 | ||
|
|
25a8b53ff5 | ||
|
|
466b50bca6 | ||
|
|
1fac910c3e | ||
|
|
68e6f2616d | ||
|
|
d0d8529afa | ||
|
|
b36429879d | ||
|
|
c7bc2b78ac | ||
|
|
1afe08af08 | ||
|
|
52707267fc | ||
|
|
e507b2092b | ||
|
|
d23cb8571d | ||
|
|
b2e83ea1a6 | ||
|
|
3d6a9f4d57 | ||
|
|
86356ba4d2 | ||
|
|
801f9e8dc8 | ||
|
|
cbcedaf2bd | ||
|
|
5ada966010 | ||
|
|
587f0b8609 | ||
|
|
f46e3dcfc2 | ||
|
|
a0e7ddd632 | ||
|
|
3267c68c3b | ||
|
|
c829c94e54 | ||
|
|
39b96cc544 | ||
|
|
5a79b71e70 | ||
|
|
57b230e91d | ||
|
|
b7a2aca34e | ||
|
|
cbda2deda2 | ||
|
|
779e9c64c1 | ||
|
|
26d488a979 | ||
|
|
ef7d4a2b4b | ||
|
|
c6102d3b2a | ||
|
|
4d7d4cc109 | ||
|
|
f717624bfa | ||
|
|
2114a80dbb | ||
|
|
5df3500a9f | ||
|
|
393fbd30b0 | ||
|
|
9dc1e0a9e2 | ||
|
|
4875508f70 | ||
|
|
b1c00233b3 | ||
|
|
f85e65ba32 | ||
|
|
150d2e7404 | ||
|
|
2b997135e5 | ||
|
|
3e815ed590 | ||
|
|
550d3207ad | ||
|
|
f78a1fdf95 | ||
|
|
b7545e0092 | ||
|
|
679a69f25c | ||
|
|
20e439f9d8 | ||
|
|
5d3e2cdbb9 | ||
|
|
93859297c1 | ||
|
|
2258ab23ef | ||
|
|
9b0c12a1c2 | ||
|
|
8ff8443b5e | ||
|
|
6295496d15 | ||
|
|
6e2ce11b26 | ||
|
|
bcffe2abb9 | ||
|
|
da132b379a | ||
|
|
116656e62e | ||
|
|
7be11b4e08 | ||
|
|
8521819a46 | ||
|
|
9a6529b17f | ||
|
|
26e96f362a | ||
|
|
267abc2050 | ||
|
|
dcc9d0c4af | ||
|
|
4b5c01e3e7 | ||
|
|
1ef7add534 | ||
|
|
93ca53d489 | ||
|
|
604dd4d648 | ||
|
|
4d5d0c9063 | ||
|
|
7f2b20dc98 | ||
|
|
7ad5c226e6 | ||
|
|
a3bb05242f | ||
|
|
180da3ed5a | ||
|
|
ddc7c197c8 | ||
|
|
da72afeb7c | ||
|
|
913432232d | ||
|
|
84ce45b8f0 | ||
|
|
b003ed7394 | ||
|
|
941077c11c | ||
|
|
2116c4a964 | ||
|
|
0a5111d7eb | ||
|
|
c4962114b6 | ||
|
|
8050c34174 | ||
|
|
f172c50d2b | ||
|
|
12b438d05a | ||
|
|
26215c258b | ||
|
|
71ac0ad43a | ||
|
|
ca026ecbaa | ||
|
|
5b124c0ce2 | ||
|
|
355b57b26f | ||
|
|
eeccc74128 | ||
|
|
8751363df8 | ||
|
|
f729181262 | ||
|
|
a6f2f33ccf | ||
|
|
bb18bdb932 | ||
|
|
4a7946ab7d | ||
|
|
3203ac14d3 | ||
|
|
98edef2233 | ||
|
|
732c1a3926 | ||
|
|
9c1e7c5c98 | ||
|
|
19352fdd03 | ||
|
|
8b159cc64d | ||
|
|
8d9e54130d | ||
|
|
a473ef2e92 | ||
|
|
dfb26f49a2 | ||
|
|
86a39802d3 | ||
|
|
a5f17c318d | ||
|
|
90733963e5 | ||
|
|
5dc06c341c | ||
|
|
cde884faae | ||
|
|
7a4f4a8f79 | ||
|
|
a5317799e8 | ||
|
|
d96b8e0e83 | ||
|
|
bbe2f33399 |
7
.clang-format
Normal file
@@ -0,0 +1,7 @@
|
||||
BreakBeforeBraces: Allman
|
||||
ColumnLimit: 0
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 8
|
||||
TabWidth: 8
|
||||
UseTab: Always
|
||||
SortIncludes: false
|
||||
47
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +1,26 @@
|
||||
Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION].
|
||||
|
||||
CCExtractor version (using the --version parameter preferably) : **X.X**
|
||||
To get the version of CCExtractor, you can use `--version`.
|
||||
|
||||
**In raising this issue, I confirm the following (please check boxes, eg [X]):**
|
||||
Please check all that apply and **remove the ones that do not**.
|
||||
|
||||
In the necessary information section, if this is a regression (something that used to work does not work anymore), make sure to specify the last known working version.
|
||||
|
||||
Only specify the minimum number of arguments needed to reproduce the issue.
|
||||
|
||||
In the additional information section, describe your problem.
|
||||
|
||||
Please make the affected input file available for us (no screenshots, those don't help!). Public links to Dropbox, Google Drive, etc, are all fine. If it is not possible to make it available publicly, 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. Methods to send the private invitation to us can be found [here](https://ccextractor.org/public:general:support#email).
|
||||
|
||||
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 to enable notifications in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
|
||||
|
||||
Once you have read all of the instructions **delete all the text from here to the top**.
|
||||
|
||||
CCExtractor version: {replace with the version}
|
||||
|
||||
# In raising this issue, I confirm the following:
|
||||
|
||||
- [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md).
|
||||
- [ ] I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
|
||||
@@ -10,27 +28,18 @@ CCExtractor version (using the --version parameter preferably) : **X.X**
|
||||
- [ ] I have checked that the issue I'm porting isn't already solved and no duplicates exist in [closed issues](https://github.com/CCExtractor/ccextractor/issues?q=is%3Aissue+is%3Aclosed) and in [opened issues](https://github.com/CCExtractor/ccextractor/issues)
|
||||
- [ ] I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
|
||||
- [ ] I have used the latest available version of CCExtractor to verify this issue exists.
|
||||
- [ ] I have ticked all the boxes in this section and to prove it I'm deleting the section completely to remove boilerplate text.
|
||||
|
||||
**My familiarity with the project is as follows (check one, eg [X]):**
|
||||
# Necessary information
|
||||
|
||||
- [ ] I have never used CCExtractor.
|
||||
- [ ] I have used CCExtractor just a couple of times.
|
||||
- [ ] I absolutely love CCExtractor, but have not contributed previously.
|
||||
- [ ] I am an active contributor to CCExtractor.
|
||||
- Is this a regression (i.e. did it work before)? {YES/NO}
|
||||
- What platform did you use? {Window/Linux/Mac}
|
||||
- What were the used arguments? `{replace with the arguments}`
|
||||
|
||||
**Necessary information**
|
||||
- Is this a regression (did it work before)? [ ] NO | [ ] YES - *please specify the last known working version*
|
||||
- What platform did you use? [ ] Windows - [ ] Linux - [ ] Mac
|
||||
- What where the used arguments? `-autoprogram`
|
||||
# Video links
|
||||
|
||||
**Video links**
|
||||
* {Replace with a link to a video file}
|
||||
|
||||
Please make the affected input file available for us (no screenshots, those don't help!). Public links to Dropbox, Google Drive, etc, are all fine. If it is not possible to make it available publicly, 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.
|
||||
|
||||
**Additional information**
|
||||
# Additional information
|
||||
|
||||
{issue content here, replace this line with your issue content}
|
||||
|
||||
PS: 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.
|
||||
|
||||
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,4 +1,4 @@
|
||||
Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**.
|
||||
<!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. -->
|
||||
|
||||
**In raising this pull request, I confirm the following (please check boxes):**
|
||||
|
||||
@@ -7,6 +7,7 @@ Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]
|
||||
- [ ] I have considered, and confirmed that this submission will be valuable to others.
|
||||
- [ ] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
|
||||
- [ ] I give this submission freely, and claim no ownership to its content.
|
||||
- [ ] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).**
|
||||
|
||||
**My familiarity with the project is as follows (check one):**
|
||||
|
||||
|
||||
9
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "10:00"
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 10
|
||||
89
.github/workflows/build_linux.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
name: Build CCExtractor on Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_linux.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**Makefile**'
|
||||
- 'linux/**'
|
||||
- 'package_creators/**'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/build_linux.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**Makefile**'
|
||||
- 'linux/**'
|
||||
- 'package_creators/**'
|
||||
jobs:
|
||||
build_shell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install tesseract
|
||||
run: sudo apt-get install libtesseract-dev
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: build
|
||||
run: ./build
|
||||
working-directory: ./linux
|
||||
- name: Display version information
|
||||
run: ./linux/ccextractor --version
|
||||
- name: Prepare artifacts
|
||||
run: mkdir ./linux/artifacts
|
||||
- name: Copy release artifact
|
||||
run: cp ./linux/ccextractor ./linux/artifacts/
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Linux build
|
||||
path: ./linux/artifacts
|
||||
build_autoconf:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: run autogen
|
||||
run: ./autogen.sh
|
||||
working-directory: ./linux
|
||||
- name: configure
|
||||
run: ./configure
|
||||
working-directory: ./linux
|
||||
- name: make
|
||||
run: make
|
||||
working-directory: ./linux
|
||||
- name: Display version information
|
||||
run: ./linux/ccextractor --version
|
||||
cmake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: cmake
|
||||
run: mkdir build && cd build && cmake ../src
|
||||
- name: build
|
||||
run: make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
cmake_ocr_hardsubx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: dependencies
|
||||
run: sudo apt update && sudo apt install libtesseract-dev libavformat-dev libswscale-dev
|
||||
- name: cmake
|
||||
run: mkdir build && cd build && cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src
|
||||
- name: build
|
||||
run: make -j$(nproc)
|
||||
working-directory: build
|
||||
- name: Display version information
|
||||
run: ./build/ccextractor --version
|
||||
bazel:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: bazel build
|
||||
working-directory: ./
|
||||
run: bazel build //src:ccextractor --verbose_failures
|
||||
- name: Display version information
|
||||
working-directory: ./bazel-bin
|
||||
run: ./src/ccextractor --version
|
||||
111
.github/workflows/build_windows.yml
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
name: Build CCExtractor on Windows
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build_windows.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- 'windows/**'
|
||||
tags-ignore:
|
||||
- '*.*'
|
||||
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/build_windows.yml'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- 'windows/**'
|
||||
|
||||
jobs:
|
||||
build_non_ocr_release:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: build Release
|
||||
run: msbuild ccextractor.sln /p:Configuration=Release
|
||||
working-directory: ./windows
|
||||
- name: Display version information
|
||||
run: ./ccextractorwin.exe --version
|
||||
working-directory: ./windows/Release
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows Non-OCR Release build
|
||||
path: |
|
||||
./windows/Release/ccextractorwin.exe
|
||||
./windows/Release/ccextractorgui.exe
|
||||
./windows/Release/*.dll
|
||||
build_non_ocr_debug:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: build Debug
|
||||
run: msbuild ccextractor.sln /p:Configuration=Debug
|
||||
working-directory: ./windows
|
||||
- name: Display version information
|
||||
run: ./ccextractorwin.exe --version
|
||||
working-directory: ./windows/Debug
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows Non-OCR Debug build
|
||||
path: |
|
||||
./windows/Debug/ccextractorwin.exe
|
||||
./windows/Debug/ccextractorwin.pdb
|
||||
./windows/Debug/ccextractorgui.exe
|
||||
./windows/Debug/*.dll
|
||||
build_ocr_hardsubx_release:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: build Release
|
||||
run: msbuild ccextractor.sln /p:Configuration=Release-Full
|
||||
working-directory: ./windows
|
||||
- name: Display version information
|
||||
run: ./ccextractorwinfull.exe --version
|
||||
working-directory: ./windows/Release-Full
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows OCR and HardSubX Release build
|
||||
path: |
|
||||
./windows/Release-Full/ccextractorwinfull.exe
|
||||
./windows/Release-Full/*.dll
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows OCR and HardSubX Release build
|
||||
path: |
|
||||
./windows/Release/ccextractorgui.exe
|
||||
build_ocr_hardsubx_debug:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: build Debug
|
||||
run: msbuild ccextractor.sln /p:Configuration=Debug-Full
|
||||
working-directory: ./windows
|
||||
- name: Display version information
|
||||
run: ./ccextractorwinfull.exe --version
|
||||
working-directory: ./windows/Debug-Full
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows OCR and HardSubX Debug build
|
||||
path: |
|
||||
./windows/Debug-Full/ccextractorwinfull.exe
|
||||
./windows/Debug-Full/ccextractorwinfull.pdb
|
||||
./windows/Debug-Full/*.dll
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: CCExtractor Windows OCR and HardSubX Debug build
|
||||
path: |
|
||||
./windows/Debug/ccextractorgui.exe
|
||||
22
.github/workflows/format.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Format sourcecode
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/format.yml'
|
||||
- 'src/**.c'
|
||||
- 'src/**.h'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '.github/workflows/format.yml'
|
||||
- 'src/**.c'
|
||||
- 'src/**.h'
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- name: Format code
|
||||
run: |
|
||||
find src/ -type f -not -path "src/thirdparty/*" -not -path "src/lib_ccx/zvbi/*" -name '*.c' -not -path "src/GUI/icon_data.c" | xargs clang-format -i
|
||||
git diff-index --quiet HEAD -- || (git diff && exit 1)
|
||||
38
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Upload releases
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build_windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2.4.0
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
||||
shell: bash
|
||||
- name: Setup MSBuild.exe
|
||||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: Install Win 10 SDK
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: build Release-Full
|
||||
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=Win32
|
||||
working-directory: ./windows
|
||||
- name: Copy files to directory for installer
|
||||
run: mkdir installer; cp ./Release/ccextractorgui.exe ./installer; cp ./Release-Full/ccextractorwinfull.exe ./installer; cp ./Release-Full/*.dll ./installer
|
||||
working-directory: ./windows
|
||||
- name: Display installer folder contents
|
||||
run: Get-ChildItem -Recurse ./installer
|
||||
working-directory: ./windows
|
||||
- name: Create portable zip
|
||||
run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor_win_portable.zip
|
||||
working-directory: ./windows
|
||||
- name: Upload as asset
|
||||
uses: AButler/upload-release-assets@v2.0
|
||||
with:
|
||||
files: './windows/CCExtractor_win_portable.zip'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
20
.gitignore
vendored
@@ -34,12 +34,16 @@ build/
|
||||
####
|
||||
# Visual Studio project Ignored files
|
||||
|
||||
.vs/**
|
||||
windows/.vs/**
|
||||
!windows/.vs/config/applicationhost.config
|
||||
*.suo
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.user
|
||||
*.opendb
|
||||
*.db
|
||||
*.vscode
|
||||
|
||||
####
|
||||
# Ignore the header file that is updated upon build
|
||||
@@ -51,6 +55,7 @@ windows/libs/tesseract/**
|
||||
|
||||
# Ctags
|
||||
*.tags*
|
||||
tags
|
||||
|
||||
# Vagrant
|
||||
.vagrant/
|
||||
@@ -120,3 +125,18 @@ src/**/.deps
|
||||
src/**/.dirstamp
|
||||
mac/ccextractorGUI
|
||||
linux/ccextractorGUI
|
||||
linux/ccxGUI.ini
|
||||
linux/CMakeCache.txt
|
||||
linux/CMakeFiles/
|
||||
linux/cmake_install.cmake
|
||||
linux/install_manifest.txt
|
||||
linux/lib_ccx/
|
||||
mac/lib_ccx/
|
||||
mac/install_manifest.txt
|
||||
mac/cmake_install.cmake
|
||||
mac/CMakeFiles/
|
||||
mac/CMakeCache.txt
|
||||
*.py.bak
|
||||
|
||||
# Bazel
|
||||
bazel*
|
||||
|
||||
117
.travis.yml
@@ -1,26 +1,101 @@
|
||||
language: c
|
||||
os:
|
||||
- osx
|
||||
- linux
|
||||
|
||||
sudo:
|
||||
- true
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: gcc
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- cd mac
|
||||
- ./build.command
|
||||
- ./ccextractor --version
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- cd mac
|
||||
- ./build.command
|
||||
- ./ccextractor --version
|
||||
|
||||
install:
|
||||
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install pkg-config autoconf automake libtool tesseract leptonica; fi
|
||||
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get install -y libcurl4-gnutls-dev tesseract-ocr tesseract-ocr-dev libleptonica-dev autoconf-archive; fi
|
||||
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get install python-distutils-extra tesseract-ocr tesseract-ocr-eng libopencv-dev libtesseract-dev libleptonica-dev python-all-dev swig libcv-dev python-opencv python-numpy python-setuptools build-essential subversion; fi
|
||||
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/DanBloomberg/leptonica/releases/download/1.74.4/leptonica-1.74.4.tar.gz && tar xvf leptonica-1.74.4.tar.gz; cd leptonica-1.74.4; ./configure && make && sudo make install; fi
|
||||
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then git clone https://github.com/tesseract-ocr/tesseract.git; cd tesseract; ./autogen.sh; ./configure --enable-debug; LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make; sudo make install; sudo ldconfig; cd ..; fi
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: gcc
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- cd mac
|
||||
- ./autogen.sh
|
||||
- ./configure
|
||||
- make
|
||||
- ./ccextractor --version
|
||||
|
||||
script:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd mac; ./build.command; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd mac; ./autogen.sh; ./configure; make; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd linux; ./build; cd ..; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir build; cd build; cmake ../src/; make; cd ..; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd linux; ./autogen.sh; ./configure; make; fi
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- cd mac
|
||||
- ./autogen.sh
|
||||
- ./configure
|
||||
- make
|
||||
- ./ccextractor --version
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: gcc
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ../src/
|
||||
- make
|
||||
- ./ccextractor --version
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
autoconf
|
||||
libtool
|
||||
tesseract
|
||||
leptonica
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ../src/
|
||||
- make
|
||||
- ./ccextractor --version
|
||||
339
LICENSE.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.
|
||||
@@ -3,8 +3,8 @@
|
||||
MAINTAINER = Marc Espie <espie@openbsd.org>
|
||||
CATEGORIES = multimedia
|
||||
COMMENT = closed caption subtitles extractor
|
||||
HOMEPAGE = http://ccextractor.sourceforge.net/
|
||||
V = 0.77
|
||||
HOMEPAGE = https://ccextractor.org
|
||||
V = 0.89
|
||||
DISTFILES = ccextractor.${V:S/.//}-src.zip
|
||||
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=ccextractor/}
|
||||
DISTNAME = ccextractor-$V
|
||||
|
||||
38
README.md
@@ -1,8 +1,12 @@
|
||||

|
||||
<img src ="https://github.com/CCExtractor/ccextractor-org-media/blob/master/static/ccx_logo_transparent_800x600.png" width="200px" alt="logo" />
|
||||
|
||||
# CCExtractor
|
||||
|
||||
[](https://travis-ci.org/CCExtractor/ccextractor)
|
||||
<a href="https://travis-ci.org/CCExtractor/ccextractor"><img src="https://raw.githubusercontent.com/CCExtractor/ccextractor-org-media/master/static/macOS-build-badge-logo.png" width="20"></a> [](https://travis-ci.org/CCExtractor/ccextractor)
|
||||
[](https://sampleplatform.ccextractor.org/test/master/windows)
|
||||
[](https://sampleplatform.ccextractor.org/test/master/linux)
|
||||
[](https://sourceforge.net/projects/ccextractor/)
|
||||
[](https://github.com/CCExtractor/ccextractor/releases/latest)
|
||||
|
||||
CCExtractor is a tool used to produce subtitles for TV recordings from almost anywhere in the world. We intend to keep up with all sources and formats.
|
||||
|
||||
@@ -21,21 +25,9 @@ The official repository is ([CCExtractor/ccextractor](https://github.com/CCExtra
|
||||
|
||||
The core functionality is written in C. Other languages used include C++ and Python.
|
||||
|
||||
## Google Code-in 2017
|
||||
|
||||
CCExtractor is [participating in Google Code-in 2017!](https://ccextractor.org/public:codein:welcome_2017)
|
||||
|
||||
Google Code-In is a competition of encouraging young people to learn more about Open Source and contributing to it. Tasks range from coding, documentation, quality assurance, user interface, outreach and research.
|
||||
|
||||
This is our second year of challenging tasks for pre-university students aged 13-17.
|
||||
|
||||
If you are a student fitting the age criteria, interested to contribute to CCExtractor feel free to join us. You can read more at the [Google Code-in website](https://codein.withgoogle.com).
|
||||
|
||||
If you're interested in design tasks, you should read [this](https://www.ccextractor.org/public:codein:google_code-in_2017_code-in_for_designers) first.
|
||||
|
||||
## Installation and Usage
|
||||
|
||||
Downloads for precompiled binaries and source code can be found [on our website](https://www.ccextractor.org?id=public:general:downloads).
|
||||
Downloads for precompiled binaries and source code can be found [on our website](https://ccextractor.org/public/general/downloads/).
|
||||
|
||||
Extracting subtitles is relatively simple. Just run the following command:
|
||||
|
||||
@@ -45,24 +37,26 @@ This will extract the subtitles.
|
||||
|
||||
More usage information can be found on our website:
|
||||
|
||||
- [Using the command line tool](https://www.ccextractor.org/doku.php?id=public:general:command_line_usage)
|
||||
- [Using the Windows GUI](https://www.ccextractor.org/doku.php?id=public:general:win_gui_usage)
|
||||
- [Using the command line tool](https://ccextractor.org/public/general/command_line_usage/)
|
||||
- [Using the Windows GUI](https://ccextractor.org/public/general/win_gui_usage/)
|
||||
|
||||
You can also find the list of parameters and their brief description by running `ccextractor` without any arguments.
|
||||
|
||||
You can find sample files on [our website](https://ccextractor.org/public/general/tvsamples/) to test the software.
|
||||
|
||||
## Compiling CCExtractor
|
||||
|
||||
To learn more about how to compile and build CCExtractor for your platform check the [compilation guide](https://github.com/CCExtractor/ccextractor/blob/master/docs/COMPILATION.MD).
|
||||
|
||||
## Support
|
||||
|
||||
By far the best way to get support is by opening an issue at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
|
||||
By far the best way to get support is by opening an issue at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
|
||||
|
||||
When you create a new issue, please fill in the needed details in the provided template. That makes it easier for us to help you more efficiently.
|
||||
|
||||
If you have a question or a problem you can also [contact us by email or chat with the team in Slack](https://www.ccextractor.org/doku.php?id=public:general:support).
|
||||
If you have a question or a problem you can also [contact us by email or chat with the team in Slack](https://ccextractor.org/public/general/support/).
|
||||
|
||||
If you want to contribute to CCExtractor but can't submit some code patches or issues or video samples, you can also [donate to us](https://www.ccextractor.org/public:general:http:sourceforge.net_donate_index.php?group_id=190832)
|
||||
If you want to contribute to CCExtractor but can't submit some code patches or issues or video samples, you can also [donate to us](https://sourceforge.net/donate/index.php?group_id=190832)
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -70,10 +64,10 @@ You can contribute to the project by reporting issues, forking it, modifying the
|
||||
|
||||
## News & Other Information
|
||||
|
||||
News about releases and modifications to the code can be found in the [CHANGES.TXT](docs/CHANGES.TXT) file.
|
||||
News about releases and modifications to the code can be found in the [CHANGES.TXT](docs/CHANGES.TXT) file.
|
||||
|
||||
For more information visit the CCExtractor website: [https://www.ccextractor.org](https://www.ccextractor.org)
|
||||
|
||||
## License
|
||||
|
||||
GNU General Public License version 2.0 (GPL-2.0)
|
||||
GNU General Public License version 2.0 (GPL-2.0)
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import ccextractor as cc
|
||||
import ccx_to_python_g608 as g608
|
||||
import python_srt_generator as srt_generator
|
||||
text,font,color = [],[],[]
|
||||
filename = " "
|
||||
srt_counter = " "
|
||||
def generate_output_srt(line, encoding):
|
||||
global text,font,color
|
||||
global filename, srt_counter
|
||||
if "filename:" in line:
|
||||
filename = str(str(line.split(":")[1]).split("\n")[0])
|
||||
with open(filename, 'w+') as fh:
|
||||
pass
|
||||
elif "srt_counter-" in line:
|
||||
srt_counter = str(line.split("-")[1])
|
||||
with open(filename, 'a+') as fh:
|
||||
fh.write(srt_counter)
|
||||
elif "start_time" in line:
|
||||
with open(filename, 'a+') as fh:
|
||||
data = line.split("-")
|
||||
end_time = str(data[-1].split("\n")[0])
|
||||
start_time = str(data[1].split("\t")[0])
|
||||
fh.write(start_time)
|
||||
fh.write(" --> ")
|
||||
fh.write(end_time)
|
||||
fh.write("\n")
|
||||
fh.flush()
|
||||
elif "***END OF FRAME***" in line:
|
||||
d={}
|
||||
d['text']=text
|
||||
d['color']=color
|
||||
d['font']=font
|
||||
srt_generator.generate_output_srt(filename,d, encoding)
|
||||
text,font,color = [],[],[]
|
||||
else:
|
||||
g608.g608_grid_former(line,text,color,font)
|
||||
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
###
|
||||
#MANDATORY UPDATES IN EVERY PYTHON SCRIPT
|
||||
###
|
||||
import ccextractor as cc
|
||||
import api_support
|
||||
from multiprocessing import Queue,Process,Event
|
||||
import sys
|
||||
import time
|
||||
|
||||
def templer():
|
||||
s = cc.api_init_options()
|
||||
cc.check_configuration_file(s)
|
||||
for i in sys.argv[1:]:
|
||||
cc.api_add_param(s,str(i))
|
||||
#very mandatory for keeping a track of pythonapi call. Always must be set.
|
||||
cc.my_pythonapi(s, callback)
|
||||
|
||||
compile_ret = cc.compile_params(s,len(sys.argv[1:]));
|
||||
|
||||
#very mandatory for keeping a track of pythonapi call. Always must be called so that the program knows that the call is from pythonapi.
|
||||
cc.call_from_python_api(s)
|
||||
|
||||
start_ret = cc.api_start(s);
|
||||
|
||||
def callback(line, encoding):
|
||||
api_support.generate_output_srt(line, str(encoding))
|
||||
if __name__=="__main__":
|
||||
templer()
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
|
||||
BLD_INCLUDE="-I /usr/include/python2.7/ -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"
|
||||
WRAPPER_FLAGS="-Wl,-wrap,write"
|
||||
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"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
|
||||
BLD_SOURCES="../src/ccextractor.c ccextractor_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
|
||||
|
||||
../linux/pre-build.sh
|
||||
|
||||
out=$((LC_ALL=C gcc -fPIC -c -DPYTHONAPI $BLD_FLAGS $BLD_INCLUDE $BLD_SOURCES $BLD_LINKER) 2>&1)
|
||||
#out=$((LC_ALL=C gcc -fPIC -c -Wl,-wrap,write $BLD_INCLUDE $BLD_SOURCES) 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";
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
|
||||
BLD_INCLUDE="-I /usr/include/python2.7/ -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/ccextractorapi.c ccextractorapi_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
|
||||
BLD_LINKER="-lm -pthread -zmuldefs -l tesseract -l lept -l python2.7"
|
||||
./pre-build.sh
|
||||
|
||||
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractorapi -g $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";
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -l python2.7"
|
||||
WRAPPER_FLAGS="-Wl,-wrap,write"
|
||||
|
||||
out=$((swig -python ccextractor.i && ./build_api && gcc -shared $(find -name '*.o') -o _ccextractor.so $BLD_LINKER) 2>&1)
|
||||
#out=$((swig -python ccextractor.i && ./build_api && gcc -shared $WRAPPER_FLAGS $(find -name '*.o') -o _ccextractor.so ) 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
|
||||
rm *.o
|
||||
echo "Compilation successful";
|
||||
@@ -1,78 +0,0 @@
|
||||
%module ccextractor
|
||||
%{
|
||||
#define SWIG_FILE_WITH_INIT
|
||||
#include "../src/lib_ccx/lib_ccx.h"
|
||||
#include "../src/lib_ccx/configuration.h"
|
||||
#include "../src/lib_ccx/ccx_common_option.h"
|
||||
#include "../src/lib_ccx/ccx_mp4.h"
|
||||
#include "../src/lib_ccx/hardsubx.h"
|
||||
#include "../src/lib_ccx/ccx_share.h"
|
||||
#include "../src/ccextractor.h"
|
||||
#include "../src/wrappers/wrapper.h"
|
||||
%}
|
||||
void my_pythonapi(struct ccx_s_options *api_options, PyObject* func);
|
||||
%pythoncode %{
|
||||
def g608_grid_former(line,text,color,font):
|
||||
if "text[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
text.append(line)
|
||||
if "color[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
color.append(line)
|
||||
if "font[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
font.append(line)
|
||||
|
||||
def print_g608_grid(case,text,color,font):
|
||||
help_string = """
|
||||
Case is the value that would give the desired output.
|
||||
case = 0 --> print start_time,end_time,text,color,font
|
||||
case = 1 --> print start_time,end_time,text
|
||||
case = 2 --> print start_time,end_time,color
|
||||
case = 3 --> print start_time,end_time,font
|
||||
case = 4 --> print start_time,end_time,text,color
|
||||
case = 5 --> print start_time,end_time,text,font
|
||||
case = 6 --> print start_time,end_time,color,font
|
||||
"""
|
||||
if case==0:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
|
||||
elif case==1:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
elif case==2:
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
elif case==3:
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
elif case==4:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
elif case==5:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
elif case==6:
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
else:
|
||||
print help_string
|
||||
|
||||
%}
|
||||
%include "../src/lib_ccx/ccx_common_common.h"
|
||||
%include "../src/ccextractor.h"
|
||||
%include "../src//wrappers/wrapper.h"
|
||||
@@ -1,341 +0,0 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 3.0.12
|
||||
#
|
||||
# Do not make changes to this file unless you know what you are doing--modify
|
||||
# the SWIG interface file instead.
|
||||
|
||||
from sys import version_info as _swig_python_version_info
|
||||
if _swig_python_version_info >= (2, 7, 0):
|
||||
def swig_import_helper():
|
||||
import importlib
|
||||
pkg = __name__.rpartition('.')[0]
|
||||
mname = '.'.join((pkg, '_ccextractor')).lstrip('.')
|
||||
try:
|
||||
return importlib.import_module(mname)
|
||||
except ImportError:
|
||||
return importlib.import_module('_ccextractor')
|
||||
_ccextractor = swig_import_helper()
|
||||
del swig_import_helper
|
||||
elif _swig_python_version_info >= (2, 6, 0):
|
||||
def swig_import_helper():
|
||||
from os.path import dirname
|
||||
import imp
|
||||
fp = None
|
||||
try:
|
||||
fp, pathname, description = imp.find_module('_ccextractor', [dirname(__file__)])
|
||||
except ImportError:
|
||||
import _ccextractor
|
||||
return _ccextractor
|
||||
try:
|
||||
_mod = imp.load_module('_ccextractor', fp, pathname, description)
|
||||
finally:
|
||||
if fp is not None:
|
||||
fp.close()
|
||||
return _mod
|
||||
_ccextractor = swig_import_helper()
|
||||
del swig_import_helper
|
||||
else:
|
||||
import _ccextractor
|
||||
del _swig_python_version_info
|
||||
|
||||
try:
|
||||
_swig_property = property
|
||||
except NameError:
|
||||
pass # Python < 2.2 doesn't have 'property'.
|
||||
|
||||
try:
|
||||
import builtins as __builtin__
|
||||
except ImportError:
|
||||
import __builtin__
|
||||
|
||||
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
|
||||
if (name == "thisown"):
|
||||
return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'SwigPyObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name, None)
|
||||
if method:
|
||||
return method(self, value)
|
||||
if (not static):
|
||||
if _newclass:
|
||||
object.__setattr__(self, name, value)
|
||||
else:
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
|
||||
def _swig_setattr(self, class_type, name, value):
|
||||
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
|
||||
|
||||
|
||||
def _swig_getattr(self, class_type, name):
|
||||
if (name == "thisown"):
|
||||
return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name, None)
|
||||
if method:
|
||||
return method(self)
|
||||
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
|
||||
|
||||
|
||||
def _swig_repr(self):
|
||||
try:
|
||||
strthis = "proxy of " + self.this.__repr__()
|
||||
except __builtin__.Exception:
|
||||
strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
try:
|
||||
_object = object
|
||||
_newclass = 1
|
||||
except __builtin__.Exception:
|
||||
class _object:
|
||||
pass
|
||||
_newclass = 0
|
||||
|
||||
|
||||
def my_pythonapi(api_options, func):
|
||||
return _ccextractor.my_pythonapi(api_options, func)
|
||||
my_pythonapi = _ccextractor.my_pythonapi
|
||||
|
||||
def g608_grid_former(line,text,color,font):
|
||||
if "text[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
text.append(line)
|
||||
if "color[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
color.append(line)
|
||||
if "font[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
font.append(line)
|
||||
|
||||
def print_g608_grid(case,text,color,font):
|
||||
help_string = """
|
||||
Case is the value that would give the desired output.
|
||||
case = 0 --> print start_time,end_time,text,color,font
|
||||
case = 1 --> print start_time,end_time,text
|
||||
case = 2 --> print start_time,end_time,color
|
||||
case = 3 --> print start_time,end_time,font
|
||||
case = 4 --> print start_time,end_time,text,color
|
||||
case = 5 --> print start_time,end_time,text,font
|
||||
case = 6 --> print start_time,end_time,color,font
|
||||
"""
|
||||
if case==0:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
|
||||
elif case==1:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
elif case==2:
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
elif case==3:
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
elif case==4:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
elif case==5:
|
||||
if text:
|
||||
print "\n".join(text)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
elif case==6:
|
||||
if color:
|
||||
print "\n".join(color)
|
||||
if font:
|
||||
print "\n".join(font)
|
||||
else:
|
||||
print help_string
|
||||
|
||||
|
||||
EXIT_OK = _ccextractor.EXIT_OK
|
||||
EXIT_NO_INPUT_FILES = _ccextractor.EXIT_NO_INPUT_FILES
|
||||
EXIT_TOO_MANY_INPUT_FILES = _ccextractor.EXIT_TOO_MANY_INPUT_FILES
|
||||
EXIT_INCOMPATIBLE_PARAMETERS = _ccextractor.EXIT_INCOMPATIBLE_PARAMETERS
|
||||
EXIT_UNABLE_TO_DETERMINE_FILE_SIZE = _ccextractor.EXIT_UNABLE_TO_DETERMINE_FILE_SIZE
|
||||
EXIT_MALFORMED_PARAMETER = _ccextractor.EXIT_MALFORMED_PARAMETER
|
||||
EXIT_READ_ERROR = _ccextractor.EXIT_READ_ERROR
|
||||
EXIT_WITH_HELP = _ccextractor.EXIT_WITH_HELP
|
||||
EXIT_NO_CAPTIONS = _ccextractor.EXIT_NO_CAPTIONS
|
||||
EXIT_NOT_CLASSIFIED = _ccextractor.EXIT_NOT_CLASSIFIED
|
||||
EXIT_ERROR_IN_CAPITALIZATION_FILE = _ccextractor.EXIT_ERROR_IN_CAPITALIZATION_FILE
|
||||
EXIT_BUFFER_FULL = _ccextractor.EXIT_BUFFER_FULL
|
||||
EXIT_MISSING_ASF_HEADER = _ccextractor.EXIT_MISSING_ASF_HEADER
|
||||
EXIT_MISSING_RCWT_HEADER = _ccextractor.EXIT_MISSING_RCWT_HEADER
|
||||
CCX_COMMON_EXIT_FILE_CREATION_FAILED = _ccextractor.CCX_COMMON_EXIT_FILE_CREATION_FAILED
|
||||
CCX_COMMON_EXIT_UNSUPPORTED = _ccextractor.CCX_COMMON_EXIT_UNSUPPORTED
|
||||
EXIT_NOT_ENOUGH_MEMORY = _ccextractor.EXIT_NOT_ENOUGH_MEMORY
|
||||
CCX_COMMON_EXIT_BUG_BUG = _ccextractor.CCX_COMMON_EXIT_BUG_BUG
|
||||
CCX_OK = _ccextractor.CCX_OK
|
||||
CCX_FALSE = _ccextractor.CCX_FALSE
|
||||
CCX_TRUE = _ccextractor.CCX_TRUE
|
||||
CCX_EAGAIN = _ccextractor.CCX_EAGAIN
|
||||
CCX_EOF = _ccextractor.CCX_EOF
|
||||
CCX_EINVAL = _ccextractor.CCX_EINVAL
|
||||
CCX_ENOSUPP = _ccextractor.CCX_ENOSUPP
|
||||
CCX_ENOMEM = _ccextractor.CCX_ENOMEM
|
||||
|
||||
def fdprintf(fd, fmt):
|
||||
return _ccextractor.fdprintf(fd, fmt)
|
||||
fdprintf = _ccextractor.fdprintf
|
||||
|
||||
def millis_to_time(milli, hours, minutes, seconds, ms):
|
||||
return _ccextractor.millis_to_time(milli, hours, minutes, seconds, ms)
|
||||
millis_to_time = _ccextractor.millis_to_time
|
||||
|
||||
def freep(arg):
|
||||
return _ccextractor.freep(arg)
|
||||
freep = _ccextractor.freep
|
||||
|
||||
def dbg_print(mask, fmt):
|
||||
return _ccextractor.dbg_print(mask, fmt)
|
||||
dbg_print = _ccextractor.dbg_print
|
||||
|
||||
def debug_608_to_ASC(ccdata, channel):
|
||||
return _ccextractor.debug_608_to_ASC(ccdata, channel)
|
||||
debug_608_to_ASC = _ccextractor.debug_608_to_ASC
|
||||
|
||||
def add_cc_sub_text(sub, str, start_time, end_time, info, mode, arg7):
|
||||
return _ccextractor.add_cc_sub_text(sub, str, start_time, end_time, info, mode, arg7)
|
||||
add_cc_sub_text = _ccextractor.add_cc_sub_text
|
||||
class python_subs_modified(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, python_subs_modified, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, python_subs_modified, name)
|
||||
__repr__ = _swig_repr
|
||||
__swig_setmethods__["start_time"] = _ccextractor.python_subs_modified_start_time_set
|
||||
__swig_getmethods__["start_time"] = _ccextractor.python_subs_modified_start_time_get
|
||||
if _newclass:
|
||||
start_time = _swig_property(_ccextractor.python_subs_modified_start_time_get, _ccextractor.python_subs_modified_start_time_set)
|
||||
__swig_setmethods__["end_time"] = _ccextractor.python_subs_modified_end_time_set
|
||||
__swig_getmethods__["end_time"] = _ccextractor.python_subs_modified_end_time_get
|
||||
if _newclass:
|
||||
end_time = _swig_property(_ccextractor.python_subs_modified_end_time_get, _ccextractor.python_subs_modified_end_time_set)
|
||||
|
||||
def __init__(self):
|
||||
this = _ccextractor.new_python_subs_modified()
|
||||
try:
|
||||
self.this.append(this)
|
||||
except __builtin__.Exception:
|
||||
self.this = this
|
||||
__swig_destroy__ = _ccextractor.delete_python_subs_modified
|
||||
__del__ = lambda self: None
|
||||
python_subs_modified_swigregister = _ccextractor.python_subs_modified_swigregister
|
||||
python_subs_modified_swigregister(python_subs_modified)
|
||||
cvar = _ccextractor.cvar
|
||||
|
||||
class python_subs_array(_object):
|
||||
__swig_setmethods__ = {}
|
||||
__setattr__ = lambda self, name, value: _swig_setattr(self, python_subs_array, name, value)
|
||||
__swig_getmethods__ = {}
|
||||
__getattr__ = lambda self, name: _swig_getattr(self, python_subs_array, name)
|
||||
__repr__ = _swig_repr
|
||||
__swig_setmethods__["sub_count"] = _ccextractor.python_subs_array_sub_count_set
|
||||
__swig_getmethods__["sub_count"] = _ccextractor.python_subs_array_sub_count_get
|
||||
if _newclass:
|
||||
sub_count = _swig_property(_ccextractor.python_subs_array_sub_count_get, _ccextractor.python_subs_array_sub_count_set)
|
||||
__swig_setmethods__["subs"] = _ccextractor.python_subs_array_subs_set
|
||||
__swig_getmethods__["subs"] = _ccextractor.python_subs_array_subs_get
|
||||
if _newclass:
|
||||
subs = _swig_property(_ccextractor.python_subs_array_subs_get, _ccextractor.python_subs_array_subs_set)
|
||||
|
||||
def __init__(self):
|
||||
this = _ccextractor.new_python_subs_array()
|
||||
try:
|
||||
self.this.append(this)
|
||||
except __builtin__.Exception:
|
||||
self.this = this
|
||||
__swig_destroy__ = _ccextractor.delete_python_subs_array
|
||||
__del__ = lambda self: None
|
||||
python_subs_array_swigregister = _ccextractor.python_subs_array_swigregister
|
||||
python_subs_array_swigregister(python_subs_array)
|
||||
|
||||
|
||||
def api_init_options():
|
||||
return _ccextractor.api_init_options()
|
||||
api_init_options = _ccextractor.api_init_options
|
||||
|
||||
def check_configuration_file(api_options):
|
||||
return _ccextractor.check_configuration_file(api_options)
|
||||
check_configuration_file = _ccextractor.check_configuration_file
|
||||
|
||||
def compile_params(api_options, argc):
|
||||
return _ccextractor.compile_params(api_options, argc)
|
||||
compile_params = _ccextractor.compile_params
|
||||
|
||||
def api_add_param(api_options, arg):
|
||||
return _ccextractor.api_add_param(api_options, arg)
|
||||
api_add_param = _ccextractor.api_add_param
|
||||
|
||||
def api_start(api_options):
|
||||
return _ccextractor.api_start(api_options)
|
||||
api_start = _ccextractor.api_start
|
||||
|
||||
def api_param_count(api_options):
|
||||
return _ccextractor.api_param_count(api_options)
|
||||
api_param_count = _ccextractor.api_param_count
|
||||
|
||||
def api_param(api_options, count):
|
||||
return _ccextractor.api_param(api_options, count)
|
||||
api_param = _ccextractor.api_param
|
||||
|
||||
def sigterm_handler(sig):
|
||||
return _ccextractor.sigterm_handler(sig)
|
||||
sigterm_handler = _ccextractor.sigterm_handler
|
||||
|
||||
def sigint_handler(sig):
|
||||
return _ccextractor.sigint_handler(sig)
|
||||
sigint_handler = _ccextractor.sigint_handler
|
||||
|
||||
def print_end_msg():
|
||||
return _ccextractor.print_end_msg()
|
||||
print_end_msg = _ccextractor.print_end_msg
|
||||
|
||||
def main(argc, argv):
|
||||
return _ccextractor.main(argc, argv)
|
||||
main = _ccextractor.main
|
||||
|
||||
def call_from_python_api(api_options):
|
||||
return _ccextractor.call_from_python_api(api_options)
|
||||
call_from_python_api = _ccextractor.call_from_python_api
|
||||
|
||||
def free_python_global_vars():
|
||||
return _ccextractor.free_python_global_vars()
|
||||
free_python_global_vars = _ccextractor.free_python_global_vars
|
||||
|
||||
def set_pythonapi(api_options):
|
||||
return _ccextractor.set_pythonapi(api_options)
|
||||
set_pythonapi = _ccextractor.set_pythonapi
|
||||
|
||||
def setautoprogram(api_options):
|
||||
return _ccextractor.setautoprogram(api_options)
|
||||
setautoprogram = _ccextractor.setautoprogram
|
||||
|
||||
def setstdout(api_options):
|
||||
return _ccextractor.setstdout(api_options)
|
||||
setstdout = _ccextractor.setstdout
|
||||
|
||||
def setpesheader(api_options):
|
||||
return _ccextractor.setpesheader(api_options)
|
||||
setpesheader = _ccextractor.setpesheader
|
||||
|
||||
def setdebugdvbsub(api_options):
|
||||
return _ccextractor.setdebugdvbsub(api_options)
|
||||
setdebugdvbsub = _ccextractor.setdebugdvbsub
|
||||
# This file is compatible with both classic and new-style classes.
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
def g608_grid_former(line,text,color,font):
|
||||
if "text[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
text.append(line)
|
||||
if "color[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
color.append(line)
|
||||
if "font[" in line:
|
||||
line = str(line.split(":", 1)[1])
|
||||
line = str(line.split("\n")[0])
|
||||
font.append(line)
|
||||
|
||||
def return_g608_grid(case,text,color,font):
|
||||
ret_val = {'text':" ",'color':" ",'font':" "}
|
||||
help_string = """
|
||||
Case is the value that would give the desired output.
|
||||
case = 0 --> print start_time,end_time,text,color,font
|
||||
case = 1 --> print start_time,end_time,text
|
||||
case = 2 --> print start_time,end_time,color
|
||||
case = 3 --> print start_time,end_time,font
|
||||
case = 4 --> print start_time,end_time,text,color
|
||||
case = 5 --> print start_time,end_time,text,font
|
||||
case = 6 --> print start_time,end_time,color,font
|
||||
"""
|
||||
if case==0:
|
||||
if text:
|
||||
ret_val['text']=text
|
||||
if color:
|
||||
ret_val['color']=color
|
||||
if font:
|
||||
ret_val['font']=font
|
||||
|
||||
elif case==1:
|
||||
if text:
|
||||
ret_val['text']=text
|
||||
elif case==2:
|
||||
if color:
|
||||
ret_val['color']=color
|
||||
elif case==3:
|
||||
if font:
|
||||
ret_val['font']=font
|
||||
elif case==4:
|
||||
if text:
|
||||
ret_val['text']=text
|
||||
if color:
|
||||
ret_val['color']=color
|
||||
elif case==5:
|
||||
if text:
|
||||
ret_val['text']=text
|
||||
if font:
|
||||
ret_val['font']=font
|
||||
elif case==6:
|
||||
if color:
|
||||
ret_val['color']=color
|
||||
if font:
|
||||
ret_val['font']=font
|
||||
else:
|
||||
print help_string
|
||||
return ret_val
|
||||
@@ -1,152 +0,0 @@
|
||||
import ccextractor as cc
|
||||
import re
|
||||
"""
|
||||
#Handling underline
|
||||
buff = ""
|
||||
underline_flag = 0
|
||||
for i,font_type in enumerate(font_line):
|
||||
if font_type == 'U' and not underline_flag:
|
||||
buff = buff + '<u> '
|
||||
underline_flag = 1
|
||||
underline=1
|
||||
elif font_type =="R" and underline_flag:
|
||||
buff = buff + '</u>'
|
||||
underline_flag = 0
|
||||
continue;
|
||||
buff += letter[i]
|
||||
#adding a new line after buff has seen underline
|
||||
#need to cross check with CCExtractor output as to how they are doing
|
||||
if underline:
|
||||
buff+= "\n"
|
||||
else:
|
||||
buff=""
|
||||
"""
|
||||
encodings_map = {
|
||||
'0':'unicode',
|
||||
'1':'latin1',
|
||||
'2':'utf-8',
|
||||
'3':'ascii',
|
||||
}
|
||||
|
||||
color_text_start={
|
||||
"0":"",
|
||||
"1":"<font color=\"#00ff00\">",
|
||||
"2":"<font color=\"#0000ff\">",
|
||||
"3":"<font color=\"#00ffff\">",
|
||||
"4":"<font color=\"#ff0000\">",
|
||||
"5":"<font color=\"#ffff00\">",
|
||||
"6":"<font color=\"#ff00ff\">",
|
||||
"7":"<font color=\"",
|
||||
"8":"",
|
||||
"9":""
|
||||
};
|
||||
color_text_end={
|
||||
"0":"",
|
||||
"1":"</font",
|
||||
"2":"</font>",
|
||||
"3":"</font>",
|
||||
"4":"</font>",
|
||||
"5":"</font>",
|
||||
"6":"</font>",
|
||||
"7":"</font>",
|
||||
"8":"",
|
||||
"9":""
|
||||
};
|
||||
no_color_tag = ['0','8','9']
|
||||
def comparing_text_font_grids(text, font, color):
|
||||
original_text = text
|
||||
original_color = color
|
||||
temp_color = []
|
||||
for letter,color_line in zip(original_text,color):
|
||||
color = 0
|
||||
prev = color_line[0]
|
||||
buff = color_text_start[str(prev)]
|
||||
if prev not in no_color_tag:
|
||||
color_flag = 1
|
||||
else:
|
||||
color_flag = 0
|
||||
if letter.count(" ")<32:
|
||||
for i,color_type in enumerate(color_line):
|
||||
if color_type not in no_color_tag and prev!=color_type and not color_flag:
|
||||
color = 1
|
||||
buff = buff + color_text_start[str(color_type)]
|
||||
color_flag = 1
|
||||
elif prev!=color_type and color_flag:
|
||||
color = 1
|
||||
buff = buff + color_text_end[str(prev)]
|
||||
color_flag = 0
|
||||
buff += letter[i]
|
||||
prev=color_type
|
||||
if color_flag:
|
||||
color_flag=0
|
||||
buff+=color_text_end[str(prev)]
|
||||
if color:
|
||||
temp_color.append((buff,1))
|
||||
else:
|
||||
temp_color.append((letter,0))
|
||||
temp_font_italics=[]
|
||||
for letter,font_line in zip(original_text,font):
|
||||
if letter.count(" ")<32:
|
||||
buff=""
|
||||
underline,italics = 0,0
|
||||
#Handling italics
|
||||
italics_flag = 0
|
||||
for i,font_type in enumerate(font_line):
|
||||
if font_type == 'I' and not italics_flag:
|
||||
italics=1
|
||||
buff = buff + '<i>'
|
||||
italics_flag = 1
|
||||
elif font_type =="R" and italics_flag:
|
||||
italics=1
|
||||
buff = buff + '</i>'
|
||||
italics_flag = 0
|
||||
buff += letter[i]
|
||||
if italics_flag:
|
||||
buff+='</i>'
|
||||
if italics:
|
||||
temp_font_italics.append((buff,1))
|
||||
else:
|
||||
temp_font_italics.append((letter,0))
|
||||
else:
|
||||
temp_font_italics.append((letter,0))
|
||||
final = []
|
||||
for i,j in zip(temp_color,temp_font_italics):
|
||||
if i[1] and not j[1]:
|
||||
final.append(i[0])
|
||||
elif j[1] and not i[1]:
|
||||
final.append(j[0])
|
||||
else:
|
||||
if not i[1]:
|
||||
final.append(i[0])
|
||||
else:
|
||||
print "error"
|
||||
return (final,font,color)
|
||||
|
||||
|
||||
def generate_output_srt(filename,d, encoding):
|
||||
if encoding in encodings_map.keys():
|
||||
if encoding!='0':
|
||||
encoding_format = encodings_map[encoding]
|
||||
else:
|
||||
encoding_format = ""
|
||||
else:
|
||||
print "encoding error in python"
|
||||
return
|
||||
if encoding_format:
|
||||
d['text'] = [unicode(item,encoding_format) for item in d['text']]
|
||||
else:
|
||||
d['text'] = [unicode(item) for item in d['text']]
|
||||
d['text'],d['font'],d['color']= comparing_text_font_grids(d['text'],d['font'],d['color'])
|
||||
for item in d['text']:
|
||||
if item.count(" ")<32:
|
||||
o=item
|
||||
with open(filename,'ab+') as fh:
|
||||
if encoding_format:
|
||||
fh.write(o.encode(encoding_format))
|
||||
else:
|
||||
fh.write(str(o))
|
||||
fh.write("\n")
|
||||
fh.flush()
|
||||
with open(filename,'ab+') as fh:
|
||||
fh.write("\n")
|
||||
fh.flush()
|
||||
@@ -1,25 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
output_formats = ['.srt','.ass','.ssa','.webvtt','.sami','.txt','.original','.python','.py']
|
||||
args_list = sys.argv[1:]
|
||||
args_count = len(args_list)
|
||||
if args_count>1:
|
||||
print "wrong usage"
|
||||
exit(0)
|
||||
directory = args_list[0]
|
||||
if not os.path.isdir(directory):
|
||||
print "error: path given is not a directory"
|
||||
exit(0)
|
||||
files = []
|
||||
for item in os.listdir(directory):
|
||||
ext = os.path.splitext(item)[1]
|
||||
if ext not in output_formats:
|
||||
files.append(os.path.join(directory,item))
|
||||
for sample in files:
|
||||
print "Processing file: "+sample
|
||||
#command=['../linux/ccextractor',sample]
|
||||
command = ['python','api_testing.py',sample]
|
||||
subprocess.call(command)
|
||||
print "Finished processing file: "+sample
|
||||
92
docs/AUTHORS.TXT
Normal file
@@ -0,0 +1,92 @@
|
||||
ccextractor was originally a mildly optimized C port of McPoodle's excellent
|
||||
but painfully slow Perl script SCC_RIP. That port (ccextractor 0.01) was
|
||||
written by Carlos Fernández (cfsmp3).
|
||||
|
||||
After a number of versions that did something semiuseful Volker Quetschke
|
||||
joined the effort and together Carlos and Volker to CCExtractor a point in
|
||||
which it was actually really usable, at least for the cases that interested
|
||||
them.
|
||||
|
||||
Unfortunately Volker moved on once CCExtractor did what he needed to do for
|
||||
him.
|
||||
|
||||
At some point David Liontooth from UCLA started to use CCExtractor as a
|
||||
replacement for libzvbi because libzvbi wasn't working for some specific
|
||||
streams. UCLA became the primary key user as they were using CCExtractor
|
||||
24x7 to process a huge amount of stream from several countries, and was
|
||||
therefore able to provide samples, proper bug reports, etc.
|
||||
|
||||
At that time CCEXtractor was still US-centric, because it was originally
|
||||
written so Carlos could get subtitles for US TV shows. But UCLA wanted
|
||||
European subtitles too, and they already had recording nodes in Denmark
|
||||
(which use teletext) and Spain (which uses DVB).
|
||||
|
||||
For teletext a good solution existed already: Petr Kutalek's telxcc.
|
||||
We contacted Petr and asked for permission to integrate his code into
|
||||
CCExtractor. Petr's absolutely brilliantly clean code was easy to
|
||||
integrate and build upon - and with it, we added support for the first
|
||||
kind of European subtitles.
|
||||
|
||||
Around that time, we decided to apply for Google Summer of Code. That
|
||||
was also a game changer, with Willem, Ruslan and Anshul being the first
|
||||
3 students. They are still around, now as mentors and year round
|
||||
contributors.
|
||||
|
||||
Since them, many more people have been involved: More than 10 as
|
||||
Google Summer of Code students, Code-In students, companies that
|
||||
sponsored development by hiring team members to do custom development
|
||||
(Comcast was the first one, and we'll always be grateful for the
|
||||
opportunity).
|
||||
|
||||
List of students is below (if they added themselves). For a complete
|
||||
list, just check the pull requests at GitHub.
|
||||
|
||||
Home: https://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
|
||||
- Matej Plavevski
|
||||
- Danila Fedorin
|
||||
|
||||
Google Code-in 2017 students
|
||||
- Matej Plavevski
|
||||
- Harry Yu
|
||||
- Theodore Fabian
|
||||
- Nikunj Taneja
|
||||
- John Chew
|
||||
- Aadi Bajpai
|
||||
- Wiliam(Hori75)
|
||||
|
||||
Google Summer of Code 2017 students
|
||||
- Diptanshu Jamgade
|
||||
- Mayank Gupta
|
||||
|
||||
Google Code-in 2018 students
|
||||
- Matej Plavevski
|
||||
- Ivan Makarov
|
||||
- Albert (alufers)
|
||||
- Brian M
|
||||
- John Chew
|
||||
- T1duS
|
||||
130
docs/CHANGES.TXT
@@ -1,4 +1,131 @@
|
||||
0.86 (2017-01-09)
|
||||
0.89 (2021-06-13)
|
||||
-----------------
|
||||
- Fix: Fix broken links in README
|
||||
- Fix: Timing in DVB, sub duration check for timeout.
|
||||
- New: Added support for SCC and CCD encoder formats
|
||||
- New: Added support to output captions to MCC file (#733).
|
||||
- New: Add support for censoring words ("Kid Friendly") (#1139)
|
||||
- New: Extend support of capitalization for all BITMAP and 608 subtitles (#1214)
|
||||
- New: Added an option to disable timestamps for WebVTT (In response to issue #1127)
|
||||
- Fix: Change inet_ntop to inet_ntoa for Windows XP compatibility
|
||||
- Fix: Added italics, underline, and color rendering support for -out=spupng with EIA608/teletext
|
||||
- Fix: ccx_demuxer_mxf.c: Parse framerate from MXF captions to fix caption timings.
|
||||
- Fix: hardsubx_decoder.c: Fix memory leaks using Leptonica API.
|
||||
- Fix: linux/Makefile.am: added some sources to enable rpms to be created.
|
||||
- Fix: Crash when using -sc (sentence case) option (#1115)
|
||||
- Fix: Segmentation fault on VOB #1128
|
||||
- Fix: Hang while processing video #1121
|
||||
- Fix: lib_ccx.c: Initialize fatal error logging function before first usage in init_libraries
|
||||
- Fix: A few (minor) memory leaks around the code.
|
||||
- Fix: General code clean up / reformatting
|
||||
- Fix: Fix multiple definitions with new -fno-common default in GCC 10
|
||||
- Fix: Mac now builds reproducibly again without errors on the date command (#1230)
|
||||
- Fix: Allow all oem modes with tesseract v4 (#1264)
|
||||
- Doc: Updated ccextractor.cnf.sample.
|
||||
- Update: Updated LibPNG to 1.6.37
|
||||
- Remove: Python API (since no one cares about it and it's unmaintained)
|
||||
- Remove: -cf , just use FFmpeg if you want a ES from a TS or PS, CCExtractor is a bad tool
|
||||
for this.
|
||||
- Fix: Segmentation fault on Windows
|
||||
- Update: Updated libGPAC to 1.0.1
|
||||
- Fix: Segmentation fault with unsupported and multitrack file reports
|
||||
- Fix: Write subtitle header to multitrack outputs
|
||||
- Fix: Write multitrack files to the output file directory
|
||||
- Fix: Correct frame number calculation in SCC (#1340)
|
||||
- Fix: Regression on Teletext that caused dates to be wrong (RT 78 on the sample platform)
|
||||
- Fix: CEA-708: Better timing, fixes for missing subtitles
|
||||
- Fix: timing for direct rollup
|
||||
- Fix: timing for VOB files with multiple chapters
|
||||
|
||||
0.88 (2019-05-21)
|
||||
-----------------
|
||||
- New: More tapping points for debug image in ccextractor.
|
||||
- New: Add support for tesseract 4.0
|
||||
- Optimize: Remove multiple RGB to grey conversion in OCR.
|
||||
- Fix: Update UTF8Proc to 2.2.0
|
||||
- Fix: Update LibPNG to 1.6.35
|
||||
- Fix: Update Protobuf-c to 1.3.1
|
||||
- Fix: Warn instead of fatal when a 0xFF marker is missing
|
||||
- Fix: Segfault in general_loop.c due to null pointer dereference (case of no encoder)
|
||||
- Fix: Enable printing hdtv stats to console.
|
||||
- Fix: Many typos in comments and output messages
|
||||
- Fix: Ignore Visual Studio temporary project files
|
||||
- New: Add support for non-Latin characters in stdout
|
||||
- Fix: Check whether stream is empty
|
||||
- New: Add support for EIA-608 inside .mkv
|
||||
- New: Add support for DVB inside .mkv
|
||||
- Fix: Added -latrusmap Map Latin symbols to Cyrillic ones in special cases
|
||||
of Russian Teletext files (issue #1086)
|
||||
- Fix: Several OCR crashes
|
||||
|
||||
0.87 (2018-10-23)
|
||||
-----------------
|
||||
- New: Upgrade libGPAC to 0.7.1.
|
||||
- New: mp4 tx3g & multitrack subtitles.
|
||||
- New: Guide to update dependencies (docs/Updating_Dependencies.txt).
|
||||
- New: Add LICENSE File (#959).
|
||||
- New: Display quantisation mode in info box (#954).
|
||||
- New: Add instruction required to build ccextractor with HARDSUBX support (#946).
|
||||
- New: Added version no. of libraries to --version.
|
||||
- New: Added -quant (OCR quantization function).
|
||||
- New: Python API now compatible with Python 3.
|
||||
- Fix: linux/builddebug: Added non-local directories to the incluye search path so we don't
|
||||
require a locally compiled tesseract or leptonica.
|
||||
- Fix: Correct -HARDSUBX Bug In CMake, allow build with hardsubx using cmake (#966).
|
||||
- Fix: possible segfaults in hardsubx_classifier.c due to strdup (#963).
|
||||
- Fix: Improve the start and end timestamps of extracted burned in captions (#962).
|
||||
- Fix: Update COMPILATION.md (#960).
|
||||
- Fix: Fixed crash with "-out=report" and "-out=null".
|
||||
- Fix: -nocf not working with OCR'ing (#958).
|
||||
- Fix: segfault in add_cc_sub_text and initialize to NULL in init_encoder (#950).
|
||||
- Fix: ccx_decoders_common.c: Copy data type when creating a copy of the subtitle structure.
|
||||
- Fix: Implicit declaration of these functions throws warning during build (#948).
|
||||
- Fix: ccx_decoders_common.c: Properly release allocated resources on free_subtitle().
|
||||
- Fix: Added a datatype member to struct cc_subtitle - needed so we can properly free all
|
||||
memory when void *data points to a structure that has its own pointers.
|
||||
- Fix: dvb_subtitle_decoder.c: When combining image regions verify that the offset is
|
||||
never negative.
|
||||
- Fix: Updated traivis.yml to fix osx build (#947).
|
||||
- Fix: Add utf8proc src file to cmake, updated header file (#944).
|
||||
- Fix: Added required pointers on freep() calls.
|
||||
- Fix: Removed dvb_debug_traces_to_stdout and used the usual dbg_print instead.
|
||||
- Fix: Additional debug traces for DVB.
|
||||
- Fix: Fix minor memory leak in ocr.c.
|
||||
- Fix: Fix issue with displaying utf8proc version.
|
||||
- Fix: Fix failing cmake due to liblept/tesseract header files.
|
||||
- Fix: Added missing \n in params.c.
|
||||
- Fix: builddebug: Use -fsanitize=address -fno-omit-frame-pointer.
|
||||
- Fix: ccx_decoders_common.c: Removed trivial memory leak.
|
||||
- Fix: ccx_encoders_srt.c: Made sure a pointer is non-NULL before dereferencing.
|
||||
- Fix: dvb_subtitle_decoder.c: Initialize pointer members to NULL when creating a structure.
|
||||
- Fix: lib_ccx.c: Initialize (memset 0) structure cc_subtitle after memory allocation.
|
||||
- Fix: Added verboseness to error/warnings in dvb_subtitle_decoder.c.
|
||||
- Fix: dvb_subtitle_decoder.c: Work on passing invalid streams errors upstream (plus some
|
||||
warning messages) so we can eventually recover from this situation instead of crashing.
|
||||
- Fix: telxcc.c: Currently setting a colour doesn't necessarily add a space even though the
|
||||
specifications mandate it. (#930).
|
||||
- Fix: dvb_subtitle_decoder.c: Fix null pointer derefence when region==NULL in write_dvb_sub.
|
||||
- Fix: DVB Teletext subtitle incomplete.
|
||||
- Fix: replace all 0xA characters within startbox with 0x20.
|
||||
- Fix: DVB Teletext subtitle incomplete (#922).
|
||||
- Fix: Add missing return value to one of the returns in process_tx3g().
|
||||
- Fix: Typos and other minor bugs.
|
||||
- Fix: Tidy CMakeLists & vcxproj (#920).
|
||||
- Fix: Added m2ts and -mxf to help screen.
|
||||
- Fix: Added MKV to demuxer_print_cfg.
|
||||
- Fix: Added MXF to demuxer_print_cfg.
|
||||
- Fix: "Out of order packets" error had wrong print() parameters.
|
||||
- Fix: Updated Python documentation.
|
||||
- Fix: Fix incorrect path in XML (#904).
|
||||
- Fix: linux build script (non-debug): Don't hide warnings from compiler.
|
||||
- Fix: linux build script (debug): Display what's step of the build script we're in.
|
||||
- Fix: Make the build reproducible (#976).
|
||||
- Fix: Remove instance of o1 and o2 from help.
|
||||
- Fix: Colors of DVB subtitles with depth 2 broken due to a missing break.
|
||||
- Fix: CEA-708: Caption loss due to CW command (#991).
|
||||
- Fix: CEA-708: Update patch for windows priority with functions (#990).
|
||||
|
||||
0.86 (2018-01-09)
|
||||
-----------------
|
||||
- New: Preliminary MXF support
|
||||
- New: Added a histogram in one-minute increments of the number of lines in a subtitle.
|
||||
@@ -1088,4 +1215,3 @@ version of CCExtractor.
|
||||
- Added video information (as extracted from sequence header).
|
||||
- Some code clean-up.
|
||||
- FF sanity check enabled by default.
|
||||
|
||||
|
||||
@@ -14,35 +14,45 @@ git clone https://github.com/CCExtractor/ccextractor.git
|
||||
|
||||
1. Make sure all the dependencies are met.
|
||||
|
||||
Debian:
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y libglew-dev libglfw3-dev cmake gcc libcurl4-gnutls-dev tesseract-ocr tesseract-ocr-dev libleptonica-dev
|
||||
```
|
||||
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
|
||||
|
||||
RHEL:
|
||||
|
||||
```bash
|
||||
yum install -y glew-devel glfw-devel cmake gcc libcurl-devel tesseract-devel leptonica-devel
|
||||
```
|
||||
|
||||
**Note:** On Ubuntu Version 18.04 (Bionic) and (probably) later, install `libtesseract-dev` rather than `tesseract-ocr-dev`, which does not exist anymore.
|
||||
|
||||
**Note:** On Ubuntu Version 14.04 (Trusty) and earlier, you should build leptonica and tesseract from source
|
||||
|
||||
2. Compiling
|
||||
|
||||
### Using the build script
|
||||
By default build script does not include debugging information hence, you cannot debug the executable produced (i.e. `./ccextractor`) on a debugger. To include debugging information, use the `builddebug` script.
|
||||
|
||||
**Using the build script**
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
#Navigate to linux directory and call the build script
|
||||
|
||||
cd ccextractor/linux
|
||||
|
||||
# compile without debug flags
|
||||
./build
|
||||
|
||||
# compile with debug info
|
||||
./builddebug
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Standard linux compilation through Autoconf scripts**
|
||||
### Standard linux compilation through Autoconf scripts
|
||||
|
||||
```
|
||||
```bash
|
||||
sudo apt-get install autoconf #Dependency to generate configuration script
|
||||
cd ccextractor/linux
|
||||
./autogen.sh
|
||||
@@ -51,11 +61,14 @@ make
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
|
||||
# make build systemwide
|
||||
sudo make install
|
||||
```
|
||||
|
||||
**Using CMake**
|
||||
### Using CMake
|
||||
|
||||
```
|
||||
```bash
|
||||
#Create and navigate to directory where you want to store built files
|
||||
|
||||
cd ccextractor/
|
||||
@@ -69,19 +82,26 @@ make
|
||||
|
||||
# test your build
|
||||
./ccextractor
|
||||
|
||||
# make build systemwide
|
||||
sudo make install
|
||||
```
|
||||
|
||||
`cmake` also accepts the argument `-DWITH_OCR=ON` to enable OCR.
|
||||
|
||||
**Compiling with GUI:**
|
||||
### Compiling with GUI:
|
||||
|
||||
To build CCExtractor with a gui you will additionally need to install [GLEW](http://glew.sourceforge.net/build.html) and [GLFW](http://www.glfw.org/docs/latest/compile.html)
|
||||
|
||||
In order to compile it you'll need to configure it using autoconf by passing the `-with-gui` option.
|
||||
|
||||
```
|
||||
```bash
|
||||
./autogen.sh
|
||||
./configure --with-gui
|
||||
make
|
||||
|
||||
# make build systemwide
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
|
||||
@@ -90,25 +110,25 @@ Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
|
||||
|
||||
1. Make sure all the dependencies are met. They can be installed via Homebrew as
|
||||
|
||||
```
|
||||
```bash
|
||||
brew install pkg-config
|
||||
brew install autoconf automake libtool
|
||||
brew install tesseract
|
||||
brew install leptonica
|
||||
```
|
||||
|
||||
To verify tesseract and leptonica are detected by pkg-config, e.g.
|
||||
Use pkg-config to verify tesseract and leptonica dependencies, e.g.
|
||||
|
||||
````
|
||||
```bash
|
||||
pkg-config --exists --print-errors tesseract
|
||||
pkg-config --exists --print-errors lept
|
||||
````
|
||||
|
||||
2. Compiling
|
||||
|
||||
**Using build.command script:**
|
||||
|
||||
```
|
||||
|
||||
### Compiling
|
||||
|
||||
#### Using build.command script:
|
||||
|
||||
```bash
|
||||
cd ccextractor/mac
|
||||
./build.command OCR
|
||||
|
||||
@@ -118,7 +138,7 @@ cd ccextractor/mac
|
||||
|
||||
If you don't want the OCR capabilities, then you don't need to configure the tesseract and leptonica packages, and build it with just
|
||||
|
||||
```
|
||||
```bash
|
||||
cd ccextractor/mac
|
||||
./build.command
|
||||
|
||||
@@ -126,9 +146,9 @@ cd ccextractor/mac
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Using CMake**
|
||||
#### Using CMake
|
||||
|
||||
```
|
||||
```bash
|
||||
#Create and navigate to directory where you want to store built files
|
||||
|
||||
cd ccextractor/
|
||||
@@ -144,9 +164,9 @@ make
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Standard compilation through Autoconf scripts :**
|
||||
#### Standard compilation through Autoconf scripts:
|
||||
|
||||
```
|
||||
```bash
|
||||
cd ccextractor/mac
|
||||
./autogen.sh
|
||||
./configure
|
||||
@@ -156,18 +176,18 @@ make
|
||||
./ccextractor
|
||||
```
|
||||
|
||||
**Compiling with GUI:**
|
||||
#### Compiling with GUI:
|
||||
|
||||
To use CCExtractor with a gui you will additionally need to install GLEW and GLFW. You can do that by installing it via homebrew using:
|
||||
|
||||
```
|
||||
```bash
|
||||
brew install glfw
|
||||
brew install glew
|
||||
```
|
||||
|
||||
In order to compile it you'll need to configure it using autoconf by passing the `-with-gui` option.
|
||||
|
||||
```
|
||||
```bash
|
||||
./autogen.sh
|
||||
./configure --with-gui
|
||||
make
|
||||
@@ -176,18 +196,40 @@ make
|
||||
Once set up you can run the GUI interface from the terminal `./ccextractorGUI`
|
||||
|
||||
## Windows
|
||||
Note: Following screenshots and steps are based on Visual Studio 2017, but they should be more or less same for other versions.
|
||||
|
||||
Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it.
|
||||
1.Open `windows/` directory to locate `ccextractor.vcxproj`, `ccextractorGUI.vcxproj` (blue arrows) and `ccextractor.sln` (red arrow).
|
||||
|
||||

|
||||
|
||||
2.Accept the security prompt (if any), to proceed with compilation.
|
||||

|
||||
|
||||
3.Using Visual Studio (2015 or above), open ccextractor.sln. This will build both CCExtractor and its GUI. To build them separately, open the respective .vcxproj file.
|
||||
|
||||
4.In Solution Explorer, you'll see two projects with the VS version and Windows release version in parenthesis. Change them to parameters which are true for you by clicking right mouse button on project and selecting properties.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
5.Right click and select `build` to compile the project and generate executable file.
|
||||
|
||||

|
||||
|
||||
6.Find the executable file in `Debug` or `Release` folder, based on selected configuration.
|
||||
|
||||

|
||||
|
||||
Configurations options are: `(Debug|Release)-Full`
|
||||
|
||||
Configurations options include dependent libraries which are used for OCR.
|
||||
|
||||
**Using CMake**
|
||||
### Using CMake
|
||||
|
||||
You may also generate `.sln` files for Visual Studio and build using build tools, or open `.sln` files using Visual Studio.
|
||||
|
||||
```
|
||||
```bash
|
||||
cmake ../src/ -G "Visual Studio 14 2015"
|
||||
cmake --build . --config Release --ccextractor
|
||||
```
|
||||
@@ -201,4 +243,3 @@ Go to the package_creators folder using `cd` and run the `./arch.sh`
|
||||
### Redhat Package Manager (rpm) based Linux Distributions
|
||||
|
||||
Go to the package_creators folder using `cd` and run the `./rpm.sh`
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
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
|
||||
50
docs/FFMPEG.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Overview
|
||||
|
||||
FFmpeg Integration was done to support multiple encapsulations.
|
||||
|
||||
## Dependencies
|
||||
FFmpeg libraries
|
||||
|
||||
### 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 prebuilt 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
|
||||
|
||||
### On Linux:
|
||||
`make ENABLE_FFMPEG=yes`
|
||||
|
||||
### On Windows:
|
||||
#### Put the path of libs/include of ffmpeg library in library paths.
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
2. Select Configuration properties in left panel(column) of property.
|
||||
3. Select VC++ Directory.
|
||||
4. In the right pane, in the right-hand column of the VC++ Directory property, open the drop-down menu and choose Edit.
|
||||
5. Add path of Directory where you have kept uncompressed library of FFmpeg.
|
||||
|
||||
|
||||
#### Set preprocessor flag `ENABLE_FFMPEG=1`
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
2. In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
3. In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
4. In the Preprocessor Definitions dialog box, add `ENABLE_FFMPEG=1`. Choose OK to save your changes.
|
||||
|
||||
#### Add library in linker
|
||||
1. Open property of project
|
||||
2. Select Configuration properties
|
||||
3. Select Linker in left panel(column)
|
||||
4. Select Input
|
||||
5. Select Additional dependencies in right panel
|
||||
6. Add all FFmpeg's lib in new line
|
||||
@@ -20,6 +20,10 @@ 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.
|
||||
|
||||
FFmpeg from packages (on Debian) plus a couple of other dependencies you will need:
|
||||
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxcb-shm0-dev liblzma-dev
|
||||
|
||||
FFmpeg from source:
|
||||
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
|
||||
@@ -36,8 +40,17 @@ 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
|
||||
To build the program with hardsubx support,
|
||||
|
||||
== from the Linux directory run:-
|
||||
./configure --enable-hardsubx
|
||||
make ENABLE_HARDSUBX=yes
|
||||
|
||||
== using cmake from root directory
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DWITH_OCR=on -DWITH_HARDSUBX=on ../src/
|
||||
make
|
||||
|
||||
NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04.
|
||||
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
A mailing list is now available from sourceforge:
|
||||
A mailing list is now available from google groups:
|
||||
|
||||
https://groups.google.com/forum/#!forum/ccextractor-dev
|
||||
|
||||
The old one, hosted in sourceforge, is discontinued, but here is the link just in case:
|
||||
|
||||
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
|
||||
another), so almost everything goes here:
|
||||
|
||||
- Bug reports
|
||||
- Feature requests
|
||||
- Announcements
|
||||
|
||||
NOT here:
|
||||
|
||||
- Samples
|
||||
|
||||
|
||||
|
||||
123
docs/OCR.md
Normal file
@@ -0,0 +1,123 @@
|
||||
# Overview
|
||||
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.
|
||||
|
||||
# Dependency
|
||||
1. Tesseract (OCR library by Google)
|
||||
2. Leptonica (Image processing library)
|
||||
|
||||
# How to compile CCExtractor on Linux with OCR
|
||||
|
||||
## Install Dependency
|
||||
|
||||
### Using package manager
|
||||
#### Ubuntu, Debian
|
||||
```
|
||||
sudo apt-get install libleptonica-dev libtesseract-dev tesseract-ocr-eng
|
||||
```
|
||||
#### Suse
|
||||
```
|
||||
zypper install leptonica-devel
|
||||
```
|
||||
|
||||
### Downloading source code and compiling it.
|
||||
|
||||
#### Leptonnica.
|
||||
This package is available in your distro, you need liblept-devel library.
|
||||
|
||||
If Leptonica isn't available for your distribution, or you want to use a newer version
|
||||
than they offer, you can compile your own.
|
||||
|
||||
you can download lib leptonica source code from http://www.leptonica.com/download.html
|
||||
|
||||
#### Tesseract.
|
||||
Tesseract is available directly from many Linux distributions. The package is generally
|
||||
called 'tesseract' or 'tesseract-ocr' - search your distribution's repositories to
|
||||
find it. Packages are also generally available for language training data (search the
|
||||
repositories,) but if not you will need to download the appropriate training data,
|
||||
unpack it, and copy the .traineddata file into the 'tessdata' directory, probably
|
||||
/usr/share/tesseract-ocr/tessdata or /usr/share/tessdata.
|
||||
|
||||
If Tesseract isn't available for your distribution, or you want to use a newer version
|
||||
than they offer, you can compile your own.
|
||||
|
||||
If you compile Tesseract then following command in its source code are enough
|
||||
```
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
Note:
|
||||
1. CCExtractor is tested with Tesseract 3.04 version but it works with older versions.
|
||||
2. Useful Download links:
|
||||
1. *Tesseract* https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
|
||||
2. *Tesseract training data* https://github.com/tesseract-ocr/tessdata/archive/3.04.00.tar.gz
|
||||
|
||||
|
||||
##Compilation
|
||||
|
||||
###using Build script
|
||||
```
|
||||
cd ccextractor/linux
|
||||
./build
|
||||
```
|
||||
|
||||
### Passing flags to configure
|
||||
```
|
||||
cd ccextractor/linux
|
||||
./autogen.sh
|
||||
./configure --with-gui --enable-ocr
|
||||
make
|
||||
```
|
||||
|
||||
### Passing flags to cmake
|
||||
```
|
||||
cd <CCExrtactor cloned code>
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DWITH_OCR=ON ../src
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
|
||||
How to compile CCExtractor on Windows with OCR
|
||||
===============================================
|
||||
|
||||
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.
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
2. Select Configuration properties in left panel(column) of property.
|
||||
3. Select VC++ Directory.
|
||||
4. In the right pane, in the right-hand column of the VC++ Directory property, open the drop-down menu and choose Edit.
|
||||
5. Add path of Directory where you have kept uncompressed library of leptonica and tesseract.
|
||||
|
||||
|
||||
Set preprocessor flag ENABLE_OCR=1
|
||||
1. In visual studio 2013 right click <Project> and select property.
|
||||
2. In the left panel, select Configuration Properties, C/C++, Preprocessor.
|
||||
3. In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
|
||||
4. In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
|
||||
|
||||
Add library in linker
|
||||
1. Open property of project
|
||||
2. Select Configuration properties
|
||||
3. Select Linker in left panel(column)
|
||||
4. Select Input
|
||||
5. Select Additional dependencies in right panel
|
||||
6. Add libtesseract304d.lib in new line
|
||||
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.gz extract the tar file and put
|
||||
tessdata folder where you have kept CCExtractor executable
|
||||
|
||||
Copy the tesseract and leptonica dll from lib folder downloaded from above link to folder of executable or in system32.
|
||||
98
docs/OCR.txt
@@ -1,98 +0,0 @@
|
||||
|
||||
Overview
|
||||
========
|
||||
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.
|
||||
|
||||
Dependency
|
||||
==========
|
||||
Tesseract (OCR library by Google)
|
||||
Leptonica (Image processing library)
|
||||
|
||||
Ubuntu install Dependency using package manager
|
||||
===============================================
|
||||
sudo apt-get install libleptonica-dev libtesseract-dev tesseract-ocr-eng
|
||||
|
||||
How to compile CCExtractor on Linux with OCR
|
||||
=============================================
|
||||
|
||||
Download and Install Leptonnica.
|
||||
-------------------------------
|
||||
This package is available, you need liblept-devel library.
|
||||
|
||||
If Leptonica isn't available for your distribution, or you want to use a newer version
|
||||
than they offer, you can compile your own.
|
||||
|
||||
you can download lib leptonica from http://www.leptonica.com/download.html
|
||||
|
||||
Download and Install Tesseract.
|
||||
-------------------------------
|
||||
Tesseract is available directly from many Linux distributions. The package is generally
|
||||
called 'tesseract' or 'tesseract-ocr' - search your distribution's repositories to
|
||||
find it. Packages are also generally available for language training data (search the
|
||||
repositories,) but if not you will need to download the appropriate training data,
|
||||
unpack it, and copy the .traineddata file into the 'tessdata' directory, probably
|
||||
/usr/share/tesseract-ocr/tessdata or /usr/share/tessdata.
|
||||
|
||||
If Tesseract isn't available for your distribution, or you want to use a newer version
|
||||
than they offer, you can compile your own.
|
||||
|
||||
If you compile Tesseract then following command in its source code are enough
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
|
||||
Note:
|
||||
1) CCExtractor is tested with Tesseract 3.04 version but it works with older versions.
|
||||
|
||||
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
|
||||
-------------------------------------------------
|
||||
make ENABLE_OCR=yes
|
||||
|
||||
|
||||
How to compile CCExtractor on Windows with OCR
|
||||
===============================================
|
||||
|
||||
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.
|
||||
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 leptonica
|
||||
and tesseract.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
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 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.gz extract the tar file and put
|
||||
tessdata folder where you have kept CCExtractor executable
|
||||
|
||||
Copy the tesseract and leptonica dll from lib folder downloaded from above link to folder of executable or in system32.
|
||||
@@ -1,252 +0,0 @@
|
||||
This is the main documentation of Python extension module for CCExtractor:
|
||||
|
||||
====
|
||||
CCExtractor Library
|
||||
|
||||
----
|
||||
Refactoring the codebase into a library
|
||||
Earlier version of CCExtractor was compiled as a binary and could not be used as a library. The entire codebase was executed via a single main function defined in ccextractor.c and this architecture was not suitable for extending ccextractor source code to a library. Hence, many modifications were made to ccextractor.c so that conversion to a library could be done. Major modifications were:
|
||||
Segmenting the larger functions into smaller functions so that they could be called from one main function. Earlier the entire processing was carried out from one main function itself. This was not a good idea considering the possibility for library. This would allow the user to set the parameters to be passed to CCExtractor from Python with one parameter at a time and not the entire list of all parameters together.
|
||||
The refactoring of the code base and architectural judgements as to how the code should be segmented so that the entire working remains the same and also the library structure could be established.
|
||||
Apart from these changes, the header file ccextractor.h was also included into the codebase to define many global variables as well as the function declarations of definitions made in ccextractor.c. The major changes could be seen at this PR (merged). However, following the next stages of development after the changes made in the above mentioned PR, the final structure could be found at ccextractor.c and ccextractor.h.
|
||||
|
||||
----
|
||||
Definitions made in ccextractor.h
|
||||
In ccextractor.h, the major changes included declaring global variables which would be accessible throughout the codebase for calling the respective callbacks (discussed later in the documentation) from C to Python for processing the caption frames in Python as they are extracted in CCExtractor. The global variable was also used to keep a track of the start time and end time of caption frames so that the CE-608 grids belonging to the same frame could be clubbed together. The global variable array has been defined and the respective structure definition has also been done in ccextractor.h.
|
||||
The global variable array is an instance of this structure. The elements of the structure are PyObject* reporter, int sub_count and struct python_subs_modified* subs. The subs has been defined with start_time and end_time as its elements. More detailed description about why start_time and end_time have been used is given in the section describing about extractors. The main motivation for defining a global variable to catch hold of start time and end time of the caption frames as they are processed in CCExtractor is to identify the text, font and color grids (for CE-608 captions) that belong to the same caption frame.
|
||||
The major point to note is that the compilation of Python extension module includes setting a macro PYTHONAPI which acts as an indication that the compilation is made for Python extension module and this helps in declaring as well as defining the functions which are only needed for Python extension module. As defined here, the PYTHONAPI macro is used to define the functions/variables which are needed only by the extension module.
|
||||
Another major advantage of defining the macro PYTHONAPI is that the definitions made for Python extension module only need python-dev package as a prerequisite for compilation. However, if the user wants to compile only CCExtractor and not the Python extension module, then the code should not have python-dev package as a dependency. This has been attained by using macro PYTHONAPI and C pre-processors.
|
||||
|
||||
====
|
||||
CCExtractor Python Extension Module
|
||||
|
||||
----
|
||||
Extension module dependencies
|
||||
|
||||
1. SWIG
|
||||
For generation of the wrappers of the C code base, which would then be used to compile the extension module, I have used SWIG (swig-3.0.12). The entire compilation has been included in a build script (discussed later) and the user need not have prior knowledge of SWIG to get started.
|
||||
For compiling the Python extension module, the second dependency in addition to the dependencies of CCExtractor is SWIG. The user can follow these installation steps for getting SWIG installed.
|
||||
For generating the wrappers of the C/C++ code in a user required language, the user needs to have a basic understanding of the interface file which is used by SWIG. However, in case of generating the extension module for CCExtractor, the interface file has been written and is available here. SWIG uses this interface file to generate the wrappers for CCExtractor which are then compiled to form the extension module.
|
||||
2. Python-dev package
|
||||
|
||||
----
|
||||
Overall architecture
|
||||
|
||||
The entire Python Extension module related work is done in the api/ directory with modifications to the CCExtractor codebase to integrate the divergent path, CCExtractor would take if the processing is done via Python module.
|
||||
|
||||
----
|
||||
Generating the Python extension module:
|
||||
|
||||
For this project, I have mainly used two build scripts, viz., build_api and build_library which are both present in the api/ directory. For generating the Python bindings, user need to just run the build_library script as ./build_library. This would internally generate the SWIG wrappers from the SWIG interface file (ccextractor.i) present in the same directory. The user should note that if the user has not installed SWIG, the the compilation would stop at this step itself. Once the wrappers are generated, then the build_library script would execute the build_api script which would compile the entire code base of CCExtractor along with the wrappers generated by SWIG. In addition to this, build_api would also compile the extractors and wrappers defined in the extractors/ and wrappers/ directories respectively. Once the compilation is successful, then build_library would generate a shared library called _ccextractor.so from the entire code which would be shared object for the module.
|
||||
In addition to generating the wrapper codes generated by SWIG, it also outputs the ccextractor.py which would be later used as Python extension module for accessing CCExtractor functionality via Python.
|
||||
As mentioned in earlier section, the build_api compiles the entire code base with an option -DPYTHONAPI which is used by GCC to define a macro PYTHONAPI. This macro then acts as a signal telling that the extension module is being generated and the bindings dependency need a check as well as the bindings dependent functions need to be defined.
|
||||
|
||||
----
|
||||
Workflow of Python extension module
|
||||
|
||||
The following section encompasses on the detailed description of the entire workflow of Python extension modules and the importance of each function in the codeflow. An example usage has been done in api_testing.py.
|
||||
|
||||
****
|
||||
api_init_options
|
||||
Function declaration- struct ccx_s_options* api_init_options()
|
||||
This function returns an initialized instance of struct ccx_s_options which is modified in CCExtractor according to the values of the parameters provided by the user while executing CCExtractor.
|
||||
****
|
||||
check_configuration_file
|
||||
Function declaration- void check_configuration_file(struct ccx_s_options api_options)
|
||||
This function is used to check the configuration file and it takes the struct ccx_s_options instance as returned by api_init_options().
|
||||
****
|
||||
api_add_param
|
||||
Function declaration- void api_add_param(struct ccx_s_options* api_options,char* arg)
|
||||
The api_add_param function is used to add user passed parameters to the struct ccx_s_options instance which would be used to compile the parameters and make the necessary modifications in the working of CCExtractor.
|
||||
This function takes the instance of struct ccx_s_options passed to check_configuration_file function and also, the string denoting the parameter passed by the user.
|
||||
The parameters are added to the python_params element of struct ccx_s_options and the count of the parameters is kept in python_param_count.
|
||||
****
|
||||
my_pythonapi
|
||||
Function declaration- (depends on whether the compilation is done as CCExtractor binary or as extension modules)
|
||||
The my_pythonapi is defined on the basis of how the compilation has been done by the user. If the user wants to use CCExtractor binary rather than the Python extension module, then this function is defined as #define my_pythonapi(args, func) set_pythonapi(args) with the set_pythonapi being defined in wrapper.c.
|
||||
However, if the user wants to build the extension module, then the definition of my_pythonapi is done as #define my_pythonapi(args, func) set_pythonapi_via_python(args, func) with the set_pythonapi_via_python function being defined in wrapper.c.
|
||||
Thus, it can been observed that my_pythonapi takes two arguments when the compilation is done as extension module. In both the case, the first argument is struct ccx_s_options instance as used by api_add_param. But in case of compiling the extension module, the my_pythonapi function takes a second parameter which is the python callback function that CCExtractor would call when passing values from C to Python (a detailed discussion about this has been done later).
|
||||
This function is not a mandatory function to call when using the CCExtractor binary.
|
||||
****
|
||||
compile_params
|
||||
Function declaration- int compile_params(struct ccx_s_options *api_options,int argc)
|
||||
The compile_params function mainly compiles all the parameters supplied by the user and modifies the elements of the api_options on the basis of the parameters supplied by the user.
|
||||
In this function, we add a dummy parameter ./ccextractor so that the parse_params function which is called from compile_params function properly compiles all the parameter except the first parameter as done in here.
|
||||
This function then returns the return value as obtained by the parse_params function.
|
||||
****
|
||||
call_from_python_api
|
||||
Function declaration- void call_from_python_api(struct ccx_s_options *api_options)
|
||||
The call_from_python_api function checks if the parameter -pythonapi was provided by the user. If the parameter was passed by the user then the global varable signal_python_api is set to 1 showing that the execution is done via Python modules; otherwise the value of signal_python_api is 0.
|
||||
In case of clarifications, the user does not explicitly need to pass the parameter -pythonapi. It is passed by the my_pythonapi function and thus used by call_from_python_api to set the signal_python_api to 1.
|
||||
****
|
||||
api_start
|
||||
Function declaration- int api_start(struct ccx_s_options api_options)
|
||||
This is the most important function of entire processing done by CCExtractor. After the entire compiling of parameters have been completed, then comes the stage when the actual processing is done.
|
||||
The api_start is the function which is majorly responsible for extracting the caption frames and passing them back to Python for processing.
|
||||
|
||||
The user should note that the codeflow discussed above till this point is generic to both CCExtractor binary as well as CCExtractor’s Python extension module. From this point onwards, the codeflow that has been described is mainly how the Python extension module accepts the caption frames via callback function and then processings done on the caption frames to generate the output subtitle file (.srt) via Python.
|
||||
|
||||
The api_start function in case of CE-608 captions calls a function general_loop for processing of the sample(video) that needs to be processed which in turn makes a call to encode_sub which encodes the subtitle buffer obtained from the sample.
|
||||
In encode_sub function, the sub_type is checked to be CE-608. If the sub_type is 608, then another check is made to check the value of signal_python_api. If the signal_python_api is set to 1, then a call to pass_cc_buffer_to_python is made. Otherwise, the processing continues as if the call for processing was made from CCExtractor binary.
|
||||
From the pass_cc_buffer_to_python function, the call is made to the extractor function, then the extractor function in turns calls the callback function provided earlier via my_pythonapi function. The arguments given to the callback function are the ones corresponding to the information content of the caption frame which has been processed by CCExtractor. This information is accessed via the Python SRT generator scripts which would process the caption frames and write the processed information in the output subtitle files.
|
||||
The following sections would be sequential in-detail descriptions about how each process functions:
|
||||
|
||||
----
|
||||
Python Encoder for CCExtractor
|
||||
|
||||
Following the architecture of CCExtractor’s codebase, a new file named ccx_encoders_python.c was added. The main reason of adding this file was to define the functions which would be called when the extraction process or CCExtractor extraction functionality is being performed via Python extension module. At this moment, since the extension module extends support only for CE-608 samples, only pass_cc_buffer_to_python function has been defined. Later on, when the binding’s support is extended to support other formats then in that case other functions like pass_cc_bitmap_to_python and others would be included in this file following the architecture of other encoders.
|
||||
****
|
||||
pass_cc_buffer_to_python
|
||||
Function declaration- int pass_cc_buffer_to_python(struct eia608_screen *data, struct encoder_ctx *context)
|
||||
This is the function where the actual work of passing the extracted caption buffer to Python extension modules for processing the caption frames is done.
|
||||
The pass_cc_buffer_to_python function is called when the sample from which the caption frames are to be extracted is a CE-608 sample and the call for extraction is made from Python extension module.
|
||||
In this function, whenever a caption frame element is extracted, be it the srt_counter, caption timing information or any information related to the text, font or color grid of the CE-608 captions, then that information is passed to extractor function defined in extractors/ directory. A detailed description about how exactly the extractors function would be included in the next section.
|
||||
|
||||
----
|
||||
Extractors for bindings
|
||||
|
||||
As documented in the previous section, when the extraction of CE-608 caption frames in done via Python, then the call is made to pass_cc_buffer_to_python function defined in ccx_encoders_python.c. In this function, after extracting lines in a caption frame (lines may belong to any of the text, font or color grid for CE-608), those lines are passed to python_extract_g608_grid function defined in extractors.c.
|
||||
****
|
||||
python_extract_g608_grid
|
||||
Function declaration- void python_extract_g608_grid(unsigned h1, unsigned m1, unsigned s1, unsigned ms1, unsigned h2, unsigned m2, unsigned s2, unsigned ms2, char* buffer, int identifier, int srt_counter, int encoding)
|
||||
The main aim of using python_extract_g608_grid function is to able to identify the lines belonging to a particular frame and then passing these lines to the Python callback function with added identifiers for identification as to which CE-608 grid those lines belong to in a particular caption frame. More documentation about the identifiers and the nomenclature used for the bindings has been documented in the ‘Support for only CE-608 captions’ section and the user is advised to read that section to get a better understanding of the nomenclature.
|
||||
The arguments passed to python_extract_g608_grid include encoding which is the encoding that CCExtractor would have used to write the output subtitle file. Thus, the encoding is passed from CCExtractor to Python via the callback function so that the output subtitle file generated by Python would have the same encoding as the output generated by CCExtractor would have had.
|
||||
Out of all the arguments that are passed to the python_extract_g608_grid function, the one interesting argument is the identifier argument which has different values depending on the type of caption frame line it is called with. For example, if the line passed to python_extract_g608_grid function is a line belonging to its color grid, then the value of the identifier would be 2. Similarly, we have:
|
||||
identifier = 0 -> adding start and end time
|
||||
identifier = 1 -> subtitle
|
||||
identifier = 2 -> color
|
||||
identifier = 3 -> font
|
||||
This is how the python_extract_g608_grid function is able to generate the entire caption frame for a CE-608 sample along with timings.
|
||||
|
||||
----
|
||||
Callback Function architecture
|
||||
|
||||
When using the extension module, when a particular C function is called from Python, the control is transferred to C and returned to Python only after the execution of the function. However, according to the adopted architecture, a single function would process the entire sample and extract all the caption frames until the control is passed back to Python for processing the captions in Python. Thereupon, for further processing in Python the user would have had to wait until the end of the extraction of all the caption frames from the sample. This would violate the basic ideology that the module should be able to process the caption frames in Python as they are extracted in CCExtractor rather than waiting till the end of extraction from the entire sample.
|
||||
As a result of this, the callback function architecture was adopted. The main advantage of this architecture is that the moment a line from the caption frame is extracted the line is passed via a callback function to Python and the processing of the extracted line could be done in Python.
|
||||
In the present architecture, the user has a flexibility to tell CCExtractor which Python function would act as a callback function and a mechanism has been designed to convey this function to CCExtractor. This has been done with the use of my_pythonapi function as discussed in the previous sections.
|
||||
NOTE: In the api_testing.py, I have defined the callback function to be named callback. However, the user has complete freedom to define any name for the callback function. The user needs to note that the callback function would be getting nothing but a line from the caption frame that is extracted by CCExtractor. Further processing of the extracted line is the responsibility of the user.
|
||||
After defining the callback function, the user needs to make sure that this function is passed via Python to CCExtractor so that it can be used for callback. For doing so, the user needs to set the second argument of the function my_pythonapi as the callback function. This has been done in the api_testing.py script and the user can refer to it for example.
|
||||
A detailed description about why a single line of the caption frame is passed via the callback function and not the entire frame is described in detail in later sections.
|
||||
Also, when the user passes the callback function via Python to CCExtractor so the my_pythonapi function saves a pointer to this function as an element to a global structure, array, defined and declared in ccextractor.h. The element reporter holds the callback function passed by user via Python.
|
||||
Whenever the user wants to pass a line to the callback function then the user needs to call the function run which has been defined in ccextractor.c.
|
||||
****
|
||||
run
|
||||
Function declaration- void run(PyObject * reporter, char * line, int encoding)
|
||||
The run function takes two arguments and their description is as follows:
|
||||
The first argument is the callback function which the user passes via Python. According to present architecture, this callback function is contained by the element reporter contained in the global structure named array. So the first argument is array.reporter.
|
||||
The second argument to the run function is the line which needs to be passed to Python.
|
||||
This is how the callback mechanism works for passing the lines from C to Python in real time.
|
||||
|
||||
----
|
||||
Processing output in Python
|
||||
|
||||
As described in the previous sections, the extension modules just return a single line from the caption frames. The processing of the caption frames to generate the output subtitle file is done in Python.
|
||||
A script to generate an output subtitle file from the extracted captions frames in Python has been written. The api_testing.py has a function named callback which acts as a callback function returning the extracted caption lines in Python. These lines then are passed to generated_output_srt in api_support.py described in the api/ directory. Thereupon, the function searches if the line has specific identifier which are used to decide how the output would be generated. A detailed section has been included in this documentation regarding the nomenclature used for processing different lines in CE-608 format caption fields (Support for only CE-608 captions section). The main reason for doing so is to avoid any buffering in C to hold the caption lines until the entire caption frames are extracted. This facilitates real time processing of the extracted caption frames.
|
||||
For getting the output filename from CCExtractor which would then be used to write the output srt file from Python, whenever the code is run from the extension module the first line that is passed via the callback function is the output filename generated by CCExtractor. This is incorporated by calling the callback function from init_write function defined in the src/lib_ccx/output.c file. The line passed to the callback function is of the format filename-<name of the output file to be generated> and this is then used to generate the output file. This line is then captured in the generate_output_srt function defined in the api_support.py.
|
||||
However, if the user wants the flexibility of defining the filename in a different manner, then for such outputs, the user must make changes in the generate_output_srt function to set the filename and ignoring the first line that appears in Python via the callback function.
|
||||
|
||||
----
|
||||
Support for only CE-608 captions:
|
||||
|
||||
For understanding the CE-608 caption format, the user is advised to refer to this documentation on CE-608.
|
||||
|
||||
The Python extension module is so far able to extract the captions frames from CE-608 samples. In samples with CE-608, the caption frames that are extracted by CCExtractor are in the form a 15x32 grid which depicts the screen. Thus, the information regarding the font of the captions, the colour they would be having on the screen as well as their alignment on the screen is captured in font,color and text grids respectively.
|
||||
Using Python modules each of such grids can be accessed in Python. However, as described in the previous section the callback function gets a single line and not the entire grid from CCExtractor, some processing needs to be done in Python for getting the user required grids per caption frames.
|
||||
The functions which would be acting as the processing and buffering functions for grid generations are present in the ccx_to_python_g608.py. The two major functions are return_g608_grid and g608_grid_former. The g608_grid_former is mainly used to form the grid from lines obtained at the callback function.
|
||||
The main advantage of the return_g608_grid function is that the user can generate whatever pattern the user desires to process in Python. For accessing various different combinations of the font, color and text grids in CE-608, a help_string has been defined in the return_g608_grid function in the ccx_to_python_g608.py file which describes on the value of mode to be passed to this function to get proper combination of the grids.
|
||||
In the earlier sections it has been stated that the callback function in Python is not passed with the entire caption frame but just one single line from the frame, a particular nomenclature has been devised to make sure that the lines belonging to the same caption frames are identified in the Python interface. The nomenclature is as follows:
|
||||
For every frame, the first line that is passed to the callback function is the srt_counter which indicates the identifier value of the caption frame that would be extracted next.
|
||||
Following the srt_counter, the next line would contain a conjunction of the start time and end time of the caption frame with respect to the timings when the captions would be visible on the screen. The start_time and end_time would be conjuncted as start_time-<start time>\t end_time-<end time>\n and the user needs to process this line to get the timings. This processing in case of getting a srt file as an output has been done in the generate_output_srt function.
|
||||
After the timings have been sent via the callback function, until the next srt_counter is extracted, the lines containing information about the color, font or text grids of CE-608 samples are passed via the callback function to Python.
|
||||
For processing the grids separately, the color grid could be identified by identifying the presence of color[<srt_counter value>]:<color grid line> in the line obtained from the callback function. Similarly, for the font and text grids, the nomenclatures are font[<srt_counter value>]:<font grid line> and text[<srt_counter value>]:<text grid line> respectively. Processing a grid on the basis of such a nomenclature has been done in the g608_grid_former in the ccx_to_python_g608.py file.
|
||||
After the entire caption frame has been sent via the callback function to Python for further processing, when the extraction of present caption frames finishes and CCExtractor shifts to a new frame, then a line containing ***END OF FRAME*** is passed via the callback function from C to Python. The user needs to catch this line in order to get the signal that from the next line onwards a new caption frame would begin. Similar approach has been implemented in the function generate_output_srt in the api_support.py file.
|
||||
This is how the entire CE-608 is transmitted to Python and the user needs to follow the nomenclature in order to get the caption frames in Python.
|
||||
However, if the user thinks to modify the nomenclature in accordance with some other nomenclature that suits their use case, then the user can do so by editing the python_extract_g608_grid function in the extractor.c file. In this file, the user needs to find the lines where the function run is called with its first parameter being the callback function that is passed from Python and the second parameter being the line which is to be passed to Python.
|
||||
|
||||
----
|
||||
Wrappers for the extension module
|
||||
|
||||
In case of using an API, it is highly desired to set the parameters desired by the user not via command line but as call to built-in functions. This gave rise to the necessity of wrapper functions which can be called to set certain parameters for directing the functioning of the bindings.
|
||||
The wrappers have been defined in the wrapper.c file in api/wrappers/ directory. The user can use just call the wrappers to set some parameters. More wrappers can be defined according to the architecture followed in wrapper.c.
|
||||
The user needs to note that the wrappers can be called anytime in between adding parameters to CCExtractor instance (as done in api_testing.py) and before calling the compile_params function from the CCExtractor module.
|
||||
Another thing to note about the wrapper is that, the my_pythonapi wrapper function is a very important wrapper function. It tells CCExtractor that the call has been made using the Python module and thus the functioning of CCExtractor is altered. Hence, if the user intends to use the Python module the user is always advised to call this wrapper function with its first argument to be the object returned by api_init function from CCExtractor module and second argument being the callback function which would be called by the CCExtractor to pass the extracted caption lines back to Python.
|
||||
|
||||
----
|
||||
Test Script
|
||||
|
||||
Once the Python module are generated then the user can use them by importing ccextractor module in Python.
|
||||
For testing the output of the bindings a test script, api_testing.py. But to mention, the module at this stage only supports generating a subtitle file from the CE-608 standard samples only.
|
||||
Another testing feature, that has been added is that the user can use recursive_tester.py to generate the subtitle files for all the samples from a directory. The only parameter needed to run this script is the location of all the samples.
|
||||
|
||||
----
|
||||
Silent API
|
||||
|
||||
The Python bindings have been designed in such a way that the API is silent in itself as well as in the form of output generation. Silent in itself means that the API doesn’t write out any output to the STDOUT and the entire output of CCExtractor is silenced when the module is used for extraction of caption frames. This feature has been made possible by passing a parameter -pythonapi internally in api_testing.py using the function my_pythonapi() from the ccextractor module. The -pythonapi internally makes CCExtractor to silence all the outputs that could have been generated otherwise.
|
||||
If the user wants to add some print functionality from the CCExtractor, then may be defining the prints using printf C function could be an option. Note that the user cannot use the mprint function to get prints from the extension module from inside the CCExtractor C code part as used in CCExtractor to get the desired STDOUT prints as these are silenced via -pythonapi.
|
||||
|
||||
====
|
||||
Work status
|
||||
The proposal made by me for this project had a major component of multi-threading to let CCExtractor’s Python bindings run the CCExtractor’s extraction process in multi-threads.
|
||||
However, the end goal was modified while the GSOC 2017 coding period and after Second Phase Evaluation, the main aim was to create a Python extension module for CCExtractor which could process CE-608 video samples, extract the caption information present in them and pass this information to Python for further processing. The module was expected to be silent and the output generation from the caption information present in the video sample has to be done via Python.
|
||||
The present status of the extension module is that the module can extract caption information from CE-608 standard video samples and pass the caption information to Python. Further work has also been done to process this caption information to generate an output subtitle(srt) file (the user is advised to check completion of comparing_text_font_grids function sub-section under the future work section).
|
||||
|
||||
====
|
||||
Future Work
|
||||
|
||||
----
|
||||
Identifying the input format and raising errors if unsupported
|
||||
|
||||
CCExtractor does not process any non-video files. Similarly, the processing of non-video files is not supported by extension module. However, since the API has been designed to be silent, the module doesn’t output any error log stating that the input file is a non-video file and it cannot be processed.
|
||||
This is a much desired feature and the present version of CCExtractor extension module lacks this feature. I would be working on this feature post GSOC 2017 but if any user finds that this feature has not been added until they start contribution to CCExtractor’s extension module, then their work on this feature would be highly appreciated.
|
||||
For adding this feature to extension module, the extension module must be extended to process the return value from CCExtractor as done in the api_start function. When the sample (non-video) is processed via CCExtractor’s binary, then the processing is stopped by raising an ‘Invalid option to CCExtractor Library’ error. However, since the extension module has been designed to be silent, this error message is suppressed. Hence, the user should extend the test scripts to process the return value of api_start function in python extension module according to the constants defined in ccx_common_common.h
|
||||
|
||||
----
|
||||
Callback class mechanism
|
||||
|
||||
The present architecture uses a callback mechanism to pass the extracted caption lines from the caption frames of CE-608 captions to Python for further processing. In the callback mechanism, a callback function is supplied to CCExtractor in C via the my_pythonapi function which stores the callback function as a PyObject* in the global variable array. However, according to Python documentation on C-API, everything in Python is a PyObject; be it a function, a tuple or a class.
|
||||
So, the ideology is to replace the present callback function by a class which can have many methods that the user can use for different use cases.
|
||||
An example of such an implementation has been done here. The user needs to note that for accessing the Python class in C, some modifications need to be done to the run function defined in ccextractor.c and a sample example for calling a class method named ‘callback’ could be found here.
|
||||
Also, an important point to be noted in this case is that the user needs to pass the callback function’s name to run function in C so that the corresponding callback method of the class passed via my_pythonapi could be called via C. As an example, the callback method’s name has been provided here.
|
||||
For understanding the exact implementation of this approach, I would recommend the user to understand C-API for Python as the documentation is quite extensive to every use case.
|
||||
|
||||
----
|
||||
Completion of comparing_text_font_grids function
|
||||
|
||||
The Python extension module for CCExtractor is able to pass lines of the caption frames for different grids of CE-608 captions. However, for generating the subtitle file from the caption grids, the text grid needs to be modified according to the color grid as well as font grid. In CCExtractor, this job is done at the function, get_decoder_line_encoded.
|
||||
For generation of subtitle files (.srt files) from Python, an equivalent version of get_decoder_line_encoded has been implemented in Python and has been defined as comparing_text_font_grids in python_srt_generator.py
|
||||
However, as the user can note that this function is not a complete implementation of get_decoder_line_encoded function, completion of this function’s definition is a matter of future work.
|
||||
|
||||
----
|
||||
Adding more wrapper functions
|
||||
|
||||
As described in the ‘Wrappers for the extension module’ section, more wrapper functions are needed to be declared in the wrapper.c file. For example, few wrappers have been defined. More wrapper functions can be defined in a similar manner.
|
||||
Extending the module to support other caption formats
|
||||
In this version, CCExtractor’s extension module supports processing of video samples having CE-608 standard captions in them and writing these captions to output subtitle (.srt) files.
|
||||
However, CCExtractor in itself has support for other caption standards like DVB, 708 etc. So, extension of module to extract of caption information from samples containing the caption information in these formats is a future task.
|
||||
The user should note that the information passed from CE-608 to Python is in raw form as lines which are then used to form the 608 grids. Similarly, the extension to other formats must consider passing the raw information of caption in respective format and then processing the information extracted by CCExtractor in Python.
|
||||
While extending, the architecture to be followed for ccx_encoders_python should be consistent to other encoders in the codebase to maintain uniformity. Thus for DVB samples, a function name pass_cc_bitmap_to_python and for 708 samples pass_cc_subtitle_to_python need to be declared in ccx_encoders_python.c.
|
||||
|
||||
====
|
||||
PyPI module
|
||||
(This section is for contributors who want to upload the package to PyPI)
|
||||
The PyPI module that has been uploaded has many things added to the CCExtractor code tree and all of this can be found here (branch - manifest_file).
|
||||
The contributor is advised to use the documentation at ‘An Introduction to Distutils’ and its subsequent parts to understand this section.
|
||||
The overall strategy or steps that have been followed to generate the distribution for being uploaded to PyPI is as follows:
|
||||
|
||||
----
|
||||
Adding files to distribution and generating the distribution
|
||||
|
||||
All the files that are needed to be included in the package distribution are to be added the MANIFEST file as done here. For understanding the syntax used in MANIFEST file the user can check this documentation.
|
||||
After the MANIFEST file has been written properly, the user can generate the distribution package by the command
|
||||
python setup.py sdist
|
||||
This command would generate the distribution on the basis of MANIFEST file and place in the dist/ directory as a .tar.gz file until specified otherwise by the user.
|
||||
One thing to mention about the MANIFEST file is that it can only include files/folders from the folder it is defined within. It cannot include directories/files from parent directory or any other child directory. However, in the MANIFEST file I used, I have added the symlink to src main src directory so that the source code can be added to the package distribution via the MANIFEST file.
|
||||
|
||||
----
|
||||
An analysis of the setup.py file used
|
||||
|
||||
The setup.py has been used to install the Python module on the user system. To understand what all the parameters mean in setup the user must refer to this documentation.
|
||||
The cmdclass defined at line is a very important part of the script as it internally makes call to the scripts included in package_build_scripts. A point to note is that this directory is used to include the scripts into the package distribution via the MANIFEST file.
|
||||
The scripts in package_build_scripts are the scripts which do the actual compilation of the source code to required python module and shared object. The user is advised to refer to build_library_package and build_api_package to understand how to compilation process takes place. The user may also refer to this documentation for understanding how the build scripts work.
|
||||
For any modifications made to the build scripts, viz, build_library and build_api corresponding modifications are to be made to the scripts included in package_build_scripts so that the compilation does not fail while installing the Python extension module.
|
||||
The ccextractor.i used in the package_build_scripts is an interface file used by SWIG to generate the wrapper codes. This is an essential part and should always be present with the distribution.
|
||||
@@ -1,68 +1,16 @@
|
||||
ccextractor, 0.86
|
||||
-----------------
|
||||
Original authors: Carlos Fernández (cfsmp3), Volker Quetschke.
|
||||
Maintainer: cfsmp3
|
||||
## CCExtractor
|
||||
check AUTHORS.TXT for history and developers
|
||||
|
||||
Currently lots of developers work on CCExtractor, particularly during
|
||||
Google Summer of Code and Google Code-in.
|
||||
|
||||
Lots of credit goes to other people, though:
|
||||
McPoodle (author of the original SCC_RIP), Neuron2, and others (see source
|
||||
code).
|
||||
|
||||
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
|
||||
- Matej Plavevski
|
||||
- Danila Fedorin
|
||||
|
||||
(more, but they forgot to add themselves...)
|
||||
|
||||
Google Summer of Code 2017 students
|
||||
- Diptanshu Jamgade
|
||||
- Mayank Gupta
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
GPL 2.0.
|
||||
|
||||
Description
|
||||
-----------
|
||||
ccextractor was originally a mildly optimized C port of McPoodle's excellent
|
||||
but painfully slow Perl script SCC_RIP. It lets you rip the raw closed
|
||||
captions (read: subtitles) data from a number of sources, such as DVD or
|
||||
ATSC (digital TV) streams.
|
||||
|
||||
## Description
|
||||
Since the original port, the whole code has been rewritten (more than once,
|
||||
one might add) and support for most subtitle formats around the world has
|
||||
been added (teletext, DVB, CEA-708, ISDB...)
|
||||
|
||||
|
||||
Basic Usage
|
||||
-----------
|
||||
## Basic Usage
|
||||
(please run ccextractor with no parameters for the complete manual -
|
||||
this is for your convenience, really).
|
||||
|
||||
@@ -79,8 +27,7 @@ trivial - you just need to pass the input file and (optionally) some
|
||||
details about the input and output files.
|
||||
|
||||
|
||||
Languages
|
||||
---------
|
||||
## Languages
|
||||
Usually English captions are transmitted in line 21 field 1 data,
|
||||
using channel 1, so the default values are correct so you don't
|
||||
need to do anything and you don't need to understand what it all
|
||||
@@ -98,20 +45,17 @@ So try adding these parameter combinations to your other parameters.
|
||||
|
||||
If there are Spanish subtitles, one of them should work.
|
||||
|
||||
McPoodle's page
|
||||
---------------
|
||||
## McPoodle's page
|
||||
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
|
||||
|
||||
Essential CC related information and free (with source) tools.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
## Encoding
|
||||
This version, in both its Linux and Windows builds generates by
|
||||
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
|
||||
-----------
|
||||
## Future work
|
||||
- Please check www.ccextractor.org for news and future work.
|
||||
|
||||
27
docs/Updating_Dependencies.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
A guide to how dependencies should be updated in CCExtractor.
|
||||
|
||||
Author: thealphadollar
|
||||
======================
|
||||
|
||||
CCExtractor depends on multiple dependencies and they are updated from time to time. On every major revision of the dependencies, the changes need to be incorporated into our repository.
|
||||
|
||||
It is not straightforward since we make minor (or sometimes major) changes into the library to use it and these changes are lost in case of direct file replacement. To overcome this issue, we should follow the below pathway.
|
||||
|
||||
*) Create a duplicate copy of the CCExtractor's folder of the library, to be updated (we will be calling this folder lib(copy) in steps and original one as lib).
|
||||
*) Download the latest files of the library from official source (the folder is called as lib(orig) in further steps).
|
||||
*) Look for files with the same name in lib and lib(orig). It can be done manually in case of small libraries (libpng), otherwise a script can be written utilising the grep command to find out files from the library which we use.
|
||||
*) In lib, replace all the files (found in previous step) with their updated versions from lib(orig). A copy command can be used in the script written for the previous step to accomplish this step.
|
||||
|
||||
Now, the files in our repository have been updated. In steps to follow, we will try to grab lost changes using lib(copy).
|
||||
|
||||
*) Run diff command between lib(copy) and lib for all files and store the output in a text document. Here files from lib(copy) should be given as first argument to notice deletions clearly.
|
||||
*) Look for deletions in an updated file and manually inspect (or ask mentor) whether that part is to be restored or not. In most cases, it is to be restored but it's better to ask than to break.
|
||||
|
||||
Once the changes have been restored, try to compile CCExtractor. It is very much likely that the compilation will fail. The most probably reason for this could be inclusion of unnecessary lines of code and their accompanying dependencies.
|
||||
e.g "X is not defined" can be an error when we don't include the file in which X is defined nor remove the unnecessary line using X.
|
||||
CCExtractor doesn't use a library fully, we use only the code and files necessary. This requires manual removal of extra lines and dependencies.
|
||||
|
||||
*) Output the compilation erros in a text document while compiling.
|
||||
*) Use inspection and comparison with lib(copy) to decide whether the line causing error is to be removed.
|
||||
|
||||
Compile again, debug and push the change for the Continuous Integration tests on samples.
|
||||
@@ -1,7 +1,7 @@
|
||||
#######################################################
|
||||
# Version 0.01
|
||||
# Version 0.02
|
||||
#
|
||||
# To enable required option please uncommnent option
|
||||
# To enable required option please uncomment option
|
||||
#
|
||||
|
||||
|
||||
@@ -12,12 +12,15 @@
|
||||
# 0 = file
|
||||
# 1 = stdin
|
||||
# 2 = network
|
||||
# 3 = tcp
|
||||
|
||||
INPUT_SOURCE=0
|
||||
|
||||
# The Buffer Input tag
|
||||
# This tag takes number in its input.
|
||||
|
||||
# Is it ccx_bufferdata_type ?
|
||||
|
||||
#BUFFER_INPUT=0
|
||||
|
||||
# The Direct Rollup tag
|
||||
@@ -45,22 +48,28 @@ INPUT_SOURCE=0
|
||||
#NOTYPE_SETTING=
|
||||
|
||||
# The Codec Tag takes the preference of codec
|
||||
# tag CCX_CODEC_ANY is by default
|
||||
# tag CCX_CODEC_ANY by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_CODEC_ANY (default)
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
# 3 = CCX_CODEC_ISDB_CC
|
||||
# 4 = CCX_CODEC_ATSC_CC
|
||||
# 5 = CCX_CODEC_NONE
|
||||
|
||||
#CODEC=
|
||||
|
||||
# The NO Codec Tag uses codec specified
|
||||
# tag CCX_CODEC_NONE by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_CODEC_ANY
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
|
||||
#CODEC=
|
||||
|
||||
# The NO Codec Tag do not use codec specified
|
||||
# tag CCX_CODEC_NONE is by default
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 1 = CCX_CODEC_TELETEXT
|
||||
# 2 = CCX_CODEC_DVB
|
||||
# 3 = CCX_CODEC_NONE
|
||||
# 3 = CCX_CODEC_ISDB_CC
|
||||
# 4 = CCX_CODEC_ATSC_CC
|
||||
# 5 = CCX_CODEC_NONE (default)
|
||||
|
||||
#NOCODEC=
|
||||
|
||||
@@ -68,15 +77,21 @@ INPUT_SOURCE=0
|
||||
# by default output format is srt
|
||||
# This tag takes number in its input and their meanings
|
||||
# are following
|
||||
# 0 = CCX_OF_RAW
|
||||
# 1 = CCX_OF_SRT (default)
|
||||
# 2 = CCX_OF_SAMI
|
||||
# 3 = CCX_OF_TRANSCRIPT
|
||||
# 4 = CCX_OF_RCWT
|
||||
# 5 = CCX_OF_NULL
|
||||
# 6 = CCX_OF_SMPTETT
|
||||
# 7 = CCX_OF_SPUPNG
|
||||
# 8 = CCX_OF_DVDRAW
|
||||
# 0 = CCX_OF_RAW
|
||||
# 1 = CCX_OF_SRT (default)
|
||||
# 2 = CCX_OF_SAMI
|
||||
# 3 = CCX_OF_TRANSCRIPT
|
||||
# 4 = CCX_OF_RCWT
|
||||
# 5 = CCX_OF_NULL
|
||||
# 6 = CCX_OF_SMPTETT
|
||||
# 7 = CCX_OF_SPUPNG
|
||||
# 8 = CCX_OF_DVDRAW
|
||||
# 9 = CCX_OF_WEBVTT
|
||||
# 10 = CCX_OF_SIMPLE_XML
|
||||
# 11 = CCX_OF_G608
|
||||
# 12 = CCX_OF_CURL
|
||||
# 13 = CCX_OF_SSA
|
||||
# 14 = CCX_OF_MCC
|
||||
|
||||
#OUTPUT_FORMAT=
|
||||
|
||||
|
||||
BIN
docs/img/Binaries.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
docs/img/Building.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
docs/img/ProjectSection.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
docs/img/Properties.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
docs/img/Warning.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
docs/img/projectFiles.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
@@ -11,8 +11,10 @@ Step 2) create a separate directory where you want to build the target.
|
||||
~> cd ccextractor
|
||||
~> mkdir build
|
||||
|
||||
Step 3) make the build system using cmake
|
||||
~> cmake ../src/
|
||||
Step 3) make the build system using cmake. Params in [] are optional and have
|
||||
been explained later in the document.
|
||||
~> cmake [-DWITH_FFMPEG=ON] [-DWITH_OCR=ON] [-DWITH_SHARING=ON]
|
||||
[-DWITH_HARDSUBX=ON] ../src/
|
||||
|
||||
Step 4) Compile the code.
|
||||
~> make
|
||||
@@ -28,7 +30,10 @@ 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/
|
||||
cmake -DWITH_SHARING=ON ../src/
|
||||
|
||||
If you want to build CCExtractor with HARDSUBX support
|
||||
cmake -DWITH_HARDSUBX=ON ../src/
|
||||
|
||||
Hint for looking all the things you want to set from outside
|
||||
cmake -LAH ../src/
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
find /vagrant/Second\ phase\ evaluation/ -name '*.ts' -exec sh -c '
|
||||
for file do
|
||||
python ../../api/api_testing.py $file -quiet
|
||||
done
|
||||
' sh {} +
|
||||
@@ -5,101 +5,110 @@ bin_PROGRAMS = ccextractor
|
||||
ccextractor_SOURCES = \
|
||||
../src/ccextractor.c \
|
||||
../src/ccextractor.h \
|
||||
../src/gpacmp4/avc_ext.c \
|
||||
../src/gpacmp4/avilib.c \
|
||||
../src/gpacmp4/av_parsers.c \
|
||||
../src/gpacmp4/base_encoding.c \
|
||||
../src/gpacmp4/bitstream.c \
|
||||
../src/gpacmp4/box_code_3gpp.c \
|
||||
../src/gpacmp4/box_code_adobe.c \
|
||||
../src/gpacmp4/box_code_apple.c \
|
||||
../src/gpacmp4/box_code_base.c \
|
||||
../src/gpacmp4/box_code_drm.c \
|
||||
../src/gpacmp4/box_code_meta.c \
|
||||
../src/gpacmp4/box_funcs.c \
|
||||
../src/gpacmp4/configfile.c \
|
||||
../src/gpacmp4/data_map.c \
|
||||
../src/gpacmp4/desc_private.c \
|
||||
../src/gpacmp4/descriptors.c \
|
||||
../src/gpacmp4/drm_sample.c \
|
||||
../src/gpacmp4/error.c \
|
||||
../src/gpacmp4/gpac_ogg.c \
|
||||
../src/gpacmp4/hinting.c \
|
||||
../src/gpacmp4/ipmpx_code.c \
|
||||
../src/gpacmp4/ipmpx_parse.c \
|
||||
../src/gpacmp4/isom_intern.c \
|
||||
../src/gpacmp4/isom_read.c \
|
||||
../src/gpacmp4/isom_store.c \
|
||||
../src/gpacmp4/isom_write.c \
|
||||
../src/gpacmp4/list.c \
|
||||
../src/gpacmp4/math.c \
|
||||
../src/gpacmp4/media.c \
|
||||
../src/gpacmp4/media_odf.c \
|
||||
../src/gpacmp4/meta.c \
|
||||
../src/gpacmp4/movie_fragments.c \
|
||||
../src/gpacmp4/mp4.c \
|
||||
../src/gpacmp4/odf_code.c \
|
||||
../src/gpacmp4/odf_codec.c \
|
||||
../src/gpacmp4/odf_command.c \
|
||||
../src/gpacmp4/os_config_init.c \
|
||||
../src/gpacmp4/os_divers.c \
|
||||
../src/gpacmp4/os_file.c \
|
||||
../src/gpacmp4/qos.c \
|
||||
../src/gpacmp4/sample_descs.c \
|
||||
../src/gpacmp4/slc.c \
|
||||
../src/gpacmp4/stbl_read.c \
|
||||
../src/gpacmp4/stbl_write.c \
|
||||
../src/gpacmp4/track.c \
|
||||
../src/gpacmp4/tx3g.c \
|
||||
../src/gpacmp4/url.c \
|
||||
../src/gpacmp4/utf.c \
|
||||
../src/gpacmp4/gpac/avparse.h \
|
||||
../src/gpacmp4/gpac/base_coding.h \
|
||||
../src/gpacmp4/gpac/bitstream.h \
|
||||
../src/gpacmp4/gpac/config_file.h \
|
||||
../src/gpacmp4/gpac/configuration.h \
|
||||
../src/gpacmp4/gpac/constants.h \
|
||||
../src/gpacmp4/gpac/events_constants.h \
|
||||
../src/gpacmp4/gpac/ietf.h \
|
||||
../src/gpacmp4/gpac/isomedia.h \
|
||||
../src/gpacmp4/gpac/list.h \
|
||||
../src/gpacmp4/gpac/math.h \
|
||||
../src/gpacmp4/gpac/media_tools.h \
|
||||
../src/gpacmp4/gpac/mpeg4_odf.h \
|
||||
../src/gpacmp4/gpac/network.h \
|
||||
../src/gpacmp4/gpac/revision.h \
|
||||
../src/gpacmp4/gpac/setup.h \
|
||||
../src/gpacmp4/gpac/tools.h \
|
||||
../src/gpacmp4/gpac/utf.h \
|
||||
../src/gpacmp4/gpac/version.h \
|
||||
../src/gpacmp4/gpac/internal/avilib.h \
|
||||
../src/gpacmp4/gpac/internal/isomedia_dev.h \
|
||||
../src/gpacmp4/gpac/internal/media_dev.h \
|
||||
../src/gpacmp4/gpac/internal/odf_dev.h \
|
||||
../src/gpacmp4/gpac/internal/odf_parse_common.h \
|
||||
../src/gpacmp4/gpac/internal/ogg.h \
|
||||
../src/libpng/pngstruct.h \
|
||||
../src/libpng/pngpriv.h \
|
||||
../src/libpng/pnginfo.h \
|
||||
../src/libpng/pnglibconf.h \
|
||||
../src/libpng/pngconf.h \
|
||||
../src/libpng/pngdebug.h \
|
||||
../src/libpng/png.h \
|
||||
../src/libpng/png.c \
|
||||
../src/libpng/pngerror.c \
|
||||
../src/libpng/pngget.c \
|
||||
../src/libpng/pngmem.c \
|
||||
../src/libpng/pngpread.c \
|
||||
../src/libpng/pngread.c \
|
||||
../src/libpng/pngrio.c \
|
||||
../src/libpng/pngrtran.c \
|
||||
../src/libpng/pngrutil.c \
|
||||
../src/libpng/pngset.c \
|
||||
../src/libpng/pngtrans.c \
|
||||
../src/libpng/pngwio.c \
|
||||
../src/libpng/pngwrite.c \
|
||||
../src/libpng/pngwtran.c \
|
||||
../src/libpng/pngwutil.c \
|
||||
../src/thirdparty/gpacmp4/avc_ext.c \
|
||||
../src/thirdparty/gpacmp4/avilib.c \
|
||||
../src/thirdparty/gpacmp4/av_parsers.c \
|
||||
../src/thirdparty/gpacmp4/base_encoding.c \
|
||||
../src/thirdparty/gpacmp4/bitstream.c \
|
||||
../src/thirdparty/gpacmp4/box_code_3gpp.c \
|
||||
../src/thirdparty/gpacmp4/box_code_adobe.c \
|
||||
../src/thirdparty/gpacmp4/box_code_apple.c \
|
||||
../src/thirdparty/gpacmp4/box_code_base.c \
|
||||
../src/thirdparty/gpacmp4/box_code_drm.c \
|
||||
../src/thirdparty/gpacmp4/box_dump.c \
|
||||
../src/thirdparty/gpacmp4/box_code_meta.c \
|
||||
../src/thirdparty/gpacmp4/box_funcs.c \
|
||||
../src/thirdparty/gpacmp4/color.c \
|
||||
../src/thirdparty/gpacmp4/configfile.c \
|
||||
../src/thirdparty/gpacmp4/data_map.c \
|
||||
../src/thirdparty/gpacmp4/desc_private.c \
|
||||
../src/thirdparty/gpacmp4/descriptors.c \
|
||||
../src/thirdparty/gpacmp4/drm_sample.c \
|
||||
../src/thirdparty/gpacmp4/error.c \
|
||||
../src/thirdparty/gpacmp4/gpac_ogg.c \
|
||||
../src/thirdparty/gpacmp4/hint_track.c \
|
||||
../src/thirdparty/gpacmp4/hinting.c \
|
||||
../src/thirdparty/gpacmp4/ipmpx_code.c \
|
||||
../src/thirdparty/gpacmp4/ipmpx_parse.c \
|
||||
../src/thirdparty/gpacmp4/isom_intern.c \
|
||||
../src/thirdparty/gpacmp4/isom_read.c \
|
||||
../src/thirdparty/gpacmp4/isom_store.c \
|
||||
../src/thirdparty/gpacmp4/isom_write.c \
|
||||
../src/thirdparty/gpacmp4/list.c \
|
||||
../src/thirdparty/gpacmp4/math.c \
|
||||
../src/thirdparty/gpacmp4/media.c \
|
||||
../src/thirdparty/gpacmp4/media_odf.c \
|
||||
../src/thirdparty/gpacmp4/meta.c \
|
||||
../src/thirdparty/gpacmp4/movie_fragments.c \
|
||||
../src/thirdparty/gpacmp4/odf_code.c \
|
||||
../src/thirdparty/gpacmp4/odf_codec.c \
|
||||
../src/thirdparty/gpacmp4/odf_command.c \
|
||||
../src/thirdparty/gpacmp4/os_config_init.c \
|
||||
../src/thirdparty/gpacmp4/os_divers.c \
|
||||
../src/thirdparty/gpacmp4/os_file.c \
|
||||
../src/thirdparty/gpacmp4/qos.c \
|
||||
../src/thirdparty/gpacmp4/sample_descs.c \
|
||||
../src/thirdparty/gpacmp4/slc.c \
|
||||
../src/thirdparty/gpacmp4/stbl_read.c \
|
||||
../src/thirdparty/gpacmp4/stbl_write.c \
|
||||
../src/thirdparty/gpacmp4/track.c \
|
||||
../src/thirdparty/gpacmp4/tx3g.c \
|
||||
../src/thirdparty/gpacmp4/url.c \
|
||||
../src/thirdparty/gpacmp4/utf.c \
|
||||
../src/thirdparty/gpacmp4/os_thread.c \
|
||||
../src/thirdparty/gpacmp4/module.c \
|
||||
../src/thirdparty/gpacmp4/os_module.c \
|
||||
../src/thirdparty/gpacmp4/xml_parser.c \
|
||||
../src/thirdparty/gpacmp4/constants.c \
|
||||
../src/thirdparty/gpacmp4/gpac/avparse.h \
|
||||
../src/thirdparty/gpacmp4/gpac/base_coding.h \
|
||||
../src/thirdparty/gpacmp4/gpac/bitstream.h \
|
||||
../src/thirdparty/gpacmp4/gpac/color.h \
|
||||
../src/thirdparty/gpacmp4/gpac/config_file.h \
|
||||
../src/thirdparty/gpacmp4/gpac/configuration.h \
|
||||
../src/thirdparty/gpacmp4/gpac/constants.h \
|
||||
../src/thirdparty/gpacmp4/gpac/events_constants.h \
|
||||
../src/thirdparty/gpacmp4/gpac/ietf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/isomedia.h \
|
||||
../src/thirdparty/gpacmp4/gpac/list.h \
|
||||
../src/thirdparty/gpacmp4/gpac/maths.h \
|
||||
../src/thirdparty/gpacmp4/gpac/media_tools.h \
|
||||
../src/thirdparty/gpacmp4/gpac/mpeg4_odf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/network.h \
|
||||
../src/thirdparty/gpacmp4/gpac/revision.h \
|
||||
../src/thirdparty/gpacmp4/gpac/setup.h \
|
||||
../src/thirdparty/gpacmp4/gpac/tools.h \
|
||||
../src/thirdparty/gpacmp4/gpac/utf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/version.h \
|
||||
../src/thirdparty/gpacmp4/gpac/iso639.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/avilib.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/isomedia_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/media_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/odf_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/odf_parse_common.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/ogg.h \
|
||||
../src/thirdparty/libpng/pngstruct.h \
|
||||
../src/thirdparty/libpng/pngpriv.h \
|
||||
../src/thirdparty/libpng/pnginfo.h \
|
||||
../src/thirdparty/libpng/pnglibconf.h \
|
||||
../src/thirdparty/libpng/pngconf.h \
|
||||
../src/thirdparty/libpng/pngdebug.h \
|
||||
../src/thirdparty/libpng/png.h \
|
||||
../src/thirdparty/libpng/png.c \
|
||||
../src/thirdparty/libpng/pngerror.c \
|
||||
../src/thirdparty/libpng/pngget.c \
|
||||
../src/thirdparty/libpng/pngmem.c \
|
||||
../src/thirdparty/libpng/pngpread.c \
|
||||
../src/thirdparty/libpng/pngread.c \
|
||||
../src/thirdparty/libpng/pngrio.c \
|
||||
../src/thirdparty/libpng/pngrtran.c \
|
||||
../src/thirdparty/libpng/pngrutil.c \
|
||||
../src/thirdparty/libpng/pngset.c \
|
||||
../src/thirdparty/libpng/pngtrans.c \
|
||||
../src/thirdparty/libpng/pngwio.c \
|
||||
../src/thirdparty/libpng/pngwrite.c \
|
||||
../src/thirdparty/libpng/pngwtran.c \
|
||||
../src/thirdparty/libpng/pngwutil.c \
|
||||
../src/lib_ccx/ccx_common_common.h \
|
||||
../src/lib_ccx/ccx_common_option.h \
|
||||
../src/lib_ccx/utility.h \
|
||||
@@ -151,8 +160,10 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/ccx_encoders_g608.c \
|
||||
../src/lib_ccx/ccx_encoders_helpers.c \
|
||||
../src/lib_ccx/ccx_encoders_helpers.h \
|
||||
../src/lib_ccx/ccx_encoders_python.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.h \
|
||||
../src/lib_ccx/ccx_encoders_sami.c \
|
||||
../src/lib_ccx/ccx_encoders_scc.c \
|
||||
../src/lib_ccx/ccx_encoders_smptett.c \
|
||||
../src/lib_ccx/ccx_encoders_splitbysentence.c \
|
||||
../src/lib_ccx/ccx_encoders_spupng.c \
|
||||
@@ -198,6 +209,7 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/list.h \
|
||||
../src/lib_ccx/matroska.c \
|
||||
../src/lib_ccx/matroska.h \
|
||||
../src/lib_ccx/mp4.c \
|
||||
../src/lib_ccx/myth.c \
|
||||
../src/lib_ccx/networking.c \
|
||||
../src/lib_ccx/networking.h \
|
||||
@@ -218,102 +230,100 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/ts_tables_epg.c \
|
||||
../src/lib_ccx/wtv_constants.h \
|
||||
../src/lib_ccx/wtv_functions.c \
|
||||
../src/zlib/adler32.c \
|
||||
../src/zlib/compress.c \
|
||||
../src/zlib/crc32.c \
|
||||
../src/zlib/crc32.h \
|
||||
../src/zlib/deflate.c \
|
||||
../src/zlib/deflate.h \
|
||||
../src/zlib/gzclose.c \
|
||||
../src/zlib/gzguts.h \
|
||||
../src/zlib/gzlib.c \
|
||||
../src/zlib/gzread.c \
|
||||
../src/zlib/gzwrite.c \
|
||||
../src/zlib/infback.c \
|
||||
../src/zlib/inffast.c \
|
||||
../src/zlib/inffast.h \
|
||||
../src/zlib/inffixed.h \
|
||||
../src/zlib/inflate.c \
|
||||
../src/zlib/inflate.h \
|
||||
../src/zlib/inftrees.c \
|
||||
../src/zlib/inftrees.h \
|
||||
../src/zlib/trees.c \
|
||||
../src/zlib/trees.h \
|
||||
../src/zlib/uncompr.c \
|
||||
../src/zlib/zconf.h \
|
||||
../src/zlib/zlib.h \
|
||||
../src/zlib/zutil.c \
|
||||
../src/zlib/zutil.h \
|
||||
../src/utf8proc/utf8proc.c \
|
||||
../src/utf8proc/utf8proc.h \
|
||||
../src/lib_hash/sha2.c \
|
||||
../src/lib_hash/sha2.h \
|
||||
../src/protobuf-c/protobuf-c.c \
|
||||
../src/protobuf-c/protobuf-c.h \
|
||||
../src/zvbi/bcd.h \
|
||||
../src/zvbi/bit_slicer.c \
|
||||
../src/zvbi/bit_slicer.h \
|
||||
../src/zvbi/decoder.c \
|
||||
../src/zvbi/macros.h \
|
||||
../src/zvbi/misc.h \
|
||||
../src/zvbi/raw_decoder.c \
|
||||
../src/zvbi/raw_decoder.h \
|
||||
../src/zvbi/sampling_par.c \
|
||||
../src/zvbi/sampling_par.h \
|
||||
../src/zvbi/sliced.h \
|
||||
../src/zvbi/zvbi_decoder.h \
|
||||
../src/extractors/extractor.c \
|
||||
../src/extractors/extractor.h \
|
||||
../src/wrappers/wrapper.c \
|
||||
../src/wrappers/wrapper.h \
|
||||
../src/freetype/autofit/autofit.c \
|
||||
../src/freetype/base/ftbase.c \
|
||||
../src/freetype/base/ftbbox.c \
|
||||
../src/freetype/base/ftbdf.c \
|
||||
../src/freetype/base/ftbitmap.c \
|
||||
../src/freetype/base/ftcid.c \
|
||||
../src/freetype/base/ftfntfmt.c \
|
||||
../src/freetype/base/ftfstype.c \
|
||||
../src/freetype/base/ftgasp.c \
|
||||
../src/freetype/base/ftglyph.c \
|
||||
../src/freetype/base/ftgxval.c \
|
||||
../src/freetype/base/ftinit.c \
|
||||
../src/freetype/base/ftlcdfil.c \
|
||||
../src/freetype/base/ftmm.c \
|
||||
../src/freetype/base/ftotval.c \
|
||||
../src/freetype/base/ftpatent.c \
|
||||
../src/freetype/base/ftpfr.c \
|
||||
../src/freetype/base/ftstroke.c \
|
||||
../src/freetype/base/ftsynth.c \
|
||||
../src/freetype/base/ftsystem.c \
|
||||
../src/freetype/base/fttype1.c \
|
||||
../src/freetype/base/ftwinfnt.c \
|
||||
../src/freetype/bdf/bdf.c \
|
||||
../src/freetype/bzip2/ftbzip2.c \
|
||||
../src/freetype/cache/ftcache.c \
|
||||
../src/freetype/cff/cff.c \
|
||||
../src/freetype/cid/type1cid.c \
|
||||
../src/freetype/gzip/ftgzip.c \
|
||||
../src/freetype/lzw/ftlzw.c \
|
||||
../src/freetype/pcf/pcf.c \
|
||||
../src/freetype/pfr/pfr.c \
|
||||
../src/freetype/psaux/psaux.c \
|
||||
../src/freetype/pshinter/pshinter.c \
|
||||
../src/freetype/psnames/psnames.c \
|
||||
../src/freetype/raster/raster.c \
|
||||
../src/freetype/sfnt/sfnt.c \
|
||||
../src/freetype/smooth/smooth.c \
|
||||
../src/freetype/truetype/truetype.c \
|
||||
../src/freetype/type1/type1.c \
|
||||
../src/freetype/type42/type42.c \
|
||||
../src/freetype/winfonts/winfnt.c
|
||||
../src/thirdparty/zlib/adler32.c \
|
||||
../src/thirdparty/zlib/compress.c \
|
||||
../src/thirdparty/zlib/crc32.c \
|
||||
../src/thirdparty/zlib/crc32.h \
|
||||
../src/thirdparty/zlib/deflate.c \
|
||||
../src/thirdparty/zlib/deflate.h \
|
||||
../src/thirdparty/zlib/gzclose.c \
|
||||
../src/thirdparty/zlib/gzguts.h \
|
||||
../src/thirdparty/zlib/gzlib.c \
|
||||
../src/thirdparty/zlib/gzread.c \
|
||||
../src/thirdparty/zlib/gzwrite.c \
|
||||
../src/thirdparty/zlib/infback.c \
|
||||
../src/thirdparty/zlib/inffast.c \
|
||||
../src/thirdparty/zlib/inffast.h \
|
||||
../src/thirdparty/zlib/inffixed.h \
|
||||
../src/thirdparty/zlib/inflate.c \
|
||||
../src/thirdparty/zlib/inflate.h \
|
||||
../src/thirdparty/zlib/inftrees.c \
|
||||
../src/thirdparty/zlib/inftrees.h \
|
||||
../src/thirdparty/zlib/trees.c \
|
||||
../src/thirdparty/zlib/trees.h \
|
||||
../src/thirdparty/zlib/uncompr.c \
|
||||
../src/thirdparty/zlib/zconf.h \
|
||||
../src/thirdparty/zlib/zlib.h \
|
||||
../src/thirdparty/zlib/zutil.c \
|
||||
../src/thirdparty/zlib/zutil.h \
|
||||
../src/thirdparty/utf8proc/utf8proc.c \
|
||||
../src/thirdparty/utf8proc/utf8proc.h \
|
||||
../src/thirdparty/lib_hash/sha2.c \
|
||||
../src/thirdparty/lib_hash/sha2.h \
|
||||
../src/thirdparty/protobuf-c/protobuf-c.c \
|
||||
../src/thirdparty/protobuf-c/protobuf-c.h \
|
||||
../src/thirdparty/zvbi/bcd.h \
|
||||
../src/lib_ccx/zvbi/bit_slicer.c \
|
||||
../src/lib_ccx/zvbi/bit_slicer.h \
|
||||
../src/lib_ccx/zvbi/decoder.c \
|
||||
../src/lib_ccx/zvbi/macros.h \
|
||||
../src/lib_ccx/zvbi/misc.h \
|
||||
../src/lib_ccx/zvbi/raw_decoder.c \
|
||||
../src/lib_ccx/zvbi/raw_decoder.h \
|
||||
../src/lib_ccx/zvbi/sampling_par.c \
|
||||
../src/lib_ccx/zvbi/sampling_par.h \
|
||||
../src/lib_ccx/zvbi/sliced.h \
|
||||
../src/lib_ccx/zvbi/zvbi_decoder.h \
|
||||
../src/freetype/* \
|
||||
../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/include/ft2build.h \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c
|
||||
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_H
|
||||
|
||||
ccextractor_CPPFLAGS =-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/ -I../src/ -I../src/freetype/include/
|
||||
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/thirdparty/gpacmp4/ -I../src/thirdparty/libpng/ -I../src/thirdparty/zlib/ -I../src/thirdparty/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty/protobuf-c/ -I../src/thirdparty -I../src/ -I../src/thirdparty/freetype/include/
|
||||
|
||||
|
||||
ccextractor_LDADD=-lm
|
||||
ccextractor_LDADD=-lm -lpthread -ldl
|
||||
|
||||
if SYS_IS_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
|
||||
@@ -324,6 +334,10 @@ ccextractor_CFLAGS += -DPAC_CONFIG_DARWIN -Dfopen64=fopen -Dopen64=open -Dlseek6
|
||||
ccextractor_LDADD += -liconv -lz
|
||||
endif
|
||||
|
||||
if SYS_IS_64_BIT
|
||||
ccextractor_CFLAGS += -DGPAC_64_BITS
|
||||
endif
|
||||
|
||||
if HARDSUBX_IS_ENABLED
|
||||
ccextractor_CFLAGS += -DENABLE_HARDSUBX
|
||||
ccextractor_CPPFLAGS+= ${libavcodec_CFLAGS}
|
||||
@@ -361,7 +375,7 @@ ccextractor_LDADD += $(TESS_LIB)
|
||||
ccextractor_LDADD += $(LEPT_LIB)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = ../src/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
EXTRA_DIST = ../src/thirdparty/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/thirdparty/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
|
||||
#For GUI
|
||||
if BUILD_WITH_GUI
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
./pre-build.sh
|
||||
autoreconf -i
|
||||
|
||||
123
linux/build
@@ -1,61 +1,65 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
|
||||
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 -I../src/freetype/include"
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
#!/usr/bin/env bash
|
||||
BLD_FLAGS="$BLD_FLAGS -std=gnu99 -Wno-write-strings -Wno-pointer-sign -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_H"
|
||||
bit_os=$(getconf LONG_BIT)
|
||||
if [ "$bit_os"=="64" ]
|
||||
then
|
||||
BLD_FLAGS="$BLD_FLAGS -DGPAC_64_BITS"
|
||||
fi
|
||||
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/thirdparty/gpacmp4/ -I../src/thirdparty/libpng -I../src/thirdparty/zlib -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash -I../src/thirdparty/protobuf-c -I../src/thirdparty -I../src/thirdparty/freetype/include"
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib/ -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"
|
||||
SRC_FREETYPE="../src/freetype/autofit/autofit.c
|
||||
../src/freetype/base/ftbase.c
|
||||
../src/freetype/base/ftbbox.c
|
||||
../src/freetype/base/ftbdf.c
|
||||
../src/freetype/base/ftbitmap.c
|
||||
../src/freetype/base/ftcid.c
|
||||
../src/freetype/base/ftfntfmt.c
|
||||
../src/freetype/base/ftfstype.c
|
||||
../src/freetype/base/ftgasp.c
|
||||
../src/freetype/base/ftglyph.c
|
||||
../src/freetype/base/ftgxval.c
|
||||
../src/freetype/base/ftinit.c
|
||||
../src/freetype/base/ftlcdfil.c
|
||||
../src/freetype/base/ftmm.c
|
||||
../src/freetype/base/ftotval.c
|
||||
../src/freetype/base/ftpatent.c
|
||||
../src/freetype/base/ftpfr.c
|
||||
../src/freetype/base/ftstroke.c
|
||||
../src/freetype/base/ftsynth.c
|
||||
../src/freetype/base/ftsystem.c
|
||||
../src/freetype/base/fttype1.c
|
||||
../src/freetype/base/ftwinfnt.c
|
||||
../src/freetype/bdf/bdf.c
|
||||
../src/freetype/bzip2/ftbzip2.c
|
||||
../src/freetype/cache/ftcache.c
|
||||
../src/freetype/cff/cff.c
|
||||
../src/freetype/cid/type1cid.c
|
||||
../src/freetype/gzip/ftgzip.c
|
||||
../src/freetype/lzw/ftlzw.c
|
||||
../src/freetype/pcf/pcf.c
|
||||
../src/freetype/pfr/pfr.c
|
||||
../src/freetype/psaux/psaux.c
|
||||
../src/freetype/pshinter/pshinter.c
|
||||
../src/freetype/psnames/psnames.c
|
||||
../src/freetype/raster/raster.c
|
||||
../src/freetype/sfnt/sfnt.c
|
||||
../src/freetype/smooth/smooth.c
|
||||
../src/freetype/truetype/truetype.c
|
||||
../src/freetype/type1/type1.c
|
||||
../src/freetype/type42/type42.c
|
||||
../src/freetype/winfonts/winfnt.c"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
SRC_GPAC="$(find ../src/thirdparty/gpacmp4/ -name '*.c')"
|
||||
SRC_HASH="$(find ../src/thirdparty/lib_hash/ -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/thirdparty/protobuf-c/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/thirdparty/utf8proc/utf8proc.c"
|
||||
SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c
|
||||
../src/thirdparty/freetype/base/ftbase.c
|
||||
../src/thirdparty/freetype/base/ftbbox.c
|
||||
../src/thirdparty/freetype/base/ftbdf.c
|
||||
../src/thirdparty/freetype/base/ftbitmap.c
|
||||
../src/thirdparty/freetype/base/ftcid.c
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c
|
||||
../src/thirdparty/freetype/base/ftfstype.c
|
||||
../src/thirdparty/freetype/base/ftgasp.c
|
||||
../src/thirdparty/freetype/base/ftglyph.c
|
||||
../src/thirdparty/freetype/base/ftgxval.c
|
||||
../src/thirdparty/freetype/base/ftinit.c
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c
|
||||
../src/thirdparty/freetype/base/ftmm.c
|
||||
../src/thirdparty/freetype/base/ftotval.c
|
||||
../src/thirdparty/freetype/base/ftpatent.c
|
||||
../src/thirdparty/freetype/base/ftpfr.c
|
||||
../src/thirdparty/freetype/base/ftstroke.c
|
||||
../src/thirdparty/freetype/base/ftsynth.c
|
||||
../src/thirdparty/freetype/base/ftsystem.c
|
||||
../src/thirdparty/freetype/base/fttype1.c
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c
|
||||
../src/thirdparty/freetype/bdf/bdf.c
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c
|
||||
../src/thirdparty/freetype/cache/ftcache.c
|
||||
../src/thirdparty/freetype/cff/cff.c
|
||||
../src/thirdparty/freetype/cid/type1cid.c
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c
|
||||
../src/thirdparty/freetype/pcf/pcf.c
|
||||
../src/thirdparty/freetype/pfr/pfr.c
|
||||
../src/thirdparty/freetype/psaux/psaux.c
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c
|
||||
../src/thirdparty/freetype/psnames/psnames.c
|
||||
../src/thirdparty/freetype/raster/raster.c
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c
|
||||
../src/thirdparty/freetype/smooth/smooth.c
|
||||
../src/thirdparty/freetype/truetype/truetype.c
|
||||
../src/thirdparty/freetype/type1/type1.c
|
||||
../src/thirdparty/freetype/type42/type42.c
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $SRC_FREETYPE"
|
||||
BLD_LINKER="$BLD_LINKER -lm -zmuldefs -l tesseract -l lept -lpthread -ldl"
|
||||
|
||||
echo "Running pre-build script..."
|
||||
./pre-build.sh
|
||||
echo "Trying to compile..."
|
||||
|
||||
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER)2>&1)
|
||||
res=$?
|
||||
@@ -71,7 +75,7 @@ then
|
||||
fi
|
||||
if [[ $out == *"capi.h: No such file or directory"* ]]
|
||||
then
|
||||
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
|
||||
echo "Error: please install tesseract development library (libtesseract-dev for Debian/Ubuntu)";
|
||||
exit 3
|
||||
fi
|
||||
if [[ $out == *"allheaders.h: No such file or directory"* ]]
|
||||
@@ -85,4 +89,9 @@ then
|
||||
>&2 echo "$out"
|
||||
exit 5
|
||||
fi
|
||||
echo "Compilation successful";
|
||||
if [[ "$out" != "" ]] ; then
|
||||
echo "$out"
|
||||
echo "Compilation successful, compiler message shown in previous lines"
|
||||
else
|
||||
echo "Compilation successful, no compiler messages."
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh -ex
|
||||
#!/usr/bin/env sh -ex
|
||||
|
||||
####################################################################
|
||||
# setup by tracey apr 2012
|
||||
@@ -88,13 +88,13 @@ cd ccextractor/linux/;
|
||||
# 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;
|
||||
perl -i -pe 's/(strchr|strstr)\(/$1((char *)/' ../src/thirdparty/gpacmp4/url.c ../src/thirdparty/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 \
|
||||
gcc -Wno-write-strings -Wno-pointer-sign -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 \
|
||||
|
||||
@@ -1,60 +1,4 @@
|
||||
#!/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 -DFT2_BUILD_LIBRARY"
|
||||
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 -I../src/freetype/include"
|
||||
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_FREETYPE="../src/freetype/autofit/autofit.c
|
||||
../src/freetype/base/ftbase.c
|
||||
../src/freetype/base/ftbbox.c
|
||||
../src/freetype/base/ftbdf.c
|
||||
../src/freetype/base/ftbitmap.c
|
||||
../src/freetype/base/ftcid.c
|
||||
../src/freetype/base/ftfntfmt.c
|
||||
../src/freetype/base/ftfstype.c
|
||||
../src/freetype/base/ftgasp.c
|
||||
../src/freetype/base/ftglyph.c
|
||||
../src/freetype/base/ftgxval.c
|
||||
../src/freetype/base/ftinit.c
|
||||
../src/freetype/base/ftlcdfil.c
|
||||
../src/freetype/base/ftmm.c
|
||||
../src/freetype/base/ftotval.c
|
||||
../src/freetype/base/ftpatent.c
|
||||
../src/freetype/base/ftpfr.c
|
||||
../src/freetype/base/ftstroke.c
|
||||
../src/freetype/base/ftsynth.c
|
||||
../src/freetype/base/ftsystem.c
|
||||
../src/freetype/base/fttype1.c
|
||||
../src/freetype/base/ftwinfnt.c
|
||||
../src/freetype/bdf/bdf.c
|
||||
../src/freetype/bzip2/ftbzip2.c
|
||||
../src/freetype/cache/ftcache.c
|
||||
../src/freetype/cff/cff.c
|
||||
../src/freetype/cid/type1cid.c
|
||||
../src/freetype/gzip/ftgzip.c
|
||||
../src/freetype/lzw/ftlzw.c
|
||||
../src/freetype/pcf/pcf.c
|
||||
../src/freetype/pfr/pfr.c
|
||||
../src/freetype/psaux/psaux.c
|
||||
../src/freetype/pshinter/pshinter.c
|
||||
../src/freetype/psnames/psnames.c
|
||||
../src/freetype/raster/raster.c
|
||||
../src/freetype/sfnt/sfnt.c
|
||||
../src/freetype/smooth/smooth.c
|
||||
../src/freetype/truetype/truetype.c
|
||||
../src/freetype/type1/type1.c
|
||||
../src/freetype/type42/type42.c
|
||||
../src/freetype/winfonts/winfnt.c"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.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 $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
|
||||
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
|
||||
#!/usr/bin/env bash
|
||||
export BLD_FLAGS="-DENABLE_HARDSUBX"
|
||||
export BLD_LINKER="-lswscale -lavutil -pthread -lavformat -lavcodec -lxcb-shm -lxcb -lX11 -llzma -lswresample"
|
||||
./build
|
||||
|
||||
@@ -1,59 +1,3 @@
|
||||
#!/bin/bash
|
||||
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
|
||||
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 -I../src/freetype/include"
|
||||
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"
|
||||
SRC_FREETYPE="../src/freetype/autofit/autofit.c
|
||||
../src/freetype/base/ftbase.c
|
||||
../src/freetype/base/ftbbox.c
|
||||
../src/freetype/base/ftbdf.c
|
||||
../src/freetype/base/ftbitmap.c
|
||||
../src/freetype/base/ftcid.c
|
||||
../src/freetype/base/ftfntfmt.c
|
||||
../src/freetype/base/ftfstype.c
|
||||
../src/freetype/base/ftgasp.c
|
||||
../src/freetype/base/ftglyph.c
|
||||
../src/freetype/base/ftgxval.c
|
||||
../src/freetype/base/ftinit.c
|
||||
../src/freetype/base/ftlcdfil.c
|
||||
../src/freetype/base/ftmm.c
|
||||
../src/freetype/base/ftotval.c
|
||||
../src/freetype/base/ftpatent.c
|
||||
../src/freetype/base/ftpfr.c
|
||||
../src/freetype/base/ftstroke.c
|
||||
../src/freetype/base/ftsynth.c
|
||||
../src/freetype/base/ftsystem.c
|
||||
../src/freetype/base/fttype1.c
|
||||
../src/freetype/base/ftwinfnt.c
|
||||
../src/freetype/bdf/bdf.c
|
||||
../src/freetype/bzip2/ftbzip2.c
|
||||
../src/freetype/cache/ftcache.c
|
||||
../src/freetype/cff/cff.c
|
||||
../src/freetype/cid/type1cid.c
|
||||
../src/freetype/gzip/ftgzip.c
|
||||
../src/freetype/lzw/ftlzw.c
|
||||
../src/freetype/pcf/pcf.c
|
||||
../src/freetype/pfr/pfr.c
|
||||
../src/freetype/psaux/psaux.c
|
||||
../src/freetype/pshinter/pshinter.c
|
||||
../src/freetype/psnames/psnames.c
|
||||
../src/freetype/raster/raster.c
|
||||
../src/freetype/sfnt/sfnt.c
|
||||
../src/freetype/smooth/smooth.c
|
||||
../src/freetype/truetype/truetype.c
|
||||
../src/freetype/type1/type1.c
|
||||
../src/freetype/type42/type42.c
|
||||
../src/freetype/winfonts/winfnt.c"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
|
||||
|
||||
./pre-build.sh
|
||||
gcc -g $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER
|
||||
#!/usr/bin/env bash
|
||||
export BLD_FLAGS="-g"
|
||||
./build
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make distclean > /dev/null 2>&1 || true
|
||||
rm -rf Makefile configure *.in config.status config.log aclocal.m4 build-conf autom4te.cache
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([CCExtractor], [0.86], [carlos@ccextractor.org])
|
||||
AC_INIT([CCExtractor], [0.89], [carlos@ccextractor.org])
|
||||
AC_CONFIG_AUX_DIR([build-conf])
|
||||
AC_CONFIG_SRCDIR([../src/ccextractor.c])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
@@ -115,6 +115,7 @@ AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test
|
||||
AM_CONDITIONAL(SYS_IS_LINUX, [ test `uname -s` = "Linux"])
|
||||
AM_CONDITIONAL(SYS_IS_MAC, [ test `uname -s` = "Darwin"])
|
||||
AM_CONDITIONAL(BUILD_WITH_GUI, [test "x$with_gui" = "xyes"])
|
||||
AM_CONDITIONAL(SYS_IS_64_BIT,[test `getconf LONG_BIT` = "64"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#!/bin/bash
|
||||
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
|
||||
#!/usr/bin/env bash
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng/ -name '*.c')"
|
||||
SRC_ZLIB="$(find ../sr/thirdpartyc/zlib/ -name '*.c')"
|
||||
SRC_ZVBI="$(find ../sr/thirdpartyc/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_GPAC="$(find ../sr/thirdpartyc/gpacmp4/ -name '*.c')"
|
||||
SRC_HASH="$(find ../sr/thirdpartyc/lib_hash/ -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/thirdparty/protobuf-c/ -name '*.c')"
|
||||
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
|
||||
BLD_SOURCES="../src/ccextractor.c ../src/ccextractorapi_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
|
||||
BLD_SOURCES="../src/ccextractor.c ../src/ccextractorapi_wrap.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
|
||||
|
||||
python setup.py $BLD_SOURCES
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
echo "Obtaining Git commit"
|
||||
commit=(`git rev-parse HEAD 2>/dev/null`)
|
||||
if [ -z "$commit" ]; then
|
||||
@@ -21,7 +21,7 @@ fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date +%Y-%m-%d`
|
||||
builddate=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
|
||||
385
mac/Makefile.am
@@ -5,101 +5,109 @@ bin_PROGRAMS = ccextractor
|
||||
ccextractor_SOURCES = \
|
||||
../src/ccextractor.c \
|
||||
../src/ccextractor.h \
|
||||
../src/gpacmp4/avc_ext.c \
|
||||
../src/gpacmp4/avilib.c \
|
||||
../src/gpacmp4/av_parsers.c \
|
||||
../src/gpacmp4/base_encoding.c \
|
||||
../src/gpacmp4/bitstream.c \
|
||||
../src/gpacmp4/box_code_3gpp.c \
|
||||
../src/gpacmp4/box_code_adobe.c \
|
||||
../src/gpacmp4/box_code_apple.c \
|
||||
../src/gpacmp4/box_code_base.c \
|
||||
../src/gpacmp4/box_code_drm.c \
|
||||
../src/gpacmp4/box_code_meta.c \
|
||||
../src/gpacmp4/box_funcs.c \
|
||||
../src/gpacmp4/configfile.c \
|
||||
../src/gpacmp4/data_map.c \
|
||||
../src/gpacmp4/desc_private.c \
|
||||
../src/gpacmp4/descriptors.c \
|
||||
../src/gpacmp4/drm_sample.c \
|
||||
../src/gpacmp4/error.c \
|
||||
../src/gpacmp4/gpac_ogg.c \
|
||||
../src/gpacmp4/hinting.c \
|
||||
../src/gpacmp4/ipmpx_code.c \
|
||||
../src/gpacmp4/ipmpx_parse.c \
|
||||
../src/gpacmp4/isom_intern.c \
|
||||
../src/gpacmp4/isom_read.c \
|
||||
../src/gpacmp4/isom_store.c \
|
||||
../src/gpacmp4/isom_write.c \
|
||||
../src/gpacmp4/list.c \
|
||||
../src/gpacmp4/math.c \
|
||||
../src/gpacmp4/media.c \
|
||||
../src/gpacmp4/media_odf.c \
|
||||
../src/gpacmp4/meta.c \
|
||||
../src/gpacmp4/movie_fragments.c \
|
||||
../src/gpacmp4/mp4.c \
|
||||
../src/gpacmp4/odf_code.c \
|
||||
../src/gpacmp4/odf_codec.c \
|
||||
../src/gpacmp4/odf_command.c \
|
||||
../src/gpacmp4/os_config_init.c \
|
||||
../src/gpacmp4/os_divers.c \
|
||||
../src/gpacmp4/os_file.c \
|
||||
../src/gpacmp4/qos.c \
|
||||
../src/gpacmp4/sample_descs.c \
|
||||
../src/gpacmp4/slc.c \
|
||||
../src/gpacmp4/stbl_read.c \
|
||||
../src/gpacmp4/stbl_write.c \
|
||||
../src/gpacmp4/track.c \
|
||||
../src/gpacmp4/tx3g.c \
|
||||
../src/gpacmp4/url.c \
|
||||
../src/gpacmp4/utf.c \
|
||||
../src/gpacmp4/gpac/avparse.h \
|
||||
../src/gpacmp4/gpac/base_coding.h \
|
||||
../src/gpacmp4/gpac/bitstream.h \
|
||||
../src/gpacmp4/gpac/config_file.h \
|
||||
../src/gpacmp4/gpac/configuration.h \
|
||||
../src/gpacmp4/gpac/constants.h \
|
||||
../src/gpacmp4/gpac/events_constants.h \
|
||||
../src/gpacmp4/gpac/ietf.h \
|
||||
../src/gpacmp4/gpac/isomedia.h \
|
||||
../src/gpacmp4/gpac/list.h \
|
||||
../src/gpacmp4/gpac/math.h \
|
||||
../src/gpacmp4/gpac/media_tools.h \
|
||||
../src/gpacmp4/gpac/mpeg4_odf.h \
|
||||
../src/gpacmp4/gpac/network.h \
|
||||
../src/gpacmp4/gpac/revision.h \
|
||||
../src/gpacmp4/gpac/setup.h \
|
||||
../src/gpacmp4/gpac/tools.h \
|
||||
../src/gpacmp4/gpac/utf.h \
|
||||
../src/gpacmp4/gpac/version.h \
|
||||
../src/gpacmp4/gpac/internal/avilib.h \
|
||||
../src/gpacmp4/gpac/internal/isomedia_dev.h \
|
||||
../src/gpacmp4/gpac/internal/media_dev.h \
|
||||
../src/gpacmp4/gpac/internal/odf_dev.h \
|
||||
../src/gpacmp4/gpac/internal/odf_parse_common.h \
|
||||
../src/gpacmp4/gpac/internal/ogg.h \
|
||||
../src/libpng/pngstruct.h \
|
||||
../src/libpng/pngpriv.h \
|
||||
../src/libpng/pnginfo.h \
|
||||
../src/libpng/pnglibconf.h \
|
||||
../src/libpng/pngconf.h \
|
||||
../src/libpng/pngdebug.h \
|
||||
../src/libpng/png.h \
|
||||
../src/libpng/png.c \
|
||||
../src/libpng/pngerror.c \
|
||||
../src/libpng/pngget.c \
|
||||
../src/libpng/pngmem.c \
|
||||
../src/libpng/pngpread.c \
|
||||
../src/libpng/pngread.c \
|
||||
../src/libpng/pngrio.c \
|
||||
../src/libpng/pngrtran.c \
|
||||
../src/libpng/pngrutil.c \
|
||||
../src/libpng/pngset.c \
|
||||
../src/libpng/pngtrans.c \
|
||||
../src/libpng/pngwio.c \
|
||||
../src/libpng/pngwrite.c \
|
||||
../src/libpng/pngwtran.c \
|
||||
../src/libpng/pngwutil.c \
|
||||
../src/thirdparty/gpacmp4/avc_ext.c \
|
||||
../src/thirdparty/gpacmp4/avilib.c \
|
||||
../src/thirdparty/gpacmp4/av_parsers.c \
|
||||
../src/thirdparty/gpacmp4/base_encoding.c \
|
||||
../src/thirdparty/gpacmp4/bitstream.c \
|
||||
../src/thirdparty/gpacmp4/box_code_3gpp.c \
|
||||
../src/thirdparty/gpacmp4/box_code_adobe.c \
|
||||
../src/thirdparty/gpacmp4/box_code_apple.c \
|
||||
../src/thirdparty/gpacmp4/box_code_base.c \
|
||||
../src/thirdparty/gpacmp4/box_code_drm.c \
|
||||
../src/thirdparty/gpacmp4/box_dump.c \
|
||||
../src/thirdparty/gpacmp4/box_code_meta.c \
|
||||
../src/thirdparty/gpacmp4/box_funcs.c \
|
||||
../src/thirdparty/gpacmp4/color.c \
|
||||
../src/thirdparty/gpacmp4/configfile.c \
|
||||
../src/thirdparty/gpacmp4/data_map.c \
|
||||
../src/thirdparty/gpacmp4/desc_private.c \
|
||||
../src/thirdparty/gpacmp4/descriptors.c \
|
||||
../src/thirdparty/gpacmp4/drm_sample.c \
|
||||
../src/thirdparty/gpacmp4/error.c \
|
||||
../src/thirdparty/gpacmp4/gpac_ogg.c \
|
||||
../src/thirdparty/gpacmp4/hint_track.c \
|
||||
../src/thirdparty/gpacmp4/hinting.c \
|
||||
../src/thirdparty/gpacmp4/ipmpx_code.c \
|
||||
../src/thirdparty/gpacmp4/ipmpx_parse.c \
|
||||
../src/thirdparty/gpacmp4/isom_intern.c \
|
||||
../src/thirdparty/gpacmp4/isom_read.c \
|
||||
../src/thirdparty/gpacmp4/isom_store.c \
|
||||
../src/thirdparty/gpacmp4/isom_write.c \
|
||||
../src/thirdparty/gpacmp4/list.c \
|
||||
../src/thirdparty/gpacmp4/math.c \
|
||||
../src/thirdparty/gpacmp4/media.c \
|
||||
../src/thirdparty/gpacmp4/media_odf.c \
|
||||
../src/thirdparty/gpacmp4/meta.c \
|
||||
../src/thirdparty/gpacmp4/movie_fragments.c \
|
||||
../src/thirdparty/gpacmp4/odf_code.c \
|
||||
../src/thirdparty/gpacmp4/odf_codec.c \
|
||||
../src/thirdparty/gpacmp4/odf_command.c \
|
||||
../src/thirdparty/gpacmp4/os_config_init.c \
|
||||
../src/thirdparty/gpacmp4/os_divers.c \
|
||||
../src/thirdparty/gpacmp4/os_file.c \
|
||||
../src/thirdparty/gpacmp4/qos.c \
|
||||
../src/thirdparty/gpacmp4/sample_descs.c \
|
||||
../src/thirdparty/gpacmp4/slc.c \
|
||||
../src/thirdparty/gpacmp4/stbl_read.c \
|
||||
../src/thirdparty/gpacmp4/stbl_write.c \
|
||||
../src/thirdparty/gpacmp4/track.c \
|
||||
../src/thirdparty/gpacmp4/tx3g.c \
|
||||
../src/thirdparty/gpacmp4/url.c \
|
||||
../src/thirdparty/gpacmp4/utf.c \
|
||||
../src/thirdparty/gpacmp4/os_thread.c \
|
||||
../src/thirdparty/gpacmp4/module.c \
|
||||
../src/thirdparty/gpacmp4/os_module.c \
|
||||
../src/thirdparty/gpacmp4/xml_parser.c \
|
||||
../src/thirdparty/gpacmp4/constants.c \
|
||||
../src/thirdparty/gpacmp4/gpac/avparse.h \
|
||||
../src/thirdparty/gpacmp4/gpac/base_coding.h \
|
||||
../src/thirdparty/gpacmp4/gpac/bitstream.h \
|
||||
../src/thirdparty/gpacmp4/gpac/color.h \
|
||||
../src/thirdparty/gpacmp4/gpac/config_file.h \
|
||||
../src/thirdparty/gpacmp4/gpac/configuration.h \
|
||||
../src/thirdparty/gpacmp4/gpac/constants.h \
|
||||
../src/thirdparty/gpacmp4/gpac/events_constants.h \
|
||||
../src/thirdparty/gpacmp4/gpac/ietf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/isomedia.h \
|
||||
../src/thirdparty/gpacmp4/gpac/list.h \
|
||||
../src/thirdparty/gpacmp4/gpac/maths.h \
|
||||
../src/thirdparty/gpacmp4/gpac/media_tools.h \
|
||||
../src/thirdparty/gpacmp4/gpac/mpeg4_odf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/network.h \
|
||||
../src/thirdparty/gpacmp4/gpac/revision.h \
|
||||
../src/thirdparty/gpacmp4/gpac/setup.h \
|
||||
../src/thirdparty/gpacmp4/gpac/tools.h \
|
||||
../src/thirdparty/gpacmp4/gpac/utf.h \
|
||||
../src/thirdparty/gpacmp4/gpac/version.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/avilib.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/isomedia_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/media_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/odf_dev.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/odf_parse_common.h \
|
||||
../src/thirdparty/gpacmp4/gpac/internal/ogg.h \
|
||||
../src/thirdparty/libpng/pngstruct.h \
|
||||
../src/thirdparty/libpng/pngpriv.h \
|
||||
../src/thirdparty/libpng/pnginfo.h \
|
||||
../src/thirdparty/libpng/pnglibconf.h \
|
||||
../src/thirdparty/libpng/pngconf.h \
|
||||
../src/thirdparty/libpng/pngdebug.h \
|
||||
../src/thirdparty/libpng/png.h \
|
||||
../src/thirdparty/libpng/png.c \
|
||||
../src/thirdparty/libpng/pngerror.c \
|
||||
../src/thirdparty/libpng/pngget.c \
|
||||
../src/thirdparty/libpng/pngmem.c \
|
||||
../src/thirdparty/libpng/pngpread.c \
|
||||
../src/thirdparty/libpng/pngread.c \
|
||||
../src/thirdparty/libpng/pngrio.c \
|
||||
../src/thirdparty/libpng/pngrtran.c \
|
||||
../src/thirdparty/libpng/pngrutil.c \
|
||||
../src/thirdparty/libpng/pngset.c \
|
||||
../src/thirdparty/libpng/pngtrans.c \
|
||||
../src/thirdparty/libpng/pngwio.c \
|
||||
../src/thirdparty/libpng/pngwrite.c \
|
||||
../src/thirdparty/libpng/pngwtran.c \
|
||||
../src/thirdparty/libpng/pngwutil.c \
|
||||
../src/lib_ccx/ccx_common_common.h \
|
||||
../src/lib_ccx/ccx_common_option.h \
|
||||
../src/lib_ccx/utility.h \
|
||||
@@ -151,8 +159,10 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/ccx_encoders_g608.c \
|
||||
../src/lib_ccx/ccx_encoders_helpers.c \
|
||||
../src/lib_ccx/ccx_encoders_helpers.h \
|
||||
../src/lib_ccx/ccx_encoders_python.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.c \
|
||||
../src/lib_ccx/ccx_encoders_mcc.h \
|
||||
../src/lib_ccx/ccx_encoders_sami.c \
|
||||
../src/lib_ccx/ccx_encoders_scc.c \
|
||||
../src/lib_ccx/ccx_encoders_smptett.c \
|
||||
../src/lib_ccx/ccx_encoders_splitbysentence.c \
|
||||
../src/lib_ccx/ccx_encoders_spupng.c \
|
||||
@@ -198,6 +208,7 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/list.h \
|
||||
../src/lib_ccx/matroska.c \
|
||||
../src/lib_ccx/matroska.h \
|
||||
../src/lib_ccx/mp4.c \
|
||||
../src/lib_ccx/myth.c \
|
||||
../src/lib_ccx/networking.c \
|
||||
../src/lib_ccx/networking.h \
|
||||
@@ -218,103 +229,99 @@ ccextractor_SOURCES = \
|
||||
../src/lib_ccx/ts_tables_epg.c \
|
||||
../src/lib_ccx/wtv_constants.h \
|
||||
../src/lib_ccx/wtv_functions.c \
|
||||
../src/zlib/adler32.c \
|
||||
../src/zlib/compress.c \
|
||||
../src/zlib/crc32.c \
|
||||
../src/zlib/crc32.h \
|
||||
../src/zlib/deflate.c \
|
||||
../src/zlib/deflate.h \
|
||||
../src/zlib/gzclose.c \
|
||||
../src/zlib/gzguts.h \
|
||||
../src/zlib/gzlib.c \
|
||||
../src/zlib/gzread.c \
|
||||
../src/zlib/gzwrite.c \
|
||||
../src/zlib/infback.c \
|
||||
../src/zlib/inffast.c \
|
||||
../src/zlib/inffast.h \
|
||||
../src/zlib/inffixed.h \
|
||||
../src/zlib/inflate.c \
|
||||
../src/zlib/inflate.h \
|
||||
../src/zlib/inftrees.c \
|
||||
../src/zlib/inftrees.h \
|
||||
../src/zlib/trees.c \
|
||||
../src/zlib/trees.h \
|
||||
../src/zlib/uncompr.c \
|
||||
../src/zlib/zconf.h \
|
||||
../src/zlib/zlib.h \
|
||||
../src/zlib/zutil.c \
|
||||
../src/zlib/zutil.h \
|
||||
../src/utf8proc/utf8proc.c \
|
||||
../src/utf8proc/utf8proc.h \
|
||||
../src/lib_hash/sha2.c \
|
||||
../src/lib_hash/sha2.h \
|
||||
../src/protobuf-c/protobuf-c.c \
|
||||
../src/protobuf-c/protobuf-c.h \
|
||||
../src/zvbi/bcd.h \
|
||||
../src/zvbi/bit_slicer.c \
|
||||
../src/zvbi/bit_slicer.h \
|
||||
../src/zvbi/decoder.c \
|
||||
../src/zvbi/macros.h \
|
||||
../src/zvbi/misc.h \
|
||||
../src/zvbi/raw_decoder.c \
|
||||
../src/zvbi/raw_decoder.h \
|
||||
../src/zvbi/sampling_par.c \
|
||||
../src/zvbi/sampling_par.h \
|
||||
../src/zvbi/sliced.h \
|
||||
../src/zvbi/zvbi_decoder.h \
|
||||
../src/extractors/extractor.c \
|
||||
../src/extractors/extractor.h \
|
||||
../src/wrappers/wrapper.c \
|
||||
../src/wrappers/wrapper.h \
|
||||
../src/freetype/autofit/autofit.c \
|
||||
../src/freetype/base/ftbase.c \
|
||||
../src/freetype/base/ftbbox.c \
|
||||
../src/freetype/base/ftbdf.c \
|
||||
../src/freetype/base/ftbitmap.c \
|
||||
../src/freetype/base/ftcid.c \
|
||||
../src/freetype/base/ftfntfmt.c \
|
||||
../src/freetype/base/ftfstype.c \
|
||||
../src/freetype/base/ftgasp.c \
|
||||
../src/freetype/base/ftglyph.c \
|
||||
../src/freetype/base/ftgxval.c \
|
||||
../src/freetype/base/ftinit.c \
|
||||
../src/freetype/base/ftlcdfil.c \
|
||||
../src/freetype/base/ftmm.c \
|
||||
../src/freetype/base/ftotval.c \
|
||||
../src/freetype/base/ftpatent.c \
|
||||
../src/freetype/base/ftpfr.c \
|
||||
../src/freetype/base/ftstroke.c \
|
||||
../src/freetype/base/ftsynth.c \
|
||||
../src/freetype/base/ftsystem.c \
|
||||
../src/freetype/base/fttype1.c \
|
||||
../src/freetype/base/ftwinfnt.c \
|
||||
../src/freetype/bdf/bdf.c \
|
||||
../src/freetype/bzip2/ftbzip2.c \
|
||||
../src/freetype/cache/ftcache.c \
|
||||
../src/freetype/cff/cff.c \
|
||||
../src/freetype/cid/type1cid.c \
|
||||
../src/freetype/gzip/ftgzip.c \
|
||||
../src/freetype/lzw/ftlzw.c \
|
||||
../src/freetype/pcf/pcf.c \
|
||||
../src/freetype/pfr/pfr.c \
|
||||
../src/freetype/psaux/psaux.c \
|
||||
../src/freetype/pshinter/pshinter.c \
|
||||
../src/freetype/psnames/psnames.c \
|
||||
../src/freetype/raster/raster.c \
|
||||
../src/freetype/sfnt/sfnt.c \
|
||||
../src/freetype/smooth/smooth.c \
|
||||
../src/freetype/truetype/truetype.c \
|
||||
../src/freetype/type1/type1.c \
|
||||
../src/freetype/type42/type42.c \
|
||||
../src/freetype/winfonts/winfnt.c
|
||||
../src/thirdparty/zlib/adler32.c \
|
||||
../src/thirdparty/zlib/compress.c \
|
||||
../src/thirdparty/zlib/crc32.c \
|
||||
../src/thirdparty/zlib/crc32.h \
|
||||
../src/thirdparty/zlib/deflate.c \
|
||||
../src/thirdparty/zlib/deflate.h \
|
||||
../src/thirdparty/zlib/gzclose.c \
|
||||
../src/thirdparty/zlib/gzguts.h \
|
||||
../src/thirdparty/zlib/gzlib.c \
|
||||
../src/thirdparty/zlib/gzread.c \
|
||||
../src/thirdparty/zlib/gzwrite.c \
|
||||
../src/thirdparty/zlib/infback.c \
|
||||
../src/thirdparty/zlib/inffast.c \
|
||||
../src/thirdparty/zlib/inffast.h \
|
||||
../src/thirdparty/zlib/inffixed.h \
|
||||
../src/thirdparty/zlib/inflate.c \
|
||||
../src/thirdparty/zlib/inflate.h \
|
||||
../src/thirdparty/zlib/inftrees.c \
|
||||
../src/thirdparty/zlib/inftrees.h \
|
||||
../src/thirdparty/zlib/trees.c \
|
||||
../src/thirdparty/zlib/trees.h \
|
||||
../src/thirdparty/zlib/uncompr.c \
|
||||
../src/thirdparty/zlib/zconf.h \
|
||||
../src/thirdparty/zlib/zlib.h \
|
||||
../src/thirdparty/zlib/zutil.c \
|
||||
../src/thirdparty/zlib/zutil.h \
|
||||
../src/thirdparty/utf8proc/utf8proc.c \
|
||||
../src/thirdparty/utf8proc/utf8proc.h \
|
||||
../src/thirdparty/lib_hash/sha2.c \
|
||||
../src/thirdparty/lib_hash/sha2.h \
|
||||
../src/thirdparty/protobuf-c/protobuf-c.c \
|
||||
../src/thirdparty/protobuf-c/protobuf-c.h \
|
||||
../src/thirdparty/zvbi/bcd.h \
|
||||
../src/thirdparty/zvbi/bit_slicer.c \
|
||||
../src/thirdparty/zvbi/bit_slicer.h \
|
||||
../src/thirdparty/zvbi/decoder.c \
|
||||
../src/thirdparty/zvbi/macros.h \
|
||||
../src/thirdparty/zvbi/misc.h \
|
||||
../src/thirdparty/zvbi/raw_decoder.c \
|
||||
../src/thirdparty/zvbi/raw_decoder.h \
|
||||
../src/thirdparty/zvbi/sampling_par.c \
|
||||
../src/thirdparty/zvbi/sampling_par.h \
|
||||
../src/thirdparty/zvbi/sliced.h \
|
||||
../src/thirdparty/zvbi/zvbi_decoder.h \
|
||||
../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c
|
||||
|
||||
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
|
||||
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_H
|
||||
|
||||
ccextractor_CPPFLAGS =-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/ -I../src/ -I../src/freetype/include/
|
||||
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/thirdparty/gpacmp4/ -I../src/thirdparty/libpng/ -I../src/thirdparty/zlib/ -I../src/thirdparty/zvbi/ -I../src/thirdparty/lib_hash/ -I../src/thirdparty/protobuf-c -I../src/thirdparty -I../src -I../src/thirdparty/freetype/include
|
||||
|
||||
|
||||
ccextractor_LDADD=-lm
|
||||
ccextractor_LDADD=-lm -lpthread -ldl
|
||||
|
||||
if SYS_IS_LINUX
|
||||
ccextractor_CFLAGS += -O3 -s -DGPAC_CONFIG_LINUX
|
||||
@@ -362,7 +369,7 @@ ccextractor_LDADD += $(TESS_LIB)
|
||||
ccextractor_LDADD += $(LEPT_LIB)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = ../src/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
EXTRA_DIST = ../src/thirdparty/gpacmp4/gpac/sync_layer.h ../src/lib_ccx/ccfont2.xbm ../src/thirdparty/utf8proc/utf8proc_data.c fonts/ icon/
|
||||
|
||||
#For GUI
|
||||
if BUILD_WITH_GUI
|
||||
|
||||
@@ -1,62 +1,60 @@
|
||||
#!/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 -DFT2_BUILD_LIBRARY"
|
||||
BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_H"
|
||||
[[ $1 = "OCR" ]] && BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"
|
||||
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../src/freetype/include"
|
||||
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/thirdparty/gpacmp4 -I../src/lib_hash -I../src/thirdparty/libpng -I../src/thirdparty -I../src/thirdparty/protobuf-c -I../src/thirdparty/zlib -I../src/thirdparty/zvbi -I../src/thirdparty/freetype/include"
|
||||
[[ $1 = "OCR" ]] && BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors 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="../src/utf8proc/utf8proc.c"
|
||||
SRC_ZLIB="$(find ../src/zlib -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
|
||||
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
|
||||
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
|
||||
SRC_FREETYPE="../src/freetype/autofit/autofit.c \
|
||||
../src/freetype/base/ftbase.c \
|
||||
../src/freetype/base/ftbbox.c \
|
||||
../src/freetype/base/ftbdf.c \
|
||||
../src/freetype/base/ftbitmap.c \
|
||||
../src/freetype/base/ftcid.c \
|
||||
../src/freetype/base/ftfntfmt.c \
|
||||
../src/freetype/base/ftfstype.c \
|
||||
../src/freetype/base/ftgasp.c \
|
||||
../src/freetype/base/ftglyph.c \
|
||||
../src/freetype/base/ftgxval.c \
|
||||
../src/freetype/base/ftinit.c \
|
||||
../src/freetype/base/ftlcdfil.c \
|
||||
../src/freetype/base/ftmm.c \
|
||||
../src/freetype/base/ftotval.c \
|
||||
../src/freetype/base/ftpatent.c \
|
||||
../src/freetype/base/ftpfr.c \
|
||||
../src/freetype/base/ftstroke.c \
|
||||
../src/freetype/base/ftsynth.c \
|
||||
../src/freetype/base/ftsystem.c \
|
||||
../src/freetype/base/fttype1.c \
|
||||
../src/freetype/base/ftwinfnt.c \
|
||||
../src/freetype/bdf/bdf.c \
|
||||
../src/freetype/bzip2/ftbzip2.c \
|
||||
../src/freetype/cache/ftcache.c \
|
||||
../src/freetype/cff/cff.c \
|
||||
../src/freetype/cid/type1cid.c \
|
||||
../src/freetype/gzip/ftgzip.c \
|
||||
../src/freetype/lzw/ftlzw.c \
|
||||
../src/freetype/pcf/pcf.c \
|
||||
../src/freetype/pfr/pfr.c \
|
||||
../src/freetype/psaux/psaux.c \
|
||||
../src/freetype/pshinter/pshinter.c \
|
||||
../src/freetype/psnames/psnames.c \
|
||||
../src/freetype/raster/raster.c \
|
||||
../src/freetype/sfnt/sfnt.c \
|
||||
../src/freetype/smooth/smooth.c \
|
||||
../src/freetype/truetype/truetype.c \
|
||||
../src/freetype/type1/type1.c \
|
||||
../src/freetype/type42/type42.c \
|
||||
../src/freetype/winfonts/winfnt.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $SRC_FREETYPE $API_WRAPPERS $API_EXTRACTORS"
|
||||
BLD_LINKER="-lm -liconv"
|
||||
SRC_GPAC="$(find ../src/thirdparty/gpacmp4 -name '*.c')"
|
||||
SRC_LIB_HASH="$(find ../src/thirdparty/lib_hash -name '*.c')"
|
||||
SRC_LIBPNG="$(find ../src/thirdparty/libpng -name '*.c')"
|
||||
SRC_PROTOBUF="$(find ../src/thirdparty/protobuf-c -name '*.c')"
|
||||
SRC_UTF8="../src/thirdparty/utf8proc/utf8proc.c"
|
||||
SRC_ZLIB="$(find ../src/thirdparty/zlib -name '*.c')"
|
||||
SRC_ZVBI="$(find ../src/thirdparty/zvbi -name '*.c')"
|
||||
SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c \
|
||||
../src/thirdparty/freetype/base/ftbase.c \
|
||||
../src/thirdparty/freetype/base/ftbbox.c \
|
||||
../src/thirdparty/freetype/base/ftbdf.c \
|
||||
../src/thirdparty/freetype/base/ftbitmap.c \
|
||||
../src/thirdparty/freetype/base/ftcid.c \
|
||||
../src/thirdparty/freetype/base/ftfntfmt.c \
|
||||
../src/thirdparty/freetype/base/ftfstype.c \
|
||||
../src/thirdparty/freetype/base/ftgasp.c \
|
||||
../src/thirdparty/freetype/base/ftglyph.c \
|
||||
../src/thirdparty/freetype/base/ftgxval.c \
|
||||
../src/thirdparty/freetype/base/ftinit.c \
|
||||
../src/thirdparty/freetype/base/ftlcdfil.c \
|
||||
../src/thirdparty/freetype/base/ftmm.c \
|
||||
../src/thirdparty/freetype/base/ftotval.c \
|
||||
../src/thirdparty/freetype/base/ftpatent.c \
|
||||
../src/thirdparty/freetype/base/ftpfr.c \
|
||||
../src/thirdparty/freetype/base/ftstroke.c \
|
||||
../src/thirdparty/freetype/base/ftsynth.c \
|
||||
../src/thirdparty/freetype/base/ftsystem.c \
|
||||
../src/thirdparty/freetype/base/fttype1.c \
|
||||
../src/thirdparty/freetype/base/ftwinfnt.c \
|
||||
../src/thirdparty/freetype/bdf/bdf.c \
|
||||
../src/thirdparty/freetype/bzip2/ftbzip2.c \
|
||||
../src/thirdparty/freetype/cache/ftcache.c \
|
||||
../src/thirdparty/freetype/cff/cff.c \
|
||||
../src/thirdparty/freetype/cid/type1cid.c \
|
||||
../src/thirdparty/freetype/gzip/ftgzip.c \
|
||||
../src/thirdparty/freetype/lzw/ftlzw.c \
|
||||
../src/thirdparty/freetype/pcf/pcf.c \
|
||||
../src/thirdparty/freetype/pfr/pfr.c \
|
||||
../src/thirdparty/freetype/psaux/psaux.c \
|
||||
../src/thirdparty/freetype/pshinter/pshinter.c \
|
||||
../src/thirdparty/freetype/psnames/psnames.c \
|
||||
../src/thirdparty/freetype/raster/raster.c \
|
||||
../src/thirdparty/freetype/sfnt/sfnt.c \
|
||||
../src/thirdparty/freetype/smooth/smooth.c \
|
||||
../src/thirdparty/freetype/truetype/truetype.c \
|
||||
../src/thirdparty/freetype/type1/type1.c \
|
||||
../src/thirdparty/freetype/type42/type42.c \
|
||||
../src/thirdparty/freetype/winfonts/winfnt.c"
|
||||
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $SRC_FREETYPE"
|
||||
BLD_LINKER="-lm -liconv -lpthread -ldl"
|
||||
[[ $1 = "OCR" ]] && BLD_LINKER="$BLD_LINKER `pkg-config --libs --silence-errors tesseract` `pkg-config --libs --silence-errors lept`"
|
||||
|
||||
./pre-build.sh
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([CCExtractor], [0.86], [carlos@ccextractor.org])
|
||||
AC_INIT([CCExtractor], [0.89], [carlos@ccextractor.org])
|
||||
AC_CONFIG_AUX_DIR([build-conf])
|
||||
AC_CONFIG_SRCDIR([../src/ccextractor.c])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
BIN
mac/gui/InstallCCExtractorMacGUI.app.zip
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Info.plist
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/MacOS/InstallCCExtractorMacGUI
Executable file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/MainMenu.nib
generated
Normal file
BIN
mac/gui/InstallCCExtractorMacGUI.app/Contents/Resources/script
Executable file
2
mac/gui/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## Simple MacOS GUI for CCExtractor
|
||||
This is a simple GUI for MacOS. It was generated using the open source Platypus tool created by [Sveinbjörn Þórðarson](https://sveinbjorn.org). You can learn more about Platypus [here.](https://sveinbjorn.org/platypus) It is recommended if you need more customization please use the CLI tool as this app only has the default settings.
|
||||
BIN
mac/gui/src/CCExtractor.app/Contents/Info.plist
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/MacOS/CCExtractor
Executable file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppIcon.icns
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/AppSettings.plist
Normal file
BIN
mac/gui/src/CCExtractor.app/Contents/Resources/MainMenu.nib
generated
Normal file
12
mac/gui/src/CCExtractor.app/Contents/Resources/script
Executable file
@@ -0,0 +1,12 @@
|
||||
/usr/local/bin/ccextractor $1
|
||||
|
||||
function display() {
|
||||
osascript <<EOT
|
||||
tell app "System Events"
|
||||
display dialog "$1" buttons {"OK"} default button 1 with title "CCExtractor"
|
||||
return
|
||||
end tell
|
||||
EOT
|
||||
}
|
||||
echo "Done"
|
||||
display "Process Complete. Check the source file's folder for the subtitles."
|
||||
BIN
mac/gui/src/CCExtractor.dmg
Normal file
25
mac/gui/src/HowToGenerateApp.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# HowToGenerateApp
|
||||
|
||||
## Main App
|
||||
|
||||
Script Type: Shell
|
||||
|
||||
Script Path: script.sh located in src folder
|
||||
|
||||
Interface: Droplet
|
||||
|
||||
Remain running after execution: Enabled
|
||||
|
||||
Accept Dropped Files: Enabled
|
||||
|
||||
## Install App
|
||||
|
||||
Script Type: Apple Script
|
||||
|
||||
Script Path: InstallCCExtractor.scpt located in src folder
|
||||
|
||||
Interface: Progress Bar
|
||||
|
||||
Bundled Files: CCExtractor.dmg located in src folder
|
||||
|
||||
Remain running after execution: Disabled
|
||||
BIN
mac/gui/src/InstallCCExtractor.scpt
Normal file
BIN
mac/gui/src/ccx_logo_icon.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
1
mac/gui/src/placeholder.md
Normal file
@@ -0,0 +1 @@
|
||||
place
|
||||
12
mac/gui/src/script.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
/usr/local/bin/ccextractor $1
|
||||
|
||||
function display() {
|
||||
osascript <<EOT
|
||||
tell app "System Events"
|
||||
display dialog "$1" buttons {"OK"} default button 1 with title "CCExtractor"
|
||||
return
|
||||
end tell
|
||||
EOT
|
||||
}
|
||||
echo "Done"
|
||||
display "Process Complete. Check the source file's folder for the subtitles."
|
||||
@@ -21,7 +21,7 @@ fi
|
||||
if [ -z "$commit" ]; then
|
||||
commit="Unknown"
|
||||
fi
|
||||
builddate=`date +%Y-%m-%d`
|
||||
builddate=`date -j -u -r "${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d`
|
||||
echo "Storing variables in file"
|
||||
echo "Commit: $commit"
|
||||
echo "Date: $builddate"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pkgname=ccextractor
|
||||
pkgver=0.85
|
||||
pkgver=0.89
|
||||
pkgrel=1
|
||||
pkgdesc="A closed captions and teletext subtitles extractor for video streams."
|
||||
arch=('i686' 'x86_64')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: ccextractor
|
||||
Version: 0.85
|
||||
Version: 0.88
|
||||
Release: 1
|
||||
Summary: A closed captions and teletext subtitles extractor for video streams.
|
||||
Group: Applications/Internet
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
TYPE="debian" # can be one of 'slackware', 'debian', 'rpm'
|
||||
PROGRAM_NAME="ccextractor"
|
||||
VERSION="0.85"
|
||||
VERSION="0.88"
|
||||
RELEASE="1"
|
||||
LICENSE="GPL-2.0"
|
||||
MAINTAINER="carlos@ccextractor.org"
|
||||
|
||||
16
src/BUILD
Normal file
@@ -0,0 +1,16 @@
|
||||
cc_binary(
|
||||
name = "ccextractor",
|
||||
srcs = ["ccextractor.c",
|
||||
"ccextractor.h"],
|
||||
deps = [
|
||||
"//src/lib_ccx:lib_ccx",
|
||||
"//src/thirdparty/protobuf-c:protobuf-c",
|
||||
"//src/thirdparty/gpacmp4:gpacmp4",
|
||||
"//src/thirdparty/zlib:zlib",
|
||||
"//src/thirdparty/freetype:freetype"
|
||||
],
|
||||
copts = [ "-Isrc/thirdparty/protobuf-c", "-Isrc/thirdparty/libpng", "-Isrc" ]
|
||||
)
|
||||
|
||||
exports_files (["ccextractor.h"], ["//src/lib_ccx:__pkg__"])
|
||||
|
||||
@@ -5,10 +5,11 @@ 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)
|
||||
option (WITH_HARDSUBX "Build with support for burned-in subtitles" OFF)
|
||||
|
||||
# Version number
|
||||
set (CCEXTRACTOR_VERSION_MAJOR 0)
|
||||
set (CCEXTRACTOR_VERSION_MINOR 85b)
|
||||
set (CCEXTRACTOR_VERSION_MINOR 89)
|
||||
|
||||
# Get project directory
|
||||
get_filename_component(BASE_PROJ_DIR ../ ABSOLUTE)
|
||||
@@ -39,76 +40,79 @@ configure_file (
|
||||
"${PROJECT_SOURCE_DIR}/lib_ccx/compile_info_real.h"
|
||||
)
|
||||
|
||||
add_definitions(-DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY)
|
||||
add_definitions(-DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP -DGPAC_HAVE_CONFIG_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/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/lib_hash/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/extractors/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/wrappers/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/zlib/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/freetype/include/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/extractors/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/wrappers/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-DGPAC_64_BITS)
|
||||
endif()
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR})
|
||||
include_directories(${PROJECT_SOURCE_DIR}/lib_ccx)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/lib_ccx/zvbi)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/gpacmp4)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/protobuf-c)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/lib_hash)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/libpng)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/zlib)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/freetype/include)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/thirdparty/gpacmp4/ SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/thirdparty/lib_hash/ SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/thirdparty/libpng/ SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/thirdparty/protobuf-c/ SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/thirdparty/zlib/ SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR}/lib_ccx/zvbi/ SOURCEFILE)
|
||||
|
||||
set(UTF8PROC_SOURCE ${PROJECT_SOURCE_DIR}/thirdparty/utf8proc/utf8proc.c)
|
||||
|
||||
set(FREETYPE_SOURCE
|
||||
${PROJECT_SOURCE_DIR}/freetype/autofit/autofit.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftbase.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftbbox.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftbdf.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftbitmap.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftcid.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftfntfmt.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftfstype.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftgasp.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftglyph.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftgxval.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftinit.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftlcdfil.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftmm.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftotval.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftpatent.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftpfr.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftstroke.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftsynth.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftsystem.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/fttype1.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/base/ftwinfnt.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/bdf/bdf.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/bzip2/ftbzip2.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/cache/ftcache.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/cff/cff.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/cid/type1cid.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/gzip/ftgzip.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/lzw/ftlzw.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/pcf/pcf.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/pfr/pfr.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/psaux/psaux.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/pshinter/pshinter.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/psnames/psnames.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/raster/raster.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/sfnt/sfnt.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/smooth/smooth.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/truetype/truetype.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/type1/type1.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/type42/type42.c
|
||||
${PROJECT_SOURCE_DIR}/freetype/winfonts/winfnt.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/autofit/autofit.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftbase.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftbbox.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftbdf.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftbitmap.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftcid.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftfntfmt.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftfstype.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftgasp.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftglyph.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftgxval.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftinit.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftlcdfil.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftmm.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftotval.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftpatent.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftpfr.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftstroke.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftsynth.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftsystem.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/fttype1.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/base/ftwinfnt.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/bdf/bdf.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/bzip2/ftbzip2.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/cache/ftcache.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/cff/cff.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/cid/type1cid.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/gzip/ftgzip.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/lzw/ftlzw.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/pcf/pcf.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/pfr/pfr.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/psaux/psaux.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/pshinter/pshinter.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/psnames/psnames.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/raster/raster.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/sfnt/sfnt.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/smooth/smooth.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/truetype/truetype.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/type1/type1.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/type42/type42.c
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/freetype/winfonts/winfnt.c
|
||||
)
|
||||
#Windows specific libraries and linker flags
|
||||
if(WIN32)
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/win_spec_incld/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/win_iconv/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/win_iconv/" SOURCEFILE)
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_spec_incld/")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/" SOURCEFILE)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ws2_32 winmm)
|
||||
else (WIN32)
|
||||
# Adding some platform specific library path
|
||||
@@ -125,7 +129,7 @@ endif(MSVC)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FILE_OFFSET_BITS=64")
|
||||
add_subdirectory (lib_ccx)
|
||||
|
||||
aux_source_directory (${PROJECT_SOURCE_DIR} SOURCEFILE)
|
||||
aux_source_directory(${PROJECT_SOURCE_DIR} SOURCEFILE)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ccx)
|
||||
# set (EXTRA_LIBS ${EXTRA_LIBS} m)
|
||||
|
||||
@@ -134,7 +138,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} -lz -lm)
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} -lm -lpthread -ldl)
|
||||
|
||||
find_package (PkgConfig)
|
||||
|
||||
@@ -147,16 +151,19 @@ 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)
|
||||
pkg_check_modules (AVFILTER REQUIRED libavfilter)
|
||||
pkg_check_modules (SWSCALE REQUIRED libswscale)
|
||||
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFILTER_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${SWSCALE_LIBRARIES})
|
||||
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFORMAT_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVUTIL_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVCODEC_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFILTER_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${SWSCALE_INCLUDE_DIRS})
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
|
||||
@@ -187,13 +194,38 @@ if (PKG_CONFIG_FOUND AND WITH_SHARING)
|
||||
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)
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/protobuf-c/")
|
||||
aux_source_directory ("${PROJECT_SOURCE_DIR}/thirdparty/protobuf-c/" SOURCEFILE)
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SHARING")
|
||||
endif (PKG_CONFIG_FOUND AND WITH_SHARING)
|
||||
|
||||
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE})
|
||||
########################################################
|
||||
# Build for hardsubx using avformat, avutil, avcodec and
|
||||
# swscale
|
||||
########################################################
|
||||
|
||||
if (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
|
||||
|
||||
pkg_check_modules (AVFORMAT REQUIRED libavformat)
|
||||
pkg_check_modules (AVUTIL REQUIRED libavutil)
|
||||
pkg_check_modules (AVCODEC REQUIRED libavcodec)
|
||||
pkg_check_modules (SWSCALE REQUIRED libswscale)
|
||||
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_LIBRARIES})
|
||||
set (EXTRA_LIBS ${EXTRA_LIBS} ${SWSCALE_LIBRARIES})
|
||||
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFORMAT_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVUTIL_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVCODEC_INCLUDE_DIRS})
|
||||
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${SWSCALE_INCLUDE_DIRS})
|
||||
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_HARDSUBX")
|
||||
endif (PKG_CONFIG_FOUND AND WITH_HARDSUBX)
|
||||
|
||||
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE} ${UTF8PROC_SOURCE})
|
||||
target_link_libraries (ccextractor ${EXTRA_LIBS})
|
||||
target_include_directories (ccextractor PUBLIC ${EXTRA_INCLUDES})
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
int activity(struct nk_context *ctx, int x, int y, int width, int height, struct main_tab *main_settings)
|
||||
{
|
||||
static int i;
|
||||
if (nk_begin(ctx, "Activity", nk_rect(x, y, width, height), NK_WINDOW_TITLE|NK_WINDOW_BACKGROUND))
|
||||
if (nk_begin(ctx, "Activity", nk_rect(x, y, width, height), NK_WINDOW_TITLE | NK_WINDOW_BACKGROUND))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 40, 1);
|
||||
for(i = 0; i < main_settings->activity_string_count; i++)
|
||||
for (i = 0; i < main_settings->activity_string_count; i++)
|
||||
nk_label_wrap(ctx, main_settings->activity_string[i]);
|
||||
}
|
||||
nk_end(ctx);
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
#include <GL/glew.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
|
||||
|
||||
#define PATH_LENGTH 66
|
||||
#define NAME_LENGTH 56
|
||||
#define PREFIX_LENGTH_TRUNCATED 10
|
||||
@@ -31,6 +29,7 @@
|
||||
#include "nuklear_lib/nuklear.h"
|
||||
#include "nuklear_lib/nuklear_glfw_gl2.h"
|
||||
|
||||
#include "icon_data.c"
|
||||
|
||||
//#define WINDOW_WIDTH 1200
|
||||
//#define WINDOW_HEIGHT 800
|
||||
@@ -54,7 +53,6 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
|
||||
|
||||
static struct main_tab main_settings;
|
||||
|
||||
/*Trigger command for CLI*/
|
||||
@@ -62,7 +60,6 @@ char command[20];
|
||||
|
||||
/*Global Variables for Drag and Drop files*/
|
||||
|
||||
|
||||
/* Width and Height of all frames*/
|
||||
const GLint WIDTH_mainPanelAndWindow = 530, HEIGHT_mainPanelandWindow = 550;
|
||||
const GLint WIDTH_termORPreviewPanel = 530, HEIGHT_termORPreviewPanel = 100;
|
||||
@@ -78,38 +75,35 @@ static int tab_screen_height;
|
||||
/*Parameter Constants*/
|
||||
static int modifiedParams = 0;
|
||||
|
||||
|
||||
static void error_callback(int e, const char *d)
|
||||
{
|
||||
printf("Error %d: %s\n", e, d);
|
||||
}
|
||||
|
||||
void drop_callback(GLFWwindow* window, int count, const char **paths)
|
||||
void drop_callback(GLFWwindow *window, int count, const char **paths)
|
||||
{
|
||||
int i,j,k,z,copycount, prefix_length, slash_length, fileNameTruncated_index;
|
||||
|
||||
int i, j, k, z, copycount, prefix_length, slash_length, fileNameTruncated_index;
|
||||
|
||||
printf("Number of selected paths:%d\n", count);
|
||||
|
||||
if(main_settings.filename_count == 0 && main_settings.filenames == NULL)
|
||||
main_settings.filenames = (char**)calloc(count + 1, sizeof(char*));
|
||||
if (main_settings.filename_count == 0 && main_settings.filenames == NULL)
|
||||
main_settings.filenames = (char **)calloc(count + 1, sizeof(char *));
|
||||
else
|
||||
main_settings.filenames = (char**)realloc(main_settings.filenames, (main_settings.filename_count + count + 1) * sizeof(char*));
|
||||
main_settings.filenames = (char **)realloc(main_settings.filenames, (main_settings.filename_count + count + 1) * sizeof(char *));
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
printf("\n%d", main_settings.filename_count);
|
||||
|
||||
main_settings.filenames[main_settings.filename_count] = (char*)calloc((strlen(paths[i])+5), sizeof(char));
|
||||
main_settings.filenames[main_settings.filename_count] = (char *)calloc((strlen(paths[i]) + 5), sizeof(char));
|
||||
main_settings.filenames[main_settings.filename_count][0] = '\"';
|
||||
strcat(main_settings.filenames[main_settings.filename_count], paths[i]);
|
||||
strcat(main_settings.filenames[main_settings.filename_count], "\"");
|
||||
puts(main_settings.filenames[main_settings.filename_count]);
|
||||
puts(main_settings.filenames[main_settings.filename_count]);
|
||||
main_settings.filename_count++;
|
||||
}
|
||||
main_settings.filenames[main_settings.filename_count] = NULL;
|
||||
|
||||
main_settings.filenames[main_settings.filename_count] = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*Rectangle to hold file names*/
|
||||
//void draw_file_rectangle_widget(struct nk_context *ctx, struct nk_font *font)
|
||||
//{
|
||||
@@ -137,7 +131,7 @@ void drop_callback(GLFWwindow* window, int count, const char **paths)
|
||||
// space.y = space.y + 20;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
/*Rectangle to hold extraction info*/
|
||||
@@ -188,7 +182,8 @@ int main(void)
|
||||
glfwSetWindowUserPointer(win, &ctx);
|
||||
glfwSetDropCallback(win, drop_callback);
|
||||
|
||||
if (glewInit() != GLEW_OK) {
|
||||
if (glewInit() != GLEW_OK)
|
||||
{
|
||||
fprintf(stderr, "Failed to setup GLEW\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -202,20 +197,12 @@ int main(void)
|
||||
ctx = nk_glfw3_init(win, NK_GLFW3_INSTALL_CALLBACKS);
|
||||
struct nk_font_atlas *font_atlas;
|
||||
nk_glfw3_font_stash_begin(&font_atlas);
|
||||
#ifdef _WIN32
|
||||
struct nk_font *droid = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 16, 0);
|
||||
struct nk_font *droid_big = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 25, 0);
|
||||
struct nk_font *droid_head = nk_font_atlas_add_from_file(font_atlas, "../../fonts/Roboto-Regular.ttf", 20, 0);
|
||||
#else
|
||||
struct nk_font *droid = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 16, 0);
|
||||
struct nk_font *droid_big = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 25, 0);
|
||||
struct nk_font *droid_head = nk_font_atlas_add_from_file(font_atlas, "../fonts/Roboto-Regular.ttf", 20, 0);
|
||||
#endif
|
||||
struct nk_font *droid = nk_font_atlas_add_from_memory(font_atlas, roboto_regular_font, sizeof(roboto_regular_font), 16, 0);
|
||||
struct nk_font *droid_big = nk_font_atlas_add_from_memory(font_atlas, roboto_regular_font, sizeof(roboto_regular_font), 25, 0);
|
||||
struct nk_font *droid_head = nk_font_atlas_add_from_memory(font_atlas, roboto_regular_font, sizeof(roboto_regular_font), 20, 0);
|
||||
nk_glfw3_font_stash_end();
|
||||
nk_style_set_font(ctx, &droid->handle);
|
||||
|
||||
|
||||
|
||||
//CHECKBOX VALUES
|
||||
static int show_terminal_check = nk_false;
|
||||
static int show_preview_check = nk_false;
|
||||
@@ -223,7 +210,7 @@ int main(void)
|
||||
static int advanced_mode_check = nk_false;
|
||||
static int file_extension_check = nk_true;
|
||||
|
||||
/*Settigs and tab options*/
|
||||
/*Settings and tab options*/
|
||||
setup_main_settings(&main_settings);
|
||||
static struct network_popup network_settings;
|
||||
setup_network_settings(&network_settings);
|
||||
@@ -247,49 +234,38 @@ int main(void)
|
||||
|
||||
/* icons */
|
||||
|
||||
media.icons.home = icon_load(home_icon_data, sizeof(home_icon_data));
|
||||
media.icons.directory = icon_load(directory_icon_data, sizeof(directory_icon_data));
|
||||
media.icons.computer = icon_load(computer_icon_data, sizeof(computer_icon_data));
|
||||
#ifdef _WIN32
|
||||
media.icons.home = icon_load("../../icon/home.png");
|
||||
media.icons.directory = icon_load("../../icon/directory.png");
|
||||
media.icons.computer = icon_load("../../icon/computer.png");
|
||||
media.icons.drives = icon_load("../../icon/drive.png");
|
||||
media.icons.desktop = icon_load("../../icon/desktop.png");
|
||||
media.icons.default_file = icon_load("../../icon/default.png");
|
||||
media.icons.text_file = icon_load("../../icon/text.png");
|
||||
media.icons.music_file = icon_load("../../icon/music.png");
|
||||
media.icons.font_file = icon_load("../../icon/font.png");
|
||||
media.icons.img_file = icon_load("../../icon/img.png");
|
||||
media.icons.movie_file = icon_load("../../icon/movie.png");
|
||||
#else
|
||||
media.icons.home = icon_load("../icon/home.png");
|
||||
media.icons.directory = icon_load("../icon/directory.png");
|
||||
media.icons.computer = icon_load("../icon/computer.png");
|
||||
media.icons.desktop = icon_load("../icon/desktop.png");
|
||||
media.icons.default_file = icon_load("../icon/default.png");
|
||||
media.icons.text_file = icon_load("../icon/text.png");
|
||||
media.icons.music_file = icon_load("../icon/music.png");
|
||||
media.icons.font_file = icon_load("../icon/font.png");
|
||||
media.icons.img_file = icon_load("../icon/img.png");
|
||||
media.icons.movie_file = icon_load("../icon/movie.png");
|
||||
media.icons.drives = icon_load(drive_icon_data, sizeof(drive_icon_data));
|
||||
#endif
|
||||
media.icons.desktop = icon_load(desktop_icon_data, sizeof(desktop_icon_data));
|
||||
media.icons.default_file = icon_load(default_icon_data, sizeof(default_icon_data));
|
||||
media.icons.text_file = icon_load(text_icon_data, sizeof(text_icon_data));
|
||||
media.icons.music_file = icon_load(music_icon_data, sizeof(music_icon_data));
|
||||
media.icons.font_file = icon_load(font_icon_data, sizeof(font_icon_data));
|
||||
media.icons.img_file = icon_load(img_icon_data, sizeof(img_icon_data));
|
||||
media.icons.movie_file = icon_load(movie_icon_data, sizeof(movie_icon_data));
|
||||
|
||||
media_init(&media);
|
||||
media_init(&media);
|
||||
|
||||
file_browser_init(&browser, &media);
|
||||
file_browser_init(&browser, &media);
|
||||
|
||||
/*Read Last run state*/
|
||||
FILE *loadFile;
|
||||
loadFile = fopen("ccxGUI.ini", "r");
|
||||
if(loadFile != NULL)
|
||||
{
|
||||
printf("File found and reading it!\n");
|
||||
load_data(loadFile, &main_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &hd_homerun, &burned_subs, &network_settings);
|
||||
fclose(loadFile);
|
||||
}
|
||||
/*Read Last run state*/
|
||||
FILE *loadFile;
|
||||
loadFile = fopen("ccxGUI.ini", "r");
|
||||
if (loadFile != NULL)
|
||||
{
|
||||
printf("File found and reading it!\n");
|
||||
load_data(loadFile, &main_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &hd_homerun, &burned_subs, &network_settings);
|
||||
fclose(loadFile);
|
||||
}
|
||||
|
||||
/*Main GUI loop*/
|
||||
while (nk_true)
|
||||
{
|
||||
if(glfwWindowShouldClose(win))
|
||||
if (glfwWindowShouldClose(win))
|
||||
{
|
||||
FILE *saveFile;
|
||||
saveFile = fopen("ccxGUI.ini", "w");
|
||||
@@ -301,27 +277,24 @@ int main(void)
|
||||
glfwPollEvents();
|
||||
nk_glfw3_new_frame();
|
||||
|
||||
|
||||
//Popups
|
||||
static int show_progress_details = nk_false;
|
||||
static int show_about_ccx = nk_false;
|
||||
static int show_getting_started = nk_false;
|
||||
|
||||
|
||||
|
||||
//GUI
|
||||
if (nk_begin(ctx, "CCExtractor", nk_rect(0, 0, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow),
|
||||
NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BACKGROUND))
|
||||
NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BACKGROUND))
|
||||
{
|
||||
|
||||
|
||||
//MENUBAR
|
||||
//MENUBAR
|
||||
nk_menubar_begin(ctx);
|
||||
nk_layout_row_begin(ctx, NK_STATIC, 30, 3);
|
||||
nk_layout_row_push(ctx, 80);
|
||||
if (nk_menu_begin_label(ctx, "Preferences", NK_TEXT_LEFT, nk_vec2(120, 200))) {
|
||||
if (nk_menu_begin_label(ctx, "Preferences", NK_TEXT_LEFT, nk_vec2(120, 200)))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 30, 1);
|
||||
if(nk_menu_item_label(ctx, "Reset Defaults", NK_TEXT_LEFT))
|
||||
if (nk_menu_item_label(ctx, "Reset Defaults", NK_TEXT_LEFT))
|
||||
{
|
||||
remove("ccxGUI.ini");
|
||||
setup_main_settings(&main_settings);
|
||||
@@ -334,14 +307,14 @@ int main(void)
|
||||
setup_debug_tab(&debug);
|
||||
setup_hd_homerun_tab(&hd_homerun);
|
||||
setup_burned_subs_tab(&burned_subs);
|
||||
|
||||
}
|
||||
if (nk_menu_item_label(ctx, "Network Settings", NK_TEXT_LEFT))
|
||||
network_settings.show_network_settings = nk_true;
|
||||
nk_menu_end(ctx);
|
||||
}
|
||||
nk_layout_row_push(ctx, 70);
|
||||
if (nk_menu_begin_label(ctx, "Windows", NK_TEXT_LEFT, nk_vec2(120, 200))) {
|
||||
if (nk_menu_begin_label(ctx, "Windows", NK_TEXT_LEFT, nk_vec2(120, 200)))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 30, 1);
|
||||
nk_checkbox_label(ctx, "Activity", &show_activity_check);
|
||||
nk_checkbox_label(ctx, "Terminal", &show_terminal_check);
|
||||
@@ -358,38 +331,39 @@ int main(void)
|
||||
show_about_ccx = nk_true;
|
||||
nk_menu_end(ctx);
|
||||
}
|
||||
|
||||
//Network Settings
|
||||
|
||||
//Network Settings
|
||||
if (network_settings.show_network_settings)
|
||||
draw_network_popup(ctx, &network_settings);
|
||||
|
||||
//About CCExtractor Popup
|
||||
//About CCExtractor Popup
|
||||
if (show_about_ccx)
|
||||
draw_about_ccx_popup(ctx, &show_about_ccx, &droid_big->handle, &droid_head->handle);
|
||||
|
||||
//Getting Started
|
||||
//Getting Started
|
||||
if (show_getting_started)
|
||||
draw_getting_started_popup(ctx, &show_getting_started);
|
||||
|
||||
//Color Popup
|
||||
//Color Popup
|
||||
if (output.color_popup)
|
||||
draw_color_popup(ctx, &output);
|
||||
|
||||
//File Browser as Popup
|
||||
if(main_settings.scaleWindowForFileBrowser){
|
||||
//File Browser as Popup
|
||||
if (main_settings.scaleWindowForFileBrowser)
|
||||
{
|
||||
int width = 0, height = 0;
|
||||
glfwGetWindowSize(win, &width, &height);
|
||||
glfwSetWindowSize(win, 930, 650);
|
||||
glfwSetWindowSizeLimits(win,930, 650, 930, 650 );
|
||||
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
|
||||
file_browser_run(&browser, ctx, &main_settings, &output, &debug, &hd_homerun);
|
||||
}
|
||||
|
||||
//Thread popop when file can't be read
|
||||
if(main_settings.threadPopup)
|
||||
//Thread popop when file can't be read
|
||||
if (main_settings.threadPopup)
|
||||
draw_thread_popup(ctx, &main_settings.threadPopup);
|
||||
|
||||
//Thread popup for hd_homerun thread
|
||||
if(hd_homerun.threadPopup)
|
||||
//Thread popup for hd_homerun thread
|
||||
if (hd_homerun.threadPopup)
|
||||
draw_thread_popup(ctx, &hd_homerun.threadPopup);
|
||||
|
||||
nk_layout_row_end(ctx);
|
||||
@@ -397,27 +371,38 @@ int main(void)
|
||||
nk_layout_space_begin(ctx, NK_STATIC, 15, 1);
|
||||
nk_layout_space_end(ctx);
|
||||
|
||||
|
||||
|
||||
/*TABS TRIGGERED IN ADVANCED MODE FLAG*/
|
||||
if (advanced_mode_check)
|
||||
{
|
||||
static int current_tab = 0;
|
||||
enum tab_name { MAIN, INPUT, ADV_INPUT, OUTPUT, DECODERS, CREDITS, DEBUG, HDHOMERUN, BURNEDSUBS };
|
||||
const char *names[] = { "Main", "Input", "Advanced Input", "Output", "Decoders", "Credits", "Debug", "HDHomeRun", "BurnedSubs" };
|
||||
enum tab_name
|
||||
{
|
||||
MAIN,
|
||||
INPUT,
|
||||
ADV_INPUT,
|
||||
OUTPUT,
|
||||
DECODERS,
|
||||
CREDITS,
|
||||
DEBUG,
|
||||
HDHOMERUN,
|
||||
BURNEDSUBS
|
||||
};
|
||||
const char *names[] = {"Main", "Input", "Advanced Input", "Output", "Decoders", "Credits", "Debug", "HDHomeRun", "BurnedSubs"};
|
||||
float id = 0;
|
||||
int i;
|
||||
|
||||
nk_style_push_vec2(ctx, &ctx->style.window.spacing, nk_vec2(0, 0));
|
||||
nk_style_push_float(ctx, &ctx->style.button.rounding, 0);
|
||||
nk_layout_row_begin(ctx, NK_STATIC, 20, 9);
|
||||
for (i = 0; i < 9; ++i) {
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
/*Make sure button perfectly fits text*/
|
||||
const struct nk_user_font *f = ctx->style.font;
|
||||
float text_width = f->width(f->userdata, f->height, names[i], nk_strlen(names[i]));
|
||||
float widget_width = text_width + 3 * ctx->style.button.padding.x;
|
||||
nk_layout_row_push(ctx, widget_width);
|
||||
if (current_tab == i) {
|
||||
if (current_tab == i)
|
||||
{
|
||||
/*Active tab gets highlighted*/
|
||||
struct nk_style_item button_color = ctx->style.button.normal;
|
||||
ctx->style.button.normal = ctx->style.button.active;
|
||||
@@ -434,61 +419,64 @@ int main(void)
|
||||
if (nk_group_begin(ctx, "Advanced Tabs", NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_style_pop_vec2(ctx);
|
||||
switch (current_tab) {
|
||||
case MAIN:
|
||||
tab_screen_height = 0;
|
||||
break;
|
||||
switch (current_tab)
|
||||
{
|
||||
case MAIN:
|
||||
tab_screen_height = 0;
|
||||
break;
|
||||
|
||||
case INPUT:
|
||||
draw_input_tab(ctx, &tab_screen_height, &input, &decoders);
|
||||
break;
|
||||
case INPUT:
|
||||
draw_input_tab(ctx, &tab_screen_height, &input, &decoders);
|
||||
break;
|
||||
|
||||
case ADV_INPUT:
|
||||
draw_advanced_input_tab(ctx, &tab_screen_height, &advanced_input);
|
||||
break;
|
||||
case ADV_INPUT:
|
||||
draw_advanced_input_tab(ctx, &tab_screen_height, &advanced_input);
|
||||
break;
|
||||
|
||||
case OUTPUT:
|
||||
draw_output_tab(ctx, &tab_screen_height, &output, &main_settings);
|
||||
break;
|
||||
case OUTPUT:
|
||||
draw_output_tab(ctx, &tab_screen_height, &output, &main_settings);
|
||||
break;
|
||||
|
||||
case DECODERS:
|
||||
draw_decoders_tab(ctx, &tab_screen_height, &decoders);
|
||||
break;
|
||||
case DECODERS:
|
||||
draw_decoders_tab(ctx, &tab_screen_height, &decoders);
|
||||
break;
|
||||
|
||||
case CREDITS:
|
||||
draw_credits_tab(ctx, &tab_screen_height, &credits);
|
||||
break;
|
||||
case CREDITS:
|
||||
draw_credits_tab(ctx, &tab_screen_height, &credits);
|
||||
break;
|
||||
|
||||
case DEBUG:
|
||||
draw_debug_tab(ctx, &tab_screen_height, &main_settings, &output, &debug);
|
||||
break;
|
||||
case DEBUG:
|
||||
draw_debug_tab(ctx, &tab_screen_height, &main_settings, &output, &debug);
|
||||
break;
|
||||
|
||||
case HDHOMERUN:
|
||||
draw_hd_homerun_tab(ctx, &tab_screen_height, &hd_homerun, &main_settings);
|
||||
break;
|
||||
case HDHOMERUN:
|
||||
draw_hd_homerun_tab(ctx, &tab_screen_height, &hd_homerun, &main_settings);
|
||||
break;
|
||||
|
||||
case BURNEDSUBS:
|
||||
draw_burned_subs_tab(ctx, &tab_screen_height, &burned_subs);
|
||||
break;
|
||||
case BURNEDSUBS:
|
||||
draw_burned_subs_tab(ctx, &tab_screen_height, &burned_subs);
|
||||
break;
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
else nk_style_pop_vec2(ctx);
|
||||
else
|
||||
nk_style_pop_vec2(ctx);
|
||||
}
|
||||
|
||||
//ADVANCED MODE FLAG
|
||||
static const float ratio_adv_mode[] = { 0.75f, 0.22f, .03f };
|
||||
static const float ratio_adv_mode[] = {0.75f, 0.22f, .03f};
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 3, ratio_adv_mode);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_checkbox_label(ctx, "Advanced Mode", &advanced_mode_check);
|
||||
|
||||
//RADIO BUTTON 1
|
||||
static const float ratio_button[] = { .10f, .90f };
|
||||
static const float check_extension_ratio[] = { .10f, .53f, .12f, .15f, .10f };
|
||||
//RADIO BUTTON 1
|
||||
static const float ratio_button[] = {.10f, .90f};
|
||||
static const float check_extension_ratio[] = {.10f, .53f, .12f, .15f, .10f};
|
||||
//static int op = FILES;
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, ratio_button);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_option_label(ctx, "Extract from files below:", main_settings.port_or_files == FILES)) {
|
||||
if (nk_option_label(ctx, "Extract from files below:", main_settings.port_or_files == FILES))
|
||||
{
|
||||
//op = FILES;
|
||||
main_settings.port_or_files = FILES;
|
||||
}
|
||||
@@ -500,7 +488,7 @@ int main(void)
|
||||
nk_checkbox_label(ctx, "Check for common video file extensions", &file_extension_check);
|
||||
if (main_settings.filename_count > 0)
|
||||
{
|
||||
if(nk_button_label(ctx, "Add"))
|
||||
if (nk_button_label(ctx, "Add"))
|
||||
{
|
||||
main_settings.is_file_browser_active = nk_true;
|
||||
main_settings.scaleWindowForFileBrowser = nk_true;
|
||||
@@ -508,7 +496,8 @@ int main(void)
|
||||
|
||||
for (int i = 0; i < main_settings.filename_count; i++)
|
||||
{
|
||||
if (main_settings.is_file_selected[i]) {
|
||||
if (main_settings.is_file_selected[i])
|
||||
{
|
||||
add_remove_button = nk_true;
|
||||
break;
|
||||
}
|
||||
@@ -518,32 +507,29 @@ int main(void)
|
||||
if (add_remove_button)
|
||||
{
|
||||
|
||||
if (nk_button_label(ctx, "Remove")) {
|
||||
for (int i = main_settings.filename_count-1; i != -1; i--)
|
||||
if (main_settings.is_file_selected[i]) {
|
||||
remove_path_entry(&main_settings, i );
|
||||
if (nk_button_label(ctx, "Remove"))
|
||||
{
|
||||
for (int i = main_settings.filename_count - 1; i != -1; i--)
|
||||
if (main_settings.is_file_selected[i])
|
||||
{
|
||||
remove_path_entry(&main_settings, i);
|
||||
main_settings.is_file_selected[i] = nk_false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
if (nk_button_label(ctx, "Clear"))
|
||||
{
|
||||
free(main_settings.filenames);
|
||||
main_settings.filename_count = 0;
|
||||
}
|
||||
else if (nk_button_label(ctx, "Clear"))
|
||||
{
|
||||
free(main_settings.filenames);
|
||||
main_settings.filename_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//RECTANGLE-FILES
|
||||
static const float ratio_rect_files[] = { 0.10f,0.80f };
|
||||
static const float ratio_rect_files[] = {0.10f, 0.80f};
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 180, 2, ratio_rect_files);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_group_begin(ctx, "Files in extraction queue:", NK_WINDOW_BORDER | NK_WINDOW_TITLE ))
|
||||
if (nk_group_begin(ctx, "Files in extraction queue:", NK_WINDOW_BORDER | NK_WINDOW_TITLE))
|
||||
{
|
||||
if (main_settings.filename_count != 0)
|
||||
{
|
||||
@@ -553,7 +539,8 @@ int main(void)
|
||||
nk_selectable_label(ctx, truncate_path_string(main_settings.filenames[i]), NK_TEXT_LEFT, &main_settings.is_file_selected[i]);
|
||||
}
|
||||
|
||||
else {
|
||||
else
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 1, 1);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
@@ -568,21 +555,20 @@ int main(void)
|
||||
main_settings.scaleWindowForFileBrowser = nk_true;
|
||||
}
|
||||
nk_spacing(ctx, 1);
|
||||
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
|
||||
}
|
||||
|
||||
//RadioButton 2 along with combobox
|
||||
static const float ratio_port[] = { 0.10f,0.20f,0.20f,0.20f,0.20f,0.10f };
|
||||
//RadioButton 2 along with combobox
|
||||
static const float ratio_port[] = {0.10f, 0.20f, 0.20f, 0.20f, 0.20f, 0.10f};
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_port);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_option_label(ctx, "Extract from", main_settings.port_or_files == PORT)) {
|
||||
if (nk_option_label(ctx, "Extract from", main_settings.port_or_files == PORT))
|
||||
{
|
||||
//op = PORT;
|
||||
main_settings.port_or_files = PORT;
|
||||
}
|
||||
main_settings.port_select = nk_combo(ctx, main_settings.port_type, 2, main_settings.port_select, 20, nk_vec2(85,100));
|
||||
main_settings.port_select = nk_combo(ctx, main_settings.port_type, 2, main_settings.port_select, 20, nk_vec2(85, 100));
|
||||
nk_label(ctx, " stream, on port:", NK_TEXT_LEFT);
|
||||
|
||||
//RADDIO BUTTON 2, TEXTEDIT FOR ENTERING PORT NUMBER
|
||||
@@ -593,12 +579,12 @@ int main(void)
|
||||
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
|
||||
nk_layout_space_end(ctx);
|
||||
|
||||
//Extraction Info`rmation
|
||||
//Extraction Information
|
||||
nk_layout_row_dynamic(ctx, 10, 1);
|
||||
nk_text(ctx, "Extraction Info:", 16, NK_TEXT_CENTERED);
|
||||
|
||||
//RECTANGLE-INFO
|
||||
static const float ratio_rect_info[] = { 0.10f,0.80f,0.10f };
|
||||
static const float ratio_rect_info[] = {0.10f, 0.80f, 0.10f};
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 75, 2, ratio_rect_info);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_group_begin(ctx, "Extraction Info:", NK_WINDOW_BORDER))
|
||||
@@ -606,50 +592,42 @@ int main(void)
|
||||
if (main_settings.filename_count != 0)
|
||||
{
|
||||
nk_layout_row_static(ctx, 18, 380, 1);
|
||||
nk_label(ctx, concat("Input type: ", input.type[input.type_select]), NK_TEXT_LEFT);
|
||||
nk_label(ctx, concat("Output type: ", output.type[output.type_select]), NK_TEXT_LEFT);
|
||||
if(output.is_filename)
|
||||
nk_label(ctx, concat("Output path: ", output.filename), NK_TEXT_LEFT);
|
||||
else
|
||||
nk_label(ctx, "Output path: Default", NK_TEXT_LEFT);
|
||||
if(burned_subs.is_burned_subs)
|
||||
nk_label(ctx, "Hardsubtitles extraction: Yes", NK_TEXT_LEFT);
|
||||
else
|
||||
nk_label(ctx, "Hardsubtitles extraction: No", NK_TEXT_LEFT);
|
||||
|
||||
|
||||
nk_label(ctx, concat("Input type: ", input.type[input.type_select]), NK_TEXT_LEFT);
|
||||
nk_label(ctx, concat("Output type: ", output.type[output.type_select]), NK_TEXT_LEFT);
|
||||
if (output.is_filename)
|
||||
nk_label(ctx, concat("Output path: ", output.filename), NK_TEXT_LEFT);
|
||||
else
|
||||
nk_label(ctx, "Output path: Default", NK_TEXT_LEFT);
|
||||
if (burned_subs.is_burned_subs)
|
||||
nk_label(ctx, "Hardsubtitles extraction: Yes", NK_TEXT_LEFT);
|
||||
else
|
||||
nk_label(ctx, "Hardsubtitles extraction: No", NK_TEXT_LEFT);
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
|
||||
}
|
||||
|
||||
|
||||
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
|
||||
nk_layout_space_end(ctx);
|
||||
//PROGRESSBAR
|
||||
static const float ratio_progress[] = { 0.10f,0.03f,0.57f,0.03f,0.17f,0.10f };
|
||||
static const float ratio_progress[] = {0.10f, 0.03f, 0.57f, 0.03f, 0.17f, 0.10f};
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 6, ratio_progress);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_progress(ctx, &main_settings.progress_cursor, 101, nk_false);
|
||||
|
||||
|
||||
|
||||
//Extract Button
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_button_label(ctx, "Extract"))
|
||||
{
|
||||
|
||||
setup_and_create_thread(&main_settings, &command);
|
||||
|
||||
}
|
||||
|
||||
|
||||
nk_layout_space_begin(ctx, NK_STATIC, 10, 1);
|
||||
nk_layout_space_end(ctx);
|
||||
|
||||
//PROGRESS_DETAILS_BUTTON
|
||||
if(!show_activity_check)
|
||||
if (!show_activity_check)
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 3);
|
||||
nk_spacing(ctx, 1);
|
||||
@@ -666,14 +644,11 @@ int main(void)
|
||||
|
||||
//build command string
|
||||
command_builder(&command, &main_settings, &network_settings, &input, &advanced_input, &output, &decoders, &credits, &debug, &burned_subs);
|
||||
|
||||
|
||||
|
||||
}
|
||||
nk_end(ctx);
|
||||
|
||||
glfwGetWindowSize(win, &screenWidth, &screenHeight);
|
||||
|
||||
|
||||
if (!main_settings.scaleWindowForFileBrowser)
|
||||
{
|
||||
if (show_activity_check && show_preview_check && show_terminal_check)
|
||||
@@ -748,7 +723,7 @@ int main(void)
|
||||
{
|
||||
glfwSetWindowSize(win, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
|
||||
glfwSetWindowSizeLimits(win, WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow,
|
||||
WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
|
||||
WIDTH_mainPanelAndWindow, HEIGHT_mainPanelandWindow);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -757,7 +732,6 @@ int main(void)
|
||||
glfwSetWindowSizeLimits(win, 930, 650, 930, 650);
|
||||
}
|
||||
|
||||
|
||||
glViewport(0, 0, screenWidth, screenHeight);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
/* IMPORTANT: `nk_glfw_render` modifies some global OpenGL state
|
||||
@@ -768,19 +742,19 @@ int main(void)
|
||||
glfwSwapBuffers(win);
|
||||
}
|
||||
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.home.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.directory.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.computer.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.home.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.directory.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.computer.handle.id);
|
||||
#ifdef _WIN32
|
||||
glDeleteTextures(1, (const GLuint*)&media.icons.drives.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.drives.handle.id);
|
||||
#endif
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.desktop.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.default_file.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.text_file.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.music_file.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.font_file.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.img_file.handle.id);
|
||||
glDeleteTextures(1,(const GLuint*)&media.icons.movie_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.desktop.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.default_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.text_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.music_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.font_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.img_file.handle.id);
|
||||
glDeleteTextures(1, (const GLuint *)&media.icons.movie_file.handle.id);
|
||||
|
||||
file_browser_free(&browser);
|
||||
//free(main_settings.filenames);
|
||||
@@ -790,14 +764,13 @@ int main(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void setup_main_settings(struct main_tab *main_settings)
|
||||
{
|
||||
|
||||
|
||||
main_settings->is_check_common_extension = nk_false;
|
||||
main_settings->port_num_len = 0;
|
||||
main_settings->port_or_files = FILES;
|
||||
main_settings->port_type = (char**)malloc(2 * sizeof(char*));
|
||||
main_settings->port_type = (char **)malloc(2 * sizeof(char *));
|
||||
main_settings->port_type[0] = "UDP";
|
||||
main_settings->port_type[1] = "TCP";
|
||||
main_settings->port_select = 0;
|
||||
@@ -808,10 +781,10 @@ void setup_main_settings(struct main_tab *main_settings)
|
||||
main_settings->threadPopup = nk_false;
|
||||
}
|
||||
|
||||
char* truncate_path_string(char *filePath)
|
||||
char *truncate_path_string(char *filePath)
|
||||
{
|
||||
char* file_path = strdup(filePath);
|
||||
int i,j,z,slash_length, fileNameTruncated_index,copycount, prefix_length;
|
||||
char *file_path = strdup(filePath);
|
||||
int i, j, z, slash_length, fileNameTruncated_index, copycount, prefix_length;
|
||||
char file_name[PATH_LENGTH], *ptr_slash, fileNameTruncated[NAME_LENGTH];
|
||||
//strcpy(filePath[i], paths[i]);
|
||||
if (strlen(filePath) >= PATH_LENGTH - 1)
|
||||
@@ -838,7 +811,7 @@ char* truncate_path_string(char *filePath)
|
||||
}
|
||||
strncpy(fileNameTruncated, ptr_slash, 47);
|
||||
|
||||
strncpy(file_name, file_path , 7);
|
||||
strncpy(file_name, file_path, 7);
|
||||
file_name[7] = '.';
|
||||
file_name[8] = '.';
|
||||
file_name[9] = '.';
|
||||
@@ -849,7 +822,8 @@ char* truncate_path_string(char *filePath)
|
||||
strcpy(file_path, file_name);
|
||||
}
|
||||
|
||||
else {
|
||||
else
|
||||
{
|
||||
copycount = PATH_LENGTH - 1;
|
||||
prefix_length = copycount - slash_length - 3;
|
||||
strncpy(file_name, file_path, prefix_length);
|
||||
@@ -867,7 +841,7 @@ char* truncate_path_string(char *filePath)
|
||||
}
|
||||
return file_path;
|
||||
}
|
||||
else
|
||||
else
|
||||
return filePath;
|
||||
}
|
||||
|
||||
@@ -878,52 +852,51 @@ void remove_path_entry(struct main_tab *main_settings, int indexToRemove)
|
||||
// printf("%d ", (*array)[i]);
|
||||
//printf("\n");
|
||||
|
||||
char** temp = (char**)calloc(main_settings->filename_count, sizeof(char *)); // allocate an array with a size 1 less than the current one
|
||||
char **temp = (char **)calloc(main_settings->filename_count, sizeof(char *)); // allocate an array with a size 1 less than the current one
|
||||
|
||||
memmove(
|
||||
temp,
|
||||
main_settings->filenames,
|
||||
(indexToRemove + 1) * sizeof(char *)); // copy everything BEFORE the index
|
||||
memmove(
|
||||
temp,
|
||||
main_settings->filenames,
|
||||
(indexToRemove + 1) * sizeof(char *)); // copy everything BEFORE the index
|
||||
|
||||
memmove(
|
||||
temp + indexToRemove,
|
||||
(main_settings->filenames) + (indexToRemove + 1),
|
||||
(main_settings->filename_count - indexToRemove) * sizeof(char *)); // copy everything AFTER the index
|
||||
|
||||
free(main_settings->filenames);
|
||||
main_settings->filenames = temp;
|
||||
main_settings->filename_count--;
|
||||
main_settings->filenames[main_settings->filename_count] = NULL;
|
||||
|
||||
memmove(
|
||||
temp + indexToRemove,
|
||||
(main_settings->filenames) + (indexToRemove + 1),
|
||||
(main_settings->filename_count - indexToRemove) * sizeof(char *)); // copy everything AFTER the index
|
||||
|
||||
free(main_settings->filenames);
|
||||
main_settings->filenames = temp;
|
||||
main_settings->filename_count--;
|
||||
main_settings->filenames[main_settings->filename_count] = NULL;
|
||||
}
|
||||
|
||||
struct nk_image
|
||||
icon_load(const char *filename)
|
||||
icon_load(char icon_data[], int len)
|
||||
{
|
||||
int x,y,n;
|
||||
GLuint tex;
|
||||
unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
|
||||
if (!data) die("[SDL]: failed to load image: %s", filename);
|
||||
int x, y, n;
|
||||
GLuint tex;
|
||||
|
||||
glGenTextures(1, &tex);
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
unsigned char *data = stbi_load_from_memory(icon_data, len, &x, &y, &n, 0);
|
||||
if (!data)
|
||||
die("[SDL]: failed to load icons");
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
stbi_image_free(data);
|
||||
return nk_image_id((int)tex);
|
||||
glGenTextures(1, &tex);
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
stbi_image_free(data);
|
||||
return nk_image_id((int)tex);
|
||||
}
|
||||
|
||||
|
||||
char* concat(char* string1, char *string2)
|
||||
char *concat(char *string1, char *string2)
|
||||
{
|
||||
static char prefix[300], suffix[300];
|
||||
strcpy(prefix, string1);
|
||||
strcpy(suffix, string2);
|
||||
return strcat(prefix, suffix);
|
||||
}
|
||||
static char prefix[300], suffix[300];
|
||||
strcpy(prefix, string1);
|
||||
strcpy(suffix, string2);
|
||||
return strcat(prefix, suffix);
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#define MAX_WAIT 10
|
||||
#define PROGRESS_COMPLETE 100
|
||||
|
||||
void* extract_thread(void* extract_args)
|
||||
void *extract_thread(void *extract_args)
|
||||
{
|
||||
struct args_extract *params = (struct args_extract*)extract_args;
|
||||
struct args_extract *params = (struct args_extract *)extract_args;
|
||||
static char term_string[500];
|
||||
strcpy(term_string, params->command_string);
|
||||
strcat(term_string, " ");
|
||||
@@ -20,7 +20,7 @@ void* extract_thread(void* extract_args)
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
void* read_activity_data(void *read_args)
|
||||
void *read_activity_data(void *read_args)
|
||||
{
|
||||
puts("Inside activity thread!");
|
||||
char line[500];
|
||||
@@ -31,13 +31,13 @@ void* read_activity_data(void *read_args)
|
||||
time.tv_nsec = 10000000L;
|
||||
#endif
|
||||
int wait = 0;
|
||||
struct args_extract *read_params = (struct args_extract*)read_args;
|
||||
struct args_extract *read_params = (struct args_extract *)read_args;
|
||||
FILE *file;
|
||||
char current_input[500];
|
||||
int concat_index = 0;
|
||||
file = fopen("ccx.log", "r");
|
||||
|
||||
while(file == NULL)
|
||||
while (file == NULL)
|
||||
{
|
||||
printf("Cannot open ccx.log, trying again.\n");
|
||||
file = fopen("ccx.log", "r");
|
||||
@@ -47,20 +47,23 @@ void* read_activity_data(void *read_args)
|
||||
_sleep(10);
|
||||
#endif
|
||||
wait++;
|
||||
if(wait == MAX_WAIT)
|
||||
if (wait == MAX_WAIT)
|
||||
{
|
||||
read_params->main_threadsettings->threadPopup = nk_true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
while(!feof(file))
|
||||
while (!feof(file))
|
||||
{
|
||||
if (fgets(current_input, sizeof(current_input), file) == NULL)
|
||||
continue;
|
||||
if (concat_index == 0) {
|
||||
if (concat_index == 0)
|
||||
{
|
||||
strcpy(line, current_input);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(line, current_input);
|
||||
}
|
||||
concat_index++;
|
||||
@@ -68,26 +71,24 @@ void* read_activity_data(void *read_args)
|
||||
continue;
|
||||
|
||||
sscanf(line, "%[^\n]", buffer);
|
||||
if(read_params->main_threadsettings->activity_string_count == 0)
|
||||
if (read_params->main_threadsettings->activity_string_count == 0)
|
||||
read_params->main_threadsettings->activity_string =
|
||||
malloc(sizeof(*read_params->main_threadsettings->activity_string));
|
||||
malloc(sizeof(*read_params->main_threadsettings->activity_string));
|
||||
else
|
||||
read_params->main_threadsettings->activity_string =
|
||||
realloc(read_params->main_threadsettings->activity_string,
|
||||
(read_params->main_threadsettings->activity_string_count + 1)*sizeof(char*));
|
||||
realloc(read_params->main_threadsettings->activity_string,
|
||||
(read_params->main_threadsettings->activity_string_count + 1) * sizeof(char *));
|
||||
|
||||
read_params->main_threadsettings->activity_string[read_params->main_threadsettings->activity_string_count] = strdup(buffer);
|
||||
read_params->main_threadsettings->activity_string_count++;
|
||||
|
||||
|
||||
|
||||
memset(line, 0, sizeof(line));
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
concat_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* read_data_from_thread(void* read_args)
|
||||
void *read_data_from_thread(void *read_args)
|
||||
{
|
||||
pthread_t tid_activity;
|
||||
pthread_attr_t attr_activity;
|
||||
@@ -99,10 +100,9 @@ void* read_data_from_thread(void* read_args)
|
||||
time.tv_nsec = 10000000L;
|
||||
#endif
|
||||
|
||||
|
||||
int wait = 0;
|
||||
struct args_extract *read_params = (struct args_extract*)read_args;
|
||||
int unknown1 = 0, unknown2 = 0,progress_count = 0;
|
||||
struct args_extract *read_params = (struct args_extract *)read_args;
|
||||
int unknown1 = 0, unknown2 = 0, progress_count = 0;
|
||||
FILE *file;
|
||||
char prev_line[500];
|
||||
char line[500];
|
||||
@@ -115,12 +115,13 @@ void* read_data_from_thread(void* read_args)
|
||||
/*Setup activity thread*/
|
||||
pthread_attr_init(&attr_activity);
|
||||
int err = pthread_create(&tid_activity, &attr_activity, read_activity_data, read_params);
|
||||
if(!err)
|
||||
if (!err)
|
||||
puts("Activity Thread created");
|
||||
|
||||
file = fopen("gui_report.log", "r");
|
||||
|
||||
while (file == NULL) {
|
||||
while (file == NULL)
|
||||
{
|
||||
printf("Cannot open gui_report.log, trying again.\n");
|
||||
file = fopen("gui_report.log", "r");
|
||||
#if UNIX
|
||||
@@ -129,20 +130,23 @@ void* read_data_from_thread(void* read_args)
|
||||
_sleep(10);
|
||||
#endif
|
||||
wait++;
|
||||
if (wait >= MAX_WAIT) {
|
||||
if (wait >= MAX_WAIT)
|
||||
{
|
||||
read_params->main_threadsettings->threadPopup = nk_true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
if (fgets(current_input, sizeof(current_input), file) == NULL)
|
||||
continue;
|
||||
if (concat_index == 0) {
|
||||
if (concat_index == 0)
|
||||
{
|
||||
strcpy(line, current_input);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(line, current_input);
|
||||
}
|
||||
concat_index++;
|
||||
@@ -150,41 +154,41 @@ void* read_data_from_thread(void* read_args)
|
||||
continue;
|
||||
|
||||
progress_success = sscanf(line, "###PROGRESS#%d#%d#%d", &progress_count, &unknown1, &unknown2);
|
||||
if(progress_success == 3)
|
||||
if (progress_success == 3)
|
||||
read_params->main_threadsettings->progress_cursor = progress_count;
|
||||
subs_success1 = sscanf(line, "###SUBTITLE#%[^#]#%[^#]#%[^\n]", t_start, t_end, subtitle1);
|
||||
subs_success2 = sscanf(line, "###SUBTITLE###%[^\n]", subtitle2);
|
||||
if(subs_success1 == 3)
|
||||
if (subs_success1 == 3)
|
||||
{
|
||||
sprintf(buffer, "%s-%s: %s", t_start, t_end, subtitle1);
|
||||
if(read_params->main_threadsettings->preview_string_count == 0)
|
||||
if (read_params->main_threadsettings->preview_string_count == 0)
|
||||
read_params->main_threadsettings->preview_string =
|
||||
malloc(sizeof(*read_params->main_threadsettings->preview_string));
|
||||
malloc(sizeof(*read_params->main_threadsettings->preview_string));
|
||||
else
|
||||
read_params->main_threadsettings->preview_string =
|
||||
realloc(read_params->main_threadsettings->preview_string,
|
||||
(read_params->main_threadsettings->preview_string_count + 1)*sizeof(char*));
|
||||
realloc(read_params->main_threadsettings->preview_string,
|
||||
(read_params->main_threadsettings->preview_string_count + 1) * sizeof(char *));
|
||||
|
||||
read_params->main_threadsettings->preview_string[read_params->main_threadsettings->preview_string_count] = strdup(buffer);
|
||||
read_params->main_threadsettings->preview_string_count++;
|
||||
}
|
||||
|
||||
if(subs_success2 == 1)
|
||||
if (subs_success2 == 1)
|
||||
{
|
||||
sprintf(buffer, " %s", subtitle2);
|
||||
if(read_params->main_threadsettings->preview_string_count == 0)
|
||||
if (read_params->main_threadsettings->preview_string_count == 0)
|
||||
read_params->main_threadsettings->preview_string =
|
||||
malloc(sizeof(*read_params->main_threadsettings->preview_string));
|
||||
malloc(sizeof(*read_params->main_threadsettings->preview_string));
|
||||
else
|
||||
read_params->main_threadsettings->preview_string =
|
||||
realloc(read_params->main_threadsettings->preview_string,
|
||||
(read_params->main_threadsettings->preview_string_count + 1)*sizeof(char*));
|
||||
realloc(read_params->main_threadsettings->preview_string,
|
||||
(read_params->main_threadsettings->preview_string_count + 1) * sizeof(char *));
|
||||
|
||||
read_params->main_threadsettings->preview_string[read_params->main_threadsettings->preview_string_count] = strdup(buffer);
|
||||
read_params->main_threadsettings->preview_string_count++;
|
||||
}
|
||||
|
||||
if(progress_count == PROGRESS_COMPLETE)
|
||||
if (progress_count == PROGRESS_COMPLETE)
|
||||
break;
|
||||
memset(line, 0, sizeof(line));
|
||||
concat_index = 0;
|
||||
@@ -193,15 +197,15 @@ void* read_data_from_thread(void* read_args)
|
||||
printf("progress count:%d\n", progress_count);
|
||||
fclose(file);
|
||||
printf("File closed\n");
|
||||
for(int i = 0; i<read_params->main_threadsettings->preview_string_count; i++)
|
||||
printf("%s\n",read_params->main_threadsettings->preview_string[i]);
|
||||
for (int i = 0; i < read_params->main_threadsettings->preview_string_count; i++)
|
||||
printf("%s\n", read_params->main_threadsettings->preview_string[i]);
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
void* feed_files_for_extraction(void* file_args)
|
||||
void *feed_files_for_extraction(void *file_args)
|
||||
{
|
||||
printf("Inside feeder\n");
|
||||
|
||||
|
||||
struct args_extract *extract_params = (struct args_extract *)file_args;
|
||||
printf("count:%d\n", extract_params->main_threadsettings->filename_count);
|
||||
extract_params->command_string = extract_params->threadcommand->term_string;
|
||||
@@ -209,15 +213,14 @@ void* feed_files_for_extraction(void* file_args)
|
||||
pthread_t tid_extract, tid_read;
|
||||
pthread_attr_t attr_extract, attr_read;
|
||||
|
||||
|
||||
for(int i = 0; count != 0; i++, count--)
|
||||
for (int i = 0; count != 0; i++, count--)
|
||||
{
|
||||
pthread_t tid_extract, tid_read;
|
||||
pthread_attr_t attr_extract, attr_read;
|
||||
|
||||
pthread_attr_init(&attr_extract);
|
||||
pthread_attr_init(&attr_read);
|
||||
|
||||
|
||||
extract_params->main_threadsettings->is_file_selected[i] = nk_true;
|
||||
extract_args.file_string = extract_params->main_threadsettings->filenames[i];
|
||||
int err1 = pthread_create(&tid_extract, &attr_extract, extract_thread, extract_params);
|
||||
@@ -236,16 +239,14 @@ void* feed_files_for_extraction(void* file_args)
|
||||
|
||||
remove("gui_report.log");
|
||||
remove("ccx.log");
|
||||
|
||||
}
|
||||
printf("File feeding over\n");
|
||||
}
|
||||
|
||||
|
||||
void setup_and_create_thread(struct main_tab *main_settings, struct built_string *command)
|
||||
{
|
||||
extract_args.main_threadsettings = (struct main_tab*)main_settings;
|
||||
extract_args.threadcommand = (struct built_string*)command;
|
||||
extract_args.main_threadsettings = (struct main_tab *)main_settings;
|
||||
extract_args.threadcommand = (struct built_string *)command;
|
||||
|
||||
pthread_attr_init(&attr_launch);
|
||||
int err = pthread_create(&tid_launch, &attr_launch, feed_files_for_extraction, &extract_args);
|
||||
@@ -253,12 +254,11 @@ void setup_and_create_thread(struct main_tab *main_settings, struct built_string
|
||||
printf("Feeder created!\n");
|
||||
}
|
||||
|
||||
|
||||
/*THREAD FUNCTIONS FOR HD_HOMERUN*/
|
||||
void* find_hd_homerun_devices(void *args)
|
||||
void *find_hd_homerun_devices(void *args)
|
||||
{
|
||||
char command[300];
|
||||
extract_args.homerun_thread = (struct hd_homerun_tab*)args;
|
||||
extract_args.homerun_thread = (struct hd_homerun_tab *)args;
|
||||
int wait = 0;
|
||||
FILE *file;
|
||||
char line[200];
|
||||
@@ -271,7 +271,6 @@ void* find_hd_homerun_devices(void *args)
|
||||
time.tv_nsec = 10000000L;
|
||||
#endif
|
||||
|
||||
|
||||
#if HD_HOMERUN
|
||||
strcpy(command, "hdhomerun_config");
|
||||
#else
|
||||
@@ -280,56 +279,55 @@ void* find_hd_homerun_devices(void *args)
|
||||
strcpy(command, " discover >> homerun.log");
|
||||
system(command);
|
||||
|
||||
|
||||
file = fopen("homerun.log", "r");
|
||||
|
||||
while (file == NULL) {
|
||||
printf("Cannot open file! Trying again.\n");
|
||||
file = fopen("homerun.log", "r");
|
||||
while (file == NULL)
|
||||
{
|
||||
printf("Cannot open file! Trying again.\n");
|
||||
file = fopen("homerun.log", "r");
|
||||
#if UNIX
|
||||
nanosleep(&time, NULL);
|
||||
nanosleep(&time, NULL);
|
||||
#else
|
||||
_sleep(10);
|
||||
_sleep(10);
|
||||
#endif
|
||||
wait++;
|
||||
if (wait >= MAX_WAIT) {
|
||||
extract_args.homerun_thread->threadPopup = nk_true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
wait++;
|
||||
if (wait >= MAX_WAIT)
|
||||
{
|
||||
extract_args.homerun_thread->threadPopup = nk_true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
fgets(line, sizeof(line), file);
|
||||
device_success = sscanf(line, "hdhomerun device %[^\n]", device);
|
||||
if(feof(file))
|
||||
if (feof(file))
|
||||
break;
|
||||
if(device_success == 1)
|
||||
if (device_success == 1)
|
||||
{
|
||||
if(extract_args.homerun_thread->device_num == 0)
|
||||
if (extract_args.homerun_thread->device_num == 0)
|
||||
{
|
||||
extract_args.homerun_thread->devices = malloc(sizeof(char*));
|
||||
extract_args.homerun_thread->devices = malloc(sizeof(char *));
|
||||
extract_args.homerun_thread->devices[extract_args.homerun_thread->device_num] = strdup(device);
|
||||
extract_args.homerun_thread->device_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
extract_args.homerun_thread->devices = realloc(extract_args.homerun_thread->devices,
|
||||
(extract_args.homerun_thread->device_num + 1)*sizeof(char*));
|
||||
(extract_args.homerun_thread->device_num + 1) * sizeof(char *));
|
||||
extract_args.homerun_thread->devices[extract_args.homerun_thread->device_num] = strdup(device);
|
||||
extract_args.homerun_thread->device_num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("Find device thread finished\n");
|
||||
|
||||
printf("Find device thread finished\n");
|
||||
}
|
||||
|
||||
void* setup_hd_homerun_device(void *args)
|
||||
void *setup_hd_homerun_device(void *args)
|
||||
{
|
||||
char device[20];
|
||||
extract_args.homerun_thread = (struct hd_homerun_tab*)args;
|
||||
extract_args.homerun_thread = (struct hd_homerun_tab *)args;
|
||||
char channel_command[300];
|
||||
char program_command[300];
|
||||
char target_command[300];
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
#include "command_builder.h"
|
||||
|
||||
void command_builder(struct built_string *command,
|
||||
struct main_tab *main_settings,
|
||||
struct network_popup *network_settings,struct input_tab *input,
|
||||
struct advanced_input_tab *advanced_input,
|
||||
struct output_tab *output,
|
||||
struct decoders_tab *decoders,
|
||||
struct credits_tab *credits,
|
||||
struct debug_tab *debug,
|
||||
struct burned_subs_tab *burned_subs)
|
||||
struct main_tab *main_settings,
|
||||
struct network_popup *network_settings, struct input_tab *input,
|
||||
struct advanced_input_tab *advanced_input,
|
||||
struct output_tab *output,
|
||||
struct decoders_tab *decoders,
|
||||
struct credits_tab *credits,
|
||||
struct debug_tab *debug,
|
||||
struct burned_subs_tab *burned_subs)
|
||||
{
|
||||
static char buffer[1000];
|
||||
static char buffer[1000];
|
||||
#ifdef _WIN32
|
||||
strcpy(buffer, "ccextractorwin --gui_mode_reports");
|
||||
#else
|
||||
@@ -38,70 +38,77 @@ void command_builder(struct built_string *command,
|
||||
if (input->is_split)
|
||||
strcat(buffer, " --videoedited");
|
||||
|
||||
if (input->is_process_from) {
|
||||
if (input->is_process_from)
|
||||
{
|
||||
strcat(buffer, " -startat ");
|
||||
strcat(buffer, input->from_time_buffer);
|
||||
}
|
||||
|
||||
if (input->is_process_until) {
|
||||
|
||||
if (input->is_process_until)
|
||||
{
|
||||
strcat(buffer, " -endat ");
|
||||
strcat(buffer, input->until_time_buffer);
|
||||
}
|
||||
|
||||
switch (input->elementary_stream) {
|
||||
case AUTO_DETECT:
|
||||
break;
|
||||
case STREAM_TYPE:
|
||||
strcat(buffer, " -datastreamtype ");
|
||||
strncat(buffer, input->stream_type, input->stream_type_len);
|
||||
break;
|
||||
case STREAM_PID:
|
||||
strcat(buffer, " -datapid ");
|
||||
strncat(buffer, input->stream_pid, input->stream_pid_len);
|
||||
switch (input->elementary_stream)
|
||||
{
|
||||
case AUTO_DETECT:
|
||||
break;
|
||||
case STREAM_TYPE:
|
||||
strcat(buffer, " -datastreamtype ");
|
||||
strncat(buffer, input->stream_type, input->stream_type_len);
|
||||
break;
|
||||
case STREAM_PID:
|
||||
strcat(buffer, " -datapid ");
|
||||
strncat(buffer, input->stream_pid, input->stream_pid_len);
|
||||
}
|
||||
|
||||
if (input->is_assume_mpeg) {
|
||||
if (input->is_assume_mpeg)
|
||||
{
|
||||
strcat(buffer, " -streamtype ");
|
||||
strncat(buffer, input->mpeg_type, input->mpeg_type_len);
|
||||
}
|
||||
|
||||
if(decoders->teletext_dvb == TELETEXT)
|
||||
if (decoders->teletext_dvb == TELETEXT)
|
||||
{
|
||||
switch (input->teletext_decoder) {
|
||||
case AUTO_DECODE:
|
||||
break;
|
||||
case FORCE:
|
||||
strcat(buffer, " -teletext");
|
||||
break;
|
||||
case DISABLE:
|
||||
strcat(buffer, " -noteletext");
|
||||
switch (input->teletext_decoder)
|
||||
{
|
||||
case AUTO_DECODE:
|
||||
break;
|
||||
case FORCE:
|
||||
strcat(buffer, " -teletext");
|
||||
break;
|
||||
case DISABLE:
|
||||
strcat(buffer, " -noteletext");
|
||||
}
|
||||
|
||||
if (input->is_process_teletext_page) {
|
||||
if (input->is_process_teletext_page)
|
||||
{
|
||||
strcat(buffer, " -tpage ");
|
||||
strncat(buffer, input->teletext_page_number, input->teletext_page_numer_len);
|
||||
}
|
||||
}
|
||||
|
||||
switch (input->is_limit) {
|
||||
case NO_LIMIT:
|
||||
break;
|
||||
case LIMITED:
|
||||
strcat(buffer, " --screenfuls ");
|
||||
strcat(buffer, input->screenful_limit_buffer);
|
||||
switch (input->is_limit)
|
||||
{
|
||||
case NO_LIMIT:
|
||||
break;
|
||||
case LIMITED:
|
||||
strcat(buffer, " --screenfuls ");
|
||||
strcat(buffer, input->screenful_limit_buffer);
|
||||
}
|
||||
|
||||
switch (input->clock_input) {
|
||||
case AUTO:
|
||||
break;
|
||||
case GOP:
|
||||
strcat(buffer, " --goptime");
|
||||
break;
|
||||
case PTS:
|
||||
strcat(buffer, " --nogoptime");
|
||||
break;
|
||||
switch (input->clock_input)
|
||||
{
|
||||
case AUTO:
|
||||
break;
|
||||
case GOP:
|
||||
strcat(buffer, " --goptime");
|
||||
break;
|
||||
case PTS:
|
||||
strcat(buffer, " --nogoptime");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*Main tab and network settings*/
|
||||
@@ -109,200 +116,212 @@ void command_builder(struct built_string *command,
|
||||
{
|
||||
switch (main_settings->port_select)
|
||||
{
|
||||
case 0:
|
||||
strcat(buffer, " -udp ");
|
||||
if (!strstr(network_settings->udp_ipv4, "None")) {
|
||||
strncat(buffer, network_settings->udp_ipv4, network_settings->udp_ipv4_len);
|
||||
strcat(buffer, ":");
|
||||
}
|
||||
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
|
||||
break;
|
||||
case 1:
|
||||
strcat(buffer, " -tcp ");
|
||||
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
|
||||
if (!strstr(network_settings->tcp_pass, "None")) {
|
||||
strcat(buffer, " -tcppassword ");
|
||||
strncat(buffer, network_settings->tcp_pass, network_settings->tcp_pass_len);
|
||||
}
|
||||
if (!strstr(network_settings->tcp_desc, "None")) {
|
||||
strcat(buffer, " -tcpdesc ");
|
||||
strncat(buffer, network_settings->tcp_desc, network_settings->tcp_desc_len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 0:
|
||||
strcat(buffer, " -udp ");
|
||||
if (!strstr(network_settings->udp_ipv4, "None"))
|
||||
{
|
||||
strncat(buffer, network_settings->udp_ipv4, network_settings->udp_ipv4_len);
|
||||
strcat(buffer, ":");
|
||||
}
|
||||
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
|
||||
break;
|
||||
case 1:
|
||||
strcat(buffer, " -tcp ");
|
||||
strncat(buffer, main_settings->port_num, main_settings->port_num_len);
|
||||
if (!strstr(network_settings->tcp_pass, "None"))
|
||||
{
|
||||
strcat(buffer, " -tcppassword ");
|
||||
strncat(buffer, network_settings->tcp_pass, network_settings->tcp_pass_len);
|
||||
}
|
||||
if (!strstr(network_settings->tcp_desc, "None"))
|
||||
{
|
||||
strcat(buffer, " -tcpdesc ");
|
||||
strncat(buffer, network_settings->tcp_desc, network_settings->tcp_desc_len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (input->is_live_stream) {
|
||||
if (input->is_live_stream)
|
||||
{
|
||||
strcat(buffer, " -s ");
|
||||
strncat(buffer, input->wait_data_sec, input->wait_data_sec_len);
|
||||
}
|
||||
|
||||
if (input->is_process_from) {
|
||||
if (input->is_process_from)
|
||||
{
|
||||
strcat(buffer, " -startat ");
|
||||
strcat(buffer, input->from_time_buffer);
|
||||
}
|
||||
|
||||
if (input->is_process_until) {
|
||||
if (input->is_process_until)
|
||||
{
|
||||
strcat(buffer, " -endat ");
|
||||
strcat(buffer, input->until_time_buffer);
|
||||
}
|
||||
|
||||
switch (input->elementary_stream) {
|
||||
case AUTO_DETECT:
|
||||
break;
|
||||
case STREAM_TYPE:
|
||||
strcat(buffer, " -datastreamtype ");
|
||||
strncat(buffer, input->stream_type, input->stream_type_len);
|
||||
break;
|
||||
case STREAM_PID:
|
||||
strcat(buffer, " -datapid ");
|
||||
strncat(buffer, input->stream_pid, input->stream_pid_len);
|
||||
switch (input->elementary_stream)
|
||||
{
|
||||
case AUTO_DETECT:
|
||||
break;
|
||||
case STREAM_TYPE:
|
||||
strcat(buffer, " -datastreamtype ");
|
||||
strncat(buffer, input->stream_type, input->stream_type_len);
|
||||
break;
|
||||
case STREAM_PID:
|
||||
strcat(buffer, " -datapid ");
|
||||
strncat(buffer, input->stream_pid, input->stream_pid_len);
|
||||
}
|
||||
|
||||
if (input->is_assume_mpeg) {
|
||||
if (input->is_assume_mpeg)
|
||||
{
|
||||
strcat(buffer, " -streamtype ");
|
||||
strncat(buffer, input->mpeg_type, input->mpeg_type_len);
|
||||
}
|
||||
|
||||
switch (input->teletext_decoder) {
|
||||
case AUTO_DECODE:
|
||||
break;
|
||||
case FORCE:
|
||||
strcat(buffer, " -teletext");
|
||||
break;
|
||||
case DISABLE:
|
||||
strcat(buffer, " -noteletext");
|
||||
switch (input->teletext_decoder)
|
||||
{
|
||||
case AUTO_DECODE:
|
||||
break;
|
||||
case FORCE:
|
||||
strcat(buffer, " -teletext");
|
||||
break;
|
||||
case DISABLE:
|
||||
strcat(buffer, " -noteletext");
|
||||
}
|
||||
|
||||
if (input->is_process_teletext_page) {
|
||||
if (input->is_process_teletext_page)
|
||||
{
|
||||
strcat(buffer, " -tpage ");
|
||||
strncat(buffer, input->teletext_page_number, input->teletext_page_numer_len);
|
||||
}
|
||||
|
||||
switch (input->is_limit) {
|
||||
case NO_LIMIT:
|
||||
break;
|
||||
case LIMITED:
|
||||
strcat(buffer, " --screenfuls ");
|
||||
strcat(buffer, input->screenful_limit_buffer);
|
||||
switch (input->is_limit)
|
||||
{
|
||||
case NO_LIMIT:
|
||||
break;
|
||||
case LIMITED:
|
||||
strcat(buffer, " --screenfuls ");
|
||||
strcat(buffer, input->screenful_limit_buffer);
|
||||
}
|
||||
|
||||
switch (input->clock_input) {
|
||||
case AUTO:
|
||||
break;
|
||||
case GOP:
|
||||
strcat(buffer, " --goptime");
|
||||
break;
|
||||
case PTS:
|
||||
strcat(buffer, " --nogoptime");
|
||||
break;
|
||||
switch (input->clock_input)
|
||||
{
|
||||
case AUTO:
|
||||
break;
|
||||
case GOP:
|
||||
strcat(buffer, " --goptime");
|
||||
break;
|
||||
case PTS:
|
||||
strcat(buffer, " --nogoptime");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*ADVANCED INPUT SETTINGS*/
|
||||
if(advanced_input->is_multiple_program)
|
||||
if (advanced_input->is_multiple_program)
|
||||
{
|
||||
switch(advanced_input->multiple_program)
|
||||
switch (advanced_input->multiple_program)
|
||||
{
|
||||
case FIRST_PROG:
|
||||
strcat(buffer, " -autoprogram");
|
||||
break;
|
||||
case PROG_NUM:
|
||||
strcat(buffer, " -pn ");
|
||||
strcat(buffer, advanced_input->prog_number);
|
||||
break;
|
||||
case FIRST_PROG:
|
||||
strcat(buffer, " -autoprogram");
|
||||
break;
|
||||
case PROG_NUM:
|
||||
strcat(buffer, " -pn ");
|
||||
strcat(buffer, advanced_input->prog_number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(advanced_input->set_myth)
|
||||
switch (advanced_input->set_myth)
|
||||
{
|
||||
case AUTO_MYTH:
|
||||
break;
|
||||
case FORCE_MYTH:
|
||||
strcat(buffer, " -myth");
|
||||
break;
|
||||
case DISABLE_MYTH:
|
||||
strcat(buffer, " -nomyth");
|
||||
break;
|
||||
case AUTO_MYTH:
|
||||
break;
|
||||
case FORCE_MYTH:
|
||||
strcat(buffer, " -myth");
|
||||
break;
|
||||
case DISABLE_MYTH:
|
||||
strcat(buffer, " -nomyth");
|
||||
break;
|
||||
}
|
||||
|
||||
if(advanced_input->is_mpeg_90090)
|
||||
if (advanced_input->is_mpeg_90090)
|
||||
strcat(buffer, " -90090");
|
||||
if(advanced_input->is_padding_0000)
|
||||
if (advanced_input->is_padding_0000)
|
||||
strcat(buffer, " -fp");
|
||||
if(advanced_input->is_order_ccinfo)
|
||||
if (advanced_input->is_order_ccinfo)
|
||||
strcat(buffer, " -poc");
|
||||
if(advanced_input->is_win_bug)
|
||||
if (advanced_input->is_win_bug)
|
||||
strcat(buffer, " -wtvconvertfix");
|
||||
if(advanced_input->is_hauppage_file)
|
||||
if (advanced_input->is_hauppage_file)
|
||||
strcat(buffer, " -haup");
|
||||
if(advanced_input->is_process_mp4)
|
||||
if (advanced_input->is_process_mp4)
|
||||
strcat(buffer, " -mp4vidtrack");
|
||||
if(advanced_input->is_ignore_broadcast)
|
||||
if (advanced_input->is_ignore_broadcast)
|
||||
strcat(buffer, " -noautotimeref");
|
||||
|
||||
/*DECODERS TAB*/
|
||||
if(decoders->is_field2)
|
||||
if (decoders->is_field2)
|
||||
strcat(buffer, " -12");
|
||||
|
||||
switch(decoders->channel)
|
||||
switch (decoders->channel)
|
||||
{
|
||||
case CHANNEL_1:
|
||||
break;
|
||||
case CHANNEL_2:
|
||||
strcat(buffer, " -cc2");
|
||||
break;
|
||||
case CHANNEL_1:
|
||||
break;
|
||||
case CHANNEL_2:
|
||||
strcat(buffer, " -cc2");
|
||||
break;
|
||||
}
|
||||
|
||||
if(decoders->is_708)
|
||||
if (decoders->is_708)
|
||||
{
|
||||
strcat(buffer, " -svc ");
|
||||
strncat(buffer, decoders->services, decoders->services_len);
|
||||
}
|
||||
|
||||
switch(decoders->teletext_dvb)
|
||||
switch (decoders->teletext_dvb)
|
||||
{
|
||||
case TELETEXT:
|
||||
if(strcmp(decoders->min_distance, "2"))
|
||||
{
|
||||
strcat(buffer, " -levdistmincnt ");
|
||||
strncat(buffer, decoders->min_distance, decoders->min_distance_len);
|
||||
}
|
||||
if(strcmp(decoders->max_distance, "10"))
|
||||
{
|
||||
strcat(buffer, " -levdistmaxpct ");
|
||||
strncat(buffer, decoders->max_distance, decoders->max_distance_len);
|
||||
}
|
||||
break;
|
||||
case TELETEXT:
|
||||
if (strcmp(decoders->min_distance, "2"))
|
||||
{
|
||||
strcat(buffer, " -levdistmincnt ");
|
||||
strncat(buffer, decoders->min_distance, decoders->min_distance_len);
|
||||
}
|
||||
if (strcmp(decoders->max_distance, "10"))
|
||||
{
|
||||
strcat(buffer, " -levdistmaxpct ");
|
||||
strncat(buffer, decoders->max_distance, decoders->max_distance_len);
|
||||
}
|
||||
break;
|
||||
|
||||
case DVB:
|
||||
strcat(buffer, " -codec dvdsub");
|
||||
break;
|
||||
case DVB:
|
||||
strcat(buffer, " -codec dvdsub");
|
||||
break;
|
||||
}
|
||||
|
||||
/*CREDITS TAB*/
|
||||
if(credits->is_start_text)
|
||||
if (credits->is_start_text)
|
||||
{
|
||||
strcat(buffer, " --startcreditstext \"");
|
||||
strncat(buffer, credits->start_text, credits->start_text_len);
|
||||
strcat(buffer,"\" --startcreditsforatleast ");
|
||||
strcat(buffer, "\" --startcreditsforatleast ");
|
||||
strncat(buffer, credits->start_atleast_sec, credits->start_atleast_sec_len);
|
||||
strcat(buffer, " --startcreditsforatmost ");
|
||||
strncat(buffer, credits->start_atmost_sec, credits->start_atmost_sec_len);
|
||||
if(credits->is_before)
|
||||
if (credits->is_before)
|
||||
{
|
||||
strcat(buffer, " --startcreditsnotbefore ");
|
||||
strcat(buffer, credits->before_time_buffer);
|
||||
}
|
||||
if(credits->is_after)
|
||||
if (credits->is_after)
|
||||
{
|
||||
strcat(buffer, " --startcreditsnotafter ");
|
||||
strcat(buffer, credits->after_time_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
if(credits->is_end_text)
|
||||
if (credits->is_end_text)
|
||||
{
|
||||
strcat(buffer, " --endcreditstext \"");
|
||||
strncat(buffer, credits->end_text, credits->end_text_len);
|
||||
@@ -313,91 +332,94 @@ void command_builder(struct built_string *command,
|
||||
}
|
||||
|
||||
/*DEBUG TAB*/
|
||||
if(debug->is_elementary_stream)
|
||||
if (debug->is_elementary_stream)
|
||||
{
|
||||
strcat(buffer, " -cf ");
|
||||
strncat(buffer, debug->elementary_stream, debug->elementary_stream_len);
|
||||
}
|
||||
if(debug->is_dump_packets)
|
||||
if (debug->is_dump_packets)
|
||||
strcat(buffer, " -debug");
|
||||
if(debug->is_debug_608)
|
||||
if (debug->is_debug_608)
|
||||
strcat(buffer, " -608");
|
||||
if(debug->is_debug_708)
|
||||
if (debug->is_debug_708)
|
||||
strcat(buffer, " -708");
|
||||
if(debug->is_stamp_output)
|
||||
if (debug->is_stamp_output)
|
||||
strcat(buffer, " -goppts");
|
||||
if(debug->is_debug_analysed_vid)
|
||||
if (debug->is_debug_analysed_vid)
|
||||
strcat(buffer, " -vides");
|
||||
if(debug->is_raw_608_708)
|
||||
if (debug->is_raw_608_708)
|
||||
strcat(buffer, " -cbraw");
|
||||
if(debug->is_debug_parsed)
|
||||
if (debug->is_debug_parsed)
|
||||
strcat(buffer, " -parsedebug");
|
||||
if(!strcmp(output->type[output->type_select], "bin"))
|
||||
if (!strcmp(output->type[output->type_select], "bin"))
|
||||
{
|
||||
if(debug->is_disable_sync)
|
||||
if (debug->is_disable_sync)
|
||||
strcat(buffer, " -nosync");
|
||||
if(debug->is_no_padding)
|
||||
if (debug->is_no_padding)
|
||||
strcat(buffer, " -fullbin");
|
||||
}
|
||||
if(debug->is_debug_xds)
|
||||
if (debug->is_debug_xds)
|
||||
strcat(buffer, " -xdsdebug");
|
||||
if(debug->is_output_pat)
|
||||
if (debug->is_output_pat)
|
||||
strcat(buffer, " -parsePAT");
|
||||
if(debug->is_output_pmt)
|
||||
if (debug->is_output_pmt)
|
||||
strcat(buffer, " -parsePMT");
|
||||
if(debug->is_scan_ccdata)
|
||||
if (debug->is_scan_ccdata)
|
||||
strcat(buffer, " -investigate_packets");
|
||||
if(debug->is_output_levenshtein)
|
||||
if (debug->is_output_levenshtein)
|
||||
strcat(buffer, " -deblev");
|
||||
|
||||
/*HARD_BURNED SUBS SETTINGS*/
|
||||
if(burned_subs->is_burned_subs)
|
||||
if (burned_subs->is_burned_subs)
|
||||
{
|
||||
strcat(buffer, " -hardsubx -ocr_mode");
|
||||
switch(burned_subs->ocr_mode)
|
||||
switch (burned_subs->ocr_mode)
|
||||
{
|
||||
case FRAME_WISE:
|
||||
strcat(buffer, " frame");
|
||||
break;
|
||||
case WORD_WISE:
|
||||
strcat(buffer, " word");
|
||||
break;
|
||||
case LETTER_WISE:
|
||||
strcat(buffer, " letter");
|
||||
break;
|
||||
case FRAME_WISE:
|
||||
strcat(buffer, " frame");
|
||||
break;
|
||||
case WORD_WISE:
|
||||
strcat(buffer, " word");
|
||||
break;
|
||||
case LETTER_WISE:
|
||||
strcat(buffer, " letter");
|
||||
break;
|
||||
}
|
||||
|
||||
strcat(buffer, " -min_sub_duration ");
|
||||
strcat(buffer, burned_subs->min_duration);
|
||||
|
||||
if(!burned_subs->subs_color_select && burned_subs->color_type == PRESET)
|
||||
if (!burned_subs->subs_color_select && burned_subs->color_type == PRESET)
|
||||
sprintf(buffer, "%s -whiteness_thresh %d", buffer, burned_subs->luminance_threshold);
|
||||
|
||||
sprintf(buffer, "%s -conf_thresh %d", buffer, burned_subs->confidence_threshold);
|
||||
|
||||
if(burned_subs->is_italic)
|
||||
if (burned_subs->is_italic)
|
||||
strcat(buffer, " -detect_italics");
|
||||
}
|
||||
|
||||
//Output
|
||||
{
|
||||
strcat(buffer, " -out=");
|
||||
strcat(buffer, output->type[output->type_select]);
|
||||
if (output->is_filename) {
|
||||
strcat(buffer, " -o \"");
|
||||
strncat(buffer, output->filename, output->filename_len);
|
||||
strcat(buffer, "\"");
|
||||
}
|
||||
strcat(buffer, " -out=");
|
||||
strcat(buffer, output->type[output->type_select]);
|
||||
if (output->is_filename)
|
||||
{
|
||||
strcat(buffer, " -o \"");
|
||||
strncat(buffer, output->filename, output->filename_len);
|
||||
strcat(buffer, "\"");
|
||||
}
|
||||
|
||||
if (output->is_delay) {
|
||||
strcat(buffer, " -delay ");
|
||||
strcat(buffer, output->delay_sec_buffer);
|
||||
}
|
||||
if (output->is_delay)
|
||||
{
|
||||
strcat(buffer, " -delay ");
|
||||
strcat(buffer, output->delay_sec_buffer);
|
||||
}
|
||||
|
||||
if (output->is_export_xds)
|
||||
strcat(buffer, " -xds");
|
||||
if (output->is_export_xds)
|
||||
strcat(buffer, " -xds");
|
||||
|
||||
switch (output->encoding) {
|
||||
switch (output->encoding)
|
||||
{
|
||||
case LATIN:
|
||||
strcat(buffer, " -latin1");
|
||||
break;
|
||||
@@ -407,41 +429,43 @@ void command_builder(struct built_string *command,
|
||||
case UTF:
|
||||
strcat(buffer, " -utf8");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (output->is_bom)
|
||||
strcat(buffer, " -bom");
|
||||
else
|
||||
strcat(buffer, " -nobom");
|
||||
if (output->is_bom)
|
||||
strcat(buffer, " -bom");
|
||||
else
|
||||
strcat(buffer, " -nobom");
|
||||
|
||||
if (output->is_cap_standard)
|
||||
strcat(buffer, " --sentencecap");
|
||||
if (output->is_cap_standard)
|
||||
strcat(buffer, " --sentencecap");
|
||||
|
||||
if (output->is_cap_file) {
|
||||
strcat(buffer, " --capfile \"");
|
||||
strncat(buffer, output->cap_dictionary, output->cap_dictionary_len);
|
||||
strcat(buffer, "\"");
|
||||
}
|
||||
if (output->is_cap_file)
|
||||
{
|
||||
strcat(buffer, " --capfile \"");
|
||||
strncat(buffer, output->cap_dictionary, output->cap_dictionary_len);
|
||||
strcat(buffer, "\"");
|
||||
}
|
||||
|
||||
switch (output->line_ending)
|
||||
{
|
||||
switch (output->line_ending)
|
||||
{
|
||||
case CRLF:
|
||||
break;
|
||||
case LF:
|
||||
strcat(buffer, " -lf");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (output->is_center)
|
||||
strcat(buffer, " -trim");
|
||||
if (output->is_center)
|
||||
strcat(buffer, " -trim");
|
||||
|
||||
if (output->is_dash)
|
||||
strcat(buffer, " -autodash");
|
||||
if (output->is_dash)
|
||||
strcat(buffer, " -autodash");
|
||||
|
||||
if (output->no_typesetting)
|
||||
strcat(buffer, " --notypesetting");
|
||||
if (output->no_typesetting)
|
||||
strcat(buffer, " --notypesetting");
|
||||
|
||||
switch (output->font_color) {
|
||||
switch (output->font_color)
|
||||
{
|
||||
case NO_COLOR:
|
||||
strcat(buffer, " --nofontcolor");
|
||||
break;
|
||||
@@ -449,10 +473,10 @@ void command_builder(struct built_string *command,
|
||||
strcat(buffer, " --defaultcolor #");
|
||||
strcat(buffer, output->color_hex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (output->onetime_or_realtime)
|
||||
{
|
||||
switch (output->onetime_or_realtime)
|
||||
{
|
||||
case ONETIME:
|
||||
strcat(buffer, " --norollup");
|
||||
break;
|
||||
@@ -460,23 +484,21 @@ void command_builder(struct built_string *command,
|
||||
strcat(buffer, " -dru");
|
||||
switch (output->roll_limit_select)
|
||||
{
|
||||
case 1:
|
||||
strcat(buffer, " -ru1");
|
||||
break;
|
||||
case 2:
|
||||
strcat(buffer, " -ru2");
|
||||
break;
|
||||
case 3:
|
||||
strcat(buffer, " -ru3");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 1:
|
||||
strcat(buffer, " -ru1");
|
||||
break;
|
||||
case 2:
|
||||
strcat(buffer, " -ru2");
|
||||
break;
|
||||
case 3:
|
||||
strcat(buffer, " -ru3");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
memset(command->term_string, 0, sizeof(command->term_string));
|
||||
strncpy(command->term_string, buffer, strlen(buffer));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#ifndef STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
@@ -24,8 +24,7 @@
|
||||
#include "ccextractorGUI.h"
|
||||
#include "tabs.h"
|
||||
|
||||
void
|
||||
die(const char *fmt, ...)
|
||||
void die(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
@@ -35,36 +34,38 @@ die(const char *fmt, ...)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
char*
|
||||
file_load(const char* path, size_t* siz)
|
||||
char *
|
||||
file_load(const char *path, size_t *siz)
|
||||
{
|
||||
char *buf;
|
||||
FILE *fd = fopen(path, "rb");
|
||||
if (!fd) die("Failed to open file: %s\n", path);
|
||||
if (!fd)
|
||||
die("Failed to open file: %s\n", path);
|
||||
fseek(fd, 0, SEEK_END);
|
||||
*siz = (size_t)ftell(fd);
|
||||
fseek(fd, 0, SEEK_SET);
|
||||
buf = (char*)calloc(*siz, 1);
|
||||
buf = (char *)calloc(*siz, 1);
|
||||
fread(buf, *siz, 1, fd);
|
||||
fclose(fd);
|
||||
return buf;
|
||||
}
|
||||
|
||||
char*
|
||||
char *
|
||||
str_duplicate(const char *src)
|
||||
{
|
||||
char *ret;
|
||||
size_t len = strlen(src);
|
||||
if (!len) return 0;
|
||||
ret = (char*)malloc(len + 1);
|
||||
if (!ret) return 0;
|
||||
if (!len)
|
||||
return 0;
|
||||
ret = (char *)malloc(len + 1);
|
||||
if (!ret)
|
||||
return 0;
|
||||
memcpy(ret, src, len);
|
||||
ret[len] = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
dir_free_list(char **list, size_t size)
|
||||
void dir_free_list(char **list, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < size; ++i)
|
||||
@@ -72,7 +73,7 @@ dir_free_list(char **list, size_t size)
|
||||
free(list);
|
||||
}
|
||||
|
||||
char**
|
||||
char **
|
||||
dir_list(const char *dir, int return_subdirs, size_t *count)
|
||||
{
|
||||
size_t n = 0;
|
||||
@@ -99,13 +100,16 @@ dir_list(const char *dir, int return_subdirs, size_t *count)
|
||||
size = 0;
|
||||
|
||||
z = opendir(dir);
|
||||
if (z != none) {
|
||||
if (z != none)
|
||||
{
|
||||
int nonempty = 1;
|
||||
struct dirent *data = readdir(z);
|
||||
nonempty = (data != NULL);
|
||||
if (!nonempty) return NULL;
|
||||
if (!nonempty)
|
||||
return NULL;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
DIR *y;
|
||||
char *p;
|
||||
int is_subdir;
|
||||
@@ -115,18 +119,23 @@ dir_list(const char *dir, int return_subdirs, size_t *count)
|
||||
strncpy(buffer + n, data->d_name, MAX_PATH_LEN - n);
|
||||
y = opendir(buffer);
|
||||
is_subdir = (y != NULL);
|
||||
if (y != NULL) closedir(y);
|
||||
if (y != NULL)
|
||||
closedir(y);
|
||||
|
||||
if ((return_subdirs && is_subdir) || (!is_subdir && !return_subdirs)) {
|
||||
if (!size) {
|
||||
results = (char**)calloc(sizeof(char*), capacity);
|
||||
if ((return_subdirs && is_subdir) || (!is_subdir && !return_subdirs))
|
||||
{
|
||||
if (!size)
|
||||
{
|
||||
results = (char **)calloc(sizeof(char *), capacity);
|
||||
}
|
||||
else if (size >= capacity) {
|
||||
else if (size >= capacity)
|
||||
{
|
||||
void *old = results;
|
||||
capacity = capacity * 2;
|
||||
results = (char**)realloc(results, capacity * sizeof(char*));
|
||||
results = (char **)realloc(results, capacity * sizeof(char *));
|
||||
assert(results);
|
||||
if (!results) free(old);
|
||||
if (!results)
|
||||
free(old);
|
||||
}
|
||||
p = str_duplicate(data->d_name);
|
||||
results[size++] = p;
|
||||
@@ -134,13 +143,14 @@ dir_list(const char *dir, int return_subdirs, size_t *count)
|
||||
} while ((data = readdir(z)) != NULL);
|
||||
}
|
||||
|
||||
if (z) closedir(z);
|
||||
if (z)
|
||||
closedir(z);
|
||||
*count = size;
|
||||
return results;
|
||||
}
|
||||
|
||||
struct file_group
|
||||
FILE_GROUP(enum file_groups group, const char *name, struct nk_image *icon)
|
||||
FILE_GROUP(enum file_groups group, const char *name, struct nk_image *icon)
|
||||
{
|
||||
struct file_group fg;
|
||||
fg.group = group;
|
||||
@@ -150,7 +160,7 @@ struct file_group
|
||||
}
|
||||
|
||||
struct file
|
||||
FILE_DEF(enum file_types type, const char *suffix, enum file_groups group)
|
||||
FILE_DEF(enum file_types type, const char *suffix, enum file_groups group)
|
||||
{
|
||||
struct file fd;
|
||||
fd.type = type;
|
||||
@@ -159,8 +169,8 @@ struct file
|
||||
return fd;
|
||||
}
|
||||
|
||||
struct nk_image*
|
||||
media_icon_for_file(struct media *media, const char *file)
|
||||
struct nk_image *
|
||||
media_icon_for_file(struct media *media, const char *file)
|
||||
{
|
||||
int i = 0;
|
||||
const char *s = file;
|
||||
@@ -169,12 +179,15 @@ struct nk_image*
|
||||
memset(suffix, 0, sizeof(suffix));
|
||||
|
||||
/* extract suffix .xxx from file */
|
||||
while (*s++ != '\0') {
|
||||
while (*s++ != '\0')
|
||||
{
|
||||
if (found && i < 3)
|
||||
suffix[i++] = *s;
|
||||
|
||||
if (*s == '.') {
|
||||
if (found) {
|
||||
if (*s == '.')
|
||||
{
|
||||
if (found)
|
||||
{
|
||||
found = 0;
|
||||
break;
|
||||
}
|
||||
@@ -183,13 +196,16 @@ struct nk_image*
|
||||
}
|
||||
|
||||
/* check for all file definition of all groups for fitting suffix*/
|
||||
for (i = 0; i < FILE_MAX && found; ++i) {
|
||||
for (i = 0; i < FILE_MAX && found; ++i)
|
||||
{
|
||||
struct file *d = &media->files[i];
|
||||
{
|
||||
const char *f = d->suffix;
|
||||
s = suffix;
|
||||
while (f && *f && *s && *s == *f) {
|
||||
s++; f++;
|
||||
while (f && *f && *s && *s == *f)
|
||||
{
|
||||
s++;
|
||||
f++;
|
||||
}
|
||||
|
||||
/* found correct file definition so */
|
||||
@@ -201,8 +217,7 @@ struct nk_image*
|
||||
return &media->icons.default_file;
|
||||
}
|
||||
|
||||
void
|
||||
media_init(struct media *media)
|
||||
void media_init(struct media *media)
|
||||
{
|
||||
/* file groups */
|
||||
struct icons *icons = &media->icons;
|
||||
@@ -232,8 +247,7 @@ media_init(struct media *media)
|
||||
media->files[FILE_GIF] = FILE_DEF(FILE_GIF, "gif", FILE_GROUP_IMAGE);
|
||||
}
|
||||
|
||||
void
|
||||
file_browser_reload_directory_content(struct file_browser *browser, const char *path)
|
||||
void file_browser_reload_directory_content(struct file_browser *browser, const char *path)
|
||||
{
|
||||
strncpy(browser->directory, path, MAX_PATH_LEN);
|
||||
dir_free_list(browser->files, browser->file_count);
|
||||
@@ -243,8 +257,7 @@ file_browser_reload_directory_content(struct file_browser *browser, const char *
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void
|
||||
get_drives(struct file_browser *browser)
|
||||
void get_drives(struct file_browser *browser)
|
||||
{
|
||||
static int drive_num;
|
||||
static char drive_list[50][4];
|
||||
@@ -258,7 +271,8 @@ get_drives(struct file_browser *browser)
|
||||
{
|
||||
printf("cannot find any drives! try again with different settings/permissions");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
puts("File opened");
|
||||
while ((c = getc(file)) != EOF)
|
||||
{
|
||||
@@ -272,7 +286,6 @@ get_drives(struct file_browser *browser)
|
||||
continue;
|
||||
|
||||
prev_char = c;
|
||||
|
||||
}
|
||||
}
|
||||
printf("drive nums:%d\n", drive_num);
|
||||
@@ -280,17 +293,16 @@ get_drives(struct file_browser *browser)
|
||||
for (int i = 0; i < drive_num; i++)
|
||||
strcat(drive_list[i], ":\\");
|
||||
|
||||
|
||||
browser->drives_num = drive_num;
|
||||
browser->drives = (char**)calloc(drive_num + 1, sizeof(char*));
|
||||
browser->drives = (char **)calloc(drive_num + 1, sizeof(char *));
|
||||
for (int i = 0; i < drive_num; i++)
|
||||
{
|
||||
browser->drives[i] = (char*)calloc(strlen(drive_list[i]), sizeof(char));
|
||||
browser->drives[i] = (char *)calloc(strlen(drive_list[i]), sizeof(char));
|
||||
browser->drives[i] = strdup(drive_list[i]);
|
||||
}
|
||||
browser->drives[browser->drives_num] = NULL;
|
||||
|
||||
for (int i = 0; i< drive_num; i++)
|
||||
for (int i = 0; i < drive_num; i++)
|
||||
puts(browser->drives[i]);
|
||||
|
||||
fclose(file);
|
||||
@@ -298,8 +310,7 @@ get_drives(struct file_browser *browser)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
file_browser_init(struct file_browser *browser, struct media *media)
|
||||
void file_browser_init(struct file_browser *browser, struct media *media)
|
||||
{
|
||||
memset(browser, 0, sizeof(*browser));
|
||||
browser->media = media;
|
||||
@@ -311,9 +322,11 @@ file_browser_init(struct file_browser *browser, struct media *media)
|
||||
/* load files and sub-directory list */
|
||||
const char *home = getenv("HOME");
|
||||
#ifdef _WIN32
|
||||
if (!home) home = getenv("USERPROFILE");
|
||||
if (!home)
|
||||
home = getenv("USERPROFILE");
|
||||
#else
|
||||
if (!home) home = getpwuid(getuid());
|
||||
if (!home)
|
||||
home = getpwuid(getuid());
|
||||
#endif
|
||||
{
|
||||
size_t l;
|
||||
@@ -341,8 +354,7 @@ file_browser_init(struct file_browser *browser, struct media *media)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
file_browser_free(struct file_browser *browser)
|
||||
void file_browser_free(struct file_browser *browser)
|
||||
{
|
||||
if (browser->files)
|
||||
dir_free_list(browser->files, browser->file_count);
|
||||
@@ -353,24 +365,22 @@ file_browser_free(struct file_browser *browser)
|
||||
memset(browser, 0, sizeof(*browser));
|
||||
}
|
||||
|
||||
int
|
||||
file_browser_run(struct file_browser *browser,
|
||||
struct nk_context *ctx,
|
||||
struct main_tab *main_settings,
|
||||
struct output_tab *output,
|
||||
struct debug_tab *debug,
|
||||
struct hd_homerun_tab *hd_homerun)
|
||||
int file_browser_run(struct file_browser *browser,
|
||||
struct nk_context *ctx,
|
||||
struct main_tab *main_settings,
|
||||
struct output_tab *output,
|
||||
struct debug_tab *debug,
|
||||
struct hd_homerun_tab *hd_homerun)
|
||||
{
|
||||
static int isFileAdded = nk_false;
|
||||
int ret = 0;
|
||||
struct media *media = browser->media;
|
||||
struct nk_rect total_space;
|
||||
|
||||
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "File Browser", NK_WINDOW_CLOSABLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_MOVABLE,
|
||||
nk_rect(0, 0, 930, 650)))
|
||||
nk_rect(0, 0, 930, 650)))
|
||||
{
|
||||
static float ratio[] = { 0.25f, NK_UNDEFINED };
|
||||
static float ratio[] = {0.25f, NK_UNDEFINED};
|
||||
float spacing_x = ctx->style.window.spacing.x;
|
||||
|
||||
/* output path directory selector in the menubar */
|
||||
@@ -380,7 +390,8 @@ file_browser_run(struct file_browser *browser,
|
||||
char *d = browser->directory;
|
||||
char *begin = d + 1;
|
||||
nk_layout_row_dynamic(ctx, 25, 6);
|
||||
while (*d++) {
|
||||
while (*d++)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (*d == '\\')
|
||||
#else
|
||||
@@ -388,7 +399,8 @@ file_browser_run(struct file_browser *browser,
|
||||
#endif
|
||||
{
|
||||
*d = '\0';
|
||||
if (nk_button_label(ctx, begin)) {
|
||||
if (nk_button_label(ctx, begin))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
*d++ = '\\';
|
||||
#else
|
||||
@@ -451,100 +463,112 @@ file_browser_run(struct file_browser *browser,
|
||||
|
||||
cols = 4;
|
||||
rows = count / cols;
|
||||
for (i = 0; i <= rows; i += 1) {
|
||||
{size_t n = j + cols;
|
||||
nk_layout_row_dynamic(ctx, 135, (int)cols);
|
||||
for (; j < count && j < n; ++j) {
|
||||
/* draw one row of icons */
|
||||
if (j < browser->dir_count) {
|
||||
/* draw and execute directory buttons */
|
||||
if (nk_button_image(ctx, media->icons.directory))
|
||||
index = (int)j;
|
||||
}
|
||||
else {
|
||||
/* draw and execute files buttons */
|
||||
struct nk_image *icon;
|
||||
size_t fileIndex = ((size_t)j - browser->dir_count);
|
||||
icon = media_icon_for_file(media, browser->files[fileIndex]);
|
||||
if (nk_button_image(ctx, *icon)) {
|
||||
strncpy(browser->file, browser->directory, MAX_PATH_LEN);
|
||||
n = strlen(browser->file);
|
||||
strncpy(browser->file + n, browser->files[fileIndex], MAX_PATH_LEN - n);
|
||||
ret = 1;
|
||||
for (i = 0; i <= rows; i += 1)
|
||||
{
|
||||
{
|
||||
size_t n = j + cols;
|
||||
nk_layout_row_dynamic(ctx, 135, (int)cols);
|
||||
for (; j < count && j < n; ++j)
|
||||
{
|
||||
/* draw one row of icons */
|
||||
if (j < browser->dir_count)
|
||||
{
|
||||
/* draw and execute directory buttons */
|
||||
if (nk_button_image(ctx, media->icons.directory))
|
||||
index = (int)j;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* draw and execute files buttons */
|
||||
struct nk_image *icon;
|
||||
size_t fileIndex = ((size_t)j - browser->dir_count);
|
||||
icon = media_icon_for_file(media, browser->files[fileIndex]);
|
||||
if (nk_button_image(ctx, *icon))
|
||||
{
|
||||
strncpy(browser->file, browser->directory, MAX_PATH_LEN);
|
||||
n = strlen(browser->file);
|
||||
strncpy(browser->file + n, browser->files[fileIndex], MAX_PATH_LEN - n);
|
||||
ret = 1;
|
||||
|
||||
if (hd_homerun->is_homerun_browser_active)
|
||||
{
|
||||
hd_homerun->location_len = strlen(browser->file);
|
||||
strncpy(hd_homerun->location, browser->file, hd_homerun->location_len);
|
||||
isFileAdded = nk_true;
|
||||
hd_homerun->is_homerun_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (debug->is_debug_browser_active)
|
||||
{
|
||||
debug->elementary_stream_len = strlen(browser->file);
|
||||
strcpy(debug->elementary_stream, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
debug->is_debug_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (output->is_output_browser_active)
|
||||
{
|
||||
output->filename_len = strlen(browser->file);
|
||||
strcpy(output->filename, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
output->is_output_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (output->is_cap_browser_active)
|
||||
{
|
||||
output->cap_dictionary_len = strlen(browser->file);
|
||||
strcpy(output->cap_dictionary, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
output->is_cap_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (main_settings->is_file_browser_active)
|
||||
{
|
||||
if (main_settings->filename_count == 0)
|
||||
main_settings->filenames = (char **)calloc(2, sizeof(char *));
|
||||
else
|
||||
main_settings->filenames = (char **)realloc(main_settings->filenames, (main_settings->filename_count + 2) * sizeof(char *));
|
||||
|
||||
if (hd_homerun->is_homerun_browser_active)
|
||||
{
|
||||
hd_homerun->location_len = strlen(browser->file);
|
||||
strncpy(hd_homerun->location, browser->file, hd_homerun->location_len);
|
||||
isFileAdded = nk_true;
|
||||
hd_homerun->is_homerun_browser_active = nk_false;
|
||||
break;
|
||||
main_settings->filenames[main_settings->filename_count] = (char *)calloc((strlen(browser->file) + 5), sizeof(char));
|
||||
main_settings->filenames[main_settings->filename_count][0] = '\"';
|
||||
strcat(main_settings->filenames[main_settings->filename_count], browser->file);
|
||||
strcat(main_settings->filenames[main_settings->filename_count], "\"");
|
||||
main_settings->filename_count++;
|
||||
main_settings->filenames[main_settings->filename_count] = NULL;
|
||||
isFileAdded = nk_true;
|
||||
main_settings->is_file_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (debug->is_debug_browser_active)
|
||||
{
|
||||
debug->elementary_stream_len = strlen(browser->file);
|
||||
strcpy(debug->elementary_stream, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
debug->is_debug_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (output->is_output_browser_active)
|
||||
{
|
||||
output->filename_len = strlen(browser->file);
|
||||
strcpy(output->filename, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
output->is_output_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (output->is_cap_browser_active)
|
||||
{
|
||||
output->cap_dictionary_len = strlen(browser->file);
|
||||
strcpy(output->cap_dictionary, browser->file);
|
||||
isFileAdded = nk_true;
|
||||
output->is_cap_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
if (main_settings->is_file_browser_active)
|
||||
{
|
||||
if (main_settings->filename_count == 0)
|
||||
main_settings->filenames = (char**)calloc(2, sizeof(char*));
|
||||
else
|
||||
main_settings->filenames = (char**)realloc(main_settings->filenames, (main_settings->filename_count + 2) * sizeof(char*));
|
||||
|
||||
main_settings->filenames[main_settings->filename_count] = (char*)calloc((strlen(browser->file) + 5), sizeof(char));
|
||||
main_settings->filenames[main_settings->filename_count][0] = '\"';
|
||||
strcat(main_settings->filenames[main_settings->filename_count], browser->file);
|
||||
strcat(main_settings->filenames[main_settings->filename_count], "\"");
|
||||
main_settings->filename_count++;
|
||||
main_settings->filenames[main_settings->filename_count] = NULL;
|
||||
isFileAdded = nk_true;
|
||||
main_settings->is_file_browser_active = nk_false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}}
|
||||
{size_t n = k + cols;
|
||||
nk_layout_row_dynamic(ctx, 20, (int)cols);
|
||||
for (; k < count && k < n; k++) {
|
||||
/* draw one row of labels */
|
||||
if (k < browser->dir_count) {
|
||||
nk_label(ctx, browser->directories[k], NK_TEXT_CENTERED);
|
||||
}
|
||||
{
|
||||
size_t n = k + cols;
|
||||
nk_layout_row_dynamic(ctx, 20, (int)cols);
|
||||
for (; k < count && k < n; k++)
|
||||
{
|
||||
/* draw one row of labels */
|
||||
if (k < browser->dir_count)
|
||||
{
|
||||
nk_label(ctx, browser->directories[k], NK_TEXT_CENTERED);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t t = k - browser->dir_count;
|
||||
nk_label(ctx, browser->files[t], NK_TEXT_CENTERED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
size_t t = k - browser->dir_count;
|
||||
nk_label(ctx, browser->files[t], NK_TEXT_CENTERED);
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
if (index != -1) {
|
||||
if (index != -1)
|
||||
{
|
||||
size_t n = strlen(browser->directory);
|
||||
strncpy(browser->directory + n, browser->directories[index], MAX_PATH_LEN - n);
|
||||
n = strlen(browser->directory);
|
||||
if (n < MAX_PATH_LEN - 1) {
|
||||
if (n < MAX_PATH_LEN - 1)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
browser->directory[n] = '\\';
|
||||
#else
|
||||
@@ -555,10 +579,9 @@ file_browser_run(struct file_browser *browser,
|
||||
file_browser_reload_directory_content(browser, browser->directory);
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
|
||||
|
||||
}
|
||||
if (isFileAdded) {
|
||||
if (isFileAdded)
|
||||
{
|
||||
isFileAdded = nk_false;
|
||||
main_settings->scaleWindowForFileBrowser = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
@@ -567,9 +590,9 @@ file_browser_run(struct file_browser *browser,
|
||||
nk_popup_end(ctx);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
main_settings->scaleWindowForFileBrowser = nk_false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,6 @@ file_browser_run(struct file_browser *browser,
|
||||
struct hd_homerun_tab *hd_homerun);
|
||||
|
||||
struct nk_image
|
||||
icon_load(const char *filename);
|
||||
icon_load(char icon_data[], int len);
|
||||
|
||||
#endif
|
||||
|
||||
27786
src/GUI/icon_data.c
Normal file
@@ -24,8 +24,8 @@ void setup_network_settings(struct network_popup *network_settings)
|
||||
|
||||
void draw_network_popup(struct nk_context *ctx, struct network_popup *network_settings)
|
||||
{
|
||||
const float save_ok_ratio[] = { 0.8f,0.1f,0.1f };
|
||||
const float udp_tcp_ratio[] = { 0.45f,0.1f,0.45f };
|
||||
const float save_ok_ratio[] = {0.8f, 0.1f, 0.1f};
|
||||
const float udp_tcp_ratio[] = {0.45f, 0.1f, 0.45f};
|
||||
static char udp_ipv4_buffer[30];
|
||||
static int udp_ipv4_len[30];
|
||||
static char tcp_pass_buf[30];
|
||||
@@ -36,12 +36,12 @@ void draw_network_popup(struct nk_context *ctx, struct network_popup *network_se
|
||||
static int send_port_len[30];
|
||||
static char send_host_buf[30];
|
||||
static int send_host_len[30];
|
||||
const char network_attr[][30] = { "-udp port:", "-udp [host:]port:","-sendto host[:port]:","-tcp port:","-tcppassword password:", "-tcpdesc description:" };
|
||||
static struct nk_rect s = { 20,30,480,500 };
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Network Settings", NK_WINDOW_CLOSABLE|NK_WINDOW_NO_SCROLLBAR, s))
|
||||
const char network_attr[][30] = {"-udp port:", "-udp [host:]port:", "-sendto host[:port]:", "-tcp port:", "-tcppassword password:", "-tcpdesc description:"};
|
||||
static struct nk_rect s = {20, 30, 480, 500};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Network Settings", NK_WINDOW_CLOSABLE | NK_WINDOW_NO_SCROLLBAR, s))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 220, 1);
|
||||
if(nk_group_begin(ctx, "Receive", NK_WINDOW_TITLE ))
|
||||
if (nk_group_begin(ctx, "Receive", NK_WINDOW_TITLE))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 21, 3, udp_tcp_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
@@ -64,7 +64,7 @@ void draw_network_popup(struct nk_context *ctx, struct network_popup *network_se
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 200, 1);
|
||||
if (nk_group_begin(ctx, "Send", NK_WINDOW_TITLE ))
|
||||
if (nk_group_begin(ctx, "Send", NK_WINDOW_TITLE))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 21, 3, udp_tcp_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
@@ -82,16 +82,18 @@ void draw_network_popup(struct nk_context *ctx, struct network_popup *network_se
|
||||
/*nk_layout_row_static(ctx, 20, 200, 2);
|
||||
nk_label(ctx, network_attr[5], NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, text_buffer[5], &text_len[5], 50, nk_filter_default);*/
|
||||
|
||||
|
||||
//OK Button
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 27, 3, save_ok_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_button_label(ctx, "Save")) {
|
||||
if (nk_button_label(ctx, "Save"))
|
||||
{
|
||||
network_settings->save_network_settings = nk_true;
|
||||
network_settings->show_network_settings = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
}
|
||||
if (nk_button_label(ctx, "OK")) {
|
||||
if (nk_button_label(ctx, "OK"))
|
||||
{
|
||||
network_settings->save_network_settings = nk_false;
|
||||
network_settings->show_network_settings = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
@@ -105,7 +107,7 @@ void draw_network_popup(struct nk_context *ctx, struct network_popup *network_se
|
||||
|
||||
void draw_getting_started_popup(struct nk_context *ctx, int *show_getting_started)
|
||||
{
|
||||
static struct nk_rect s = { 20,30,480,500 };
|
||||
static struct nk_rect s = {20, 30, 480, 500};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Getting Started", NK_WINDOW_CLOSABLE, s))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 80, 1);
|
||||
@@ -118,15 +120,15 @@ void draw_getting_started_popup(struct nk_context *ctx, int *show_getting_starte
|
||||
|
||||
void draw_about_ccx_popup(struct nk_context *ctx, int *show_about_ccx, struct nk_user_font *droid_big, struct nk_user_font *droid_head)
|
||||
{
|
||||
const float ccx_ratio[] = { 0.3f,0.4f,0.3f };
|
||||
const float ok_ratio[] = { 0.9f,0.1f };
|
||||
static struct nk_rect s = { 20,30,480,500};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "About CCExtractor", NK_WINDOW_CLOSABLE|NK_WINDOW_NO_SCROLLBAR, s))
|
||||
const float ccx_ratio[] = {0.3f, 0.4f, 0.3f};
|
||||
const float ok_ratio[] = {0.9f, 0.1f};
|
||||
static struct nk_rect s = {20, 30, 480, 500};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "About CCExtractor", NK_WINDOW_CLOSABLE | NK_WINDOW_NO_SCROLLBAR, s))
|
||||
{
|
||||
nk_style_push_font(ctx, droid_big);
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 30, 3, ccx_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_label_wrap(ctx, "About CCExtractor"/*, NK_TEXT_LEFT*/);
|
||||
nk_label_wrap(ctx, "About CCExtractor" /*, NK_TEXT_LEFT*/);
|
||||
nk_style_pop_font(ctx);
|
||||
|
||||
nk_layout_row_dynamic(ctx, 390, 1);
|
||||
@@ -204,7 +206,7 @@ void draw_about_ccx_popup(struct nk_context *ctx, int *show_about_ccx, struct nk
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_label_wrap(ctx, "- Dish Network files");
|
||||
nk_layout_row_dynamic(ctx, 80, 1);
|
||||
nk_label_wrap(ctx, "Usually, if you record a TV show with your capture card and CCExtractor produces the expected result, it will work for your all recordings.If it doesn't, which means that your card uses a format CCExtractor can't handle, please contact me and we'll try to make it work.");
|
||||
nk_label_wrap(ctx, "Usually, if you record a TV show with your capture card and CCExtractor produces the expected result, it will work for your all recordings.If it doesn't, which means that your card uses a format CCExtractor can't handle, please contact me and we'll try to make it work.");
|
||||
|
||||
nk_style_push_font(ctx, droid_head);
|
||||
nk_layout_row_dynamic(ctx, 23, 1);
|
||||
@@ -230,13 +232,13 @@ void draw_about_ccx_popup(struct nk_context *ctx, int *show_about_ccx, struct nk
|
||||
nk_layout_row_dynamic(ctx, 23, 1);
|
||||
nk_label_wrap(ctx, "Send me an email: carlos@ccextractor.org");
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 27, 2, ok_ratio);
|
||||
nk_spacing(ctx,1);
|
||||
if (nk_button_label(ctx, "OK")) {
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_button_label(ctx, "OK"))
|
||||
{
|
||||
*show_about_ccx = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
}
|
||||
@@ -248,11 +250,11 @@ void draw_about_ccx_popup(struct nk_context *ctx, int *show_about_ccx, struct nk
|
||||
|
||||
void draw_progress_details_popup(struct nk_context *ctx, int *show_progress_details, struct main_tab *main_settings)
|
||||
{
|
||||
static struct nk_rect s = { 20,30,480,500 };
|
||||
static struct nk_rect s = {20, 30, 480, 500};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Progress Details of Extraction", NK_WINDOW_CLOSABLE, s))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
for( int i = 0; i < main_settings->activity_string_count; i++)
|
||||
for (int i = 0; i < main_settings->activity_string_count; i++)
|
||||
nk_label_wrap(ctx, main_settings->activity_string[i]);
|
||||
nk_popup_end(ctx);
|
||||
}
|
||||
@@ -262,15 +264,16 @@ void draw_progress_details_popup(struct nk_context *ctx, int *show_progress_deta
|
||||
|
||||
void draw_color_popup(struct nk_context *ctx, struct output_tab *output)
|
||||
{
|
||||
static struct nk_rect s = { 250,250,200,230 };
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Color Picker", NK_WINDOW_TITLE |NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, s))
|
||||
static struct nk_rect s = {250, 250, 200, 230};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "Color Picker", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER, s))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 160, 1);
|
||||
output->color_rgb = nk_color_picker(ctx, output->color_rgb, NK_RGBA);
|
||||
|
||||
|
||||
nk_layout_row_dynamic(ctx, 25, 3);
|
||||
nk_spacing(ctx, 1);
|
||||
if (nk_button_label(ctx, "OK")) {
|
||||
if (nk_button_label(ctx, "OK"))
|
||||
{
|
||||
show_color_from_picker = nk_true;
|
||||
output->color_popup = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
@@ -283,23 +286,21 @@ void draw_color_popup(struct nk_context *ctx, struct output_tab *output)
|
||||
output->color_popup = nk_false;
|
||||
}
|
||||
|
||||
|
||||
void draw_thread_popup(struct nk_context *ctx, int *show_thread_popup)
|
||||
{
|
||||
static struct nk_rect s = { 100, 100, 300, 175 };
|
||||
static const float ratio[] = { 0.85f, 0.15f };
|
||||
static struct nk_rect s = {100, 100, 300, 175};
|
||||
static const float ratio[] = {0.85f, 0.15f};
|
||||
if (nk_popup_begin(ctx, NK_POPUP_STATIC, "File Read Error",
|
||||
NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER, s))
|
||||
NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER, s))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_label(ctx, "Cannot read file.", NK_TEXT_CENTERED);
|
||||
nk_layout_row_dynamic(ctx, 60, 1);
|
||||
nk_label_wrap(ctx, "Make sure the directory isn't write protected OR you are running the program with write permissions.");
|
||||
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
if(nk_button_label(ctx, "OK"))
|
||||
if (nk_button_label(ctx, "OK"))
|
||||
{
|
||||
*show_thread_popup = nk_false;
|
||||
nk_popup_close(ctx);
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
int preview(struct nk_context *ctx, int x, int y, int width, int height, struct main_tab *main_settings)
|
||||
{
|
||||
static int i;
|
||||
if (nk_begin(ctx, "Preview", nk_rect(x, y, width, height), NK_WINDOW_TITLE|NK_WINDOW_BACKGROUND))
|
||||
if (nk_begin(ctx, "Preview", nk_rect(x, y, width, height), NK_WINDOW_TITLE | NK_WINDOW_BACKGROUND))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
for( i = 0; i < main_settings->preview_string_count; i++)
|
||||
for (i = 0; i < main_settings->preview_string_count; i++)
|
||||
nk_label_wrap(ctx, main_settings->preview_string[i]);
|
||||
|
||||
|
||||
}
|
||||
nk_end(ctx);
|
||||
return !nk_window_is_closed(ctx, "Preview");
|
||||
|
||||
@@ -4,24 +4,24 @@
|
||||
#include "popups.h"
|
||||
|
||||
void load_data(FILE *file,
|
||||
struct main_tab* main_settings,
|
||||
struct input_tab* input,
|
||||
struct advanced_input_tab* advanced_input,
|
||||
struct output_tab* output,
|
||||
struct decoders_tab* decoders,
|
||||
struct credits_tab* credits,
|
||||
struct debug_tab* debug,
|
||||
struct hd_homerun_tab* hd_homerun,
|
||||
struct burned_subs_tab* burned_subs,
|
||||
struct network_popup* network_settings)
|
||||
struct main_tab *main_settings,
|
||||
struct input_tab *input,
|
||||
struct advanced_input_tab *advanced_input,
|
||||
struct output_tab *output,
|
||||
struct decoders_tab *decoders,
|
||||
struct credits_tab *credits,
|
||||
struct debug_tab *debug,
|
||||
struct hd_homerun_tab *hd_homerun,
|
||||
struct burned_subs_tab *burned_subs,
|
||||
struct network_popup *network_settings)
|
||||
{
|
||||
int null_int,r ,g, b;
|
||||
int null_int, r, g, b;
|
||||
char null_char[260];
|
||||
|
||||
//Read main_tab data
|
||||
fscanf(file, "port_or_files:%d\n", &main_settings->port_or_files);
|
||||
fscanf(file, "port_num_len:%d\n", &main_settings->port_num_len);
|
||||
if( main_settings->port_num_len > 0)
|
||||
if (main_settings->port_num_len > 0)
|
||||
fscanf(file, "port_num:%[^\n]\n", main_settings->port_num);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -34,7 +34,7 @@ void load_data(FILE *file,
|
||||
fscanf(file, "is_split:%d\n", &input->is_split);
|
||||
fscanf(file, "is_live_stream:%d\n", &input->is_live_stream);
|
||||
fscanf(file, "wait_data_sec_len:%d\n", &input->wait_data_sec_len);
|
||||
if(input->wait_data_sec_len > 0)
|
||||
if (input->wait_data_sec_len > 0)
|
||||
fscanf(file, "wait_data_sec:%[^\n]\n", input->wait_data_sec);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -48,17 +48,17 @@ void load_data(FILE *file,
|
||||
fscanf(file, "elementary_stream:%d\n", &input->elementary_stream);
|
||||
fscanf(file, "is_assume_mpeg:%d\n", &input->is_assume_mpeg);
|
||||
fscanf(file, "stream_type_len:%d\n", &input->stream_type_len);
|
||||
if( input->stream_type_len > 0)
|
||||
if (input->stream_type_len > 0)
|
||||
fscanf(file, "stream_type:%[^\n]\n", input->stream_type);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "stream_pid_len:%d\n", &input->stream_pid_len);
|
||||
if(input->stream_pid_len > 0)
|
||||
if (input->stream_pid_len > 0)
|
||||
fscanf(file, "stream_pid:%[^\n]\n", input->stream_pid);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "mpeg_type_len:%d\n", &input->mpeg_type_len);
|
||||
if(input->mpeg_type_len > 0)
|
||||
if (input->mpeg_type_len > 0)
|
||||
fscanf(file, "mpeg_type:%[^\n]\n", input->mpeg_type);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -66,7 +66,7 @@ void load_data(FILE *file,
|
||||
fscanf(file, "teletext_decoder:%d\n", &input->teletext_decoder);
|
||||
fscanf(file, "is_process_teletext_page:%d\n", &input->is_process_teletext_page);
|
||||
fscanf(file, "teletext_page_number_len:%d\n", &input->teletext_page_numer_len);
|
||||
if(input->teletext_page_numer_len)
|
||||
if (input->teletext_page_numer_len)
|
||||
fscanf(file, "teletext_page_number:%[^\n]\n", input->teletext_page_number);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -79,7 +79,7 @@ void load_data(FILE *file,
|
||||
fscanf(file, "is_multiple_program:%d\n", &advanced_input->is_multiple_program);
|
||||
fscanf(file, "multiple_program:%d\n", &advanced_input->multiple_program);
|
||||
fscanf(file, "prog_number_len:%d\n", &advanced_input->prog_number_len);
|
||||
if(advanced_input->prog_number_len)
|
||||
if (advanced_input->prog_number_len)
|
||||
fscanf(file, "prog_number:%[^\n]\n", advanced_input->prog_number);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -97,7 +97,7 @@ void load_data(FILE *file,
|
||||
fscanf(file, "type_select:%d\n", &output->type_select);
|
||||
fscanf(file, "is_filename:%d\n", &output->is_filename);
|
||||
fscanf(file, "filename_len:%d\n", &output->filename_len);
|
||||
if(output->filename_len > 0)
|
||||
if (output->filename_len > 0)
|
||||
fscanf(file, "filename:%[^\n]\n", output->filename);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -137,24 +137,23 @@ void load_data(FILE *file,
|
||||
fscanf(file, "channel:%d\n", &decoders->channel);
|
||||
fscanf(file, "is_708:%d\n", &decoders->is_708);
|
||||
fscanf(file, "services_len:%d\n", &decoders->services_len);
|
||||
if(decoders->services_len > 0)
|
||||
if (decoders->services_len > 0)
|
||||
fscanf(file, "services:%[^\n]\n", decoders->services);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
fscanf(file, "teletext_dvb:%d\n", &decoders->teletext_dvb);
|
||||
fscanf(file, "min_distance_len:%d\n", &decoders->min_distance_len);
|
||||
if(decoders->min_distance_len > 0)
|
||||
if (decoders->min_distance_len > 0)
|
||||
fscanf(file, "min_distance:%[^\n]\n", decoders->min_distance);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "max_distance_len:%d\n", &decoders->max_distance_len);
|
||||
if(decoders->max_distance_len > 0)
|
||||
if (decoders->max_distance_len > 0)
|
||||
fscanf(file, "max_distance:%[^\n]\n", decoders->max_distance);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
|
||||
//Read credits tab data
|
||||
fscanf(file, "is_start_text:%d\n", &credits->is_start_text);
|
||||
|
||||
@@ -163,25 +162,25 @@ void load_data(FILE *file,
|
||||
fscanf(file, "before_time_buffer:%[^\n]\n", credits->before_time_buffer);
|
||||
fscanf(file, "after_time_buffer:%[^\n]\n", credits->after_time_buffer);
|
||||
fscanf(file, "start_atmost_sec_len:%d\n", &credits->start_atmost_sec_len);
|
||||
if(credits->start_atmost_sec_len > 0)
|
||||
if (credits->start_atmost_sec_len > 0)
|
||||
fscanf(file, "start_atmost_sec:%[^\n]\n", credits->start_atmost_sec);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "start_atleast_sec_len:%d\n", &credits->start_atleast_sec_len);
|
||||
if(credits->start_atleast_sec_len > 0)
|
||||
if (credits->start_atleast_sec_len > 0)
|
||||
fscanf(file, "start_atleast_sec:%[^\n]\n", credits->start_atleast_sec);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n",null_char);
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
fscanf(file, "is_end_text:%d\n", &credits->is_end_text);
|
||||
fscanf(file, "end_atmost_sec_len:%d\n", &credits->end_atmost_sec_len);
|
||||
if(credits->end_atmost_sec_len > 0)
|
||||
if (credits->end_atmost_sec_len > 0)
|
||||
fscanf(file, "end_atmost_sec:%[^\n]\n", credits->end_atmost_sec);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
fscanf(file, "end_atleast_sec_len:%d\n", &credits->end_atleast_sec_len);
|
||||
if(credits->end_atleast_sec_len > 0)
|
||||
if (credits->end_atleast_sec_len > 0)
|
||||
fscanf(file, "end_atleast_sec:%[^\n]\n", credits->end_atleast_sec);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -190,11 +189,10 @@ void load_data(FILE *file,
|
||||
fscanf(file, "end_text_len:%d\n", &credits->end_text_len);
|
||||
read_credits(file, credits);
|
||||
|
||||
|
||||
//Read debug tab data
|
||||
fscanf(file, "is_elementary_stream:%d\n", &debug->is_elementary_stream);
|
||||
fscanf(file, "elementary_stream_len:%d\n", &debug->elementary_stream_len);
|
||||
if(debug->elementary_stream_len > 0)
|
||||
if (debug->elementary_stream_len > 0)
|
||||
fscanf(file, "elementary_stream:%[^\n]\n", debug->elementary_stream);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -216,51 +214,49 @@ void load_data(FILE *file,
|
||||
|
||||
//Read HD Homerun Tab data
|
||||
fscanf(file, "location_len:%d\n", &hd_homerun->location_len);
|
||||
if(hd_homerun->location_len > 0)
|
||||
if (hd_homerun->location_len > 0)
|
||||
fscanf(file, "location:%[^\n]\n", hd_homerun->location);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "tuner_len:%d\n", &hd_homerun->tuner_len);
|
||||
if(hd_homerun->tuner_len >0)
|
||||
if (hd_homerun->tuner_len > 0)
|
||||
fscanf(file, "tuner:%[^\n]\n", hd_homerun->tuner);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "channel_len:%d\n", &hd_homerun->channel_len);
|
||||
if(hd_homerun->channel_len > 0)
|
||||
if (hd_homerun->channel_len > 0)
|
||||
fscanf(file, "channel:%[^\n]\n", hd_homerun->channel);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "program_len:%d\n", &hd_homerun->program_len);
|
||||
if(hd_homerun->program_len > 0)
|
||||
if (hd_homerun->program_len > 0)
|
||||
fscanf(file, "program:%[^\n]\n", hd_homerun->program);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "ipv4_address_len:%d\n", &hd_homerun->ipv4_address_len);
|
||||
if(hd_homerun->ipv4_address_len > 0)
|
||||
if (hd_homerun->ipv4_address_len > 0)
|
||||
fscanf(file, "ipv4_address:%[^\n]\n", hd_homerun->ipv4_address);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
fscanf(file, "port_number_len:%d\n", &hd_homerun->port_number_len);
|
||||
if(hd_homerun->port_number_len > 0)
|
||||
if (hd_homerun->port_number_len > 0)
|
||||
fscanf(file, "port_number:%[^\n]\n", hd_homerun->port_number);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
|
||||
|
||||
//Read Burned Subs tab data
|
||||
fscanf(file, "is_burnded_subs:%d\n", &burned_subs->is_burned_subs);
|
||||
fscanf(file, "color_type:%d\n", &burned_subs->color_type);
|
||||
fscanf(file, "sub_color_select:%d\n", &burned_subs->subs_color_select);
|
||||
fscanf(file, "custom_hue_len:%d\n", &burned_subs->custom_hue_len);
|
||||
if(burned_subs->custom_hue_len > 0)
|
||||
if (burned_subs->custom_hue_len > 0)
|
||||
fscanf(file, "custom_hue:%[^\n]\n", burned_subs->custom_hue);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
|
||||
fscanf(file, "ocr_mode:%d\n", &burned_subs->ocr_mode);
|
||||
fscanf(file, "min_duration_len:%d\n", &burned_subs->min_duration_len);
|
||||
if(burned_subs->min_duration_len > 0)
|
||||
if (burned_subs->min_duration_len > 0)
|
||||
fscanf(file, "min_duration:%[^\n]\n", burned_subs->min_duration);
|
||||
else
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
@@ -291,22 +287,22 @@ void load_data(FILE *file,
|
||||
else
|
||||
fscanf(file, "send_port:%[^\n]\n", null_char);
|
||||
fscanf(file, "send_host_len:%d\n", &network_settings->send_host_len);
|
||||
if(network_settings->send_host_len > 0)
|
||||
if (network_settings->send_host_len > 0)
|
||||
fscanf(file, "send_host:%[^\n]\n", network_settings->send_host);
|
||||
fscanf(file, "send_host:%[^\n]\n", null_char);
|
||||
}
|
||||
|
||||
void save_data(FILE *file,
|
||||
struct main_tab* main_settings,
|
||||
struct input_tab* input,
|
||||
struct advanced_input_tab* advanced_input,
|
||||
struct output_tab* output,
|
||||
struct decoders_tab* decoders,
|
||||
struct credits_tab* credits,
|
||||
struct debug_tab* debug,
|
||||
struct hd_homerun_tab* hd_homerun,
|
||||
struct burned_subs_tab* burned_subs,
|
||||
struct network_popup* network_settings)
|
||||
struct main_tab *main_settings,
|
||||
struct input_tab *input,
|
||||
struct advanced_input_tab *advanced_input,
|
||||
struct output_tab *output,
|
||||
struct decoders_tab *decoders,
|
||||
struct credits_tab *credits,
|
||||
struct debug_tab *debug,
|
||||
struct hd_homerun_tab *hd_homerun,
|
||||
struct burned_subs_tab *burned_subs,
|
||||
struct network_popup *network_settings)
|
||||
{
|
||||
//Write main_tab data
|
||||
fprintf(file, "port_or_files:%d\n", main_settings->port_or_files);
|
||||
@@ -401,7 +397,6 @@ void save_data(FILE *file,
|
||||
fprintf(file, "max_distance_len:%d\n", decoders->max_distance_len);
|
||||
fprintf(file, "max_distance:%s\n", decoders->max_distance);
|
||||
|
||||
|
||||
//Write credits tab data
|
||||
fprintf(file, "is_start_text:%d\n", credits->is_start_text);
|
||||
|
||||
@@ -423,7 +418,6 @@ void save_data(FILE *file,
|
||||
fprintf(file, "end_text_len:%d\n", credits->end_text_len);
|
||||
write_credits(file, credits);
|
||||
|
||||
|
||||
//Write debug tab data
|
||||
fprintf(file, "is_elementary_stream:%d\n", debug->is_elementary_stream);
|
||||
fprintf(file, "elementary_stream_len:%d\n", debug->elementary_stream_len);
|
||||
@@ -458,8 +452,6 @@ void save_data(FILE *file,
|
||||
fprintf(file, "port_number_len:%d\n", hd_homerun->port_number_len);
|
||||
fprintf(file, "port_number:%s\n", hd_homerun->port_number);
|
||||
|
||||
|
||||
|
||||
//Write Burned Subs tab data
|
||||
fprintf(file, "is_burnded_subs:%d\n", burned_subs->is_burned_subs);
|
||||
fprintf(file, "color_type:%d\n", burned_subs->color_type);
|
||||
@@ -488,56 +480,55 @@ void save_data(FILE *file,
|
||||
fprintf(file, "send_port:%s\n", network_settings->send_port);
|
||||
fprintf(file, "send_host_len:%d\n", network_settings->send_host_len);
|
||||
fprintf(file, "send_host:%s\n", network_settings->send_host);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void write_credits(FILE* file, struct credits_tab* credits)
|
||||
void write_credits(FILE *file, struct credits_tab *credits)
|
||||
{
|
||||
//Number of newlines in end_text
|
||||
static int newlines_end;
|
||||
//Number of newlines in start_text
|
||||
static int newlines_start;
|
||||
int newline_char = 10; // '\n' is 10 in ascii encoding
|
||||
for(int i = 0; i < credits->start_text_len; i++)
|
||||
for (int i = 0; i < credits->start_text_len; i++)
|
||||
{
|
||||
if(credits->start_text[i] == newline_char)
|
||||
if (credits->start_text[i] == newline_char)
|
||||
newlines_start++;
|
||||
}
|
||||
|
||||
for(int i = 0; i < credits->end_text_len; i++)
|
||||
for (int i = 0; i < credits->end_text_len; i++)
|
||||
{
|
||||
if(credits->end_text[i] == newline_char)
|
||||
if (credits->end_text[i] == newline_char)
|
||||
newlines_end++;
|
||||
}
|
||||
|
||||
fprintf(file, "start_text:%d\n", newlines_start);
|
||||
if(credits->start_text_len > 0)
|
||||
if (credits->start_text_len > 0)
|
||||
fprintf(file, "%s\n", credits->start_text);
|
||||
fprintf(file, "end_text:%d\n", newlines_end);
|
||||
if(credits->end_text_len > 0)
|
||||
if (credits->end_text_len > 0)
|
||||
fprintf(file, "%s\n", credits->end_text);
|
||||
}
|
||||
|
||||
void read_credits(FILE* file, struct credits_tab* credits)
|
||||
void read_credits(FILE *file, struct credits_tab *credits)
|
||||
{
|
||||
//Number of newlines in end_text
|
||||
static int newlines_end;
|
||||
//Number of newlines in start_text
|
||||
static int newlines_start;
|
||||
static char buffer[1000], null_char[260];
|
||||
if(credits->start_text_len == 0)
|
||||
if (credits->start_text_len == 0)
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
else
|
||||
{
|
||||
fscanf(file, "start_text:%d\n", &newlines_start);
|
||||
for(int i = 0; i != newlines_start + 1; i++)
|
||||
for (int i = 0; i != newlines_start + 1; i++)
|
||||
{
|
||||
static char line[200];
|
||||
fscanf(file, "%[^\n]\n", line);
|
||||
if(!(i == newlines_start))
|
||||
if (!(i == newlines_start))
|
||||
strcat(line, "\n");
|
||||
if(strlen(buffer) > 0)
|
||||
if (strlen(buffer) > 0)
|
||||
strcat(buffer, line);
|
||||
else
|
||||
strcpy(buffer, line);
|
||||
@@ -548,18 +539,18 @@ void read_credits(FILE* file, struct credits_tab* credits)
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
}
|
||||
|
||||
if(credits->end_text_len == 0)
|
||||
if (credits->end_text_len == 0)
|
||||
fscanf(file, "%[^\n]\n", null_char);
|
||||
else
|
||||
{
|
||||
fscanf(file, "end_text:%d\n", &newlines_end);
|
||||
for(int i = 0; i != newlines_end + 1; i++)
|
||||
for (int i = 0; i != newlines_end + 1; i++)
|
||||
{
|
||||
static char line[200];
|
||||
fscanf(file, "%[^\n]\n", line);
|
||||
if(!(i == newlines_end))
|
||||
if (!(i == newlines_end))
|
||||
strcat(line, "\n");
|
||||
if(strlen(buffer) > 0)
|
||||
if (strlen(buffer) > 0)
|
||||
strcat(buffer, line);
|
||||
else
|
||||
strcpy(buffer, line);
|
||||
@@ -567,6 +558,4 @@ void read_credits(FILE* file, struct credits_tab* credits)
|
||||
memset(credits->end_text, 0, sizeof(credits->end_text));
|
||||
strcpy(credits->end_text, buffer);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
345
src/GUI/tabs.c
@@ -36,7 +36,7 @@ void setup_output_tab(struct output_tab *output)
|
||||
//Encoding
|
||||
output->encoding = UTF;
|
||||
output->is_bom = nk_false;
|
||||
|
||||
|
||||
//Capitalization
|
||||
output->is_cap_standard = nk_false;
|
||||
output->is_cap_file = nk_false;
|
||||
@@ -55,7 +55,7 @@ void setup_output_tab(struct output_tab *output)
|
||||
//Roll-up Captions
|
||||
output->onetime_or_realtime = ONETIME;
|
||||
output->roll_limit_select = 0;
|
||||
output->roll_limit = (char**)malloc(4 * sizeof(char *));
|
||||
output->roll_limit = (char **)malloc(4 * sizeof(char *));
|
||||
output->roll_limit[0] = "No Limit";
|
||||
output->roll_limit[1] = "1 Line";
|
||||
output->roll_limit[2] = "2 Lines";
|
||||
@@ -176,14 +176,13 @@ void setup_credits_tab(struct credits_tab *credits)
|
||||
credits->end_atleast_sec_len = strlen(credits->end_atleast_sec);
|
||||
strcpy(credits->end_atmost_sec, "3");
|
||||
credits->end_atmost_sec_len = strlen(credits->end_atmost_sec);
|
||||
|
||||
}
|
||||
|
||||
void setup_hd_homerun_tab(struct hd_homerun_tab *hd_homerun)
|
||||
{
|
||||
hd_homerun->is_homerun_browser_active = nk_false;
|
||||
hd_homerun->location_len = 0;
|
||||
hd_homerun->devices = (char**)malloc(3 * sizeof(char *));
|
||||
hd_homerun->devices = (char **)malloc(3 * sizeof(char *));
|
||||
hd_homerun->device_num = 0;
|
||||
strcpy(hd_homerun->tuner, "0");
|
||||
hd_homerun->tuner_len = strlen(hd_homerun->tuner);
|
||||
@@ -194,7 +193,7 @@ void setup_hd_homerun_tab(struct hd_homerun_tab *hd_homerun)
|
||||
void setup_burned_subs_tab(struct burned_subs_tab *burned_subs)
|
||||
{
|
||||
burned_subs->is_burned_subs = nk_false;
|
||||
burned_subs->subs_color = (char**)malloc(7 * sizeof(char *));
|
||||
burned_subs->subs_color = (char **)malloc(7 * sizeof(char *));
|
||||
burned_subs->subs_color[0] = "white";
|
||||
burned_subs->subs_color[1] = "yellow";
|
||||
burned_subs->subs_color[2] = "green";
|
||||
@@ -211,21 +210,20 @@ void setup_burned_subs_tab(struct burned_subs_tab *burned_subs)
|
||||
burned_subs->is_italic = nk_false;
|
||||
}
|
||||
|
||||
|
||||
/*Tab specific functions*/
|
||||
void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input_tab *input,
|
||||
struct decoders_tab *decoders)
|
||||
struct decoders_tab *decoders)
|
||||
{
|
||||
const float screenful_limit_ratio[] = { 0.47f, 0.3f };
|
||||
const float screenful_limit_ratio[] = {0.47f, 0.3f};
|
||||
static struct time from_time, until_time;
|
||||
const float stream_type_pid_ratio[] = { 0.7f,0.3f };
|
||||
const float mpeg_type_ratio[] = { 0.7f,0.3f };
|
||||
const float teletext_page_ratio[] = { 0.75f,0.25f };
|
||||
const float stream_teletext_ratio[] = { 0.5f, 0.501f };
|
||||
const float wait_data_ratio[] = { 0.6f, 0.25f, 0.15f };
|
||||
const float gen_type_ratio[] = { 0.3f, 0.7f };
|
||||
const float gen_time_ratio[] = { 0.6f ,0.401f};
|
||||
const char *split_type[] = { "Individual Files", "Parts of same video. Cut by generic tool", "Parts of same video. Cut by video tool" };
|
||||
const float stream_type_pid_ratio[] = {0.7f, 0.3f};
|
||||
const float mpeg_type_ratio[] = {0.7f, 0.3f};
|
||||
const float teletext_page_ratio[] = {0.75f, 0.25f};
|
||||
const float stream_teletext_ratio[] = {0.5f, 0.501f};
|
||||
const float wait_data_ratio[] = {0.6f, 0.25f, 0.15f};
|
||||
const float gen_type_ratio[] = {0.3f, 0.7f};
|
||||
const float gen_time_ratio[] = {0.6f, 0.401f};
|
||||
const char *split_type[] = {"Individual Files", "Parts of same video. Cut by generic tool", "Parts of same video. Cut by video tool"};
|
||||
static int split_num;
|
||||
*tab_screen_height = 472;
|
||||
|
||||
@@ -262,7 +260,8 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
nk_checkbox_label(ctx, "Process From: (HH:MM:SS)", &input->is_process_from);
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
|
||||
if (nk_combo_begin_label(ctx, input->from_time_buffer, nk_vec2(180, 250))) {
|
||||
if (nk_combo_begin_label(ctx, input->from_time_buffer, nk_vec2(180, 250)))
|
||||
{
|
||||
sprintf(input->from_time_buffer, "%02d:%02d:%02d", from_time.hours, from_time.minutes, from_time.seconds);
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
from_time.seconds = nk_propertyi(ctx, "#Seconds:", 0, from_time.seconds, 60, 1, 1);
|
||||
@@ -271,13 +270,13 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
nk_combo_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
//Process Until
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Process Until: (HH:MM:SS)", &input->is_process_until);
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
|
||||
if (nk_combo_begin_label(ctx, input->until_time_buffer, nk_vec2(180, 250))) {
|
||||
if (nk_combo_begin_label(ctx, input->until_time_buffer, nk_vec2(180, 250)))
|
||||
{
|
||||
sprintf(input->until_time_buffer, "%02d:%02d:%02d", until_time.hours, until_time.minutes, until_time.seconds);
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
until_time.seconds = nk_propertyi(ctx, "#Seconds:", 0, until_time.seconds, 60, 1, 1);
|
||||
@@ -294,17 +293,20 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
if (nk_group_begin(ctx, "Elementary Stream", NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_TITLE | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "Auto", input->elementary_stream == AUTO_DETECT)) {
|
||||
if (nk_option_label(ctx, "Auto", input->elementary_stream == AUTO_DETECT))
|
||||
{
|
||||
input->elementary_stream = AUTO_DETECT;
|
||||
}
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, stream_type_pid_ratio);
|
||||
if (nk_option_label(ctx, "Process stream of type:", input->elementary_stream == STREAM_TYPE)) {
|
||||
if (nk_option_label(ctx, "Process stream of type:", input->elementary_stream == STREAM_TYPE))
|
||||
{
|
||||
input->elementary_stream = STREAM_TYPE;
|
||||
}
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, input->stream_type, &input->stream_type_len, 9, nk_filter_decimal);
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, stream_type_pid_ratio);
|
||||
if (nk_option_label(ctx, "Process stream with PID:", input->elementary_stream == STREAM_PID)) {
|
||||
if (nk_option_label(ctx, "Process stream with PID:", input->elementary_stream == STREAM_PID))
|
||||
{
|
||||
input->elementary_stream = STREAM_PID;
|
||||
}
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, input->stream_pid, &input->stream_pid_len, 9, nk_filter_decimal);
|
||||
@@ -313,7 +315,7 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
nk_checkbox_label(ctx, "Assume MPEG type is:", &input->is_assume_mpeg);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, input->mpeg_type, &input->mpeg_type_len, 9, nk_filter_decimal);
|
||||
|
||||
if(input->teletext_decoder == FORCE)
|
||||
if (input->teletext_decoder == FORCE)
|
||||
{
|
||||
input->elementary_stream = STREAM_PID;
|
||||
}
|
||||
@@ -323,22 +325,26 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
//Teletext Group
|
||||
if (nk_group_begin(ctx, "Teletext", NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_TITLE | NK_WINDOW_BORDER))
|
||||
{
|
||||
if(decoders->teletext_dvb == DVB){
|
||||
if (decoders->teletext_dvb == DVB)
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 40, 1);
|
||||
nk_label_colored_wrap(ctx, "Teletext is disabled in Decoders->Teletext or DVB.", nk_rgb(255, 56, 38));
|
||||
}
|
||||
else
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "Auto", input->teletext_decoder == AUTO_DECODE)) {
|
||||
if (nk_option_label(ctx, "Auto", input->teletext_decoder == AUTO_DECODE))
|
||||
{
|
||||
input->teletext_decoder = AUTO_DECODE;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if (nk_option_label(ctx, "Force Teletext decoder", input->teletext_decoder == FORCE)) {
|
||||
if (nk_option_label(ctx, "Force Teletext decoder", input->teletext_decoder == FORCE))
|
||||
{
|
||||
input->teletext_decoder = FORCE;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if (nk_option_label(ctx, "Disable Teletext decoder", input->teletext_decoder == DISABLE)) {
|
||||
if (nk_option_label(ctx, "Disable Teletext decoder", input->teletext_decoder == DISABLE))
|
||||
{
|
||||
input->teletext_decoder = DISABLE;
|
||||
}
|
||||
|
||||
@@ -350,26 +356,24 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
//Screenfuls limit group
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 95, 2, stream_teletext_ratio);
|
||||
if (nk_group_begin(ctx, "'Screenfuls' limit", NK_WINDOW_BORDER | NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
int screenful_limits = atoi(input->screenful_limit_buffer);
|
||||
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "No limit", input->is_limit == NO_LIMIT))
|
||||
{
|
||||
input->is_limit = NO_LIMIT;
|
||||
}
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, screenful_limit_ratio);
|
||||
if (nk_option_label(ctx, "Screenful Limit:", input->is_limit == LIMITED)) {
|
||||
if (nk_option_label(ctx, "Screenful Limit:", input->is_limit == LIMITED))
|
||||
{
|
||||
input->is_limit = LIMITED;
|
||||
}
|
||||
screenful_limits = nk_propertyi(ctx, "", 0, screenful_limits, 999, 1, 1);
|
||||
sprintf(input->screenful_limit_buffer, "%d", screenful_limits);
|
||||
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
@@ -382,10 +386,12 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
{
|
||||
input->clock_input = AUTO;
|
||||
}
|
||||
if (nk_option_label(ctx, "GOP", input->clock_input == GOP)) {
|
||||
if (nk_option_label(ctx, "GOP", input->clock_input == GOP))
|
||||
{
|
||||
input->clock_input = GOP;
|
||||
}
|
||||
if (nk_option_label(ctx, "PTS", input->clock_input == PTS)) {
|
||||
if (nk_option_label(ctx, "PTS", input->clock_input == PTS))
|
||||
{
|
||||
input->clock_input = PTS;
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
@@ -395,24 +401,24 @@ void draw_input_tab(struct nk_context *ctx, int *tab_screen_height, struct input
|
||||
void draw_advanced_input_tab(struct nk_context *ctx, int *tab_screen_height, struct advanced_input_tab *advanced_input)
|
||||
{
|
||||
*tab_screen_height = 472;
|
||||
const float prog_myth_ratio[] = { 0.5f, 0.5f };
|
||||
const float prog_num_ratio[] = { 0.67f, 0.03f, 0.3f };
|
||||
const float prog_myth_ratio[] = {0.5f, 0.5f};
|
||||
const float prog_num_ratio[] = {0.67f, 0.03f, 0.3f};
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 125, 2, prog_myth_ratio);
|
||||
|
||||
//Multiple Programs Group
|
||||
if(nk_group_begin(ctx, "Multiple Programs", NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_TITLE))
|
||||
if (nk_group_begin(ctx, "Multiple Programs", NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_TITLE))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_checkbox_label(ctx, "File contains multiple programs", &advanced_input->is_multiple_program);
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Process first suitable program", advanced_input->multiple_program == FIRST_PROG))
|
||||
if (nk_option_label(ctx, "Process first suitable program", advanced_input->multiple_program == FIRST_PROG))
|
||||
{
|
||||
advanced_input->multiple_program = FIRST_PROG;
|
||||
}
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, prog_num_ratio);
|
||||
if(nk_option_label(ctx, "Process program with #", advanced_input->multiple_program == PROG_NUM))
|
||||
if (nk_option_label(ctx, "Process program with #", advanced_input->multiple_program == PROG_NUM))
|
||||
{
|
||||
advanced_input->multiple_program = PROG_NUM;
|
||||
}
|
||||
@@ -423,22 +429,22 @@ void draw_advanced_input_tab(struct nk_context *ctx, int *tab_screen_height, str
|
||||
}
|
||||
|
||||
//Myth TV group
|
||||
if(nk_group_begin(ctx, "Myth TV", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Myth TV", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Auto", advanced_input->set_myth == AUTO_MYTH))
|
||||
if (nk_option_label(ctx, "Auto", advanced_input->set_myth == AUTO_MYTH))
|
||||
{
|
||||
advanced_input->set_myth = AUTO_MYTH;
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Force usage of Myth TV decoder", advanced_input->set_myth == FORCE_MYTH))
|
||||
if (nk_option_label(ctx, "Force usage of Myth TV decoder", advanced_input->set_myth == FORCE_MYTH))
|
||||
{
|
||||
advanced_input->set_myth = FORCE_MYTH;
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Disable Myth TV decoder", advanced_input->set_myth == DISABLE_MYTH))
|
||||
if (nk_option_label(ctx, "Disable Myth TV decoder", advanced_input->set_myth == DISABLE_MYTH))
|
||||
{
|
||||
advanced_input->set_myth = DISABLE_MYTH;
|
||||
}
|
||||
@@ -448,7 +454,7 @@ void draw_advanced_input_tab(struct nk_context *ctx, int *tab_screen_height, str
|
||||
|
||||
//Miscellaneous group
|
||||
nk_layout_row_dynamic(ctx, 210, 1);
|
||||
if(nk_group_begin(ctx, "Miscellaneous", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Miscellaneous", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Use 90090 as MPEG clock frequency instead of 90000 (needed for some DVDs", &advanced_input->is_mpeg_90090);
|
||||
@@ -465,36 +471,35 @@ void draw_advanced_input_tab(struct nk_context *ctx, int *tab_screen_height, str
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Ignore broadcast date info (only affects Teletext in timed transcript with -datets)", &advanced_input->is_ignore_broadcast);
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct output_tab *output, struct main_tab *main_settings)
|
||||
{
|
||||
const float roll_limit_ratio[] = { 0.55f, 0.45f };
|
||||
const float roll_limit_ratio[] = {0.55f, 0.45f};
|
||||
nk_flags active;
|
||||
static int len;
|
||||
static int cap_len;
|
||||
static int color_len = 6;
|
||||
const float gen_enc_ratio[] = { 0.701f, 0.302f };
|
||||
const float type_ratio[] = { 0.3f,0.7f };
|
||||
const float out_file_ratio[] = { 0.3f,0.53f,0.17f };
|
||||
const float cap_file_ratio[] = { 0.2f,0.63f,0.17f };
|
||||
const float delay_ratio[] = { 0.5f, 0.2f, 0.3f };
|
||||
const float color_roll_ratio[] = { 0.6f,0.401f };
|
||||
const float color_check_ratio[] = { 0.6f,0.23f,0.07f,0.1f };
|
||||
const float gen_enc_ratio[] = {0.701f, 0.302f};
|
||||
const float type_ratio[] = {0.3f, 0.7f};
|
||||
const float out_file_ratio[] = {0.3f, 0.53f, 0.17f};
|
||||
const float cap_file_ratio[] = {0.2f, 0.63f, 0.17f};
|
||||
const float delay_ratio[] = {0.5f, 0.2f, 0.3f};
|
||||
const float color_roll_ratio[] = {0.6f, 0.401f};
|
||||
const float color_check_ratio[] = {0.6f, 0.23f, 0.07f, 0.1f};
|
||||
*tab_screen_height = 472;
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 160, 2, gen_enc_ratio);
|
||||
|
||||
//General Group
|
||||
if (nk_group_begin(ctx, "General", NK_WINDOW_TITLE |NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "General", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
int delay_secs = atoi(output->delay_sec_buffer);
|
||||
//Output Type
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, type_ratio);
|
||||
nk_label(ctx, "Output Type:", NK_TEXT_LEFT);
|
||||
output->type_select = nk_combo(ctx, output->type, 13, output->type_select, 25, nk_vec2(225, 200));
|
||||
output->type_select = nk_combo(ctx, output->type, 13, output->type_select, 25, nk_vec2(225, 200));
|
||||
|
||||
//Output File
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, out_file_ratio);
|
||||
@@ -512,7 +517,7 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
delay_secs = nk_propertyi(ctx, "", 0, delay_secs, 1000, 1, 1);
|
||||
sprintf(output->delay_sec_buffer, "%d", delay_secs);
|
||||
nk_label(ctx, "seconds", NK_TEXT_LEFT);
|
||||
|
||||
|
||||
//Export XDS info
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_checkbox_label(ctx, "Export XDS information (transcripts)", &output->is_export_xds);
|
||||
@@ -520,19 +525,22 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
//Encoding Group
|
||||
if (nk_group_begin(ctx, "Encoding", NK_WINDOW_TITLE |NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Encoding", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
static int option = UTF;
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "Latin", output->encoding == LATIN)) {
|
||||
if (nk_option_label(ctx, "Latin", output->encoding == LATIN))
|
||||
{
|
||||
output->encoding = LATIN;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "Unicode", output->encoding == UNIC)) {
|
||||
if (nk_option_label(ctx, "Unicode", output->encoding == UNIC))
|
||||
{
|
||||
output->encoding = UNIC;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "UTF-8", output->encoding == UTF)) {
|
||||
if (nk_option_label(ctx, "UTF-8", output->encoding == UTF))
|
||||
{
|
||||
output->encoding = UTF;
|
||||
}
|
||||
|
||||
@@ -543,10 +551,9 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 100, 2, gen_enc_ratio);
|
||||
//Capitalization Group
|
||||
if(nk_group_begin(ctx, "Capitalization", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Capitalization", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Standard capitalization rules.", &output->is_cap_standard);
|
||||
@@ -564,14 +571,16 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
}
|
||||
|
||||
//Line Endings
|
||||
if (nk_group_begin(ctx, "Line Endings:", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR |NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Line Endings:", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "CRLF (Windows)", output->line_ending == CRLF)) {
|
||||
if (nk_option_label(ctx, "CRLF (Windows)", output->line_ending == CRLF))
|
||||
{
|
||||
output->line_ending = CRLF;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if (nk_option_label(ctx, "LF (UNIX-like)", output->line_ending == LF)) {
|
||||
if (nk_option_label(ctx, "LF (UNIX-like)", output->line_ending == LF))
|
||||
{
|
||||
output->line_ending = LF;
|
||||
}
|
||||
|
||||
@@ -588,20 +597,22 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Add dash (-) when speaker changes (for .srt)", &output->is_dash);
|
||||
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Don't add typesetting tags(bold, italic, etc.)", &output->no_typesetting);
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Don't add color information", output->font_color == NO_COLOR)) {
|
||||
if (nk_option_label(ctx, "Don't add color information", output->font_color == NO_COLOR))
|
||||
{
|
||||
output->font_color = NO_COLOR;
|
||||
}
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 4, color_check_ratio);
|
||||
if (nk_option_label(ctx, "Default color (RRGGBB)#", output->font_color == DEFAULT_COLOR)) {
|
||||
if (nk_option_label(ctx, "Default color (RRGGBB)#", output->font_color == DEFAULT_COLOR))
|
||||
{
|
||||
output->font_color = DEFAULT_COLOR;
|
||||
}
|
||||
active = nk_edit_string(ctx, NK_EDIT_FIELD|NK_EDIT_SIG_ENTER, output->color_hex, &color_len, 7, nk_filter_hex);
|
||||
active = nk_edit_string(ctx, NK_EDIT_FIELD | NK_EDIT_SIG_ENTER, output->color_hex, &color_len, 7, nk_filter_hex);
|
||||
nk_label(ctx, "or", NK_TEXT_CENTERED);
|
||||
if (nk_button_color(ctx, output->color_rgb))
|
||||
output->color_popup = nk_true;
|
||||
@@ -617,17 +628,15 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
printf("%d%d%d", output->color_rgb.r, output->color_rgb.g, output->color_rgb.b);
|
||||
}*/
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Roll-up Captions Group
|
||||
if (nk_group_begin(ctx, "Roll-up Captions", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if (nk_option_label(ctx, "Letters appear in realtime", output->onetime_or_realtime == REALTIME)) {
|
||||
if (nk_option_label(ctx, "Letters appear in realtime", output->onetime_or_realtime == REALTIME))
|
||||
{
|
||||
output->onetime_or_realtime = REALTIME;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
@@ -637,7 +646,8 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
output->roll_limit_select = nk_combo(ctx, output->roll_limit, 4, output->roll_limit_select, 25, nk_vec2(80, 80));
|
||||
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if (nk_option_label(ctx, "Letters appear line by line", output->onetime_or_realtime == ONETIME)) {
|
||||
if (nk_option_label(ctx, "Letters appear line by line", output->onetime_or_realtime == ONETIME))
|
||||
{
|
||||
output->onetime_or_realtime = ONETIME;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
@@ -645,23 +655,21 @@ void draw_output_tab(struct nk_context *ctx, int *tab_screen_height, struct outp
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct decoders_tab *decoders)
|
||||
{
|
||||
*tab_screen_height = 472;
|
||||
const float field_channel_ratio[] = { 0.5f, 0.5f };
|
||||
const float services_ratio[] = { 0.3f, 0.002f, 0.2f };
|
||||
const float min_distance_ratio[] = { 0.45f, 0.01f, 0.2f };
|
||||
const float max_distance_ratio[] = { 0.73f, 0.01f, 0.2f };
|
||||
const float field_channel_ratio[] = {0.5f, 0.5f};
|
||||
const float services_ratio[] = {0.3f, 0.002f, 0.2f};
|
||||
const float min_distance_ratio[] = {0.45f, 0.01f, 0.2f};
|
||||
const float max_distance_ratio[] = {0.73f, 0.01f, 0.2f};
|
||||
|
||||
nk_layout_row_dynamic(ctx, 160, 1);
|
||||
if(nk_group_begin(ctx, "608 Decoder", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "608 Decoder", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 85, 2, field_channel_ratio);
|
||||
if(nk_group_begin(ctx, "Field", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Field", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Extract captions from field 1", &decoders->is_field1);
|
||||
@@ -670,15 +678,15 @@ void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct de
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
if(nk_group_begin(ctx, "Channel", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Channel", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Extract captions from channel 1", decoders->channel == CHANNEL_1))
|
||||
if (nk_option_label(ctx, "Extract captions from channel 1", decoders->channel == CHANNEL_1))
|
||||
{
|
||||
decoders->channel = CHANNEL_1;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
if(nk_option_label(ctx, "Extract captions from channel 2", decoders->channel == CHANNEL_2))
|
||||
if (nk_option_label(ctx, "Extract captions from channel 2", decoders->channel == CHANNEL_2))
|
||||
{
|
||||
decoders->channel = CHANNEL_2;
|
||||
}
|
||||
@@ -687,15 +695,14 @@ void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct de
|
||||
|
||||
nk_layout_row_dynamic(ctx, 40, 1);
|
||||
nk_label_wrap(ctx, "In general, if you want English subtitles you don't need to use these options. "
|
||||
"If you want the second language (usually "
|
||||
"Spanish), you may need to try other combinations.");
|
||||
|
||||
"If you want the second language (usually "
|
||||
"Spanish), you may need to try other combinations.");
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 125, 1);
|
||||
if(nk_group_begin(ctx, "708 Decoder", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "708 Decoder", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Enable 708 Decoder", &decoders->is_708);
|
||||
@@ -704,30 +711,32 @@ void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct de
|
||||
nk_spacing(ctx, 1);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, decoders->services, &decoders->services_len, 15, nk_filter_ascii);
|
||||
nk_layout_row_dynamic(ctx, 45, 1);
|
||||
nk_label_wrap(ctx, "The service list is a comma seperated list of services to process. "
|
||||
"Valid values: 1 to 63. Ranges are NOT supported.");
|
||||
nk_label_wrap(ctx, "The service list is a comma separated list of services to process. "
|
||||
"Valid values: 1 to 63. Ranges are NOT supported.");
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 63, 1);
|
||||
if(nk_group_begin(ctx, "Teletext or DVB (if both are present)", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Teletext or DVB (if both are present)", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx,20, 2);
|
||||
if(nk_option_label(ctx, "Teletext", decoders->teletext_dvb == TELETEXT)){
|
||||
nk_layout_row_dynamic(ctx, 20, 2);
|
||||
if (nk_option_label(ctx, "Teletext", decoders->teletext_dvb == TELETEXT))
|
||||
{
|
||||
decoders->teletext_dvb = TELETEXT;
|
||||
}
|
||||
if(nk_option_label(ctx, "DVB", decoders->teletext_dvb == DVB)){
|
||||
if (nk_option_label(ctx, "DVB", decoders->teletext_dvb == DVB))
|
||||
{
|
||||
decoders->teletext_dvb = DVB;
|
||||
}
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
if(decoders->teletext_dvb == TELETEXT)
|
||||
if (decoders->teletext_dvb == TELETEXT)
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 95, 1);
|
||||
if(nk_group_begin(ctx, "Teletext line duplication", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Teletext line duplication", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, min_distance_ratio);
|
||||
nk_label(ctx, "Minimum allowed distance (default 2)", NK_TEXT_LEFT);
|
||||
@@ -738,7 +747,6 @@ void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct de
|
||||
nk_spacing(ctx, 1);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, decoders->max_distance, &decoders->max_distance_len, 3, nk_filter_decimal);
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
}
|
||||
@@ -747,14 +755,14 @@ void draw_decoders_tab(struct nk_context *ctx, int *tab_screen_height, struct de
|
||||
void draw_credits_tab(struct nk_context *ctx, int *tab_screen_height, struct credits_tab *credits)
|
||||
{
|
||||
static struct time before_time, after_time;
|
||||
const float start_time_ratio[] = { 0.005f, 0.26f, 0.18f, 0.1f, 0.25f, 0.18f };
|
||||
const float atleast_atmost_ratio[] = { 0.005f, 0.28, 0.1f, 0.36f, 0.1f, 0.1f };
|
||||
const float start_time_ratio[] = {0.005f, 0.26f, 0.18f, 0.1f, 0.25f, 0.18f};
|
||||
const float atleast_atmost_ratio[] = {0.005f, 0.28, 0.1f, 0.36f, 0.1f, 0.1f};
|
||||
static int start_atleast_int, start_atmost_int;
|
||||
*tab_screen_height = 472;
|
||||
|
||||
//Start Credits Group
|
||||
nk_layout_row_dynamic(ctx, 210, 1);
|
||||
if(nk_group_begin(ctx, "Start Credits", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "Start Credits", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Enable, write below text as soon as possible.", &credits->is_start_text);
|
||||
@@ -766,8 +774,8 @@ void draw_credits_tab(struct nk_context *ctx, int *tab_screen_height, struct cre
|
||||
nk_spacing(ctx, 1);
|
||||
nk_checkbox_label(ctx, "Before (MM:SS)", &credits->is_before);
|
||||
|
||||
|
||||
if (nk_combo_begin_label(ctx, credits->before_time_buffer, nk_vec2(100, 100))) {
|
||||
if (nk_combo_begin_label(ctx, credits->before_time_buffer, nk_vec2(100, 100)))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
sprintf(credits->before_time_buffer, "%02d:%02d", before_time.minutes, before_time.seconds);
|
||||
before_time.seconds = nk_propertyi(ctx, "#S:", 0, before_time.seconds, 60, 1, 1);
|
||||
@@ -779,8 +787,8 @@ void draw_credits_tab(struct nk_context *ctx, int *tab_screen_height, struct cre
|
||||
|
||||
nk_checkbox_label(ctx, "After (MM:SS)", &credits->is_after);
|
||||
|
||||
|
||||
if (nk_combo_begin_label(ctx, credits->after_time_buffer, nk_vec2(100, 100))) {
|
||||
if (nk_combo_begin_label(ctx, credits->after_time_buffer, nk_vec2(100, 100)))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
sprintf(credits->after_time_buffer, "%02d:%02d", after_time.minutes, after_time.seconds);
|
||||
after_time.seconds = nk_propertyi(ctx, "#S:", 0, after_time.seconds, 60, 1, 1);
|
||||
@@ -801,13 +809,13 @@ void draw_credits_tab(struct nk_context *ctx, int *tab_screen_height, struct cre
|
||||
|
||||
//End Credits Group
|
||||
nk_layout_row_dynamic(ctx, 180, 1);
|
||||
if(nk_group_begin(ctx, "End Credits", NK_WINDOW_TITLE|NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR))
|
||||
if (nk_group_begin(ctx, "End Credits", NK_WINDOW_TITLE | NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_checkbox_label(ctx, "Enable, write below text after last caption and as close as possible to video end.", &credits->is_end_text);
|
||||
nk_layout_row_dynamic(ctx, 85, 1);
|
||||
nk_edit_string(ctx, NK_EDIT_BOX, credits->end_text, &credits->end_text_len, 1000, nk_filter_ascii);
|
||||
nk_layout_row(ctx,NK_DYNAMIC, 25, 6, atleast_atmost_ratio);
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 6, atleast_atmost_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_label(ctx, "Display credits at least", NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, credits->end_atleast_sec, &credits->end_atleast_sec_len, 3, nk_filter_decimal);
|
||||
@@ -820,18 +828,18 @@ void draw_credits_tab(struct nk_context *ctx, int *tab_screen_height, struct cre
|
||||
}
|
||||
|
||||
void draw_debug_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
struct main_tab *main_settings,
|
||||
struct output_tab *output,
|
||||
struct debug_tab *debug)
|
||||
struct main_tab *main_settings,
|
||||
struct output_tab *output,
|
||||
struct debug_tab *debug)
|
||||
{
|
||||
*tab_screen_height = 472;
|
||||
const float stream_ratio[] = { 0.45f, 0.45f, 0.1f };
|
||||
const float stream_ratio[] = {0.45f, 0.45f, 0.1f};
|
||||
nk_layout_row_dynamic(ctx, 4, 1);
|
||||
nk_spacing(ctx, 1);
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, stream_ratio);
|
||||
nk_checkbox_label(ctx, "Write elementary stream to this file", &debug->is_elementary_stream);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, debug->elementary_stream, &debug->elementary_stream_len, 260, nk_filter_ascii);
|
||||
if(nk_button_label(ctx, "Browse"))
|
||||
if (nk_button_label(ctx, "Browse"))
|
||||
{
|
||||
debug->is_debug_browser_active = nk_true;
|
||||
main_settings->scaleWindowForFileBrowser = nk_true;
|
||||
@@ -858,14 +866,13 @@ void draw_debug_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_checkbox_label(ctx, "Print debug info for parse container files (only for ASF files at the moment).", &debug->is_debug_parsed);
|
||||
|
||||
if(!(strcmp(output->type[output->type_select], "bin")))
|
||||
if (!(strcmp(output->type[output->type_select], "bin")))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_checkbox_label(ctx, "Disable sync code when there's a timeline gap.", &debug->is_disable_sync);
|
||||
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
nk_checkbox_label(ctx, "Don't remove trailing padding blocks.", &debug->is_no_padding);
|
||||
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
@@ -885,19 +892,19 @@ void draw_debug_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
}
|
||||
|
||||
void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
struct hd_homerun_tab *hd_homerun,
|
||||
struct main_tab *main_settings)
|
||||
struct hd_homerun_tab *hd_homerun,
|
||||
struct main_tab *main_settings)
|
||||
{
|
||||
*tab_screen_height = 472;
|
||||
int setup_device = nk_false;
|
||||
const float location_ratio[] = { 0.35f, 0.5f, 0.15f };
|
||||
const float devices_ratio[] = { 0.8f, 0.2f };
|
||||
const float tuner_ratio[] = { .35f, 0.4f, 0.13 };
|
||||
const float channel_ratio[] = { 0.35f, 0.4f };
|
||||
const float program_ratio[] = { 0.35f, 0.4f };
|
||||
const float done_ratio[] = { 0.45f, 0.1f };
|
||||
const float ipv4_ratio[] = { 0.35f, 0.4f};
|
||||
const float port_ratio[] = { 0.35f, 0.4f };
|
||||
const float location_ratio[] = {0.35f, 0.5f, 0.15f};
|
||||
const float devices_ratio[] = {0.8f, 0.2f};
|
||||
const float tuner_ratio[] = {.35f, 0.4f, 0.13};
|
||||
const float channel_ratio[] = {0.35f, 0.4f};
|
||||
const float program_ratio[] = {0.35f, 0.4f};
|
||||
const float done_ratio[] = {0.45f, 0.1f};
|
||||
const float ipv4_ratio[] = {0.35f, 0.4f};
|
||||
const float port_ratio[] = {0.35f, 0.4f};
|
||||
static int before_selected, after_selected;
|
||||
static int done = nk_false;
|
||||
#if HD_HOMERUN
|
||||
@@ -907,21 +914,21 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, location_ratio);
|
||||
nk_label(ctx, "'hdhomerun_config' utility*:", NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, hd_homerun->location, &hd_homerun->location_len, 260, nk_filter_ascii);
|
||||
if(nk_button_label(ctx, "Browse"))
|
||||
if (nk_button_label(ctx, "Browse"))
|
||||
{
|
||||
hd_homerun->is_homerun_browser_active = nk_true;
|
||||
main_settings->scaleWindowForFileBrowser = nk_true;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 40, 1);
|
||||
nk_label_wrap(ctx, "*Absolute location of 'hdhomerun_config' executable. Displaying this message means "
|
||||
"either utility is not installed or environment variables aren't set for proper detection.");
|
||||
"either utility is not installed or environment variables aren't set for proper detection.");
|
||||
|
||||
#endif
|
||||
nk_layout_row_dynamic(ctx, 120, 1);
|
||||
if(nk_group_begin(ctx, "Choose a device:", NK_WINDOW_TITLE|NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Choose a device:", NK_WINDOW_TITLE | NK_WINDOW_BORDER))
|
||||
{
|
||||
|
||||
if(hd_homerun->device_num == 0)
|
||||
if (hd_homerun->device_num == 0)
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_label_wrap(ctx, "No devices found, yet. Please check your settings and try again.");
|
||||
@@ -929,22 +936,22 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
else
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
for(int i = 0; i < hd_homerun->device_num; i++)
|
||||
for (int i = 0; i < hd_homerun->device_num; i++)
|
||||
{
|
||||
nk_selectable_label(ctx, hd_homerun->devices[i], NK_TEXT_LEFT, &hd_homerun->device_select[i]);
|
||||
if(hd_homerun->device_select[i])
|
||||
if (hd_homerun->device_select[i])
|
||||
{
|
||||
before_selected = i - 1;
|
||||
after_selected = i + 1;
|
||||
for( int j = 0; j <= before_selected; j++)
|
||||
for (int j = 0; j <= before_selected; j++)
|
||||
hd_homerun->device_select[j] = nk_false;
|
||||
for(int j = after_selected; j < hd_homerun->device_num; j++)
|
||||
for (int j = after_selected; j < hd_homerun->device_num; j++)
|
||||
hd_homerun->device_select[j] = nk_false;
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < hd_homerun->device_num; i++)
|
||||
for (int i = 0; i < hd_homerun->device_num; i++)
|
||||
{
|
||||
if(hd_homerun->device_select[i] == nk_true)
|
||||
if (hd_homerun->device_select[i] == nk_true)
|
||||
{
|
||||
hd_homerun->selected = i;
|
||||
break;
|
||||
@@ -954,24 +961,22 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, devices_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
if(hd_homerun->selected == -1)
|
||||
if (hd_homerun->selected == -1)
|
||||
{
|
||||
if(nk_button_label(ctx, "Find Devices"))
|
||||
if (nk_button_label(ctx, "Find Devices"))
|
||||
{
|
||||
pthread_attr_init(&attr_find);
|
||||
|
||||
int err = pthread_create(&tid_find, &attr_find, find_hd_homerun_devices, hd_homerun);
|
||||
if(!err)
|
||||
if (!err)
|
||||
printf("Find Device thread created!\n");
|
||||
|
||||
}
|
||||
}
|
||||
if(hd_homerun->selected != -1 && done == nk_false)
|
||||
if (hd_homerun->selected != -1 && done == nk_false)
|
||||
{
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, tuner_ratio);
|
||||
@@ -986,7 +991,7 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
nk_label(ctx, "Program number for extraction:", NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, hd_homerun->program, &hd_homerun->program_len, 10, nk_filter_decimal);
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2,ipv4_ratio);
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, ipv4_ratio);
|
||||
nk_label(ctx, "Target IPv4 address:", NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, hd_homerun->ipv4_address, &hd_homerun->ipv4_address_len, 16, nk_filter_ascii);
|
||||
|
||||
@@ -994,18 +999,17 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
nk_label(ctx, "Target Port number:", NK_TEXT_LEFT);
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, hd_homerun->port_number, &hd_homerun->port_number_len, 7, nk_filter_decimal);
|
||||
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, done_ratio);
|
||||
nk_spacing(ctx, 1);
|
||||
if(nk_button_label(ctx, "Done"))
|
||||
if (nk_button_label(ctx, "Done"))
|
||||
{
|
||||
pthread_attr_init(&attr_setup);
|
||||
int err = pthread_create(&tid_setup, &attr_setup, setup_hd_homerun_device, hd_homerun);
|
||||
if(!err)
|
||||
printf("Setup Device thread created!\n");
|
||||
pthread_attr_init(&attr_setup);
|
||||
int err = pthread_create(&tid_setup, &attr_setup, setup_hd_homerun_device, hd_homerun);
|
||||
if (!err)
|
||||
printf("Setup Device thread created!\n");
|
||||
|
||||
pthread_join(tid_setup, NULL);
|
||||
done = nk_true;
|
||||
pthread_join(tid_setup, NULL);
|
||||
done = nk_true;
|
||||
}
|
||||
}
|
||||
if (done == nk_true)
|
||||
@@ -1015,19 +1019,16 @@ void draw_hd_homerun_tab(struct nk_context *ctx, int *tab_screen_height,
|
||||
nk_layout_row_dynamic(ctx, 20, 1);
|
||||
nk_label(ctx, "Please start CCExtractor with UDP settings if not started.", NK_TEXT_CENTERED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct burned_subs_tab *burned_subs)
|
||||
{
|
||||
*tab_screen_height = 472;
|
||||
const float color_mode_ratio[] = { 0.65f, 0.351f};
|
||||
const float preset_ratio[] = { 0.4f, 0.5f };
|
||||
const float custom_ratio[] = { 0.4f, 0.5f};
|
||||
const float delay_ratio[] = { 0.4f, 0.2f, 0.2f };
|
||||
const float threshold_ratio[] = { 0.9f, 0.1f };
|
||||
const float color_mode_ratio[] = {0.65f, 0.351f};
|
||||
const float preset_ratio[] = {0.4f, 0.5f};
|
||||
const float custom_ratio[] = {0.4f, 0.5f};
|
||||
const float delay_ratio[] = {0.4f, 0.2f, 0.2f};
|
||||
const float threshold_ratio[] = {0.9f, 0.1f};
|
||||
static char buffer[5];
|
||||
|
||||
nk_layout_row_dynamic(ctx, 30, 1);
|
||||
@@ -1038,16 +1039,18 @@ void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct
|
||||
#endif
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 140, 2, color_mode_ratio);
|
||||
if(nk_group_begin(ctx, "Subtitle Color", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Subtitle Color", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, preset_ratio);
|
||||
if(nk_option_label(ctx, "Preset color:", burned_subs->color_type == PRESET)){
|
||||
if (nk_option_label(ctx, "Preset color:", burned_subs->color_type == PRESET))
|
||||
{
|
||||
burned_subs->color_type = PRESET;
|
||||
}
|
||||
burned_subs->subs_color_select = nk_combo(ctx, burned_subs->subs_color, 7, burned_subs->subs_color_select, 25, nk_vec2(100, 100));
|
||||
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 2, custom_ratio);
|
||||
if(nk_option_label(ctx, "Custom Hue:", burned_subs->color_type == CUSTOM)){
|
||||
if (nk_option_label(ctx, "Custom Hue:", burned_subs->color_type == CUSTOM))
|
||||
{
|
||||
burned_subs->color_type = CUSTOM;
|
||||
}
|
||||
nk_edit_string(ctx, NK_EDIT_SIMPLE, burned_subs->custom_hue, &burned_subs->custom_hue_len, 4, nk_filter_decimal);
|
||||
@@ -1059,29 +1062,32 @@ void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
if(nk_group_begin(ctx, "OCR mode", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "OCR mode", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if(nk_option_label(ctx, "Frame - wise", burned_subs->ocr_mode == FRAME_WISE)){
|
||||
if (nk_option_label(ctx, "Frame - wise", burned_subs->ocr_mode == FRAME_WISE))
|
||||
{
|
||||
burned_subs->ocr_mode = FRAME_WISE;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if(nk_option_label(ctx, "Word - wise", burned_subs->ocr_mode == WORD_WISE)){
|
||||
if (nk_option_label(ctx, "Word - wise", burned_subs->ocr_mode == WORD_WISE))
|
||||
{
|
||||
burned_subs->ocr_mode = WORD_WISE;
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 25, 1);
|
||||
if(nk_option_label(ctx, "Letter - wise", burned_subs->ocr_mode == LETTER_WISE)){
|
||||
if (nk_option_label(ctx, "Letter - wise", burned_subs->ocr_mode == LETTER_WISE))
|
||||
{
|
||||
burned_subs->ocr_mode = LETTER_WISE;
|
||||
}
|
||||
|
||||
if(burned_subs->is_italic)
|
||||
if (burned_subs->is_italic)
|
||||
{
|
||||
burned_subs->ocr_mode = WORD_WISE;
|
||||
}
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
nk_layout_row_dynamic(ctx, 120, 1);
|
||||
if(nk_group_begin(ctx, "Minimum Subtitle Duration", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Minimum Subtitle Duration", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 25, 3, delay_ratio);
|
||||
nk_label(ctx, "Set the minimum subtitle duration to:", NK_TEXT_LEFT);
|
||||
@@ -1094,10 +1100,10 @@ void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct
|
||||
nk_group_end(ctx);
|
||||
}
|
||||
|
||||
if(!burned_subs->subs_color_select && burned_subs->color_type == PRESET)
|
||||
if (!burned_subs->subs_color_select && burned_subs->color_type == PRESET)
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 60, 1);
|
||||
if(nk_group_begin(ctx, "Luminance Threshold", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Luminance Threshold", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, threshold_ratio);
|
||||
nk_slider_int(ctx, 0, &burned_subs->luminance_threshold, 100, 1);
|
||||
@@ -1109,7 +1115,7 @@ void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct
|
||||
}
|
||||
|
||||
nk_layout_row_dynamic(ctx, 60, 1);
|
||||
if(nk_group_begin(ctx, "Confidence Threshold", NK_WINDOW_TITLE|NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
if (nk_group_begin(ctx, "Confidence Threshold", NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR | NK_WINDOW_BORDER))
|
||||
{
|
||||
nk_layout_row(ctx, NK_DYNAMIC, 20, 2, threshold_ratio);
|
||||
nk_slider_int(ctx, 0, &burned_subs->confidence_threshold, 100, 1);
|
||||
@@ -1121,5 +1127,4 @@ void draw_burned_subs_tab(struct nk_context *ctx, int *tab_screen_height, struct
|
||||
|
||||
nk_layout_row_dynamic(ctx, 30, 1);
|
||||
nk_checkbox_label(ctx, "Enable italics detection.", &burned_subs->is_italic);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ static int
|
||||
terminal(struct nk_context *ctx, int x, int y, int width, int height, char *command)
|
||||
{
|
||||
if (nk_begin(ctx, "Terminal", nk_rect(x, y, width, height),
|
||||
NK_WINDOW_TITLE|NK_WINDOW_BACKGROUND ))
|
||||
NK_WINDOW_TITLE | NK_WINDOW_BACKGROUND))
|
||||
{
|
||||
nk_layout_row_dynamic(ctx, 60, 1);
|
||||
nk_label_wrap(ctx, command);
|
||||
|
||||
@@ -601,7 +601,7 @@ extern "C" {
|
||||
p = &dirp->data;
|
||||
}
|
||||
else {
|
||||
/* The very last entry has been processed or an error occured */
|
||||
/* The very last entry has been processed or an error occurred */
|
||||
FindClose(dirp->handle);
|
||||
dirp->handle = INVALID_HANDLE_VALUE;
|
||||
p = NULL;
|
||||
@@ -692,7 +692,7 @@ extern "C" {
|
||||
* to 1252 using chcp utility and use Lucida Console font, or (2) use
|
||||
* _cprintf function when writing to console. The _cprinf() will re-encode
|
||||
* ANSI strings to the console code page so many non-ASCII characters will
|
||||
* display correcly.
|
||||
* display correctly.
|
||||
*/
|
||||
static struct dirent*
|
||||
readdir(
|
||||
@@ -850,7 +850,7 @@ extern "C" {
|
||||
wcstr[n] = 0;
|
||||
}
|
||||
|
||||
/* Length of resuting multi-byte string WITH zero terminator */
|
||||
/* Length of resulting multi-byte string WITH zero terminator */
|
||||
if (pReturnValue) {
|
||||
*pReturnValue = n + 1;
|
||||
}
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
|
||||
/* CCExtractor, originally by carlos at ccextractor.org, now a lot of people.
|
||||
Credits: See CHANGES.TXT
|
||||
Credits: See AUTHORS.TXT
|
||||
License: GPL 2.0
|
||||
*/
|
||||
#include "ccextractor.h"
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
|
||||
volatile int terminate_asap = 0;
|
||||
|
||||
struct ccx_s_options ccx_options;
|
||||
struct lib_ccx_ctx *signal_ctx;
|
||||
|
||||
void sigusr1_handler(int sig)
|
||||
{
|
||||
mprint("Caught SIGUSR1. Filename Change Requested\n");
|
||||
change_filename_requested = 1;
|
||||
mprint("Caught SIGUSR1. Filename Change Requested\n");
|
||||
change_filename_requested = 1;
|
||||
}
|
||||
|
||||
|
||||
void sigterm_handler(int sig)
|
||||
{
|
||||
printf("Received SIGTERM, terminating as soon as possible.\n");
|
||||
terminate_asap = 1;
|
||||
printf("Received SIGTERM, terminating as soon as possible.\n");
|
||||
terminate_asap = 1;
|
||||
}
|
||||
|
||||
|
||||
void sigint_handler(int sig)
|
||||
{
|
||||
if (ccx_options.print_file_reports)
|
||||
print_file_report(signal_ctx);
|
||||
if (ccx_options.print_file_reports)
|
||||
print_file_report(signal_ctx);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
void print_end_msg(void)
|
||||
{
|
||||
mprint("Issues? Open a ticket here\n");
|
||||
mprint("https://github.com/CCExtractor/ccextractor/issues\n");
|
||||
mprint("Issues? Open a ticket here\n");
|
||||
mprint("https://github.com/CCExtractor/ccextractor/issues\n");
|
||||
}
|
||||
|
||||
|
||||
int api_start(struct ccx_s_options api_options)
|
||||
{
|
||||
struct lib_ccx_ctx *ctx;
|
||||
struct lib_cc_decode *dec_ctx = NULL;
|
||||
int ret = 0, tmp;
|
||||
enum ccx_stream_mode_enum stream_mode;
|
||||
struct lib_ccx_ctx *ctx = NULL; // Context for libs
|
||||
struct lib_cc_decode *dec_ctx = NULL; // Context for decoder
|
||||
int ret = 0, tmp = 0;
|
||||
enum ccx_stream_mode_enum stream_mode = CCX_SM_ELEMENTARY_OR_NOT_FOUND;
|
||||
|
||||
#if defined(ENABLE_OCR) && defined(_WIN32)
|
||||
setMsgSeverity(LEPT_MSG_SEVERITY);
|
||||
setMsgSeverity(LEPT_MSG_SEVERITY);
|
||||
#endif
|
||||
#ifdef ENABLE_HARDSUBX
|
||||
if(api_options.hardsubx)
|
||||
if (api_options.hardsubx)
|
||||
{
|
||||
// Perform burned in subtitle extraction
|
||||
hardsubx(&api_options);
|
||||
@@ -57,98 +57,93 @@ int api_start(struct ccx_s_options api_options)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize CCExtractor libraries
|
||||
ctx = init_libraries(&api_options);
|
||||
#ifdef ENABLE_PYTHON
|
||||
int i=0;
|
||||
// Initialize CCExtractor libraries
|
||||
ctx = init_libraries(&api_options);
|
||||
|
||||
while(i<api_options.python_param_count)
|
||||
{
|
||||
free(api_options.python_params[i]);
|
||||
i++;
|
||||
}
|
||||
#endif
|
||||
if (!ctx && errno == ENOMEM)
|
||||
fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory, could not initialize libraries\n");
|
||||
else if (!ctx && errno == EINVAL)
|
||||
fatal (CCX_COMMON_EXIT_BUG_BUG, "Invalid option to CCextractor Library\n");
|
||||
else if (!ctx && errno == EPERM)
|
||||
fatal (CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to create output file: Operation not permitted.\n");
|
||||
else if (!ctx && errno == EACCES)
|
||||
fatal (CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to create output file: Permission denied\n");
|
||||
else if (!ctx)
|
||||
fatal (EXIT_NOT_CLASSIFIED, "Unable to create Library Context %d\n",errno);
|
||||
if (!ctx)
|
||||
{
|
||||
if (errno == ENOMEM)
|
||||
fatal(EXIT_NOT_ENOUGH_MEMORY, "Not enough memory, could not initialize libraries\n");
|
||||
else if (errno == EINVAL)
|
||||
fatal(CCX_COMMON_EXIT_BUG_BUG, "Invalid option to CCextractor Library\n");
|
||||
else if (errno == EPERM)
|
||||
fatal(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to create output file: Operation not permitted.\n");
|
||||
else if (errno == EACCES)
|
||||
fatal(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Unable to create output file: Permission denied\n");
|
||||
else
|
||||
fatal(EXIT_NOT_CLASSIFIED, "Unable to create Library Context %d\n", errno);
|
||||
}
|
||||
|
||||
#ifdef WITH_LIBCURL
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
if (!curl)
|
||||
{
|
||||
curl_global_cleanup(); // Must be done even on init fail
|
||||
fatal (EXIT_NOT_CLASSIFIED, "Unable to init curl.");
|
||||
fatal(EXIT_NOT_CLASSIFIED, "Unable to init curl.");
|
||||
}
|
||||
#endif
|
||||
|
||||
int show_myth_banner = 0;
|
||||
int show_myth_banner = 0;
|
||||
|
||||
params_dump(ctx);
|
||||
params_dump(ctx);
|
||||
|
||||
// default teletext page
|
||||
if (tlt_config.page > 0) {
|
||||
// dec to BCD, magazine pages numbers are in BCD (ETSI 300 706)
|
||||
tlt_config.page = ((tlt_config.page / 100) << 8) | (((tlt_config.page / 10) % 10) << 4) | (tlt_config.page % 10);
|
||||
}
|
||||
// default teletext page
|
||||
if (tlt_config.page > 0)
|
||||
{
|
||||
// dec to BCD, magazine pages numbers are in BCD (ETSI 300 706)
|
||||
tlt_config.page = ((tlt_config.page / 100) << 8) | (((tlt_config.page / 10) % 10) << 4) | (tlt_config.page % 10);
|
||||
}
|
||||
|
||||
if (api_options.transcript_settings.xds)
|
||||
{
|
||||
if (api_options.write_format != CCX_OF_TRANSCRIPT)
|
||||
{
|
||||
api_options.transcript_settings.xds = 0;
|
||||
mprint ("Warning: -xds ignored, XDS can only be exported to transcripts at this time.\n");
|
||||
}
|
||||
}
|
||||
if (api_options.transcript_settings.xds)
|
||||
{
|
||||
if (api_options.write_format != CCX_OF_TRANSCRIPT)
|
||||
{
|
||||
api_options.transcript_settings.xds = 0;
|
||||
mprint("Warning: -xds ignored, XDS can only be exported to transcripts at this time.\n");
|
||||
}
|
||||
}
|
||||
|
||||
time_t start, final;
|
||||
time(&start);
|
||||
|
||||
time_t start, final;
|
||||
time(&start);
|
||||
|
||||
if (api_options.binary_concat)
|
||||
{
|
||||
ctx->total_inputsize=get_total_file_size(ctx);
|
||||
if (ctx->total_inputsize < 0)
|
||||
{
|
||||
switch (ctx->total_inputsize)
|
||||
{
|
||||
case -1*ENOENT:
|
||||
fatal(EXIT_NO_INPUT_FILES, "Failed to open input file: File does not exist.");
|
||||
case -1*EACCES:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Unable to access");
|
||||
case -1*EINVAL:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Invalid opening flag.");
|
||||
case -1*EMFILE:
|
||||
fatal(EXIT_TOO_MANY_INPUT_FILES, "Failed to open input file: Too many files are open.");
|
||||
default:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Reason unknown");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (api_options.binary_concat)
|
||||
{
|
||||
ctx->total_inputsize = get_total_file_size(ctx);
|
||||
if (ctx->total_inputsize < 0)
|
||||
{
|
||||
switch (ctx->total_inputsize)
|
||||
{
|
||||
case -1 * ENOENT:
|
||||
fatal(EXIT_NO_INPUT_FILES, "Failed to open one of the input file(s): File does not exist.");
|
||||
case -1 * EACCES:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Unable to access");
|
||||
case -1 * EINVAL:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Invalid opening flag.");
|
||||
case -1 * EMFILE:
|
||||
fatal(EXIT_TOO_MANY_INPUT_FILES, "Failed to open input file: Too many files are open.");
|
||||
default:
|
||||
fatal(EXIT_READ_ERROR, "Failed to open input file: Reason unknown");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
signal_ctx = ctx;
|
||||
m_signal(SIGINT, sigint_handler);
|
||||
m_signal(SIGTERM, sigterm_handler);
|
||||
m_signal(SIGUSR1, sigusr1_handler);
|
||||
signal_ctx = ctx;
|
||||
m_signal(SIGINT, sigint_handler);
|
||||
m_signal(SIGTERM, sigterm_handler);
|
||||
m_signal(SIGUSR1, sigusr1_handler);
|
||||
#endif
|
||||
terminate_asap = 0;
|
||||
terminate_asap = 0;
|
||||
|
||||
#ifdef ENABLE_SHARING
|
||||
if (api_options.translate_enabled && ctx->num_input_files > 1)
|
||||
if (api_options.translate_enabled && ctx->num_input_files > 1)
|
||||
{
|
||||
mprint("[share] WARNING: simultaneous translation of several input files is not supported yet\n");
|
||||
api_options.translate_enabled = 0;
|
||||
api_options.sharing_enabled = 0;
|
||||
api_options.sharing_enabled = 0;
|
||||
}
|
||||
if (api_options.translate_enabled)
|
||||
{
|
||||
@@ -156,451 +151,314 @@ int api_start(struct ccx_s_options api_options)
|
||||
ccx_share_launch_translator(api_options.translate_langs, api_options.translate_key);
|
||||
}
|
||||
#endif //ENABLE_SHARING
|
||||
ret = 0;
|
||||
while (switch_to_next_file(ctx, 0))
|
||||
{
|
||||
prepare_for_new_file(ctx);
|
||||
ret = 0;
|
||||
while (switch_to_next_file(ctx, 0))
|
||||
{
|
||||
prepare_for_new_file(ctx);
|
||||
#ifdef ENABLE_SHARING
|
||||
if (api_options.sharing_enabled)
|
||||
if (api_options.sharing_enabled)
|
||||
ccx_share_start(ctx->basefilename);
|
||||
#endif //ENABLE_SHARING
|
||||
|
||||
stream_mode = ctx->demux_ctx->get_stream_mode(ctx->demux_ctx);
|
||||
// Disable sync check for raw formats - they have the right timeline.
|
||||
// Also true for bin formats, but -nosync might have created a
|
||||
// broken timeline for debug purposes.
|
||||
// Disable too in MP4, specs doesn't say that there can't be a jump
|
||||
switch (stream_mode)
|
||||
{
|
||||
case CCX_SM_MCPOODLESRAW:
|
||||
case CCX_SM_RCWT:
|
||||
case CCX_SM_MP4:
|
||||
stream_mode = ctx->demux_ctx->get_stream_mode(ctx->demux_ctx);
|
||||
// Disable sync check for raw formats - they have the right timeline.
|
||||
// Also true for bin formats, but -nosync might have created a
|
||||
// broken timeline for debug purposes.
|
||||
// Disable too in MP4, specs doesn't say that there can't be a jump
|
||||
switch (stream_mode)
|
||||
{
|
||||
case CCX_SM_MCPOODLESRAW:
|
||||
case CCX_SM_RCWT:
|
||||
case CCX_SM_MP4:
|
||||
#ifdef WTV_DEBUG
|
||||
case CCX_SM_HEX_DUMP:
|
||||
case CCX_SM_HEX_DUMP:
|
||||
#endif
|
||||
ccx_common_timing_settings.disable_sync_check = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* -----------------------------------------------------------------
|
||||
MAIN LOOP
|
||||
----------------------------------------------------------------- */
|
||||
switch (stream_mode)
|
||||
{
|
||||
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
|
||||
if (!api_options.use_gop_as_pts) // If !0 then the user selected something
|
||||
api_options.use_gop_as_pts = 1; // Force GOP timing for ES
|
||||
ccx_common_timing_settings.is_elementary_stream = 1;
|
||||
case CCX_SM_TRANSPORT:
|
||||
case CCX_SM_PROGRAM:
|
||||
case CCX_SM_ASF:
|
||||
case CCX_SM_WTV:
|
||||
case CCX_SM_GXF:
|
||||
case CCX_SM_MXF:
|
||||
ccx_common_timing_settings.disable_sync_check = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* -----------------------------------------------------------------
|
||||
MAIN LOOP
|
||||
----------------------------------------------------------------- */
|
||||
switch (stream_mode)
|
||||
{
|
||||
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
|
||||
if (!api_options.use_gop_as_pts) // If !0 then the user selected something
|
||||
api_options.use_gop_as_pts = 1; // Force GOP timing for ES
|
||||
ccx_common_timing_settings.is_elementary_stream = 1;
|
||||
case CCX_SM_TRANSPORT:
|
||||
case CCX_SM_PROGRAM:
|
||||
case CCX_SM_ASF:
|
||||
case CCX_SM_WTV:
|
||||
case CCX_SM_GXF:
|
||||
case CCX_SM_MXF:
|
||||
#ifdef ENABLE_FFMPEG
|
||||
case CCX_SM_FFMPEG:
|
||||
case CCX_SM_FFMPEG:
|
||||
#endif
|
||||
if (!api_options.use_gop_as_pts) // If !0 then the user selected something
|
||||
api_options.use_gop_as_pts = 0;
|
||||
if (api_options.ignore_pts_jumps)
|
||||
ccx_common_timing_settings.disable_sync_check = 1;
|
||||
mprint ("\rAnalyzing data in general mode\n");
|
||||
tmp = general_loop(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MCPOODLESRAW:
|
||||
mprint ("\rAnalyzing data in McPoodle raw mode\n");
|
||||
tmp = raw_loop(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
case CCX_SM_RCWT:
|
||||
mprint ("\rAnalyzing data in CCExtractor's binary format\n");
|
||||
tmp = rcwt_loop(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MYTH:
|
||||
mprint ("\rAnalyzing data in MythTV mode\n");
|
||||
show_myth_banner = 1;
|
||||
tmp = myth_loop(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MP4:
|
||||
mprint ("\rAnalyzing data with GPAC (MP4 library)\n");
|
||||
close_input_file(ctx); // No need to have it open. GPAC will do it for us
|
||||
if (ctx->current_file == -1) // We don't have a file to open, must be stdin, and GPAC is incompatible with stdin
|
||||
{
|
||||
fatal (EXIT_INCOMPATIBLE_PARAMETERS, "MP4 requires an actual file, it's not possible to read from a stream, including stdin.\n");
|
||||
}
|
||||
if(api_options.extract_chapters)
|
||||
{
|
||||
tmp = dumpchapters(ctx, &ctx->mp4_cfg, ctx->inputfile[ctx->current_file]);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = processmp4(ctx, &ctx->mp4_cfg, ctx->inputfile[ctx->current_file]);
|
||||
}
|
||||
if (api_options.print_file_reports)
|
||||
print_file_report(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MKV:
|
||||
mprint ("\rAnalyzing data in Matroska mode\n");
|
||||
tmp = matroska_loop(ctx);
|
||||
if (!ret) ret = tmp;
|
||||
break;
|
||||
if (!api_options.use_gop_as_pts) // If !0 then the user selected something
|
||||
api_options.use_gop_as_pts = 0;
|
||||
if (api_options.ignore_pts_jumps)
|
||||
ccx_common_timing_settings.disable_sync_check = 1;
|
||||
mprint("\rAnalyzing data in general mode\n");
|
||||
tmp = general_loop(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MCPOODLESRAW:
|
||||
mprint("\rAnalyzing data in McPoodle raw mode\n");
|
||||
tmp = raw_loop(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
case CCX_SM_RCWT:
|
||||
mprint("\rAnalyzing data in CCExtractor's binary format\n");
|
||||
tmp = rcwt_loop(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MYTH:
|
||||
mprint("\rAnalyzing data in MythTV mode\n");
|
||||
show_myth_banner = 1;
|
||||
tmp = myth_loop(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MP4:
|
||||
mprint("\rAnalyzing data with GPAC (MP4 library)\n");
|
||||
close_input_file(ctx); // No need to have it open. GPAC will do it for us
|
||||
if (ctx->current_file == -1) // We don't have a file to open, must be stdin, and GPAC is incompatible with stdin
|
||||
{
|
||||
fatal(EXIT_INCOMPATIBLE_PARAMETERS, "MP4 requires an actual file, it's not possible to read from a stream, including stdin.\n");
|
||||
}
|
||||
if (api_options.extract_chapters)
|
||||
{
|
||||
tmp = dumpchapters(ctx, &ctx->mp4_cfg, ctx->inputfile[ctx->current_file]);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = processmp4(ctx, &ctx->mp4_cfg, ctx->inputfile[ctx->current_file]);
|
||||
}
|
||||
if (api_options.print_file_reports)
|
||||
print_file_report(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
case CCX_SM_MKV:
|
||||
mprint("\rAnalyzing data in Matroska mode\n");
|
||||
tmp = matroska_loop(ctx);
|
||||
if (!ret)
|
||||
ret = tmp;
|
||||
break;
|
||||
#ifdef WTV_DEBUG
|
||||
case CCX_SM_HEX_DUMP:
|
||||
case CCX_SM_HEX_DUMP:
|
||||
close_input_file(ctx); // process_hex will open it in text mode
|
||||
process_hex (ctx, ctx->inputfile[0]);
|
||||
process_hex(ctx, ctx->inputfile[0]);
|
||||
break;
|
||||
#endif
|
||||
case CCX_SM_AUTODETECT:
|
||||
fatal(CCX_COMMON_EXIT_BUG_BUG, "Cannot be reached!");
|
||||
break;
|
||||
}
|
||||
list_for_each_entry(dec_ctx, &ctx->dec_ctx_head, list, struct lib_cc_decode)
|
||||
{
|
||||
mprint("\n");
|
||||
dbg_print(CCX_DMT_DECODER_608, "\nTime stamps after last caption block was written:\n");
|
||||
dbg_print(CCX_DMT_DECODER_608, "GOP: %s \n", print_mstime_static(gop_time.ms) );
|
||||
case CCX_SM_AUTODETECT:
|
||||
fatal(CCX_COMMON_EXIT_BUG_BUG, "Cannot be reached!");
|
||||
break;
|
||||
}
|
||||
list_for_each_entry(dec_ctx, &ctx->dec_ctx_head, list, struct lib_cc_decode)
|
||||
{
|
||||
mprint("\n");
|
||||
dbg_print(CCX_DMT_DECODER_608, "\nTime stamps after last caption block was written:\n");
|
||||
dbg_print(CCX_DMT_DECODER_608, "GOP: %s \n", print_mstime_static(gop_time.ms));
|
||||
|
||||
dbg_print(CCX_DMT_DECODER_608, "GOP: %s (%+3dms incl.)\n",
|
||||
print_mstime_static((LLONG)(gop_time.ms
|
||||
-first_gop_time.ms
|
||||
+get_fts_max(dec_ctx->timing)-fts_at_gop_start)),
|
||||
(int)(get_fts_max(dec_ctx->timing)-fts_at_gop_start));
|
||||
// When padding is active the CC block time should be within
|
||||
// 1000/29.97 us of the differences.
|
||||
dbg_print(CCX_DMT_DECODER_608, "Max. FTS: %s (without caption blocks since then)\n",
|
||||
print_mstime_static(get_fts_max(dec_ctx->timing)));
|
||||
dbg_print(CCX_DMT_DECODER_608, "GOP: %s (%+3dms incl.)\n",
|
||||
print_mstime_static((LLONG)(gop_time.ms - first_gop_time.ms + get_fts_max(dec_ctx->timing) - fts_at_gop_start)),
|
||||
(int)(get_fts_max(dec_ctx->timing) - fts_at_gop_start));
|
||||
// When padding is active the CC block time should be within
|
||||
// 1000/29.97 us of the differences.
|
||||
dbg_print(CCX_DMT_DECODER_608, "Max. FTS: %s (without caption blocks since then)\n",
|
||||
print_mstime_static(get_fts_max(dec_ctx->timing)));
|
||||
|
||||
if (dec_ctx->codec == CCX_CODEC_ATSC_CC)
|
||||
{
|
||||
mprint ("\nTotal frames time: %s (%u frames at %.2ffps)\n",
|
||||
print_mstime_static( (LLONG)(total_frames_count*1000/current_fps) ),
|
||||
total_frames_count, current_fps);
|
||||
}
|
||||
if (dec_ctx->codec == CCX_CODEC_ATSC_CC)
|
||||
{
|
||||
mprint("\nTotal frames time: %s (%u frames at %.2ffps)\n",
|
||||
print_mstime_static((LLONG)(total_frames_count * 1000 / current_fps)),
|
||||
total_frames_count, current_fps);
|
||||
}
|
||||
|
||||
if (ctx->stat_hdtv)
|
||||
{
|
||||
mprint ("\rCC type 0: %d (%s)\n", dec_ctx->cc_stats[0], cc_types[0]);
|
||||
mprint ("CC type 1: %d (%s)\n", dec_ctx->cc_stats[1], cc_types[1]);
|
||||
mprint ("CC type 2: %d (%s)\n", dec_ctx->cc_stats[2], cc_types[2]);
|
||||
mprint ("CC type 3: %d (%s)\n", dec_ctx->cc_stats[3], cc_types[3]);
|
||||
}
|
||||
// Add one frame as fts_max marks the beginning of the last frame,
|
||||
// but we need the end.
|
||||
dec_ctx->timing->fts_global += dec_ctx->timing->fts_max + (LLONG) (1000.0/current_fps);
|
||||
// CFS: At least in Hauppage mode, cb_field can be responsible for ALL the
|
||||
// timing (cb_fields having a huge number and fts_now and fts_global being 0 all
|
||||
// the time), so we need to take that into account in fts_global before resetting
|
||||
// counters.
|
||||
if (cb_field1!=0)
|
||||
dec_ctx->timing->fts_global += cb_field1*1001/3;
|
||||
else if (cb_field2!=0)
|
||||
dec_ctx->timing->fts_global += cb_field2*1001/3;
|
||||
else
|
||||
dec_ctx->timing->fts_global += cb_708*1001/3;
|
||||
// Reset counters - This is needed if some captions are still buffered
|
||||
// and need to be written after the last file is processed.
|
||||
cb_field1 = 0; cb_field2 = 0; cb_708 = 0;
|
||||
dec_ctx->timing->fts_now = 0;
|
||||
dec_ctx->timing->fts_max = 0;
|
||||
if (dec_ctx->stat_hdtv)
|
||||
{
|
||||
mprint("\rCC type 0: %d (%s)\n", dec_ctx->cc_stats[0], cc_types[0]);
|
||||
mprint("CC type 1: %d (%s)\n", dec_ctx->cc_stats[1], cc_types[1]);
|
||||
mprint("CC type 2: %d (%s)\n", dec_ctx->cc_stats[2], cc_types[2]);
|
||||
mprint("CC type 3: %d (%s)\n", dec_ctx->cc_stats[3], cc_types[3]);
|
||||
}
|
||||
// Add one frame as fts_max marks the beginning of the last frame,
|
||||
// but we need the end.
|
||||
dec_ctx->timing->fts_global += dec_ctx->timing->fts_max + (LLONG)(1000.0 / current_fps);
|
||||
// CFS: At least in Hauppage mode, cb_field can be responsible for ALL the
|
||||
// timing (cb_fields having a huge number and fts_now and fts_global being 0 all
|
||||
// the time), so we need to take that into account in fts_global before resetting
|
||||
// counters.
|
||||
if (cb_field1 != 0)
|
||||
dec_ctx->timing->fts_global += cb_field1 * 1001 / 3;
|
||||
else if (cb_field2 != 0)
|
||||
dec_ctx->timing->fts_global += cb_field2 * 1001 / 3;
|
||||
else
|
||||
dec_ctx->timing->fts_global += cb_708 * 1001 / 3;
|
||||
// Reset counters - This is needed if some captions are still buffered
|
||||
// and need to be written after the last file is processed.
|
||||
cb_field1 = 0;
|
||||
cb_field2 = 0;
|
||||
cb_708 = 0;
|
||||
dec_ctx->timing->fts_now = 0;
|
||||
dec_ctx->timing->fts_max = 0;
|
||||
|
||||
#ifdef ENABLE_SHARING
|
||||
if (api_options.sharing_enabled)
|
||||
if (api_options.sharing_enabled)
|
||||
{
|
||||
ccx_share_stream_done(ctx->basefilename);
|
||||
ccx_share_stop();
|
||||
}
|
||||
#endif //ENABLE_SHARING
|
||||
|
||||
if (dec_ctx->total_pulldownframes)
|
||||
mprint ("incl. pulldown frames: %s (%u frames at %.2ffps)\n",
|
||||
print_mstime_static( (LLONG)(dec_ctx->total_pulldownframes*1000/current_fps) ),
|
||||
dec_ctx->total_pulldownframes, current_fps);
|
||||
if (dec_ctx->timing->pts_set >= 1 && dec_ctx->timing->min_pts != 0x01FFFFFFFFLL)
|
||||
{
|
||||
LLONG postsyncms = (LLONG) (dec_ctx->frames_since_last_gop*1000/current_fps);
|
||||
mprint ("\nMin PTS: %s\n",
|
||||
print_mstime_static( dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) - dec_ctx->timing->fts_offset));
|
||||
if (pts_big_change)
|
||||
mprint ("(Reference clock was reset at some point, Min PTS is approximated)\n");
|
||||
mprint ("Max PTS: %s\n",
|
||||
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms));
|
||||
if (dec_ctx->total_pulldownframes)
|
||||
mprint("incl. pulldown frames: %s (%u frames at %.2ffps)\n",
|
||||
print_mstime_static((LLONG)(dec_ctx->total_pulldownframes * 1000 / current_fps)),
|
||||
dec_ctx->total_pulldownframes, current_fps);
|
||||
if (dec_ctx->timing->pts_set >= 1 && dec_ctx->timing->min_pts != 0x01FFFFFFFFLL)
|
||||
{
|
||||
LLONG postsyncms = (LLONG)(dec_ctx->frames_since_last_gop * 1000 / current_fps);
|
||||
mprint("\nMin PTS: %s\n",
|
||||
print_mstime_static(dec_ctx->timing->min_pts / (MPEG_CLOCK_FREQ / 1000) - dec_ctx->timing->fts_offset));
|
||||
if (pts_big_change)
|
||||
mprint("(Reference clock was reset at some point, Min PTS is approximated)\n");
|
||||
mprint("Max PTS: %s\n",
|
||||
print_mstime_static(dec_ctx->timing->sync_pts / (MPEG_CLOCK_FREQ / 1000) + postsyncms));
|
||||
|
||||
mprint ("Length: %s\n",
|
||||
print_mstime_static( dec_ctx->timing->sync_pts/(MPEG_CLOCK_FREQ/1000) + postsyncms
|
||||
- dec_ctx->timing->min_pts/(MPEG_CLOCK_FREQ/1000) + dec_ctx->timing->fts_offset ));
|
||||
}
|
||||
mprint("Length: %s\n",
|
||||
print_mstime_static(dec_ctx->timing->sync_pts / (MPEG_CLOCK_FREQ / 1000) + postsyncms - dec_ctx->timing->min_pts / (MPEG_CLOCK_FREQ / 1000) + dec_ctx->timing->fts_offset));
|
||||
}
|
||||
|
||||
// dvr-ms files have invalid GOPs
|
||||
if (gop_time.inited && first_gop_time.inited && stream_mode != CCX_SM_ASF)
|
||||
{
|
||||
mprint("\nInitial GOP time: %s\n",
|
||||
print_mstime_static(first_gop_time.ms));
|
||||
mprint("Final GOP time: %s%+3dF\n",
|
||||
print_mstime_static(gop_time.ms),
|
||||
dec_ctx->frames_since_last_gop);
|
||||
mprint("Diff. GOP length: %s%+3dF",
|
||||
print_mstime_static(gop_time.ms - first_gop_time.ms),
|
||||
dec_ctx->frames_since_last_gop);
|
||||
mprint(" (%s)\n\n",
|
||||
print_mstime_static(gop_time.ms - first_gop_time.ms + (LLONG)((dec_ctx->frames_since_last_gop) * 1000 / 29.97)));
|
||||
}
|
||||
|
||||
// dvr-ms files have invalid GOPs
|
||||
if (gop_time.inited && first_gop_time.inited && stream_mode != CCX_SM_ASF)
|
||||
{
|
||||
mprint ("\nInitial GOP time: %s\n",
|
||||
print_mstime_static(first_gop_time.ms));
|
||||
mprint ("Final GOP time: %s%+3dF\n",
|
||||
print_mstime_static(gop_time.ms),
|
||||
dec_ctx->frames_since_last_gop);
|
||||
mprint ("Diff. GOP length: %s%+3dF",
|
||||
print_mstime_static(gop_time.ms - first_gop_time.ms),
|
||||
dec_ctx->frames_since_last_gop);
|
||||
mprint (" (%s)\n\n",
|
||||
print_mstime_static(gop_time.ms - first_gop_time.ms
|
||||
+(LLONG) ((dec_ctx->frames_since_last_gop)*1000/29.97)) );
|
||||
}
|
||||
if (dec_ctx->false_pict_header)
|
||||
mprint("Number of likely false picture headers (discarded): %d\n", dec_ctx->false_pict_header);
|
||||
if (dec_ctx->num_key_frames)
|
||||
mprint("Number of key frames: %d\n", dec_ctx->num_key_frames);
|
||||
|
||||
if (dec_ctx->false_pict_header)
|
||||
mprint ("Number of likely false picture headers (discarded): %d\n",dec_ctx->false_pict_header);
|
||||
if (dec_ctx->num_key_frames)
|
||||
mprint("Number of key frames: %d\n", dec_ctx->num_key_frames);
|
||||
if (dec_ctx->stat_numuserheaders)
|
||||
mprint("Total user data fields: %d\n", dec_ctx->stat_numuserheaders);
|
||||
if (dec_ctx->stat_dvdccheaders)
|
||||
mprint("DVD-type user data fields: %d\n", dec_ctx->stat_dvdccheaders);
|
||||
if (dec_ctx->stat_scte20ccheaders)
|
||||
mprint("SCTE-20 type user data fields: %d\n", dec_ctx->stat_scte20ccheaders);
|
||||
if (dec_ctx->stat_replay4000headers)
|
||||
mprint("ReplayTV 4000 user data fields: %d\n", dec_ctx->stat_replay4000headers);
|
||||
if (dec_ctx->stat_replay5000headers)
|
||||
mprint("ReplayTV 5000 user data fields: %d\n", dec_ctx->stat_replay5000headers);
|
||||
if (dec_ctx->stat_hdtv)
|
||||
mprint("HDTV type user data fields: %d\n", dec_ctx->stat_hdtv);
|
||||
if (dec_ctx->stat_dishheaders)
|
||||
mprint("Dish Network user data fields: %d\n", dec_ctx->stat_dishheaders);
|
||||
if (dec_ctx->stat_divicom)
|
||||
{
|
||||
mprint("CEA608/Divicom user data fields: %d\n", dec_ctx->stat_divicom);
|
||||
|
||||
if (dec_ctx->stat_numuserheaders)
|
||||
mprint("Total user data fields: %d\n", dec_ctx->stat_numuserheaders);
|
||||
if (dec_ctx->stat_dvdccheaders)
|
||||
mprint("DVD-type user data fields: %d\n", dec_ctx->stat_dvdccheaders);
|
||||
if (dec_ctx->stat_scte20ccheaders)
|
||||
mprint("SCTE-20 type user data fields: %d\n", dec_ctx->stat_scte20ccheaders);
|
||||
if (dec_ctx->stat_replay4000headers)
|
||||
mprint("ReplayTV 4000 user data fields: %d\n", dec_ctx->stat_replay4000headers);
|
||||
if (dec_ctx->stat_replay5000headers)
|
||||
mprint("ReplayTV 5000 user data fields: %d\n", dec_ctx->stat_replay5000headers);
|
||||
if (dec_ctx->stat_hdtv)
|
||||
mprint("HDTV type user data fields: %d\n", dec_ctx->stat_hdtv);
|
||||
if (dec_ctx->stat_dishheaders)
|
||||
mprint("Dish Network user data fields: %d\n", dec_ctx->stat_dishheaders);
|
||||
if (dec_ctx->stat_divicom)
|
||||
{
|
||||
mprint("CEA608/Divicom user data fields: %d\n", dec_ctx->stat_divicom);
|
||||
mprint("\n\nNOTE! The CEA 608 / Divicom standard encoding for closed\n");
|
||||
mprint("caption is not well understood!\n\n");
|
||||
mprint("Please submit samples to the developers.\n\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
mprint("\n\nNOTE! The CEA 608 / Divicom standard encoding for closed\n");
|
||||
mprint("caption is not well understood!\n\n");
|
||||
mprint("Please submit samples to the developers.\n\n\n");
|
||||
}
|
||||
if (is_decoder_processed_enough(ctx) == CCX_TRUE)
|
||||
break;
|
||||
} // file loop
|
||||
close_input_file(ctx);
|
||||
|
||||
}
|
||||
prepare_for_new_file(ctx); // To reset counters used by handle_end_of_data()
|
||||
|
||||
if(is_decoder_processed_enough(ctx) == CCX_TRUE)
|
||||
break;
|
||||
} // file loop
|
||||
close_input_file(ctx);
|
||||
free((void *) ctx->extension);
|
||||
time(&final);
|
||||
|
||||
prepare_for_new_file (ctx); // To reset counters used by handle_end_of_data()
|
||||
|
||||
|
||||
time (&final);
|
||||
|
||||
long proc_time=(long) (final-start);
|
||||
mprint ("\rDone, processing time = %ld seconds\n", proc_time);
|
||||
long proc_time = (long)(final - start);
|
||||
mprint("\rDone, processing time = %ld seconds\n", proc_time);
|
||||
#if 0
|
||||
if (proc_time>0)
|
||||
if (proc_time > 0)
|
||||
{
|
||||
LLONG ratio=(get_fts_max()/10)/proc_time;
|
||||
unsigned s1=(unsigned) (ratio/100);
|
||||
unsigned s2=(unsigned) (ratio%100);
|
||||
mprint ("Performance (real length/process time) = %u.%02u\n",
|
||||
LLONG ratio = (get_fts_max() / 10) / proc_time;
|
||||
unsigned s1 = (unsigned)(ratio / 100);
|
||||
unsigned s2 = (unsigned)(ratio % 100);
|
||||
mprint("Performance (real length/process time) = %u.%02u\n",
|
||||
s1, s2);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (is_decoder_processed_enough(ctx) == CCX_TRUE)
|
||||
{
|
||||
mprint ("\rNote: Processing was canceled before all data was processed because\n");
|
||||
mprint ("\rone or more user-defined limits were reached.\n");
|
||||
}
|
||||
if (is_decoder_processed_enough(ctx) == CCX_TRUE)
|
||||
{
|
||||
mprint("\rNote: Processing was canceled before all data was processed because\n");
|
||||
mprint("\rone or more user-defined limits were reached.\n");
|
||||
}
|
||||
|
||||
#ifdef CURL
|
||||
if (curl)
|
||||
if (curl)
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
#endif
|
||||
dinit_libraries(&ctx);
|
||||
#ifdef PYTHON_API
|
||||
free_python_global_vars();
|
||||
curl_global_cleanup();
|
||||
#endif
|
||||
dinit_libraries(&ctx);
|
||||
|
||||
if (!ret)
|
||||
mprint("\nNo captions were found in input.\n");
|
||||
if (!ret)
|
||||
mprint("\nNo captions were found in input.\n");
|
||||
|
||||
print_end_msg();
|
||||
print_end_msg();
|
||||
|
||||
if (show_myth_banner)
|
||||
{
|
||||
mprint("NOTICE: Due to the major rework in 0.49, we needed to change part of the timing\n");
|
||||
mprint("code in the MythTV's branch. Please report results to the address above. If\n");
|
||||
mprint("something is broken it will be fixed. Thanks\n");
|
||||
}
|
||||
return ret ? EXIT_OK : EXIT_NO_CAPTIONS;
|
||||
}
|
||||
#ifdef ENABLE_PYTHON
|
||||
void free_python_global_vars()
|
||||
{
|
||||
int i=0;
|
||||
while(i<array.sub_count)
|
||||
{
|
||||
free(array.subs[i].start_time);
|
||||
free(array.subs[i].end_time);
|
||||
i++;
|
||||
}
|
||||
free(array.subs);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct ccx_s_options* api_init_options()
|
||||
{
|
||||
init_options(&ccx_options);
|
||||
return &ccx_options;
|
||||
if (show_myth_banner)
|
||||
{
|
||||
mprint("NOTICE: Due to the major rework in 0.49, we needed to change part of the timing\n");
|
||||
mprint("code in the MythTV's branch. Please report results to the address above. If\n");
|
||||
mprint("something is broken it will be fixed. Thanks\n");
|
||||
}
|
||||
return ret ? EXIT_OK : EXIT_NO_CAPTIONS;
|
||||
}
|
||||
|
||||
void check_configuration_file(struct ccx_s_options api_options)
|
||||
struct ccx_s_options *api_init_options()
|
||||
{
|
||||
parse_configuration(&api_options);
|
||||
init_options(&ccx_options);
|
||||
return &ccx_options;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_PYTHON
|
||||
int compile_params(struct ccx_s_options *api_options,int argc)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//adding the parameter ./ccextractor to the list of python_params for further parsing
|
||||
api_options->python_params = realloc(api_options->python_params, (api_options->python_param_count+1) * sizeof *api_options->python_params);
|
||||
api_options->python_params[api_options->python_param_count] = malloc(strlen("./ccextractor")+1);
|
||||
strcpy(api_options->python_params[api_options->python_param_count], "./ccextractor");
|
||||
api_options->python_param_count++;
|
||||
setlocale(LC_ALL, ""); // Supports non-English CCs
|
||||
|
||||
char* temp = api_options->python_params[api_options->python_param_count-1];
|
||||
int i;
|
||||
for (i = api_options->python_param_count-1; i > 0; i--)
|
||||
api_options->python_params[i] = api_options->python_params[i-1];
|
||||
api_options->python_params[0] = temp;
|
||||
struct ccx_s_options *api_options = api_init_options();
|
||||
parse_configuration(api_options);
|
||||
// If "ccextractor.cnf" is present, takes options from it.
|
||||
// See docs/ccextractor.cnf.sample for more info.
|
||||
|
||||
int ret = parse_parameters (api_options, api_options->python_param_count, api_options->python_params);
|
||||
int compile_ret = parse_parameters(api_options, argc, argv);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void api_add_param(struct ccx_s_options* api_options,char* arg)
|
||||
{
|
||||
api_options->python_params = realloc(api_options->python_params, (api_options->python_param_count+1) * sizeof *api_options->python_params);
|
||||
api_options->python_params[api_options->python_param_count] = malloc(strlen(arg)+1);
|
||||
strcpy(api_options->python_params[api_options->python_param_count], arg);
|
||||
api_options->python_param_count++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to print the i-th param submitted by the user.
|
||||
* Helpful for debugging
|
||||
*/
|
||||
char * api_param(struct ccx_s_options* api_options, int count)
|
||||
{
|
||||
return api_options->python_params[count];
|
||||
}
|
||||
|
||||
/*
|
||||
* Helper function to get the total number of params provided by the user.
|
||||
* Helpful for debugging
|
||||
*/
|
||||
int api_param_count(struct ccx_s_options* api_options)
|
||||
{
|
||||
return api_options->python_param_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* asprintf alternative
|
||||
* Defined only in case of windows users.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
int vasprintf(char **strp, const char *fmt, va_list ap)
|
||||
{
|
||||
//_vscprintf tells you how big the buffer needs to be
|
||||
int len = _vscprintf(fmt, ap);
|
||||
if (len == -1) {
|
||||
return -1;
|
||||
}
|
||||
size_t size = (size_t)len + 1;
|
||||
char *str = malloc(size);
|
||||
if (!str) {
|
||||
return -1;
|
||||
}
|
||||
// _vsprintf_s is the "secure" version of vsprintf
|
||||
int r = vsprintf_s(str, len + 1, fmt, ap);
|
||||
if (r == -1) {
|
||||
free(str);
|
||||
return -1;
|
||||
}
|
||||
*strp = str;
|
||||
return r;
|
||||
}
|
||||
|
||||
int asprintf(char **strp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int r = vasprintf(strp, fmt, ap);
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
char* time_wrapper(char* fmt, unsigned h, unsigned m, unsigned s, unsigned ms)
|
||||
{
|
||||
char * time;
|
||||
asprintf(&time,fmt, h, m, s, ms);
|
||||
return time;
|
||||
}
|
||||
|
||||
#ifdef PYTHON_API
|
||||
void call_from_python_api(struct ccx_s_options *api_options)
|
||||
{
|
||||
int indicator = api_options->signal_python_api;
|
||||
if (indicator)
|
||||
signal_python_api=1;
|
||||
else
|
||||
signal_python_api=0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PYTHONAPI)
|
||||
void run(PyObject * reporter, char * line, int encoding)
|
||||
{
|
||||
assert ( PyFunction_Check(reporter) );
|
||||
PyObject* args = Py_BuildValue("(si)",line,encoding);
|
||||
PyObject_CallObject((PyObject*)reporter, args);
|
||||
}
|
||||
#endif
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
struct ccx_s_options* api_options = api_init_options();
|
||||
check_configuration_file(*api_options);
|
||||
#ifdef ENABLE_PYTHON
|
||||
for(int i = 1; i < argc; i++)
|
||||
api_add_param(api_options,argv[i]);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_PYTHON
|
||||
int compile_ret = compile_params(api_options,argc);
|
||||
#else
|
||||
int compile_ret = parse_parameters (api_options, argc, argv);
|
||||
#endif
|
||||
|
||||
if (compile_ret == EXIT_NO_INPUT_FILES)
|
||||
{
|
||||
print_usage ();
|
||||
fatal (EXIT_NO_INPUT_FILES, "(This help screen was shown because there were no input files)\n");
|
||||
}
|
||||
else if (compile_ret == EXIT_WITH_HELP)
|
||||
{
|
||||
return EXIT_OK;
|
||||
}
|
||||
else if (compile_ret != EXIT_OK)
|
||||
{
|
||||
exit(compile_ret);
|
||||
}
|
||||
|
||||
#ifdef PYTHON_API
|
||||
call_from_python_api(api_options);
|
||||
#endif
|
||||
int start_ret = api_start(*api_options);
|
||||
return start_ret;
|
||||
if (compile_ret == EXIT_NO_INPUT_FILES)
|
||||
{
|
||||
print_usage();
|
||||
fatal(EXIT_NO_INPUT_FILES, "(This help screen was shown because there were no input files)\n");
|
||||
}
|
||||
else if (compile_ret == EXIT_WITH_HELP)
|
||||
{
|
||||
return EXIT_OK;
|
||||
}
|
||||
else if (compile_ret != EXIT_OK)
|
||||
{
|
||||
exit(compile_ret);
|
||||
}
|
||||
|
||||
int start_ret = api_start(*api_options);
|
||||
return start_ret;
|
||||
}
|
||||
|
||||