Compare commits

...

69 Commits
v0.80 ... v0.81

Author SHA1 Message Date
Carlos Fernandez
933dc50c62 Updates CHANGES.TXT 2016-06-13 12:00:46 -07:00
Kuchumov Ruslan
8b740f4af2 void atom hotfix 2016-06-12 19:59:22 +03:00
Carlos Fernandez
03cd838ff4 Fixed some of the legit warnings from Visual Studio. 2016-06-09 14:16:37 -07:00
Abhishek Vinjamoori
c8aa7b17a7 Corrected initialisation of two variables related to stats 2016-06-09 23:56:01 +05:30
Carlos Fernandez
67fb6235f4 - Fix for signal support (for file rotation) in linux
- Add hack to ignore table_id=0xc0 (Program Information) in PMT without ignoring the full PMT.
2016-06-08 17:54:56 -07:00
Carlos Fernandez
7d5f8031ca Merge branch 'pr/n379_abhishek-vinjamoori' 2016-06-08 10:30:36 -07:00
canihavesomecoffee
b8eec82f2a Update file to copy necessary DLL to output folder
Updates the project file to copy the two DLL's after compiling, so that
we can run from that directory.
2016-06-08 02:50:23 +02:00
canihavesomecoffee
04be7be06b Add OCR build support
Adds OCR build support by creating two new build configs (one debug, one
release) and some instructions about what VS expects on those configs.
2016-06-08 02:25:13 +02:00
Abhishek Vinjamoori
b224b57a43 Added feature list to CHANGES.txt 2016-06-08 00:06:20 +05:30
Abhishek Vinjamoori
f764e23881 Corrected closing of files issue. 2016-06-07 23:55:25 +05:30
Abhishek Vinjamoori
8fefe8c1b3 Fixed memory issues caused by strdup. 2016-06-07 12:47:36 +05:30
Abhishek Vinjamoori
dd93e9d672 Corrected append parameter assignment 2016-06-07 01:27:48 +05:30
Abhishek Vinjamoori
7b69100de9 Changed append parameter into ccx_s_write struct 2016-06-07 00:26:46 +05:30
Abhishek Vinjamoori
9819dbe0c1 Merge remote-tracking branch 'upstream/master' into Rotation 2016-06-06 23:07:03 +05:30
Abhishek Vinjamoori
6a5bb8bab4 Corrected the conditional statement error. File always in create mode 2016-06-06 23:06:41 +05:30
Carlos Fernandez
48878185de Merge branch 'pr/n382_canihavesomecoffee' 2016-06-06 10:24:08 -07:00
Abhishek Vinjamoori
9c5d3cdde1 Added --append paramter for preventing overwriting of files. 2016-06-05 01:26:29 +05:30
canihavesomecoffee
6ea677cd7a Move debug statement to more appropriate location
Now shows reset count for every file switched instead of keeping it
once. Also closes #375
2016-06-04 20:42:18 +02:00
canihavesomecoffee
05e451d41e Rename ccextractor to ccextractorwin for compilation 2016-06-04 20:40:34 +02:00
Abhishek Vinjamoori
ff41c56e82 Removed string errors 2016-06-04 16:53:53 +05:30
Abhishek Vinjamoori
554c1077a0 Modified rotation renaming 2016-06-04 16:09:22 +05:30
Abhishek Vinjamoori
fa563c6542 Removed another debugging statement 2016-06-01 13:26:40 +05:30
Abhishek Vinjamoori
7219f91648 Checked for errors and returning original encoder in such cases. Removed debug statements 2016-06-01 13:21:31 +05:30
Abhishek Vinjamoori
8d22988808 Modified a few parameters. Now feature works fine 2016-06-01 12:50:59 +05:30
Abhishek Vinjamoori
6f249c92d6 File rotation feature 2016-06-01 02:17:55 +05:30
Carlos Fernandez
4a61570a50 On missing headers don't dump the payload by default. 2016-05-27 17:29:48 -07:00
Carlos Fernandez
57b060b15d Added -sem to CHANGES.TXT 2016-05-27 17:16:09 -07:00
Carlos Fernandez
c31b3e823f Add more details on "premature end of file" condition 2016-05-27 16:43:58 -07:00
Carlos Fernandez
5d3aa26cdc Detailed premature end of file error on cut TS 2016-05-27 12:16:27 -07:00
Carlos Fernandez
0b2e12ce0c Changed target to XP 2016-05-27 10:45:27 -07:00
Carlos Fernandez
3a6ed7a243 Added -sem to create a semaphore file when we have an open file so external tools won't move or delete files before they are ready. 2016-05-27 10:43:27 -07:00
Carlos Fernandez
2541666333 Merge branch 'pr/n372_canihavesomecoffee' 2016-05-26 15:11:49 -07:00
Abhinav Shukla
5bcb974b96 Fixes #353 - Memory consumption reduced by 180 MB 2016-05-26 14:37:02 -07:00
Abhinav Shukla
5c65ccc12b Fixing high memory usage 2016-05-26 13:23:10 -07:00
canihavesomecoffee
61ee4b25fe Fixing warnings
- Removed unused variables
- Renamed remainder variables to better name
- Moved sha256_buf to external to avoid C4127 warning
2016-05-26 10:40:19 +02:00
Carlos Fernandez
35017de391 Fix: For MP4 files on multiple inputs CCExtractor was processing always the first file (due to using a hardcoded 0) 2016-05-25 18:38:14 -07:00
Carlos Fernandez
5efe51720c Merge branch 'pr/n367_abhishek-vinjamoori' 2016-05-25 13:28:47 -07:00
canihavesomecoffee
410c39986b Gitignore remove blank line
-
2016-05-25 21:06:37 +02:00
canihavesomecoffee
928f57bd4c Small fix added
-
2016-05-25 20:59:27 +02:00
canihavesomecoffee
6b0e57f07d Update files to reflect upcoming .81
-
2016-05-25 20:58:42 +02:00
Abhishek Vinjamoori
111258d2f0 Removed EXIT variables 2016-05-25 22:26:14 +05:30
Carlos Fernandez
db1fab51f4 Merge branch 'pr/n351_abhishek-vinjamoori' 2016-05-25 08:11:17 -07:00
Abhishek Vinjamoori
04893f4347 Changed the return variable directly without checking 2016-05-25 11:21:52 +05:30
Abhinav Shukla
e1083a030c Removing debug print statement 2016-05-24 10:13:09 -07:00
Abhinav Shukla
fa373115ad Fixing wrong function prototype 2016-05-24 10:05:20 -07:00
Abhinav Shukla
4b8f14eab1 Fixes #139 - Case fixing in teletext 2016-05-24 09:36:49 -07:00
Abhishek Vinjamoori
653795ceef Fixes #315. Force File Buffer Flushing issue. 2016-05-23 23:23:14 +05:30
Abhishek Vinjamoori
115a6103d4 Completed the other statistics 2016-05-23 17:59:49 +05:30
canihavesomecoffee
a238352fb3 Changing file permissions (attempt 2) 2016-05-23 11:57:06 +02:00
canihavesomecoffee
1322f89fcd Fixes
- 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
2016-05-23 11:52:46 +02:00
canihavesomecoffee
c1ec393bed Better small file fix
Not calculating every time, but once the file is opened, using existing
code.
2016-05-22 17:56:39 +02:00
canihavesomecoffee
243cd64d56 Merge remote-tracking branch 'CCExtractor/master' 2016-05-22 11:38:14 +02:00
canihavesomecoffee
e06be2d2f1 Manual implementation of York He Fix
-
2016-05-22 11:35:12 +02:00
Carlos Fernandez
8cfbf87420 Merge branch 'pr/n362_Abhinav95' 2016-05-22 01:30:12 -07:00
canihavesomecoffee
ff3be07df5 Add linux/mac build scripts
-
2016-05-22 09:44:55 +02:00
canihavesomecoffee
a0787e740e Add windows pre-build event
Updates the .h file that contains the build date & git commit hash (if
available)
2016-05-22 08:13:53 +02:00
canihavesomecoffee
e5b21a3a91 Adds --version parameter
Start of the --version parameter. Displays version & file hash already,
git commit & compilation date not yet finished.
2016-05-22 03:50:16 +02:00
canihavesomecoffee
f694c95510 Add hashing library and update makefiles
- 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
2016-05-22 03:49:31 +02:00
canihavesomecoffee
b5731a279a Add compile info header
Will be used to show compilation date & git commit if they're available
2016-05-22 03:47:17 +02:00
canihavesomecoffee
6bb86efa97 Add VS extension to gitignore 2016-05-22 03:45:53 +02:00
Abhinav Shukla
c54027562f Updating CHANGES.txt 2016-05-21 14:42:46 -07:00
Abhinav Shukla
a2163adc95 Merge remote-tracking branch 'upstream/master' 2016-05-21 14:00:57 -07:00
Abhinav Shukla
73c35ccb30 Correcting display of sub mode and info in transcripts 2016-05-21 13:59:27 -07:00
Carlos Fernandez
bcfdda5f8d Merge branch 'pr/n357_gshruti95' 2016-05-20 19:06:52 -07:00
Abhinav Shukla
1dd5e3089c Fix #359 - Teletext page number in -ucla 2016-05-19 12:06:58 -07:00
Shruti
74c1d6d30d Fixes #354 : Excessive XDS notices 2016-05-10 19:55:47 +05:30
Shruti
0579d7d8d7 Fixes #354 : Excessive XDS notices 2016-05-10 19:51:08 +05:30
Shruti
1d31c784e7 Fixes #354 : Excessive XDS notices 2016-05-10 19:50:16 +05:30
David Liontooth
b385fa74b0 Update build.command
Include zvbi to fix #346
2016-04-16 16:17:47 -07:00
49 changed files with 2320 additions and 894 deletions

15
.gitignore vendored
View File

