* Attempt to fix long-running regression in TeleText
Regression test 78 (https://sampleplatform.ccextractor.org/regression/test/78/view)
has been broken since #614 was merged to fix other issues.
It's been traced back to be caused by not setting t0 at the correct time
(setting it using a calculated PTS time rather than taking it from the video frame),
and this commits attempts to fix that.
* Add changes
* Clang-format changes
* Improved fix
This uses the current_pts rather than the min_pts because the value
of the delta should be relative to when the packet was received.
If min_pts wasn't set yet, it'll be retrieved and set as current_pts
* Fixup
* [FIX] Must have two newlines after WEBVTT header
Bug introduced in #1092
* [FIX] segfault with multitrack reports
* [FIX] segfault with unsupported file reports
* [FIX] Write subtitle header to multitrack outputs
* [FIX] Write multitrack files to the output file directory
* Add update_gpac.py
Add a Python script that partially automates updating GPAC to a newer
version.
* Update GPAC to version 1.0.1
Update the vendored version of GPAC to version 1.0.1.
* Add necessary GPAC header files
Add some GPAC header files that GPAC needs to compile.
* Define _GF_CONFIG_H_ to fix Linux build failing
gpac/configuration.h has a series of default configuration options for
various platforms, but it doesn't have a case for Linux and it results
in a compilation error if it encounters an unknown platform.
The settings in configuration.h don't appear to try to set any defaults
for Linux anyway, so we can disable all use of those configuration.h
settings by defining _GF_CONFIG_H_.
* Add some more necessary GPAC header files
Add a few more header files necessary to get GPAC to compile.
* Fix renamed and removed media types
Some mp4 media types ("clcp", "c608") were renamed by GPAC. "c708"
appears to have been removed, so we can just add the definition of that
to the top of mp4.c.
* Remove Remotery from updated GPAC
Remotery appears to be some code for profiling GPAC which we aren't
using, and including Remotery.c and Remotery.h ends up pulling in a lot
of files, so it's easier to just remove the include of Remotery.h and
the single use of it in os_divers.c
* Remove unused box definitions
Remove box definitions that we don't use from box_funcs.c in order to
avoid adding too many files from GPAC.
* Replace alloc function declarations with defines
Replace the GPAC wrappers around the malloc-style functions (gf_malloc,
gf_free, etc.) with defines that use the standard C versions of these
functions so that we can avoid including GPAC's alloc.c
* Remove WebVTT handling code in gf_isom_dump_srt_track
Remove the code that handles WebVTT in gf_isom_dump_srt_track to avoid
needing to pull in a lot of other files from GPAC.
gf_isom_dump_srt_track doesn't appear to be used by ccextractor directly
or indirectly (it's only called in gf_isom_text_dump which doesn't
appear to be called anywhere else) so it should be fine removing it.
* Disable use of Remotery and gzip on Linux
Use GPAC_DISABLE_REMOTERY and NO_GZIP to disable Remotery because we
aren't interested in profiling (see
5c0c9cf71e for more info) and gzip
compression through gzio.c respectively.
* Fix compilation errors in GPAC on linux
GPAC on linux after the update requires some threading functions and
dynamic loading functions in pthread and dl respectively.
* Add necessary files for GPAC to compile
Add several C and header files that GPAC needs to compile
* Disable Remotery and Gzip in all build systems
Disable Remotery and gzip (using the same method as
f49dc371b5) for:
- The linux build script (linux/build)
- The mac build script (mac/build.command)
- The mac makefile
- cmake
- bazel
- Visual Studio
* Add extra GPAC files to several build systems
Add the names of several GPAC files that were added in the update to the
linux and mac Makefiles and to the Windows Visual Studio project.
Adding these filenames isn't necessary for CMake, Bazel, or the linux or
mac build scripts because all of them compile all C files recursively in
the src/thirdparty/gpacmp4 directory instead of having an explicit list
of files to compile.
* Change NO_GZIP to GPAC_DISABLE_ZLIB in VS project
Instead of defining NO_GZIP to disable gzip support, define
GPAC_DISABLE_ZLIB, which does the same thing but also prevents the
compiler from trying to zlib.
* Avoid using GPAC's configuration.h completely
GPAC's configuration.h has a few problems with the defaults that it
sets:
- It defines GPAC_MEMORY_TRACKING on Windows, which switches to an
alternate implementation of malloc, meaning that we would have to pull
in alloc.c
- It causes compilation errors on Linux (see 9164c08979)
This disables using configuration.h by:
- Defining GPAC_HAVE_CONFIG_H to make GPAC use a separate config.h file
instead of the default configuration.h file
- Making an essentially empty config.h file to make attempts to include
it not fail
This commit also removes configuration.h from the repo to make sure we
don't accidentally include it, and removes the _GF_CONFIG_H_ hack from
the previously mentioned commit because we don't need it anymore (it's
sole purpose was avoiding using configuration.h).
* Link pthread and dl on Mac and Linux
Add -lpthread and -ldl to link pthread and dl respectively on Mac and
Linux. Needed because the update to GPAC 1.0.1 introduced os_thread.c
(which uses pthread) and os_module.c (which uses dlsym and related
functions).
* Remove unused Remotery.h header file
5c0c9cf71e removed the only use of
Remotery.h in the GPAC files that we pulled in, so there's no need to
keep it around.
* Add GPAC update to changelog
* Fix cmake build error
Building with CMake currently fails because it can't find functions from
dl (dlopen, dlsym, etc.)
* Fix bazel build error
Bazel currently doesn't find the header files in gpac/modules/ when
building gpac, most likely because it isn't searching all directories in
gpac/ recursively for header files
* Define GPAC_HAVE_CONFIG_H in lib_ccx BUILD file
lib_ccx indirectly includes gpac/tools.h, which tries to include
gpac/configuration.h, which was removed in
b46c4e8a2d. This just copies the solution
from that commit to the bazel BUILD file (defining GPAC_HAVE_CONFIG_H so
GPAC uses gpac/config.h instead).
* Link to dl and pthread in bazel GPAC BUILD file
The updated GPAC version requires functions from dl and pthread, which
weren't linked to previously when building with bazel.
* Fix 708 timing issue
Process packet as soon as the packet len is equal to the specified len
* check if cc_valid
* fix formatting
* Check if header is parsed before parsing pkt data
* Fix segfault on Windows
Using the format specifier %d to print out size is technically undefined
behavior, as size is defined as a u64, while %d is meant to print out
ints, which seems to be defined as 32 bits on most machines, and using a
format specifier with the wrong size is undefined behavior. This causes
a segfault on Windows as this apparently causes the wrong pointer to be
passed in for the filename.
* Add change to changelog
* Fix -Wunused-result warnings
* Wrap checked writes into a function
* In write_wrapped, continue writing in case of partial write
If a partial write occurs, it doesn't necessarily mean that something
failed, according to write(2). If this is the case, then the following
write will return -1.
* Fix build on MSVC
https://stackoverflow.com/questions/37460579/error-c2036-void-unknown-size
Expands the Windows build steps to include DLL's in the artifact, making an out-of-box use of said artifacts easier. The new artifacts will allow running ccextractor (not the GUI yet) directly.
Improves the build for 32 bit variants.
Contains fixes:
- `/SAFESEH:NO`: needed for linking precompiled ffmpeg-lib libraries
- add paths from $(ProjectDir)libs\lib\ffmpeg-lib and avcodec.lib; avformat.lib; avutil.lib; swscale.lib
- add extra post-build actions to copy libraries
- add $(vcpkg) paths
Adds a (likely non-working) build stage for building with OCR to the Windows GitHub actions, so we can assure that Windows keeps building with OCR just fine.
Makes a small update to the ISSUE_TEMPLATE to clarify instructions for sending samples that cannot be made public.
Co-authored-by: Willem <github@canihavesome.coffee>
* [ISSUE_TEMPLATE.md] Comment out instructions
* [PULL_REQUEST_TEMPLATE.md] Comment out instructions
* Mention in ISSUE_TEMPLATE.md that only useful arguments should be put
* Follow feedback
This was caused by 19241744d7, moving from
`unsigned char` to `enums` for colors and fonts. The problem with this is
that each colour isn't one byte next to each other so memcpy and memset
didn't work anymore.
The problem:
```patch
6812,6813c6812,6813
< EDITION OF AMERICA'S NEXT TOP
< <i> MODEL</i> ON WEDNESDAYS.<i> </i>
---
> EDITION OF<i> AMERICA'S NEXT TOP</i>
> <i> MODEL</i> ON WEDNESDAYS.
6817c6817
< EDITION OF AMERICA'S NEXT TOP
---
> EDITION OF<i> AMERICA'S NEXT TOP</i>
6819c6819
< >><i> THE VAMPIRE DIARIES </i>
---
> >><i> THE VAMPIRE DIARIES</i>
6824,6825c6824,6825
< >><i> THE VA</i>MPIRE DIARIES
< AND<i> THE SECRET CIRCLE </i>
---
> >><i> THE VAMPIRE DIARIES</i>
> AND<i> THE SECRET CIRCLE</i>
6829,6831c6829,6831
< >><i> THE VA</i>MPIRE DIARIES
< AND<i> THE S</i>ECRET CIRCLE
< ON THURSDAYS.<i> </i>
---
> >><i> THE VAMPIRE DIARIES</i>
> AND<i> THE SECRET CIRCLE</i>
> ON THURSDAYS.
6835c6835
< AND<i> THE S</i>ECRET CIRCLE
---
> AND<i> THE SECRET CIRCLE</i>
```
* file_buffer: Fix unitialized variable usage warning
Clang warns:
In file included from src/lib_ccx/asf_functions.c:5:
src/lib_ccx/file_buffer.h:76:7: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (buffer)
^~~~~~
src/lib_ccx/file_buffer.h:86:9: note: uninitialized use occurs here
return result;
^~~~~~
src/lib_ccx/file_buffer.h:76:3: note: remove the 'if' if its condition is always true
if (buffer)
^~~~~~~~~~~
src/lib_ccx/file_buffer.h:73:15: note: initialize the variable 'result' to silence this warning
size_t result;
^
= 0
* common_timing: Fix uninitialized variable usage warning
The vast majority of the code is already using fatal(), so I don't see
why this should be an exception.
Clang warns:
src/lib_ccx/ccx_common_timing.c:274:3: warning: variable 'fts' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_common_timing.c:280:9: note: uninitialized use occurs here
return fts;
^~~
src/lib_ccx/ccx_common_timing.c:261:11: note: initialize the variable 'fts' to silence this warning
LLONG fts;
^
= 0
* encoders: Fix handling of multibyte characters in UTF-8 converter
This is actually incorrect because characters longer than 1 byte will be
butchered.
Clang warns:
src/lib_ccx/ccx_encoders_common.c:178:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:193:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:209:12: warning: result of comparison of constant 256 with expression of
type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
src/lib_ccx/ccx_encoders_common.c:229:12: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always true [-Wtautological-constant-out-of-range-compare]
if (c < 256)
~ ^ ~~~
* gxf: Fix tautological comparison warnings
Clang warns:
src/lib_ccx/ccx_gxf.c:425:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
src/lib_ccx/ccx_gxf.c:542:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
src/lib_ccx/ccx_gxf.c:617:17: warning: result of comparison of constant 256 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
if (tag_len > STR_LEN)
~~~~~~~ ^ ~~~~~~~
* gxf: Fix uninitialized variable usage warnings
Clang warns:
src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG1_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'first_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG2_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'first_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_gxf.c:1475:35: note: uninitialized use occurs here
debug("first field number %d\n", first_field_nb);
^~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1410:30: note: initialize the variable 'first_field_nb' to silence this warning
unsigned char first_field_nb;
^
= '\0'
src/lib_ccx/ccx_gxf.c:1449:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG1_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1450:8: warning: variable 'last_field_nb' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TRACK_TYPE_MPEG2_525:
^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1456:3: warning: variable 'last_field_nb' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/lib_ccx/ccx_gxf.c:1476:34: note: uninitialized use occurs here
debug("last field number %d\n", last_field_nb);
^~~~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:28:115: note: expanded from macro 'debug'
^~~~~~~~~~~
src/lib_ccx/ccx_gxf.c:1411:29: note: initialize the variable 'last_field_nb' to silence this warning
unsigned char last_field_nb;
^
= '\0'
* ts_functions: Fix incorrect enumeration type in get_buffer_type
Clang warns:
src/lib_ccx/ts_functions.c:127:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PES;
~~~~~~ ^~~~~~~
src/lib_ccx/ts_functions.c:131:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_H264;
~~~~~~ ^~~~~~~~
src/lib_ccx/ts_functions.c:135:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_DVB_SUBTITLE;
~~~~~~ ^~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:139:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_ISDB_SUBTITLE;
~~~~~~ ^~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:143:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_HAUPPAGE;
~~~~~~ ^~~~~~~~~~~~
src/lib_ccx/ts_functions.c:147:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_TELETEXT;
~~~~~~ ^~~~~~~~~~~~
src/lib_ccx/ts_functions.c:151:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PRIVATE_MPEG2_CC;
~~~~~~ ^~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:155:10: warning: implicit conversion from enumeration type 'enum ccx_bufferdata_type' to different enumeration type 'enum ccx_stream_type' [-Wenum-conversion]
return CCX_PES;
~~~~~~ ^~~~~~~
src/lib_ccx/ts_functions.c:491:24: warning: implicit conversion from enumeration type 'enum ccx_stream_type' to different enumeration type 'enum ccx_bufferdata_type' [-Wenum-conversion]
ptr->bufferdatatype = get_buffer_type(cinfo);
~ ^~~~~~~~~~~~~~~~~~~~~~
* utility: Fix tautological comparison warnings
Clang warns:
src/lib_ccx/utility.c:605:24: warning: result of comparison of constant 65536 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare]
} else if (utf16_char < 0x010000) {
~~~~~~~~~~ ^ ~~~~~~~~
src/lib_ccx/utility.c:610:24: warning: result of comparison of constant 1114112 with expression of type 'unsigned short' is always true [-Wtautological-constant-out-of-range-compare]
} else if (utf16_char < 0x110000) {
~~~~~~~~~~ ^ ~~~~~~~~
* ocr: Fix floating point -> integer abs() warning
Clang warns:
src/lib_ccx/ocr.c:529:8: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
if(abs(h-h0)>50) // Color has changed
^
src/lib_ccx/ocr.c:529:8: note: use function 'fabsf' instead
if(abs(h-h0)>50) // Color has changed
^~~
fabsf
src/lib_ccx/ocr.c:529:8: note: include the header <math.h> or explicitly provide a declaration for 'fabsf'
* encoders: Fix incorrect string types when EIA-608 is in use
Clang warns:
src/lib_ccx/ccx_encoders_helpers.c: In function ‘clever_capitalize’:
src/lib_ccx/ccx_encoders_helpers.c:186:4: warning: case label value exceeds maximum value for type
186 | case 0x89: // This is a transparent space
| ^~~~
* ocr: Fix implicit struct declaration warning
Clang warns:
In file included from src/lib_ccx/dvd_subtitle_decoder.c:10:
src/lib_ccx/ocr.h:18:54: warning: ‘struct encoder_ctx’ declared inside parameter list will not be visible outside of this definition or declaration
18 | char *paraof_ocrtext(struct cc_subtitle *sub, struct encoder_ctx *context);
| ^~~~~~~~~~~
All the SCC and CCD examples I can find have CRLF line endings. VLC and
libavformat (used by MPV) don't care, so just go with the popular
convention and switch to CRLF. There's no reason a user would want to
choose their line endings in this scenario.
It now returns a value like the rest of the printf family. It doesn't
brute force the amount of memory that needs to be allocated.
It also removes a warning.
I do not believe there should be any performance concerns with this
implementation as it is what `glibc` does:
https://code.woboq.org/userspace/glibc/libio/iovdprintf.c.html
* cea708: Fix missing new line in log message
* subtype: Remove unused CC_708 type
CEA-708 inputs are coerced to CC_608 before hitting encode_sub.
GCC warns:
src/lib_ccx/ccx_encoders_common.c: In function ‘encode_sub’:
src/lib_ccx/ccx_encoders_common.c:1119:2: warning: enumeration value ‘CC_708’ not handled in switch [-Wswitch]
1119 | switch (sub->type)
| ^~~~~~
* build: Disable pointer-sign warning
This warning triggers all over the codebase due to the widespread use of
unsigned char arrays for parsed subtitle strings and them being passed
to string functions that expect signed ones. Since this won't actually
cause issues, silence the warning across the entire codebase.
* splitbysentence: Fix warnings
GCC warns:
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘sbs_is_pointer_on_sentence_breaker’:
src/lib_ccx/ccx_encoders_splitbysentence.c:170:7: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
170 | char p = *(current - 1);
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘sbs_find_insert_point_partial’:
src/lib_ccx/ccx_encoders_splitbysentence.c:231:1: warning: multi-line comment [-Wcomment]
231 | // sprintf(fmtbuf, "SBS: sbs_find_insert_point_partial: compare\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:263:1: warning: multi-line comment [-Wcomment]
263 | // LOG_DEBUG("SBS: sbs_find_insert_point_partial: LEFT CHANGED,\n\tbuf:[%s]\n\tstr:[%s]\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:297:1: warning: multi-line comment [-Wcomment]
297 | // sprintf(fmtbuf, "SBS: sbs_find_insert_point_partial: REPLACE ENTIRE TAIL !!\n\
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:222:6: warning: unused variable ‘i’ [-Wunused-variable]
222 | int i; // top level indexer for strings
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c: In function ‘reformat_cc_bitmap_through_sentence_buffer’:
src/lib_ccx/ccx_encoders_splitbysentence.c:730:8: warning: unused variable ‘str’ [-Wunused-variable]
730 | char *str;
| ^~~
src/lib_ccx/ccx_encoders_splitbysentence.c:729:6: warning: unused variable ‘i’ [-Wunused-variable]
729 | int i = 0;
| ^
src/lib_ccx/ccx_encoders_splitbysentence.c:728:6: warning: unused variable ‘used’ [-Wunused-variable]
728 | int used;
| ^~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:727:18: warning: unused variable ‘ms_end’ [-Wunused-variable]
727 | LLONG ms_start, ms_end;
| ^~~~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:727:8: warning: unused variable ‘ms_start’ [-Wunused-variable]
727 | LLONG ms_start, ms_end;
| ^~~~~~~~
src/lib_ccx/ccx_encoders_splitbysentence.c:726:20: warning: unused variable ‘rect’ [-Wunused-variable]
726 | struct cc_bitmap* rect;
| ^~~~
* spupng: Fix warnings
GCC warns:
src/lib_ccx/ccx_encoders_spupng.c: In function ‘init_face’:
src/lib_ccx/ccx_encoders_spupng.c:644:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
644 | if (error = FT_New_Face(ft_library, font, 0, face))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:651:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
651 | if (error = FT_Set_Pixel_Sizes(*face, 0, FONT_SIZE))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c: In function ‘spupng_export_string2png’:
src/lib_ccx/ccx_encoders_spupng.c:698:7: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
698 | if (error = FT_Init_FreeType(&ft_library))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:706:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
706 | if (error = init_face(&face_regular, ccx_options.enc_cfg.render_font))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:708:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
708 | if (error = init_face(&face_italics, ccx_options.enc_cfg.render_font_italics))
| ^~~~~
src/lib_ccx/ccx_encoders_spupng.c:850:9: warning: unused variable ‘height’ [-Wunused-variable]
850 | int height = slot->bitmap.rows;
| ^~~~~~
src/lib_ccx/ccx_encoders_spupng.c:849:9: warning: unused variable ‘width’ [-Wunused-variable]
849 | int width = slot->bitmap.width;
| ^~~~~
src/lib_ccx/ccx_encoders_webvtt.c: In function ‘write_webvtt_header’:
src/lib_ccx/ccx_encoders_webvtt.c:263:1: warning: control reaches end of non-void function [-Wreturn-type]
263 | }
| ^
* webvtt: Fix missing return warning
The return value of this function is never used, so just drop the
values.
GCC warns:
src/lib_ccx/ccx_encoders_webvtt.c: In function ‘write_webvtt_header’:
src/lib_ccx/ccx_encoders_webvtt.c:263:1: warning: control reaches end of non-void function [-Wreturn-type]
263 | }
| ^
* gxf: Fix MIN macro redefinition warning
GCC warns:
src/lib_ccx/ccx_gxf.c:23: warning: "MIN" redefined
23 | #define MIN(a, b) ( (a < b) ? a : b)
|
In file included from src/lib_ccx/ccx_demuxer.h:8,
from src/lib_ccx/ccx_gxf.h:4,
from src/lib_ccx/ccx_gxf.c:13:
src/lib_ccx/utility.h:8: note: this is the location of the previous definition
8 | #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
|
* dvd: Fix unused variable warnings
GCC warns:
src/lib_ccx/dvd_subtitle_decoder.c: In function ‘get_bitmap’:
src/lib_ccx/dvd_subtitle_decoder.c:133:9: warning: unused variable ‘discard’ [-Wunused-variable]
133 | int discard = get_bits(ctx, &nextbyte, &pos, &m);
| ^~~~~~~
src/lib_ccx/dvd_subtitle_decoder.c:172:9: warning: unused variable ‘discard’ [-Wunused-variable]
172 | int discard = get_bits(ctx, &nextbyte, &pos, &m);
| ^~~~~~~
src/lib_ccx/dvd_subtitle_decoder.c: In function ‘write_dvd_sub’:
src/lib_ccx/dvd_subtitle_decoder.c:320:6: warning: unused variable ‘ret’ [-Wunused-variable]
320 | int ret =0;
| ^~~
* es_functions: Fix unused variable warning
This also removes the stale commented code that used this variable.
GCC warns:
src/lib_ccx/es_functions.c: In function ‘read_pic_info’:
src/lib_ccx/es_functions.c:682:7: warning: unused variable ‘frame_type_to_char’ [-Wunused-variable]
682 | char frame_type_to_char[] = { '?', 'I', 'P','B', 'D', '?', '?','?' };
| ^~~~~~~~~~~~~~~~~~
* dvb: Fix unused variable warning when OCR is disabled
GCC warns:
src/lib_ccx/dvb_subtitle_decoder.c: In function ‘write_dvb_sub’:
src/lib_ccx/dvb_subtitle_decoder.c:1509:6: warning: unused variable ‘ret’ [-Wunused-variable]
1509 | int ret = 0;
| ^~~
* general_loop: Fix warnings
GCC warns:
src/lib_ccx/general_loop.c: In function ‘general_loop’:
src/lib_ccx/general_loop.c:1113:15: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
1113 | (enc_ctx && (enc_ctx->srt_counter || enc_ctx->cea_708_counter) ||
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
src/lib_ccx/general_loop.c:25:28: warning: ‘DO_NOTHING’ defined but not used [-Wunused-const-variable=]
25 | const static unsigned char DO_NOTHING[] = {0x80, 0x80};
| ^~~~~~~~~~
* networking: Fix unknown pragma warning for non-MSVC compilers
GCC warns:
src/lib_ccx/networking.c:22: warning: ignoring #pragma warning [-Wunknown-pragmas]
22 | #pragma warning( suppress : 4005)
|
* networking: Fix unused variable warnings on non-Windows platforms
GCC warns:
src/lib_ccx/networking.c: In function ‘net_udp_read’:
src/lib_ccx/networking.c:342:12: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
342 | in_addr_t addr;
| ^~~~
src/lib_ccx/networking.c:340:12: warning: unused variable ‘len’ [-Wunused-variable]
340 | socklen_t len = sizeof(source_addr);
| ^~~
src/lib_ccx/networking.c:338:7: warning: unused variable ‘ip’ [-Wunused-variable]
338 | char ip[INET_ADDRSTRLEN];
| ^~
* params: Fix unused variable warning when OCR is disabled
GCC warns:
src/lib_ccx/params.c: In function ‘version’:
src/lib_ccx/params.c:1015:8: warning: unused variable ‘leptversion’ [-Wunused-variable]
1015 | char *leptversion;
| ^~~~~~~~~~~
* params_dump: Fix empty encoding when ASCII is used
GCC warns:
src/lib_ccx/params_dump.c: In function ‘params_dump’:
src/lib_ccx/params_dump.c:110:2: warning: enumeration value ‘CCX_ENC_ASCII’ not handled in switch [-Wswitch]
110 | switch (ccx_options.enc_cfg.encoding)
| ^~~~~~
* params_dump: Fix comparison between mismatching enums
GCC warns:
src/lib_ccx/params_dump.c: In function ‘print_file_report’:
src/lib_ccx/params_dump.c:402:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
402 | (info->stream == CCX_SM_TRANSPORT ||
| ^~
src/lib_ccx/params_dump.c:403:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
403 | info->stream == CCX_SM_PROGRAM ||
| ^~
src/lib_ccx/params_dump.c:404:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
404 | info->stream == CCX_SM_ASF ||
| ^~
src/lib_ccx/params_dump.c:405:18: warning: comparison between ‘enum ccx_stream_type’ and ‘enum ccx_stream_mode_enum’ [-Wenum-compare]
405 | info->stream == CCX_SM_WTV))
| ^~
* telxcc: Fix unused variable warning
GCC warns:
src/lib_ccx/telxcc.c: In function ‘process_telx_packet’:
src/lib_ccx/telxcc.c:928:10: warning: unused variable ‘flag_subtitle’ [-Wunused-variable]
928 | uint8_t flag_subtitle;
| ^~~~~~~~~~~~~
* ts_functions: Fix unused variable warnings
GCC warns:
src/lib_ccx/ts_functions.c: In function ‘get_pts’:
src/lib_ccx/ts_functions.c:642:11: warning: variable ‘pes_packet_length’ set but not used [-Wunused-but-set-variable]
642 | uint16_t pes_packet_length;
| ^~~~~~~~~~~~~~~~~
src/lib_ccx/ts_functions.c:641:10: warning: variable ‘pes_stream_id’ set but not used [-Wunused-but-set-variable]
641 | uint8_t pes_stream_id;
| ^~~~~~~~~~~~~
* ts_tables_epg: Fix warnings
GCC warns:
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_add_event’:
src/lib_ccx/ts_tables_epg.c:380:6: warning: unused variable ‘isnew’ [-Wunused-variable]
380 | int isnew=true, j;
| ^~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_DVB_decode_string’:
src/lib_ccx/ts_tables_epg.c:469:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
469 | int ret=-1;
| ^~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_ATSC_decode_EIT’:
src/lib_ccx/ts_tables_epg.c:802:25: warning: variable ‘emt_location’ set but not used [-Wunused-but-set-variable]
802 | uint8_t title_length, emt_location;
| ^~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c:764:10: warning: variable ‘table_id’ set but not used [-Wunused-but-set-variable]
764 | uint8_t table_id;
| ^~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_ATSC_decode_VCT’:
src/lib_ccx/ts_tables_epg.c:837:10: warning: variable ‘table_id’ set but not used [-Wunused-but-set-variable]
837 | uint8_t table_id;
| ^~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘EPG_DVB_decode_EIT’:
src/lib_ccx/ts_tables_epg.c:883:10: warning: variable ‘segment_last_section_number’ set but not used [-Wunused-but-set-variable]
883 | uint8_t segment_last_section_number;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c:882:10: warning: variable ‘last_section_number’ set but not used [-Wunused-but-set-variable]
882 | uint8_t last_section_number;
| ^~~~~~~~~~~~~~~~~~~
src/lib_ccx/ts_tables_epg.c: In function ‘parse_EPG_packet’:
src/lib_ccx/ts_tables_epg.c:1041:11: warning: unused variable ‘transport_error_indicator’ [-Wunused-variable]
1041 | unsigned transport_error_indicator = (tspacket[1]&0x80)>>7;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
* matroska: Fix unused variable warning
The call is left alone since it might create a decoder context.
GCC warns:
src/lib_ccx/matroska.c: In function ‘matroska_save_all’:
src/lib_ccx/matroska.c:1182:27: warning: unused variable ‘dec_ctx’ [-Wunused-variable]
1182 | struct lib_cc_decode *dec_ctx = update_decoder_list(mkv_ctx->ctx);
| ^~~~~~~
* utility: Only define MIN when necessary
GCC warns:
In file included from src/lib_ccx/ccx_demuxer.h:8,
from src/lib_ccx/lib_ccx.h:15,
from src/gpacmp4/mp4.c:6:
src/lib_ccx/utility.h:8: warning: "MIN" redefined
8 | #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
|
In file included from src/gpacmp4/gpac/tools.h:33,
from src/gpacmp4/gpac/isomedia.h:50,
from src/gpacmp4/mp4.c:5:
src/gpacmp4/gpac/setup.h:324: note: this is the location of the previous definition
324 | #define MIN(X, Y) ((X)<(Y)?(X):(Y))
|
* Implement subtitle modification for all 608 encoders
This is done by modifying the subtitles in `ccx_encoders_common.c`
rather than per encoder.
* Use `char *` instead of subtitle data to capitalize
* Implement subtitle modification for OCR encoders
* Remove signness warnings
* Remove two-word profanity
They do not work for the moment
* Deal with different encoding
* Mention in changelog
* scc: Reformat control code list
- Separate sections with a blank line
- Align with 4-wide tabs rather than spaces
- Rewrite some comments
* scc: Revamp control code handling
This can be made much more readable by adding a small info struct that
contains all the information about a control code (first byte odd &
even, second byte, and assembly). Information is stored in and retrieved
from an array, created using an array initializer with the enum values
as indices.
This allows us to remove the massive switch-case blocks, leading to much
cleaner and more streamlined code.
* scc: Fix character pair writing
The space was being inserted in the wrong position, so the first
character of each caption was being cut off. The last character was also
cut off in captions with even lengths.
Reported-By: Nils ANDRÉ-CHANG <nils@nilsand.re>
* scc: Apply pair writing to control codes
The same mandatory pair logic applies here.
* scc: Fix timing and lingering captions
- Write EDM codes at end times to clear them from the screen as intended
by the captioners
- Show captions at the correct times:
- EOC+ENM *shows* the caption. It doesn't clear it -- that's EDM's job.
- The caption is *not* shown immediately after loading. EOC (End Of
Caption) is required for it to actually show.
Old behavior:
Start time: Load caption
End time: Show loaded caption
New behavior:
Start time: Load and show caption
End time: Clear displayed caption
These changes fix the issue where captions were always one line off --
that is, caption 1 would show when caption 2 was supposed to show.
* scc: Calculate frame number using a more precise frame rate
* scc: Fix timecode format specifiers
These are ints are unsigned.
* ocr: Fix minor memory leak
Detected by Valgrind:
==1203168== 2,880 bytes in 57 blocks are definitely lost in loss record 3 of 4
==1203168== at 0x483877F: malloc (vg_replace_malloc.c:309)
==1203168== by 0x51ADBEE: strdup (in /usr/lib/libc-2.30.so)
==1203168== by 0x24D1F8: ocr_bitmap (ocr.c:569)
==1203168== by 0x24E25B: ocr_rect (ocr.c:907)
==1203168== by 0x284832: write_dvb_sub (dvb_subtitle_decoder.c:1665)
==1203168== by 0x284B7A: dvbsub_handle_display_segment (dvb_subtitle_decoder.c:1720)
==1203168== by 0x285024: dvbsub_decode (dvb_subtitle_decoder.c:1828)
==1203168== by 0x2406AF: process_data (general_loop.c:648)
==1203168== by 0x2416D0: general_loop (general_loop.c:1025)
==1203168== by 0x1AC89A: api_start (ccextractor.c:214)
==1203168== by 0x16EC03: main (ccextractor.c:536)
* changes: Document OCR memory leak fix
* eia608: Re-use constant rather than hard-coding length in arrays
Hard-coding them is less clear and more prone to breakage.
* eia608: Add and use constant for max number of rows
Hard-coding it everywhere is unclear and prone to breakage.
* eia608: Initialize colors and fonts properly with a loop
memset is for single-byte types; an enum is defined to be the size of an
int, so using memset to fill an array of enum values is incorrect.
Fix it by using a simple loop to fill the elements, as there is no
memset-like function for arbitrary item lengths in C.
GCC warns:
src/lib_ccx/ccx_decoders_608.c: In function ‘clear_eia608_cc_buffer’:
src/lib_ccx/ccx_decoders_608.c:111:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
111 | memset(data->colors[i], context->settings->default_color, CCX_DECODER_608_SCREEN_WIDTH + 1);
| ^~~~~~
src/lib_ccx/ccx_decoders_608.c:112:3: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
112 | memset(data->fonts[i], FONT_REGULAR, CCX_DECODER_608_SCREEN_WIDTH + 1);
| ^~~~~~
Adds a GitHub Action that will build CCExtractor for Windows with msbuild. It will build in Release mode and Debug mode, without OCR or other features enabled.
* Fix free segfault
I restricted the scope and used free because the features of freep
aren't needed here.
Restricting the scope makes it clear when freeing the variable should be
done.
* Mention that freeing should be done
* Fix indentation, use switch instead of if
* Remove confusing comment
Enums are abstractions and should be used as such. They shouldn't be
used like integers.
* Return a const char* instead of char * allocated on heap
* Test return value inline
* Add SCC output
* Add CCD format
* Add channel header to CCD
* Return const pointer
* Revert formatting change
* Colour -> Color
* Fix formatting
* Move comment to relevant place
* Improve readability
* Fix formatting
* Fix erroneous comment
* Use different parity function not requiring GNU extension
* Use enum instead of int
* Fix bug
* Implement channel functionality
* Fix CI errors
* Fix CI build
* Add options to help menu
* Mention change in changelog
* Add file to build systems
* Remove uneeded link against zlib
* Remove the use of <stdbool.h> and use const char
* Rewrite SCC formatter
* Use fdprintf
* Added the option to disable timestamps for WebVTT
* Mentioned in changelog
* Added the option to params.c
* Encoder checks its context nwo
* Encoder checks its context
* Fix indentation
* Calculate subs_delay in encode_sub rather than in the individual encoders
Fix#1103
* Use precalculated times when sub->type == CC_TEXT
* Use calculate delay in encode_sub when sub->type == CC_608
* Added underline support
* Added changes to CHANGES.TXT
* Delete CHANGES.TXT~
* Delete .CHANGES.TXT.un~
* Update CHANGES.TXT
* Changed strncpy to memcpy when the size of the data being transferred is known
* Add declaration of struct image_copy before function
* Used strdup for duplicating strings
* Added error checking for strdup
* Added support for <i> and <b> tags
* Deleted code support bold
* Added -italics flag to sepcify italics font
* Added function for initializing freetype font face objects
* Added support for color
* Make header respect `-lf`
* [ccx_encoders_webvtt.c] Use the ternary operator to select line endings
* Use sprintf for choosing line ending and use ternary operator
* Revert
For people new to the software it can be a challenge to use it for the first time. By adding this to the README they can see the file formats supported and how the software works without having to search for their own file. This will be especially helpful to the many new GCI students who likely don't have much experience in the TV industry but want to learn how the software works.
- Improve the structure of package installation command to make it easy to copy and paste
- Improve the formatting of code blocks by mentioning language as specified by MD
* no styling unless in full mode
* part 1 of moving style to here
* no style header unless requested with webvtt-full
* only one new line to support x-timestamp-map
* move x-timestamp-map up to abide by specifications
and support ffmpeg and brightcove
* remove stray new line, crlfs are added upstream
297 seems to contain a null bug
* don't write null characters to sub file
* needed space after -full mode style
* typo
* Fix macOS travis build and remove linux builds.
* Add Apple logo for macOS build badge.
* Link the apple logo to travis build.
* Correct redundant compiler type.
* [FIX] Fix incorrect comparison of strings for AVC codec id in .mkv
* Initial work on adding DVB support to .mkv
* [REQUEST] Finished adding support for DVB inside MKV (#1000)
* Update CHANGES.TXT
At least in Ubuntu 18.04 (possibly the related Debian version and newer Ubuntus) the package `tesseract-ocr-dev` does not exist anymore. It was replaced by `libtesseract-dev`.
* Fixed the icon file not found error for windows and linux.
* Optimized distribution of icons and removed CSW dependency while running GUI
* Font and icons are now loaded directly from memory
* Added source icons and icons to C array convertor
* Destroy pix after use and release memory
* Free the frame and any dynamically allocated objects in it
* Fix typographical error
* Free the packet that was allocated by av_read_frame
* Add missing declarations
* update for windows priority
* Update ccx_decoders_708.h
* to solve timing issue bugs
one of many instances where data is received without any window defined in decoder.
* Update ccx_decoders_708.c
Currently the instructions to install with hardsubx are vague and a new method was added in PR #966
This method makes installation with HARDSUBX easy and hence has been added to the documentation.
There are no parameters as o1 or o2 in ccextractor but they have been mentioned in the help.
This commit removes such instances from file(s).
Change severity: trivial
* Add Updated GPAC
File changes have been directly inserted from libGPAC master into ccextractor's libGPAC.
This has resulted into removal of multiple custom functions and minor changes. These will be rectified in the next step of the updation.
Change severity: Very High
* Update libGPAC dependency
We use libGPAC for all our MP4 operations and, this commit updates it to the latest version.
All previous changes to the original library were restored post straight file updation and bugs have been removed.
change severity: very high
* Add Guide To Updating Dependencies
A small textual guide on how to update dependencies easily and efficiently.
strdup will give a segmentation fault if the argument passed to it is
NULL. TessResultIteratorGetUTF8Text returns a char* which can be NULL
and we should not call strdup directly over it. Once we check if the
value returned is not NULL, then we can call strdup.
* [IMPROVEMENT] Add LICENSE File
We should be adding a LICENSE File to the root of the project. We do mention that we follow GPL v2 and hence can include it's declaration file.
* Rename LICENSE to LICENSE.txt
The start and end timestamps of extracted burned in captions are flawed
and off by a large difference. Also, the start time of the first burned
in caption extracted is always zero, which is not always the case. And
the extracted captions always appear in continuous timestamps.
This commit improves the start and end timestamps of the extracted
burned in captions and reduces the error significantly, bringing the
timestamps fairly close to the actual timings as they appear in the
media file.
Add instructions to make the installation systemwide (on Linux) which can allow CCExtractor to be used from anywhere with just the below command in terminal:
`ccextractor [videofile]`
This commit adds some checks to avoid segmentation faults.
* In `add_cc_sub_text()`, strdup will cause a segfault if we duplicate an
empty string.
* In `init_encoder()`, initialize pointer fields to NULL to avoid random
addressing so we can avoid illegal memory accessing and segfaults in
other places.
To build ccextractor with hardsubx support on linux, we need to configure
ccextractor with the `-enable-hardsubx` switch along with the
`ENABLE_HARDSUBX` flag passed during compilation with make. This commit
adds the missing configure instruction.
* Added tags file and removed the previosly wrongly writtern file
* Added .vscode to visual code section
* Added the .tags in .gitignore
* Changed *.tags to *.tags*
write_dvb_sub(): Test for out of bounds and report details when this happens. Still doesn't fix the underlying issue but will help figure it out.
ocr.c: Solve malloc()/delete[] combinations that happened when operating on tesseract output. Now a malloc()'ed copy is immediately made, tesseract's results are unallocated using tesseract's delete function, and we continue using our own copy which is later free()'d.
ccx_encoders_srt.c: Made sure a pointer is non-NULL before dereferencing.
dvb_subtitle_decoder.c: Initialize pointer members to NULL when creating a structure.
lib_ccx.c: Initialize (memset 0) structure cc_subtitle after memory allocation.
README.TXT: Removed reference to sourceforge.
* Implementation of text renderer
* Fix some characters being cut
* Fix encoding and other bugs
* Add black background & fix bugs
* Fix more bugs
* Change to relative path
* Add a font option & Default font for MacOS & Fix anti-aliasing
* Document -font & enlarge default canvas
* function header in "get_more_data" functions were standarlized.
* Unnecessary stream_mode check inside the while loop was removed.
* terminate_asap if condition was moved to while condition.
* Unnecessary condition was removed.
compilation warnings before:
../src/gpacmp4/avilib.c:35:0: warning: "PACKAGE" redefined
#define PACKAGE "GPAC/avilib"
<command-line>:0:0: note: this is the location of the previous definition
../src/gpacmp4/avilib.c:36:0: warning: "VERSION" redefined
#define VERSION GPAC_FULL_VERSION
* Update README.md
* Delete README.MAC.TXT
No longer accurate given work done to integrate Mac into build processes.
* Change to use project's PNG/ZLIB libraries
* Fix Mac build command
Makes OCR an optional parameter
Adds python API file to build
* Update README.md
When the -out=raw option is used, the ccextractor jumped to spupng output
format, generating broken files in spupng format without CC data.
With this fix, now it generates CC data in McPoodle's Broadcast format.
* Removed all extractors except the grid extractor.
Removed the call to transcript extractor in ccx_encoders_transcript.c
* Removed unnecessary array appening statements in python_grid_extractor.
WIP: switch in extractor.
* Added switch in g608 grid extractor.
* Deleted comments from wrappers.
* Refactored code in ccextractor.c and .h files.
Removed all the commented part.
Made proper changes according to the coding conventions.
* Removed calls to extractor from all the encoders.
The only call made to extractor is from ccx_encoders_python.c.
* Removed a comment from wrapper.c.
In init_write function of output.c added a call to free the output string returned by asprintf in case of
sending filename to callback function.
* Added calls to free the char* which is malloced by asprintf in
extractor.c
WIP: Free the global variable elements.
* Sample testing correctly for italics tag.
Also added a hack to print only 32 characters when unicode fails.
WIP: Font tag.
* Added support for handling font and italics in Python SRT generator.
* modified the font generator.
Also, added count method for checking blank strings in
python_srt_generator.
* Added free statements for avoiding memory leaks.
* added return code for failure of asprintf calls.
* Removing unnecessary code from api_testing.py
* Made modifications to Makefile and build script.
* Added recursive_tester.py
Autoconf builds successfully.
* BUG: Made change to get_line_encoded to encode the last \0 character in a
line. Otherwise the EOL characted is absent causing garbage value to be
present in SRT.
* Exporting the encoding of the captions from CCExtractor to Python so
that the python SRT generator can generate proper SRT files.
* Modified the include statement in extractor.h
* added python_extract to encoders_srt and the captions are being
extracted in needed format. Search for an alternative to asprintf
* Checking if the alternative to asprintf generate proper srts
* CC captions accessible via python script
* Removing python caption code from __wrap_write function
* removing old cc_to_python functions
* Removing python_subs structure and all the changes done for that struct
* Removing filename functions from ccextractor.*
* Renaming make_message to time_wrapper
* Applying to python_extract codebase: SSA format
* Added python_extract_time_based and done validation for ssa
* pplying python_extract_time_based: Done validation for srt and webvtt
* led attempt for SAMI support of python_extract. Code is commented
* Appluing python_extract_time_based: validate support for SMPTETT
* Added python_extract_transcript and made changes for time printing.
* added show_extracted_captions_wtih_timings function
* Added show_extracted_captions_with_timings to python script for testing
purpose.
* refactored extractors to api directory. commented out show captions in main()
* build and build library working for the extractors.
* made caption generator work with a 0.1 time sleep. Start refactoring
* added asprintf for windows.
* file being written in the running directory
* Auto -deletion of python temporary file
* Python captions printing status set to proper.
* termination of tail successful
* Writing successful for the sample
* Generating unalternating output
* adding api_support.py
* Adding bld_flags in build_api
* Added to build_library
* Auto deletion of temporary file on SIGINT
* Discussing Seg fault with Izaron
* working for python and linux with samples. testing -out=pythonapi with stream
* Done adding bitmap support
* added -out=pythonapi support for bitmap
* Setting the messages_target to 0 for output = pythonapi
* Added wrapper for setting -out=pythonapi. Checking if -stdout value can be used in python.
* adding the cc_to_stdout=1 value for -out=pythonapi. Thus generation of output file has been avoided. May be needed to change in future.
* added extractor for g608 grid. removed sami extractor. need to work on overlap of -out=pythonapi and -out=g608
* Removed overlap of -out=pythonapi by adding -pythonapi and
signal_python_api global variable.
* added support for seperate c608 grid catching. Need to test the output
via python.
* added support for seperate printing of text font and color in CE608.
Need to make sure that the function is inbuilt.
* ADDED ce608 GRID SUPPORT FROM PYTHON
need to discuss whether to keep the print_cc_grid function specific to
the module or make it user accessible.
Mostly it would be better to make it user accessible.
* made changes in the call_from_python_api function such that only
api_options is needed to be passed.
An if statement before the call to g608_extractor has also been added.
Waiting for Carlos to comment on the output generated till this stage.
* added a signal_python_api check before calling every write function.
Thus basic writing output can be avoided.
* Commented all calls to python_extract_time_based.
making changes to python_extract_g608 to be called only from the point
when a g608 caption is detected.
* Added pass_cc_buffer_to_python in encoders_common.c temporarily
redefined get_*_encoded from static to normal
included the above functions in encoders_common.h
* Added if-else statement for switch in encode_sub function.
This is done mainly for making sure no output is generated in the api
call.
* Added ccx_encoders_python.c
Defined pass_cc_buffer_to_python in ccx_encoders_python.c
added if else statement in encode_sub's switch to make sure that the output is not generated in case of -pythonapi call
* Removed __wrap_write from the entire code base.
It's declaration and definition are only present in CCExtractor.*
* Commented out the /dev/null part in ccx_encoders_common.c.
Proceeding further on checking for file generation.
* Added output_filename in array global variable and is generated in
init_write function.
included ccextractor.h in output.c to access global variable
signal_python_api for avoiding output generation in init_write and
invalid free in dinit_write.
* Modified the definition of init_write function for accessing
signal_python_api.
* Deleted the commented part of /dev/null in ccx_encoders_common.c.
* Added target_message=0 in -pythonapi param parsing in param.c to avoid
the API from printing to STDOUT.
Deleted the commented part of -out=pythonapi.
Thinking of adding a different param for silencing the output when the
call is made from python api.
* Removed __wrap_write from ccextractor.c and ccextractor.h.
* Added ccx_to_python_g608 and modified api_support.py file.
added documentation in ccextractor.c.
* added the generate srt script. However, some random characters are
coming in first line. Need to talk about this.
* Added SRT generator for python.
Using string to remove the garbage value.
Add code for srt counter and also the start_time and end_time
conversion.
* removed the trash characters and added code to print the timings.
However, the last blank frame also results in a print. Need to take care
of this.
* rectified the mistake of writing only timings and not captions.
now next step is to just make the timings print properly
* some minor changes before diving into extracting srt_counter from the made codebase
* Added extraction of srt_counter in python_extract via fflush
srt_counter-value.
Need to modify the processing in python.
* Added the entire method to extract captions and generate srt files. Next, step would be a to define a concise function for writing the srt
* Processing into a srt working properly.
Next step is to add the information of font into the caption text.
* the data is getting generated for proper SRT counters.
* A turning point to the appraoch.
Added END OF FRAME line for printing the data for every particular
srt_counter.
Proceeding further with the generation of srt by data manipulation.
* some minor bugs but the output srt is being generated correctly. However, The font and colour encoding needs to be done.
* Taken care of random characters. Need to discuss this with Carlos. Moving further to font/color processing.
* Taken care of random characters. Need to discuss this with Carlos. Moving further to font/color processing.
* Added fflush and cleaned up the python code of srt generation
* Added <i> tag for italics.
Proceeding further with other types.
* Added the code to check for underline.
However, need to check how CCExtractor generates srt when both italics
and underline are present. For now a new line is added if both are
present.
* Shifting for making changes in th i/O work.
* Stable ouput for samples with italics is being generated.
* Added the PYTHONAPI macro definition and testing for its existence in the set_python_api function.
* build script for linux is working correctly.
Build_library is showing error of invalid def of set_pythonapi.
Moreover, extractor has some memory seg fault.
* Added mod to set a MACRO as my_python_api to set the callback function.
Till now all calls to the reporter are commented.
Working on getting the reporter to print the lines.
* Changes have been implemented to bring reporter in working state.
For now a constant string is passed from extractor. Need to make the
proper parsing possible.
* Changed the code in extractor such that entire grid is returned to the
callback function.
Need to provide this grid to the write function and also cleanup the
codebase.
* Writing the outputted srt in a file called "temp.srt".
Need to modify init_write to push filename that is to be created in
python using callback.
* Added code to get start and end time simultaneously.
entire SRT is getting generated.
* removed ccx_python_encoders.c
* Compiling and executing on Windows
* Moved definitions get_line_encoded, get_color_encoded, get_font_encoded from ccx_encoders_g608.c to ccx_encoders_common.c.
Also, deleted the static definition of get_font_encoded from
ccx_encoders_webvtt.c
* added a write statement in write_cc_bitmap_as_srt
* Rectified transfer of get_line_encoded, get_color_encoded and
get_font_encoded from ccx_decoders_common.c to ccx_encoders_common.c.
Segmenting now doesn't destroys the whole encoding context, just closes and reopens the output file
Correct a wrong function prototype for process_hex()
OCR: Attempt to correctly deal with TessBaseAPIRecognize returning an error
Changed output for parse PMT to CCX_DMT_PMT instead of CCX_DMT_VERBOSE
- TS: If we don't have pinfo don't pay attention to the current_next_indicator bit.
(fixes problem with The Lion Guard_20170321_09301000.ts). Not sure this fix is the correct one but that's what VLC does.
If no -o is suppled with stdin/network etc, the output name generated
was NULL, leading to creation of files like `.srt` which were in
category of hidden files.
* Use own SBS-context structure to store SBS-data (fixCCExtractor/ccextractor#639)
* Search for BEST match of new string and SBS-buffer (instead of first appropriate..)
* all tests are fixed and passed
* A pointer was freed twice in file
* The double free issue in GPAC is updated according to the latest source code. Issues 608 and 609 also resolved.
* Update wtv_functions.c
* Added -pesheader parameter for PES packet header dumping
* Added -pesheader parameter for short PES Header dump to console
* Added -pesheader parameter for short PES Header dump to console
* Fixed DVB subs start time and added -pesheader parameter for PES Header dumping
* Fixed DVB sub start time and added -pesheader parameter for PES packet header dumping
This should decrease code duplication - print_mstime2buf was doing
the same thing as mstime_sprintf, but with a hardcoded format and
a different return value. print_mstime (renamed to print_mstime_static)
could therefore be reworked into simply calling mstime_sprintf
(renamed to print_mstime_buff).
The only time I found hex2string being used was when it was
with two characters from char array. It therefore should be possible
to generalize the behavior of hex_to_int (which specifically takes two
characters) to take the array instead, in order to reduce code duplication.
I will refrain from moving this function into real application code in
case there is something I overlooked.
- pre-build.sh executable by default now
- git ignore updated so the updated compile_info.h won't show up when
it's being changed after building CCExtractor
- Adds a open-source hashing lib for SHA2 (SHA-256, SHA-386, SHA-512)
from http://www.aarongifford.com/computers/sha.html, with some small
modifications to make it work unders windows too
- Updates build commands to reflect this change
Please read and understand the contribution guide before creating an issue or pull request. We would like to thank [Nishad TR](https://github.com/nishad) for their contributor's guide, upon which we based ours.
## Etiquette
This project is open source, and as such, we (the maintainers) give our **free time** to build, maintain and **provide user support** for the CCExtractor program. We make the code freely available in the hope that it will be of use to other developers and users. It would be extremely unfair for us to suffer abuse or anger for our hard work.
Please be considerate towards the developers and other users when raising issues or presenting pull requests.
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the decision of the maintainers, and do not be upset or abusive if your submission is not used.
## Viability
When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project.
## Procedure
**Before filing an issue**:
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.
**Before submitting a pull request**:
- Ensure that your submission is [viable](#viability) for the project.
- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
## Technical requirements
- Before Submitting your Pull Request, merge `master` with your new branch and fix any conflicts. (Make sure you don't break anything in development!)
- Commit Unix line endings.
- Make sure to reasonably test your code. We have a sample platform that runs a test-suite for you, but it only covers a general set of tests.
Please prefix your issue with one of the following: [BUG], [PROPOSAL], [QUESTION].
To get the version of CCExtractor, you can use `--version`.
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.
- [ ] I have checked that the issue I'm posting isn't already reported.
- [ ] 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.
# Necessary information
- 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}`
# Video links
* {Replace with a link to a video file}
# Additional information
{issue content here, replace this line with your issue content}
[](https://sampleplatform.ccextractor.org/test/master/windows)
[](https://sampleplatform.ccextractor.org/test/master/linux)
[](https://github.com/CCExtractor/ccextractor/releases/latest)
Gui lovers should download the Sorceforge version of CCExtractor, the Git Version is not your cup of tea.
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.
For News about release, please find CHANGES.TXT
Subtitles are important for many people. If you're learning a new language, subtitles are a great way to learn it from movies or TV shows. If you are hard of hearing, subtitles can help you better understand what's happening on the screen. We aim to make it easy to generate subtitles by using the command line tool or Windows GUI.
The official repository is ([CCExtractor/ccextractor](https://github.com/CCExtractor/ccextractor)) and master being the most stable branch.
### **Features**
- Extract subtitles in real-time
- Translate subtitles
- Extract closed captions from DVDs
- Convert closed captions to subtitles
### Programming Languages & Technologies
The core functionality is written in C. Other languages used include C++ and Python.
## Installation and Usage
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:
`ccextractor <input>`
This will extract the subtitles.
More usage information can be found on our website:
- [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).
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://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://sourceforge.net/donate/index.php?group_id=190832)
## Contributing
You can contribute to the project by reporting issues, forking it, modifying the code and making a pull request to the repository. We have some rules, outlined in the [contributor's guide](.github/CONTRIBUTING.md).
## News & Other Information
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)
You may compile CCExtractor across all major platforms using `CMakeLists.txt` stored under `ccextractor/src/` directory. Autoconf and custom build scripts are also available. See platform specific instructions in the below sections.
Downloads for precompiled binaries and source code can be found [on our website](https://www.ccextractor.org?id=public:general:downloads).
**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.
```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
```bash
sudo apt-get install autoconf #Dependency to generate configuration script
cd ccextractor/linux
./autogen.sh
./configure
make
# test your build
./ccextractor
# make build systemwide
sudo make install
```
### Using CMake
```bash
#Create and navigate to directory where you want to store built files
cd ccextractor/
mkdir build
cd build
#Generate makefile using cmake and then compile
cmake ../src/
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:
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`
## macOS
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
```
Use pkg-config to verify tesseract and leptonica dependencies, e.g.
```bash
pkg-config --exists --print-errors tesseract
pkg-config --exists --print-errors lept
```
### Compiling
#### Using build.command script:
```bash
cd ccextractor/mac
./build.command OCR
# test your build
./ccextractor
```
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
# test your build
./ccextractor
```
#### Using CMake
```bash
#Create and navigate to directory where you want to store built files
cd ccextractor/
mkdir build
cd build
#Generate makefile using cmake and then compile
cmake ../src/
make
# test your build
./ccextractor
```
#### Standard compilation through Autoconf scripts:
```bash
cd ccextractor/mac
./autogen.sh
./configure
make
# test your build
./ccextractor
```
#### 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
```
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.
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.
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.
int [activity](#func-activity)(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
int [preview](#func-preview)(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
int [terminal](#func-terminal)(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, char *command);
### About CCExtractor specific functions
#### int <a id="func-activity">activity</a>(struct nk_context *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
##### Info:
--Contains the procedure to be carried out when Activity Window is toggled.
##### Parameters:
* *ctx - pointer to `nk_context` structure.
* x - X co-ordinate to draw Activity Window
* y - Y co-ordinate to draw Activty Window.
* width - width of window to draw.
* height - height of window to draw.
* *main_settings - pointer to [`main_tab`](#struct-main-tab) structure.
Reads activity data related to CCExtractor on `stdout`. And outputs to activity window (Updates variables that code of activity window uses).
##### Parameters:
* *read_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
Reads data from`--gui_mode_reports` redirected from `stderr` to a file. Reads the subtitles extracted in realtime and updates the variables for the same, updates the state of progress bar. Also, lanches [read_activity_data](#func-read-activity-data) in a new thread.
##### Parameters:
* *read_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
Passes command with all options from GUI to CLI CCExtractor.
##### Parameters:
* *extract_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
Feeds file by file to a new thread and waits until its extraction is done. This is done until all the files in extraction queue are extracted.
##### Parameters:
* *file_args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
* *args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
Sets up various parameters required to extract subtitle from incoming stream from a HD HomeRun Device.
##### Parameters:
* *args - Pointer to void, because thread functions don't allow any datatype as argument or return type. Therefore they are passed as void then typecasted later in the function.
Updates various variables related to Files/Directories path and names when screen of File Browser reloads. (Due to clicking on a directory or any other button leading to different directory).
##### Parameters:
* *browser - Pointer to `file_browser` struct.
* *path - Path of the new directory whose contents are to be reloaded and showed on file browser.
* *network_settings - pointer to `network_popup` struct.
##### Return type: void
#### int <a id="func-preview">preview</a>(struct [nk_context](#nk-context) *ctx, int x, int y, int width, int height, struct [main_tab](#struct-main-tab) *main_settings);
##### Info:
Draws `Preview` Nuklear window and shows preview strings (lines of subtitles extracted in realtime).
##### Parameters:
* *ctx - pointer to `nk_context` struct.
* x - X co-ordinate from where to draw window.
* y - Y co-ordinate from where to draw window.
* width - width of window.
* height - height of window.
* *main_settings - pointer to `main_tab ` struct.
Writes a label ( A plain String) and wraps it to the next line if the border of Nuklear Window, Group or Popup is reached.
*Note*: If the text wraps to next line, height for a new line must be considered while defining a layout, else the wrapped text won't be visible (but it will be there).
##### Parameters:
* nk_context* - Pointer to `nk_context` structure.
* char* - Pointer to string literal (to view).
#### int <a id="nk-window-is-closed">nk_window_is_closed</a>(struct nk_context *ctx, const char *name);
##### Info:
Checks if the active Nuklear Window is closed (by any trigger).
##### Parameters:
* *ctx - Pointer to `nk_context` structure.
* *name - Pointer to String literal(Name of window to check).
##### Return type: int
* Returns true if window is closed (by any trigger).
Marks the beginning of custom layout. Which means, marking that layout has begun, now the widgets will be pushed row by row as per requirement using [nk_layout_row_push](#nk-layout-row-push).
##### Parameters:
* *ctx - Pointer to `nk_context` structure.
* fmt - Layout format from provided formats (`enum nk_layout_format`), example - `NK_STATIC`, `NK_DYNAMIC`.
#### int <a id="nk-style-push-vec2">nk_style_push_vec2</a>(struct nk_context* struct nk_vec2*, struct nk_vec2);
##### Info:
Comes under `Style Stack`. Used to temporarily modify length, width, spacing related attributes of Styles of Nuklear Context.
##### Parameters:
* nk_context* - Pointer to `nk_context` structure.
* nk_vec2* - Pointer to attribute to be modified.
* nk_vec2* - New value in the form `nk_vec2(x, y)` as an instance of nk_vec2 structure.
##### Return type: int
* Returns true if successful.
* Returns false if unsuccessful.
#### int <a id="nk-style-push-float">nk_style_push_float</a>(struct nk_context*, float*, float);
##### Info:
Comes under `Style Stack`. Used to temporarily modify attributes requiring precision with floating point such as rounding value for buttons.
##### Parameters:
* nk_context* - Pointer to `nk_context` structure.
* float* - Pointer to variable whose value is to be changed.
* float - new value to set.
#### int <a id="nk-button-label">nk_button_label</a>(struct nk_context*, const char *title);
##### Info:
Draws a Button with provided label.
##### Parameters:
* nk_context* - Pointer to `nk_context` struct.
* *title - Pointer to string literal (Label to put on button).
##### Return type: int
* Returns true of Button is clicked.
* Returns false of Button is in 'unclicked' state.
#### int <a id="nk-style-pop-float">nk_style_pop_float</a>(struct nk_context*);
##### Info:
Pops the float values modified off the `Style Stack`. Which means, returns them to original state as they were before being modified by [nk_style_push_float](#nk-style-push-float).
##### Paramaters:
* nk_context* - Pointer to `nk_context` struct.
Used to create custom row layout in which widget placement (including spacing) is done using ratios in floating point. Maximum ratio allowed is one. So, if there are two widgets (say buttons) need to placed in 50% available area each. Then `ratio` will be {0.5f, 0.5f}.
##### Parameters:
* nk_context* - pointer to `nk_context` struct.
* nk_layout_format - format from available formats in `enum nk_layout_format` like `NK_STATIC` , `NK_DYNAMIC`.
* height - height of the layout.
* cols - Number of widgets(including spaces) to be used.
* *ratio - Ratio for widget placement.
##### Return type: void
#### void <a id="nk-spacing">nk_spacing</a>(struct nk_context*, int cols);
##### Info:
Used to create spacing (blank) of specified columns.
##### Parameters:
* nk_context* - pointer to `nk_context` struct.
* cols - Number of columns for which spacing has to be true.
##### Return type: void
#### int <a id="nk-checkbox-label">nk_checkbox_label</a>(struct nk_context *ctx, const char *label, int *active);
##### Info:
Creates a checkbox with specified label.
##### Parameters:
* *ctx - Pointer to `nk_context` struct.
* * - Pointer to string literal(Label of checkbox).
* * - Pointer to variable to store the active value. `nk_false` if unchecked, `nk_true` if checked.
##### Return type: int
* Returns false if unable to draw widget or old value of `*active` = new value of `*active`.
* Returns true of old value of `*active` != new value of `*active`.
#### int <a id="nk-option-label">nk_option_label</a>(struct nk_context *ctx, const char *label, int active);
##### Info:
Draws radio button (among radio group) with specified label.
##### Parameters:
* *ctx - pointer to `nk_context` struct.
* *label - Pointer to string literal (label of radio button).
* active - Any check to specify if the radio button is active.
##### Return type: int
* Returns true if radio button is active.
* Returns false if radio button is inactive.
#### int <a id="nk-selectable-label">nk_selectable_label</a>(struct nk_context*, const char*, nk_flags align, int *value);
##### Info:
Draws a selectable label. (Just like a regular [nk_label](#nk-label) but with a difference that it can be selected)
##### Parameters:
* nk_context* - pointer to `nk_context` struct.
* char* - Pointer to string literal (Label to display on GUI).
* align - required alignment flags from `nk_flags` like `NK_TEXT_LEFT`.
* *value - Pointer to integer variable to store the value if the label is triggered or not.
* Sets to `nk_true` if label selected.
* Sets to `nk_false` if label is in unselected state.
##### Return type: int
* Returns false if unable to draw widget or old value of `*value` = new value of `*value`.
* Returns true of old value of `*value` != new value of `*value`.
#### int <a id="nk-combo">nk_combo</a>(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size);
##### Info:
Draws combobox with given items as array of strings.
##### Parameters:
* nk_context* - Pointer to `nk_context` structure.
* **items - Array of strings of items to populate the list of combobox.
* count - Number of items in the combobox.
* selected - variable to store the index of selected item.
* item_height - Height to allocate to each item in combobox.
* size - size of combobox after expansion(when dropdown arrow is clicked). Given as [nk_vec2](#nk-vec2)(x, y).
Draws a plain text on Nuklear Window, Popup or group.
##### Parameters:
* *ctx - pointer to `nk_context` structure.
* *str - Pointer to string literal (Text to draw).
* alignment - required flags for text alignment from `nk_flags`, like `NK_TEXT_LEFT`.
##### Return type: void
#### int <a id="nk-progress">nk_progress</a>(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable);
##### Info:
Draws a progress bar.
##### Parameters:
* *ctx - Poitner to `nk_context` struct.
* *cur - Realtime value to update in progress bar.
* max - Maximum value `*cur` can achieve (usually 100, for 100% progress).
* is_modifyable -
*`nk_true` if progress bar can be modified with other events like mouse click and drag.
*`nk_false` if progress bar needs to be modified only by value of `*cur`
##### Return type: int
* Returns false if unable to draw widget or old value of `*cur` = new value of `*cur`.
* Returns true of old value of `*cur` != new value of `*cur`.
### About Nuklear Specific Structures/Variables
#### <a id="nk-context">nk_context</a>
##### Info:
Contains various Variables/attributes related to current Window.
#### <a id="nk-vec2">nk_vec2</a>
##### Info:
A simple structure containing 2 variables `x` and `y`. Used for various purposes where 2 variables are required for example.. using offset for position or size of any widget/window.
#Checks and prompts if libraries found/not found to avoild failure while building
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVCODEC -gt 0 ], [AC_MSG_NOTICE(avcodec library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVCODEC -gt 0 ], [AC_MSG_ERROR(avcodec library not found. Please install the avcodec library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVFORMAT -gt 0 ], [AC_MSG_NOTICE(avformat library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVFORMAT -gt 0 ], [AC_MSG_ERROR(avformat library not found. Please install the avformat library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avutil library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVUTIL -gt 0 ], [AC_MSG_ERROR(avutil library not found. Please install the avutil library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_SWSCALE -gt 0 ], [AC_MSG_NOTICE(swscale library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_SWSCALE -gt 0 ], [AC_MSG_ERROR(swscale library not found. Please install the swscale library before proceeding)])
#Checks and prompts if libraries found/not found to avoild failure while building
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVCODEC -gt 0 ], [AC_MSG_NOTICE(avcodec library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVCODEC -gt 0 ], [AC_MSG_ERROR(avcodec library not found. Please install the avcodec library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVFORMAT -gt 0 ], [AC_MSG_NOTICE(avformat library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVFORMAT -gt 0 ], [AC_MSG_ERROR(avformat library not found. Please install the avformat library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_AVUTIL -gt 0 ], [AC_MSG_NOTICE(avutil library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_AVUTIL -gt 0 ], [AC_MSG_ERROR(avutil library not found. Please install the avutil library before proceeding)])
AS_IF([ test x$hardsubx = xtrue && test $HAS_SWSCALE -gt 0 ], [AC_MSG_NOTICE(swscale library found)])
AS_IF([ test x$hardsubx = xtrue && test ! $HAS_SWSCALE -gt 0 ], [AC_MSG_ERROR(swscale library not found. Please install the swscale library before proceeding)])
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.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.