@@ -9,8 +9,8 @@ CVS
*.o
linux/ccextractor
linux/depend
windows/debug/**
windows/release/**
windows/Debug/**
windows/Release/**
build/
####
@@ -20,3 +20,14 @@ build/
*.sdf
*.opensdf
*.user
*.opendb
####
# Ignore the header file that is updated upon build
src/lib_ccx/compile_info.h
#### Ignore windows OCR libraries and folders
windows/libs/leptonica/**
windows/libs/tesseract/**
windows/Release-OCR/**
windows/Debug-OCR/**

View File

@@ -1,3 +1,42 @@
0.81 (2016-06-13)
-----------------
- New: --version parameter for extensive version information (version number, compile date, executable hash, git commit (if appropriate))
- New: Add -sem (semaphore) to create a .sem file when an output file is open and delete it when it's closed.
- New: Add --append parameter. This will prevent overwriting of exisiting files.
- New: File Rotation support added. The user has to send a USR1 signal to rotate.
- Fix: Issues with files <1 Mb
- Fix: Preview of generated transcript.
- Fix: Statistics were not generated anymore.
- Fix: Correcting display of sub mode and info in transcripts.
- Fix: Teletext page number displayed in -UCLA.
- Fix: Removal of excessive XDS notices about aspect ratio info.
- Fix: Force Flushing of file buffers works for all files now.
- Fix: mp4 void atoms that was causing some .mp4 files to fail.
- Fix: Memory usage caused by EPG processing was high due to many non-dynamic buffers.
- Fix: Project files for Visual Studio now include OCR support in Windows.
0.80 (2016-04-24)
-----------------
- Fix: "Premature end of file" (one of the scenarios)
- Fix: XDS data is always parsed again (needed to extract information such as program name)
- Fix: Teletext parsing: @ was incorrectly exported as * - X/26 packet specifications in ETS 300 706 v1.2.1 now better followed
- Fix: Teletext parsing: Latin G2 subsets and accented characters not displaying properly
- Fix: Timing in -ucla
- Fix: Timing in ISDB (some instances)
- Fix: "mfra" mp4 box weight changed to 1 (this helps with correct file format detection)
- Fix: Fix for TARGET File is null.
- Fix: Fixed SegFaults while parsing parameters (if mandatory parameter is not present in -outinterval, -codec or -nocodec)
- Fix: Crash when input small is too small
- Fix: Update some URLs in code (references to docs)
- Fix: -delay now updates final timestamp in ISDB, too
- Fix: Removed minor compiler warnings
- Fix: Visual Studio solution files working again
- Fix: ffmpeg integration working again
- New: Added --forceflush (-ff). If used, output file descriptors will be flushed immediately after being written to
- New: Hexdump XDS packets that we cannot parse (shouldn't be many of those anyway)
- New: If input file cannot be open, provide a decent human readable explanation
- New: GXF support
0.79 (2016-01-09)
-----------------
- Support for Grid Format (g608)

View File

@@ -1,4 +1,4 @@
ccextractor, 0.79
ccextractor, 0.81
-----------------
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
Maintainer: cfsmp3
@@ -14,12 +14,12 @@ You can subscribe to new releases notifications at freshmeat:
http://freshmeat.net/projects/ccextractor
Google Summer of Code 2014 students
- Willem van iseghem
- Willem Van Iseghem
- Ruslan KuchumoV
- Anshul Maheshwari
Google Summer of Code 2015 students
- Willem van iseghem
- Willem Van Iseghem
- Ruslan Kuchumov
- Anshul Maheshwari
- Nurendra Choudhary

View File

@@ -3,7 +3,7 @@ SHELL = /bin/sh
CC = gcc
SYS := $(shell gcc -dumpmachine)
CFLAGS = -O3 -std=gnu99
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/zlib -I../src/lib_ccx -I../src/.
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/lib_hash -I../src/zlib -I../src/lib_ccx -I../src/.
INCLUDE += -I../src/zvbi
ALL_FLAGS = -Wno-write-strings -D_FILE_OFFSET_BITS=64
LDFLAGS = -lm
@@ -14,7 +14,7 @@ endif
TARGET = ccextractor
OBJS_DIR = objs
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib:../src/lib_ccx:../src/zvbi
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib:../src/lib_ccx:../src/zvbi:../src/lib_hash
SRCS_DIR = ../src
SRCS_C = $(wildcard $(SRCS_DIR)/*.c)
@@ -42,6 +42,10 @@ SRCS_ZLIB_DIR = $(SRCS_DIR)/zlib
SRCS_ZLIB = $(wildcard $(SRCS_ZLIB_DIR)/*.c)
OBJS_ZLIB = $(SRCS_ZLIB:$(SRCS_ZLIB_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_HASH_DIR = $(SRCS_DIR)/lib_hash
SRCS_HASH = $(wildcard $(SRCS_HASH_DIR)/*.c)
OBJS_HASH = $(SRCS_HASH:$(SRCS_HASH_DIR)/%.c=$(OBJS_DIR)/%.o)
INSTLALL = cp -f -p
INSTLALL_PROGRAM = $(INSTLALL)
DESTDIR = /usr/bin
@@ -83,14 +87,14 @@ LDFLAGS+= $(shell pkg-config --libs libavutil )
endif
.PHONY: all
all: objs_dir $(TARGET)
all: pre-build objs_dir $(TARGET)
.PHONY: objs_dir
objs_dir:
mkdir -p $(OBJS_DIR)
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZVBI) $(OBJS_ZLIB) $(OBJS_CCX)
$(CC) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZVBI) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(LDFLAGS) -o $@
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZVBI) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_CCX)
$(CC) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZVBI) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(OBJS_HASH) $(LDFLAGS) -o $@
$(OBJS_DIR)/%.o: %.c
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@
@@ -104,7 +108,7 @@ $(OBJS_DIR)/ccextractor.o: ccextractor.c
.PHONY: clean
clean:
rm -rf $(TARGET) 2>/dev/null || true
rm -rf $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS) 2>/dev/null || true
rm -rf $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS_HASH) $(OBJS) 2>/dev/null || true
rm -rdf $(OBJS_DIR) 2>/dev/null || true
rm -rf .depend 2>/dev/null || true
@@ -118,8 +122,12 @@ uninstall:
.PHONY: depend dep
depend dep:
$(CC) $(CFLAGS) $(INCLUDE) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZVBI) $(SRCS_ZLIB) $(SRCS_CCX) \
$(CC) $(CFLAGS) $(INCLUDE) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZVBI) $(SRCS_ZLIB) $(SRCS_HASH) $(SRCS_CCX) \
$(SRCS_GPACMP4_C) $(SRCS_GPACMP4_CPP) |\
sed 's/^[a-zA-Z_0-9]*.o/$(OBJS_DIR)\/&/' > .depend
.PHONY: pre-build
pre-build:
./pre-build.sh
-include .depend

View File

@@ -1,12 +1,14 @@
#!/bin/bash
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64"
BLD_INCLUDE="-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi"
BLD_INCLUDE="-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash"
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')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH"
BLD_LINKER="-lm -zmuldefs"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

View File

@@ -1,12 +1,14 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64"
BLD_INCLUDE="-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi"
BLD_INCLUDE="-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash"
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')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH"
BLD_LINKER="-lm -zmuldefs"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

34
linux/pre-build.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
echo "Obtaining Git commit"
commit=(`git rev-parse HEAD 2>/dev/null`)
if [ -z "$commit" ]; then
echo "Git command not present, trying folder approach"
if [ -d "../.git" ]; then
echo "Git folder found, using HEAD file"
head="`cat ../.git/HEAD`"
ref_pos=(`expr match "$head" 'ref: '`)
if [ $ref_pos -eq 5 ]; then
echo "HEAD file contains a ref, following"
commit=(`cat "../.git/${head:5}"`)
echo "Extracted commit: $commit"
else
echo "HEAD contains a commit, using it"
commit="$head"
echo "Extracted commit: $commit"
fi
fi
fi
if [ -z "$commit" ]; then
commit="Unknown"
fi
builddate=`date +%Y-%m-%d`
echo "Storing variables in file"
echo "Commit: $commit"
echo "Date: $builddate"
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_H" > ../src/lib_ccx/compile_info.h
echo "#define CCX_CCEXTRACTOR_COMPILE_H" >> ../src/lib_ccx/compile_info.h
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info.h
echo "#endif" >> ../src/lib_ccx/compile_info.h
echo "Stored all in compile.h"
echo "Done."

View File

@@ -1,12 +1,17 @@
#!/bin/bash
cd `dirname $0`
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
BLD_INCLUDE="-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_LIBPNG"
BLD_INCLUDE="-I../src/lib_ccx -I../src/gpacmp4 -I../src/libpng -I../src/zlib -I../src/zvbi -I../src/lib_hash"
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_LIB_HASH="$(find ../src/lib_hash -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZVBI $SRC_ZLIB $SRC_LIBPNG $SRC_LIB_HASH"
BLD_LINKER="-lm -liconv"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

34
mac/pre-build.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
echo "Obtaining Git commit"
commit=(`git rev-parse HEAD 2>/dev/null`)
if [ -z "$commit" ]; then
echo "Git command not present, trying folder approach"
if [ -d "../.git" ]; then
echo "Git folder found, using HEAD file"
head="`cat ../.git/HEAD`"
ref_pos=(`expr match "$head" 'ref: '`)
if [ $ref_pos -eq 5 ]; then
echo "HEAD file contains a ref, following"
commit=(`cat "../.git/${head:5}"`)
echo "Extracted commit: $commit"
else
echo "HEAD contains a commit, using it"
commit="$head"
echo "Extracted commit: $commit"
fi
fi
fi
if [ -z "$commit" ]; then
commit="Unknown"
fi
builddate=`date +%Y-%m-%d`
echo "Storing variables in file"
echo "Commit: $commit"
echo "Date: $builddate"
echo "#ifndef CCX_CCEXTRACTOR_COMPILE_H" > ../src/lib_ccx/compile_info.h
echo "#define CCX_CCEXTRACTOR_COMPILE_H" >> ../src/lib_ccx/compile_info.h
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info.h
echo "#endif" >> ../src/lib_ccx/compile_info.h
echo "Stored all in compile.h"
echo "Done."

View File

@@ -105,8 +105,8 @@ int main(int argc, char *argv[])
#ifndef _WIN32
signal_ctx = ctx;
m_signal(SIGINT, sigint_handler);
create_signal();
#endif
while (switch_to_next_file(ctx, 0))
{
prepare_for_new_file(ctx);
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
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
processmp4 (ctx, &ctx->mp4_cfg, ctx->inputfile[0]);
processmp4(ctx, &ctx->mp4_cfg, ctx->inputfile[ctx->current_file]);
if (ccx_options.print_file_reports)
print_file_report(ctx);
break;
@@ -270,7 +270,7 @@ int main(int argc, char *argv[])
+(LLONG) ((dec_ctx->frames_since_last_gop)*1000/29.97)) );
}
/* if (dec_ctx->false_pict_header)
if (dec_ctx->false_pict_header)
mprint ("\nNumber of likely false picture headers (discarded): %d\n",dec_ctx->false_pict_header);
if (dec_ctx->stat_numuserheaders)
@@ -294,7 +294,7 @@ int main(int argc, char *argv[])
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");
}*/
}
}
@@ -322,7 +322,6 @@ int main(int argc, char *argv[])
s1, s2);
}
#endif
dbg_print(CCX_DMT_708, "[CEA-708] The 708 decoder was reset [%d] times.\n", ctx->freport.data_from_708->reset_count);
if (is_decoder_processed_enough(ctx) == CCX_TRUE)
{

View File

@@ -76,7 +76,14 @@ GF_Err gf_isom_parse_box_ex(GF_Box **outBox, GF_BitStream *bs, u32 parent_type)
if (!size) {
type = gf_bs_peek_bits(bs, 32, 0);
if (!isalnum((type>>24)&0xFF) || !isalnum((type>>16)&0xFF) || !isalnum((type>>8)&0xFF) || !isalnum(type&0xFF)) {
size = 4;
/* size = 4; */
/* In some files there are a single 0x00 at the end of atom. When the size is set to 4, */
/* but parent atom expects this atom to be 1 byte, it causes GF_ISOM_INCOMPLETE_FILE. */
/* In case there are multiple 0x00 bytes at the end, they will be handled individually, I hope :) */
size = 1;
hdr_size = 1;
type = GF_ISOM_BOX_TYPE_VOID;
} else {
goto proceed_box;
@@ -102,7 +109,7 @@ proceed_box:
}
//handle large box
if (size == 1) {
if (size == 1 && type != GF_ISOM_BOX_TYPE_VOID) {
size = gf_bs_read_u64(bs);
hdr_size += 8;
}

View File

@@ -56,7 +56,8 @@ void init_options (struct ccx_s_options *options)
options->xmltvoutputinterval=0; // interval in seconds between writting xmltv full file output
options->xmltvonlycurrent=0; // 0 off 1 on
options->keep_output_closed = 0; // By default just keep the file open.
options->force_flush = 0; // Don't flush whenever content is writtern.
options->force_flush = 0; // Don't flush whenever content is written.
options->append_mode = 0; //By default, files are overwritten.
options->ucla = 0; // By default, -UCLA not used
options->transcript_settings = ccx_encoders_default_transcript_settings;
@@ -108,6 +109,7 @@ void init_options (struct ccx_s_options *options)
options->enc_cfg.no_bom = 0; // Use BOM by default.
options->enc_cfg.services_charsets = NULL;
options->enc_cfg.all_services_charset = NULL;
options->enc_cfg.with_semaphore = 0;
options->settings_dtvcc.enabled = 0;
options->settings_dtvcc.active_services_count = 0;

View File

@@ -36,6 +36,7 @@ struct encoder_cfg
enum ccx_output_format write_format; // 0=Raw, 1=srt, 2=SMI
int keep_output_closed;
int force_flush; // Force flush on content write
int append_mode; //Append mode for output files
int ucla; // 1 if -UCLA used, 0 if not
enum ccx_encoding_type encoding;
@@ -44,6 +45,7 @@ struct encoder_cfg
int autodash; // Add dashes (-) before each speaker automatically?
int trim_subs; // " Remove spaces at sides? "
int sentence_cap ; // FIX CASE? = Fix case?
int with_semaphore; // Write a .sem file on file open and delete it on close?
/* Credit stuff */
char *start_credits_text;
char *end_credits_text;
@@ -116,6 +118,7 @@ struct ccx_s_options // Options from user parameters
int xmltvonlycurrent; // 0 off 1 on
int keep_output_closed;
int force_flush; // Force flush on content write
int append_mode; //Append mode for output files
int ucla; // 1 if UCLA used, 0 if not
ccx_encoders_transcript_format transcript_settings; // Keeps the settings for generating transcript output files.

View File

@@ -285,9 +285,10 @@ struct lib_cc_decode* init_cc_decode (struct ccx_decoders_common_settings_t *set
ctx->max_gop_length = 0;
ctx->has_ccdata_buffered = 0;
ctx->in_bufferdatatype = CCX_UNKNOWN;
ctx->frames_since_last_gop = 0;
/* ctx->stat_numuserheaders = 0;
ctx->frames_since_last_gop = 0;
ctx->total_pulldownfields = 0;
ctx->total_pulldownframes = 0;
ctx->stat_numuserheaders = 0;
ctx->stat_dvdccheaders = 0;
ctx->stat_scte20ccheaders = 0;
ctx->stat_replay5000headers = 0;
@@ -295,7 +296,7 @@ struct lib_cc_decode* init_cc_decode (struct ccx_decoders_common_settings_t *set
ctx->stat_dishheaders = 0;
ctx->stat_hdtv = 0;
ctx->stat_divicom = 0;
ctx->false_pict_header = 0;*/
ctx->false_pict_header = 0;
memcpy(&ctx->extraction_start, &setting->extraction_start,sizeof(struct ccx_boundary_time));
memcpy(&ctx->extraction_end, &setting->extraction_end,sizeof(struct ccx_boundary_time));

View File

@@ -373,6 +373,7 @@ static int reserve_buf(struct ISDBText *text, size_t len)
text->buf = ptr;
text->len = blen;
isdb_log ("expanded ctx->text(%lu)\n", blen);
return CCX_OK;
}
static int append_char(ISDBSubContext *ctx, const char ch)

View File

@@ -167,7 +167,7 @@ struct lib_cc_decode
unsigned top_field_first; // Needs to be global
/* Stats. Modified in es_userdata.c*/
/* int stat_numuserheaders;
int stat_numuserheaders;
int stat_dvdccheaders;
int stat_scte20ccheaders;
int stat_replay5000headers;
@@ -175,7 +175,7 @@ struct lib_cc_decode
int stat_dishheaders;
int stat_hdtv;
int stat_divicom;
int false_pict_header;*/
int false_pict_header;
ccx_dtvcc_ctx *dtvcc;
int current_field;

View File

@@ -116,6 +116,9 @@ typedef struct ccx_decoders_xds_context
int cur_xds_packet_type;
struct ccx_common_timing_ctx *timing;
unsigned current_ar_start;
unsigned current_ar_end;
int xds_write_to_file; // Set to 1 if XDS data is to be written to file
} ccx_decoders_xds_context_t;
@@ -704,6 +707,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_
case XDS_TYPE_ASPECT_RATIO_INFO:
{
unsigned ar_start, ar_end;
int changed = 0;
was_proc = 1;
if (ctx->cur_xds_payload_length < 5) // We need 2 data bytes
break;
@@ -716,8 +720,20 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_
ar_end = 262 - (ctx->cur_xds_payload[3] & 0x1F);
unsigned active_picture_height = ar_end - ar_start;
float aspect_ratio = (float) 320 / active_picture_height;
ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start,ar_end);
ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio);
if (ar_start != ctx->current_ar_start)
{
ctx->current_ar_start = ar_start;
ctx->current_ar_end = ar_end;
changed = 1;
ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start, ar_end);
ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio);
}
else
{
ccx_common_logging.debug_ftn(CCX_DMT_DECODER_XDS, "\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start, ar_end);
ccx_common_logging.debug_ftn(CCX_DMT_DECODER_XDS, "\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio);
}
}
case XDS_TYPE_PROGRAM_DESC_1:

View File

@@ -168,7 +168,7 @@ static int ccx_demuxer_open(struct ccx_demuxer *ctx, const char *file)
{
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
case CCX_SM_PROGRAM:
if ( detect_myth(ctx->parent) )
if ( detect_myth(ctx) )
{
ctx->stream_mode=CCX_SM_MYTH;
}

View File

@@ -13,7 +13,7 @@
#ifdef WIN32
int fsync(int fd)
{
FlushFileBuffers(fd);
return FlushFileBuffers((HANDLE)_get_osfhandle(fd)) ? 0 : -1;
}
#endif
@@ -616,12 +616,15 @@ int write_cc_subtitle_as_transcript(struct cc_subtitle *sub, struct encoder_ctx
if(context->in_fileformat == 1)
//TODO, data->my_field == 1 ? data->channel : data->channel + 2); // Data from field 2 is CC3 or 4
fdprintf(context->out->fh, "CC?|");
else if (!context->ucla)
else if (!context->ucla || !strcmp(sub->mode,"TLT"))
fdprintf(context->out->fh, sub->info);
}
if (context->transcript_settings->showMode)
{
fdprintf(context->out->fh, "%s|", sub->mode);
if(context->ucla && strcmp(sub->mode,"TLT") == 0)
fdprintf(context->out->fh, "|");
else
fdprintf(context->out->fh, "%s|", sub->mode);
}
ret = write(context->out->fh, context->subline, length);
if(ret < length)
@@ -1081,19 +1084,14 @@ static int init_output_ctx(struct encoder_ctx *ctx, struct encoder_cfg *cfg)
basefilename = get_basename(cfg->output_filename);
extension = get_file_extension(cfg->write_format);
ret = init_write(&ctx->out[0], strdup(cfg->output_filename));
ret = init_write(&ctx->out[0], strdup(cfg->output_filename), cfg->with_semaphore);
check_ret(cfg->output_filename);
ret = init_write(&ctx->out[1], create_outfilename(basefilename, "_2", extension));
ret = init_write(&ctx->out[1], create_outfilename(basefilename, "_2", extension), cfg->with_semaphore);
check_ret(ctx->out[1].filename);
}
else if (cfg->extract == 1)
{
ret = init_write(ctx->out, strdup(cfg->output_filename));
check_ret(cfg->output_filename);
}
else
{
ret = init_write(ctx->out, strdup(cfg->output_filename));
ret = init_write(ctx->out, strdup(cfg->output_filename), cfg->with_semaphore );
check_ret(cfg->output_filename);
}
}
@@ -1104,19 +1102,14 @@ static int init_output_ctx(struct encoder_ctx *ctx, struct encoder_cfg *cfg)
if (cfg->extract == 12)
{
ret = init_write(&ctx->out[0], create_outfilename(basefilename, "_1", extension));
ret = init_write(&ctx->out[0], create_outfilename(basefilename, "_1", extension), cfg->with_semaphore);
check_ret(ctx->out[0].filename);
ret = init_write(&ctx->out[1], create_outfilename(basefilename, "_2", extension));
ret = init_write(&ctx->out[1], create_outfilename(basefilename, "_2", extension), cfg->with_semaphore);
check_ret(ctx->out[1].filename);
}
else if (cfg->extract == 1)
{
ret = init_write(ctx->out, create_outfilename(basefilename, NULL, extension));
check_ret(ctx->out->filename);
}
else
{
ret = init_write(ctx->out, create_outfilename(basefilename, NULL, extension));
ret = init_write(ctx->out, create_outfilename(basefilename, NULL, extension), cfg->with_semaphore);
check_ret(ctx->out->filename);
}
}
@@ -1326,6 +1319,8 @@ int encode_sub(struct encoder_ctx *context, struct cc_subtitle *sub)
if(!context)
return CCX_OK;
context = change_filename(context);
if (sub->type == CC_608)
{
struct eia608_screen *data = NULL;

View File

@@ -73,6 +73,39 @@ void correct_case(int line_num, struct eia608_screen *data)
free(line);
}
void telx_correct_case(char *sub_line)
{
char delim[64] = {
' ', '\n', '\r', 0x89, 0x99,
'!', '"', '#', '%', '&',
'\'', '(', ')', ';', '<',
'=', '>', '?', '[', '\\',
']', '*', '+', ',', '-',
'.', '/', ':', '^', '_',
'{', '|', '}', '~', '\0' };
char *line = strdup(((char*)sub_line));
char *oline = (char*)sub_line;
char *c = strtok(line, delim);
if (c == NULL)
{
free(line);
return;
}
do
{
char **index = bsearch(&c, spell_lower, spell_words, sizeof(*spell_lower), string_cmp);
if (index)
{
char *correct_c = *(spell_correct + (index - spell_lower));
size_t len = strlen(correct_c);
memcpy(oline + (c - line), correct_c, len);
}
} while ((c = strtok(NULL, delim)) != NULL);
free(line);
}
void capitalize(struct encoder_ctx *context, int line_num, struct eia608_screen *data)
{
for (int i = 0; i < CCX_DECODER_608_SCREEN_WIDTH; i++)

View File

@@ -24,6 +24,7 @@ struct ccx_encoders_helpers_settings_t {
// Helper functions
void correct_case(int line_num, struct eia608_screen *data);
void capitalize(struct encoder_ctx *context, int line_num, struct eia608_screen *data);
void telx_correct_case(char *sub_line);
unsigned get_decoder_line_encoded_for_gui(unsigned char *buffer, int line_num, struct eia608_screen *data);
unsigned get_decoder_line_encoded(struct encoder_ctx *ctx, unsigned char *buffer, int line_num, struct eia608_screen *data);

View File

@@ -159,6 +159,7 @@ int write_cc_subtitle_as_srt(struct cc_subtitle *sub,struct encoder_ctx *context
ret = write_stringz_as_srt(sub->data, context, sub->start_time, sub->end_time);
freep(&sub->data);
sub->nb_data = 0;
ret = 1;
}
lsub = sub;
sub = sub->next;

View File

@@ -19,6 +19,11 @@ struct ccx_s_write
int temporarily_closed; // 1 means the file was created OK before but we released the handle
char *filename;
void* spupng_data;
int with_semaphore; // 1 means create a .sem file when the file is open and delete it when it's closed
char *semaphore_filename;
int renaming_extension; //Used for file rotations
int append_mode; /* Append the file. Prevent overwriting of files */
};
#endif

View File

@@ -0,0 +1,5 @@
#ifndef CCX_CCEXTRACTOR_COMPILE_H
#define CCX_CCEXTRACTOR_COMPILE_H
#define GIT_COMMIT "Unknown"
#define COMPILE_DATE "Unknown"
#endif

View File

@@ -24,7 +24,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
}
// Do something
//ctx->stat_numuserheaders++;
ctx->stat_numuserheaders++;
//header+=4;
unsigned char *ud_header = next_bytes(ustream, 4);
@@ -39,7 +39,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
// <http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_FORMAT.HTML>
if ( !memcmp(ud_header,"\x43\x43", 2 ) )
{
// ctx->stat_dvdccheaders++;
ctx->stat_dvdccheaders++;
// Probably unneeded, but keep looking for extra caption blocks
int maybeextracb = 1;
@@ -145,7 +145,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
{
unsigned char cc_data[3*31+1]; // Maximum cc_count is 31
// ctx->stat_scte20ccheaders++;
ctx->stat_scte20ccheaders++;
read_bytes(ustream, 2); // "03 01"
unsigned cc_count = (unsigned int) read_bits(ustream,5);
@@ -206,12 +206,12 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
&& ud_header[1] == 0x02 )
{
unsigned char data[3];
#if 0
if (ud_header[0]==0xbb)
ctx->stat_replay4000headers++;
else
ctx->stat_replay5000headers++;
#endif
read_bytes(ustream, 2); // "BB 02" or "99 02"
data[0]=0x05; // Field 2
@@ -227,7 +227,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
// HDTV - see A/53 Part 4 (Video)
else if ( !memcmp(ud_header,"\x47\x41\x39\x34", 4 ) )
{
// ctx->stat_hdtv++;
ctx->stat_hdtv++;
read_bytes(ustream, 4); // "47 41 39 34"
@@ -288,7 +288,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
dbg_print(CCX_DMT_VERBOSE, "Reading Dish Network user data\n");
// ctx->stat_dishheaders++;
ctx->stat_dishheaders++;
read_bytes(ustream, 2); // "05 02"
@@ -453,7 +453,7 @@ int user_data(struct lib_cc_decode *ctx, struct bitstream *ustream, int udtype,
else if ( !memcmp(ud_header,"\x02\x09", 2 ) )
{
// Either a documentation or more examples are needed.
// ctx->stat_divicom++;
ctx->stat_divicom++;
unsigned char data[3];

View File

@@ -83,18 +83,21 @@ void prepare_for_new_file (struct lib_ccx_ctx *ctx)
pts_big_change = 0;
firstcall = 1;
for(int x = 0; x < 0xfff; x++)
if(ctx->epg_inited)
{
ctx->epg_buffers[x].buffer = NULL;
ctx->epg_buffers[x].ccounter = 0;
for(int x = 0; x < 0xfff; x++)
{
ctx->epg_buffers[x].buffer = NULL;
ctx->epg_buffers[x].ccounter = 0;
}
for (int i = 0; i < TS_PMT_MAP_SIZE; i++)
{
ctx->eit_programs[i].array_len = 0;
ctx->eit_current_events[i] = -1;
}
ctx->epg_last_output = -1;
ctx->epg_last_live_output = -1;
}
for (int i = 0; i < TS_PMT_MAP_SIZE; i++)
{
ctx->eit_programs[i].array_len = 0;
ctx->eit_current_events[i] = -1;
}
ctx->epg_last_output = -1;
ctx->epg_last_live_output = -1;
}
/* Close input file if there is one and let the GUI know */
@@ -135,6 +138,7 @@ int switch_to_next_file (struct lib_ccx_ctx *ctx, LLONG bytesinbuffer)
/* Close current and make sure things are still sane */
if (ctx->demux_ctx->is_open(ctx->demux_ctx))
{
dbg_print(CCX_DMT_708, "[CEA-708] The 708 decoder was reset [%d] times.\n", ctx->freport.data_from_708->reset_count);
if (ccx_options.print_file_reports)
print_file_report(ctx);
@@ -298,6 +302,7 @@ void return_to_buffer (struct ccx_demuxer *ctx, unsigned char *buffer, unsigned
*/
size_t buffered_read_opt (struct ccx_demuxer *ctx, unsigned char *buffer, size_t bytes)
{
size_t origin_buffer_size = bytes;
size_t copied = 0;
time_t seconds = 0;
@@ -390,7 +395,7 @@ size_t buffered_read_opt (struct ccx_demuxer *ctx, unsigned char *buffer, size_t
{
/* If live stream, don't try to switch - acknowledge eof here as it won't
cause a loop end */
if (ccx_options.live_stream || !(ccx_options.binary_concat && switch_to_next_file(ctx->parent, copied)))
if (ccx_options.live_stream || ((struct lib_ccx_ctx *)ctx->parent)->inputsize <= origin_buffer_size || !(ccx_options.binary_concat && switch_to_next_file(ctx->parent, copied)))
eof = 1;
}
ctx->filebuffer_pos = keep;

View File

@@ -582,7 +582,7 @@ int process_data(struct encoder_ctx *enc_ctx, struct lib_cc_decode *dec_ctx, str
else if (data_node->bufferdatatype == CCX_TELETEXT)
{
//telxcc_update_gt(dec_ctx->private_data, ctx->demux_ctx->global_timestamp);
ret = tlt_process_pes_packet (dec_ctx, data_node->buffer, data_node->len, dec_sub);
ret = tlt_process_pes_packet (dec_ctx, data_node->buffer, data_node->len, dec_sub, enc_ctx->sentence_cap);
if(ret == CCX_EINVAL)
return ret;
got = data_node->len;

View File

@@ -98,6 +98,29 @@ struct lib_ccx_ctx* init_libraries(struct ccx_s_options *opt)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "lib_ccx_ctx");
memset(ctx, 0, sizeof(struct lib_ccx_ctx));
if(opt->xmltv)
{
ctx->epg_inited = 1;
ctx->epg_buffers = (struct PSI_buffer *)malloc(sizeof(struct PSI_buffer)*(0xfff+1));
ctx->eit_programs = (struct EIT_program *)malloc(sizeof(struct EIT_program)*(TS_PMT_MAP_SIZE+1));
ctx->eit_current_events = (int32_t *)malloc(sizeof(int32_t)*(TS_PMT_MAP_SIZE+1));
ctx->ATSC_source_pg_map = (int16_t *)malloc(sizeof(int16_t)*(0xffff));
memset(ctx->epg_buffers, 0, sizeof(struct PSI_buffer)*(0xfff+1));
memset(ctx->eit_programs, 0, sizeof(struct EIT_program)*(TS_PMT_MAP_SIZE+1));
memset(ctx->eit_current_events, 0, sizeof(int32_t)*(TS_PMT_MAP_SIZE+1));
memset(ctx->ATSC_source_pg_map, 0, sizeof(int16_t)*(0xffff));
if(!ctx->epg_buffers || !ctx->eit_programs || !ctx->eit_current_events || !ctx->ATSC_source_pg_map)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "lib_ccx_ctx");
}
else
{
ctx->epg_inited = 0;
ctx->epg_buffers = NULL;
ctx->eit_programs = NULL;
ctx->eit_current_events = NULL;
ctx->ATSC_source_pg_map = NULL;
}
struct ccx_decoder_608_report *report_608 = malloc(sizeof(struct ccx_decoder_608_report));
if (!report_608)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "report_608");

View File

@@ -1,7 +1,7 @@
#ifndef CCX_CCEXTRACTOR_H
#define CCX_CCEXTRACTOR_H
#define VERSION "0.79"
#define VERSION "0.81"
// Load common includes and constants for library usage
#include "ccx_common_platform.h"
@@ -115,10 +115,11 @@ struct lib_ccx_ctx
unsigned teletext_warning_shown; // Did we detect a possible PAL (with teletext subs) and told the user already?
struct PSI_buffer epg_buffers[0xfff+1];
struct EIT_program eit_programs[TS_PMT_MAP_SIZE+1];
int32_t eit_current_events[TS_PMT_MAP_SIZE+1];
int16_t ATSC_source_pg_map[0xffff];
int epg_inited;
struct PSI_buffer *epg_buffers;
struct EIT_program *eit_programs;
int32_t *eit_current_events;
int16_t *ATSC_source_pg_map;
int epg_last_output;
int epg_last_live_output;
struct file_report freport;
@@ -201,7 +202,7 @@ void print_file_report(struct lib_ccx_ctx *ctx);
void dinit_write(struct ccx_s_write *wb);
int temporarily_open_output(struct ccx_s_write *wb);
int temporarily_close_output(struct ccx_s_write *wb);
int init_write (struct ccx_s_write *wb,char *filename);
int init_write(struct ccx_s_write *wb, char *filename, int with_semaphore);
int writeraw (const unsigned char *data, int length, void *private_data, struct cc_subtitle *sub);
void flushbuffer (struct lib_ccx_ctx *ctx, struct ccx_s_write *wb, int closefile);
void writercwtdata (struct lib_cc_decode *ctx, const unsigned char *data, struct cc_subtitle *sub);
@@ -240,6 +241,9 @@ void timestamp_to_srttime(uint64_t timestamp, char *buffer);
void timestamp_to_smptetttime(uint64_t timestamp, char *buffer);
int levenshtein_dist (const uint64_t *s1, const uint64_t *s2, unsigned s1len, unsigned s2len);
void millis_to_date (uint64_t timestamp, char *buffer, enum ccx_output_date_format date_format, char millis_separator);
void create_signal(void);
void signal_handler(int sig_type);
struct encoder_ctx* change_filename(struct encoder_ctx*);
#ifndef _WIN32
void m_signal(int sig, void (*func)(int));
#endif
@@ -248,7 +252,7 @@ void m_signal(int sig, void (*func)(int));
void buffered_seek (struct ccx_demuxer *ctx, int offset);
extern void build_parity_table(void);
int tlt_process_pes_packet(struct lib_cc_decode *dec_ctx, uint8_t *buffer, uint16_t size, struct cc_subtitle *sub);
int tlt_process_pes_packet(struct lib_cc_decode *dec_ctx, uint8_t *buffer, uint16_t size, struct cc_subtitle *sub, int sentence_cap);
void* telxcc_init(void);
void telxcc_close(void **ctx, struct cc_subtitle *sub);
void tlt_read_rcwt(void *codec, unsigned char *buf, struct cc_subtitle *sub);

View File

@@ -11,6 +11,9 @@ void dinit_write(struct ccx_s_write *wb)
if (wb->fh > 0)
close(wb->fh);
freep(&wb->filename);
if (wb->with_semaphore && wb->semaphore_filename)
unlink(wb->semaphore_filename);
freep(&wb->semaphore_filename);
}
int temporarily_close_output(struct ccx_s_write *wb)
@@ -18,6 +21,7 @@ int temporarily_close_output(struct ccx_s_write *wb)
close(wb->fh);
wb->fh = -1;
wb->temporarily_closed = 1;
return 0;
}
int temporarily_open_output(struct ccx_s_write *wb)
@@ -41,18 +45,38 @@ int temporarily_open_output(struct ccx_s_write *wb)
int init_write (struct ccx_s_write *wb, char *filename)
int init_write (struct ccx_s_write *wb, char *filename, int with_semaphore)
{
memset(wb, 0, sizeof(struct ccx_s_write));
wb->fh=-1;
wb->temporarily_closed = 0;
wb->filename = filename;
wb->with_semaphore = with_semaphore;
wb->append_mode = ccx_options.enc_cfg.append_mode;
mprint ("Creating %s\n", filename);
wb->fh = open (filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE);
if(!(wb->append_mode))
wb->fh = open (filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE);
else
wb->fh = open (filename, O_RDWR | O_CREAT | O_APPEND | O_BINARY, S_IREAD | S_IWRITE);
wb->renaming_extension = 0;
if (wb->fh == -1)
{
return CCX_COMMON_EXIT_FILE_CREATION_FAILED;
}
if (with_semaphore)
{
wb->semaphore_filename = (char *)malloc(strlen(filename) + 6);
if (!wb->semaphore_filename)
return EXIT_NOT_ENOUGH_MEMORY;
sprintf(wb->semaphore_filename, "%s.sem", filename);
int t = open(wb->semaphore_filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE);
if (t == -1)
{
close(wb->fh);
return CCX_COMMON_EXIT_FILE_CREATION_FAILED;
}
close(t);
}
return EXIT_OK;
}

View File

@@ -5,6 +5,8 @@
#include "ccx_encoders_helpers.h"
#include "ccx_common_common.h"
#include "ccx_decoders_708.h"
#include "compile_info.h"
#include "../lib_hash/sha2.h"
static int inputfile_capacity=0;
@@ -274,7 +276,7 @@ void usage (void)
mprint (" .mp4, HDHomeRun are known to work).\n\n");
mprint (" Syntax:\n");
mprint (" ccextractor [options] inputfile1 [inputfile2...] [-o outputfilename]\n");
mprint (" [-o1 outputfilename1] [-o2 outputfilename2]\n\n");
mprint ("\n");
mprint ("To see This Help Message: -h or --help\n\n");
mprint ("File name related options:\n");
mprint (" inputfile: file(s) to process\n");
@@ -318,6 +320,7 @@ void usage (void)
mprint ("Options that affect what will be processed:\n");
mprint (" -1, -2, -12: Output Field 1 data, Field 2 data, or both\n");
mprint (" (DEFAULT is -1)\n");
mprint ("Use --append to prevent overwriting of existing files. The output will be appended instead.");
mprint (" -cc2: When in srt/sami mode, process captions in channel 2\n");
mprint (" instead of channel 1.\n");
mprint ("-svc --service N1[cs1],N2[cs2]...:\n");
@@ -507,10 +510,12 @@ void usage (void)
mprint (" -autodash: Based on position on screen, attempt to determine\n");
mprint (" the different speakers and a dash (-) when each\n");
mprint (" of them talks (.srt/.vtt only, -trim required).\n");
mprint (" -xmltv mode: produce an XMLTV file containing the EPG data from\n");
mprint (" -xmltv mode: produce an XMLTV file containing the EPG data from\n");
mprint (" the source TS file. Mode: 1 = full output\n");
mprint (" 2 = live output. 3 = both\n\n");
mprint (" 2 = live output. 3 = both\n");
mprint (" -sem: Create a .sem file for each output file that is open\n");
mprint (" and delete it on file close.\n");
mprint ("\n");
mprint ("Options that affect how ccextractor reads and writes (buffering):\n");
mprint (" -bi --bufferinput: Forces input buffering.\n");
@@ -718,6 +723,42 @@ void usage (void)
mprint(" ...\n");
}
unsigned char sha256_buf[16384];
char *calculateSHA256(char *location) {
int size_read, bytes_read, fh = 0;
SHA256_CTX ctx256;
SHA256_Init(&ctx256);
#ifdef _WIN32
fh = OPEN(location, O_RDONLY | O_BINARY);
#else
fh = OPEN(location, O_RDONLY);
#endif
if (fh < 0) {
return "Could not open file";
}
size_read = 0;
while ((bytes_read = read(fh, sha256_buf, 16384)) > 0) {
size_read += bytes_read;
SHA256_Update(&ctx256, (unsigned char*)sha256_buf, bytes_read);
}
close(fh);
SHA256_End(&ctx256, sha256_buf);
return sha256_buf;
}
void version(char *location) {
char *hash = calculateSHA256(location);
mprint("CCExtractor detailed version info\n");
mprint(" Version: %s\n", VERSION);
mprint(" Git commit: %s\n", GIT_COMMIT);
mprint(" Compilation date: %s\n", COMPILE_DATE);
mprint(" File SHA256: %s\n", hash);
}
void parse_708_services (struct ccx_s_options *opts, char *s)
{
const char *all = "all";
@@ -842,6 +883,11 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
usage();
return EXIT_WITH_HELP;
}
if (!strcmp(argv[i], "--version"))
{
version(argv[0]);
return EXIT_WITH_HELP;
}
if (strcmp (argv[i], "-")==0 || strcmp(argv[i], "-stdin") == 0)
{
@@ -889,7 +935,11 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
opt->force_flush = 1;
continue;
}
if (strcmp(argv[i], "--append") == 0)
{
opt->append_mode = 1;
continue;
}
if ((strcmp (argv[i],"-bs")==0 || strcmp (argv[i],"--buffersize")==0) && i<argc-1)
{
FILEBUFFERSIZE = atol_size(argv[i+1]);
@@ -922,6 +972,10 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
opt->enc_cfg.no_bom = 1;
continue;
}
if (strcmp(argv[i], "-sem") == 0){
opt->enc_cfg.with_semaphore = 1;
continue;
}
if (strcmp (argv[i],"-nots")==0 ||
strcmp (argv[i],"--notypesetting")==0)
{
@@ -1521,6 +1575,11 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
opt->enc_cfg.autodash = 1;
continue;
}
if (strcmp(argv[i], "-sem") == 0)
{
opt->enc_cfg.autodash = 1;
continue;
}
if (strcmp (argv[i],"-xmltv")==0)
{
if (i==argc-1 // Means no following argument
@@ -1825,6 +1884,7 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
opt->enc_cfg.millis_separator = opt->millis_separator;
opt->enc_cfg.no_font_color = opt->nofontcolor;
opt->enc_cfg.force_flush = opt->force_flush;
opt->enc_cfg.append_mode = opt->append_mode;
opt->enc_cfg.ucla = opt->ucla;
opt->enc_cfg.no_type_setting = opt->notypesetting;
opt->enc_cfg.subs_delay = opt->subs_delay;

View File

@@ -225,8 +225,7 @@ void print_cc_report(struct lib_ccx_ctx *ctx, struct cap_info* info)
}
void print_file_report(struct lib_ccx_ctx *ctx)
{
struct lib_cc_decode *dec_ctx = NULL;
enum ccx_stream_mode_enum stream_mode;
struct lib_cc_decode *dec_ctx = NULL;
struct ccx_demuxer *demux_ctx = ctx->demux_ctx;
printf("File: ");

View File

@@ -22,8 +22,6 @@ void init_hdcc (struct lib_cc_decode *ctx)
// Buffer caption blocks for later sorting/flushing.
void store_hdcc(struct lib_cc_decode *ctx, unsigned char *cc_data, int cc_count, int sequence_number, LLONG current_fts_now, struct cc_subtitle *sub)
{
enum ccx_stream_mode_enum stream_mode;
//stream_mode = ctx->demux_ctx->get_stream_mode(ctx->demux_ctx);
// Uninitialized?
if (ctx->anchor_seq_number < 0)

View File

@@ -34,6 +34,7 @@ Werner Brückner -- Teletext in digital television
#include "teletext.h"
#include <signal.h>
#include "activity.h"
#include "ccx_encoders_helpers.h"
#ifdef __MINGW32__
// switch stdin and all normal files into binary mode -- needed for Windows
@@ -125,6 +126,9 @@ struct TeletextCtx
uint8_t using_pts;
int64_t delta;
uint32_t t0;
int sentence_cap;//Set to 1 if -sc is passed
int new_sentence;
};
typedef enum
{
@@ -589,6 +593,36 @@ uint16_t bcd_page_to_int (uint16_t bcd)
return ((bcd&0xf00)>>8)*100 + ((bcd&0xf0)>>4)*10 + (bcd&0xf);
}
void telx_case_fix (struct TeletextCtx *context)
{
//Capitalizing first letter of every sentence
int line_len = strlen(context->page_buffer_cur);
for(int i = 0; i < line_len; i++)
{
switch(context->page_buffer_cur[i])
{
case ' ':
//case 0x89: // This is a transparent space
case '-':
break;
case '.': // Fallthrough
case '?': // Fallthrough
case '!':
case ':':
context->new_sentence = 1;
break;
default:
if (context->new_sentence)
context->page_buffer_cur[i] = cctoupper(context->page_buffer_cur[i]);
else
context->page_buffer_cur[i] = cctolower(context->page_buffer_cur[i]);
context->new_sentence = 0;
break;
}
}
telx_correct_case(context->page_buffer_cur);
}
void telxcc_dump_prev_page (struct TeletextCtx *ctx, struct cc_subtitle *sub)
{
char info[4];
@@ -892,6 +926,8 @@ void process_page(struct TeletextCtx *ctx, teletext_page_t *page, struct cc_subt
}
break;
default:
if (ctx->sentence_cap)
telx_case_fix(ctx);
add_cc_sub_text(sub, ctx->page_buffer_cur, page->show_timestamp,
page->hide_timestamp + 1, NULL, "TLT", CCX_ENC_UTF_8);
}
@@ -1282,7 +1318,7 @@ int tlt_print_seen_pages(struct lib_cc_decode *dec_ctx)
}
return CCX_OK;
}
int tlt_process_pes_packet(struct lib_cc_decode *dec_ctx, uint8_t *buffer, uint16_t size, struct cc_subtitle *sub)
int tlt_process_pes_packet(struct lib_cc_decode *dec_ctx, uint8_t *buffer, uint16_t size, struct cc_subtitle *sub, int sentence_cap)
{
uint64_t pes_prefix;
uint8_t pes_stream_id;
@@ -1292,6 +1328,7 @@ int tlt_process_pes_packet(struct lib_cc_decode *dec_ctx, uint8_t *buffer, uint1
uint32_t t = 0;
uint16_t i;
struct TeletextCtx *ctx = dec_ctx->private_data;
ctx->sentence_cap = sentence_cap;
if(!ctx)
{
@@ -1466,6 +1503,9 @@ void* telxcc_init(void)
ctx->delta = 0;
ctx->t0 = 0;
ctx->sentence_cap = 0;
ctx->new_sentence = 0;
return ctx;
}

View File

@@ -140,7 +140,7 @@ int ts_readpacket(struct ccx_demuxer* ctx, struct ts_payload *payload)
if (result != 4)
{
if (result>0)
mprint("Premature end of file!\n");
mprint("Premature end of file (incomplete TS packer header, expected 4 bytes, got %lld).\n",result);
return CCX_EOF;
}
}
@@ -150,7 +150,7 @@ int ts_readpacket(struct ccx_demuxer* ctx, struct ts_payload *payload)
if (result != 188)
{
if (result > 0)
mprint("Premature end of file!\n");
mprint("Premature end of file - Transport Stream packet is incomplete (expected 188 bytes, got %lld).\n", result);
return CCX_EOF;
}
@@ -518,8 +518,8 @@ int copy_payload_to_capbuf(struct cap_info *cinfo, struct ts_payload *payload)
if(payload->start[0] != 0x00 || payload->start[1] != 0x00 ||
payload->start[2] != 0x01)
{
mprint("Missing PES header!\n");
dump(CCX_DMT_GENERIC_NOTICES, payload->start, payload->length, 0, 0);
mprint("Notice: Missing PES header\n");
dump(CCX_DMT_DUMPDEF, payload->start, payload->length, 0, 0);
cinfo->saw_pesstart = 0;
errno = EINVAL;
return -1;

View File

@@ -108,6 +108,12 @@ int parse_PMT (struct ccx_demuxer *ctx, unsigned char *buf, int len, struct pro
crc = (*(int32_t*)(sbuf+olen-4));
table_id = buf[0];
/* TO-DO: We're currently parsing the PMT making assumptions that there's only one section with table_id=2,
but that doesn't have to be the case. There's a sample (friends_tbs.ts) that shows a previous section with
table_id = 0xc0. I can't find any place that says that 0xc0 (Program Information Table) must come before
table_id = 2, so we should process sections in any order.
Check https://github.com/CCExtractor/ccextractor/issues/385 for more info
*/
if (table_id == 0xC0)
{
/*
@@ -116,7 +122,12 @@ int parse_PMT (struct ccx_demuxer *ctx, unsigned char *buf, int len, struct pro
* PROGRAM INFORMATION Table found in PMT
*/
dbg_print(CCX_DMT_PARSE, "PMT: PROGRAM INFORMATION Table need implementation");
return 0;
// For now, just parse its length and remove it from the buffer
unsigned c0length = (buf[1] << 8 | buf[2]) & 0xFFF; // 12 bytes
dbg_print(CCX_DMT_PARSE, "Program information table length: %u", c0length);
memmove(buf, buf + c0length + 3, len - c0length -3); // First 3 bytes are for the table_id and the length, don't count
table_id = buf[0];
// return 0;
}
else if (table_id == 0xC1)
{

View File

@@ -1096,37 +1096,19 @@ void parse_EPG_packet(struct lib_ccx_ctx *ctx)
// Free all memory used for EPG parsing
void EPG_free(struct lib_ccx_ctx *ctx)
{
int i = 0, j;
if(ccx_options.xmltv==2 || ccx_options.xmltv==3 || ccx_options.send_to_srv)
{
if(ctx->epg_inited)
{
if (ccx_options.send_to_srv)
EPG_output_net(ctx);
else
EPG_output_live(ctx);
}
for (i = 0; i < TS_PMT_MAP_SIZE; i++)
{
for(j = 0; j < ctx->eit_programs[i].array_len; j++)
if(ccx_options.xmltv==2 || ccx_options.xmltv==3 || ccx_options.send_to_srv)
{
if(ctx->eit_programs[i].epg_events[j].has_simple)
{
free(ctx->eit_programs[i].epg_events[j].event_name);
free(ctx->eit_programs[i].epg_events[j].text);
}
if(ctx->eit_programs[i].epg_events[j].extended_text!=NULL)
free(ctx->eit_programs[i].epg_events[j].extended_text);
if(ctx->eit_programs[i].epg_events[j].num_ratings>0)
free(ctx->eit_programs[i].epg_events[j].ratings);
if(ctx->eit_programs[i].epg_events[j].num_categories>0)
free(ctx->eit_programs[i].epg_events[j].categories);
if (ccx_options.send_to_srv)
EPG_output_net(ctx);
else
EPG_output_live(ctx);
}
ctx->eit_programs[i].array_len=0;
}
for (i = 0; i < 0xfff; i++)
{
if(ctx->epg_buffers[i].buffer!=NULL)
free(ctx->epg_buffers[i].buffer);
}
free(ctx->epg_buffers);
free(ctx->eit_programs);
free(ctx->eit_current_events);
free(ctx->ATSC_source_pg_map);
}

View File

@@ -1,10 +1,13 @@
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include "lib_ccx.h"
#include "ccx_common_option.h"
#include "activity.h"
#include "utility.h"
int temp_debug = 0; // This is a convenience variable used to enable/disable debug on variable conditions. Find references to understand.
volatile sig_atomic_t change_filename_requested = 0;
static uint32_t crc32_table [] = {
@@ -371,7 +374,91 @@ void m_signal(int sig, void (*func)(int))
return;
}
void create_signal(void)
{
if (signal(SIGUSR1, signal_handler) == SIG_ERR)
mprint("Can't catch SIGUSR1.\n");
}
void signal_handler(int sig_type)
{
int ret;
if (sig_type == SIGUSR1)
{
mprint("Caught SIGUSR1. Filename Change Requested\n");
change_filename_requested = 1;
}
}
#endif
struct encoder_ctx *change_filename(struct encoder_ctx *enc_ctx)
{
if(change_filename_requested == 0)
{
return enc_ctx;
}
struct encoder_ctx *temp_encoder = malloc(sizeof(struct encoder_ctx));
*temp_encoder = *enc_ctx;
if (enc_ctx->out->fh != -1)
{
if (enc_ctx->out->fh > 0)
close(enc_ctx->out->fh);
enc_ctx->out->fh=-1;
int iter;
char str_number[15];
char *current_name = malloc(sizeof(char)*(strlen(enc_ctx->out->filename)+10));
strcpy(current_name,enc_ctx->out->filename);
mprint ("Creating %s\n", enc_ctx->out->filename);
if(enc_ctx->out->renaming_extension)
{
strcat(current_name,".");
sprintf(str_number, "%d", enc_ctx->out->renaming_extension);
strcat(current_name,str_number);
}
enc_ctx->out->renaming_extension++;
for (iter = enc_ctx->out->renaming_extension; iter >= 1; iter--)
{
int ret;
char new_extension[6];
sprintf(new_extension, ".%d", iter);
char *newname = malloc(sizeof(char)*(strlen(enc_ctx->out->filename)+10));
strcpy(newname,enc_ctx->out->filename);
strcat(newname,new_extension);
ret = rename(current_name, newname);
if(ret)
{
mprint("Failed to rename the file\n");
}
mprint ("Creating %s\n", newname);
strcpy(current_name,enc_ctx->out->filename);
if(iter-2>0)
{
strcat(current_name,".");
sprintf(str_number, "%d", iter-2);
strcat(current_name,str_number);
}
free(newname);
}
enc_ctx->out->fh = open(enc_ctx->out->filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE);
free(current_name);
if (enc_ctx->out->fh == -1)
{
mprint("Failed to create a new rotation file\n");
return temp_encoder;
}
free(temp_encoder);
change_filename_requested = 0;
return enc_ctx;
}
return temp_encoder;
}
char *get_basename(char *filename)
{
char *c;
@@ -518,6 +605,6 @@ char *strndup(const char *s, size_t n)
}
char *strtok_r(char *str, const char *delim, char **saveptr)
{
strtok_s(str, delim, saveptr);
return strtok_s(str, delim, saveptr);
}
#endif //_WIN32

View File

@@ -1,6 +1,6 @@
#ifndef CC_UTILITY_H
#define CC_UTILITY_H
#include <signal.h>
#ifndef _WIN32
#include <arpa/inet.h>
#endif
@@ -20,6 +20,7 @@ struct ccx_rational
int den;
};
extern int temp_debug;
volatile extern sig_atomic_t change_filename_requested;
void init_boundary_time (struct ccx_boundary_time *bt);
void print_error (int mode, const char *fmt, ...);
int stringztoms (const char *s, struct ccx_boundary_time *bt);

277
src/lib_hash/README Normal file
View File

@@ -0,0 +1,277 @@
VERSION:
This is version 1.0.1 RELEASE
While this is my "release" version, due to lack of additional
official test vectors against which to verify this implementation's
correctness, beware that there may be implementation bugs. Also,
it has not yet been tested on very many other architectures,
big-endian machines in particular.
LICENSE:
This implementation is released freely under an open-source BSD
license which appears at the top of each source code file.
WHAT IT IS:
The files sha2.h and sha2.c implement the SHA-256, SHA-384, and SHA-512
hash algorithms as described in the PDF document found at the following
web address:
http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf
The interface is similar to the interface to SHA-1 found in the OpenSSL
library.
The file sha2prog.c is a simple program that accepts input from either
STDIN or reads one or more files specified on the command line, and then
generates the specified hash (either SHA-256, SHA-384, SHA-512, or any
combination thereof, including all three at once).
LIMITATIONS:
This implementation has several limitations:
* Input data is only accepted in octet-length increments. No sub-byte
data is handled. The NIST document describes how to handle sub-byte
input data, but for ease of implementation this version will only
accept message data in multiples of bytes.
* This implementation utilizes 64-bit integer data types. If your
system and compiler does not have a 64-bit integer data type, this
implementation will not work.
* Because of the use of 64-bit operations, many 32-bit architectures
that do have 64-bit data types but do operations most efficiently
on 32-bit words, this implementation may be slower than an
implementation designed to use only 32-bit words (emulating the
64-bit operations).
* On platforms with 128-bit integer data types, the SHA-384 and SHA-512
bit counters used by this implementation might be better off using
the 128-bit type instead of simulating it with two 64-bit integers.
* This implementation was written in C in hopes of portability and for
the fun of it during my spare time. It is probably not the most
efficient or fastest C implementation. I welcome suggestions,
however, that suggest ways to speed things up without breaking
portability. I also welcome suggestions to improve portability.
* As mentioned above, this code has NOT been thoroughly tested.
This is perhaps the most severe limitation.
BEFORE YOU COMPILE (OPTIONS):
Each of the options described below may either be defined in the sha2.h
header file (or in the sha2.c file in some cases), or on the command
line at compile time if your compiler supports such things. For
example:
#define SHA2_USE_INTTYPES_H
#define SHA2_UNROLL_TRANSFORM
Or:
cc -c -DSHA2_UNROLL_TRANSFORM sha2.c
cc -c -DBYTE_ORDER=4321 -DBIG_ENDIAN=4321 sha2.c
Here are the available options. Read on below for a description of
each one:
SHA2_USE_INTTYPES_H
SHA2_USE_MEMSET_MEMCPY/SHA2_USE_BZERO_BCOPY
SHA2_UNROLL_TRANSFORM
BYTE_ORDER (LITTLE_ENDIAN/BIG_ENDIAN)
* SHA2_USE_INTTYPES_H option:
By default, this code uses u_intXX_t data types for 8 bit, 32 bit, and
64 bit unsigned integer type definitions. Most BSD systems define these,
as does Linux. However, some (like Compaq's Tru64 Unix) may instead
use uintXX_t data types as defined by recent ANSI C standards and as
included in the inttypes.h header file. Those wanting to use inttypes.h
need to define this either in sha.h or at compile time.
On those systems where NEITHER definitions are available, you will need
to edit both sha2.h and sha2.c and define things by hand in the appropriate
sections.
* BYTE_ORDER definitions:
This code assumes that BYTE_ORDER will be defined by the system during
compile to either equal LITTLE_ENDIAN or BIG_ENDIAN. If your system
does not define these, you may need to define them by hand in the sha.c
file according to the byte ordering conventions of your system.
* SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY
The code in sha2.c can use either memset()/memcpy() for memory block
operations, or bzero()/mcopy(). If you define neither of these, the
code will default to memset()/memcpy(). You can define either at the
command line or in sha2.h or in sha2.c.
* SHA2_UNROLL_TRANSFORM
By defining this either on the command line or in sha2.h or sha2.c,
the code will use macros to partially "unroll" the SHA transform
function. This usually generates bigger executables. It CAN (but
not necessarily WILL) generate faster code when you tell your compiler
to optimize things. For example, on the FreeBSD and Linux x86 systems
I tested things on (using gcc), when I optimized with just -O2 and
unrolled the transform, the hash transform was faster by 15-30%. On
these same systems, if I did NO optimization, the unrolled transform
was SLOWER, much slower (I'm guessing because the code was breaking
the cache, but I'm not sure). Your mileage may vary.
PORTABILITY:
The code in sha2.c and sha2.h is intended to be portable. It may
require that you do a few #definitions in the .h file. I've successfully
compiled and tested the sha2.c and sha2.h code on Apple's OS X (on
a PPC), FreeBSD 4.1.1 on Intel, Linux on Intel, FreeBSD on the Alpha,
and even under Windows98SE using Metrowerks C. The utility/example
programs (sha2prog.c, sha2test.c, and sha2speed.c) will very likely
have more trouble in portability since they do I/O.
To get sha2.c/sha2.h working under Windows, I had to define
SHA2_USE_INTTYPES_H, BYTE_ORDER, LITTLE_ENDIAN, and had to comment
out the include of <sys/types.h> in sha2.h. With a bit more work
I got the test program to run and verified that all the test
cases passed.
SUGGESTIONS/BUG FIXES:
If you make changes to get it working on other architectures, if you fix
any bugs, or if you make changes that improve this implementation's
efficiency that would be relatively portable and you're willing to release
your changes under the same license, please send them to me for possible
inclusion in future versions.
If you know where I can find some additional test vectors, please let me
know.
CHANGE HISTORY:
0.8 to 0.9 - Fixed spelling errors, changed to u_intXX_t type usage,
removed names from prototypes, added prototypes to sha2.c,
and a few things I can't recall.
0.9 to 0.9.5 - Add a new define in sha2.c that permits one to compile
it to either use memcpy()/memset() or bcopy()/bzero()
for memory block copying and zeroing. Added support
for unrolled SHA-256/384/512 transform loops. Just
compile with SHA2_UNROLL_TRANSFORM to enable. It takes
longer to compile, but I hope it is a bit faster. I
need to do some test to see whether or not it is. Oh,
in sha2.c, you either need to define SHA2_USE_BZERO_BCOPY
or SHA2_USE_MEMSET_MEMCPY to choose which way you want
to compile. *Whew* It's amazing how quickly something
simple starts to grow more complex even in the span of
just a few hours. I didn't really intend to do this much.
0.9.5 to 0.9.6 - Added a test program (sha2test) which tests against several
known test vectors. WARNING: Some of the test output
hashes are NOT from NIST's documentation and are the
output of this implementation and so may be incorrect.
0.9.6 to 0.9.7 - Fixed a bug that could cause invalid output in certain
cases and added an assumed scenario where zero-length
data is hashed. Also changed the rotation macros to use
a temporary variable as this reduces the number of operations.
When data is fed in blocks of the right length, copying of
data is reduced in this version. Added SHAYXZ_Data()
functions for ease of hashing a set of data. Added another
file sha2speed.c for doing speed testing. Added another test
vector with a larger data size (16KB). Fixed u_intXX_t and
uintXX_t handling by adding a define for SHA2_USE_INTTYPES_H
as well as made a few other minor changes to get rid of
warnings when compiling on Compaq's Tru64 Unix.
0.9.7 to 0.9.8 - The bug fix in 0.9.7 was incomplete and in some cases made
things worse. I believe that 0.9.8 fixes the bug completely
so that output is correct. I cannot verify this, however,
because of the lack of test vectors against which to do such
verification. All versions correctly matched the very few
NIST-provided vectors, but unfortunately the bug only
appeared in longer message data sets.
0.9.8 to 0.9.9 - Fixed some really bad typos and mistakes on my part that
only affected big-endian systems. I didn't have direct
access for testing before this version. Thanks to
Lucas Marshall for giving me access to his OS X system.
0.9.9 to 1.0.0b1 Added a few more test samples and made a few changes to
make things easier compiling on several other platforms.
Also I experimented with alternate macro definitions
in the SHA2_UNROLL_TRANSFORM version (see sha2.slower.c)
and eliminated the T1 temporary variable (the compiler
would of course still use internal temporary storage
during expression evaluation, but I'd hoped the compiler
would be more efficient), but unfortunately under FreeBSD
4.1.1-STABLE on an x86 platform, the change slowed things
down.
1.0.0b1 to 1.0 RELEASE Fixed an off-by-one implementation bug that affected
SHA-256 when hashed data length L = 55 + 64 * X where X is
either zero or a positive integer, and another (basically
the same bug) bug in SHA-384 and SHA-512 that showed up when
hashed data lengths L = 111 + 128 * X. Thanks to Rogier
van de Pol for sending me test data that revealed the bug.
The fix was very simple (just two tiny changes). Also,
I finally put the files into RCS so future changes will be
easier to manage. The sha2prog.c file was rewritten to
be more useful to me, and I got rid of the old C testing
program and now use a perl script with a subdirectory full
of test data. It's a more flexible test system.
1.0 to 1.0.1 - Specified the specific *_CTX structure in the MEMSET_BZERO
macro doing clean-up after hashing. This should eliminate
some warnings using Clang in version 3.0 (trunk 135348).
Thanks, Stephane Leon for reporting this.
LATEST VERSION:
The latest version and documentation (if any ;) should always be available
on the web at:
http://www.aarongifford.com/computers/sha.html
CONTACT ME:
I can be reached via email at:
Aaron Gifford <m e @ a a r o n g i f f o r d . c o m>
Please don't send support questions. I don't have the time to answer and
they'll probably be ignored. Bug fixes, or patches that add something useful
will be gratefully accepted, however.
If you use this implementation, I would enjoy getting a brief email message
letting me know who you are and what use to which it is being put. There
is no requirement to do so. I just think it would be fun.
EXAMPLES:
Here's an example of compiling and using the sha2 program (in this example
I build it using the unrolled transform version with -O2 optimizations),
and then running the perl testing script:
cc -O2 -DSHA2_UNROLL_TRANSFORM -Wall -o sha2 sha2prog.c sha2.c
% ./sha2test.pl
[most of the perl script output deleted for brevity]
===== RESULTS (18 VECTOR DATA FILES HASHED) =====
HASH TYPE NO. OF TESTS PASSED FAILED
--------- ------------ ------ ------
SHA-256 18 18 0
SHA-384 18 18 0
SHA-512 18 18 0
----------------------------------------------
TOTAL: 54 54 0
NO ERRORS! ALL TESTS WERE SUCCESSFUL!
ALL TEST VECTORS PASSED!
That's all folks! Have fun!
Aaron out.

1064
src/lib_hash/sha2.c Normal file

File diff suppressed because it is too large Load Diff

193
src/lib_hash/sha2.h Normal file
View File

@@ -0,0 +1,193 @@
/*
* FILE: sha2.h
* AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/
*
* Copyright (c) 2000-2001, Aaron D. Gifford
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $
*/
#ifndef __SHA2_H__
#define __SHA2_H__
/*
* Import u_intXX_t size_t type definitions from system headers. You
* may need to change this, or define these things yourself in this
* file.
*/
#include <sys/types.h>
#ifdef _WIN32
#include <inttypes.h>
#define u_int8_t uint8_t
#define u_int32_t uint32_t
#define u_int64_t uint64_t
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/*** SHA-256/384/512 Various Length Definitions ***********************/
#define SHA256_BLOCK_LENGTH 64
#define SHA256_DIGEST_LENGTH 32
#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1)
#define SHA384_BLOCK_LENGTH 128
#define SHA384_DIGEST_LENGTH 48
#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1)
#define SHA512_BLOCK_LENGTH 128
#define SHA512_DIGEST_LENGTH 64
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
/*** SHA-256/384/512 Context Structures *******************************/
/* NOTE: If your architecture does not define either u_intXX_t types or
* uintXX_t (from inttypes.h), you may need to define things by hand
* for your system:
*/
#if 0
typedef unsigned char u_int8_t; /* 1-byte (8-bits) */
typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */
typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */
#endif
/*
* Most BSD systems already define u_intXX_t types, as does Linux.
* Some systems, however, like Compaq's Tru64 Unix instead can use
* uintXX_t types defined by very recent ANSI C standards and included
* in the file:
*
* #include <inttypes.h>
*
* If you choose to use <inttypes.h> then please define:
*
* #define SHA2_USE_INTTYPES_H
*
* Or on the command line during compile:
*
* cc -DSHA2_USE_INTTYPES_H ...
*/
#ifdef SHA2_USE_INTTYPES_H
typedef struct _SHA256_CTX {
uint32_t state[8];
uint64_t bitcount;
uint8_t buffer[SHA256_BLOCK_LENGTH];
} SHA256_CTX;
typedef struct _SHA512_CTX {
uint64_t state[8];
uint64_t bitcount[2];
uint8_t buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
#else /* SHA2_USE_INTTYPES_H */
typedef struct _SHA256_CTX {
u_int32_t state[8];
u_int64_t bitcount;
u_int8_t buffer[SHA256_BLOCK_LENGTH];
} SHA256_CTX;
typedef struct _SHA512_CTX {
u_int64_t state[8];
u_int64_t bitcount[2];
u_int8_t buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
#endif /* SHA2_USE_INTTYPES_H */
typedef SHA512_CTX SHA384_CTX;
/*** SHA-256/384/512 Function Prototypes ******************************/
#ifndef NOPROTO
#ifdef SHA2_USE_INTTYPES_H
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
void SHA384_Init(SHA384_CTX*);
void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
#else /* SHA2_USE_INTTYPES_H */
void SHA256_Init(SHA256_CTX *);
void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
void SHA384_Init(SHA384_CTX*);
void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t);
void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t);
void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
#endif /* SHA2_USE_INTTYPES_H */
#else /* NOPROTO */
void SHA256_Init();
void SHA256_Update();
void SHA256_Final();
char* SHA256_End();
char* SHA256_Data();
void SHA384_Init();
void SHA384_Update();
void SHA384_Final();
char* SHA384_End();
char* SHA384_Data();
void SHA512_Init();
void SHA512_Update();
void SHA512_Final();
char* SHA512_End();
char* SHA512_Data();
#endif /* NOPROTO */
#endif /* __SHA2_H__ */

View File

@@ -1211,8 +1211,6 @@ vbi3_raw_decoder_set_log_fn (vbi3_raw_decoder * rd,
void * user_data,
vbi_log_mask mask)
{
unsigned int i;
assert (NULL != rd);
if (NULL == log_fn)

View File

@@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug-OCR|Win32 = Debug-OCR|Win32
Release|Win32 = Release|Win32
Release-OCR|Win32 = Release-OCR|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug|Win32.ActiveCfg = Debug|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug|Win32.Build.0 = Debug|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug-OCR|Win32.ActiveCfg = Debug-OCR|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Debug-OCR|Win32.Build.0 = Debug-OCR|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release|Win32.ActiveCfg = Release|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release|Win32.Build.0 = Release|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release-OCR|Win32.ActiveCfg = Release-OCR|Win32
{0F0063C4-BCBC-4379-A6D5-84A5669C940A}.Release-OCR|Win32.Build.0 = Release-OCR|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -1,744 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ccextractor"
ProjectGUID="{0F0063C4-BCBC-4379-A6D5-84A5669C940A}"
RootNamespace="ccextractor"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../src/gpacmp4;../src/libpng;../src/zlib"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.Lib"
ShowProgress="0"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../src/gpacmp4;../src/libpng;../src/zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="WS2_32.Lib"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\src\608.h"
>
</File>
<File
RelativePath="..\src\608_spupng.h"
>
</File>
<File
RelativePath="..\src\708.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\avilib.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\avparse.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\base_coding.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\bitstream.h"
>
</File>
<File
RelativePath="..\src\bitstream.h"
>
</File>
<File
RelativePath="..\src\ccextractor.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\configuration.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\constants.h"
>
</File>
<File
RelativePath="..\src\zlib\crc32.h"
>
</File>
<File
RelativePath="..\src\zlib\deflate.h"
>
</File>
<File
RelativePath="..\src\disable_warnings.h"
>
</File>
<File
RelativePath="..\src\zlib\gzguts.h"
>
</File>
<File
RelativePath="..\src\hamming.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\ietf.h"
>
</File>
<File
RelativePath="..\src\zlib\inffast.h"
>
</File>
<File
RelativePath="..\src\zlib\inffixed.h"
>
</File>
<File
RelativePath="..\src\zlib\inflate.h"
>
</File>
<File
RelativePath="..\src\zlib\inftrees.h"
>
</File>
<File
RelativePath="..\src\inttypes.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\isomedia.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\isomedia_dev.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\list.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\math.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\media_dev.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\media_tools.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\mpeg4_odf.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\network.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\odf_dev.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\odf_parse_common.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\internal\ogg.h"
>
</File>
<File
RelativePath="..\src\libpng\png.h"
>
</File>
<File
RelativePath="..\src\libpng\pngconf.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\setup.h"
>
</File>
<File
RelativePath="..\src\stdint.h"
>
</File>
<File
RelativePath="..\src\stdintmsc.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\sync_layer.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\targetver.h"
>
</File>
<File
RelativePath="..\src\teletext.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\tools.h"
>
</File>
<File
RelativePath="..\src\zlib\trees.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\utf.h"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac\version.h"
>
</File>
<File
RelativePath="..\src\zlib\zconf.h"
>
</File>
<File
RelativePath="..\src\zlib\zlib.h"
>
</File>
<File
RelativePath="..\src\zlib\zutil.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\src\608.cpp"
>
</File>
<File
RelativePath="..\src\608_helpers.cpp"
>
</File>
<File
RelativePath="..\src\608_sami.cpp"
>
</File>
<File
RelativePath="..\src\608_smptett.cpp"
>
</File>
<File
RelativePath="..\src\608_spupng.cpp"
>
</File>
<File
RelativePath="..\src\608_srt.cpp"
>
</File>
<File
RelativePath="..\src\708.cpp"
>
</File>
<File
RelativePath="..\src\708_encoding.cpp"
>
</File>
<File
RelativePath="..\src\activity.cpp"
>
</File>
<File
RelativePath="..\src\zlib\adler32.c"
>
</File>
<File
RelativePath="..\src\asf_functions.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\av_parsers.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\avc_ext.c"
>
</File>
<File
RelativePath="..\src\avc_functions.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\avilib.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\base_encoding.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\bitstream.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_code_3gpp.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_code_apple.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_code_base.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_code_isma.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_code_meta.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\box_funcs.c"
>
</File>
<File
RelativePath="..\src\cc_bitstream.cpp"
>
</File>
<File
RelativePath="..\src\cc_decoders_common.cpp"
>
</File>
<File
RelativePath="..\src\ccextractor.cpp"
>
</File>
<File
RelativePath="..\src\constants.cpp"
>
</File>
<File
RelativePath="..\src\zlib\crc32.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\data_map.c"
>
</File>
<File
RelativePath="..\src\zlib\deflate.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\desc_private.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\descriptors.c"
>
</File>
<File
RelativePath="..\src\encoding.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\error.c"
>
</File>
<File
RelativePath="..\src\es_functions.cpp"
>
</File>
<File
RelativePath="..\src\es_userdata.cpp"
>
</File>
<File
RelativePath="..\src\file_functions.cpp"
>
</File>
<File
RelativePath="..\src\general_loop.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\gpac_ogg.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\hinting.c"
>
</File>
<File
RelativePath="..\src\zlib\inffast.c"
>
</File>
<File
RelativePath="..\src\zlib\inflate.c"
>
</File>
<File
RelativePath="..\src\zlib\inftrees.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\ipmpx_code.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\ipmpx_parse.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\isom_intern.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\isom_read.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\isom_store.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\isom_write.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\list.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\media.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\media_odf.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\meta.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\movie_fragments.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\mp4.cpp"
>
</File>
<File
RelativePath="..\src\myth.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\odf_code.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\odf_codec.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\odf_command.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\os_divers.c"
>
</File>
<File
RelativePath="..\src\output.cpp"
>
</File>
<File
RelativePath="..\src\params.cpp"
>
</File>
<File
RelativePath="..\src\params_dump.cpp"
>
</File>
<File
RelativePath="..\src\libpng\png.c"
>
</File>
<File
RelativePath="..\src\libpng\pngerror.c"
>
</File>
<File
RelativePath="..\src\libpng\pngmem.c"
>
</File>
<File
RelativePath="..\src\libpng\pngset.c"
>
</File>
<File
RelativePath="..\src\libpng\pngtrans.c"
>
</File>
<File
RelativePath="..\src\libpng\pngwio.c"
>
</File>
<File
RelativePath="..\src\libpng\pngwrite.c"
>
</File>
<File
RelativePath="..\src\libpng\pngwtran.c"
>
</File>
<File
RelativePath="..\src\libpng\pngwutil.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\qos.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\sample_descs.c"
>
</File>
<File
RelativePath="..\src\sequencing.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\slc.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\stbl_read.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\stbl_write.c"
>
</File>
<File
RelativePath="..\src\stream_functions.cpp"
>
</File>
<File
RelativePath="..\src\telxcc.cpp"
>
</File>
<File
RelativePath="..\src\timing.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\track.c"
>
</File>
<File
RelativePath="..\src\zlib\trees.c"
>
</File>
<File
RelativePath="..\src\ts_functions.cpp"
>
</File>
<File
RelativePath="..\src\gpacmp4\tx3g.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\url.c"
>
</File>
<File
RelativePath="..\src\gpacmp4\utf.c"
>
</File>
<File
RelativePath="..\src\utility.cpp"
>
</File>
<File
RelativePath="..\src\xds.cpp"
>
</File>
<File
RelativePath="..\src\zlib\zutil.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,16 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-OCR|Win32">
<Configuration>Debug-OCR</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-OCR|Win32">
<Configuration>Release-OCR</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\lib_ccx\compile_info.h" />
<ClInclude Include="..\src\gpacmp4\gpac\avparse.h" />
<ClInclude Include="..\src\gpacmp4\gpac\base_coding.h" />
<ClInclude Include="..\src\gpacmp4\gpac\bitstream.h" />
@@ -66,6 +75,9 @@
<ClInclude Include="..\src\lib_ccx\spupng_encoder.h" />
<ClInclude Include="..\src\lib_ccx\teletext.h" />
<ClInclude Include="..\src\lib_ccx\utility.h" />
<ClInclude Include="..\src\lib_hash\sha2.h" />
<ClInclude Include="..\src\win_iconv\iconv.h" />
<ClInclude Include="..\src\win_spec_incld\dirent.h" />
<ClInclude Include="..\src\zlib\crc32.h" />
<ClInclude Include="..\src\zlib\deflate.h" />
<ClInclude Include="..\src\zlib\gzguts.h" />
@@ -85,8 +97,8 @@
<ClInclude Include="..\src\zvbi\sampling_par.h" />
<ClInclude Include="..\src\zvbi\sliced.h" />
<ClInclude Include="..\src\zvbi\zvbi_decoder.h" />
<ClInclude Include="include\inttypes.h" />
<ClInclude Include="include\stdint.h" />
<ClInclude Include="..\src\win_spec_incld\inttypes.h" />
<ClInclude Include="..\src\win_spec_incld\stdint.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\ccextractor.c" />
@@ -199,6 +211,7 @@
<ClCompile Include="..\src\lib_ccx\ts_tables_epg.c" />
<ClCompile Include="..\src\lib_ccx\utility.c" />
<ClCompile Include="..\src\lib_ccx\wtv_functions.c" />
<ClCompile Include="..\src\lib_hash\sha2.c" />
<ClCompile Include="..\src\win_iconv\win_iconv.c" />
<ClCompile Include="..\src\zlib\adler32.c" />
<ClCompile Include="..\src\zlib\crc32.c" />
@@ -221,11 +234,19 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-OCR|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-OCR|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -236,6 +257,12 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-OCR|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-OCR|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
@@ -244,11 +271,29 @@
<OutDir>Debug\</OutDir>
<IntDir>Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>ccextractorwin</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-OCR|Win32'">
<OutDir>Debug-OCR\</OutDir>
<IntDir>Debug-OCR\</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>ccextractorwin</TargetName>
<IncludePath>$(ProjectDir)libs\tesseract\include\tesseract;$(ProjectDir)libs\leptonica\include\leptonica;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)libs\tesseract\lib;$(ProjectDir)libs\leptonica\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-OCR|Win32'">
<OutDir>Release-OCR\</OutDir>
<IntDir>Release-OCR\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>ccextractorwin</TargetName>
<IncludePath>$(ProjectDir)libs\tesseract\include\tesseract;$(ProjectDir)libs\leptonica\include\leptonica;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)libs\tesseract\lib;$(ProjectDir)libs\leptonica\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>Release\</OutDir>
<IntDir>Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>ccextractorwin</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -270,9 +315,57 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-OCR|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../src/win_spec_incld;../src/gpacmp4;../src/libpng;../src/zlib;../src;../src/lib_ccx;../src/zvbi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ENABLE_OCR;WIN32;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>WS2_32.Lib;libtesseract302.lib;liblept168.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>xcopy /y $(ProjectDir)libs\leptonica\lib\liblept168.dll $(ProjectDir)$(OutDir)
xcopy /y $(ProjectDir)libs\tesseract\lib\libtesseract302.dll $(ProjectDir)$(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-OCR|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../src/win_spec_incld;../src/gpacmp4;../src/libpng;../src/zlib;../src;../src/lib_ccx;../src/zvbi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ENABLE_OCR;WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>WS2_32.Lib;libtesseract302.lib;liblept168.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PostBuildEvent>
<Command>xcopy /y $(ProjectDir)libs\leptonica\lib\liblept168.dll $(ProjectDir)$(OutDir)
xcopy /y $(ProjectDir)libs\tesseract\lib\libtesseract302.dll $(ProjectDir)$(OutDir)</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../src/win_spec_incld;../src/lib_ccx;../src/gpacmp4;../src/libpng;../src/zlib;../src/zvbi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../src/win_spec_incld;../src/lib_ccx;../src/lib_hash;../src/gpacmp4;../src/libpng;../src/zlib;../src/zvbi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
@@ -287,6 +380,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<PreBuildEvent>
<Command>pre-build.bat</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -55,6 +55,21 @@
<Filter Include="Header Files\zvbi">
<UniqueIdentifier>{288f48c3-470a-45ad-a70a-8f062c51aeb1}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\lib_hash">
<UniqueIdentifier>{140e6ccb-2042-4ecc-9cba-42a04a5b0803}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\lib_hash">
<UniqueIdentifier>{dcb7e1ec-51eb-4f69-93db-b10133e98402}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\win_spec_incld">
<UniqueIdentifier>{de4fb954-0fd9-407a-8803-4dec4640296b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\win_iconv">
<UniqueIdentifier>{1870287a-d318-4ef0-9bd1-11c965a1474c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\win_iconv">
<UniqueIdentifier>{964b0a18-918d-4b08-ba92-5a84e3c48b43}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\gpacmp4\gpac\avparse.h">
@@ -183,12 +198,6 @@
<ClInclude Include="..\src\lib_ccx\disable_warnings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\inttypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\stdint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_common_char_encoding.h">
<Filter>Header Files\ccx_common</Filter>
</ClInclude>
@@ -285,6 +294,24 @@
<ClInclude Include="..\src\zvbi\zvbi_decoder.h">
<Filter>Header Files\zvbi</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\compile_info.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_hash\sha2.h">
<Filter>Header Files\lib_hash</Filter>
</ClInclude>
<ClInclude Include="..\src\win_spec_incld\stdint.h">
<Filter>Header Files\win_spec_incld</Filter>
</ClInclude>
<ClInclude Include="..\src\win_spec_incld\inttypes.h">
<Filter>Header Files\win_spec_incld</Filter>
</ClInclude>
<ClInclude Include="..\src\win_spec_incld\dirent.h">
<Filter>Header Files\win_spec_incld</Filter>
</ClInclude>
<ClInclude Include="..\src\win_iconv\iconv.h">
<Filter>Header Files\win_iconv</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\ccextractor.c">
@@ -611,9 +638,6 @@
<ClCompile Include="..\src\lib_ccx\ccx_decoders_708_output.c">
<Filter>Source Files\ccx_decoders</Filter>
</ClCompile>
<ClCompile Include="..\src\win_iconv\win_iconv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_decoders_708_encoding.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -668,5 +692,11 @@
<ClCompile Include="..\src\lib_ccx\ccx_encoders_g608.c">
<Filter>Source Files\ccx_decoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_hash\sha2.c">
<Filter>Source Files\lib_hash</Filter>
</ClCompile>
<ClCompile Include="..\src\win_iconv\win_iconv.c">
<Filter>Source Files\win_iconv</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,21 @@
In order to compile CCExtractor with OCR support (the (Release|Debug)-OCR configurations),
we need the header files and .lib files for two libraries: Tesseract and Leptonica.
The project expects the following directory structure:
leptonica
-> include
* library header files which leptonica depends on (gif_lib, zlib, png, ...)
-> leptonica
* leptonica headers (most importantly allheaders.h)
-> lib
* the .lib & .dll generated by compiling Leptonica
tesseract
-> include
-> tesseract
* tesseract headers (most importantly capi.h)
-> lib
* the .lib & .dll generated by compiling Tesseract
Currently CCExtractor makes use of liblept168 (Leptonica 1.68) and libtesseract302 (Tesseract 3.02).

47
windows/pre-build.bat Normal file
View File

@@ -0,0 +1,47 @@
@echo OFF
setlocal EnableDelayedExpansion
echo Obtaining Git commit
git rev-parse HEAD 2>NUL > temp.txt
set /p commit=<temp.txt
if not defined commit (
echo Git command not present, trying folder approach
if exist "..\.git" (
echo Git folder found, using HEAD file
type "..\.git\HEAD" 2>NUL > temp.txt
for /f "delims=" %%a in (temp.txt) do set head=%%a&goto next
:next
set start=%head:~0,5%
set rest=%head:~5%
if "%start%"=="ref: " (
echo HEAD file contains a ref, following the ref
echo ..\.git\%rest% > temp.txt
for /f "delims=" %%a in (temp.txt) do set ref_path=%%a&goto nexttt
:nexttt
set ref_path=%ref_path:/=\%
type "%ref_path%" 2>NUL > temp.txt
for /f "delims=" %%a in (temp.txt) do set commit=%%a&goto nextt
:nextt
echo Extracted commit: %commit%
goto final
) else (
echo HEAD contains a commit, using it (%head%)
set commit = %head%
goto final
)
)
)
:final
if not defined commit set commit=Unknown
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
set builddate=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%
echo storing variables in file
echo commit: %commit%
echo date: %builddate%
echo #ifndef CCX_CCEXTRACTOR_COMPILE_H > ../src/lib_ccx/compile_info.h
echo #define CCX_CCEXTRACTOR_COMPILE_H >> ../src/lib_ccx/compile_info.h
echo #define GIT_COMMIT "%commit%" >> ../src/lib_ccx/compile_info.h
echo #define COMPILE_DATE "%builddate%" >> ../src/lib_ccx/compile_info.h
echo #endif >> ../src/lib_ccx/compile_info.h
echo stored all in compile_info.h
del temp.txt
echo done