Compare commits

...

1502 Commits

Author SHA1 Message Date
Carlos Fernandez
1bd3a43dbe Added 0.85b to CHANGES.TXT 2017-01-26 17:08:01 -08:00
Carlos Fernandez
5fa83394a0 Merge branch 'pr/n670_Izaron' 2017-01-26 10:20:13 -08:00
Carlos Fernandez
51537e8725 networking, multicast: In linux, bind to the specific IP address of the multicast source.
OCR: init some variables that didn't have a default value.
2017-01-26 10:16:52 -08:00
Evgeny
071386d552 Fixed DLL requiring in non-full version 2017-01-26 12:27:39 +03:00
Carlos Fernandez
ec9a0985ce Rework signals 2017-01-24 11:06:09 -08:00
Carlos Fernandez
71dffd6eb3 Use TessDeleteText to delete strings received from Tesseract 2017-01-23 16:05:05 -08:00
Carlos Fernandez
560a88b0b9 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-23 12:34:06 -08:00
Carlos Fernandez
626717cc28 Added release date for 0.85 and new changes to CHANGES.TXT 2017-01-23 12:33:53 -08:00
Carlos Fernandez Sanz
8dc1964f8c Merge pull request #660 from Izaron/708-adventures
Fixed ttxt 708 files segfault
2017-01-23 10:05:10 -08:00
Evgeny Shulgin
d72e946213 Fixed ttxt 708 files segfault 2017-01-23 19:29:28 +04:00
Carlos Fernandez Sanz
24edbff859 Merge pull request #655 from saurabhshri/patch-1
Ability to extract Chapters from MP4 files.
2017-01-20 13:01:43 -08:00
Saurabh Shrivastava
77da2dc873 Added -chapters paramater for chapter extaraction from MP$. 2017-01-21 01:43:41 +05:30
Saurabh Shrivastava
d9414782b2 Function prototype for chapter extraction. 2017-01-21 01:38:12 +05:30
Saurabh Shrivastava
d1b127164e Option for chapter extraction. 2017-01-21 01:37:13 +05:30
Saurabh Shrivastava
db8d9c67b6 By default don't extract chapters. 2017-01-21 01:35:58 +05:30
Saurabh Shrivastava
c9a3a0c7f2 Extract chapters from mp4 file and write it in a file. 2017-01-21 01:33:59 +05:30
Saurabh Shrivastava
0e4d211eaf Extract chapter instead of subtitles if extract_chapters is True. 2017-01-21 01:29:04 +05:30
Carlos Fernandez
57daaf3e4d - Correct identing in ccextractor.c
- Correct return code for multiprogram transport streams
2017-01-19 15:14:54 -08:00
Carlos Fernandez
bc1e309b13 Added "CCX_DTVCC_C0_NUL" (do nothing, but prevent the "unhandled" warning) 2017-01-19 14:53:15 -08:00
AlexBratosin2001
09778b2d14 Sped up min_pts calculation (avoided lots of unnecessary loop iterations) 2017-01-19 22:06:39 +02:00
Evgeny
89c00a7e21 Added OEM mode parameter 2017-01-19 20:57:35 +03:00
Carlos Fernandez
bb026a7318 Merge branch 'pr/n649_sidgairo18' 2017-01-17 11:53:13 -08:00
maxkoryukov
566d1284f2 Remove SBS stuff from decoder_init 2017-01-15 23:55:41 +05:00
maxkoryukov
b5b2a7d70d Probably fix the maxkoryukov/ccextractor#1 : split to sentences
This version returns enough readable subs , splitted into sentences
2017-01-15 22:37:51 +05:00
maxkoryukov
93e407f4a5 Improve SBS: fix for #639 and non-gready similarity detection
* Use own SBS-context structure to store SBS-data (fix CCExtractor/ccextractor#639)
* Search for BEST match of new string and SBS-buffer (instead of first appropriate..)
* all tests are fixed and passed
2017-01-15 22:37:51 +05:00
maxkoryukov
ad7b141cc6 Tiny fixes 2017-01-15 22:37:51 +05:00
maxkoryukov
f23beab07e Fix error with uninitialed sbs_handled_len. Free sbs_buffer on dinit_encoder_context
* more debug for SBS
2017-01-15 22:37:51 +05:00
maxkoryukov
c582175d35 Wrap debug instructions in #ifdef 2017-01-15 22:37:51 +05:00
maxkoryukov
1b1a572f73 SBS: use Levenshtein distance to detect duplicates in subs
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
7c9ffbbde9 Levenshtein for char * in utility.c
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
5404108cc1 Some improvements for test-environment
see maxkoryukov/ccextractor#1
2017-01-15 22:37:51 +05:00
maxkoryukov
5c2d6956fd Fixed format specifiers for debug output 2017-01-15 22:37:51 +05:00
Siddhartha Gairola
fad623ed6a Update general_loop.c 2017-01-15 14:08:16 +05:30
Siddhartha Gairola
263dd2cb40 Update ccx_encoders_webvtt.c 2017-01-15 14:07:04 +05:30
sidgairo18
2d56d067e3 Fixed issue #648 2017-01-15 14:02:49 +05:30
Carlos Fernandez Sanz
759507f196 Merge pull request #645 from Izaron/708-adventures
708 fixes
2017-01-14 10:04:06 -08:00
Evgeny
e048c65cdb [CEA-708] Added BS command 2017-01-14 19:30:03 +03:00
Evgeny
41cd5f00bc Updated 708 window dump 2017-01-14 18:17:31 +03:00
AlexBratosin2001
7ab968c4a6 Merge remote-tracking branch 'upstream/master' 2017-01-13 23:35:59 +02:00
AlexBratosin2001
462f63a294 Fixed DVB multiprogram. 2017-01-13 23:35:34 +02:00
Carlos Fernandez
f75793c5e4 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-13 11:32:22 -08:00
Carlos Fernandez
521ee29ab8 Corrections in dvbcolor help and code comments. 2017-01-13 11:32:11 -08:00
Carlos Fernandez Sanz
91690f9453 Merge pull request #643 from Izaron/708-stuff
CEA-708 subtitle counter
2017-01-13 09:55:12 -08:00
Evgeny
aa0db3c528 Using correct CEA-708 subs counter 2017-01-13 20:34:50 +03:00
Evgeny
a727d2df26 Fixed hot bug with CEA-708 counter 2017-01-13 20:32:29 +03:00
Carlos Fernandez Sanz
8f818051b0 Merge pull request #642 from Izaron/708-stuff
CEA-708 improvements
2017-01-13 06:54:12 -08:00
Evgeny
1fb98118c6 Added CEA-708 counter for EXIT_NO_CAPTIONS 2017-01-13 16:40:08 +03:00
Evgeny
967e2bc695 decoder->tv refactoring 2017-01-13 16:15:43 +03:00
Evgeny
0855c0a41d Added support of SAMI and TTXT in CEA-708 2017-01-13 16:04:37 +03:00
Evgeny
bff384e677 Refactored CEA-708 symbol struct 2017-01-13 15:46:41 +03:00
Evgeny
3b2545cf82 Fixed timing bug catching in CEA-708 2017-01-13 14:06:49 +03:00
Evgeny
762ab7ce36 Merge remote-tracking branch 'refs/remotes/CCExtractor/master' 2017-01-13 10:30:35 +03:00
Naman Yadav
ab31e7b4d4 Check for language tesseract data in /usr/share/tessdata/ (#638)
Closes https://github.com/CCExtractor/ccextractor/issues/448
2017-01-12 15:07:28 -08:00
gonzaloUran
cd17aa3a53 make -ignoreptsjumps and -dvbcolor default (#637)
* default-arguments

* default-arguments
2017-01-12 14:44:56 -08:00
Carlos Fernandez
d99fda59a3 Merge branch 'pr/n640_Izaron' 2017-01-12 10:33:19 -08:00
Evgeny
ddbd03760b Added max macro for non-Visual Studio IDE 2017-01-12 21:27:36 +03:00
Evgeny
7078f10150 Fixed 708 pen handling from line by line to correct 2017-01-12 21:07:16 +03:00
Siddhartha Gairola
6c733e96c9 Fix defects (#630)
* Fixed memory leaks issue #615

* Fixed memory leaks issue #615

* Update lib_ccx.c

* Fixing issue #629

* Update networking.c
2017-01-11 13:06:56 -08:00
Saurabh Shrivastava
720008f9fb Update params.c 2017-01-12 02:03:08 +05:30
AlexBratosin2001
ade11eb80f Fixed DVB multiprogram (timing is still broken) 2017-01-11 22:30:39 +02:00
Saurabh Shrivastava
d8a6642d5f Exit if input source is stdin for MP4. 2017-01-12 01:58:25 +05:30
Saurabh Shrivastava
2464064226 Stop GPAC from analyzing if input source is stdin. 2017-01-12 01:54:31 +05:30
Carlos Fernandez
591d74d0c5 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-11 11:53:56 -08:00
Carlos Fernandez
14286a0025 Avoid calling fatal() on warning.
Minor indenting.
2017-01-11 11:53:43 -08:00
Evgeny
ddce5829d5 Musical note should replace 'Delete' in G0 Table 2017-01-11 19:18:32 +03:00
Evgeny
ebd9fc4bfe Minor mistake in bitsream fixed 2017-01-11 14:14:35 +03:00
gonzaloUran
6f8d99b39e pesheader-option (#628) 2017-01-10 16:56:30 -08:00
saurabhkapur
65634a18d1 Fixes #618 (#619) 2017-01-10 16:27:28 -08:00
Saurabh Shrivastava
827ace8dca SMPTE-TT : Removed appearance of garbage value in color code. (#625)
Also polished and improved existing code. More details : CCExtractor#620
2017-01-10 16:26:23 -08:00
AlexBratosin2001
baa5b0d14f Fixed error regarding last commit 2017-01-11 00:24:07 +02:00
AlexBratosin2001
b633491b91 Perfected DVB timing and cleaned up code 2017-01-11 00:00:06 +02:00
AlexBratosin2001
9f331b6a92 Merge remote-tracking branch 'upstream/master' 2017-01-10 23:59:16 +02:00
Carlos Fernandez
b5de22ff13 Solve crash caused by boxdestroy? 2017-01-10 13:06:34 -08:00
Carlos Fernandez
e4c9a95f7c Memory leaks in ocr.c 2017-01-10 12:59:23 -08:00
Carlos Fernandez
90001b6c23 Fix in memory free 2017-01-10 12:20:15 -08:00
Carlos Fernandez
19fec61902 Fix: Memory leak in ccx_encoders_smptett.c 2017-01-10 12:16:05 -08:00
Carlos Fernandez
acc63cc478 Merge branch 'pr/n623_Izaron' 2017-01-10 11:35:24 -08:00
Carlos Fernandez
7a4bcd3b52 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-10 11:18:41 -08:00
Carlos Fernandez
4017b59f97 Init saw_caption_block in decoder context. 2017-01-10 11:18:18 -08:00
Evgeny
407a40e32e Fixed italics and underline bit flags 2017-01-10 22:17:13 +06:00
Evgeny
714700f6b5 Fixed column count to correct values 2017-01-10 22:03:50 +06:00
Evgeny
d60baf1895 Added support of UTF16 2017-01-10 12:12:13 +06:00
Carlos Fernandez
14418d6fa1 Added +x to build-static.sh 2017-01-09 22:42:20 +00:00
Carlos Fernandez
2db16f09c7 Added static binary build script (linux). 2017-01-09 12:08:36 -08:00
Carlos Fernandez
178aa1de9c Typo in CHANGES.TXT 2017-01-09 11:41:48 -08:00
Carlos Fernandez
6716704dc3 Added more content to CHANGES.TXT 2017-01-09 11:08:27 -08:00
Carlos Fernandez
d7d7d62971 Updated CHANGES.TXT with the new stuff for 0.85. 2017-01-09 11:06:19 -08:00
AlexBratosin2001
737c0f4205 Added Alexandru Bratosin to README.TXT 2017-01-09 20:15:36 +02:00
Carlos Fernandez
766145275a Merge branch 'pr/n622_AlexBratosin2001'
Version change from 0.84 to 0.85.
2017-01-09 10:09:13 -08:00
Carlos Fernandez
7517a5448e Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2017-01-09 10:04:27 -08:00
Carlos Fernandez
80a0f1a1c1 Changed where to report bugs. 2017-01-09 10:04:10 -08:00
AlexBratosin2001
898ce5bf87 Fixed Teletext related issues (+DVB) and added other stuff 2017-01-09 16:14:05 +02:00
Carlos Fernandez
6f11230a87 Merge branch 'master' of https://github.com/CCExtractor/ccextractor.git 2017-01-08 07:51:58 -08:00
Carlos Fernandez
a63acf4f45 Changed minor text in a debug function. 2017-01-08 07:51:44 -08:00
Evgeny
a41cd3f0c4 Added spaces as in 608 subs
Length of the string is equal to 32, and so subtitles are displayed in
VLC with spaces, not the text without spaces in the middle of screen.
2017-01-08 21:50:56 +06:00
Siddhartha Gairola
9fc0402b0f Fixed memory leaks. refer issue #615 (#617)
* Fixed memory leaks issue #615

* Fixed memory leaks issue #615

* Update lib_ccx.c
2017-01-08 07:29:15 -08:00
Anukul Sangwan
4852987aae return a non-zero return code if no subtitles were found (#553)
* return a non-zero return code if no subtitles were found

* fix for mp4
2017-01-08 01:08:45 -08:00
saurabhkapur
83632761a4 tesseract library file included in mac build command (#612)
* tesserac file added in mac build command

* tesserac file added in mac build command

* Delete .DS_Store
2017-01-07 11:52:39 -08:00
Evgeny Shulgin
2229a51b66 Added FFMPEG 3.0 what compatible with XP (#610) 2017-01-07 11:52:13 -08:00
Siddhartha Gairola
86a826edaf GPAC double free issue resolved. Issues 608 and 609 also resolved. (#611)
* A pointer was freed twice in file

* The double free issue in GPAC is updated according to the latest source code. Issues 608 and 609 also resolved.

* Update wtv_functions.c
2017-01-07 11:51:20 -08:00
cfsmp3
b6dc6dd876 Merge branch 'pr/n605_brooss' 2017-01-06 09:28:01 +01:00
Brooss
4ed60073d2 Fix for bad WTV timings (#452) 2017-01-06 15:12:18 +11:00
cfsmp3
7d01c963b8 Merge branch 'pr/n600_grave-w-grave' 2017-01-05 10:26:12 +01:00
cfsmp3
80047e536d Merge branch 'pr/n601_AlexBratosin2001' 2017-01-05 10:25:17 +01:00
cfsmp3
4bcabff630 Merge branch 'pr/n602_Lord-AJ' 2017-01-05 10:24:41 +01:00
cfsmp3
be4ad97832 Merge branch 'pr/n603_Izaron' 2017-01-05 10:23:43 +01:00
Evgeny
f2b8b43bae Added PAC row positioning 2017-01-05 11:38:04 +03:00
Lord-AJ
00f1ec7906 Added names of characters from S4E01 2017-01-05 02:02:25 +05:30
cfsmp3
f8aae84bc4 Merge branch 'pr/n599_Izaron' 2017-01-04 17:59:06 +01:00
AlexBratosin2001
2a7df734de Added -pesheader dump support for teletext packets too 2017-01-04 18:57:39 +02:00
Evgeny
4308247624 Added .css styling both inline and outline 2017-01-04 17:44:27 +03:00
grave-w-grave
5f19a9f89d Skip the packet if the adaptation field length is broken 2017-01-04 12:39:02 +11:00
Evgeny
34a21a931d Enabled the support of raw WebVTT 2017-01-03 22:57:28 +03:00
Evgeny
2b0c8ba7a0 Added WebVTT color and font support 2017-01-03 22:48:50 +03:00
Evgeny
2c30f5eb5b Fixed file invalidation
Don't need to add CRLF because file becomes invalid. We need to write
cue just after the timestamp.
2017-01-03 20:55:15 +03:00
cfsmp3
dfb7d8472c Merge branch 'pr/n598_Izaron' 2017-01-03 13:45:29 +01:00
Evgeny
d87b269bae Fixed bug with multiple headers 2017-01-02 20:43:17 +03:00
cfsmp3
c84c7b5fa0 Commented out nanoseconds in PCR 2017-01-02 18:27:00 +01:00
cfsmp3
03de867572 Attempt at solving the PTS overflow in the first 2 PTS set (Hercules.ts problem) 2017-01-02 18:25:35 +01:00
Evgeny
483540488a Added webvtt-full parameter 2017-01-02 20:22:02 +03:00
Evgeny
f55876514f Updated libpng from 1.6.26 to 1.6.27 2017-01-02 18:18:15 +03:00
cfsmp3
bf7ec06957 Made rollover_bits parts of decoder context 2017-01-02 15:07:35 +01:00
cfsmp3
874a850087 Correctly write PTS on debug 2017-01-02 14:28:22 +01:00
cfsmp3
4b0a455147 Merge branch 'pr/n594_Izaron' 2017-01-02 13:43:42 +01:00
Evgeny Shulgin
624f1722b6 The proposal to update the "Compiling" section 2017-01-02 13:22:19 +03:00
Evgeny
72f12bbff5 Hot fix for non-full configuration 2017-01-02 12:59:43 +03:00
cfsmp3
57ef958250 Corrected header directories in non-full versions. 2017-01-01 22:12:35 +01:00
cfsmp3
2814599943 Merge branch 'pr/n592_Izaron' 2017-01-01 21:53:20 +01:00
Evgeny
2942e84a6f Solved the Windows dependency hell 2017-01-01 21:34:43 +03:00
AlexBratosin2001
148a70ccb8 Fixed SPUPNG possible subtitle overlapping 2017-01-01 19:44:38 +02:00
AlexBratosin2001
5f0c6cb961 Merge remote-tracking branch 'upstream/master' 2017-01-01 19:43:22 +02:00
Lia
bb3ae7eb88 align comments (#573) 2017-01-01 16:34:53 +01:00
cfsmp3
64d2805c72 Merge branch 'pr/n588_emquantum' 2017-01-01 16:29:05 +01:00
cfsmp3
533599e5d4 Merge branch 'pr/n589_emquantum' 2017-01-01 16:27:57 +01:00
cfsmp3
cec527453a Merge branch 'pr/n587_emquantum' 2017-01-01 16:27:38 +01:00
AlexBratosin2001
2d35bbb4da Fixed SAMI unnecessary empty subtitle when extracting DVB subs (continuity check). 2016-12-31 16:50:57 +02:00
cfsmp3
7091101b04 Merge branch 'pr/n586_AlexBratosin2001' 2016-12-31 15:11:05 +01:00
emquantum
848ad08efc Create dict_smash.txt 2016-12-30 15:48:42 -05:00
emquantum
2620373fb6 Create dict_glee.txt 2016-12-30 15:39:06 -05:00
Saurabh Shrivastava
afc8a3d764 Added support for font color.
Font color support as per SMPTE-TT Specification.
2016-12-31 02:00:54 +05:30
Saurabh Shrivastava
6c1ba95f89 Proper string termination.
Replaced `strncpy` with `strncat` as `strncpy` doesn't copy null character and was causing undesirable effects.
2016-12-31 00:30:39 +05:30
emquantum
c5cd400eb8 Create dict_white_collar.txt 2016-12-30 13:45:19 -05:00
AlexBratosin2001
bd2868746d Fixed DVB to SAMI extraction (subtitle overlapping when subtitle had more than 1 line). 2016-12-30 20:43:42 +02:00
AlexBratosin2001
cc7692d7eb Fixed crash regarding memory leak 2016-12-30 19:11:33 +02:00
AlexBratosin2001
fd01232a26 Fixed SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML. 2016-12-30 16:46:23 +02:00
AlexBratosin2001
5fa93764b2 Fixed SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML. 2016-12-30 16:44:07 +02:00
cfsmp3
588ed3c77e Merge branch 'pr/n582_saurabhshri' 2016-12-30 08:50:57 +01:00
Saurabh Shrivastava
6e3f669c13 Corrected improper encoding.
It was present due to uninitialised variables. Also memory leak fixed. :)
2016-12-30 11:26:21 +05:30
Saurabh Shrivastava
23a9c5da4d Probable Memory Leak Fix. 2016-12-30 00:44:25 +05:30
Saurabh Shrivastava
344a3e633a Fixed minor mistake. 2016-12-29 23:33:42 +05:30
Saurabh Shrivastava
0a0881017a Revert Incorrect Commit. 2016-12-29 23:24:12 +05:30
Saurabh Shrivastava
76e0987c57 Adobe Premier Pro Compatibility and Proper HTML formatting.
These changes were required for Adobe Premier Pro Compatibility. Previous ones were ignored.

a. ITALICS:

This:
      <p ...>
        <span>Hello<i> italic</i>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>italics
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:fontStyle="italic"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>

2.b. UNDERLINE:

This:
      <p ...>
        <span>Hello<u> underline</u>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>underline
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:textDecoration="underline"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>
2016-12-29 23:13:01 +05:30
Saurabh Shrivastava
e0b6ae275d Adobe Premier Pro Compatibility and Proper HTML formatting.
These changes were required for Adobe Premier Pro Compatibility. Previous ones were ignored.

a. ITALICS:

This:
      <p ...>
        <span>Hello<i> italic</i>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>italics
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:fontStyle="italic"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>

2.b. UNDERLINE:

This:
      <p ...>
        <span>Hello<u> underline</u>!
        <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/></span>
      </p>
Premiere expects:
      <p ...>
        <style/>
        <span>Hello 
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
        <span>underline
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px" tts:textDecoration="underline"/>
        </span>
        <span>!
          <style tts:backgroundColor="#000000FF" tts:fontSize="18px"/>
        </span>
      </p>
2016-12-29 23:08:45 +05:30
Saurabh Shrivastava
c9fe87014e Rebasing with current memory leak fix. 2016-12-29 22:53:40 +05:30
Saurabh Shrivastava
2b94b5e316 Updated SMPTE-TT header.
Updated header according to SMPTE-TT TTML guidelines.
2016-12-29 22:50:15 +05:30
AlexBratosin2001
0c4bf2a6b1 Added -ignoreptsjumps parameter to ignore pts jumps (needed for some formats). Updated help page (added documentation for latest parameters). Replaced some printf() calls with mprint(). 2016-12-29 17:18:42 +02:00
AlexBratosin2001
b9448026d7 Updated -debugdvbsub traces to get the most relevant info. 2016-12-29 15:36:26 +02:00
AlexBratosin2001
90745b07ac Updated -debugdvbsub traces to get the most relevant info. 2016-12-29 15:33:48 +02:00
AlexBratosin2001
40d97292d2 Fixed memory leak for DVB subs. 2016-12-29 13:16:09 +02:00
AlexBratosin2001
06fdd51104 Fixed memory leak for DVB subs. 2016-12-28 22:04:23 +02:00
AlexBratosin2001
a09a7e4930 Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces. 2016-12-28 21:35:26 +02:00
AlexBratosin2001
121ac2bdfe Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces 2016-12-28 21:06:55 +02:00
AlexBratosin2001
e9c088a86b Fixed DVB subtitle timing and added -debugdvbsub parameter for DVB sub debug traces 2016-12-28 20:55:10 +02:00
cfsmp3
d4e03ec759 Merge branch 'master' of github.com:CCExtractor/ccextractor 2016-12-27 04:29:28 +01:00
cfsmp3
2d767569c9 Removed ptr->bufferdatatype fromc all to pess_header_dump. 2016-12-27 04:28:53 +01:00
Evgeny Shulgin
eecec39725 Fix SubStation Alpha subtitles in bitmap (#571) 2016-12-26 21:32:06 +01:00
Evgeny Shulgin
99ec42bf35 Fixed lept msg severity in linux (#576) 2016-12-26 21:31:33 +01:00
Evgeny Shulgin
e2f6fce850 Added build script for .deb (#574)
* Added build script for .deb

* Added tip for users and automatically build
2016-12-26 21:31:00 +01:00
AlexBratosin2001
9f2cd33a82 Added -pesheader parameter for PES packet header dumping (#572)
* Added -pesheader parameter for PES packet header dumping

* Added -pesheader parameter for short PES Header dump to console

* Added -pesheader parameter for short PES Header dump to console

* Fixed DVB subs start time and added -pesheader parameter for PES Header dumping

* Fixed DVB sub start time and added -pesheader parameter for PES packet header dumping
2016-12-26 18:21:10 +01:00
ManveerBasra
556cc482d8 Added Manveer Basra to README.txt 2016-12-24 16:29:46 -08:00
Evgeny
fe9cd61d1d Fixed bad tesseract library 2016-12-24 22:19:23 +03:00
Evgeny
08b2bcb88b Added dependencies .dll-s and copy command 2016-12-24 18:26:06 +03:00
Evgeny
0072e98fad Fixed Tesseract OCR mode, removed Lept info msg 2016-12-24 18:23:23 +03:00
Evgeny
0befb3c5b1 Renamed tess version from 3.05 to 4.00 2016-12-24 10:59:52 +03:00
Evgeny
5e0f9a4898 Disabled info and warnings from Tesseract 2016-12-24 10:42:35 +03:00
Evgeny
331a64e387 Added working tesseract 4.00 2016-12-23 18:01:12 +03:00
Evgeny
f40781a9eb Updated zlib 2016-12-23 14:37:07 +03:00
Evgeny
490fedf463 Updated libpng from 1.6.10 to 1.6.26 2016-12-23 14:25:12 +03:00
Evgeny Shulgin
12466ef9cb Memory optimization in edit_distance (#564) 2016-12-23 09:31:17 +01:00
cfsmp3
c75fc7f1eb Readded the old windows directories to .gitignore to avoid crap being committed by mistake. 2016-12-22 19:59:55 +01:00
Evgeny
4c78e47404 Fixed mess in the filters 2016-12-22 18:37:02 +03:00
Evgeny
4b80441164 Renamed OCR to Full and copy ffmpeg DLLs to folder 2016-12-22 18:19:42 +03:00
cfsmp3
e2cc2f9fd7 ImageHasSafeExceptionHandlers>false 2016-12-22 09:21:24 +01:00
cfsmp3
b669733bd8 Added pre-build.bat to Release-OCR 2016-12-22 08:54:59 +01:00
Evgeny Shulgin
5a769fa22b Fixed bug with -udp address (#549) 2016-12-22 07:40:50 +01:00
cfsmp3
8bbf27526e Merge branch 'pr/n557_Izaron' 2016-12-22 07:29:29 +01:00
cfsmp3
4270450a03 Merge branch 'pr/n554_Izaron' 2016-12-22 07:18:17 +01:00
Evgeny
802360b008 Ported HARDSUBX to Windows 2016-12-18 19:42:23 +03:00
Evgeny
ccd11d38f8 Fixed -stdin option in Windows 2016-12-18 11:21:03 +03:00
Izaron
996c18fca0 Reopen: fixed memory leaks 2016-12-17 19:00:34 +03:00
Carlos Fernandez
19f12038cd Added new stuff to CHANGES.TXT 2016-12-16 10:50:04 -08:00
Carlos Fernandez
ebc7c070f3 Merge branch 'pr/n545_Izaron' 2016-12-16 10:44:14 -08:00
Carlos Fernandez
7acb3c3874 Version bump (to 0.84). Rename target name of the Windows OCR binaries. 2016-12-16 10:41:02 -08:00
Carlos Fernandez
e3ca2c3fbc Merge branch 'pr/n537_maxkoryukov' 2016-12-16 10:06:18 -08:00
Carlos Fernandez
ac1accce96 Merge branch 'pr/n544_Izaron' 2016-12-16 10:04:19 -08:00
Carlos Fernandez
c39185abab Merge branch 'pr/n541_saurabhshri' 2016-12-16 10:03:37 -08:00
Carlos Fernandez
6729c9c33f Merge branch 'pr/n524_DanilaFe' 2016-12-16 10:02:18 -08:00
Carlos Fernandez
4e4a7aa19e Merge branch 'pr/n522_DanilaFe' 2016-12-16 10:01:24 -08:00
Izaron
5d8ce8bfb8 Added configurable curl post url 2016-12-16 15:07:01 +03:00
Izaron
92b811b329 Added myself to credits 2016-12-16 14:02:37 +03:00
Saurabh Shrivastava
8c8a357aa7 Corrected filename. 2016-12-16 11:00:34 +05:30
Saurabh Shrivastava
f2770b4609 Corrected filename. 2016-12-16 10:59:20 +05:30
Danila Fedorin
7c21754b74 Update with upstream changes and fix merge conflict. 2016-12-15 14:05:08 -08:00
Carlos Fernandez
547a9e9fbf Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-12-15 13:53:57 -08:00
Carlos Fernandez
fd6a223876 Merge branch 'pr/n520_DanilaFe' 2016-12-15 13:53:37 -08:00
captions
2fd71f00d6 Minor gramatical error 2016-12-15 11:32:17 -08:00
Carlos Fernandez
0301a40560 Merge branch 'pr/n538_Izaron' 2016-12-15 11:31:38 -08:00
Carlos Fernandez
05da03a259 Changed dependency for OCR in release version - use non-debug version of tesseract 2016-12-15 10:24:34 -08:00
Saurabh Shrivastava
6e1763332a Added missing directory for protobuf-c.
Issue fixed : https://github.com/CCExtractor/ccextractor/issues/536
2016-12-15 23:00:40 +05:30
Evgeny Shulgin
5bbf27de9c Fixed linux/build script
Last PR #534
2016-12-15 21:07:29 +04:00
maxkoryukov
54f628f7a6 remove debug-files, increase verbosity for tests
fix maxkoryukov/ccextractor#1
2016-12-15 21:23:16 +05:00
maxkoryukov
4743eb46c1 Try to make changes compatible with upstream 2016-12-15 20:25:06 +05:00
maxkoryukov
66393a80f2 Break incoming subs into sentences (through a buffer), and remove duplicates 2016-12-15 20:21:43 +05:00
Danila Fedorin
c6c8de7357 Rename mstotime to millis_to_time in ccx_encoders_ssa. 2016-12-14 17:43:59 -08:00
Danila Fedorin
cbbbb20751 Merge remote-tracking branch 'upstream/master' into cleanup-ccx-common-h 2016-12-14 17:37:55 -08:00
Carlos Fernandez
604f4d8046 Ran dos2unix in all source file, 4 files had CRLF 2016-12-14 19:45:51 +00:00
Carlos Fernandez
579d5e0844 gpacmp4/isom_write.c: Added prototypes for two functions from error.c that aren't included from headers. 2016-12-14 19:11:37 +00:00
Carlos Fernandez
5c3e1d06c0 Merge branch 'pr/n530_Izaron' 2016-12-14 10:18:12 -08:00
Carlos Fernandez
d1663de1d7 Merge branch 'pr/n532_saurabhshri' 2016-12-14 10:17:26 -08:00
Saurabh Shrivastava
1571040eae Printing exact error for clean file.
Description and discussion here : https://github.com/CCExtractor/ccextractor/pull/529
2016-12-14 15:45:08 +05:30
Saurabh Shrivastava
8221a26c2d Fixed missing directory in Makefile for linux.
There was a missing directory /src/protobuf-c in makefile for linux installation.
2016-12-14 14:20:02 +05:30
Carlos Fernandez
9996836253 Removed LIBCURL in linux build script, since that stuff is not complete 2016-12-14 01:41:38 +00:00
Carlos Fernandez
7aaa1e3edb Corrected timing in Itunes
Added list of changes to CHANGES.TXT
2016-12-13 17:39:05 -08:00
Carlos Fernandez
532ecbd449 Fixed Itunes (well, MP4 generally really, maybe more) line repetition. 2016-12-13 13:32:28 -08:00
Carlos Fernandez
e66059f621 Merge branch 'pr/n525_DanilaFe' 2016-12-13 10:44:46 -08:00
Carlos Fernandez
3344040630 Merge branch 'pr/n521_DanilaFe' 2016-12-13 10:43:15 -08:00
Carlos Fernandez
6afe786cad Merge branch 'pr/n519_DanilaFe' 2016-12-13 10:42:29 -08:00
Carlos Fernandez
5f4307932a Merge branch 'pr/n518_DanilaFe' 2016-12-13 10:40:30 -08:00
Carlos Fernandez
4978c3e648 Merge branch 'pr/n517_DanilaFe' 2016-12-13 10:39:56 -08:00
Carlos Fernandez
f0223a2505 Merge branch 'pr/n516_DanilaFe' 2016-12-13 10:38:00 -08:00
Carlos Fernandez
727c407435 Merge branch 'pr/n515_DanilaFe' 2016-12-13 10:32:01 -08:00
Carlos Fernandez
c63a250f2b Merge branch 'pr/n526_Izaron' 2016-12-13 10:31:39 -08:00
Izaron
161b98ef43 Added Vagrantfile 2016-12-13 14:32:35 +03:00
Evgeny Shulgin
2417b74ea5 Fixed CMakeLists for build in cmake (#508) 2016-12-12 12:06:57 -08:00
Carlos Fernandez
620ed70246 Merge branch 'pr/n504_canihavesomecoffee' 2016-12-12 10:11:53 -08:00
Carlos Fernandez
847dc0080a Added 3 more TV show dictionaries. 2016-12-12 10:10:58 -08:00
Evgeny Shulgin
d12600e076 Added the line to check for broken subtitle
See this line https://github.com/CCExtractor/ccextractor/blob/master/src/lib_ccx/ccx_encoders_transcript.c#L276
2016-12-12 18:23:21 +04:00
Izaron
7d60f558d5 Fixed -unixts option 2016-12-12 17:18:24 +03:00
Danila Fedorin
5602e420fc Merge remote-tracking branch 'upstream/master' into cleanup-libccx-h 2016-12-11 14:24:55 -08:00
Danila Fedorin
7a25006fa5 Merge remote-tracking branch 'upstream/master' into cleanup-bistream-h 2016-12-11 14:22:31 -08:00
Danila Fedorin
5846093a7f Merge remote-tracking branch 'upstream/master' into refactor-msprint
# Conflicts:
#	src/lib_ccx/general_loop.c
2016-12-11 14:20:15 -08:00
Danila Fedorin
88bd1d9c16 Merge remote-tracking branch 'upstream/master' into cleanup-demuxer-h 2016-12-11 14:16:54 -08:00
Danila Fedorin
dc4797bb59 Merge remote-tracking branch 'upstream/master' into cleanup-getmoredata 2016-12-11 14:15:28 -08:00
Danila Fedorin
15b5bddab8 Merge remote-tracking branch 'upstream/master' into cleanup-string-cmp 2016-12-11 14:14:44 -08:00
Danila Fedorin
2b8444b78f Merge remote-tracking branch 'upstream/master' into cleanup-hardsubx 2016-12-11 14:13:49 -08:00
Danila Fedorin
f1d276c988 Merge upstream changes. 2016-12-11 14:13:27 -08:00
Danila Fedorin
b695a8c469 Merge upstream changes 2016-12-11 14:08:37 -08:00
Danila Fedorin
0d0cb83ed6 Merge upstream changes 2016-12-11 14:05:49 -08:00
Victoria Staada
943bb576a9 Added 3 TV series database as requested (#523)
* Create dict_how_to_get_away_with_murder.txt

* Create dict_stranger_things.txt

* Update dict_stranger_things.txt

* Create dict_sense8.txt
2016-12-11 11:03:25 -08:00
Danila Fedorin
08e9c3d596 Rename previously not renamed function. 2016-12-11 01:16:52 -08:00
Danila Fedorin
209e6ebb08 Rename more variables in avc_functions 2016-12-11 01:16:13 -08:00
Danila Fedorin
202e539cca Rename some variables in avc_functions 2016-12-11 01:12:29 -08:00
Danila Fedorin
edcd2df6bc Fix variable names in asf_functions.c 2016-12-11 01:11:25 -08:00
Danila Fedorin
3f679d72cf Fix typo in asf_cuntions.c. It looks like a typo from the surrounding
code.
2016-12-11 01:05:45 -08:00
Danila Fedorin
2e09541c84 Rename another function. 2016-12-11 01:05:35 -08:00
Danila Fedorin
6885f41b61 Add more underscores!!
I feel like my last several commits were just this.
2016-12-11 01:01:51 -08:00
Danila Fedorin
69d33e7483 Better name string_cmp2.
Seeing that it is passed as a function pointer, the _function keyword
was added to its name. Hopefully that helps.
2016-12-11 01:00:46 -08:00
Danila Fedorin
d175082520 Add more underscores to getmoredata functions. 2016-12-11 00:58:36 -08:00
Danila Fedorin
2ef31d2e08 Add underscores to function na,e. 2016-12-11 00:58:29 -08:00
Danila Fedorin
eab439d450 Add small changes to function names in ccx_demuxer.h. 2016-12-11 00:57:18 -08:00
Danila Fedorin
27417cda70 Rename more mstotime's to millis_to_time. 2016-12-10 23:22:10 -08:00
Danila Fedorin
2959d2a2ae Rename function to new name. 2016-12-10 23:22:03 -08:00
Danila Fedorin
289aecc1ed Refactor code surrounding print_mstime_static.
This should decrease code duplication - print_mstime2buf was doing
the same thing as mstime_sprintf, but with a hardcoded format and
a different return value. print_mstime (renamed to print_mstime_static)
could therefore be reworked into simply calling mstime_sprintf
 (renamed to print_mstime_buff).
2016-12-10 23:20:57 -08:00
Danila Fedorin
01d2ce36d1 Clarify usage function name (rename it to print_usage). 2016-12-10 23:17:18 -08:00
Danila Fedorin
cbea9ee045 Also add underscores to get_total_file_size. 2016-12-10 23:16:36 -08:00
Danila Fedorin
ea980a4150 Add underscores to debug_608toASC. 2016-12-10 23:12:37 -08:00
Danila Fedorin
2910b10f99 Rename mstotime to millis_to_time. 2016-12-10 23:11:01 -08:00
Danila Fedorin
d5f14d56f3 Add underscores to getfilesize. 2016-12-10 23:04:20 -08:00
Danila Fedorin
c3a80b086c Rename i, u, se, and ue functions. 2016-12-10 23:02:10 -08:00
Danila Fedorin
7616cef9cc Remove accidental code duplication. 2016-12-10 23:00:08 -08:00
Danila Fedorin
1f54d88867 Add hex_string_to_int function.
The only time I found hex2string being used was when it was
with two characters from char array. It therefore should be possible
to generalize the behavior of hex_to_int (which specifically takes two
characters) to take the array instead, in order to reduce code duplication.
I will refrain from moving this function into real application code in
case there is something I overlooked.
2016-12-10 23:00:04 -08:00
Danila Fedorin
12c388093f Rename hex2int to hex_to_int. 2016-12-10 23:00:00 -08:00
Danila Fedorin
190a4203eb Rename processhex to process_hex for consistency. 2016-12-10 22:59:52 -08:00
Evgeny Shulgin
0fdd608828 Fixed FPS switching (#510) 2016-12-10 21:30:54 -08:00
Abhinav Shukla
697132baf9 Fix #454 : Removed ugly debug statement with local path (#514) 2016-12-10 21:03:48 -08:00
canihavesomecoffee
7b55f61396 Remove hardcoded references in project file, add relative ones instead 2016-12-10 08:38:58 +01:00
canihavesomecoffee
f3faaf06f8 Add VC.db file to gitignore
Also moves the folders to the correct place
2016-12-10 08:38:43 +01:00
Carlos Fernandez
6dc941d4e6 Changed platform target to v120_xp, fixed some missing dirs. 2016-12-09 14:02:10 -08:00
AlexBratosin2001
ce15155956 Updated GPAC library to v0.6.2 (#500)
Replaced GPAC.
2016-12-09 13:47:54 -08:00
Carlos Fernandez
8ab68b94ac Added detail in many error messages. 2016-12-09 11:07:29 -08:00
Carlos Fernandez
0753f23078 Merge branch 'pr/n490_saurabhshri' 2016-12-09 10:18:17 -08:00
Carlos Fernandez
859296885f Merge branch 'pr/n488_saurabhshri' 2016-12-09 10:16:42 -08:00
Saurabh Shrivastava
a37961ef9c Added more words. 2016-12-08 13:53:47 +05:30
Saurabh Shrivastava
8802c7ccc3 Minor correction in README.md
Removed a redundant line - "You can also".
2016-12-08 13:13:09 +05:30
Izaron
941d5544cf Fixed memory leak with XDS videos 2016-12-07 20:05:38 +03:00
Carlos Fernandez
d453d9327e Minor changes IN README.md 2016-12-05 12:44:57 -08:00
Carlos Fernandez
ac00131153 Merge branch 'pr/n456_TehTotalPwnage' 2016-12-05 12:38:45 -08:00
Carlos Fernandez
796cc6c1bb Merge branch 'pr/n478_Izaron' 2016-12-05 10:52:32 -08:00
Carlos Fernandez
8709e30841 Merge branch 'pr/n476_Izaron' 2016-12-05 10:43:24 -08:00
Carlos Fernandez
8f9f9a48a6 Merge branch 'pr/n475_Izaron' 2016-12-05 10:41:17 -08:00
Izaron
cfeb63b855 Fixed memory leaks 2016-12-04 22:11:08 +03:00
Izaron
904a3c26df Added two functions for ASS/SSA encoder 2016-12-03 20:23:22 +03:00
Izaron
764c890892 Fixed bug with -out=null 2016-12-03 11:01:50 +03:00
Juan Potato
3553b4da51 Fix Makefile compatibility issues with Raspberry pi
Along with adding utf8proc to actually be compiled
2016-12-02 21:14:25 -05:00
Carlos Fernandez
0f6a24a2fb Merge branch 'pr/n470_Izaron' 2016-12-02 12:26:24 -08:00
Carlos Fernandez
3704111fb0 Added new dictionaries, lots of corrections in documents. 2016-12-02 11:27:37 -08:00
Izaron
f8e378863e Added basic ASS/SSA encoding support 2016-12-02 20:24:12 +03:00
Sidhdharth
9526df1b84 Added 4 TV series database as requested.
Used a python script to generate all characters automatically just with the help of IMDB ID.
2016-12-02 19:59:56 +05:30
Deepraj Pandey
e9ea1ce659 Update ccextractor.c 2016-12-02 19:35:16 +05:30
Deepraj Pandey
9f4e6c3f06 Update ccextractor.c 2016-12-02 16:37:02 +05:30
Deepraj Pandey
4292ceb062 Update ccextractor.c 2016-12-02 14:10:25 +05:30
Deepraj Pandey
2609124346 Update using_cmake_build.txt 2016-12-02 14:02:45 +05:30
Deepraj Pandey
902da70ee3 Update OCR.txt 2016-12-02 14:01:53 +05:30
Deepraj Pandey
dd9243d459 Update MAILINGLIST.TXT 2016-12-02 13:53:36 +05:30
Deepraj Pandey
014181a653 Update HARDSUBX.txt 2016-12-02 13:46:57 +05:30
Deepraj Pandey
92bf709d65 Update G608.TXT 2016-12-02 13:33:36 +05:30
Deepraj Pandey
842ec2728e Update FRONTEND_COMMUNICATIONS.TXT 2016-12-02 11:04:09 +05:30
Deepraj Pandey
b8d0751509 Update FFMPEG.TXT 2016-12-02 11:02:24 +05:30
Deepraj Pandey
514909aa05 Update CHANGES.TXT 2016-12-02 11:00:10 +05:30
Deepraj Pandey
85922dbad7 Update dict_the.big.bang.theory.txt 2016-12-02 10:38:38 +05:30
Deepraj Pandey
a7b70df915 Update dict_mr_robot.txt 2016-12-02 10:34:03 +05:30
Deepraj Pandey
36237ef658 Update dict_greys.anatomy.txt 2016-12-02 10:30:28 +05:30
Michael Nguyen
743d3209e8 GCI: Updated README.md 2016-11-30 17:16:10 -08:00
canihavesomecoffee
814eaab300 Add utf8proc folder to the include directories
Regular debug & release have a missing folder
2016-11-29 22:38:04 +01:00
MatejMecka
40d277b666 Google Code In 2016 Modify README.MD 2016-11-29 20:57:25 +01:00
Carlos Fernandez
a1411968b8 Lots of corrections to text.
Added show-specific dictionaries for Grey's Anatomy, Mr. Robot and The Big Bang Theory (Code-in: Deborah Chan)
2016-11-29 10:24:16 -08:00
Xuhairong
2ba25a5922 Update ccextractor.cnf.sample
Corrected some spelling and grammar mistakes.
2016-11-29 17:05:35 +00:00
ManveerBasra
e54a5982e3 Changed Recognization to Recognition 2016-11-28 21:16:33 -08:00
ManveerBasra
203cf029d1 Fixed a minor mistake while correcting spelling 2016-11-28 20:38:07 -08:00
ManveerBasra
dac7e45651 Fixed multiple spelling mistakes 2016-11-28 19:53:09 -08:00
Juan Potato
0dc07384eb Various spelling corrections. 2016-11-28 17:04:59 -05:00
Carlos Fernandez
e58e166428 Removed two leftover files. 2016-11-11 12:46:33 -08:00
maxkoryukov
4ad45db655 Reordering definitions in the ccx_encoders_common.h to make it easier to read 2016-11-11 18:00:50 +05:00
Carlos Fernandez
2683896f41 Fixed missing separation between WebVTT header and body.
(unrelated to previous) added a bit more detail in an error message in the TS parser.
2016-11-04 11:00:06 -07:00
Carlos Fernandez
2e13d9f7a4 Fixes garbage in WebVTT (#438). 2016-11-03 13:28:55 -07:00
Carlos Fernandez
1f90648347 Fixes stupid bug in M2TS 2016-10-19 13:17:10 -07:00
yanwzh
6bf2185257 fixed: cmake build error for ubuntu 2016-10-18 17:55:42 +08:00
Carlos Fernandez
6f2becc42e Fixed OCR libraries dependencies for the release version in Windows. 2016-10-13 11:50:35 -07:00
Carlos Fernandez
cf21a1daee Fixed non-buffered reading from pipes. 2016-10-11 15:30:44 -07:00
Carlos Fernandez
79501bceec position_sanity_check: Don't fatal() on lseek error. 2016-10-11 13:26:39 -07:00
Carlos Fernandez
64d300d15e Fixed position_sanity_check for myth.c 2016-10-11 13:19:16 -07:00
Carlos Fernandez
eead25896f Fixed position_sanity_check 2016-10-11 13:17:39 -07:00
Hugh Mackworth
2f4fb88e07 Fix --stream option with Stdin 2016-10-11 11:48:43 -07:00
Hugh Mackworth
2ac200cdb2 Fix Mac build process
Remove unnecessary debug parameter
2016-10-11 11:46:22 -07:00
Hugh Mackworth
7f589ecade Fix Mac build process 2016-10-11 11:23:31 -07:00
Hugh Mackworth
0b4a368d03 Merge pull request #1 from CCExtractor/master
Updating to latest
2016-10-09 21:04:07 -07:00
Carlos Fernandez
e8da9bce72 Minor correction in params.c 2016-10-07 15:24:38 -07:00
Carlos Fernandez
e488c43eb7 Corrections in help screen 2016-10-07 15:22:59 -07:00
Carlos Fernandez
b1cb94ef71 Minor signal thing 2016-09-28 15:24:19 -07:00
Carlos Fernandez
56a6658bf1 Added terminate_asap to buffered_read_opt 2016-09-28 15:19:38 -07:00
Carlos Fernandez
4be8324767 Corrected signal handler setup 2016-09-28 15:17:31 -07:00
Carlos Fernandez
09a5593e2f Sigterm 2016-09-28 13:38:52 -07:00
Carlos Fernandez
c987b72033 Solves warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has
type ‘LLONG {aka long int}’
2016-09-28 13:37:45 -07:00
Carlos Fernandez
cbd894a634 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-09-28 13:30:44 -07:00
Carlos Fernandez
33273e3954 sigterm 2016-09-28 13:29:43 -07:00
Carlos Fernandez
f28698f71a Corrected linux/build 2016-09-28 13:05:09 -07:00
Carlos Fernandez
56719e7bcd Libcurl 2016-09-28 13:02:54 -07:00
Carlos Fernandez
febc9727bf Actual libcurl invocation 2016-09-28 12:56:15 -07:00
Carlos Fernandez
2ae3b8bca0 SIGTERM in general_loop 2016-09-28 12:16:09 -07:00
Carlos Fernandez
352283d0b6 SIGTERM stuff 2016-09-28 12:15:45 -07:00
Carlos Fernandez
f0696d396f SIGTERM stuff 2016-09-28 12:15:21 -07:00
Carlos Fernandez
8729ae1210 Disabling CURL in Windows 2016-09-28 12:13:50 -07:00
Carlos Fernandez
17c0d8125e - Adding SIGTERM 2016-09-28 12:13:22 -07:00
Carlos Fernandez
67a3ed3b57 Merging curl 2016-09-28 12:09:17 -07:00
Carlos Fernandez
342238325e - Start capture SIGTERM 2016-09-28 12:04:43 -07:00
Carlos Fernandez
080280c268 Added generates_files flag. 2016-09-26 15:22:09 -07:00
Carlos Fernandez
17dd6696df Initial libcurl integration work, linux only. Just groundwork, lots of dummy things yet. 2016-09-26 13:36:04 -07:00
Carlos Fernandez Sanz
d0a4851a67 Comment out enum 2016-09-21 15:30:42 -07:00
Carlos Fernandez
a09ba7c603 Work on 708: Changed DefineWindow behavior, only clear text of an existing window is style has changed.
Assigned presets in 708 attributes.
2016-09-21 13:05:28 -07:00
Carlos Fernandez Sanz
a734aa2b26 Fixed compilation in linux 2016-09-21 11:43:08 -07:00
Carlos Fernandez
1987951014 Fixed some more warnings 2016-09-21 11:35:50 -07:00
Carlos Fernandez
c8f6e8c084 Fixed some compilation warnings
Removed microutf8 files since we settled for a different UTF8 library
2016-09-21 11:30:42 -07:00
Carlos Fernandez
4101fe3880 Fixes #425 - the 708 decoder needs access the encoder. Reference was missing for .bin. 2016-09-20 16:04:33 -07:00
captions
9833090318 Removed leftover line that caused a (harmless) error message 2016-09-12 12:15:47 -07:00
Carlos Fernandez
8169d9863b Fixes #422 2016-09-12 11:50:15 -07:00
canihavesomecoffee
ecac87dc6a Fix regression introduced in 1a1e973
Due to an assignment instead of comparison, all types of codecs handled
after the DVD subtitles would now be processed as DVD subtitles...
2016-09-03 18:58:47 +02:00
Carlos Fernandez
4865649d0f Merge branch 'pr/n417_Abhinav95' 2016-08-26 17:34:39 -07:00
Abhinav Shukla
fe20494d30 Making output for one timestamp on one line 2016-08-25 17:24:18 -07:00
Carlos Fernandez
b356b1b0d6 Infrasstructure for split-by-sentence 2016-08-25 16:56:11 -07:00
Abhinav Shukla
fc3c841d03 Updating HardsubX build script 2016-08-25 16:25:25 -07:00
Abhinav Shukla
3d0d1df324 Removing unused variable 2016-08-25 16:18:01 -07:00
Carlos Fernandez
789ae74e0a New dir added to include list 2016-08-25 16:16:16 -07:00
Abhinav Shukla
bcccc5d1d5 Merge remote-tracking branch 'upstream/master' 2016-08-25 16:15:56 -07:00
Abhinav Shukla
5c7a766658 Merge remote-tracking branch 'upstream/master' 2016-08-25 16:06:23 -07:00
Carlos Fernandez
abdf5423f5 Missing dir for proto. 2016-08-25 16:05:50 -07:00
Carlos Fernandez
8775436cdb Stupid typo 2016-08-25 16:03:18 -07:00
Abhinav Shukla
3557ea50c6 Merge remote-tracking branch 'upstream/master' 2016-08-25 16:03:13 -07:00
Abhinav Shukla
2c4ae3ea42 Merge remote-tracking branch 'upstream/master' 2016-08-25 16:00:47 -07:00
Carlos Fernandez
e5e62fd2d9 Added protobuf-c to build 2016-08-25 15:57:33 -07:00
Abhinav Shukla
f3b2b05169 Fixing missing second line in ttxt for DVB 2016-08-25 15:45:33 -07:00
Carlos Fernandez
b00f8e75f6 Added dvb_subtitle_decoder.c to the project 2016-08-22 16:17:17 -07:00
bigharshrag
b604fe74b5 Fixed warning 2016-08-23 04:07:27 +05:30
bigharshrag
3082fb7a15 Cleaned code 2016-08-23 02:49:46 +05:30
bigharshrag
41ff65162b Fixed according to latest OCR 2016-08-23 02:32:35 +05:30
bigharshrag
f778beaafd Merge branch 'master' into dvd_subtitles 2016-08-23 01:48:48 +05:30
Abhinav Shukla
a018b55038 Final improvements to HardsubX 2016-08-19 08:38:21 -07:00
Abhinav Shukla
03b600fb67 Merge remote-tracking branch 'upstream/master' 2016-08-18 03:11:07 -07:00
Carlos Fernandez
358b8ef579 Initial backport of Oleg Kisselef's WITH_SHARING options. Most likely it breaks stuff. 2016-08-17 17:40:11 -07:00
Carlos Fernandez
b2c11f5984 Merge branch 'pr/n414_cfsmp3'
# Conflicts:
#	src/lib_ccx/ccx_decoders_708.c
2016-08-17 13:21:07 -07:00
Carlos Fernandez
fc14c61ac1 Merge branch 'pr/n411_Abhinav95' 2016-08-16 10:33:50 -07:00
Carlos Fernandez
c4073d1813 leptonica/tesseract version upgrade in release build (VS) 2016-08-16 10:33:17 -07:00
Abhinav Shukla
5d19fe127c Merge remote-tracking branch 'upstream/master' 2016-08-16 05:36:25 -07:00
Abhinav Shukla
a78f7d2a05 Only processing the stream specified by dvblang 2016-08-16 05:23:44 -07:00
Carlos Fernandez
78fa5c92bc Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-15 16:40:23 -07:00
Carlos Fernandez
cfa8f5ac31 Merge branch 'pr/n410_Abhinav95' 2016-08-15 16:36:50 -07:00
Abhinav Shukla
4b239fd2ee Adding ocrlang and dvblang, removing special cases for languages 2016-08-15 16:24:06 -07:00
Carlos Fernandez
676539cf8c Updated Tesseract and leptonica versions, included the files in the repo because there's a royal pain to find and/or build. 2016-08-15 16:15:50 -07:00
Carlos Fernandez
9bd4f5acdb Merge branch 'pr/n408_Abhinav95' 2016-08-15 15:18:52 -07:00
bigharshrag
438ce2f33a Fixed data over multiple packets 2016-08-15 05:45:04 +05:30
bigharshrag
cd4dfa5f76 Data spread over packets 2016-08-15 04:41:43 +05:30
Abhinav Shukla
0ad7ae6f66 Merge remote-tracking branch 'upstream/master' 2016-08-13 05:32:22 -07:00
Abhinav Shukla
625b477c23 Remove misleading comment 2016-08-12 15:09:08 -07:00
Carlos Fernandez
a75ba7edd4 Merge branch 'pr/n408_Abhinav95' 2016-08-12 15:07:59 -07:00
Abhinav Shukla
3a24024aaf Setting default language file directory to TESSERACT_PREFIX/tessdata 2016-08-12 15:05:52 -07:00
Carlos Fernandez
e4769fd0e6 Merge branch 'pr/n408_Abhinav95' 2016-08-12 10:23:13 -07:00
Abhinav Shukla
cd706068c8 Fixing problem with windows paths for traineddata 2016-08-12 03:40:59 -07:00
bigharshrag
05767df99d Fixed timing 2016-08-12 15:52:00 +05:30
Carlos Fernandez
00a2dcfa77 Merge branch 'pr/n407_Abhinav95' 2016-08-11 12:54:34 -07:00
Carlos Fernandez
a27c8019a6 Minor typo correction 2016-08-11 12:53:49 -07:00
Abhinav Shukla
3f27fd7dc1 Fixing error with path of tesseract traineddata 2016-08-11 12:21:24 -07:00
Abhinav Shukla
a83467f595 Removing excessive language notices 2016-08-11 11:58:46 -07:00
Abhinav Shukla
45d8c63a45 Adding 99 possible languages to DVB subtitle OCR 2016-08-11 11:17:39 -07:00
Abhinav Shukla
0fd7967e7f Improving documentation readability 2016-08-10 12:54:34 -07:00
Abhinav Shukla
e2f850192f Italic Detection and improved documentation 2016-08-10 09:33:08 -07:00
Abhinav Shukla
5a6dfd0c18 Added correct progress display and hue image filter for colored subs 2016-08-10 06:43:58 -07:00
Abhinav Shukla
ef8141c8a9 User documentation 2016-08-10 03:39:01 -07:00
bigharshrag
ebd2afa43f Used correct time data 2016-08-09 06:21:38 +05:30
Carlos Fernandez
89e98a6797 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 14:41:35 -07:00
Carlos Fernandez
5a4aa337b3 Removed compile warnings. 2016-08-08 14:41:32 -07:00
Carlos Fernandez
7687576e1f Pushed version number to 0.82 2016-08-08 14:13:48 -07:00
Carlos Fernandez
8ca63e02eb Merge branch 'pr/n405_Abhinav95' 2016-08-08 14:05:23 -07:00
Carlos Fernandez
b924f7a323 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 12:14:49 -07:00
Carlos Fernandez
606a5a56bc Final changes for the max 80 characters correction in help screen. 2016-08-08 12:14:45 -07:00
Carlos Fernandez
3ee6aa61a7 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 12:07:03 -07:00
Carlos Fernandez
af8a79757e More changes in help screen 2016-08-08 12:05:30 -07:00
Carlos Fernandez
a047262eb6 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 12:03:12 -07:00
Carlos Fernandez
e920c06dc0 More help screen changes. 2016-08-08 12:02:27 -07:00
Carlos Fernandez
c208c2aed2 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 11:59:18 -07:00
Carlos Fernandez
ed8592f5f8 More changes in help screen 2016-08-08 11:59:12 -07:00
Carlos Fernandez
8c85870c25 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 11:57:19 -07:00
Carlos Fernandez
f5bb5fba27 More changes in help screen. 2016-08-08 11:56:56 -07:00
Carlos Fernandez
43acdce578 More help screen changes. 2016-08-08 11:55:48 -07:00
Abhinav Shukla
92b899dc2a Cleanliness is all. 2016-08-08 11:55:31 -07:00
Carlos Fernandez
6fa1dc7b30 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 11:53:48 -07:00
Carlos Fernandez
f4c60c3aed More help screen corrections. 2016-08-08 11:53:41 -07:00
Carlos Fernandez
35ae5599c1 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 11:50:58 -07:00
Carlos Fernandez
057a1d11b1 More help corrections 2016-08-08 11:42:31 -07:00
Carlos Fernandez
5fe2c8c8a7 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-08 11:37:35 -07:00
Carlos Fernandez
030635a86b help screen corrections 2016-08-08 11:36:23 -07:00
Carlos Fernandez
af248ffd24 Correction in help screen 2016-08-08 11:26:40 -07:00
bigharshrag
6b52cabbac Fixed incorrect bitmap allocation 2016-08-08 01:25:30 +05:30
Abhinav Shukla
fa60e2ad68 Fixing build error when HardsubX not enabled 2016-08-05 12:33:17 -07:00
Abhinav Shukla
b2784bd3da Dumping HardsubX parameters 2016-08-05 12:21:35 -07:00
Carlos Fernandez
8bfcb24d15 Added new lines to bitmap -> transcript 2016-08-05 11:02:46 -07:00
Abhinav Shukla
1aaf8b465f Fixing bug with time interval in packet processing 2016-08-04 00:34:58 -07:00
Abhinav Shukla
ffb85d90a3 Update Makefile to check if libav present 2016-08-03 20:09:19 -07:00
Carlos Fernandez
6a4f196940 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-08-01 11:31:50 -07:00
Abhinav Shukla
37d9f93eb5 Merge remote-tracking branch 'upstream/master' 2016-08-01 11:26:29 -07:00
Abhinav Shukla
39559413f5 Fix errors with classifiers, write debug display function 2016-08-01 11:19:48 -07:00
Carlos Fernandez
8c845f5135 Merge branch 'pr/n403_canihavesomecoffee' 2016-08-01 10:46:04 -07:00
Carlos Fernandez
ef7ad10fdb Merge branch 'pr/n404_Abhinav95' 2016-08-01 10:45:30 -07:00
Carlos Fernandez
e6ca4274ec Undo part of the clever capitalization stuff. Doesn't work well for TV stations that are all caps except for hard of hearing notes. 2016-08-01 10:44:44 -07:00
Abhinav Shukla
d97c51139f Freeing result iterator after a frame is processed 2016-08-01 00:02:05 -07:00
Abhinav Shukla
52dfc82054 Setting up different levels of subtitle classifiers 2016-07-31 23:54:48 -07:00
Abhinav Shukla
773fb63f92 Accurate time base conversion, changing file structure 2016-07-31 23:21:44 -07:00
Abhinav Shukla
7ce4c4008c Adding HardsubX parameter parsing 2016-07-31 22:11:13 -07:00
Abhinav Shukla
178db0a085 Merge remote-tracking branch 'upstream/master' 2016-07-31 13:51:20 -07:00
Abhinav Shukla
bc833c47dc Setting up other hardsubx parameters 2016-07-31 13:51:13 -07:00
Abhinav Shukla
617b4658b4 Creating new macro and updating Makefile, hadnling errors 2016-07-31 12:13:45 -07:00
canihavesomecoffee
98a79e0e55 Re-add the VERSION_FILE_PRESENT flag 2016-07-30 18:37:32 +02:00
Carlos Fernandez
e21f787125 Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2016-07-29 16:49:01 -07:00
Carlos Fernandez
878106386c Corrected capitalization stuff: Don't touch lines that already have both upper and lower case (i.e. assume they are correct already) and don't force new sentence between frames as that's just not correct. Long sentences will take more than one frame for sure. 2016-07-29 16:41:06 -07:00
Abhinav Shukla
3c870eef7d Freeing color detection tables 2016-07-26 23:21:27 -07:00
Abhinav Shukla
4f3d61a7eb Fixing memory leaks in frame processing 2016-07-26 23:17:14 -07:00
Carlos Fernandez
470e80a194 Minor correction in help screen 2016-07-25 16:16:05 -07:00
bigharshrag
e44852a7e4 Added Palette 2016-07-26 03:04:19 +05:30
Abhinav Shukla
92885635ed Generating a basic, correctly timed output file with simple OCR 2016-07-23 18:18:32 -07:00
Abhinav Shukla
722cecf0d3 Resolving merge conflict with dvbcolor and syncing with upstream 2016-07-22 19:51:51 -07:00
Abhinav Shukla
6a9d7e7da2 Fixing segfault for empty OCR line 2016-07-22 17:54:32 -07:00
Abhinav Shukla
22ec6b96b2 Fixing compilation warnings for image_copy struct 2016-07-22 07:01:05 -07:00
Abhinav Shukla
0c8471438a Fixing error with invalid next size and correctly formatting SRT/VTT color output 2016-07-22 06:46:11 -07:00
Abhinav Shukla
3a74381318 Modifying API call not present in tesseract 3.03 2016-07-21 16:13:59 -07:00
Abhinav Shukla
0fcf9298bb Merge remote-tracking branch 'upstream/master' into dvbcolor 2016-07-21 15:29:12 -07:00
Carlos Fernandez
c8bd4e22a5 Added missing library for OCR 2016-07-21 14:59:56 -07:00
Carlos Fernandez
a918bc2798 Added OCR to linux build script
Skip another to the SCTE 57 2003 sections in PMT
2016-07-21 14:56:17 -07:00
Abhinav Shukla
9d81498bd9 Moving tesseract handle to hardsubx ctx 2016-07-21 14:54:33 -07:00
Carlos Fernandez
45a37f390b Added OCR stuff 2016-07-21 14:44:23 -07:00
Abhinav Shukla
a2eced9201 Color output in <font> tags for SRT and WebVTT 2016-07-20 12:08:42 -07:00
Abhinav Shukla
36b08c5d74 Working color detection and output for SRT from DVB 2016-07-19 19:25:46 -07:00
bigharshrag
5c0ee9ca53 Use different structs 2016-07-18 18:49:22 +05:30
Abhinav Shukla
f280feff65 Passing DVB region background color 2016-07-16 06:16:42 -07:00
Abhinav Shukla
f37e944ac4 Fixed errors in word color recognition 2016-07-09 20:39:38 -07:00
Abhinav Shukla
cf281c22ce Detecting color of every word 2016-07-07 19:42:10 -07:00
Abhinav Shukla
4d8cb4d4d4 Creating copy of image before quantization 2016-07-07 15:15:59 -07:00
Abhinav Shukla
7426841b5e Basic structure for color detection in DVB 2016-07-07 04:00:20 -07:00
Abhinav Shukla
89efdb6178 Sauvola Binarization, color independent thresholding 2016-07-06 19:15:44 -07:00
Abhinav Shukla
a37a08ef70 Merge remote-tracking branch 'upstream/master' 2016-07-06 19:08:34 -07:00
Carlos Fernandez
db80caf74a - WebVTT from DVB
- Added X-TIMESTAMP-MAP to the WebVTT header
2016-07-06 12:18:40 -07:00
Carlos Fernandez
672010711d spung: Embedded OCR comments inside the spupng tags (instead of below), much more readable. 2016-07-05 15:20:28 -07:00
Carlos Fernandez
a4cea54db8 Passed CRLF to OCR 2016-07-05 14:48:54 -07:00
Carlos Fernandez
ddbf8124a8 Merge branch 'pr/n399_canihavesomecoffee' 2016-07-05 10:34:22 -07:00
canihavesomecoffee
5655db6cd2 Update Linux & Mac build
Update the Linux & Mac build to reflect the changes made for the version
file.
2016-07-05 18:10:19 +02:00
canihavesomecoffee
c764ced536 Update compile info 2016-07-05 18:05:44 +02:00
canihavesomecoffee
9f4bff884f Update build script for windows
-
2016-07-05 18:01:47 +02:00
canihavesomecoffee
b002d58259 Updates git ignore for new file
Add a git ignore for the "real" dynamic header file, remove the ignore
for the other one.
2016-07-05 17:57:47 +02:00
Anshul Maheshwari
bdf3f6d833 close #394 Illegal .srt being created from DVBs 2016-07-03 23:59:19 +05:30
Anshul Maheshwari
7f183193d5 resolve Tesseract fail cause spngpng to fail #391
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-07-03 23:03:23 +05:30
Anshul Maheshwari
d3ae186f6b Merge remote-tracking branch 'origin/master' 2016-07-03 13:05:09 +05:30
Anshul Maheshwari
18cd92e5a8 close #397 Incorrect progress display 2016-07-03 13:04:17 +05:30
Abhinav Shukla
0e4281d4a2 Merge remote-tracking branch 'upstream/master' 2016-06-30 14:29:04 -07:00
Abhinav Shukla
7d19fa971d Setting up encoder 2016-06-30 14:19:50 -07:00
Anshul Maheshwari
a66c5aae06 Correcting y offset 2016-06-28 23:25:20 +05:30
Anshul Maheshwari
eea1792f0e Fix memory leakage in spupng
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-06-27 00:54:44 +05:30
Anshul Maheshwari
e6bd773762 Fixing missing lines in spupng
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-06-27 00:33:06 +05:30
bigharshrag
2cc8ecf20a More restructuring 2016-06-22 23:47:32 +05:30
bigharshrag
9ca3dc91ee Structure changes 2016-06-22 15:56:54 +05:30
Abhinav Shukla
98f1e15666 Limiting sutitle region to bottom 25% of the frame 2016-06-21 07:31:01 -07:00
Abhinav Shukla
c61e787bca Midterm evaluation - initial code 2016-06-21 06:48:10 -07:00
bigharshrag
89eba5e3e8 Removed extra debugging statements 2016-06-21 01:14:08 +05:30
bigharshrag
8bc1782589 Fixes for Major bugs in decoding RLE 2016-06-20 20:03:21 +05:30
bigharshrag
93a55bff8c Create bitmap 2016-06-20 03:44:50 +05:30
bigharshrag
39dec02dc4 Getting 4 bits data 2016-06-20 02:50:33 +05:30
bigharshrag
24dc763c4f Decode Run length encoding 2016-06-20 00:47:15 +05:30
bigharshrag
38f9f65ad8 small restructuring 2016-06-18 19:01:27 +05:30
bigharshrag
eaed758aa0 Critical bug fix 2016-06-18 00:34:24 +05:30
bigharshrag
705766a5ee Removed extra debugging statements 2016-06-17 23:39:28 +05:30
bigharshrag
23a99c04e9 Added processing of control packets 2016-06-17 23:02:37 +05:30
bigharshrag
1a1e9732b9 Init DVD sub decoder 2016-06-16 23:48:03 +05:30
Abhinav Shukla
2dfa3778cb Added seeking to a frame at a particular time instead of linear iteration 2016-06-16 04:57:21 -07:00
Abhinav Shukla
d99dc4c6f8 Setting up binary neighbourhood search workflow and other helpers 2016-06-15 17:01:44 -07:00
Abhinav Shukla
8507a842be Added HSV colorspace conversion 2016-06-15 16:25:39 -07:00
bigharshrag
4cafcc053e Fixes to reading PES header 2016-06-16 02:29:13 +05:30
bigharshrag
30e2c7117c Process PES header for subtitles 2016-06-15 23:58:09 +05:30
Abhinav Shukla
8e5b9b2655 Merge remote-tracking branch 'upstream/master' 2016-06-14 12:02:08 -07:00
Abhinav Shukla
954724e12a Added vertical edge detection and morphology to get subtitle ROI 2016-06-14 11:59:10 -07:00
Carlos Fernandez
97dd511452 Merge branch 'pr/n390_rkuchumov' 2016-06-14 10:57:09 -07:00
Kuchumov Ruslan
93b1e64896 skipping redundant bytes at the end of tx3g atom 2016-06-14 09:44:35 +03:00
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
Abhinav Shukla
13db1dfbfa Fixing error with frame numbers of parsed packets, now parsing video only 2016-06-09 16:31:25 -07: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
Abhinav Shukla
bc40119b72 Basic text output 2016-06-03 12:55:56 -07:00
Abhinav Shukla
65587815ff Basic video frame processing with ffmpeg 2016-06-02 13:57:08 -07:00
Abhinav Shukla
c3eabcfd96 Setting up ffmpeg frame processing (-s in the Makefile to reduce executable size) 2016-06-01 17:37:58 -07:00
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
Abhinav Shukla
204543af9a Setting up preliminary HardsubX context 2016-05-30 14:38:50 -07:00
Abhinav Shukla
c8345643c6 Adding HardsubX workflow 2016-05-30 10:44:55 -07:00
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
Abhishek Vinjamoori
0de521f22b Fixed No preview in GUI versions. 2016-04-21 00:58:49 +05:30
Abhishek Vinjamoori
c027b449cf Fixes issue #285. Added Previews which were missing after refactoring 2016-04-17 19:13:12 +05:30
David Liontooth
b385fa74b0 Update build.command
Include zvbi to fix #346
2016-04-16 16:17:47 -07:00
cfsmp3
0427878dbd Merge branch 'pr/n348_Abhinav95' 2016-03-29 18:25:37 +02:00
Abhinav Shukla
93797023e3 Fixing error in setting xds_write_to_file 2016-03-28 15:02:38 -07:00
Abhinav Shukla
02cd11ec7c Fixing xds_write_to_file 2016-03-28 13:25:44 -07:00
Abhinav Shukla
edc3d85cd5 Minor Refactoring 2016-03-28 13:22:12 -07:00
Abhinav Shukla
0e9d0e6e46 Fixing problems with XDS 2016-03-28 11:50:40 -07:00
cfsmp3
07e9d8a04e Merge branch 'pr/n343_at25sep' 2016-03-28 12:42:32 +02:00
cfsmp3
524ec68a63 Merge branch 'pr/n329_abhishek-vinjamoori' 2016-03-25 19:43:37 +01:00
canihavesomecoffee
046fd4c435 Fix windows build
Fixes windows build by adding zvbi folder to includes
2016-03-21 23:08:21 +01:00
at25sep
2fb03f3af3 Fix #257 2016-03-21 12:14:54 +05:30
cfsmp3
cd4267bc2e Merge branch 'pr/n336_Abhinav95' 2016-03-19 11:16:13 +01:00
Abhinav Shukla
48c4306cdc Fixing naming and indent 2016-03-19 02:58:32 -07:00
cfsmp3
63fd4ad847 Merge branch 'pr/n324_YorkHe' 2016-03-18 09:51:37 +01:00
cfsmp3
2cf86d46ff Merge branch 'pr/n331_at25sep' 2016-03-18 09:49:36 +01:00
bigharshrag
3c3f7afb32 Fix * displaying instead of @ 2016-03-18 10:43:22 +05:30
Abhinav Shukla
a046be0ebb Fixing issue of timestamp not incrementing if global timestamp not initialized (+ removing errors in last commit) 2016-03-17 16:54:59 -07:00
cfsmp3
dc2af919eb Merge branch 'pr/n335_bigharshrag' 2016-03-17 23:05:00 +01:00
bigharshrag
23b7470daf Bugfixes for Latin G2 subset
Bug fix for accented latin characters

Bugfixes for Latin G2 subsets and accented characters
2016-03-18 02:26:41 +05:30
Abhinav Shukla
78585c84b4 ISDB timestamps now incrementing by setting current timestamp to the FTS 2016-03-17 08:30:36 -07:00
Abhinav Shukla
02b93fa73f ISDB - Fixing end timestamp and ignoring teletext page value NA in -ucla 2016-03-16 16:19:33 -07:00
cfsmp3
3c6aff704c Added CR 2016-03-16 18:18:01 +01:00
cfsmp3
beeb797b6e Merge branch 'pr/n328_abhishek-vinjamoori' 2016-03-16 18:16:56 +01:00
cfsmp3
d275463039 Removed double space (trivial change) 2016-03-16 17:32:25 +01:00
Abhinav Shukla
51dae0ba8d Fixing broken end timestamp in -ucla (Removing unnecessary changes) 2016-03-16 09:16:59 -07:00
Abhinav Shukla
850f5f98b6 Fixing broken end timestamp in -ucla 2016-03-16 09:08:34 -07:00
Abhishek Vinjamoori
0424a474bc Fixed Segfault while parsing unterminated outinterval(without paramters) 2016-03-16 21:23:37 +05:30
at25sep
37496f8a1a typo mistake 2016-03-16 19:57:47 +05:30
at25sep
02593c9867 mfra mp4 box weight changed to 1 #273 2016-03-16 19:55:21 +05:30
Abhishek Vinjamoori
79ab53876c Target file NULL fixed 2016-03-16 11:44:41 +05:30
Abhishek Vinjamoori
a917695029 Fixed SegFaults while parsing parameters. Fixes issue #326 2016-03-16 10:55:26 +05:30
Neha Bagari
b2bfebce6f Check for number of args
Fixes #326

Usage of -codec and -nocodec options at the end without any following option
gives 'Segmentation fault'.

Added checks to overcome this.

Signed-off-by: Neha Bagari <neha.bagari.eee11@iitbhu.ac.in>
2016-03-16 09:52:23 +05:30
York
5b5f358919 Referring Issue #270. Detailed opening file error message 2016-03-14 19:38:49 +08:00
cfsmp3
92df11162c Merge branch 'pr/n307_Aesmade' 2016-03-14 10:23:58 +01:00
cfsmp3
6feef59d75 Replaced OSX build.command by a new one submitted by email by Alex Karahalios <alex@karahalios.org> 2016-03-14 09:58:22 +01:00
cfsmp3
944c6d25a2 Merge branch 'pr/n319_bigharshrag' 2016-03-13 19:21:53 +01:00
cfsmp3
9e94520a54 Merge branch 'pr/n317_Abhinav95' 2016-03-13 18:41:34 +01:00
bigharshrag
d249b1cf1b Added Cyrillic support (+ removed debugging statements) 2016-03-13 20:37:50 +05:30
bigharshrag
5661e4f37b Added Cyrilic support 2016-03-13 20:20:55 +05:30
bigharshrag
e8ae2874d6 Testing first buffer error 2016-03-13 19:48:47 +05:30
bigharshrag
f3c386f729 Clearer code 2016-03-13 17:32:43 +05:30
bigharshrag
03b8f93e04 Partial fix for Cyrilic support 2016-03-13 04:51:16 +05:30
bigharshrag
2a583883dc Partial fix for Cyrilic support 2016-03-13 04:48:22 +05:30
Abhinav Shukla
1cee9200b2 Fixing broken links 2016-03-12 05:31:32 -08:00
barun511
c634cf5ada Fixed a typo
The command that was ccextrator "name of input" should have been ccextractor "name of input"
2016-03-12 15:40:53 +05:30
Abhinav Shukla
804c6414ee Merge remote-tracking branch 'upstream/master' 2016-03-11 10:14:56 -08:00
Abhinav Shukla
0cc9642851 Removing changes to string_cmp2 2016-03-11 09:52:20 -08:00
Nikos Filippakis
286398c15d Added --forceflush (-ff) option for forcing a flush on the output buffer whenever content is written, closes #306 2016-03-11 14:10:00 +02:00
Nikos Filippakis
d0b57ecb1f Fix issue #274, caused by commit 8d073accd4 2016-03-09 18:16:21 +02:00
cfsmp3
5b11c6a5c6 Merge branch 'pr/n294_abhishek-vinjamoori' 2016-03-09 07:53:16 +01:00
cfsmp3
90c8da76bd Merge branch 'pr/n302_vinayakathavale' 2016-03-09 07:46:44 +01:00
York
e87ed5ba1c fix issue #288 2016-03-09 14:30:01 +08:00
York
1aa9a7c4d9 Merge remote-tracking branch 'upstream/master' into fallout 2016-03-09 14:04:08 +08:00
vinayak
509cb9839d Made code ISO/IEC 14496-12:2015 compliant 2016-03-09 11:06:10 +05:30
Abhinav Shukla
0089901b07 Fixed segfault on using -sc for a blank line 2016-03-08 07:45:50 -08:00
cfsmp3
877ee7b2c7 Fix fflush() segfault 2016-03-08 08:55:55 +01:00
cfsmp3
d117dacf0f fflush() after writing subtitles 2016-03-08 15:03:57 +08:00
York
1ea58bd200 Revert "fflush() after writing subtitles"
This reverts commit 4d4af9ff7f.
2016-03-08 15:01:20 +08:00
cfsmp3
dcc8af915f Merge branch 'pr/n292_abhishek-vinjamoori' 2016-03-07 18:33:40 +01:00
cfsmp3
4d4af9ff7f fflush() after writing subtitles 2016-03-07 10:15:26 +01:00
YorkHe
a9a861e8f2 Fix CMakeLists.txt 2016-03-07 14:44:49 +08:00
=
ab70c8b382 Additional Argument added to sprintf giving the correct format specifier. 2016-03-06 23:24:57 +05:30
=
d8e99ef810 Fixed format specifier for uint64_t 2016-03-06 20:15:11 +05:30
=
c92e92f73d Fixed function declaration issues in lib_ccx.h(Funciton defined in output.c) 2016-03-06 19:55:40 +05:30
Willem
d3862ba88b Fix path
-
2016-03-05 13:19:20 +01:00
Anshul Maheshwari
0023c6545b make code windows compatible
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-02-17 21:13:09 +05:30
Anshul Maheshwari
2ca835ea1b update linux build scripts
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2016-02-09 16:27:49 +01:00
Anshul Maheshwari
20859d3ee7 Adding GXF support
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2016-02-09 16:12:15 +01:00
Carlos Fernandez
e79700ea93 added -koc (keep output closed) for -simplexml. 2016-02-05 10:25:11 -08:00
Carlos Fernandez
e02d9bd98b Merge branch 'pr/n272_anshul1912' 2016-01-31 06:57:58 -08:00
Anshul Maheshwari
d7136a8390 Move FFmpeg demuxer in cc_demuxer from ccextractor
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-28 17:49:42 +05:30
cfsmp3
e1d8da9d37 Merge branch 'pr/n267_anshul1912' 2016-01-23 09:15:21 +01:00
cfsmp3
cfecd67500 Added GPL 2 to the document directory 2016-01-23 09:14:26 +01:00
Anshul Maheshwari
26623b2428 Merge branch 'master' of https://github.com/anshul1912/ccextractor 2016-01-20 16:33:09 +05:30
Anshul Maheshwari
44d9117d8d reverted back the changes for issue #269
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-20 16:31:25 +05:30
Anshul Maheshwari
31de878ea7 error check before file open
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-16 14:10:19 +05:30
cfsmp3
9768555e7c Added g608 explanation document. 2016-01-09 18:07:30 +01:00
cfsmp3
72e422d76e Correct minor warning. Added release date to CHANGES.TXT 2016-01-09 17:52:07 +01:00
cfsmp3
8860be13e4 Versión number bump 2016-01-09 15:35:33 +01:00
Anshul Maheshwari
3b7ad97f0a newline at start of print
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-09 19:22:07 +05:30
Anshul Maheshwari
5e305f2769 print total_frames_time only when atsc caption
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-09 19:20:28 +05:30
cfsmp3
0a798606ee Added --noscte20 option to help screen. 2016-01-09 11:15:28 +01:00
Anshul Maheshwari
3775daf36c Added --noscte20 close #244
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-09 15:29:51 +05:30
Anshul Maheshwari
8c5de01034 Add --nohtmlescape
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-08 11:21:14 +05:30
Anshul Maheshwari
1c352e67e4 Add --nohtmlescape
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-08 11:20:29 +05:30
Anshul Maheshwari
79838077f2 cleanup telexcc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-08 11:03:52 +05:30
Anshul Maheshwari
058bb83a25 updated CHANGE for bugs resolved
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-07 16:11:19 +05:30
Anshul Maheshwari
d2f840bb36 portable conversion of number to character
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-07 15:14:59 +05:30
Anshul Maheshwari
a576c90f4e G608 encoder file
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-07 14:51:33 +05:30
Anshul Maheshwari
a1bd01de5f Added g608 support
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-07 14:46:44 +05:30
Anshul Maheshwari
9a5e817f36 Add -h and --help option
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-04 16:11:33 +05:30
Anshul Maheshwari
bc20bc3f45 print teletext number of packet processed
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-04 16:01:36 +05:30
Anshul Maheshwari
783a6e2aa0 Remove False Message for Teletext
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-04 15:35:29 +05:30
Anshul Maheshwari
992c56b262 no xml header when teletext
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-04 15:14:06 +05:30
Anshul Maheshwari
c674cef79e Remove seg-fault at invalid mp4 detection
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2016-01-01 16:04:23 +05:30
cfsmp3
509ed756fd 0.78 2015-12-14 21:29:45 +01:00
cfsmp3
152b69ddba Changed version number to 0.78 2015-12-12 18:53:48 +01:00
Anshul Maheshwari
c2eedab33d Adding simple xml support
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-12-12 17:49:54 +05:30
Carlos Fernandez
677fee4145 Start segments at 1 2015-10-28 06:58:26 -07:00
Anshul Maheshwari
72dad743dc remove white space
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 19:14:52 +05:30
Anshul Maheshwari
e262b0699a Memory Cleanup
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 19:05:52 +05:30
Anshul Maheshwari
6942089a32 Remove Dead Code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 17:59:10 +05:30
Anshul Maheshwari
993adc3dec Indenting psi function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 17:58:09 +05:30
Anshul Maheshwari
fe7a39c0cb initialized end of string
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 17:53:20 +05:30
Anshul Maheshwari
3bd704e495 working explicit no roll up in ISDB
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-27 13:59:13 +05:30
Anshul Maheshwari
6992e54f8e Correct indentation
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-26 10:15:15 +05:30
Anshul Maheshwari
4d5ab77fed improve isdb
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-25 15:29:18 +05:30
Anshul Maheshwari
1b2328d728 Adding No Rollup in ISDB
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-23 19:34:47 +05:30
Anshul Maheshwari
2944e12541 remove unnecessary space
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-23 15:33:13 +05:30
Anshul Maheshwari
763972ca4b Added latin-1 support for teletext transcript
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-23 04:22:11 +05:30
Anshul Maheshwari
01fe0c1fc9 consider last character
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-23 01:56:39 +05:30
Anshul Maheshwari
8d160a70ff Correcting broken encoding of telexcc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-23 01:15:40 +05:30
Anshul Maheshwari
fc90b9c9f5 Added caption server details in logs
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-21 20:52:50 +05:30
Anshul Maheshwari
0a803df23f Adding parsing logic for private user data
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-21 18:24:36 +05:30
Anshul Maheshwari
d3a1ed4b06 Adding Caption descriptor
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>

This description has been added with refrence to descripton defined
in ATSC Standard

Standard Name:   Digital Video Service Multiplex and
              Transport System Standard for Cable Television

Standard Number: ANSI/SCTE 54 2009
Table 5.5 Descriptors
Section 5.8.3.6 Caption service descriptor

This was implemented for broken video in Willem testSuite with number 6
2015-10-21 17:21:39 +05:30
Anshul Maheshwari
ad89e0074b revert back max bframe
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-21 14:05:59 +05:30
Anshul Maheshwari
169a39eb3e correct Garbeled cc in multiple slice header
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-21 13:19:46 +05:30
Anshul Maheshwari
a6145af7f3 newline after showing all payload
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-19 16:47:28 +05:30
Anshul Maheshwari
03b60ef140 use common logger
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-19 13:37:51 +05:30
Anshul Maheshwari
1b7ef1e198 remove dead code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-19 13:37:01 +05:30
Anshul Maheshwari
72de68a575 Specify es paresr specific function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>

They should be moved in structure instead of writing them openly in
common decoder
2015-10-19 13:34:07 +05:30
Anshul Maheshwari
24e7b94599 regards for local count while allocatinf buffer
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-19 13:33:19 +05:30
Anshul Maheshwari
c5dc4531ae use CCX_TRUE instead of 1
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-19 13:31:22 +05:30
Anshul Maheshwari
a3e07b4a63 putting back logic of skiping packet when empty
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-17 18:16:43 +05:30
Anshul Maheshwari
d48555b849 clear buffer after copid to cc_sub
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-06 13:48:04 +05:30
Anshul Maheshwari
a1f05caddf same name buf instead buf1 buf2
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-06 13:17:05 +05:30
Anshul Maheshwari
669eb36603 remove redundant logs
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-10-06 08:54:09 +02:00
Anshul Maheshwari
ce379bcfda nb of data not decreased properly
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-10-06 08:51:43 +02:00
Anshul Maheshwari
00657ffdcd reset payload
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-10-05 15:59:56 +02:00
Anshul Maheshwari
d9e0ba027f memset payload
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-05 19:26:38 +05:30
Anshul Maheshwari
a7279e3d8a initialize min glb time stamp
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-05 19:07:19 +05:30
Anshul Maheshwari
61ae7e9f10 Merge branch 'master' of github.com:anshul1912/ccextractor 2015-10-05 19:03:20 +05:30
Anshul Maheshwari
548d323ca1 Initialize maxtref
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-05 19:03:01 +05:30
Anshul Maheshwari
d2d7a17f3b strtok_r for windows
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-05 12:58:09 +05:30
cfsmp3
65b0ed0038 Merge branch 'pr/n232_kisselef' 2015-10-04 09:56:20 +02:00
cfsmp3
2b0523d34c Merge branch 'pr/n233_anshul1912' 2015-10-04 09:55:28 +02:00
Anshul Maheshwari
5bef6bd5a4 ISDB tag in transcript mode
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-03 20:25:36 +05:30
Anshul Maheshwari
5ca3965c7b care newline in isdb to transcript
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-10-03 19:18:37 +05:30
Oleg Kisselef
e855665c87 cea-708 fixed unhandled predefined window styles 2015-10-02 13:25:14 +03:00
cfsmp3
e9bf8dad9f Merge branch 'pr/n231_anshul1912' 2015-09-30 13:54:15 +02:00
Anshul Maheshwari
54c2b21a4c Update isdb changes
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-30 17:21:53 +05:30
cfsmp3
afe5cba480 Merge branch 'pr/n230_anshul1912' 2015-09-30 13:45:15 +02:00
Anshul Maheshwari
8c34f4cbb2 make pcr program wise
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-30 16:34:27 +05:30
Anshul Maheshwari
e422e7075a correct buffered_read_opt declaration
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-30 14:06:35 +05:30
Anshul Maheshwari
cc0ee507dd remove some vs warning
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-30 13:37:27 +05:30
cfsmp3
540850f0b9 Merge branch 'pr/n230_anshul1912' 2015-09-29 17:05:54 +02:00
Anshul Maheshwari
a973c0a9c3 Merge remote-tracking branch 'upstream/master' into isdb 2015-09-29 20:34:42 +05:30
Anshul Maheshwari
ae27b3411b changed some variable name in isdb
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-29 20:34:20 +05:30
cfsmp3
89c4ac091a Merge branch 'pr/n230_anshul1912' 2015-09-29 16:56:34 +02:00
Anshul Maheshwari
843ca9b60a add ISDB source files
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-29 20:22:53 +05:30
cfsmp3
d135362d40 Add leading 0s in segment names 2015-09-29 16:51:59 +02:00
Anshul Maheshwari
2f1b9df6e9 ISDB support
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-29 20:18:50 +05:30
kisselef
7190af4e79 implemented all predefined window styles 2015-09-28 22:42:14 +03:00
kisselef
2898584ee3 Merge branch 'master' into feature-cea-708 2015-09-28 22:35:24 +03:00
cfsmp3
5ef2519bf5 Merge branch 'pr/n228_anshul1912' 2015-09-24 12:22:45 +02:00
Anshul Maheshwari
f258d317cc remove uninitialized memory
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-24 15:51:35 +05:30
cfsmp3
4d3fcd6779 Merge branch 'pr/n228_anshul1912' 2015-09-24 11:54:23 +02:00
Anshul Maheshwari
f1b0aff789 Adding system segmentation logic
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-24 15:18:46 +05:30
wforums
6e9a30b354 fix solution
-
2015-09-24 00:08:19 +02:00
wforums
37091708b7 Merge remote-tracking branch 'CCExtractor/master'
Conflicts:
	windows/ccextractor.vcxproj.filters
2015-09-24 00:05:46 +02:00
wforums
0885aae79c Updating project files
-
2015-09-24 00:03:54 +02:00
Anshul Maheshwari
5e5d30d154 Merge branch 'master' of github.com:anshul1912/ccextractor 2015-09-23 23:25:40 +05:30
Anshul Maheshwari
a614db1e20 Add option to segment file
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-23 23:25:18 +05:30
Anshul Maheshwari
f7f29e558b removed uninitialized use of result
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-09-18 11:59:00 +02:00
Anshul Maheshwari
ddc1bfe74f removed global variable result
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-18 12:39:27 +05:30
Anshul Maheshwari
18b95d9564 renamed headerfile
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 15:51:20 +05:30
Anshul Maheshwari
b012f87d87 move buffered read to file_buffer
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 15:45:16 +05:30
Anshul Maheshwari
73f277fe95 rename to keep consistency with other file
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 00:52:38 +05:30
Anshul Maheshwari
bd3df850a5 renamed 608 encoder to generic cc_encoders
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 00:36:12 +05:30
Anshul Maheshwari
73b52462c0 rename encoders from 608 to generic
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 00:28:15 +05:30
Anshul Maheshwari
267d7b4a2e moved buffer_read to file_buffer
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-17 00:00:22 +05:30
Anshul Maheshwari
35cdeda56c Adding error checking for memory in epg
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-16 17:59:44 +05:30
Anshul Maheshwari
0f90eebdf6 uninitialized section length
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-16 17:59:40 +05:30
Anshul Maheshwari
962357ed0f Adding comments
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 19:56:46 +05:30
Anshul Maheshwari
69d077df9e Adding space and reindenting
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 18:07:54 +05:30
Anshul Maheshwari
e2b0534374 remove dead code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 17:57:39 +05:30
Anshul Maheshwari
4204b7878d remove dangling declaration
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 17:55:39 +05:30
Anshul Maheshwari
1e2237f7ec saving missing result
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 17:41:00 +05:30
Anshul Maheshwari
6bfe3b3f86 Merge branch 'master' of github.com:anshul1912/ccextractor 2015-09-15 17:12:06 +05:30
Anshul Maheshwari
940bee33a4 Merge remote-tracking branch 'upstream/master' 2015-09-15 17:10:54 +05:30
cfsmp3
7c787157d8 Added -dumpdef (dump defective TS packet) as a debug option 2015-09-15 12:40:45 +02:00
Anshul Maheshwari
7514886199 change from int to LLONG
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 15:15:37 +05:30
Anshul Maheshwari
ad5b917f3b Compile code in vs2013
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 15:04:59 +05:30
Anshul Maheshwari
66408fc950 moved buffered_read to inline function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-15 13:51:34 +05:30
cfsmp3
94ec02eea9 Merge branch 'pr/n226_anshul1912' 2015-09-14 13:08:31 +02:00
Anshul Maheshwari
5e33e2e2ac Avoid derefrence of NULL
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-12 21:13:07 +05:30
cfsmp3
34613037fc bugfix in webvtt 2015-09-08 17:17:38 +02:00
Anshul Maheshwari
f2b24f13af refactor Webvtt
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>

1) remove srt counter from webvtt
2) add include files so that compiler gives error at incorrect arguments in function call
3) WEBVTT Header do not use srt counter but declared as static const str wriiteen while writing any header
4) Removed srt counter from output file from webvtt refrence taken from http://dev.w3.org/html5/webvtt/
2015-09-08 16:10:37 +05:30
cfsmp3
c718d21d0f Changes to other files 2015-09-08 11:17:28 +02:00
cfsmp3
a2828f0060 -Merge branch 'pr/n216_anshul1912'
-Added WebVTT support (manual merge of the previous PR)
2015-09-07 11:29:07 +02:00
rkuchumov
4b3b846a2c updated changes.txt 2015-09-03 20:49:29 +03:00
Anshul Maheshwari
b232945c71 refactoring headers includes
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-02 12:32:22 +05:30
Anshul Maheshwari
f91d1cb9b7 remove errors due to incorrect merge
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-01 15:26:50 +05:30
Anshul Maheshwari
fadd8aad8b merge multiprogram changes to main
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-09-01 12:53:05 +05:30
cfsmp3
b0479b247a Merge branch 'pr/n219_kisselef' 2015-08-28 10:12:19 +02:00
cfsmp3
a659544bd2 Merge branch 'pr/n217_brooss' 2015-08-28 10:09:29 +02:00
Oleg Kisselef
9ce4c99180 cea-708 usage help updated 2015-08-28 09:58:50 +03:00
Oleg Kisselef
52f51147b8 cea-708 predefined window styles 2015-08-28 09:49:10 +03:00
Oleg Kisselef
34836b50a1 cea-708 structures renamed according to POSIX. enums names updated. 2015-08-27 22:04:13 +03:00
Oleg Kisselef
7179796365 fixed linux build scripts 2015-08-27 13:50:55 +03:00
Oleg Kisselef
966c90eece win-build: strndup function implementation added 2015-08-27 11:19:03 +03:00
Oleg Kisselef
3281bf929a win-build: iconv updated and executable code removed from header 2015-08-27 11:14:34 +03:00
Oleg Kisselef
906a0704bc -awin-build: networking.c endl 2015-08-27 11:08:17 +03:00
Oleg Kisselef
20785c095c -awin-build: fixed ioctl on windows 2015-08-27 11:07:54 +03:00
Oleg Kisselef
dee2280d06 cea-708 fixed txt,ttxt crlf output 2015-08-26 21:46:40 +03:00
Oleg Kisselef
f6b69b64c3 cea-708 norollup parameter passing. removed ccx_options dependency 2015-08-26 21:42:57 +03:00
Oleg Kisselef
2f09b37f7c cea-708 fixed default pen color 2015-08-26 21:29:32 +03:00
Oleg Kisselef
20cf0f5151 cea-708 detecting malformed services parameter 2015-08-26 19:55:05 +03:00
Oleg Kisselef
860e926b5a cea-708 fixed mem usage bugs 2015-08-26 17:53:12 +03:00
Oleg Kisselef
9f81a4b5c1 cea-708 charset support 2015-08-26 17:26:19 +03:00
Oleg Kisselef
5d85220121 cea-708 cleaning up writers 2015-08-26 16:16:36 +03:00
Oleg Kisselef
6423efa2d7 cea-708 multiprogram support done 2015-08-26 15:54:52 +03:00
Oleg Kisselef
932cb77265 encoding cea-708 2015-08-26 13:54:09 +03:00
Anshul Maheshwari
691244a00e initilaize min_pts to 0 in rcwt
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 17:52:07 +05:30
Anshul Maheshwari
440c59a5fd Adding space to rcwt_loop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 17:33:07 +05:30
Anshul Maheshwari
8a3e2b5efc remove derefrencing global variable
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 16:37:11 +05:30
Anshul Maheshwari
119a4361df remove if condition
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-08-25 12:35:17 +02:00
Anshul Maheshwari
6c93b6dcf4 initialized variables
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 15:56:07 +05:30
Oleg Kisselef
4d76cd30c0 cea-708 removed unnecessary data from dtvcc decoder 2015-08-25 12:41:30 +03:00
Anshul Maheshwari
96fd051e01 pass dec_ctx instead of its channel
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 14:12:30 +05:30
Anshul Maheshwari
2fe0da30be ignore xds if not selected in transcript
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-25 11:51:09 +05:30
Brooss
890e045a88 SDT: Remove code adding extra null to channel name string end. 2015-08-25 12:34:36 +10:00
Oleg Kisselef
b333df4317 cea-708 keeping symbols in 16-bit variables 2015-08-25 00:05:34 +03:00
Oleg Kisselef
33d91a979c fixed charset handling for cea-708 2015-08-24 23:59:43 +03:00
Anshul Maheshwari
b3614f592f dont derefrence global variables
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-24 20:36:24 +05:30
Anshul Maheshwari
3bdb5f3863 remove xds global init
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-24 20:21:58 +05:30
Anshul Maheshwari
ad6346f802 making xds_context and moving global vars
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-24 20:11:14 +05:30
Anshul Maheshwari
66f41438be moving global variable of sequence to ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-24 16:55:06 +05:30
Anshul Maheshwari
647a91eafa shifting global variable in context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-24 13:41:35 +05:30
Brooss
ecf200e290 Add support for parsing the Service Description Table in MPEGTS and using it to provide real channel names in EPG output. 2015-08-24 14:35:10 +10:00
Anshul Maheshwari
da576bff2b Pass timing in get_fts function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-22 17:45:09 +05:30
Anshul Maheshwari
fcbf113526 Merge remote-tracking branch 'upstream/master' 2015-08-22 14:46:06 +05:30
cfsmp3
b90d144ff6 Merge branch 'pr/n213_anshul1912' 2015-08-22 10:48:45 +02:00
cfsmp3
2ac0ed2032 Merge branch 'pr/n214_rkuchumov' 2015-08-22 10:47:49 +02:00
cfsmp3
0afefc0392 Merge branch 'pr/n215_brooss' 2015-08-22 10:46:29 +02:00
Oleg Kisselef
9efe2b4b22 cea-708 debug message on decoder creation added 2015-08-22 09:51:02 +03:00
Oleg Kisselef
d54d881390 cea-708 color-per-row support 2015-08-22 00:03:13 +03:00
Oleg Kisselef
58b496a434 log text updated 2015-08-21 23:14:31 +03:00
Oleg Kisselef
41a8803860 checking if current window is set 2015-08-21 23:13:35 +03:00
Oleg Kisselef
4146423878 cea-708 code flow almost same as for 608 captions 2015-08-21 23:07:10 +03:00
Oleg Kisselef
1c35dcae03 fixed creating of file if output=null 2015-08-22 10:30:25 +03:00
Oleg Kisselef
3bcdbce709 dependencies updated 2015-08-22 08:56:52 +03:00
Brooss
250ee1f29b Parse after buffer fill, not on next packet 2015-08-22 04:04:46 +10:00
Brooss
fd1a86b2f5 Add support for multi-packet PATs and PMTs in MPEGTS 2015-08-22 02:25:10 +10:00
Anshul Maheshwari
3433ed2e5c removed somestatic variable from avc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-21 15:22:30 +05:30
rkuchumov
c7606beae1 segfault when closing socket input fixed (forgot about this file) 2015-08-20 19:58:38 +03:00
rkuchumov
d639323e4c segfault when closing socket input fixed 2015-08-20 19:48:34 +03:00
rkuchumov
72e780f175 ccextractor-ccextractor connection fix 2015-08-20 17:16:47 +03:00
Anshul Maheshwari
651dc67a5d update linux related chages in ocr
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-20 18:24:37 +05:30
Oleg Kisselef
6cfd7710a7 Merge branch 'master' into feature-cea-708 2015-08-19 23:47:59 +03:00
Oleg Kisselef
adc1d4662d changes 2015-08-19 20:25:07 +03:00
Oleg Kisselef
5c51b582bf cea-708 yet another big refactoring. rollup captions added. 2015-08-19 19:16:19 +03:00
Oleg Kisselef
16e794163c cea-708 added show/hide time for screens and windows 2015-08-19 18:58:43 +03:00
Oleg Kisselef
4e25d80b48 checking if have 708 captions when updating fts_global 2015-08-19 18:57:37 +03:00
Oleg Kisselef
2949918ed1 some timing debug info added 2015-08-19 18:55:47 +03:00
Oleg Kisselef
46ea522ecb cea-708 output style fix 2015-08-19 08:19:13 +03:00
Oleg Kisselef
f571a04ffc cea-708 doc updated 2015-08-18 23:28:32 +03:00
Oleg Kisselef
610b811d53 cea-708 encoding->charset 2015-08-18 17:09:57 +03:00
Oleg Kisselef
e5c4053c05 cea-708 decoder ff and hcr handling 2015-08-18 14:28:34 +03:00
Anshul Maheshwari
0b9bf16850 updated ocr doc file
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-18 16:14:54 +05:30
Oleg Kisselef
8489edf966 cea-708 params help updated 2015-08-18 13:34:41 +03:00
Oleg Kisselef
22127cccb0 added extra space because unicode symbols can be 6-byte long. cleaning windows where needed. 2015-08-18 11:57:35 +03:00
Anshul Maheshwari
57eb42c7bb Compile code using Visual studio
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-18 12:19:33 +05:30
Oleg Kisselef
0a6630f7ab specifying an encoding for non-latin languages for CEA-708 captions 2015-08-18 09:26:01 +03:00
Oleg Kisselef
b89dd8d401 cea-708 Korean encoder anchor position issue workarounded 2015-08-17 21:40:32 +03:00
Oleg Kisselef
778e66f951 cea-708 sami output merged 2015-08-17 17:55:18 +03:00
Oleg Kisselef
7a06d99443 cea-708 transcript output merged 2015-08-17 17:25:40 +03:00
Oleg Kisselef
3fff94a555 cea-708 srt and debug output refactored and improved 2015-08-17 17:09:53 +03:00
Oleg Kisselef
b65cc8ad8e dont handling 16-bit chars for cea-708 2015-08-17 09:53:24 +03:00
rkuchumov
28ddfef2b1 sending header when reconnecting 2015-08-16 19:15:15 +03:00
rkuchumov
f23cc1f41e reconnecting when no ping arrived 2015-08-16 12:25:01 +03:00
rkuchumov
1ca63ba125 mandatory desc and passw blocks 2015-08-16 11:14:00 +03:00
Oleg Kisselef
af66ace345 cea-708 defined utf8 symbol max size in bytes 2015-08-14 23:33:06 +03:00
Oleg Kisselef
c0079aee6f cea-708 handling 16-bit characters (utf16) 2015-08-14 23:29:32 +03:00
Oleg Kisselef
21a88f9cc1 added utf16 to utf8 conversion function 2015-08-14 23:28:39 +03:00
Oleg Kisselef
9923ef98ee added "all" value for cea-708 services 2015-08-14 20:52:28 +03:00
Oleg Kisselef
abce1dd873 moved cea-708 global variables into single context variable 2015-08-14 13:28:59 +03:00
Oleg Kisselef
308d500308 more cea-708 refactoring 2015-08-14 09:49:22 +03:00
Oleg Kisselef
ae6cf97bce more cea-708 refactorings 2015-08-14 00:30:53 +03:00
rkuchumov
53bedd30c1 sending ping to server 2015-08-13 22:59:45 +03:00
Oleg Kisselef
764d251986 cea-708 code refactoring 2015-08-13 20:59:28 +03:00
Anshul Maheshwari
1bfb96151f support 3.04 tesseract
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-13 21:11:52 +05:30
rkuchumov
741e87e00e empty description support 2015-08-11 09:59:04 +03:00
rkuchumov
098bff1230 Merge branch 'master' into networking_epg_support 2015-08-10 10:09:55 +03:00
rkuchumov
0374c5ec78 small fix & closing connection when server doesnt responce 2015-08-10 10:07:29 +03:00
Anshul Maheshwari
e7bec67c93 remove static timestamps from teletext
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-08 17:23:45 +05:30
Anshul Maheshwari
b9e0f67dec Correcting redundant check
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-08 16:20:30 +05:30
Anshul Maheshwari
acd96d44d2 Initialize stream mode before using it
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-08 14:01:19 +05:30
Anshul Maheshwari
4e4da44c39 Add 0x for hex represntation
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-06 18:05:16 +05:30
Anshul Maheshwari
bb0f836e84 removing redundant code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-06 15:55:02 +05:30
Anshul Maheshwari
5f6a8c7f54 Using EOF instead global variable
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-06 15:48:42 +05:30
Anshul Maheshwari
0c6bf5d8b1 make some space
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-06 14:41:40 +05:30
Anshul Maheshwari
f8210f94f2 Passing only demuxer ctx to wtv getdata
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-06 14:33:22 +05:30
rkuchumov
243674ed96 adding ping support from the server 2015-08-06 11:58:19 +03:00
Anshul Maheshwari
322d352ca0 selecting multiprogram for ts stream in report mode
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-04 18:59:48 +05:30
Anshul Maheshwari
c8c71085e1 Adding return from set_fts
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-04 18:54:17 +05:30
Anshul Maheshwari
4969e6a8fd Initialize Teletext when data not present
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-04 15:10:20 +05:30
Anshul Maheshwari
ece4a5fa8a Memory Leakage in Teletext
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-08-04 13:59:01 +05:30
cfsmp3
7d034f44e4 Merge branch 'pr/n202_anshul1912' 2015-08-02 16:39:55 +02:00
cfsmp3
c12d3856f2 Merge branch 'pr/n201_december-soul'
Conflicts:
	src/ccextractor.c
	src/lib_ccx/ccx_encoders_common.c
	src/lib_ccx/lib_ccx.c
2015-08-02 16:38:43 +02:00
Anshul Maheshwari
24f9106cde Merge remote-tracking branch 'carlos/master' 2015-08-01 12:21:44 +05:30
Anshul Maheshwari
58503141c3 Ignore empty string Srt encoder
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-31 22:44:08 +05:30
Anshul Maheshwari
3b214f491b correcting sub delay for end time
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-31 22:23:14 +05:30
Anshul Maheshwari
f83ca18c7d Merge branch 'master' of https://github.com/anshul1912/ccextractor 2015-07-31 21:36:01 +05:30
Anshul Maheshwari
1261cee8dc incorrect update of stream
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-31 21:33:18 +05:30
Anshul Maheshwari
92ecaa9434 dont check program number in single stream mode
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-07-31 11:03:10 +02:00
Anshul Maheshwari
fd66228b26 Cleaning stream data when PAT changes
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-31 12:30:41 +05:30
Anshul Maheshwari
bfd7556b50 free memory for ignored stream
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-31 11:15:44 +05:30
Anshul Maheshwari
3174e3dc9e remove multi addition of data_node len
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-30 13:40:44 +05:30
Anshul Maheshwari
ec26080bd2 if last crc is equal to present crc dont update pmt
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-30 12:22:12 +05:30
Anshul Maheshwari
5ea83ccf9d corrected len and buf for crc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-30 11:37:16 +05:30
Anshul Maheshwari
5af65d941a need capinfo only true when any good crc already found
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 19:21:12 +05:30
Anshul Maheshwari
0d79ad3cb6 crc used while checking packet second time
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 19:18:42 +05:30
Anshul Maheshwari
8499a6b426 Init bufferdatatype
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 18:02:52 +05:30
Anshul Maheshwari
577a79de47 initialized gop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 15:18:21 +05:30
Anshul Maheshwari
6133b9c26d print fps message once
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 12:52:06 +05:30
Anshul Maheshwari
c4e91f8ccc Remove memory leakage
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-29 11:58:42 +05:30
cfsmp3
589fd91d8e Merge branch 'pr/n202_anshul1912' 2015-07-28 22:33:15 +02:00
Anshul Maheshwari
03eba6114b remove invalid access of memory
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-28 20:23:32 +05:30
Anshul Maheshwari
56f0786cc3 correct broken Freport
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-28 11:30:09 +05:30
cfsmp3
aff591fd9b Merge branch 'pr/n202_anshul1912' 2015-07-28 07:05:22 +02:00
Anshul Maheshwari
bdaa3a1352 Completed Freport for teletext and DVB
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 22:02:47 +05:30
Anshul Maheshwari
f3b104584d update multiprogram changes in doc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 16:04:28 +05:30
Anshul Maheshwari
e47315e423 not to unset remaining buffer
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 15:36:36 +05:30
Anshul Maheshwari
43335e30a9 move strange header to demux_ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 13:43:58 +05:30
Anshul Maheshwari
79c4a48d60 ES code in Context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 13:33:00 +05:30
Anshul Maheshwari
a5538902ec moving telxcc related globals to telxcc Ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 11:51:20 +05:30
Anshul Maheshwari
1b9d905b28 move global vars from es to decode ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 10:43:45 +05:30
Anshul Maheshwari
89c8b018c8 move parity code to ccx_common_common.c
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 10:42:16 +05:30
Anshul Maheshwari
cde69fdd88 remove segfault in epg
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-27 10:05:00 +05:30
rkuchumov
a798fdf57e merge conflicts 2015-07-26 13:09:55 +03:00
Anshul Maheshwari
8b89ad0c5a refactor enc demux cfg
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-25 16:52:13 +05:30
Anshul Maheshwari
309f4130e0 Clean ts code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-25 16:29:55 +05:30
Anshul Maheshwari
0f2ccdbe4f added newline in warning
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-25 16:17:22 +05:30
Anshul Maheshwari
eeb33de590 Verified checksum and save section in pinfo
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-25 16:15:13 +05:30
rkuchumov
91a8997826 Merge branch 'networking_epg_support' of https://github.com/rkuchumov/ccextractor into networking_epg_support 2015-07-24 22:48:04 +03:00
rkuchumov
5fb7bc434c changed net protocol (passw check) 2015-07-24 22:24:51 +03:00
rkuchumov
77540355ed epg lang and category fields support 2015-07-24 22:24:51 +03:00
rkuchumov
c5362b682e indentation fix 2015-07-24 22:24:51 +03:00
rkuchumov
e0f3751fe8 sending epg 2015-07-24 22:23:51 +03:00
rkuchumov
54583f95a3 wrapping bin data with headers 2015-07-24 22:23:51 +03:00
rkuchumov
990e653e91 Merge branch 'networking_epg_support' of https://github.com/rkuchumov/ccextractor into networking_epg_support 2015-07-24 18:44:49 +03:00
rkuchumov
9d2fb48d3d changed net protocol (passw check) 2015-07-24 18:39:42 +03:00
rkuchumov
e5e51c4389 epg lang and category fields support 2015-07-24 18:39:42 +03:00
rkuchumov
74dbd4d7e5 indentation fix 2015-07-24 18:39:42 +03:00
rkuchumov
784a46d165 sending epg 2015-07-24 18:37:12 +03:00
rkuchumov
83e1959db8 wrapping bin data with headers 2015-07-24 18:37:12 +03:00
cfsmp3
e0bf79f28b Merge branch 'pr/n200_anshul1912' 2015-07-24 16:28:50 +02:00
cfsmp3
5c1f4772c7 typo fix 2015-07-24 16:28:37 +02:00
Anshul Maheshwari
deca14c2c2 refresh dvb codec
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-24 16:38:04 +05:30
Anshul Maheshwari
8023ebe8e2 revert current pts flag
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-24 15:54:25 +05:30
Anshul Maheshwari
0e98604267 made telexcc working in bin format
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-24 12:49:42 +05:30
Anshul Maheshwari
7e68c8e823 cross check for cinfo
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-24 11:15:59 +05:30
Anshul Maheshwari
601dbfd062 use encoder with pn
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 21:43:30 +05:30
Anshul Maheshwari
35983534f1 remove seg fault
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 20:06:58 +05:30
Anshul Maheshwari
f88330c7c9 close telexcc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 20:01:29 +05:30
Anshul Maheshwari
a0bf7dadf8 move init_hdcc to dec_ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 19:48:48 +05:30
Anshul Maheshwari
f2added8d1 revert hdcc flush
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 19:45:30 +05:30
Anshul Maheshwari
9f78a843ee Add global hdcc flag to decode context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 18:47:04 +05:30
Anshul Maheshwari
3e78fdd675 wait till stream stream type is know
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 18:21:35 +05:30
Anshul Maheshwari
c5dfd52eb9 Initialize cinfo with codec
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 17:45:26 +05:30
Anshul Maheshwari
08df39c3d4 initialize max_gop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 17:08:19 +05:30
Anshul Maheshwari
9fad88fee3 cleaning ts tables
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 17:04:58 +05:30
rkuchumov
6ae94fdbab changed net protocol (passw check) 2015-07-23 13:59:18 +03:00
rkuchumov
8d5f0e5505 epg lang and category fields support 2015-07-23 12:55:37 +03:00
Anshul Maheshwari
11b614cedf Initialize codec in dec update
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 12:43:13 +05:30
Anshul Maheshwari
fc79649c9c initialize file buffer in stdin
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 12:35:21 +05:30
Anshul Maheshwari
b85e93a2cb opening raw type condition
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-23 12:21:34 +05:30
Anshul Maheshwari
dd8923b2e4 error checking in init decoder 2015-07-23 12:13:31 +05:30
Anshul Maheshwari
1437aea328 multiple decode context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-22 15:33:09 +05:30
Anshul Maheshwari
1fdad2314f remove segfault at free of filename
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-21 18:07:24 +05:30
Anshul Maheshwari
6aac9dad43 not working multiprogram
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-21 13:13:25 +05:30
Anshul Maheshwari
fc248dd41f not to use data_node before recieved
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-14 21:22:11 +05:30
Anshul Maheshwari
a2394df838 remove derefrence NULL pointer
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-14 21:07:20 +05:30
Anshul Maheshwari
306d60ccf9 encoder ctx initilaziation only when required
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-14 21:01:08 +05:30
Anshul Maheshwari
d78a722260 moved encoder related code in each loop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-14 15:39:35 +05:30
Anshul Maheshwari
4a34799e09 Adding flush logic in function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-14 15:22:07 +05:30
Anshul Maheshwari
489622fb0b Merge branch 'master' of https://github.com/anshul1912/ccextractor 2015-07-14 12:02:41 +05:30
Anshul Maheshwari
9689dd8c19 remove VS Compiler error from list.h
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 09:31:35 -07:00
Anshul Maheshwari
d29f6817c6 error checking in encoder
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 18:49:06 +05:30
Anshul Maheshwari
f9ea7009fe removed segfault from 708
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 18:46:33 +05:30
Anshul Maheshwari
ddd8381440 Correcting out context selection on basis of field
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 18:08:15 +05:30
Anshul Maheshwari
964b8c1165 refactored encoder
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 03:32:26 +05:30
Anshul Maheshwari
0541a2fb62 move output context in encoder from global context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-13 00:16:26 +05:30
Anshul Maheshwari
f3654174fc moving file_function to demux ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 23:33:52 +05:30
rkuchumov
0fc1055da6 indentation fix 2015-07-10 17:26:26 +03:00
rkuchumov
a654b133e5 sending epg 2015-07-10 17:21:46 +03:00
Anshul Maheshwari
3a886c6a5b proper initialization of cc_data
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 19:42:48 +05:30
Anshul Maheshwari
4a8d51aed1 including avc header
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 19:24:37 +05:30
Anshul Maheshwari
70f5723c89 making context of avc
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 19:22:51 +05:30
rkuchumov
b85702a706 wrapping bin data with headers 2015-07-10 15:45:06 +03:00
Anshul Maheshwari
0bf1e83fa1 free pat payload
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 17:51:36 +05:30
Anshul Maheshwari
67d62631aa remove ignore param from demux_data
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 17:24:03 +05:30
Anshul Maheshwari
43f276abca correctcondition to ignore stream
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 17:13:23 +05:30
Anshul Maheshwari
7cea808f46 ignore unused stream in cap info
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 17:10:29 +05:30
Anshul Maheshwari
adbe8ed934 eof handle in rawloop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 15:59:22 +05:30
Anshul Maheshwari
a3eba7cf45 error checking in copy capbuf
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 13:13:29 +05:30
Anshul Maheshwari
3f26290614 Check pid before needs
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 12:14:30 +05:30
Anshul Maheshwari
d63660468a init datastream with sane value
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 02:34:05 +05:30
Anshul Maheshwari
3daecf66a3 replced stream info array from list
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-10 02:06:49 +05:30
Anshul Maheshwari
16db90a630 Free mem allocated for input file name
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 23:41:35 +05:30
Anshul Maheshwari
c1d7f82819 handling wrong pes header
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 22:07:08 +05:30
Anshul Maheshwari
f8ee9504a8 handling wrong pes header
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 21:26:58 +05:30
Anshul Maheshwari
c75d056b76 Handling boundary condition
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 13:16:23 +05:30
Anshul Maheshwari
6c38f1b73b rename windex to len
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 12:59:07 +05:30
Anshul Maheshwari
00b61a291d Initialize demux node in general loop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 12:36:06 +05:30
Anshul Maheshwari
fcdc5f852b Passing demux ctx instead of lib ctx
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-09 12:08:38 +05:30
Anshul Maheshwari
0424b0f119 remove memory leakage in teletext 2015-07-08 23:10:39 +05:30
Anshul Maheshwari
82559fd572 Initialize demuxer data
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-08 22:40:20 +05:30
Anshul Maheshwari
3837ffae59 Correct asf and wtv
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-08 22:25:53 +05:30
Anshul Maheshwari
2e4cda0383 working telxcc code with srt
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-08 22:02:33 +05:30
Anshul Maheshwari
dc6ef18c21 Free tree of streams and program 2015-07-08 16:51:58 +05:30
Anshul Maheshwari
bf3790183a woorking telxcc code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-08 16:41:52 +05:30
Anshul Maheshwari
bfa8b593ab teletext to srt working
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-08 11:20:49 +05:30
Anshul Maheshwari
401d679f80 reversed priority 2015-07-07 19:27:43 +05:30
Anshul Maheshwari
157faaf0b5 Add multistream support in databuffer 2015-07-07 19:11:45 +05:30
Anshul Maheshwari
cb49812d17 broken teletext
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-07 12:10:05 +05:30
Anshul Maheshwari
d88fa2a3ce remove context dependency from write_section 2015-07-06 22:13:17 +05:30
Anshul Maheshwari
5716ab7cfc Add back haupage support in ts 2015-07-06 21:14:25 +05:30
Anshul Maheshwari
04b9e40cc5 Add reset hack back again 2015-07-06 21:08:47 +05:30
Anshul Maheshwari
2f92036557 Initialize databuffertype 2015-07-06 18:24:41 +05:30
Anshul Maheshwari
6aaa4fe2d4 Add windex instead len 2015-07-06 17:01:15 +05:30
Anshul Maheshwari
ab0f54bb57 correct handling for eof
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-06 15:43:44 +05:30
Anshul Maheshwari
6642084132 Open up more buffer type 2015-07-06 02:12:50 +05:30
Anshul Maheshwari
c5ca7c7e1a working with srt output and single program input
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-06 01:48:08 +05:30
Anshul Maheshwari
5b24334b43 move pmt code related comments near parsePMT
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-03 14:59:44 +05:30
Anshul Maheshwari
df93801021 Initilaize param
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-03 12:43:25 +05:30
Anshul Maheshwari
64285879db encoding flushed bytes 2015-07-03 11:51:03 +05:30
Anshul Maheshwari
0523f0bcd5 check array boundary before acess
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-02 18:49:14 +05:30
Anshul Maheshwari
c6721ebc3e making array of cap pid
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-02 16:40:44 +05:30
Anshul Maheshwari
9d22f9a466 Adding error Message at boundary
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-02 16:39:41 +05:30
Anshul Maheshwari
d58fb00970 Correcting boundary condtions
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-02 14:43:56 +05:30
Anshul Maheshwari
62e189a9cb correctin loss of last frame 2015-07-01 17:06:55 +05:30
Anshul Maheshwari
dc17946a55 Remove infinite loops
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-07-01 11:21:50 +05:30
Anshul Maheshwari
78d8d858d2 Adding header file
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-30 21:56:36 +05:30
Anshul Maheshwari
30e7f95f38 move pmt from global to demuxer ctx 2015-06-30 21:32:46 +05:30
Anshul Maheshwari
8026d2e671 Remove unused loop
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-30 20:34:01 +05:30
Anshul Maheshwari
c98e00201a remove seg fault while overwrite detection
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-30 19:09:49 +05:30
Anshul Maheshwari
9b0ba130f1 Corrected broken position_sanity_check 2015-06-30 19:00:33 +05:30
Anshul Maheshwari
83aa9709f4 moving subline bufffer to encoder context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-30 11:39:32 +05:30
Anshul Maheshwari
340549e916 coreected broken detect stream 2015-06-29 21:34:15 +05:30
Anshul Maheshwari
6d41964bba Addin decoded subtitle in decoder context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-29 21:31:37 +05:30
Anshul Maheshwari
71f030f4ee move parameter checking to parameter ctx 2015-06-29 12:10:50 +05:30
Anshul Maheshwari
67653d06d3 Restore default when no -o param provided 2015-06-29 11:38:36 +05:30
Anshul Maheshwari
ab9f3a4b4a give memory for '\0' character in output file 2015-06-29 11:37:19 +05:30
Anshul Maheshwari
d9e9305e2c Seprate wbout context 2015-06-28 15:41:34 +05:30
Anshul Maheshwari
2bcc0c5561 corrected elementry to elementary 2015-06-27 15:21:00 +05:30
Anshul Maheshwari
cd03d8a658 moved filename part in lib_ccx 2015-06-27 15:18:42 +05:30
Anshul Maheshwari
589074886b removing multiple file in encoder ctx 2015-06-27 14:55:02 +05:30
Anshul Maheshwari
c6ca493752 Removed redundant wbout struct 2015-06-27 14:34:40 +05:30
Anshul Maheshwari
aef649d23a Initialize past value in open 2015-06-26 21:05:06 +05:30
Anshul Maheshwari
610b7323f4 time depend on demuxer init 2015-06-26 20:26:09 +05:30
Anshul Maheshwari
eb6f6a9000 Added Demuxer data to seprate out context 2015-06-26 20:18:49 +05:30
Anshul Maheshwari
f3fe829d48 remove false warning about premature file completion 2015-06-25 20:06:54 +05:30
Anshul Maheshwari
cb39d12615 Making demuxer context
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-25 19:09:54 +05:30
Anshul Maheshwari
5d52026736 remove wbout dependency 2015-06-23 22:21:07 +05:30
Anshul Maheshwari
48dce9c7ce correct header guard 2015-06-22 17:12:41 +05:30
Anshul Maheshwari
2032a754e6 moved credits initializations 2015-06-22 14:30:38 +05:30
Anshul Maheshwari
aa353140ef remove wbout dependency from decoder 2015-06-21 23:55:19 +05:30
Anshul Maheshwari
ee47e8458f Use cc_sub in raw dvd 2015-06-21 23:49:08 +05:30
Anshul Maheshwari
081f127c85 remove compiler warnings
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-20 21:26:01 +05:30
cfsmp3
7169c71360 Merge branch 'pr/n187_anshul1912' 2015-06-20 13:54:47 +02:00
cfsmp3
5c3a757e5b Updated CHANGES.TXT with release date 2015-06-20 13:54:21 +02:00
Anshul Maheshwari
673cadc6bf Version 0.77 2015-06-20 17:00:19 +05:30
cfsmp3
2318e714db Merge branch 'pr/n186_anshul1912' 2015-06-20 11:06:41 +02:00
Anshul Maheshwari
a6d27a2de5 compile on windows
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-19 23:31:37 -07:00
Anshul Maheshwari
dc842b0312 removed segfault with cap file 2015-06-19 22:59:22 +05:30
cfsmp3
3879f5c7ef Merge branch 'pr/n156_kisselef'
Conflicts:
	src/lib_ccx/CMakeLists.txt

Changed 0.76 to 0.77
2015-06-19 13:14:55 +02:00
Anshul Maheshwari
e01d93afa8 Corrected typos in help info
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-18 17:24:47 +05:30
Anshul Maheshwari
6ec8086b0a remove invalid warn at srt 2015-06-18 11:39:20 +05:30
Anshul Maheshwari
b80572c3b6 Corrected help display for BOM 2015-06-17 19:38:53 +05:30
Anshul Maheshwari
3f6fd51f45 removed segfault at ccextractor.c 2015-06-17 19:09:52 +05:30
Anshul Maheshwari
87af82f022 corrected broken raw output 2015-06-17 18:42:08 +05:30
Anshul Maheshwari
020ca9a1cf Merge remote-tracking branch 'carlos/master' 2015-06-17 16:26:00 +05:30
Anshul Maheshwari
beccc3d5b7 Correct broken rcwt
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-17 16:23:33 +05:30
Anshul Maheshwari
1d03bd7d13 pass cc_sub structure to rcwt 2015-06-17 11:59:04 +05:30
cfsmp3
13290294a6 Merge branch 'pr/n182_anshul1912' 2015-06-16 20:10:26 +02:00
Anshul Maheshwari
1eef500c73 Indent decoder 2015-06-16 23:34:22 +05:30
Anshul Maheshwari
ca5135c8aa passing decoder sub structure in teletext 2015-06-16 20:15:47 +05:30
Anshul Maheshwari
740a1d798e add space in code 2015-06-13 19:22:24 +05:30
Anshul Maheshwari
b68a086698 remove dead code 2015-06-13 19:09:31 +05:30
Anshul Maheshwari
0e60ceb4d0 moving option check in param context 2015-06-13 19:08:40 +05:30
Anshul Maheshwari
2030c16b22 Display usage when no input file 2015-06-13 10:58:17 +02:00
cfsmp3
79b1bca8f7 Merge branch 'pr/n179_anshul1912' 2015-06-12 08:02:56 +02:00
cfsmp3
76b3d3e4d1 Merge branch 'pr/n180_rkuchumov' 2015-06-12 08:02:09 +02:00
rkuchumov
90d8731a03 dep target is fixed 2015-06-10 21:50:01 +03:00
rkuchumov
85270c7047 optimization is removed for ccextractor.c 2015-06-10 21:39:53 +03:00
rkuchumov
c9e596e60a flushing cc buffer every I, P slice for both fields 2015-06-10 08:25:20 +03:00
Anshul Maheshwari
24d83e130a Remove Segmentation Fault at opt service
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-06-05 12:11:05 +05:30
cfsmp3
4fc19d4289 Merge branch 'pr/n175_wforums' 2015-06-04 22:09:40 +02:00
wforums
74ad11b44f Release project build fix
Fixed release project for VS. New subfolders weren't included.
2015-06-04 00:34:08 +02:00
wforums
051a6f1f67 git ignore update
Updated gitignore with some more VS project files.
2015-06-04 00:31:29 +02:00
Oleg Kisselef
3f7eb981e6 Fixed millis_to_date usage with ocr enabled build 2015-06-04 03:02:39 +06:00
Carlos Fernandez
8ca152262e Merge branch 'pr/n171_kisselef' 2015-05-28 06:53:39 -07:00
Anshul Maheshwari
f17501f0e5 linux build using Cmake 2015-05-28 12:05:10 +05:30
Oleg Kisselef
6cc8d7de05 ts/ps detection fall through removed 2015-05-27 17:10:01 +06:00
Carlos Fernandez
d4f6db8479 Merge branch 'pr/n168_codeman38' 2015-05-26 18:35:39 -07:00
Anshul Maheshwari
7b22a8d966 Segmentation Fault supression 2015-05-26 11:42:18 +05:30
Anshul Maheshwari
c5cebeaa4f Adding some space 2015-05-25 18:49:00 +05:30
Anshul Maheshwari
f1cf6c7be8 Added check on boundary condition 2015-05-25 18:48:20 +05:30
Cody Boisclair
80303ddde5 Add iconv to EXTRA_LIBS in CMakeLists.
Compilation via cmake fails on OS X if libiconv is not
specified as a required library.
2015-05-24 00:40:16 -04:00
Anshul Maheshwari
89ee62ea14 EPG help at new line 2015-05-22 17:35:46 +05:30
Anshul Maheshwari
a1959d20f3 remove make clean hangsup problem 2015-05-19 19:56:33 +05:30
Anshul Maheshwari
810cb73203 Indenting code 2015-05-19 15:50:01 +05:30
Anshul Maheshwari
38b9ed7fcd Indenting code 2015-05-19 15:28:14 +05:30
Anshul Maheshwari
35b8f2375f Indenting Code 2015-05-19 14:17:09 +05:30
Anshul Maheshwari
aa619b5f93 Indenting Code 2015-05-19 14:11:10 +05:30
Anshul Maheshwari
c03d3032aa Merge remote-tracking branch 'carlos/master' 2015-05-19 12:41:18 +05:30
Anshul Maheshwari
191cdd2bdc Indentation of 708 decoder 2015-05-19 12:40:15 +05:30
Anshul Maheshwari
9d5c8759e5 Indenting code 2015-05-19 12:28:20 +05:30
Anshul Maheshwari
a4b5c6e028 Indent code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 12:24:22 +05:30
Anshul Maheshwari
113b606091 Indentation of cc_bitstream 2015-05-19 12:11:18 +05:30
Anshul Maheshwari
a69e031835 Indentation of avc_function
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 12:07:51 +05:30
Anshul Maheshwari
ba38055bed lib_ccx/asf_functions.c
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 11:59:27 +05:30
Anshul Maheshwari
3c086e8ff0 Indent asf constants
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 11:54:29 +05:30
Anshul Maheshwari
f9c26d8684 Indent activity.c 2015-05-19 11:37:41 +05:30
Anshul Maheshwari
2ed9789f9c Indenting 708_encoding 2015-05-19 11:14:57 +05:30
Anshul Maheshwari
282108942b Correcting Header guard for spupng
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 11:12:41 +05:30
Anshul Maheshwari
6c107a0d4e Indent spupng code 2015-05-19 11:08:45 +05:30
Anshul Maheshwari
6e4ab6faae Fails earlier if not enough memory
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 10:57:01 +05:30
Anshul Maheshwari
e8016edfc1 Move copyright notice to top
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 10:52:48 +05:30
Anshul Maheshwari
30839f7c2c Indent smptett code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 10:50:27 +05:30
Anshul Maheshwari
89459a6c2e Indenting sami code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 10:45:04 +05:30
Anshul Maheshwari
c49db8c083 Removing runtime warnings 2015-05-19 10:40:40 +05:30
Anshul Maheshwari
fa6588fa80 Remove redundant print code
Signed-off-by: Anshul Maheshwari <er.anshul.maheshwari@gmail.com>
2015-05-19 10:38:05 +05:30
Carlos Fernandez
7d74256664 Merge branch 'pr/n166_anshul1912' 2015-05-18 09:28:39 -07:00
Anshul Maheshwari
2210660ae4 Indentation no change in logic 2015-05-18 19:46:57 +05:30
Anshul Maheshwari
f2fc93b7f8 removed dead code 2015-05-18 19:36:22 +05:30
Anshul Maheshwari
d54a2d9486 Indentation of utility.c 2015-05-18 19:10:48 +05:30
Anshul Maheshwari
88015d6d4b Adding milliseprator in tlt_config init 2015-05-18 12:22:35 +05:30
Anshul Maheshwari
f1ff75b846 Remove ccxoptions fromm encoder 2015-05-16 15:04:22 +05:30
Anshul Maheshwari
1123755dc7 Remove options from decoder 2015-05-16 13:16:25 +05:30
Carlos Fernandez
6a4f379ab7 Merge branch 'pr/n165_wforums' 2015-05-15 08:21:39 -07:00
Anshul Maheshwari
9369cde9a3 partially removing global options from utility 2015-05-15 19:56:01 +05:30
Anshul Maheshwari
a1d985b4ca Remove use of global options in sami 2015-05-15 18:07:31 +05:30
Anshul Maheshwari
b26854d3d7 Removing ccx_options from output ctx 2015-05-15 17:57:10 +05:30
Anshul Maheshwari
cbb4b4c7bb remove use of global var in telexcc 2015-05-15 13:37:15 +05:30
wforums
1a1aa746d5 Possible MP4 detection fix
Expanded detection for mp4. Needs to be checked with test suite and then
discussed :)
2015-05-14 23:52:23 +02:00
Anshul Maheshwari
b4f5b5b98e Removing global options from Mp4 2015-05-15 00:31:18 +05:30
Anshul Maheshwari
fa3b651ee1 Remove use glb bar ccx_options in param ctx 2015-05-14 23:54:26 +05:30
Carlos Fernandez
91d079be1e Merge branch 'pr/n164_anshul1912' 2015-05-14 19:54:17 +02:00
Anshul Maheshwari
d16ea0a7ea Decleare Xds related func in Xds header 2015-05-14 23:14:55 +05:30
wforums
6133bf6297 Revert of changes in stream format detection
Regression testing points out that at least 12 files no longer produce
correct results due to this change. Reverting is necessary until a
better solution for #69 can be found that does not break current other
files.
2015-05-13 18:44:58 +02:00
Oleg Kisselef
14e1420b7e Merge branch 'master' into feature-with-ocr-cmake-parameter 2015-05-05 13:30:16 +06:00
Oleg Kisselef
10568a0270 Merge branch 'master' into feature-mp4-c708-support 2015-05-05 12:56:23 +06:00
cfsmp3
53da058fe1 Merge branch 'pr/n155_kisselef' 2015-05-04 13:40:49 +02:00
cfsmp3
4d199fb03b Merge branch 'pr/n159_kisselef' 2015-05-04 13:39:47 +02:00
cfsmp3
f04cbbd99c Experiments with 708 in MP4. 2015-05-04 13:39:06 +02:00
Oleg Kisselef
e572ba8b6e better naming 2015-04-26 21:47:02 +06:00
Oleg Kisselef
45974e88be debug constant typo fix 2015-04-26 21:40:36 +06:00
Oleg Kisselef
8140bf3e52 mp4 708: fixed *cc_count value obtaining 2015-04-24 18:27:28 +06:00
Oleg Kisselef
4570965af2 removed ide auto-added header include 2015-04-24 15:51:07 +06:00
Oleg Kisselef
fcd250a557 basic c708 support for mp4 2015-04-24 15:43:59 +06:00
Oleg Kisselef
b92e42e685 yet another gpac fix applied 2015-04-24 15:42:08 +06:00
Oleg Kisselef
5daccf4268 gpac size calculation fix merged from gpac repo 2015-04-24 15:40:15 +06:00
Oleg Kisselef
e0903a0789 cdp sections enum added 2015-04-24 15:39:20 +06:00
Oleg Kisselef
bcf1546fc2 added c708 media subtype 2015-04-24 15:38:15 +06:00
Oleg Kisselef
92f53be666 fixed cmake to add gpac platform dependent defines 2015-04-23 17:30:22 +06:00
Oleg Kisselef
8ae0bd7f16 cmake build doc updated 2015-04-17 22:50:57 +06:00
Oleg Kisselef
754159e2bc cmakelists codestyle 2015-04-17 22:35:29 +06:00
Oleg Kisselef
3f817d655c added WITH_OCR parameter to cmake and libs dependencies 2015-04-17 22:16:42 +06:00
Oleg Kisselef
572837d7ba if ENABLE_OCR replaced everywhere with ifdef to have one style 2015-04-17 22:15:56 +06:00
Oleg Kisselef
fb8dcf4025 handling 7-byte PES packets for dvb-subs stream 2015-04-17 22:10:42 +06:00
cfsmp3
c7b77b5555 Fix crash on broken PMT section
Moved order of file format (MP4 now higher priority than PS)
2015-04-12 23:30:26 +02:00
cfsmp3
fe1ac8564a Merge branch 'pr/n148_kisselef' 2015-04-08 11:20:07 +02:00
cfsmp3
9230390937 Merge branch 'pr/n149_kisselef' 2015-04-08 11:17:20 +02:00
cfsmp3
14f926124d Merge branch 'pr/n150_anshul1912' 2015-04-08 11:15:31 +02:00
cfsmp3
76e8489304 XDS: Support for Canadian French content advisory
XDS: Support for the (obsolete) aspect ratio packet type
2015-04-08 11:14:50 +02:00
Anshul Maheshwari
0e0b1973f0 removing redundant init_options 2015-04-08 01:12:27 +05:30
Oleg Kisselef
a6666a4fbd detecting when output filename is same as one of input filenames to avoid overwrite 2015-04-07 12:02:52 +06:00
Oleg Kisselef
3a66db200d typo in mp4 detection algorithm fixed: 'feee'->'free'
added 'wide' box to mp4 detection algorithm
2015-04-06 22:22:00 +06:00
cfsmp3
4f3e5fe677 0.76 2015-03-28 13:32:09 +01:00
cfsmp3
ad99ccdfec Merge branch 'pr/n143_hardikchoudhary12' 2015-03-23 13:06:32 +01:00
cfsmp3
1bc174efa2 Merge branch 'pr/n144_ivladak' 2015-03-23 13:05:50 +01:00
cfsmp3
983db8c92d Allow processing EPG only 2015-03-23 13:05:10 +01:00
Vladislav Ivanishin
b4ce115f7c Fixed mac build 2015-03-21 04:26:49 +03:00
hardikchoudhary12
cb7f31ef8c Update README.md
Updated grammar.
2015-03-17 04:00:55 +05:30
cfsmp3
1a5d78b1b4 Merge branch 'pr/n138_brooss' 2015-03-04 09:38:22 +01:00
Brooss
c873ff6a06 add -xmltvonlycurrent option 2015-03-04 15:53:16 +11:00
Brooss
454024808d escape XML strings 2015-03-03 15:56:24 +11:00
Brooss
0a22e1e429 fix crash with -out=null 2015-03-03 14:38:19 +11:00
Brooss
3fb288357d change parse_EPG_packet to void 2015-03-03 12:27:28 +11:00
Brooss
966d88fc10 fix gcc warnings 2015-03-03 12:12:40 +11:00
Brooss
c91aa79852 rename win_iconv.c -> win_iconv.h, fixes build script 2015-03-03 12:06:07 +11:00
cfsmp3
04ccb477f1 -stdin was broken, fixed. 2015-03-02 09:48:55 +01:00
cfsmp3
10ea570229 Merge branch 'pr/n137_brooss' 2015-03-02 07:14:45 +01:00
Brooss
551c3d0e2f Fix referencing outdated offset in EPG_decode_extended_event_descriptor 2015-03-02 13:00:28 +11:00
cfsmp3
49530b079b Merge branch 'pr/n137_brooss' 2015-03-01 18:40:15 +01:00
Brooss
02986fe7a8 fix buffer overrun in EPG_decode_extended_event_descriptor 2015-03-02 04:18:36 +11:00
cfsmp3
a230ec5f6f Merge branch 'pr/n135_brooss' 2015-03-01 17:03:24 +01:00
Brooss
7902b85d1b Fix codepage symbol getting letf in the middle of certain dvb extented_event_descriptor strings 2015-03-02 02:24:18 +11:00
Brooss
77d275d6a5 fix ratings closings tag 2015-03-02 01:48:54 +11:00
Brooss
4c2a4a59a2 Add fallback workaround for streams with no PMT but EPG 2015-03-02 00:49:13 +11:00
cfsmp3
d80455a408 Merge branch 'pr/n134_mailumangjain' 2015-03-01 09:12:33 +01:00
cfsmp3
27e2bb9017 fix for broken stdout 2015-03-01 09:12:12 +01:00
Umang Jain
9358978a61 Fixes output for field_2 2015-02-27 20:47:50 +05:30
Brooss
cffd02c106 string formatting in EPG_print_event fix 2015-02-26 14:25:57 +11:00
cfsmp3
b45370cbb4 Minor typo correction 2015-02-25 08:43:06 +01:00
Brooss
56e15a3be0 Call iconv_close. Fix warning 2015-02-25 16:48:40 +11:00
Brooss
7b4d93988f Fixes for compiling on MSVC2013 2015-02-25 16:37:57 +11:00
Umang Jain
0e803eba95 Fix for SegFault error in -out=raw/bin output format
Issue Link:https://github.com/CCExtractor/ccextractor/issues/102
2015-02-24 18:58:54 +05:30
Brooss
8c9bfa17dd fix fprintf formatting in EPG_print_event() 2015-02-16 11:46:55 +11:00
Brooss
413173f5e5 add public domain win_iconv for win32 2015-02-16 11:28:49 +11:00
Brooss
1a050c76a5 Inital DVB and ATSC EPG support 2015-02-16 11:06:51 +11:00
cfsmp3
c3d00d80f5 Added support for M2TS 2015-02-10 17:27:17 +01:00
cfsmp3
c989c941df Added dates to CHANGES.TXT 2015-01-22 13:50:04 +01:00
cfsmp3
dc9f6d250a Fix annoying warning in OSX build 2015-01-18 22:56:26 +01:00
cfsmp3
9f00cec9c0 Uncomment a condition in es_functions that was causing garbled output (unknown why we commeted it out in the first place) 2015-01-10 17:57:16 +01:00
cfsmp3
b7d2754518 Merge branch 'pr/n130_anshul1912' 2015-01-09 13:29:33 +01:00
Anshul Maheshwari
94675b2dac handle no language found 2015-01-09 13:14:32 +01:00
Anshul Maheshwari
2c9faa70ea give error message with ENABLE_OCR 2015-01-07 19:57:57 +01:00
cfsmp3
b7616fcb17 Merge branch 'pr/n130_anshul1912' 2015-01-07 16:32:30 +01:00
Anshul Maheshwari
eb93345544 added dirent.h 2015-01-07 20:44:47 +05:30
cfsmp3
e6024c1cb1 Merge branch 'pr/n129_anshul1912' 2015-01-07 15:16:23 +01:00
Anshul Maheshwari
ecc4c2520e assigning prev_start to start_time 2015-01-07 19:38:55 +05:30
Anshul Maheshwari
a83c686f6a Remove multi warning when traindata not present 2015-01-07 18:49:53 +05:30
Anshul Maheshwari
c4a8135b4d using language while opening traindata
Signed-off-by: Anshul Maheshwari <anshul.ffmpeg@gmail.com>
2015-01-07 14:45:47 +05:30
cfsmp3
004f9d512a Typos 2015-01-07 10:01:39 +01:00
cfsmp3
53df68b4c3 Merge branch 'pr/n128_anshul1912' 2015-01-06 21:40:30 +01:00
Anshul Maheshwari
74bb91aa5b fixing minor bugs 2015-01-06 21:19:39 +05:30
rkuchumov
453bb56520 stdout output fix 2015-01-01 10:55:26 +03:00
cfsmp3
db50730a00 Fixed typos in docs 2014-12-25 12:17:34 +01:00
Anshul Maheshwari
36a266e43c Merge branch 'master' of https://github.com/anshul1912/ccextractor 2014-12-24 11:58:32 +05:30
Anshul Maheshwari
354c52ec61 updated teletext changes 2014-12-24 11:53:00 +05:30
Anshul Maheshwari
2b65419bfb Merge remote-tracking branch 'carlos/master' 2014-12-24 11:47:07 +05:30
cfsmp3
740365db7e Merge branch 'pr/n125_MikaYuoadas' 2014-12-23 12:44:45 +01:00
cfsmp3
03dc0498ea Init 'ret' variables 2014-12-23 12:43:47 +01:00
Akim Sadaoui
e9a7474f3d Fixed potential timestamp overflow with negative delay
When delay was a large enough negative number, some show_timestamp would
overflow and be set to ridiculously large value.
2014-12-19 17:00:12 +01:00
Akim Sadaoui
1ecb2abd62 Added support for -startat and -endat for teletext input 2014-12-19 16:59:23 +01:00
Akim Sadaoui
d3b4b8ff03 Fixed smptett timeExpression format
Now all timeExperssion in smptett file comply to:
http://www.w3.org/TR/2013/REC-ttml1-20130924/#timing-value-timeExpression
2014-12-19 16:55:47 +01:00
Akim Sadaoui
29aa63c23c Fixed a typo in smptett header 2014-12-19 16:50:21 +01:00
Anshul Maheshwari
7083a36ecb Merge remote-tracking branch 'carlos/master' 2014-11-30 21:09:40 +05:30
Anshul Maheshwari
38421e886e Merge remote-tracking branch 'carlos/master' 2014-11-28 19:42:19 +01:00
Akim Sadaoui
b0de53c351 Added default style to smptett header 2014-11-28 15:57:50 +01:00
Akim Sadaoui
09dcb8b7c0 Fixed a rare bug with some teletext input
In rare cases, the output had the last line written after the footer (i.e. for
smptett the last </div></tt> was after the last <p>).
2014-11-28 15:56:28 +01:00
Akim Sadaoui
13ab9e6a4e Fixed line break in output for teletext input 2014-11-28 15:56:06 +01:00
Akim Sadaoui
08ae34bc24 Added smptett support for teletext input 2014-11-28 15:54:40 +01:00
Akim Sadaoui
f5f1a70eb8 fixed a typo in generated smptett 2014-11-28 15:54:35 +01:00
Anshul Maheshwari
471c130928 updated version to 0.75 2014-11-26 18:31:01 +05:30
cfsmp3
4db37e7ac3 Merge branch 'pr/n121_anshul1912' 2014-11-26 13:57:53 +01:00
Anshul Maheshwari
3953f806b0 corrected sign of argument 2014-11-26 18:02:25 +05:30
Anshul Maheshwari
cf0ebd27f7 corrected initial value of ret 2014-11-26 18:00:53 +05:30
Anshul Maheshwari
559d05c478 added flag in CCExtractor Cmake to build with FFMpeg 2014-11-26 17:58:49 +05:30
Anshul Maheshwari
4d7e629ba5 in ffmpeg intigration logic, removed unneeded malloc and free 2014-11-26 17:57:41 +05:30
Anshul Maheshwari
866c4ea159 added flag in CCExtractor Cmake to build with FFMpeg 2014-11-26 17:55:20 +05:30
Anshul Maheshwari
cf508653f2 documented how to compile ccextractor with FFmpeg using cmake 2014-11-26 17:53:12 +05:30
Anshul Maheshwari
b3b683aa83 Instruction on how to build ccextractor with CMake 2014-11-25 15:00:39 +05:30
Anshul Maheshwari
9f6309ef14 More elaborate warning for DVB subtitle's 2014-11-14 18:12:48 +05:30
cfsmp3
b95e06c21c Merge branch 'pr/n118_anshul1912' 2014-11-11 13:35:37 +01:00
Anshul Maheshwari
7ed99097ba removed libpng15 requirement in cmake 2014-10-31 04:44:38 +05:30
Anshul Maheshwari
3f4bbbde25 addd some platform specific library path 2014-10-31 04:38:06 +05:30
Anshul Maheshwari
5828f50210 init timing while initilaizing library 2014-10-31 04:19:53 +05:30
Anshul Maheshwari
b5931e8749 added dinit function to remove some memory leaks 2014-10-29 21:23:41 +05:30
Anshul Maheshwari
c588b42e0a remove redundant write format 2014-10-20 04:06:51 +05:30
Anshul Maheshwari
f9ee9570a4 remove internal use of ccx_decoders_common_settings_t 2014-10-20 03:16:57 +05:30
Anshul Maheshwari
55e408bbb7 made seprate decoder context 2014-10-19 22:36:02 +05:30
Anshul Maheshwari
93a5ae9728 cmake:generate pkg-config pc file on make install 2014-10-17 22:02:08 +05:30
cfsmp3
5c7430cff5 Merge branch 'pr/n116_anshul1912' 2014-10-12 09:56:02 +02:00
cfsmp3
fecf14bc15 Merge branch 'pr/n117_wforums' 2014-10-12 09:55:18 +02:00
wforums
a4275eba62 MAC build command fix
Fixed.
2014-10-12 00:47:47 +02:00
wforums
3873e8fd30 Bugfix for output filename fix
Getting tired :( Forgot to change header.
2014-10-12 00:45:08 +02:00
Anshul Maheshwari
5e22be2576 reverted back the changes of adding exra byte 2014-10-12 03:56:00 +05:30
cfsmp3
0b568cb168 Merge branch 'pr/n115_wforums' 2014-10-11 22:53:25 +02:00
cfsmp3
017d539710 Merge branch 'pr/n114_anshul1912' 2014-10-11 22:52:40 +02:00
wforums
06c8f69056 Output filename fix
The provided names in -o1 and -o2 were not passed on between argument
passing and initialisation of write structures, resulting in default
names.
2014-10-11 22:47:16 +02:00
Anshul Maheshwari
b06654b760 increased 1 byte of cc_data according to spec
According to CEA-708-D August 2008
cc_data() {
    reserved                   1 bit
    proccess_cc_data_flag      1 bit
    zero bit                   1 bit
    cc_count                   5 bit
    reserved                   8 bit
    for( i = 0; i < cc_count; i++) {
        one_bit_4_compatibility      1 bit
        reserved                     4 bit
        cc_valid                     1 bit
        cc_type                      2 bit
        cc_data_1                    8 bit
        cc_data_2                    8 bit
    }
}
2014-10-12 00:55:08 +05:30
cfsmp3
4ff49c2010 Merge branch 'pr/n113_anshul1912' 2014-10-11 13:02:11 +02:00
Anshul Maheshwari
0c650711cf corrected ffmpeg enabled build 2014-10-11 14:54:02 +05:30
cfsmp3
3128f10fb5 In srt, use -lf to change CRLF for LF. 2014-10-11 11:23:18 +02:00
cfsmp3
63b209929e Version push (to 0.75) 2014-10-11 10:48:12 +02:00
cfsmp3
5f68a9166f -Added -bom 2014-10-11 10:39:56 +02:00
Anshul Maheshwari
15616edea8 updated changes 2014-10-11 12:26:54 +05:30
cfsmp3
cce4ec5e1a Merge branch 'pr/n111_wforums' 2014-10-11 08:05:02 +02:00
Anshul Maheshwari
72ecd279cf passing ctx to store_hdcc 2014-10-11 10:47:06 +05:30
Anshul Maheshwari
87f1a3845c remove more global variables from header files 2014-10-11 02:25:58 +05:30
Anshul Maheshwari
4ae5f3483c removed global variable from header files 2014-10-11 01:48:57 +05:30
Anshul Maheshwari
38876690f8 Merge branch 'master' of https://github.com/anshul1912/ccextractor 2014-10-10 23:57:55 +05:30
Anshul Maheshwari
7bb4e842dd corrected function declaration 2014-10-10 23:56:53 +05:30
wforums
26d9584a93 Windows projext fix 2014-10-10 18:49:46 +02:00
wforums
9d5ce9aaae UCLA bug fix?
-
2014-10-10 18:49:39 +02:00
wforums
47264425df Fix of build script + moving ccfont2 2014-10-10 16:47:30 +02:00
wforums
e8f8d04369 possible fix for ucla timing issue 2014-10-10 16:37:41 +02:00
Anshul Maheshwari
78cb26c9cb moved windows specific include 2014-10-09 20:20:23 -07:00
Anshul Maheshwari
2f5d45df01 added library file in windows build script 2014-10-09 18:49:02 -07:00
wforums
53be44dfdb Merge branch 'master' of https://github.com/CCExtractor/ccextractor 2014-10-09 23:12:13 +02:00
wforums
48b5a0b384 Small UCLA fix
-
2014-10-09 23:12:07 +02:00
Anshul Maheshwari
a08c7b1871 corrected do_NAL declaration 2014-10-09 16:15:13 +05:30
Anshul Maheshwari
0a2a00f883 corrected pointer 2014-10-09 15:36:46 +05:30
Anshul Maheshwari
2125e58e1f minor refactoring to correctly set options 2014-10-09 15:04:17 +05:30
Anshul Maheshwari
5bdd6971f7 moved option parsing in library 2014-10-08 18:48:16 +05:30
Anshul Maheshwari
051bc7138d moved global variable in library context 2014-10-08 18:44:07 +05:30
Anshul Maheshwari
e6dca329ee removed option parameter from ccextractor 2014-10-07 21:43:00 +05:30
Anshul Maheshwari
6cfddb12a6 corrected typo cxx to ccx 2014-10-07 19:56:35 +05:30
Anshul Maheshwari
c9c063b8d8 Merge -xds willem changes 2014-10-07 19:50:02 +05:30
Anshul Maheshwari
e0cd8b2e56 builds on windows 2014-10-07 19:25:09 -07:00
Anshul Maheshwari
38d2088db5 include lib_ccx.h instead of ccextractor.h 2014-10-07 16:35:30 +05:30
Anshul Maheshwari
8e940b050a rename ccextractor.h to lib_ccx.h 2014-10-07 16:25:14 +05:30
cfsmp3
5733b40ca6 Merge branch 'pr/n107_anshul1912' 2014-10-07 12:03:51 +02:00
cfsmp3
22c40675a6 Merge branch 'pr/n108_wforums' 2014-10-07 12:00:36 +02:00
wforums
a3ef46c21d XDS fix + exception when parameters not compatible
See title :)
2014-10-07 11:34:09 +02:00
Anshul Maheshwari
93a546bab4 compiled on windows 2014-10-07 00:24:45 -07:00
Anshul Maheshwari
ec427fd82c remove use of relative path 2014-10-07 00:21:28 -07:00
Anshul Maheshwari
70cc3c2046 Added Cmake support 2014-10-07 02:39:41 +05:30
Anshul Maheshwari
5634960813 add ccx library path in Makefile 2014-10-07 02:39:36 +05:30
Anshul Maheshwari
c7a49e80e3 relative paths while including header file 2014-10-07 02:39:31 +05:30
Anshul Maheshwari
617d2d30dc move all code except ccextractor in folder lib_ccx 2014-10-07 02:38:54 +05:30
cfsmp3
18f781d099 0.74 2014-09-24 13:04:26 +02:00
Ruslan Kuchumov
84db812769 windows support 2014-09-08 18:49:37 +00:00
Ruslan Kuchumov
7763f8aeab pointer bugfix 2014-09-08 18:02:49 +00:00
Ruslan Kuchumov
faa879801e printing output on SIGINT 2014-09-08 09:02:10 +00:00
wforums
4635329a5b Changes.txt updated
-
2014-09-06 13:17:04 +02:00
wforums
b89cc3b6df UCLA TT format change
Switched around TEL & TT page number in ttxt format.
2014-09-06 13:16:51 +02:00
wforums
e9f8313f7c BOM parameter
BOM can be not written now if -nobom is passed as parameter.
2014-09-06 13:16:25 +02:00
wforums
324cd84ffe UCLA parameter fix
Added a new option to ensure that UCLA parameter doesn't get overriden
anymore.
2014-09-06 12:13:50 +02:00
wforums
9d7518c9ec -o1 -o2 -12 fix
Fixes the issue where when using multiple output files, everyting is
written to the -o2 output file.
2014-09-06 00:07:28 +02:00
Ruslan Kuchumov
32e0d6023d sending teletext to the server 2014-09-04 16:07:06 +00:00
Ruslan Kuchumov
c9465e476b segfault when no input files bugfix 2014-09-04 16:02:51 +00:00
Ruslan Kuchumov
45d237da40 removed bin output when sending to server 2014-09-04 15:33:02 +00:00
cfsmp3
631ae2e02f Version bump (0.72 to 0.73) 2014-08-19 07:45:00 +02:00
Anshul Maheshwari
695aa14cd7 Merge remote-tracking branch 'carlos/master' 2014-08-18 23:47:03 +05:30
Anshul Maheshwari
b638bb1d3a updated some grammer in Readme.md 2014-08-18 23:37:03 +05:30
Anshul Maheshwari
28950bf90e changes should not be in Readme.md 2014-08-18 23:22:43 +05:30
wforums
77f8289ca6 Version change
- Added description
2014-08-18 14:26:52 +02:00
wforums
cece92a828 Merge conflict resolve
Fixed merge conflicts
2014-08-18 13:50:30 +02:00
wforums
bd08454d66 Merge from upstream 2014-08-18 13:45:44 +02:00
wforums
c6e5dd5cf7 GPACMP4 filter
moved 2 files to filter
2014-08-18 13:43:12 +02:00
cfsmp3
bd8e3ad137 Merge branch 'pr/n98_rkuchumov' 2014-08-18 13:34:31 +02:00
cfsmp3
8a2e71fcfb Merge branch 'pr/n99_rkuchumov' 2014-08-18 13:33:06 +02:00
wforums
301c2a7138 Library - step one and half
- moved around some functions
- 608_helpers is gone now (moved last function)
2014-08-18 10:35:43 +02:00
Anshul Maheshwari
5368d7292f update version 2014-08-18 13:13:54 +05:30
Anshul Maheshwari
29689b10aa Merge branch 'master' of https://github.com/anshul1912/ccextractor 2014-08-18 13:11:03 +05:30
Anshul Maheshwari
4d8883d0f1 Documented FFmpeg Intigration 2014-08-18 13:10:06 +05:30
Anshul Maheshwari
efe6fceb3a add cflags for gpacmp4 on linux 2014-08-17 10:19:54 +02:00
Ruslan Kuchumov
d9a998b95f memory leak 2014-08-16 23:53:34 +00:00
Ruslan Kuchumov
bf94c2997d unusable variable 2014-08-16 23:41:14 +00:00
Ruslan Kuchumov
6405a3973d tlt support 2014-08-16 21:53:00 +00:00
Anshul Maheshwari
9270e22a65 Merge branch 'master' of https://github.com/anshul1912/ccextractor 2014-08-16 09:49:32 +02:00
Anshul Maheshwari
02e19cf617 corrected CFLAGS to be include in ffmpeg enable 2014-08-16 09:48:29 +02:00
Ruslan Kuchumov
1493b6c4f5 renaming 2014-08-15 21:29:28 +00:00
wforums
74ab732999 Library - fixes
-
2014-08-15 18:37:15 +02:00
wforums
5961d1b56e Library - fixes
-
2014-08-15 18:24:17 +02:00
wforums
87d6a6bf91 Library - fixes
Include fixes
2014-08-15 18:19:48 +02:00
wforums
456d23f547 Library - step one and half
- Cleaned out header files + adjusted accordingly
- Decoupled spupng_encoder from ccextractor.h
- Decoupled ccx_encoders_common from ccextractor.h
2014-08-15 17:47:58 +02:00
wforums
02da93d0e4 Merge conflict fix
-
2014-08-15 14:09:33 +02:00
wforums
597304e932 Merge from upstream
-
2014-08-15 12:34:18 +02:00
Anshul Maheshwari
918889c890 corrected timing in spupng xml file 2014-08-15 12:28:30 +02:00
Anshul Maheshwari
47bfe6bffc corrected timing for tudor using ffmpeg 2014-08-15 12:28:29 +02:00
cfsmp3
5789a0a224 Updated MD 2014-08-15 12:28:29 +02:00
Anshul Maheshwari
b15f54c7f9 Intigration of ffmpeg in ccextractor 2014-08-15 12:28:28 +02:00
wforums
bc3794eb14 Library - step one and hafl
-
2014-08-15 11:59:53 +02:00
wforums
4e66d290a6 Library - step one and half
Moved most of 608_helper functions to ccx_encoders_helpers, as they seem
more logical. No idea yet where the last one has to go (used in both
encoder/decoder 608 right now)
2014-08-15 11:44:14 +02:00
wforums
7b48b01fd1 Library - intermediate
This one has errors!
2014-08-15 09:00:16 +02:00
Anshul Maheshwari
883dfaae4a corrected timing in spupng xml file 2014-08-14 20:45:38 +05:30
wforums
884a25a7cd Commented unused vars
Added a ; too much.
2014-08-13 15:54:27 +02:00
wforums
8cc8767634 Commented unused variables
-
2014-08-13 15:48:08 +02:00
wforums
90a6902ad4 Library - step one and half
More removal of links.
2014-08-13 15:47:53 +02:00
wforums
b334acb426 Library - step one and half
Decoupled 708 from ccextractor.h (finally), reworked some things as
well.
2014-08-13 15:33:51 +02:00
Anshul Maheshwari
9c847aa4f1 Merge remote-tracking branch 'carlos/master' 2014-08-13 17:48:50 +05:30
Anshul Maheshwari
c3397d1949 corrected timing for tudor using ffmpeg 2014-08-13 17:48:00 +05:30
Ruslan Kuchumov
41ad0b4006 cc_name 2014-08-12 22:32:11 +00:00
cfsmp3
7fa59a14f7 Updated MD 2014-08-12 17:15:39 +02:00
wforums
170a57b9c6 Library - fix
-
2014-08-12 14:34:34 +02:00
wforums
0a15c2d16e Library - fix
Fix of includes
2014-08-12 14:32:28 +02:00
wforums
c52283676a Library - step one and half
- Moved enum & struct to more appropriate place (also fixes error with
compiling under linux)
2014-08-12 14:26:48 +02:00
wforums
ce3c2b5ae2 Merge fix 2
-
2014-08-12 12:25:35 +02:00
wforums
48e030d94c Merge fix
Fixing errors that popped up after trying to merge.
2014-08-12 12:14:36 +02:00
wforums
afaa7c8b76 Merge try
Trying to merge
2014-08-12 11:41:22 +02:00
wforums
4e6c0352b0 XDS segfault fix
Fixes segfault on using TTXT + XDS
2014-08-12 10:39:01 +02:00
Anshul Maheshwari
f84b69aca7 Intigration of ffmpeg in ccextractor 2014-08-12 10:43:07 +05:30
cfsmp3
cc7ebbc4d7 Replace g++ with gcc in OSX 2014-08-11 14:33:52 +02:00
Ruslan Kuchumov
7a74b815fa segfault on error fix 2014-08-09 21:23:27 +00:00
Ruslan Kuchumov
331038634d password bug fix 2014-08-09 21:17:41 +00:00
Ruslan Kuchumov
aa2c316093 Chris's patch 2014-08-09 20:52:15 +00:00
cfsmp3
3347f5d345 Version bump 2014-08-09 13:18:56 +02:00
cfsmp3
141792a299 Delete upgradelog. 2014-08-09 13:18:14 +02:00
cfsmp3
183e613981 Merge branch 'pr/n93_wforums' 2014-08-08 16:39:02 +02:00
wforums
19e2912a71 AVC fps fix
- Will now change current_fps based on AVC data (if present). Should fix
an issue with low fps video that was submitted.
2014-08-07 21:09:45 +02:00
wforums
dc82154a03 AVC fps fix
Changes.txt updated.
2014-08-07 21:09:31 +02:00
cfsmp3
2029dab3bf Merge branch 'pr/n92_anshul1912' 2014-08-05 21:24:08 +02:00
wforums
405d808d0b WTV fix
Fixed WTV
2014-08-04 21:10:17 +02:00
Anshul Maheshwari
783e889634 showing language at channel in DVB transcript 2014-07-31 01:28:19 +05:30
Anshul Maheshwari
a32c8a3b7f dvb output as transcript 2014-07-30 23:00:55 +05:30
Anshul Maheshwari
5618df35c6 Merge branch 'master' of https://github.com/anshul1912/ccextractor 2014-07-30 21:17:44 +05:30
Anshul Maheshwari
c054594383 output of dvb in srt sami smptett format 2014-07-30 21:17:04 +05:30
Anshul Maheshwari
c58f99378f removing redundant snprintf defines 2014-07-30 00:33:47 -07:00
Anshul Maheshwari
45d1dfe425 merging src/cc_encoders_common.c 2014-07-30 11:45:25 +05:30
Anshul Maheshwari
a5dcf9242d dvb_sub_decoder use common encoder interface 2014-07-30 11:40:12 +05:30
cfsmp3
ecc0714f48 Correction to text files 2014-07-29 10:12:22 +02:00
cfsmp3
26410b991d Version pump 2014-07-29 10:06:45 +02:00
cfsmp3
19b1bff7f4 Merge branch 'pr/n91_anshul1912'
Conflicts:
	docs/CHANGES.TXT
2014-07-29 09:28:28 +02:00
Anshul Maheshwari
bc1aff78d7 updated README 2014-07-29 08:16:00 +02:00
Anshul Maheshwari
2df8931d00 updated changes.txt 2014-07-29 08:13:54 +02:00
wforums
b765198d53 Updated for 0.71
-
2014-07-28 22:22:47 +02:00
cfsmp3
22f620400a Merge branch 'pr/n89_anshul1912' 2014-07-28 21:22:29 +02:00
cfsmp3
a68add78d0 Merge branch 'pr/n88_rkuchumov'
Conflicts:
	docs/CHANGES.TXT
2014-07-28 17:56:15 +02:00
Ruslan Kuchumov
14d866e8a2 -stdin parameter 2014-07-28 18:48:07 +00:00
Anshul Maheshwari
335bca4507 uninitialized values used in encoder 2014-07-28 17:48:25 +02:00
Ruslan Kuchumov
f31425e9f0 cygwin support 2014-07-28 13:57:54 +00:00
Anshul Maheshwari
3f54fab5f4 Indentation of file 2014-07-28 11:19:33 +05:30
Anshul Maheshwari
59c62d48b3 handle memory leakage 2014-07-28 10:55:46 +05:30
Ruslan Kuchumov
a926766478 merge conflict 2014-07-27 23:24:19 +00:00
Ruslan Kuchumov
cc233c61f2 changes.txt 2014-07-27 23:23:11 +00:00
cfsmp3
e9fcdf392f Merge branch 'pr/n83_rkuchumov'
Conflicts:
	src/file_functions.c
	src/params.c
2014-07-27 20:29:05 +02:00
Ruslan
c42f039297 fix 2014-07-26 21:17:20 +04:00
Ruslan Kuchumov
8cbaf09b4f moved udp code to networking.c 2014-07-26 21:07:45 +00:00
Ruslan Kuchumov
ee8d5dff66 goddamn windows 2014-07-26 17:56:58 +00:00
Ruslan Kuchumov
ec0873f5a2 windows support 2014-07-26 12:06:17 +00:00
Ruslan Kuchumov
29515bfcd5 some changes to the protocol 2014-07-25 19:58:16 +00:00
Ruslan Kuchumov
c85ebb0c1e usage & no debug 2014-07-25 18:17:46 +00:00
Ruslan Kuchumov
d6e66d5c7f password 2014-07-24 22:47:47 +00:00
Ruslan Kuchumov
f65f2b229a params 2014-07-24 21:14:56 +00:00
Ruslan Kuchumov
5094351469 listening tcp port 2014-07-24 20:19:13 +00:00
Anshul Maheshwari
5d6a770ce8 error checking for socket 2014-07-23 13:34:36 +05:30
Anshul Maheshwari
010d7f9ce4 error checking in fdprintf 2014-07-23 13:14:20 +05:30
Anshul Maheshwari
fb49e680a6 error checking in getfilesize 2014-07-23 13:10:42 +05:30
Anshul Maheshwari
6b98856892 put telexcc debug code inside a macro 2014-07-23 13:08:04 +05:30
Anshul Maheshwari
1a479a7199 looking for writing beyond the memory
increasing memory to 40, though only 38 is required but to make it
multiple of 4 and 8 looking at 32bit and 64 bit system.
2014-07-23 11:58:38 +05:30
Anshul Maheshwari
2894bcd7ff closed cid 26479 getc does not match eof 2014-07-22 15:36:00 +05:30
Anshul Maheshwari
1ae8040bd7 closing configurtion file correctly 2014-07-22 14:08:02 +05:30
Ruslan Kuchumov
57a80084ce bin support 2014-07-21 13:18:20 +00:00
Ruslan Kuchumov
e35b4ea62c small fix 2014-07-21 11:10:02 +00:00
Ruslan Kuchumov
3546526177 teletext support 2014-07-21 11:10:02 +00:00
Ruslan Kuchumov
12efb6166a constants 2014-07-21 11:10:02 +00:00
Ruslan Kuchumov
9beee068ce debug output 2014-07-21 11:10:02 +00:00
Ruslan Kuchumov
9efcba5c02 608 support & params 2014-07-21 11:10:02 +00:00
Ruslan Kuchumov
947333ea64 init 2014-07-21 11:08:29 +00:00
Anshul Maheshwari
7e527fc62a memory leakage for 608_smptett 2014-07-21 14:09:02 +05:30
Anshul Maheshwari
9f78c595b3 resource leak in configuration 2014-07-21 13:54:42 +05:30
Anshul Maheshwari
fa03442c85 leakage of file handler 2014-07-21 13:54:33 +05:30
Anshul Maheshwari
e664c035a1 handle memory leakage 2014-07-21 13:54:04 +05:30
Anshul Maheshwari
c522e3b054 error checking fr cur_xds_payload_length 2014-07-21 13:52:41 +05:30
Anshul Maheshwari
b3c037ab21 indentation of param_c 2014-07-21 12:16:16 +05:30
Anshul Maheshwari
097fdb643b corecting boundary of xds_call_letters 2014-07-21 11:41:42 +05:30
Anshul Maheshwari
43094a9897 fix typo while checking boundary 2014-07-21 11:36:20 +05:30
Anshul Maheshwari
aefa623cd4 reverted typo for xds with mprint 2014-07-20 20:07:28 +05:30
Anshul Maheshwari
1be11738eb removed redundant declaration in header file 2014-07-20 20:06:36 +05:30
Anshul Maheshwari
5a09c116f6 correct xdsprint argument 2014-07-20 14:26:42 +05:30
cfsmp3
bb700db08e Merge branch 'pr/n78_anshul1912' 2014-07-20 10:46:38 +02:00
cfsmp3
2e8582b14c Merge branch 'pr/n74_anshul1912'
Conflicts:
	src/608_sami.c
2014-07-20 10:46:21 +02:00
Anshul Maheshwari
8d47dc2f82 corrected size of expression 2014-07-20 13:37:35 +05:30
Anshul Maheshwari
6a3c736195 Added comments, to use function and structure 2014-07-20 08:53:43 +05:30
Anshul Maheshwari
9463999325 added snprintf in utility 2014-07-19 12:27:22 -07:00
Anshul Maheshwari
e50c30eaaa not to write 0 bytes
write have undefined( not mentioned behaviour when 0 bytes written)
write xds data even if start_time is 0
2014-07-19 22:10:50 +05:30
Anshul Maheshwari
45a3e21897 passed as argument cur_xds_packet_class 2014-07-19 18:34:42 +05:30
Anshul Maheshwari
47dbcdff9c write xds data only when option is passed 2014-07-19 18:15:53 +05:30
Anshul Maheshwari
dc164f81e5 improved xds logic 2014-07-19 17:46:16 +05:30
Anshul Maheshwari
bab0ec8b60 removed implicit declaration warning 2014-07-19 16:35:53 +05:30
Anshul Maheshwari
f543e3f4e2 xds extraction in seprate output context 2014-07-19 16:29:28 +05:30
Ruslan Kuchumov
43d4b9abaa typo fix 2014-07-18 21:45:57 +00:00
Ruslan Kuchumov
f5bbb6aef5 output to stdout when -out=null removed 2014-07-18 21:44:47 +00:00
Ruslan Kuchumov
25b666c2ae seg fault fix 2014-07-18 21:43:53 +00:00
Anshul Maheshwari
78087073ac mpg file correction 2014-07-18 11:23:16 +02:00
Anshul Maheshwari
12c2ced497 corrected transcript for mov files 2014-07-17 17:26:14 +02:00
cfsmp3
87954419ba Typo fix 2014-07-16 14:31:41 +02:00
cfsmp3
0add0bc2e9 Detect out-of-band XDS packets and a couple of other bugfixes. 2014-07-16 14:30:59 +02:00
Anshul Maheshwari
7858afb837 Merge branch 'seprate_output_context' of https://github.com/anshul1912/ccextractor into seprate_output_context 2014-07-16 16:07:21 +05:30
Anshul Maheshwari
69c0b2e223 handling end of data correctly 2014-07-16 16:06:29 +05:30
Anshul Maheshwari
855ca48220 not to use g++ 2014-07-16 16:05:55 +05:30
Anshul Maheshwari
02bee86397 correct value for try_to_add_start_credits 2014-07-14 21:28:27 +05:30
Anshul Maheshwari
315d466da8 updated mythtv for encoder 2014-07-14 18:47:54 +05:30
Anshul Maheshwari
d4597e0094 indentation of mythtv 2014-07-14 17:52:06 +05:30
cfsmp3
b8ff3414c0 Fix is packet size, as reporte by Coverity 2014-07-14 14:12:12 +02:00
Anshul Maheshwari
2206cc1f78 adding encoder in rcwt loop 2014-07-14 17:24:20 +05:30
Anshul Maheshwari
00433467be use_"-12"_and_"-out=raw"_tn_both_fields_in_1_file 2014-07-14 17:20:03 +05:30
Anshul Maheshwari
1000e33e7f adding raw data support 2014-07-14 13:37:30 +05:30
Anshul Maheshwari
a64245fb5b correcting help message typo 2014-07-14 13:37:07 +05:30
Anshul Maheshwari
2f784f00ff correcting logic of devide time
Added another loop so that data whose start time is
already set, does not get affected while setting
others time.

in cc_encoder doing data++ so that it can buffer
more then 2 data
2014-07-14 13:32:54 +05:30
Anshul Maheshwari
136012c558 moving write header in init_encoder
RCWT header can't have a BOM before it, or parsing it later will not
be possible
2014-07-13 18:40:50 +05:30
Anshul Maheshwari
874abf6442 added encoder context in spupng 2014-07-13 18:28:39 +05:30
Anshul Maheshwari
20975957ee corrected corruption of sub for mp4 2014-07-13 18:28:33 +05:30
Anshul Maheshwari
1fabae2870 using encoder from cc_encoder_common 2014-07-13 18:28:28 +05:30
Anshul Maheshwari
abb3523ee3 passing encoder context 2014-07-13 18:28:22 +05:30
Anshul Maheshwari
ec63a06e25 generic-code-from-608-encoder-to-common-encoder 2014-07-13 18:28:16 +05:30
Anshul Maheshwari
8b4353f08c passing-subtitle-in-output_c 2014-07-13 18:28:11 +05:30
Anshul Maheshwari
8bfb3b87c3 remove declaration conflicts 2014-07-13 18:28:06 +05:30
Anshul Maheshwari
f1a493b999 passing-subtitle-in-myth.c-n-sequencing.c 2014-07-13 18:28:00 +05:30
Anshul Maheshwari
3afcfa79e1 allocating-cc_subtitle-for-mp4 2014-07-13 18:27:55 +05:30
Anshul Maheshwari
adaa436f6b allocating-cc_subtitle-in-general_loop.c 2014-07-13 18:27:49 +05:30
Anshul Maheshwari
37135762c5 passing-av-subtitle-in-es_userdata.c 2014-07-13 18:27:44 +05:30
Anshul Maheshwari
e6aa7128df passing cc_subtitle in ccextractor_h n es_function_c 2014-07-13 18:27:37 +05:30
Anshul Maheshwari
da8d4a290c passing cc_subtitle in src/avc_functions.c 2014-07-13 18:27:30 +05:30
Anshul Maheshwari
4d11a727d9 passing cc_subtitle in cc608 decoder 2014-07-13 18:27:20 +05:30
Anshul Maheshwari
3c232bfca0 Merge remote-tracking branch 'upstream/master' 2014-07-13 18:24:37 +05:30
Anshul Maheshwari
b3fe96477a dereferebcing NULL pointer 2014-07-13 18:08:44 +05:30
Anshul Maheshwari
5f87544a0d Invalid memory access at boundary 2014-07-13 01:43:27 +05:30
cfsmp3
f0c0ca4566 Merge branch 'pr/n73_anshul1912' 2014-07-12 21:26:45 +02:00
Anshul Maheshwari
23719526cd update changes_text 2014-07-13 00:54:57 +05:30
cfsmp3
67ffe22460 Merge branch 'pr/n72_anshul1912' 2014-07-12 21:18:07 +02:00
Anshul Maheshwari
08996a3253 using freep and removing redundant code 2014-07-12 19:42:38 +05:30
Anshul Maheshwari
95e2f7665b corrected time roll up 2014-07-12 11:28:43 +05:30
Anshul Maheshwari
a5ef2d1574 some memory check before accessing 2014-07-11 13:13:48 -07:00
Anshul Maheshwari
cc0a786004 compile on windows 2014-07-11 22:13:33 +05:30
Anshul Maheshwari
4d6693d948 cleaned mp4.c file 2014-07-11 19:09:34 +05:30
Anshul Maheshwari
9c0792c5a0 using time from data structure 2014-07-11 18:51:04 +05:30
Anshul Maheshwari
0f06f47ab4 logic to devide time between frames 2014-07-11 18:40:00 +05:30
Anshul Maheshwari
5371f854fc indentation of 608_srt.c 2014-07-11 16:59:20 +05:30
wforums
bd49f0f959 Fix for .bin/RCWT file generation
When not using latin1 charset, we were producing unreadable .bin files.

Fixed by adding a separate case where for an RCWT under no circumstance
BOM's can be added before the header.
2014-07-10 12:37:30 +02:00
Willem
63d3071233 Merge pull request #1 from CCExtractor/master
put wtv specific dump in WTV_DEBUG macro
2014-07-10 11:36:00 +02:00
Anshul Maheshwari
015a50bafd put wtv specific dump in WTV_DEBUG macro 2014-07-07 18:02:59 +05:30
Anshul Maheshwari
1ee4b9bd01 put wtv specific dump in WTV_DEBUG macro 2014-07-07 17:45:12 +05:30
527 changed files with 173734 additions and 53762 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

38
.gitignore vendored
View File

@@ -1,3 +1,9 @@
####
# Ignore tests tmp files and results
tests/runtest
tests/**/*.gcda
tests/**/*.gcno
####
# Ignore CVS related files
@@ -9,10 +15,40 @@ CVS
*.o
linux/ccextractor
linux/depend
windows/debug/*
windows/Debug/**
windows/Debug-OCR/**
windows/Release/**
windows/Release-Full/**
windows/Release-OCR/**
windows/Debug-Full/**
windows/x64/**
windows/ccextractor.VC.db
build/
####
# Visual Studio project Ignored files
*.suo
*.sdf
*.opensdf
*.user
*.opendb
####
# Ignore the header file that is updated upon build
src/lib_ccx/compile_info_real.h
#### Ignore windows OCR libraries and folders
windows/libs/leptonica/**
windows/libs/tesseract/**
# Ctags
*.tags*
# Vagrant
.vagrant/
# Eclipse stuff
.cproject
.project
.settings/

637
Dictionary/dict_Arrow.txt Normal file
View File

@@ -0,0 +1,637 @@
A.R.G.U.S Tech
A.R.G.U.S. Agent
A.R.G.U.S. Guard
A.R.G.U.S. Tech
Adam Castwidth
Adam Donner
Adam Hoffman
Adam Hunt
Additional
Adrian Chase
Agent
Aglin
Aide
Akio Yamashiro
Al Ow-Al
Alan Chang
Alan Durand
Albie
Alderman Richard Ford
Alex Davis
Alex Salese
Alexi Leonov
Allison Lee
Alvarez
Amanda Waller
Ambushed Soldier
Anastasia
Anatoly Knyazev
Andy Diggle
Andy Jr.
Angry Crowd Riot
Angry Woman
Ankov
Anthony Venza
Anthony Walker
Armed Citizen
Armed Citizen #2
Armed Guard
Armored Truck Driver
Asian Driver
Assassin
Attendant
Attorney
Attractive Woman
Badass Inmate
Baker
Bank Guard
Bank Guard #1
Bank Guard #2
Bank Manager
Bar Guy
Barman
Baron Reiter
Barry Allen
Bartender
Barton Mathis
Bean Pole
Becky
Ben Turner
Benefit Patron
Benefit Security
Bertinelli's Thug
Bethany Snow
Big Donor
Biker
Biker Leader
Billy Malone
Black Hawk Guard
Blaine
Blake
Bo Travis
Bodyguard
Bodyguard #1
Bomb Squad Officer
Boss
Bouncer
Bouncer #1
Boy
Bratva Thug
Brick Thug #1
Brick Thug #2
Brie Larvan
Briefcase Man
Burly Guard
Business Suit
Businesswoman
Bystander
CSI Tech
CSU Tech Kelton
Caitlin Snow
Camille Declan
Captain
Captain Stein
Carl
Carl Roberto
Carly Diggle
Carrie Cutter
Carter Bowen
Carter Hall
Cass Derenick
Certo
Chase
Chauffeur
China White
Chinese Man
Chinese Pilot
Christopher Chance
Cisco Ramon
Claire Abbott
Clinton Hogue
Clock King
Cocktail Waitress
College Kid
Colonel Walker
Colton
Commissioner Brian Nudocerdo
Comptroller
Conklin
Constantine Drakon
Controller
Cooper Seldon
Cop
Cop #1
Cop's Wife
Coroner
Corrupt Cop #1
Costa
Councillor
Councilman Kullons
Count Vertigo
Counterfeiter
Courier
Court Clerk
Crewman
Cronan
Curtis Holt
Customs Agent
Cyrus Gold
Cyrus Vanch
D.B. Gavin Carnahan
D.O.C. Guard
DJ
Damian Darhk's Assistant
Damien Darhk
Dance Partner
Danny Brickwell
Danny De La Vega
Dark Archer
Dark Archer Stick
Daughter
Dead Girl
Dead Girl in Photograph
Deadshot
Dealer
Deathbolt
Deathstroke
Declan Lin
Delivery Clerk
Dennis
Dennis Fisk
Derek Reston
Derek Sampson
Desk Guard
Detective
Detective Lucas Hilton
Detective McKenna Hall
Deveau
Digger Harkness
Dignitary's Wife
Dina Salvati
Dinah Lance
District Attorney
Doctor
Dominic Alonzo
Donna Smoak
Double Down
Dr. Aldus Boardman
Dr. Anthony Ivo
Dr. Avery Pressnall
Dr. Douglas Miller
Dr. Lockhart
Dr. Neil Lamb
Dr. Schwartz
Dr. Vaca
Dr. Webb
Driver
Drug Dealer
Drug Dealer's Girlfriend
Drunk Guy
Drunk Partier
Dying Culebra Member
ESU Officer
ESU Sergeant
Eddie Walczak
Edward Fyers
Edward Rasmus
Elite Man
Emergency Services
Emily Nocenti
Engineer Antonov
Eric Dunn
Eric Moore
Erica Vendel
Erlich Kelso
Esrin Fortuna
Evan Wender
Evelyn Sharp
Ezra Barnes
FBI Agent
Federal Marshal
Felicity Smoak
Female Clubber
Female Hostage
Female Scientist
Fence
Field Reporter
Fire Chief Raynes
Firefly
Firestorm
First Mate
Fitzmartin
Frank Bertinelli
Frank Chen
Fred
Friendly Bratva
Galina
Gambler
Gang Leader
Gang Member
Gangbanger
Gangbanger #1
Gangbanger #2
Gardener
Gary
General Matthew Shrieve
General Vadimov
George Wolfman
German
Gerry Conway
Gholem Qadir
Gholem Security
Ghost
Ghost #2
Gideon
Girl
Glass Banger
Gora
Grandmother
Gravano
Greg Osborne
Grizzled Man
Guard
Guard #1
Guard #2
Guillermo Barrera
Gun Dealer
Gunman #2
Gus Sabatoni
Halcones Gang Member
Hardhat
Harley Quinn
Harold Backman
Hawkgirl
Heat Wave
Helena Bertinelli
Hendrick Von Arnim
Hive Scientist
Homeless Man
Hooded Man
Hoodie
Hoodlum
Hot Chick
Hot Girl
Housewife
Husband
Ian
Infected Man
Injured Chemist
Inmate
Intern
Isaac Stanzler
Isabel Rochev
Ishmael Gregor
Izzy Declan
Jackhammer
James Holder
Jana Washington
Janet Carroll
Janice Bowen
Jason Brodeur
Jean Loring
Jenn
Jenny Russo
Jermaine Fisher
Jessica Danforth
Jim Huffman
Joanna De La Vega
John Constantine
John Diggle
John Jr.
John Le
John Nickel
Jordan Kern
Jose Anton
Joseph Falk
Josiah Hudson
Judge
Judge Brackett
Judge Mandelbaum
Judge Moss
Judge Sakow
Junior Gangbanger
Junkie
Kandy Kane
Kara Danvers
Karla Groves
Kate Spencer
Katherine
Katsu Cheng
Keating
Kendrick Weller
Kirby Bates
Klaus Markos
Konstantin Kovar
Kyle Reston
LOA Soldier
Lady in Red
Landmine Soldier
Laura - Skull A
Laura Hoffman
Laura Washington
Laurel Lance
Lead Gangbanger
Lead Gunman
Lead Soldier
League Assassin
Leo Mueller
Li Khuan Hui
Lieutenant
Lieutenant Joyner
Liling
Linda Park
Little Boy
Liza Warner
Lonnie Machin
Lowlife
Lt. Conahan
Lt. Dave Ellet
Lt. Frank Pike
Lyla Michaels
M.I.T Student
MP #1
MP #2
MP #3
MP #4
Maddie
Madison Danforth
Maitre'd
Malcolm Merlyn
Malcolm's Friend
Male Scientist
Man
Man #2
Man in Suit
Man on Bus
Manny
Marcus Redmond
Margo
Mari McCabe
Mark Francis
Mark Scheffer
Mark Shaw
Markov
Martin Somers
Maseo Yamashiro
Matt Istook
Max Fuller
Maya Resik
Mayor Altman
Mayor Celia Castle
Mayor Queen's Assistant
Mercenary
Mercenary #3
Merlyn Security #1
Merlyn Security #2
Michael Amar
Michael Ancona
Middle Aged Woman
Milo Armitage
Mina Fayad
Minister
Mirakuru Soldier
Model
Moderator
Moira Queen
Morgan
Mother at Mall
Motorcycle Cop
Mouthpiece
Mr. Blank
Mr. Gardner
Mr. Russo
Mrs. Gardner
Mrs. Merlyn
Mrs. Reston
Mrs. Volodarsky
Myron Forest
Nancy Moore
Nate Heywood
Nathan Sierra
Ned Foster
Nelson Ravich
News Caster
News Reporter
Nick Salvati
Nico
Noah Kuttler
Nora Darhk
Nurse
Nyssa al Ghul
Obnoxious Clubber
Officer
Officer Benton
Officer Daily
Officer Jones
Officer Lopez
Officer Thompson
Officiant
Oliver Queen
Oliver's Security Detail
Ops Leader
Orderly
Orphan
Overlapping Personnel #1
Overlapping Personnel #2
Pablo Estevez
Palmer Tech Guard
Paparazzi
Parole Officer
Partner
Paul
Paul Copani
Paul Knox
Pedestrian
Peter
Peter Declan
Peter Kang
Petrov
Phaedra Nixon
Pharmacist
Phil
Pilot
Pino Bertinelli
Pirate
Pit Boss
Pretty Girl
Prison Guard
Prison Guard #1
Prison Guard #2
Prisoner
Prisoner #1
Prisoner #2
Private Collins
Protester
Pudgy Emcee
Pyotr Friedkin
QC Security Guard
Queen Family Lawyer
Quentin Lance
Ra's al Ghul
Ragman
Raisa
Rameses II
Raven
Ray Palmer
Real Estate Woman
Rebecca Merlyn
Recruit #1
Recruit #2
Redhead Girl
Refugee Woman
Rene Ramirez
Reporter
Reporter #1
Reporter #2
Reporter #3
Reporter #5
Richard
Rickie - Skull Man
Ripped
Rob Scott
Robert Joyce
Robert Queen
Rookie
Rosie
Roy Harper
Russian Cop #1
Russian Drugs Buyer
Russian Fight Arranger
Russian Policeman
Ruvé Adams
SCPD Clerk
SCPD Detective
SCPD Officer
SCPD Officer #1
SWAT #2
SWAT #3
SWAT #4
Samantha Clayton
Sara Lance
Scared Girl
Scientist
Screaming Woman
Sebastian Blood
Secretary
Security Guard
Security Guard #1
Security Guard #2
Senator Joseph Cray
Sentry
Sergei
Sergio
Servant
Sexy Hostess
Shado
Shadowspire Soldier
Shane Colvin
Shannon Groff
Sharp Gangster
Shimosawa
Shooter
Silhouetted Man
Simon
Simon Lacroix
Sin
Sin's Father
Skel
Skull B
Slade Wilson
Sleazy Businessman
Sleazy Clerk
Slim
Sobbing Man
Social Worker
Soldier
Soldier #2
Staffer #1
Staffer #2
Station Attendant
Steve Aoki
Street Kid
Street Tough
Striking Woman
Suited Bratva
Supporter #1
Supporter #2
Survivor
Susan Williams
Susie Lawton
Swat Team Leader
TV Host
Taiana
Talibah
Talking Head
Task Force Agent
Task Force Leader
Tatsu Yamashiro
Tattooed Inmate
Taylor Moore
Technician
Technician #2
Ted Gaynor
Ted Grant
Teddy Reston
Terrified Prisoner
The Butcher
The Captain
The Count
The Dodger
The Mayor
The Mechanic
The Priestess
Thea Queen
Thomas Flynn
Thomas Kemp
Thug
Thug #1
Tim Kaufman
Tim Sullivan
Tobias Church
Tom Weston
Tomas
Tommy Merlyn
Tony Daniel
Torque
Triad Accountant
Triad Thug
Turk
US Ambassador
Uniform
Uniform Cop
Untouchable #2
Untouchable #3
Vandal Savage
Vendor
Veronica Sparks
Victor Nocenti
Victor Swanstrom
Vigilante
Viktor
Viktor's Henchman
Vivian
Vixen
Vlad
Volkov
Volunteer
Waiter
Waitress
Walter Steele
Warehouse Worker
Wealthy Patron
Wheelman
Wife
William
Woman
Woman on Bus
Yao Fei
Young Boy
Young Girl with Glasses
Young Guard
Young Mother
Young Nyssa
Young Oliver
Young Thug
Young Tommy
Zhishan
Zoe Lawton

View File

@@ -0,0 +1,370 @@
ABQ Detective #1
ABQ Detective #2
APD Detective Tim Roberts
APD Officer
ASAC George Merkert
AUSA
Addict
Agent Buddy
Airport Traveler
Albuquerque Police Officer
Amber
Anchor #1
Anchor #2
Anchor #3
Anchor #4
Andrea Cantillo
Arms Dealer
Asst. US Attorney
Backhoe Operator
Bad Girl
Badger
Banger #1
Bank Customer
Bank Teller
Bar Fighter
Barfly
Barry
Bartender
Ben
Beneke Employee #1
Beneke Employee #2
Benicio Fuentes
Beto
Big Biker
Biker
Bingo Caller
Bingo Lady
Bob
Bogdan Wolynetz
Boy in Museum
Brock Cantillo
Burnout
Business Community Leader #1
Business Community Leader #2
Businessman
CID Special Agent
Cab Driver
Cancer Patient
Car Wash Attendant
Car Wash Customer
Car Wash Patron
CarWash Patron
Cara
Caregiver
Carmen Molina
Carol
Carpet Cleaner
Carpet Cleaner #2
Cartel Gunman #1
Cartel Gunman #2
Cartel Gunman #3
Cartel Gunman #4
Cartel Henchman
Carwash Customer
Chad
Chad's Girlfriend
Charlie Rose
Chemical Plant Guard
Chemistry Student
Chief Food Technician
Chris Mara
Chuck
Clovis
Colleen
Combo
Commercial Narrator
Commercial Voice Over
Concerned Parent
Conductor
Cop
Cop #1
Cop #2
Corpse
Customer
DEA
DEA Agent
DEA Agent #1
DEA Agent Artie
DEA Agent Scott
DEA Agent Tom
DEA Agent Vanco
DEA Point Man
Dan Wachsberger
Darla
Daughter
Dave
Declan
Declan's Crew Member
Declan's Driver
Delivery Man
Delores
Dennis Markowski
Deputy #1
Deputy Kee
Detective
Detective #1
Detective #2
Detective Kalanchoe
Detective Munn
Doctor
Dog Handler
Don Eladio
Donald Margolis
Dorothy Yobs
Dr. Barry Goodman
Dr. Belknap
Dr. Chavez
Dr. Delcavoli
Dr. Soper
Dr. Victor Bravenec
Drew Sharp
Duane Chow
Duty Officer
EMT
ER Doctor #1
ER Doctor #2
Ed
El Paso DEA Agent
Elliott Schwartz
Emilio Koyama
Emotional Woman
Engineer
Farley
Father
Federale
Female Employee
Female Homeowner
Fernando
Fireman
First Realtor
Fran
Francesca
Frankie
Friendly Agent
Friendly Guy
GYN
Gaff
Gale Boetticher
Garduño's Diner
Getz
Gonzo
Good Samaritan
Government Lawyer
Grandma
Gretchen Schwartz
Group Leader
Gunman #1
Gunman #2
Gus' Operative
Gustavo 'Gus' Fring
Hank Schrader
Henry Tyree
Herr Herzog
High School Student
Homeless Man
Homeless Man's Wife
Homeowner
Hospital Administrator
Hospital Patient
Hot Chick Cop
Huell
Hugo Archuleta
Ira
Irving
Jack's Henchman
Jake Pinkman
James Edward Kilkelly
Jane Margolis
Janice
Jeffrey
Jesse Pinkman
Jewelry Store Owner
Jock
Jock's Friend #1
Jock's Friend #2
Juan Bolsa
Kaylee Ehrmantraut
Ken Wins
Kenny
Kid
Kiira
Krazy-8
Kuby
Lady in Car
Laundry Woman 1
Laundry Woman 2
Laundry Woman 3
Laundry Worker
Lawson
Lawyer
Lead Doctor
Leonel Salamanca
Lester
Little Old Lady
Local Correspondant
Locksmith
Look out
Lookout
Los Pollos Hermanos Cook
Los Pollos Hermanos Patron
Louis
Lt. Adam Estiguez
Lucy
Lydia Rodarte-Quayle
Ma Kettle
Madrigal Suit
Magnet Guy #2
Mail Lady
Male Homeowner
Manager
Marco Salamanca
Mariano
Marie Schrader
Matt
Max Arsiniega
Medical Technician
Meth Cook
Meth Drug Dealer
Miguel
Mike Ehrmantraut
Mike's Security Team 1
Mike's Security Team 2
Min-Ye
Morning After Girl
Mortgage Broker
Mother
Mr. Gardiner
Mr. Pinkman
Mr. Wilson
Mrs. Ortega
Mrs. Pinkman
Mrs. Pope
Ms. Tromel
Music Producer
NA Sponsor
Narcocorridos Band #1
Narcocorridos Band #2
Native American Man
Neighbor
Neighborhood Boy
Neighborhood Kid
News Reporter
No-Doze
Nurse
O.M.I. Attendant
O.M.I. Officer
OPR Official #1
Ob-Gyn
Off Duty Cop
Office Manager
Office Worker
Old Crawler
Old Joe
Old Man
Orderly
Pa Kettle
Pamela
Parent
Party Girl
Partygoer
Paul Tyree
Pedestrian
Pediatric Nurse
Peng
Peter Schuler
Physical Therapist
Police Officer
Policeman
Pollos Manager
Preppy Shopper
Prison Guard
Prospective Buyer
Public Defender
Radio DJ #1
Radio DJ #2
Realtor
Receptionist
Rehab Group Girl
Rehab Patient
Restaurant Employee
Restaurant Patron
Rival Dealer #1
Rival Dealer #2
Ron Forenall
Rookie Officer
Rowdy Prisoner
SAC Ramey
Sad Faced Girl
Sales Girl
Salesman
Sara Tyree
Saul Goodman
Saul's Client
Scary Skell
Schlubby Guy #1
Schlubby Guy #2
School Office Worker
Scientist
Screaming Shopper
Secretary
Senior DEA Agent
Server
Sexy Cartel Girl
Sexy Neighbor
Skater
Skell
Sketchy
Skinny Pete
Skycap
Skyler White
Soren
Spooge
Spooge's Woman
Stephanie Doswell
Steven Gomez
Stew
Stripper #1
Stripper #2
Student
Supermarket Clerk
Support Group Leader
Support Group Member
TV Reporter
Tattooed Biker
Tattooed Woman
Teacher
Technician
Ted Beneke
The Assassin
Thug Buddy
Tio Salamanca
Tio's Nurse
Todd
Tomas
Tortuga
Trent
Truck Guard 1
Truck Guard 2
Tucker
Tuco Salamanca
Tweaker Thief
Tweaky Dude
Tyrus Kitt
Uncle Jack
Union Rep
Urinal Guy
Victor
Waiter
Waitress
Walter White
Walter White, Jr.
Warehouse Worker
Wendy
Wide Eyed Boy
Wino
Woman in Denny's
Young Boy
Young Leonel
Young Marco
Yuppie Woman

View File

@@ -0,0 +1,614 @@
'That's Right' Man
Addam Marbrand
Adrack Humble
Aeron Greyjoy
Aerys Targaryen
Aggo
Alliser Thorne
Alton Lannister
Amory Lorch
Anara
Anguy
Anya Waynwood
Areo Hotah
Armeca
Arthur
Arthur Dayne
Arya Stark
Ash
Axell Florent
Aya
Baby Sam
Balon Greyjoy
Baratheon Archer
Baratheon General
Baratheon Guard
Baratheon Officer
Baratheon Soldier
Baratheon Soldier #1
Baratheon Soldier #2
Barristan Selmy
Bathhouse Boy
Bathhouse Prostitute
Bear Island Maester
Beggar Woman
Belicho Paenymion
Benjen Stark
Beric Dondarrion
Bianca
Biter
Black Jack Bulwer
Black Lorren
Black Walder Rivers
Boat Commander
Bobono
Bolton General
Bolton Guard
Bolton Officer
Bolton Soldier
Bowen Marsh
Braavosi Captain
Braavosi Madam
Braavosi Theatre Server
Braavosi Theatre Sound Artist
Braavosi Woman #1
Braavosi Woman #2
Bran Stark
Brant
Brea
Brienne of Tarth
Bronn
Brothel Child #1
Brothel Child #2
Brothel Customer
Brothel Guard
Brother Ray
Brotherhood Member
Brusco
Brynden 'Blackfish' Tully
Camello
Captain of the Archers
Captain of the Bolton Archers
Captain's Daughter
Catelyn Stark
Catspaw Assassin
Cersei Body Double
Cersei Lannister
Chella
Child of the Forest
Citadel Maester
Clarenzo
Clea
Cley Cerwyn
Colen of Greenpools
Cooper
Craster
Craster's Wife
Craster's Wife #2
Craster's Wife #3
Craster's Younger Wife
Daario Naharis
Daenerys Targaryen
Dagmer Cleftjaw
Daisy
Davos Seaworth
Denys Mallister
Derek
Desmond Crakehall
Despondent Man
Dickon Tarly
Dim Dalba
Donnel Hill
Donnel Waynwood
Dontos Hollard
Doran Martell
Doreah
Dothraki
Dothraki Bloodrider #1
Dothraki Bloodrider #2
Dothraki Crone
Dothraki Man Having Sex
Dothraki Widow #1
Dothraki Widow #2
Dothraki Woman Having Sex
Dragonstone waiter
Drennan
Drowned Priest
Drummer
Drunk Patron
Dwarf Hunter #1
Dwarf Hunter #2
Dying Man
Eddard 'Ned' Stark
Eddison Tollett
Edmure Tully
Elder Meereen Slave
Ellaria Sand
Eon Hunter
Euron Greyjoy
Eyrie Guard
Faceless Man
Faith Militant
Faith Militant #1
Faith Militant #2
Farlen
Farmer Hamlet
Farmer's Daughter
Fennesz
Fighter
First Mate
Foreign Merchant
Frances
Frey Guard
Frey Guardsman
Frey Soldier #1
Frey Soldier #2
Frey Wedding Guest
Fruit Vendor
Gared
Gatins
Gendry
Genna
Gerald
Gerold Hightower
Ghita
Gilly
Glover General
Goatherd
Goatherd's Son
Goldcloak
Goldcloak #1
Goldcloak #2
Gordy
Grand Maester Pycelle
Great Master #1
Great Master #2
Great Master #3
Great Master #4
Great Master #5
Great Master #6
Great Master #7
Greatjon Umber
Gregor Clegane
Greizhen mo Ullhor
Grenn
Grey Worm
Guymon
Hallyne
Handmaid
Harald Karstark
Healtor Troop
High Priestess
High Septon
High Sparrow
Hizdahr zo Loraq
Hodor
Hog Farmer
Hoster Tully
Hot Pie
Howland Reed
Hugh of the Vale
Iggo
Illyrio Mopatis
Ilyn Payne
Imry Florent
Inn Waitress
Innkeeper
Innkeeper's Daughter
Ironborn #1
Ironborn #2
Ironborn #3
Ironborn Abusing a Volantene Whore
Ironborn at Brothel
Ironborn in Skiff
Irri
Izembaro
Jacks
Jaime Lannister
Janos Slynt
Jaqen H'ghar
Jaqen's Disguise
Jaremy Rykker
Jeor Mormont
Jhiqui
Joffrey Baratheon
Johnna
Jojen Reed
Jon Arryn
Jon Snow
Jon Snow Soldier
Jonos Bracken
Jorah Mormont
Jory Cassel
Joss
Joyeuse Erenford
Karl Tanner
Karsi
Karstark Lead Archer
Karstark Lookout
Karstark Soldier
Karstark Soldier #1
Karstark Soldier #2
Kayla
Kegs
Kesh
Kevan Lannister
Khal Brozho
Khal Drogo
Khal Forzho
Khal Moro
Khal Qorro
Khal Rhalko
Khaleesi Handmaiden #1
King Balon Greyjoy Dwarf
King Joffrey Baratheon Dwarf
King Renly Baratheon Dwarf
King Robb Stark Dwarf
King Stannis Baratheon Dwarf
King's Guard
King's Landing Baker
King's Landing Boaster
King's Landing Drunkard
King's Landing Flasher #1
King's Landing Flasher #2
King's Landing Handmaiden
King's Landing Rioter #1
King's Landing Rioter #2
King's Landing Rioter #3
King's Landing Tailor
King's Landing Urchin
King's Landing Whore
Kinvara
Knight of House Frey
Knight of House Lynderly
Kovarro
Kraznys mo Nakloz
Kurleket
Lady Crane
Lady Kitty Frey
Lancel Lannister
Lannister Archer
Lannister Army Member
Lannister Captain
Lannister Guard
Lannister Guard #1
Lannister Guard #2
Lannister Guard #3
Lannister Guardsman
Lannister Lord
Lannister Messenger
Lannister Scout
Lannister Soldier
Lannister Torturer
Lead Dornish Guard
Lead Kingsguard
Leaf
Lem Lemoncloak
Leo Lefford
Lhara
Little Bird
Little Bird #3
Little Bird #4
Little Bird #5
Little Bird #6
Little Bird #7
Loboda
Locke
Lollys Stokeworth
Lommy Greenhands
Loras Tyrell
Lord Blackmont
Lord Galbart Glover
Lord Portan
Lord Varys
Lord of Bones
Lordsport Dockhand
Lothar Frey
Loyal Night's Watchman #1
Loyal Night's Watchman #2
Lyanna Mormont
Lyanna Stark
Lysa Arryn
Mace Tyrell
Maester Aemon
Maester Caleotte
Maester Cressen
Maester Helliweg
Maester Luwin
Maester Wolkan
Mag the Mighty
Maggy
Mago
Male Prostitute
Malko
Mallister Supporter
Mance Rayder
Mandon Moore
Manservant
Marei
Margaery Tyrell
Margaery Tyrell Mummer
Margaery's Handmaiden
Marianne Frey
Marillion
Masha Heddle
Master Torturer
Matthos Seaworth
Meera Reed
Meereen Guard
Meereen Slave
Meereenese Homeless Mother
Melara Hetherspoon
Melessa Tarly
Melisandre
Merchant Captain
Merchant in Tavern
Mero
Merry Frey
Meryn Trant
Mhaegen
Mikken
Mirelle
Mirri Maz Duur
Missandei
Mole's Town Madam
Mole's Town Whore
Morag
Mord
Morgan
Morgan's Friend
Moro's Wife #1
Moro's Wife #2
Mossador
Mully
Mummer #2
Mummer #3
Mummer #4
Musician #1
Musician #2
Musician #3
Musician #4
Musician #5
Mycah
Myranda
Myrcella Baratheon
Night's Watch
Night's Watch Archer
Night's Watch Deserter
Night's Watch Messenger
Night's Watch Officer
Night's Watchman
Night's Watchman #1
Night's Watchman #2
Nobel Man
Noble Lady
Noble Man
Northern Lord
Northman Archer
Northman Rider
Northman Rioter
Nymeria Sand
Obara Sand
Oberyn Martell
Old Man
Old Nan
Old Woman
Old Woman Prisoner
Olenna Tyrell
Olly
Olly's Mother
Olyvar
Orell
Ornela
Orphan Kid
Osha
Othell Yarwyck
Oznak zo Pahl
Peasant
Pentoshi Servant
Petyr 'Littlefinger' Baelish
Pit Announcer
Pit Fighter
Podrick Payne
Polliver
Prendahl na Ghezn
Prisoner
Protestor
Pyat Pree
Pypar
Qartheen Woman
Qhono
Qhorin Halfhand
Qotho
Quaithe
Quent
Qyburn
Rakharo
Ralf Kenning
Ramsay Bolton
Randyll Tarly
Rast
Rattleshirt
Razdal mo Eraz
Red Keep Stableboy
Red Priestess
Reginald Lannister
Renly Baratheon
Rennick
Rhaego
Rickard Karstark
Rickard Stark
Rickon Stark
Riddell
Riverlands Traveller
Riverrun Nobleman
Robb Stark
Robert Baratheon
Robett Glover
Robin Arryn
Rodrik Cassel
Roose Bolton
Rorge
Ros
Roslin Frey
Royal Steward
Ryger Rivers
Sailor
Salladhor Saan
Samwell Tarly
Sandor 'The Hound' Clegane
Sansa Stark
Second Son
Sellsword #1
Sellsword #2
Selyse Baratheon
Septa Moelle
Septa Mordane
Septa Scolera
Septa Unella
Septon
Ser Endrew Tarth
Shae
Shagga
Shireen Baratheon
Silk King
Simpson
Singing Lannister Soldier
Sissy
Slaver
Smalljon Umber
Soldier
Son of the Harpy
Sorcerer
Sparring Boy
Spice King
Stannis Baratheon
Stark Guard
Stark Messenger
Stark Soldier
Steelshanks Walton
Steve
Stevron Frey
Stiv
Stone Man
Street Tough #1
Street Tough #2
Strong Fighter
Strong Sam Stone
Styr
Syrio Forel
Talisa Stark
Talla Tarly
Tansy
Ternesio Terys
The Bear
The Crone
The Maiden
The Mother
The Night King
The Tickler
The Waif
The Waif's Disguise
Thenn Warg
Theon Greyjoy
Theon's Master of Hounds
Thin Man
Thoros of Myr
Three-Eyed Raven
Timett
Tobho Mott
Todder
Tomard
Tommen Baratheon
Tommen's Attendant
Tommen's Manservant
Tommy
Tormund Giantsbane
Torrhen Karstark
Tortured Prisoner
Tortured Slave
Tourney Herald
Trystane Martell
Tully Bannerman
Tully Soldier
Tycho Nestoris
Tyene Sand
Tyrell Bannerman
Tyrell Guard
Tyrell Lady
Tyrell Servant
Tyrell Soldier
Tyrion Lannister
Tywin Lannister
Unsullied
Vala
Valyrian Slave
Vance Corbray
Vardis Egen
Varly
Vayon Poole
Violet
Viserys Targaryen
Volantene Whore
Volantene Whore #1
Volantene Whore #2
Volantene Whore #3
Volantene Whore #4
Volantene Whore #5
Waitress
Walda Bolton
Walder Frey
Warlock
Waymar Royce
Wedding Band
Wedding Guest
Wendel Manderly
Westerosi Trader
White Rat
White Walker
White Walker #2
Whore
Whore #1
Whore #2
Wight
Wight Wildling Girl
Wilding Gladiator
Wildling
Wildling Rioter
Will
Willa
Willem Lannister
Willis Wode
Wine Merchant
Winter Town Man
Winterfell Beekeeper
Winterfell Shepherd
Woodcutter
Wounded Lannister
Wun Wun
Wyllis
Wyman Manderly
Xaro Xhoan Daxos
Yara Greyjoy
Yezzan zo Qaggaz
Ygritte
Yohn Royce
Yoren
Young Benjen Stark
Young Braavosi
Young Cersei Lannister
Young Lyanna Stark
Young Nan
Young Ned
Young Ned Stark
Young Nobleman
Young Rodrik Cassel
Yunkai Citizen
Yunkai'i Slave #1
Yunkai'i Slave #2
Yunkai'i Slave #3
Yunkai'i Slave #4
Yunkai'i Slave #5
Yunkai'i Whore
Zanrush

1380
Dictionary/dict_House.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
Ancient Psychic Tandem War Elephant
Banana Guard
Candy Kingdom
Candy People
Choose Goose
Cinnamon Bun
City of Thieves
Colonel Candycorn
Cosmic Owl
Crab Princess
Dr. Donut
Dr. Ice Cream
Duchess of Nuts
Earl of Lemongrab
Everything Burrito
Finn the Human
Fire Kingdom
Flame Princess
Flying Lettuce Bros.
Ghost Princess
Hotdog Knight
Ice King
Ice Kingdom
Jake the Dog
Lady Rainicorn
Lake Butterscotch
Land of Ooo
Lumpy Space Princess
Marauder Village
Marshmallow Kid
Mr. Cream Puff
Muscle Princess
Nice King
Nice Knights
Nightosphere
Nurse Poundcake
Old Lady Princess
Party Pat
Peppermint Butler
Pillow World
Princess Bubblegum
Raggedy Princess
Root Beer Guy
Sir Slicer
Skeleton Princess
Slime Princess
Snow Golem
The Enchiridion
The Lich
Toast Princess
Tree Fort
Tree Trunks
Wildberry Princess
Wizard Battle

View File

@@ -0,0 +1,25 @@
Adipose
Amy Pond
Clara Oswin Oswald
Cybermen
Dalek
Davros
Donna Noble
Jack Harkness
Judoon
K-9
Martha Jones
Master
Mickey Smith
Missy
Ood
River Song
Rory Williams
Rose Tyler
Sontarans
Tardis
Time Lord
The Doctor
The Silence
Weeping Angel
Zygon

97
Dictionary/dict_glee.txt Normal file
View File

@@ -0,0 +1,97 @@
Glee Club
New Directions
Will Schuester
Sue Sylvester
Emma Pillsbury
Terri Schuester
Arthur Abrams
Artie Abrams
Tina Cohen-Chang
Brittany Pierce
Glease
Finn Hudson
Film School
Lima
Unique Adams
Vocal Adrenaline
Glee Club Regionals
Jesse St. James
Nationals
William McKinley High School
Rizzo
Grease
Ryder Lynn
Mr. Shue
Coach Shannon Beiste
Blaine Devon Anderson
Dalton Academy
The Warblers
Sectionals
NYADA
June Dolloway
Dave Karofsky
McKinley High Titans
Principal Figgins
Cooter Menkins
Roz Washington
Rachel Barbra Berry
Jesse St. James
Shelby Corcoran
Cassandra July
Brody Weston
Funny Girl
Michel Robert "Mike" Chang, Jr.
Joffrey Ballet
Asian Camp
Sam Evans
Lucy Quinn Fabray
Cheerios
Beth
Skanks
Finn Hudson
Marley Rose
Burt Hummel
Mercedes Jones
Santana Lopez
Ryder Lynn
Jake Puckerman
Noah Puckerman
Kitty Wilde
Alistair
Azimio
Jacob Ben Israel
Rory Flanagan
Joe Hart
Jane Hayward
Becky Jackson
Madison McCarthy
Sugar Motta
Myron Muskovitz
Bob Harris
Spencer Porter
Roderick
Matt Rutherford
Lauren Zizes
Jazz Ensemble
Hank Saunders
Suzy Pepper
Shane Tinsley
Rick "The Stick" Nelson
Lillian Adler
Holly Holliday
Acafellas
Sandy Ryerson
Ken Tanaka
Sunshine Corazón
Dustin Goolsby
Harmony
Grace Hitchens
Sebastian Smythe
Kendra Giardi
Carl Howell
Carole Hudson
Millie Rose
April Rhodes
Bryan Ryan

View File

@@ -0,0 +1,59 @@
Greys Anatomy
Meredith Grey
Lexie Grey
Ellis Grey
Thatcher Grey
Derek Shepherd
Amelia Shepherd
Owen Hunt
Dr. Margaret Pierce
Dr. Teddy Altman
Alex Karev
Callie Torres
Izzie Stevens
Christina Yang
Mark Sloan
Jackson Avery
Leah Murphy
April Kepner
Arizona Robbins
George O'Malley
Preston Bruke
Miranda Bailey
Denny Duquette
Dr. Addison Montgomery
Richard Webber
Adele Webber
Jo Wilson
Andrew Deluca
Nathan Riggs
Erica Hahn
Sadie Harris
Stephanie Edwards
Jason Myers
Dr. Nicole Herman
Hannah Davies
Shane Ross
Seattle Grace Hospital
Mercy West Medical Center
Seattle Grace Mercy West Hospital
Denny Duquette Memorial Clinic
Grey Sloan Memorial Hospital
Mayo Clinic
Cleveland Clinic
Portland General Hospital
Seattle Presbyterian Hospital
Klausman Institute for Medical Research
Roseridge Home for Extended Care
Veterans Rehabilitation Center
Trauma Center
Emergency Room
Intensive Care Unit
Neonatal Intensive Care Unit
Operating Room
On-Call Room
Chasing Cars
Snow Patrol

View File

@@ -0,0 +1,42 @@
Annalise Keating
Anna Mae Harkness
Nate Lahey
Wes Gibbins
Connor Walsh
Michaela Pratt
Asher Millstone
Laurel Castillo
Frank Delfino
Bonnie Winterbottom
Oliver Hampton
Rebecca Sutter
Sam Keating
Caleb Hapstall
Catherine Hapstall
Emily Sinclair
Meggy Travers
Simon Drake
Soraya Hargrove
Phillip Jessup
Eve Rothlow
Lila Stangard
Bill Millstone
A.D.A. Rene Atwood
Kan
Griffin O'Reilly
Rose
Detective Mumford
A.D.A. Todd Denver
D.A. Wendy Parks
Levi Sutter
Wallace Mahoney
Charles Mahoney
Vince Levin
Christophe
Hannah Keating
Middleton University
Keating 5
Who's Under the Sheet
Keating House
HTGAWM
pro-bono law clinic

View File

@@ -0,0 +1,11 @@
Dev
Rachel
Go-Gurt
Arnold
Brian
Denise
The Sickening
Nina
Nashville
Paro
Benjamin

View File

@@ -0,0 +1,36 @@
Elliot Alderson
Mr. Robot
Darlene
Angela Moss
Tyrell Wellick
Joanna Wellick
Phillip Price
Federal Bureau of Investigation
Fun Society
Gideon Goddard
Lloyd Chung
Ollie Parker
E Corp
Evil Corp
Terry Colby
Scott Knowles
Sharon Knowles
Mr. Sutherland
Antara Nayar
Krista Gordon
Shayla Nico
Fernando Vera
Elliot's Mother
The Hackers
fsociety
Romero
Trenton
Mobley
The Dark Army
Whiterose
Cisco
New York
Evil Corp Headquarters
Allsafe Cybersecurity
Rons Coffee
Python

View File

@@ -0,0 +1,11 @@
Jess
Jessica Day
Nick Miller
Winston Bishop
Schmidt
Cece Parekh
Coach
Latvian Basketball League
Ferguson
True American
Los Angeles middle school

View File

@@ -0,0 +1,59 @@
Sense8
Abraham
Amanita
Amondi Kabaka
Angelica Turing
Anton Bogdanow
Bug
Capheus "Van Damme"
Daniela Velasquez
Daya Dandekar
Diego Morales
Dr. Metzger
Felix Berner
Githu
Grace
Gunnar
Hassan Bogdanow
Hernando
Jacks
Janet Marks
Jela
Joaquin Flores
Jonas Maliki
Joong-Ki Bak
Kala Dandekar
Kang-Dae Bak
Wolfgang Bogdanow
Lina
Lito Rodriguez
Lúna Magnúsdóttir
Magnús Þórsson
Manendra Rasal
Mi-Cha
Michael Gorski
Min-Jung
Mr. Whispers
Niles Bolger
Nomi Marks
Nyx
Prisoner 818
Priya Dandekar
Purab Kohli
Rajan Rasal
Riley Blue
Sahana Rasal
Sanyam Dandekar
Sanyam Dendekar
Sara Patrell
Sergei Bogdanow
Shiro
Silas Kabaka
Soo-Jin
Steiner Bogdanow
Sun Bak
Sven
Teagan Marks
Will Gorski
Yrsa
Sensates

View File

@@ -0,0 +1,37 @@
Ajay
Alex
Anderson
Baker Street
Bill Wiggins
Charles Augustus Magnussen
Charlie Welsborough
Detective Inspector Lestrade
Gabriel
Greg Lestrade
Irene Adler
James Moriarty
Jim Moriarty
John Watson
John Hamish Watson
Karim
Lady Smallwood
Lestrade
Magnussen
Margaret Thatcher
Mary Morstan
Mary Watson
Mike Stamford
Molly Hooper
Moriarty
Mrs. Hudson
Mycroft Holmes
Norbury
Philip Anderson
Rosamund Mary
Rosie
Sally Donovan
Samarra
Sergeant Donovan
Sherlock Holmes
Tbilisi
Vivian Norbury

42
Dictionary/dict_smash.txt Normal file
View File

@@ -0,0 +1,42 @@
Smash
Julia Houston
Derek Wills
Karen Cartwright
Tom Levitt
Ivy Lynn
Eileen Rand
Jimmy Collins
Sam Strickland
Kyle Bishop
Ana Vargas
Ellis Boyd
Dev Sundaram
Frank Houston
Lyle West
Leigh Conroy
Rebecca Duvall
Veronica Moore
Terrence Falls
Linda
Lisa McMann
Roger Cartwright
Mrs. Cartwright
Jerry Rand
Leo Houston
Bobby
Dennis
Jessica
Sue
Nick Felder
Michael Swift
John Goodwin
Daisy Parker
R.J.
Monica Swift
Scott Nichols
Margot
Agnes
Bombshell
Hit List
Heaven on Earth
Liaisons

View File

@@ -0,0 +1,41 @@
Arachne
Arachnophobia
Asura
Azusa
Black Star
Blair
Crona
Death City
Death the Kid
Death Weapon Meister Academy
DWMA
Eibon
Eruka
Excalibur
Franken Stein
Free
Giriko
Joe Buttataki
Justin
Kilik
Kishin
Liz
Lord Death
Maka
Maka Albarn
Marie
Masamune
Medusa
Meister
Mifune
Mizune
Mosquito
Ox Ford
Patty
Professor Stein
Sid
Soul
Soul Eater
Spirit
Tsubaki
Weapon

View File

@@ -0,0 +1,16 @@
Amethyst
Beach City
Cookie Cat
Crying Breakfast Friends
Crystal Gems
Crystal Temple
Earthlings
Fryman
Garnet
Lion
Pearl
Peridot
Rose Quartz
Ruby
Sapphire
Steven Universe

View File

@@ -0,0 +1,84 @@
Stranger Things
Murray Bauman
Becky Ives
Benny Hammond
Bill
Billy
Martin Brenner
Jonathan Byers
Joyce Byers
Lonnie Byers
Will Byers
Callahan
Carol
Russell Coleman
Connie Frazier
Cynthia
Dark dimension creature
David O'Bannon
Diane
Donald Melvald
Earl
Eel-like creature
Elevator Scientist
Eleven
El
011
The Weirdo
Eleanor
Florence
Tommy H.
Steve Harrington
Dustin Henderson
Barbara Holland
Jim Hopper
Sarah Hopper
James
Jeffrey
Jen
Jennifer Hayes
Lead Agent
Marissa
Max
The Monster
Mrs. Holland
Bob Newby
Nicole
Dr. Owens
Pastor Charles
Patrick
Powell
Roman
Russian Agent
Sandra
Scott Clarke
Shepard
Lucas Sinclair
Slug-like creature
Terry Ives
Troy
Troy's mother
Holly Wheeler
Karen Wheeler
Mike Wheeler
Nancy Wheeler
Ted Wheeler
Demogorgon
Hawkins National Laboratory
Upside Down
Hawkins Middle School
Project MKUltra
Dungeons & Dragons
Operation Mirkwood
Heathkit ham shack
Castle Byers
Hawkins General Hospital
Hawkins Police Station
Hawkins High School
Quarry
Etowah
Benny's Burgers
Bradley's Big Buy
Byers house
Downtown Hawkins
Roane County Coroner

View File

@@ -0,0 +1,30 @@
The Big Bang Theory
Penny
Leonard Hofstadter
Sheldon Cooper
Raj Koothrappali
Bernadette Rostenkowski
Howard Wolowitz
Amy Farrah Fowler
Leslie Winkle
Stuart Bloom
Arthur Jeffries
Mrs. Wolowitz
Barry Kripke
Priya Koothrappali
Mrs. Koothrappali
Mr. Koothrappali
Lucy
Sheldons Spot
The Apartment Building
Apartment 4A/B
The Laundry Room
The Roof
Wolowitzs' House
Capitol Comics
The Cheesecake Factory
The Comic Center of Pasadena
California Institute of Technology
Massachusetts Institute of Technology
Jet Propulsion Laboratory
Pasadena

View File

@@ -0,0 +1,23 @@
Arsenal Football Club
Aunt Irma
Big Ben
Countdown
Dragon's Den
Emergency Services
Employee of the Month
Friendface
Gay: A Gay Musical
Information Technology
Jen Barber
Lonely Hearts
Maurice Moss
Random Access Memory
Sea Parks
Spaceology
The Banner
The Evening Informer
The Internet
The London Echo
Tnetennba
Windows Vista
Word

View File

@@ -0,0 +1,37 @@
Neal Caffrey
Mozzie
Peter Burke
Sara Ellis
Elizabeth Burke
Diana Berrigan
Lauren Cruz
Clinton Jones
Kate Moreau
Garrett Fowler
Alex Hunter
Vincent Adler
Special Agent
White Collar Division
June Ellington
Reese Hughes
Matthew Keller
Rebecca Lowe
Rachel Turner
Cindy
Christie
Senator Terrence Pratt
Amanda Callaway
David Siegel
Operation Mentor
Office of Professional Responsibility
Samantha
Sterling-Bosch
Kali
Teddy Winters
Detroit Mob
Burke's Seven
Mrs. Suit
Special Agent in Charge
Satchmo
Dutchman

View File

@@ -4,7 +4,7 @@ MAINTAINER = Marc Espie <espie@openbsd.org>
CATEGORIES = multimedia
COMMENT = closed caption subtitles extractor
HOMEPAGE = http://ccextractor.sourceforge.net/
V = 0.70
V = 0.77
DISTFILES = ccextractor.${V:S/.//}-src.zip
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=ccextractor/}
DISTNAME = ccextractor-$V

View File

@@ -1,21 +1,68 @@
ccextractor
===========
![logo](https://avatars3.githubusercontent.com/u/7253637?v=3&s=100)
# CCExtractor
CCExtractor - Carlos' version (mainstream).
CCExtractor is a tool that produces subtitles from TV use. Global accessibility (all users, all content, all countries) is the goal. With so many different formats, this is a constantly moving target, but we intend to keep up with all sources and formats.
0.70 - GSOC
-----------
This is the first release that is part of Google's Summer of Code.
Anshul, Ruslan and Willem joined CCExtractor to work on a number of things
over the summer, and their work is already reaching the mainstream
version of CCExtractor.
Carlos' version (mainstream) is the most stable branch.
- Added a huge dictionary submitted by Matt Stockard.
- Added DVB subtitles decoder, spupng in output
- Added support for cdt2 media atoms in QT video files. Now multiple atoms in
a single sample sequence are supported.
- Changed Makefile.
- Fixed some bugs.
- Added feature to print info about file's subtitles and streams.
- Support Long PMT.
- Support Configuration file.
## Installation and Usage
Downloads for precompiled binaries and source code can be found [on our website](http://www.ccextractor.org/doku.php?id=public:general:downloads).
Extracting subtitles is relatively simple. Just run the following command:
```ccextractor <input>```
This will extract the subtitles.
More usage information can be found on our website:
- [Using the command line tool](http://www.ccextractor.org/doku.php?id=public:general:command_line_usage)
- [Using the Windows GUI](http://www.ccextractor.org/doku.php?id=public:general:win_gui_usage)
## Compiling
### Debian/Ubuntu
Install these packages in the terminal
sudo apt-get install -y gcc
sudo apt-get install -y libcurl4-gnutls-dev
sudo apt-get install -y tesseract-ocr
sudo apt-get install -y tesseract-ocr-dev
sudo apt-get install -y libleptonica-dev
Then run script linux/build or linux/builddebug.
### Windows
Open the windows/ccextractor.sln file with Visual Studio (2015 at least), and build it. Configurations "(Debug|Release)-Full" includes dependent libraries which are used for OCR.
## Support
By far the best way to get support is by opening a support ticket at our [issue tracker](https://github.com/CCExtractor/ccextractor/issues).
When creating a ticket:
- Make sure you are using the latest CCExtractor version.
- If it's a new issue (for example a video file that a previous CCExtractor version processed fine but now causes a crash), mention the last version you know was working.
- If the issue is about a specific file, make that file available for us. Don't just send us the output from CCExtractor, as we can't do anything about a screenshot that shows a crash. We need the input that actually causes it. You can upload the file to Dropbox, Google Drive, etc, and make it public so you get a download link to add to your ticket.
- If you cannot make the file public for any (reasonable) reason you can send us a private invitation (both Dropbox and Google Drive allow that). In this case we will download the file and upload it to the private developer repository.
- Do not upload your file to any location that will require us to sign up or endure a wait list, slow downloads, etc.
- If your upload expires make sure you keep it active somehow (replace links if needed). Keep in mind that while we go over all tickets some may take a few days, and it's important we have the file available when we actually need it.
- Make sure you set an alert in GitHub so you get notifications about your ticket. We may need to ask questions and we do everything inside GitHub's system.
- Please use English.
- It goes without saying, we like polite people.
You can also [contact us by email or chat with the team in Slack](http://www.ccextractor.org/doku.php?id=public:general:support).
## Contributing
You can contribute to the project by forking it, modifying the code, and making a pull request to the repository.
## News & Other Information
News about releases and modifications to the code can be found in the `CHANGES.TXT` file.
For more information visit the CCExtractor website: [http://www.ccextractor.org](http://www.ccextractor.org)

16
Vagrantfile vendored Normal file
View File

@@ -0,0 +1,16 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
# Uncomment this line if you want to sync other folders
# config.vm.synced_folder "/home/user/video", "/video"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y gcc
sudo apt-get install -y libcurl4-gnutls-dev
sudo apt-get install -y tesseract-ocr
sudo apt-get install -y tesseract-ocr-dev
sudo apt-get install -y libleptonica-dev
SHELL
end

View File

@@ -28,4 +28,17 @@ To do:
CCExtractor fully support Asian languages. I do need samples
though. No samples, no support.
- A few commands are not yet supported, specifically those related
to delay.
to delay.
- Detect and extract captions from MP4 (MOV) files, handled by gpacmp4
Done (18.08.2015):
- Major refactoring
- Librarized as much as possible (global vars moved to dtvcc context)
- Added some control commands support
- 16 bit charset support added (not "moved everything to 16-bit", but they could be successfully exported)
- SAMI output added
- Transcript output added
- Timed transcript output added
- Added colour support (only one colour/style can be applied for the whole screen at the moment)
- Roll up captions handling

View File

@@ -1,5 +1,206 @@
0.70 - GSOC
-----------
0.85b (2017-1-26)
-----------------
- Fix: Base Windows binary (without OCR) compiled without DLL dependencies.
0.85 (2017-01-23)
-----------------
- New: Added FFMPEG 3.0 to Windows build - last one that is XP compatible.
- New: Major improvements in CEA-608 to WebVTT (styles, etc).
- New: Return a non-zero return code if no subtitles are found.
- New: Windows build files updated to Visual Studio 2015, new target platform is 140_xp.
- New: Added basic support of Tesseract 4.0.0.
- New: Added build script for .deb.
- New: Updated -debugdvbsub parameter to get the most relevant DVB traces for debugging.
- New: SMPTE-TT files are now compatible with Adobe Premiere.
- New: Updated libpng.
- New: Added 3rd party (Tracy from archive.org) static linux build script.
- New: Add chapter extraction for MP4 files.
- New: Return code 10 if no captions are found at all.
- Fix: Teletext duplicate lines in certain cases.
- Fix: Improved teletext timing.
- Fix: DVB timing is finally good.
- Fix: A few minor memory leaks.
- Fix: tesseract library file included in mac build command.
- Fix: Bad WTV timings in some cases.
- Fix: Mac build script.
- Fix: Memory optimization in HARDSUBX edit_distance.
- Fix: SubStation Alpha subtitles in bitmap.
- Fix: lept msg severity in linux.
- Fix: SSA, SPUPNG and VTT timing and skipping of subtitles for SAMI and TTML.
- Fix: SMPTE-TT : Added support for font color.
- Fix: SAMI unnecessary empty subtitle when extracting DVB subs.
- Fix: Skip the packet if the adaptation field length is broken.
- Fix: 708 - lots of work done in the decoder. Implementation of more commands. Better timing.
0.84 (2016-12-16)
-----------------
- New: In Windows, both with and without-OCR binaries are bundled, since the OCR one causes problems due to
dependencies in some system. So unless you need the OCR just use the non-OCR version.
- New: Added -sbs (sentence by sentence) for DVB output. Each frame in the output file contains a complete
sentence (experimental).
- New: Added -curlposturl. If used each output frame will be sent with libcurl by doing a POST to that URL.
- Fix: More code consistency checking in function names.
- Fix: linux build script now tries to verify dependencies.
- Fix: Mac build script was missing a directory.
0.83 (2016-12-13)
-----------------
- Fix: Duplicate lines in mp4 (specifically affects itunes).
- Fix: Timing in .mp4, timing now calculated for each CC pair instead of per atom.
- Fix: Typos everywhere in the documentation and source code.
- Fix: CMakeLists for build in cmake.
- Fix: -unixts option.
- Fix: FPS switching messages.
- Fix: Removed ugly debug statement with local path in HardsubX.
- Fix: Changed platform target to v120_xp in Visual Studio (so XP is supported again).
- Fix: Added detail in many error messages.
- Fix: Memory leaks in videos with XDS.
- Fix: Makefile compatibility issues with Raspberry pi.
- Fix: missing separation between WebVTT header and body.
- Fix: Stupid bug in M2TS that preventing it from working.
- Fix: OCR libraries dependencies for the release version in Windows.
- Fix: non-buffered reading from pipes.
- Fix: --stream option with stdin.
- New: terminate_asap to buffered_read_opt
- New: Added some TV-show specific spelling dictionaries.
- New: Updated GPAC library.
- New: ASS/SSA.
- New: Capture sigterm to do some clean up before terminating.
- New: Work on 708: Changed DefineWindow behavior, only clear text of an existing window is style has changed.
0.82 (2016-08-15)
-----------------
- New: HardsubX - Burned in subtitle extraction subsystem.
- New: Color Detection in DVB Subtitles
- Fix: Corrected sentence capitalization
- Fix: Skipping redundant bytes at the end of tx3g atom in MP4
- Fix: Illegal SRT files being created from DVB subtitles
- Fix: Incorrect Progress Display
0.81 (2016-06-13)
-----------------
- New: --version parameter for extensive version information (version number, compile date, executable hash, git commit (if appropriate))
- New: Add -sem (semaphore) to create a .sem file when an output file is open and delete it when it's closed.
- New: Add --append parameter. This will prevent overwriting of existing files.
- New: File Rotation support added. The user has to send a USR1 signal to rotate.
- Fix: Issues with files <1 Mb
- Fix: Preview of generated transcript.
- Fix: Statistics were not generated anymore.
- Fix: Correcting display of sub mode and info in transcripts.
- Fix: Teletext page number displayed in -UCLA.
- Fix: Removal of excessive XDS notices about aspect ratio info.
- Fix: Force Flushing of file buffers works for all files now.
- Fix: mp4 void atoms that was causing some .mp4 files to fail.
- Fix: Memory usage caused by EPG processing was high due to many non-dynamic buffers.
- Fix: Project files for Visual Studio now include OCR support in Windows.
0.80 (2016-04-24)
-----------------
- Fix: "Premature end of file" (one of the scenarios)
- Fix: XDS data is always parsed again (needed to extract information such as program name)
- Fix: Teletext parsing: @ was incorrectly exported as * - X/26 packet specifications in ETS 300 706 v1.2.1 now better followed
- Fix: Teletext parsing: Latin G2 subsets and accented characters not displaying properly
- Fix: Timing in -ucla
- Fix: Timing in ISDB (some instances)
- Fix: "mfra" mp4 box weight changed to 1 (this helps with correct file format detection)
- Fix: Fix for TARGET File is null.
- Fix: Fixed SegFaults while parsing parameters (if mandatory parameter is not present in -outinterval, -codec or -nocodec)
- Fix: Crash when input small is too small
- Fix: Update some URLs in code (references to docs)
- Fix: -delay now updates final timestamp in ISDB, too
- Fix: Removed minor compiler warnings
- Fix: Visual Studio solution files working again
- Fix: ffmpeg integration working again
- New: Added --forceflush (-ff). If used, output file descriptors will be flushed immediately after being written to
- New: Hexdump XDS packets that we cannot parse (shouldn't be many of those anyway)
- New: If input file cannot be open, provide a decent human readable explanation
- New: GXF support
0.79 (2016-01-09)
-----------------
- Support for Grid Format (g608)
- Show Correct number of teletext packet processed
- Removed Segfault on incorrect mp4 detection
- Remove xml header from transcript format
- Help message updated for Teletext
- Added --help and -h for help message
- Added --nohtmlescape option
- Added --noscte20 option
0.78 (2015-12-12)
-----------------
- Support to extract Closed Caption from MultiProgram at once.
- CEA-708: exporting to SAMI (.smi), Transcript (.txt), Timed Transcript (ttxt) and SubRip (.srt).
- CEA-708: 16 bit charset support (tested on Korean).
- CEA-708: Roll Up captions handling.
- Changed TCP connection protocol (BIN data is now wrapped in packets, added EPG support and keep-alive packets).
- TCP connection password prompt is removed. To set connection password use -tcppassword argument instead.
- Support ISDB Closed Caption.
- Added a new output format, simplexml (used internally by a CCExtractor user, may or may not be useful for
anyone else).
0.77 (2015-06-20)
-----------------
- Fixed bug in capitalization code ('I' was not being capitalized).
- GUI should now run in Windows 8 (using the include .Net runtime, since
3.5 cannot be installed in Windows 8 apparently).
- Fixed Mac build script, binary is now compiled with support for
files over 2 GB.
- Fixed bug in PMT code, damaged PMT sections could make CCExtractor
crash.
0.76 (2015-03-28)
-----------------
- Added basic M2TS support
- Added EPG support - you can now export the Program Guide to XML
- Some bug fixes
0.75 (2015-01-15)
-----------------
- Fixed issue with teletext to other then srt.
- CCExtractor can be used as library if compiled using cmake
- By default the Windows version adds BOM to generated UTF files (this is
because it's needed to open the files correctly) while all other
builds don't add it (because it messes with text processing tools).
You can use -bom and -nobom to change the behaviour.
0.74 (2014-09-24)
-----------------
- Fixed issue with -o1 -o2 and -12 parameters (where it would write output only in the o2 file)
- Fixed UCLA parameter issue. Now the UCLA parameter settings can't be overwritten anymore by later parameters that affect the custom transcript
- Switched order around for TLT and TT page number in custom transcript to match UCLA settings
- Added nobom parameter, for when files are processed by tools that can't handle the BOM. If using this, files might be not readable under windows.
- Segfault fix when no input files were given
- No more bin output when sending to server + possibility to send TT to server for processing
- Windows: Added the Microsoft redistributable MSVCR120.DLL to both the installation package and the application zip.
0.73 - GSOC (2014-08-19)
------------------------
- Added support of BIN format for Teletext
- Added start of librarization. This will allow in the future for other programs to use encoder/decoder functions and more.
0.72 - GSOC (2014-08-12)
------------------------
- Fix for WTV files with incorrect timing
- Added support for fps change using data from AVC video track in a H264 TS file.
- Added FFMpeg Support to enable all encapsulator and decoder provided by ffmpeg
0.71 - GSOC (2014-07-31)
------------------------
- Added feature to receive captions in BIN format according to CCExtractor's own
protocol over TCP (-tcp port [-tcppassword password])
- Added ability to send captions to the server described above or to the
online repository (-sendto host[:port])
- Added -stdin parameter for reading input stream from standard input
- Compilation in Cygwin using linux/Makefile
- Fix for .bin files when not using latin1 charset
- Correction of mp4 timing, when one timestamp points timing of two atom
0.70 - GSOC (2014-07-06)
------------------------
This is the first release that is part of Google's Summer of Code.
Anshul, Ruslan and Willem joined CCExtractor to work on a number of things
over the summer, and their work is already reaching the mainstream
@@ -28,7 +229,7 @@ version of CCExtractor.
- Display end time
- Display caption mode
- Display caption channel
- Use a relative timestamp ( relative to the sample)
- Use a relative timestamp (relative to the sample)
- Display XDS info
- Use colors
Examples:
@@ -37,9 +238,10 @@ version of CCExtractor.
1111001 is the default setting for -ucla
Make sure you use this parameter after others that might affect these
settings (-out, -ucla, -xds, -txt, -ttxt, ...)
- Fixed Negative timing Bug
0.69
----
0.69 (2014-04-05)
-----------------
- A few patches from Christopher Small, including proper support
for multiple multicast clients listening on the same port.
- GUI: Fixed teletext preview.
@@ -58,8 +260,8 @@ version of CCExtractor.
- Windows GUI: Some code refactoring, since the HDHomeRun support makes
the code larger enough to require more than one source file :-)
0.68
----
0.68 (2013-12-24)
-----------------
- A couple of shared variables between 608 decoders were causing
problems when both fields were processed at the same time with
-12, fixed.
@@ -73,14 +275,14 @@ version of CCExtractor.
(Heleen Buus).
- Some fixes (Chris Small).
0.67
----
0.67 (2013-10-09)
-----------------
- Padding bytes were being discarded early in the process in 0.66,
which is convenient for debugging, but it messes with timing in
.raw, which depends on padding. Fixed.
- MythTV's branch had a fixed size buffer that could not be enough
some times. Made dynamic.
- Better support for PAT changing mid stream.
- Better support for PAT changing mid-stream.
- Removed quotes in Start in .smi (format fix).
- Added multicast support (Chris Small)
- Added ability to select IP address to bind in UDP (Chris Small)
@@ -94,8 +296,8 @@ version of CCExtractor.
roll-up mode.
0.66
----
0.66 (2013-07-01)
-----------------
- Fixed bug in auto detection code that triggered a message
about file being auto of sync.
- Added -investigate_packets
@@ -110,10 +312,10 @@ version of CCExtractor.
their PMT entry.
- Added -datastreamtype to manually selecting a stream based on
its type instead of its PID. Useful if your recording program
always hides the caption under the stream stream type.
always hides the caption under the stream type.
- Added -streamtype so if an elementary stream is selected manually
for processing the streamtype can be selected too. This can be
needed if you process for example a stream that is declared as
for processing, the streamtype can be selected too. This can be
needed if you process, for example a stream that is declared as
"private MPEG" in the PMT, so CCExtractor can't tell what it is.
Usually you'll want -streamtype 2 (MPEG video) or -streamtype 6
(MPEG private data).
@@ -122,10 +324,10 @@ version of CCExtractor.
- Fixes in roll-up, cursor was being moved to column 1 if a
RU2, RU3 or RU4 was received even if already in roll-up mode.
- Added -autoprogram. If a multiprogram TS is processed and
-autoprogram is used CCExtractor will analyze all PMTs and use
-autoprogram is used, CCExtractor will analyze all PMTs and use
the first program that has a suitable data stream.
- Timed transcript (ttxt) now also exports the caption mode
(roll-up, paint-on, etc) next to each line, as it's useful to
(roll-up, paint-on, etc.) next to each line, as it's useful to
detect things like commercials.
- Content Advisory information from XDS is now decoded if it's
transmitted in "US TV parental guidelines" or "MPA".
@@ -173,8 +375,8 @@ version of CCExtractor.
- Added -noautotimeref: Prevent UTC reference from being auto set from
the stream data.
0.65
----
0.65 (2013-03-14)
-----------------
- Minor GUI changes for teletext
- Added end timestamps in timed transcripts
- Added support for SMPTE (patch by John Kemp)
@@ -192,8 +394,8 @@ version of CCExtractor.
display their contents (-parsePAT and -parsePMT) which makes
troubleshooting easier.
0.64
----
0.64 (2012-10-29)
-----------------
- Changed Window GUI size (larger).
- Added Teletext options to GUI.
- Added -teletext to force teletext mode even if not detected
@@ -213,8 +415,8 @@ version of CCExtractor.
- Added --nogoptime to force PTS timing even when CCExtractor would
use GOP timing otherwise.
0.63
----
0.63 (2012-08-17)
-----------------
- Telext support added, by integrating Petr Kutalek's telxcc. Integration is
still quite basic (there's equivalent code from both CCExtractor and
telxcc) and some clean up is needed, but it works. Petr has announced that
@@ -222,8 +424,8 @@ version of CCExtractor.
CCExtractor.
- Some bug fixes, as usual.
0.62
----
0.62 (2012-05-23)
-----------------
- Corrected Mac build "script" (needed to add GPAC includes). Thanks to the
Mac users that sent this.
- Hauppauge mode now uses PES timing, needed for files that don't have
@@ -245,8 +447,8 @@ version of CCExtractor.
or certain samples (we had none like this in our test collection). Thanks,
Rajesh.
0.61
----
0.61 (2012-03-08)
-----------------
- Fix: GCC 3.4.4 can now build CCExtractor.
- Fix: Damaged TS packets (those that come with 'error in transport' bit
on) are now skipped.
@@ -256,8 +458,8 @@ version of CCExtractor.
anything but please report).
- Some non-interesting cleanup.
0.60
----
0.60 (unreleased)
-----------------
- Add: MP4 support, using GPAC (a media library). Integration is currently
"enough so it works", but needs some more work. There's some duplicate
code, the stream must be a file (no streaming), etc.
@@ -267,8 +469,8 @@ version of CCExtractor.
roll-up) was broken, with complete lines being missing.
- Fix: bin format not working as input.
0.59
----
0.59 (2011-10-07)
-----------------
- More AVC/H.264 work. pic_order_cnt_type != 0 will be processed now.
- Fix: Roll-up captions with interruptions for Text (with ResumeTextDisplay
in the middle of the caption data) were missing complete lines.
@@ -296,8 +498,8 @@ version of CCExtractor.
- Some code clean up, minor refactoring.
- Teletext detection (not yet processing).
0.58
----
0.58 (2011-08-21)
-----------------
- Implemented new PTS based mode to order the caption information
of AVC/H.264 data streams. The old pic_order_cnt_lsb based method
is still available via the -poc or --usepicorder command switches.
@@ -321,18 +523,18 @@ version of CCExtractor.
output are processed OK.
- Updated Windows GUI.
0.57
----
- Bugfixes in the Windows version. Some debug code was unintentionally
0.57 (2010-12-16)
-----------------
- Bug fixes in the Windows version. Some debug code was unintentionally
left in the released version.
0.56
----
0.56 (2010-12-09)
-----------------
- H264 support
- Other minor changes a lot less important
0.55
----
0.55 (2009-08-09)
-----------------
- Replace pattern matching code with improved parser for MPEG-2 elementary
streams.
- Fix parsing of ReplayTV 5000 captions.
@@ -347,11 +549,11 @@ version of CCExtractor.
because of the odd number of fields. I used top_field_first to tell when the channels
are reversed. See Table 6-1 of the SCTE 20 [Paul Fernquist]
0.54
----
0.54 (2009-04-16)
-----------------
- Add -nosync and -fullbin switches for debugging purposes.
- Remove -lg (--largegops) switch.
- Improve syncronization of captions for source files with
- Improve synchronization of captions for source files with
jumps in their time information or gaps in the caption
information.
- [R. Abarca] Changed Mac script, it now compiles/link
@@ -361,8 +563,8 @@ version of CCExtractor.
- Added a feature to add start and end messages (for credits).
See help screen for details.
0.53
----
0.53 (2009-02-24)
-----------------
- Force generated RCWT files to have the same length as source file.
- Fix documentation for -startat / -endat switches.
- Make -startat / -endat work with all output formats.
@@ -388,17 +590,17 @@ version of CCExtractor.
it (there's not .NET 3.5 for Windows 2000), as
requested by a couple of key users.
0.51
----
0.51 (unreleased)
-----------------
- Removed -autopad and -goppad, no longer needed.
- In preparation to a new binary format we have
renamed the current .bin to .raw. Raw files
have only CC data (with no header, timing, etc).
have only CC data (with no header, timing, etc.).
- The input file format (when forced) is now
specified with
-in=format
such as -in=ts, -in=raw, -in=ps ...
The old switches (-ts, -ps, etc) still work.
The old switches (-ts, -ps, etc.) still work.
The only exception is -bin which has been removed
(reserved for the new binary format). Use
-in=raw to process a raw file.
@@ -414,14 +616,14 @@ version of CCExtractor.
too.
- [Volker] Dish Network clean-up
0.50
----
0.50 (2008-12-12)
-----------------
- [Volker] Fix in DVR-MS NTSC timing
- [Volker] More clean-up
- Minor fixes
0.49
----
0.49 (2008-12-10)
-----------------
- [Volker] Major MPEG parser rework. Code much
cleaner now.
- Some stations transmit broken roll-up captions,
@@ -436,11 +638,11 @@ version of CCExtractor.
is broken please let me know.
- Added new debug options.
- [Volker] Added support for DVR-MS NTSC files.
- Other minor bugfixes and changes.
- Other minor bug fixes and changes.
0.46
----
- Added support for live streaming, ccextractor
0.46 (2008-11-24)
-----------------
- Added support for live streaming, CCExtractor
can now process files that are being recorded
at the same time.
@@ -452,14 +654,13 @@ version of CCExtractor.
Note: For now, it's only ATSC recordings, not
NTSC (analog) recordings.
0.45
----
- Added autodetection of DVR-MS files.
0.45 (2008-11-14)
-----------------
- Added auto-detection of DVR-MS files.
- Added -asf to force DVR-MS mode.
- Added some specific support for DVR-MS
files. These format used to work
correcty in 0.34 (pure luck) but the
correctly in 0.34 (pure luck) but the
MPEG code rework broke it. It should
work as it used to.
- Updated Windows GUI to support the
@@ -474,8 +675,8 @@ version of CCExtractor.
need ccextractor to use GOP timing in large
GOPs.
0.44
----
0.44 (2008-09-10)
-----------------
- Added an option to the GUI to process
individual files in batch, i.e. call
ccextractor once per file. Use it if you
@@ -483,28 +684,28 @@ version of CCExtractor.
in one go.
- Added an option to prevent duplicate
lines in roll-up captions.
- Several minor bugfixes.
- Several minor bug fixes.
- Updated the GUI to add the new options.
0.43
----
0.43 (2008-06-20)
-----------------
- Fixed a bug in the read loop (no less)
that caused some files to fail when
reading without buffering (which is
the default in the linux build).
the default in the Linux build).
- Several improvements in the GUI, such as
saving current options as default.
0.42
----
0.42 (2008-06-17)
-----------------
- The option switch "-transcript" has been
changed to "--transcript". Also, "-txt"
has been added as the short alias.
- Windows GUI
- Updated help screen
0.41
----
0.41 (2008-06-15)
-----------------
- Default output is now .srt instead of .bin,
use -raw if you need the data dump instead of
.srt.
@@ -514,17 +715,17 @@ version of CCExtractor.
deaf people know if the person talking is
at the left or the right of the screen, i.e.
there aren't useless. But if they annoy
you go ahead...
you, go ahead...
0.40
----
0.40 (2008-05-20)
-----------------
- Fixed a bug in the sanity check function
that caused the Myth branch to abort.
- Fixed the OSX build script, it needed a
new #define to work.
0.39
----
0.39 (2008-05-11)
-----------------
- Added a -transcript. If used, the output will
have no time information. Also, if in roll-up
mode there will be no repeated lines.
@@ -533,7 +734,7 @@ version of CCExtractor.
- Fixed a bug in the CC decoder that could cause
the first line not to be cleared in roll-up
mode.
- ccextractor can now follow number sequences in
- CCExtractor can now follow number sequences in
file names, by suffixing the name with +.
For example,
@@ -557,20 +758,20 @@ version of CCExtractor.
join the subs), use -ve.
0.36
----
0.36 (unreleased)
-----------------
- Fixed bug in SMI, nbsp was missing a ;.
- Footer for SAMI files was incorrect (<body> and
<sami> tags were being opened again instead of
being closed).
- Displayed memory is now written to disk at end
of stream even if there is no command requesting
so (may prevent losing the last screenful).
so (may prevent losing the last screen-full).
- Important change that could break scripts, but
that have been added because old behaviour was
annoying to most people: _1 and _2 at the end
of the output file names is now added ONLY if
-12 is used (ie when there are two output
-12 is used (i.e. when there are two output
files to produce). So
ccextractor -srt sopranos.mpg
@@ -588,8 +789,8 @@ version of CCExtractor.
as usual.
0.35
----
0.35 (unreleased)
-----------------
- Added --defaultcolor to the help screen. Code
was already in 0.34 but the documentation wasn't
updated.
@@ -598,8 +799,8 @@ version of CCExtractor.
- At the end of the process, a ratio between
video length and time to process is displayed.
0.34
----
0.34 (2007-06-03)
-----------------
- Added some basic letter case and capitalization
support. For captions that broadcast in ALL
UPPERCASE (most of them), ccextractor can now
@@ -650,8 +851,8 @@ version of CCExtractor.
Number (0.0.0.34 in this version) in case
you want to check for version info.
0.33
----
0.33 (unreleased)
-----------------
- Added -scr or --screenfuls, to select the
number of screenfuls ccextractor should
write before exiting. A screenful is
@@ -670,9 +871,9 @@ version of CCExtractor.
Use -nofc or --nofontcolor if you don't
want these tags.
0.32
----
- Added -delay ms, which adds (or substracts)
0.32 (unreleased)
-----------------
- Added -delay ms, which adds (or subtracts)
a number of milliseconds to all times in
.srt/.sami files. For example,
@@ -683,15 +884,15 @@ version of CCExtractor.
-delay -400
causes all substitles to appear 400 ms before
causes all subtitles to appear 400 ms before
they would normally do.
- Added -startat at -endat which lets you
select just a portion of data to be processed,
such as from minute 3 to minute 5. Check
help screen for exact syntax.
0.31
----
0.31 (unreleased)
-----------------
- Added -dru (direct rollup), which causes
roll-up captions to be written as
they would on TV instead of line by line.
@@ -699,20 +900,20 @@ version of CCExtractor.
and ugly too (each line is written many
times, two characters at time).
0.30
----
0.30 (2007-05-24)
-----------------
- Fix in extended char decoding, I wasn't
replacing the previous char.
- When a sequence code was found before
having a PTS, reported time was
undefined.
0.29
----
- Minor bugfix.
0.29 (unreleased)
-----------------
- Minor bug fix.
0.28
----
0.28 (unreleased)
-----------------
- Fixed a buffering related issue. Short version,
the first 2 Mb in non-TS mode were being
discarded.
@@ -721,20 +922,20 @@ version of CCExtractor.
they are not part of the .srt "standard"
even if McPoodle add them.
0.27
----
- Modified sanitizing code, it's less aggresive
0.27 (unreleased)
-----------------
- Modified sanitizing code, it's less aggressive
now. Ideally it should mean that characters
won't be missed anymore. We'll see.
0.26
----
0.26 (unreleased)
-----------------
- Added -gp (or -goppad) to make ccextractor use
GOP timing. Try it for non TS files where
subs start OK but desync as the video advances.
0.25
----
0.25 (unreleased)
-----------------
- Format detection is not perfect yet. I've added
-nomyth to prevent the MytvTV code path to be
called. I've seen apparently correct files that
@@ -744,8 +945,8 @@ version of CCExtractor.
options will work.
0.24
----
0.24 (unreleased)
-----------------
- Fixed a bug that caused dvr-ms (Windows Media Center)
files to be incorrectly processed (letters out of
order all the time).
@@ -759,8 +960,8 @@ version of CCExtractor.
still can).
0.22
----
0.22 (2007-05-15)
-----------------
- Added text mode handling into decoder, which gets rids
of junk when text mode data is present.
- Added support for certain (possibly non standard
@@ -771,14 +972,14 @@ version of CCExtractor.
- Other Minor bug fixes.
0.20
----
0.20 (2007-05-07)
-----------------
- Unicode should be decent now.
- Added support for Hauppauge PVR 250 cards, and (possibly)
many others (bttv) with the same closed caption recording
format.
This is the result of hacking MythTV's MPEG parser into
ccextractor. Integration is not very good (to put it
CCExtractor. Integration is not very good (to put it
midly) but it seems to work. Depending on the feedback I
may continue working on this or just leave it 'as it'
(good enough).
@@ -789,20 +990,20 @@ version of CCExtractor.
though. If you have a good CSS for .SAMI files let me
know.
0.19
----
0.19 (2007-05-03)
-----------------
- Work on Dish Network streams, timing was completely broken.
It's fixed now at least for the samples I have, if it's not
completely fixed let me know. Credit for this goes to
Jack Ha who sent me a couple of samples and a first
implementation of a semiworking fix.
implementation of a semi working-fix.
- Added support for several input files (see help screen for
details).
- Added Unicode and Latin-1 encoding.
0.17
----
0.17 (2007-04-29)
-----------------
- Extraction to .srt is almost complete - works correctly for
pop-up and roll-up captions, possibly not yet for paint-on
(mostly because I don't have any sample with paint-on captions
@@ -810,8 +1011,8 @@ version of CCExtractor.
- Minor bug fixes.
- Automatic TS/non-TS mode detection.
0.14
----
0.14 (2007-04-25)
-----------------
- Work on handling special cases related to the MPEG reference
clock: Roll over, jumps, etc.
- Modified padding code a bit: In particular, padding occurs
@@ -824,10 +1025,10 @@ version of CCExtractor.
needs to start with a TS header).
- Minor bug fixes.
0.07
----
0.07 (2007-04-19)
-----------------
- Added MPEG reference clock parsing.
- Added autopadding in TS. Does miracles with timing.
- Added auto padding in TS. Does miracles with timing.
- Added video information (as extracted from sequence header).
- Some code clean-up.
- FF sanity check enabled by default.

58
docs/FFMPEG.TXT Normal file
View File

@@ -0,0 +1,58 @@
Overview
========
FFmpeg Integration was done to support multiple encapsulations.
Dependency
=========
FFmpeg library's
Download and Install FFmpeg on your Linux pc.
---------------------------------------------
Download latest source code from following link
https://ffmpeg.org/download.html
then following command to install ffmpeg
./configure && make && make install
Note:If you installed ffmpeg on non-standard location, please change/update your
environment variable $PATH and $LD_LIBRARY_PATH
Download and Install FFmpeg on your Windows pc.
----------------------------------------------
Download prebuild library from following link
http://ffmpeg.zeranoe.com/builds/
You need to download Shared Versions to run the program and Dev Versions to compile.
How to compile ccextractor
==========================
In Linux
--------
make ENABLE_FFMPEG=yes
On Windows
----------
put the path of libs/include of ffmpeg library in library paths.
Step 1) In visual studio 2013 right click <Project> and select property.
Step 2) Select Configuration properties in left panel(column) of property.
Step 3) Select VC++ Directory.
Step 4) In the right pane, in the right-hand column of the VC++ Directory property,
open the drop-down menu and choose Edit.
Step 5) Add path of Directory where you have kept uncompressed library of FFmpeg.
Set preprocessor flag ENABLE_FFMPEG=1
Step 1) In visual studio 2013 right click <Project> and select property.
Step 2) In the left panel, select Configuration Properties, C/C++, Preprocessor.
Step 3) In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
Step 4) In the Preprocessor Definitions dialog box, add ENABLE_FFMPEG=1. Choose OK to save your changes.
Add library in linker
Step 1) Open property of project
Step 2) Select Configuration properties
Step 3) Select Linker in left panel(column)
Step 4) Select Input
Step 5) Select Additional dependencies in right panel
Step 6) Add all FFmpeg's lib in new line

View File

@@ -1,4 +1,4 @@
Starting with version 0.51, ccextractor has a mode
Starting with version 0.51, CCExtractor has a mode
that allows frontends and other programs know what
the current progress is as well as get information
on interesting events, such as a file being open
@@ -80,7 +80,7 @@ VIDEOINFO - New video information found
Horizontal resolution
Vertical resolution
Aspect ratio
Framerate
Frame rate
Example: ###VIDEOINFO#1980#1080#16:9#29.97

58
docs/G608.TXT Normal file
View File

@@ -0,0 +1,58 @@
G608
====
G608 (for grid 608) is generated by CCExtractor by using -out=g608.
This is a verbose format that exports the contents of the 608 grid verbatim
so there's no loss of positioning or colors due the limitations or complexity
or other output formats.
G608 is a text file with a structure based on .srt and looks like this:
1
00:00:02,019 --> 00:00:03,585
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
99999999999999999999999999999999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
- Previously on The Tudors... 90000000000000000000000000000009RIIIIIIIIIIIIIIIIRRRRRRRRRRRRRRR
- Your Holy Father offs you 99000000000000000000000000000999RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
For each subtitle frame there's exactly 15 rows (which represent the 15 rows of the 608 screen)
of 96 characters each.
Each row is divided in 3 blocks: 32 characters for the text, 32 characters for the color, and
32 characters for the font.
The possible color values are:
COL_WHITE = 0,
COL_GREEN = 1,
COL_BLUE = 2,
COL_CYAN = 3,
COL_RED = 4,
COL_YELLOW = 5,
COL_MAGENTA = 6,
COL_USERDEFINED = 7,
COL_BLACK = 8,
COL_TRANSPARENT = 9
And the possible font values are:
R => Regular
I => Italics
U => Underlined
B => Underlined + Italics
If a 'E' is found in either color or font that means a bug in CCExtractor. Should you ever get
an E please send us a .bin file that causes it.
This format is intended for post processing tools that need to represent the output of a 608
decoder accurately but that don't want to deal with the madness of other more generic subtitle
formats.

47
docs/HARDSUBX.txt Normal file
View File

@@ -0,0 +1,47 @@
Overview
========
Subtitles which are burned into the video (or hard subbed) can be extracted using the -hardsubx flag.
The system works by processing video frames and extracting only the subtitles from them, followed
by an OCR recognition using Tesseract.
Dependencies
============
Tesseract (OCR library by Google)
Leptonica (C Image processing library)
FFMpeg (Video Processing Library)
Compilation
===========
Linux
-----
Make sure Tesseract, Leptonica and FFMPeg are installed, and that their libraries can be found using pkg-config.
Refer to OCR.txt for installation details.
To install FFmpeg (libav), follow the steps at:-
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu - For Ubuntu, Debian and Linux Mint
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic - For generic Linux compilation
To validate your FFMpeg installation, make sure you can run the following commands on your terminal:-
pkg-config --cflags libavcodec
pkg-config --cflags libavformat
pkg-config --cflags libavutil
pkg-config --cflags libswscale
pkg-config --libs libavcodec
pkg-config --libs libavformat
pkg-config --libs libavutil
pkg-config --libs libswscale
On success, you should see the correct include directory path and the linker flags.
To build the program with hardsubx support, from the Linux directory run:-
make ENABLE_HARDSUBX=yes
NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04.
Windows
-------
Coming Soon

View File

@@ -3,7 +3,7 @@ A mailing list is now available from sourceforge:
https://lists.sourceforge.net/lists/listinfo/ccextractor-users
I expect it to be very low traffic (right now there's around 10
people actively helping with ccextractor in one way or
people actively helping with CCExtractor in one way or
another), so almost everything goes here:
- Bug reports

View File

@@ -1,17 +1,17 @@
Overview
========
OCR (Optical Character Recognisation ) is an technique used to
extract text from images. In the World of Subtile, subtitle stored
in bitmap format are common and even neccassary. for converting subtile
in bitmap format to subtilte in text format ocr is used.
OCR (Optical Character Recognition) is a technique used to
extract text from images. In the World of Subtitle, subtitle stored
in bitmap format are common and even necessary for converting subtitle
in bitmap format to subtitle in text format OCR is used.
Dependecy
=========
Tesseract (OCR library by google)
Leptonica (image processing library)
Dependency
==========
Tesseract (OCR library by Google)
Leptonica (Image processing library)
How to compile ccextractor on linux with OCR
How to compile CCExtractor on Linux with OCR
=============================================
Download and Install Leptonnica.
@@ -43,25 +43,23 @@ sudo make install
sudo ldconfig
Note:
1) CCExtractor is tested with Tesseract 3.02.02 version.
1) CCExtractor is tested with Tesseract 3.04 version but it works with older versions.
you can download tesseract from https://drive.google.com/folderview?id=0B7l10Bj_LprhQnpSRkpGMGV2eE0&usp=sharing
you can download tesseract from https://github.com/tesseract-ocr/tesseract/archive/3.04.00.tar.gz
you can download tesseract training data from https://github.com/tesseract-ocr/tessdata/archive/3.04.00.tar.gz
Compile CCextractor passing flags like following
Compile CCExtractor passing flags like following
-------------------------------------------------
make ENABLE_OCR=yes
How to compile ccextractor on Windows with OCR
=============================================
How to compile CCExtractor on Windows with OCR
===============================================
Download prebuild library of leptonica from following link
http://www.leptonica.com/source/leptonica-1.68-win32-lib-include-dirs.zip
Download prebuild library of tesseract from following tesseract official link
https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-3.02.02-win32-lib-include-dirs.zip
Download prebuild library of leptonica and tesseract from following link
https://drive.google.com/file/d/0B2ou7ZfB-2nZOTRtc3hJMHBtUFk/view?usp=sharing
put the path of libs/include of leptonica and tesseract in library paths.
step 1) In visual studio 2013 right click <Project> and select property.
@@ -74,23 +72,23 @@ Step 5) Add path of Directory where you have kept uncompressed library of lepton
Set preprocessor flag ENABLE_OCR=1
Step 1)In visual studio 2013 right click <Project> and select property.
Step 2)In the left panel, select Configuration Properties, C/C++, Preprocessor.
Step 3)In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
Step 4)In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
Step 1) In visual studio 2013 right click <Project> and select property.
Step 2) In the left panel, select Configuration Properties, C/C++, Preprocessor.
Step 3) In the right panel, in the right-hand column of the Preprocessor Definitions property, open the drop-down menu and choose Edit.
Step 4) In the Preprocessor Definitions dialog box, add ENABLE_OCR=1. Choose OK to save your changes.
Add library in linker
step 1)Open property of project
Step 2)Select Configuration properties
Step 3)Select Linker in left panel(column)
Step 4)Select Input
Step 5)Select Additional dependencies in right panel
Step 6)Add libtesseract302.lib in new line
Step 7)Add liblept168.lib in new line
step 1) Open property of project
Step 2) Select Configuration properties
Step 3) Select Linker in left panel(column)
Step 4) Select Input
Step 5) Select Additional dependencies in right panel
Step 6) Add libtesseract304d.lib in new line
Step 7) Add liblept172.lib in new line
Download language data from following link
https://code.google.com/p/tesseract-ocr/downloads/list
after downloading the tesseract-ocr-3.02.eng.tar extract the tar file and put
tessdata folder where you have kept ccextractor executable
after downloading the tesseract-ocr-3.02.eng.tar.gz extract the tar file and put
tessdata folder where you have kept CCExtractor executable
Copy the tesseract and leptonica dll in the folder of executable or in system32.
Copy the tesseract and leptonica dll from lib folder downloaded from above link to folder of executable or in system32.

View File

@@ -1,17 +1,41 @@
ccextractor, 0.63
ccextractor, 0.85
-----------------
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
Authors: Carlos Fernández (cfsmp3), Volker Quetschke.
Maintainer: cfsmp3
Lots of credit goes to other people, though:
McPoodle (author of the original SCC_RIP), Neuron2, and others (see source
code).
Home: http://ccextractor.sourceforge.net
Home: http://www.ccextractor.org
Google Summer of Code 2014 students
- Willem Van Iseghem
- Ruslan KuchumoV
- Anshul Maheshwari
Google Summer of Code 2015 students
- Willem Van Iseghem
- Ruslan Kuchumov
- Anshul Maheshwari
- Nurendra Choudhary
- Oleg Kiselev
- Vasanth Kalingeri
Google Summer of Code 2016 students
- Willem Van Iseghem
- Ruslan Kuchumov
- Abhishek Vinjamoori
- Abhinav Shukla
- Rishabh Garg
Google Code-in 2016 students
- Evgeny Shulgin
- Manveer Basra
- Alexandru Bratosin
(more, but they forgot to add themselves...)
You can subscribe to new releases notifications at freshmeat:
http://freshmeat.net/projects/ccextractor
License
-------
@@ -67,21 +91,18 @@ If there are Spanish subtitles, one of them should work.
McPoodle's page
---------------
http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_TOOLS.HTML
Essential CC related information and free (with source) tools.
Encoding
--------
This version, in both its Linux and Windows builds generates by
default Latin-1 encoded files. You can use -unicode and -utf8
if you prefer these encodings (usually it just depends on what
your specific player likes).
This has changed from the previous UTF-8 default which vobsub
can't handle.
default Unicode files. You can use -latin1 and -utf8 if you prefer
these encodings (usually it just depends on what your specific
player likes).
Future work
-----------
- Finish EIA-708 decoder
- Network support
- Please check www.ccextractor.org for news and future work.

View File

@@ -5,9 +5,9 @@
#
# The Input Source tag option give ability to user
# to take imput from file, standurd input or network
# This tag take number in its input and there meanings
# The Input Source tag option gives ability to user
# to take input from file, standard input or network
# This tag takes number in its input and their meanings
# are following
# 0 = file
# 1 = stdin
@@ -16,12 +16,12 @@
INPUT_SOURCE=0
# The Buffer Input tag
# This tag take number in its input.
# This tag takes number in its input.
#BUFFER_INPUT=0
# The Direct Rollup tag
# This tag take number in its input and there meanings
# This tag takes number in its input and their meanings
# are following
# 0 = no
# 1 = yes
@@ -29,7 +29,7 @@ INPUT_SOURCE=0
#DIRECT_ROLLUP=
#The No font Color Tag
# This tag take number in its input and there meanings
# This tag takes number in its input and their meanings
# are following
# 0 = no
# 1 = yes
@@ -37,16 +37,16 @@ INPUT_SOURCE=0
#NOFONT_COLOR=
#The No type Setting Tag
# This tag take number in its input and there meanings
# This tag takes number in its input and their meanings
# are following
# 0 = no
# 1 = yes
#NOTYPE_SETTING=
# The Codec Tag take the preference of codec
# The Codec Tag takes the preference of codec
# tag CCX_CODEC_ANY is by default
# This tag take number in its input and there meaning
# This tag takes number in its input and their meanings
# are following
# 0 = CCX_CODEC_ANY
# 1 = CCX_CODEC_TELETEXT
@@ -56,7 +56,7 @@ INPUT_SOURCE=0
# The NO Codec Tag do not use codec specified
# tag CCX_CODEC_NONE is by default
# This tag take number in its input and there meaning
# This tag takes number in its input and their meanings
# are following
# 1 = CCX_CODEC_TELETEXT
# 2 = CCX_CODEC_DVB
@@ -66,7 +66,7 @@ INPUT_SOURCE=0
# OUTPUT_FORMAT tag specify format of output
# by default output format is srt
# This tag take number in its input and there meaning
# This tag takes number in its input and their meanings
# are following
# 0 = CCX_OF_RAW
# 1 = CCX_OF_SRT (default)
@@ -87,7 +87,7 @@ INPUT_SOURCE=0
#START_CREDIT_TEXT=
# Start credit do not start before apecified time in tag
# Start credit do not start before specified time in tag
# this tag only accepts SS, MM:SS or HH:MM:SS
#START_CREDIT_NOT_BEFORE=
@@ -124,7 +124,7 @@ INPUT_SOURCE=0
#END_CREDITS_FOR_ATMOST
# Is Video edited or splitted by tool
# Is Video edited or split by tool
# By default its 1, ccextractor will process input files in
# sequence as if they were all one large file i.e
# split by a generic, non video-aware tool. If you
@@ -140,7 +140,7 @@ INPUT_SOURCE=0
# overrides the default PTS timing,GOP timing is always
# used for Elementary Streams.
#
# This tag take number in its input and there meaning
# This tag takes number in its input and their meanings
# are following
# 0 = use pts for time (when reasonable)
# 1 = use gop for time (when reasonable)
@@ -164,7 +164,7 @@ INPUT_SOURCE=0
# emulation, you can have ccextractor write only one
# line at a time, getting rid of these repeated lines.
#
# This tag take number in its input and there meaning
# This tag take number in its input and their meanings
# are following
# 0 = no (default)
# 1 = yes

339
docs/gpl-2.0.txt Normal file
View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,34 @@
For building CCExtractor using cmake follow steps below..
Step 1) Check you have right version of cmake installed. ( version >= 3.0.2 )
We are using CMP0037 policy of cmake which was introduced in 3.0.0
since we have tested our system only with cmake version 3.0.2, I would
suggest to use 3.0.2 or higher version.
Step 2) create a separate directory where you want to build the target.
In Unix you can do it using following commands.
~> cd ccextractor
~> mkdir build
Step 3) make the build system using cmake
~> cmake ../src/
Step 4) Compile the code.
~> make
~> make install
Step 5) Use CCextractor as you would like
If you want to build CCExtractor with FFMpeg you need to pass
cmake -DWITH_FFMPEG=ON ../src/
If you want to build CCExtractor with OCR you need to pass
cmake -DWITH_OCR=ON ../src/
If you want to build CCExtractor with Sharing and Translating service:
cmake -DWITH_SHARING ../src/
Hint for looking all the things you want to set from outside
cmake -LAH ../src/

View File

@@ -1,26 +1,37 @@
SHELL = /bin/sh
CC = gcc
CXX = g++
CFLAGS = -O3 -std=gnu99
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/zlib
ALL_FLAGS = -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64
LDFLAGS = -lm -zmuldefs
SYS := $(shell gcc -dumpmachine)
CFLAGS = -O3 -std=gnu99 -s
INCLUDE = -I../src/gpacmp4/ -I../src/libpng -I../src/lib_hash -I../src/protobuf-c -I../src/zlib -I../src/lib_ccx -I../src/.
INCLUDE += -I../src/zvbi -I../src/utf8proc
ALL_FLAGS = -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT
LDFLAGS = -lm
ifneq (, $(findstring linux, $(SYS)))
CFLAGS +=-DGPAC_CONFIG_LINUX
endif
TARGET = ccextractor
OBJS_DIR = objs
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib
VPATH = ../src:../src/gpacmp4:../src/libpng:../src/zlib:../src/lib_ccx:../src/zvbi:../src/lib_hash:../src/utf8proc:../src/protobuf-c
SRCS_DIR = ../src
SRCS_C = $(wildcard $(SRCS_DIR)/*.c)
OBJS = $(SRCS_C:$(SRCS_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_CCX_DIR = $(SRCS_DIR)/lib_ccx
SRCS_CCX = $(wildcard $(SRCS_CCX_DIR)/*.c)
OBJS_CCX = $(SRCS_CCX:$(SRCS_CCX_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_PNG_DIR = $(SRCS_DIR)/libpng
SRCS_PNG = $(wildcard $(SRCS_PNG_DIR)/*.c)
OBJS_PNG = $(SRCS_PNG:$(SRCS_PNG_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_ZVBI_DIR = $(SRCS_DIR)/zvbi
SRCS_ZVBI = $(wildcard $(SRCS_ZVBI_DIR)/*.c)
OBJS_ZVBI = $(SRCS_ZVBI:$(SRCS_ZVBI_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_GPACMP4_DIR = $(SRCS_DIR)/gpacmp4
SRCS_GPACMP4_C = $(wildcard $(SRCS_GPACMP4_DIR)/*.c)
SRCS_GPACMP4_CPP = $(wildcard $(SRCS_GPACMP4_DIR)/*.cpp)
@@ -31,25 +42,93 @@ SRCS_ZLIB_DIR = $(SRCS_DIR)/zlib
SRCS_ZLIB = $(wildcard $(SRCS_ZLIB_DIR)/*.c)
OBJS_ZLIB = $(SRCS_ZLIB:$(SRCS_ZLIB_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_HASH_DIR = $(SRCS_DIR)/lib_hash
SRCS_HASH = $(wildcard $(SRCS_HASH_DIR)/*.c)
OBJS_HASH = $(SRCS_HASH:$(SRCS_HASH_DIR)/%.c=$(OBJS_DIR)/%.o)
SRCS_UTF8_DIR = $(SRCS_DIR)/utf8proc
SRCS_UTF8 = $(SRCS_UTF8_DIR)/utf8proc.c
OBJS_UTF8 = $(SRCS_UTF8:$(SRCS_UTF8_DIR)/%.c=$(OBJS_DIR)/%.o)
INSTLALL = cp -f -p
INSTLALL_PROGRAM = $(INSTLALL)
DESTDIR = /usr/bin
ifeq ($(ENABLE_HARDSUBX),yes)
ENABLE_OCR=yes
CFLAGS+=-DENABLE_HARDSUBX
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
CFLAGS+= $(shell pkg-config --cflags libswscale)
AV_LDFLAGS+= $(shell pkg-config --libs libavcodec )
AV_LDFLAGS+= $(shell pkg-config --libs libavformat )
AV_LDFLAGS+= $(shell pkg-config --libs libavutil )
AV_LDFLAGS+= $(shell pkg-config --libs libswscale )
ifeq ($(AV_LDFLAGS),$(EMPTY))
$(error **ERROR** "libav not found")
else
$(info "libav found")
endif
LDFLAGS+= $(AV_LDFLAGS)
endif
ifeq ($(ENABLE_OCR),yes)
CFLAGS+=-I/usr/local/include/tesseract -I/usr/local/include/leptonica
CFLAGS+=-DENABLE_OCR
LDFLAGS+= $(shell pkg-config --libs tesseract)
CFLAGS+=-DENABLE_OCR -DPNG_NO_CONFIG_H
LEPT_LDFLAGS+= $(shell pkg-config --libs lept)
ifneq ($(shell pkg-config --exists tesseract), $(EMPTY))
TESS_LDFLAGS+= $(shell pkg-config --libs tesseract)
TESS_CFLAGS+= $(shell pkg-config --cflags tesseract)
else
#fix for raspberry pi not having a pkgconfig file for tesseract
ifneq ($(wildcard /usr/include/tesseract/*),$(EMPTY))
TESS_LDFLAGS+= -ltesseract
TESS_CFLAGS+= -I/usr/include/tesseract
endif
endif
#error checking of library are there or not
ifeq ($(TESS_LDFLAGS),$(EMPTY))
$(error **ERROR** "tesseract not found")
else
#TODO print the version of library found
$(info "tesseract found")
endif
ifeq ($(LEPT_LDFLAGS),$(EMPTY))
$(error **ERROR** "leptonica not found")
else
#TODO print the version of library found
$(info "Leptonica found")
endif
CFLAGS += $(TESS_CFLAGS)
CFLAGS += $(shell pkg-config --cflags lept)
LDFLAGS += $(TESS_LDFLAGS)
LDFLAGS += $(LEPT_LDFLAGS)
endif
ifeq ($(ENABLE_FFMPEG),yes)
CFLAGS+=-DENABLE_FFMPEG
CFLAGS+= $(shell pkg-config --cflags libavcodec)
CFLAGS+= $(shell pkg-config --cflags libavformat)
CFLAGS+= $(shell pkg-config --cflags libavutil)
LDFLAGS+= $(shell pkg-config --libs libavcodec )
LDFLAGS+= $(shell pkg-config --libs libavformat )
LDFLAGS+= $(shell pkg-config --libs libavutil )
endif
.PHONY: all
all: objs_dir $(TARGET)
all: pre-build objs_dir $(TARGET)
.PHONY: objs_dir
objs_dir:
mkdir -p $(OBJS_DIR)
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZLIB)
$(CXX) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(LDFLAGS) -o $@
$(TARGET): $(OBJS) $(OBJS_PNG) $(OBJS_GPACMP4) $(OBJS_ZVBI) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_CCX) $(OBJS_UTF8)
$(CC) $(ALL_FLAGS) $(CFLAGS) $(OBJS) $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZVBI) $(OBJS_GPACMP4) $(OBJS_ZLIB) $(OBJS_HASH) $(OBJS_UTF8) $(LDFLAGS) -o $@
$(OBJS_DIR)/%.o: %.c
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@
@@ -57,12 +136,15 @@ $(OBJS_DIR)/%.o: %.c
$(OBJS_DIR)/%.o: %.cpp
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) $< -o $@ -I../src/gpacmp4
$(OBJS_DIR)/ccextractor.o: ccextractor.c
$(CC) -c $(ALL_FLAGS) $(INCLUDE) $(CFLAGS) -O0 $< -o $@
.PHONY: clean
clean:
rm $(TARGET) 2>/dev/null || true
rm $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS) 2>/dev/null || true
rm -rd $(OBJS_DIR) 2>/dev/null || true
rm .depend 2>/dev/null || true
rm -rf $(TARGET) 2>/dev/null || true
rm -rf $(OBJS_CCX) $(OBJS_PNG) $(OBJS_ZLIB) $(OBJS_GPACMP4) $(OBJS_HASH) $(OBJS_UTF8) $(OBJS) 2>/dev/null || true
rm -rdf $(OBJS_DIR) 2>/dev/null || true
rm -rf .depend 2>/dev/null || true
.PHONY: install
install: $(TARGET)
@@ -74,8 +156,12 @@ uninstall:
.PHONY: depend dep
depend dep:
$(CXX) $(CXXFLAGS) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZLIB) \
$(CC) $(CFLAGS) $(INCLUDE) -E -MM $(SRCS_C) $(SRCS_PNG) $(SRCS_ZVBI) $(SRCS_ZLIB) $(SRCS_HASH) $(SRCS_UTF8) $(SRCS_CCX) \
$(SRCS_GPACMP4_C) $(SRCS_GPACMP4_CPP) |\
sed 's/^[a-zA-Z_0-9]*.o/$(OBJS_DIR)\/&/' > .depend
.PHONY: pre-build
pre-build:
./pre-build.sh
-include .depend

View File

@@ -1,2 +1,45 @@
#!/bin/bash
gcc -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c') -lm -zmuldefs
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER) 2>&1)
res=$?
if [[ $out == *"gcc: command not found"* ]]
then
echo "Error: please install gcc";
exit 1
fi
if [[ $out == *"curl.h: No such file or directory"* ]]
then
echo "Error: please install curl development library (libcurl4-gnutls-dev for Debian/Ubuntu)";
exit 2
fi
if [[ $out == *"capi.h: No such file or directory"* ]]
then
echo "Error: please install tesseract development library (tesseract-ocr-dev for Debian/Ubuntu)";
exit 3
fi
if [[ $out == *"allheaders.h: No such file or directory"* ]]
then
echo "Error: please install leptonica development library (libleptonica-dev for Debian/Ubuntu)";
exit 4
fi
if [[ $res -ne 0 ]] # Unknown error
then
echo "Compiled with errors"
>&2 echo "$out"
exit 5
fi
echo "Compilation successful";

112
linux/build-static.sh Executable file
View File

@@ -0,0 +1,112 @@
#!/bin/sh -ex
####################################################################
# setup by tracey apr 2012
# updated version dec 2016
# see: http://www.ccextractor.org/doku.php
####################################################################
# build it static!
# simplest way is with linux alpine
# hop onto box with docker on it and cd to dir of the file you are staring at
# You will get a static-compiled binary and english language library file in the end.
if [ ! -e /tmp/cc/ccextractor-README.txt ]; then
rm -rf /tmp/cc;
mkdir -p -m777 /tmp/cc;
mkdir -p -m777 ../lib/tessdata/;
cp ccextractor-README.txt /tmp/cc/;
sudo docker run -v /tmp/cc:/tmp/cc --rm -it alpine:latest /tmp/cc/ccextractor-README.txt;
# NOTE: _AFTER_ testing/validating, you can promote it from "ccextractor.next" to "ccextractor"... ;-)
cp /tmp/cc/*traineddata ../lib/tessdata/;
chmod go-w ../lib/tessdata/;
exit 0;
fi
# NOW we are inside docker container...
cd /tmp/cc;
# we want tesseract (for OCR)
echo '
http://dl-cdn.alpinelinux.org/alpine/v3.5/main
http://dl-cdn.alpinelinux.org/alpine/v3.5/community
' >| /etc/apk/repositories;
apk update; apk upgrade;
apk add --update bash zsh alpine-sdk perl;
# (needed by various static builds below)
# Even though we're going to (re)builid tesseract from source statically, get its dependencies setup by
# installing it now, too.
apk add autoconf automake libtool tesseract-ocr-dev;
# Now comes the not-so-fun parts... Many packages _only_ provide .so files in their distros -- not the .a
# needed files for building something with it statically. Step through them now...
# libgif
wget https://sourceforge.net/projects/giflib/files/giflib-5.1.4.tar.gz;
zcat giflib*tar.gz | tar xf -;
cd giflib*/;
./configure --disable-shared --enable-static; make; make install;
hash -r;
cd -;
# libwebp
git clone https://github.com/webmproject/libwebp;
cd libwebp;
./autogen.sh;
./configure --disable-shared --enable-static; make; make install;
cd -;
# leptonica
wget http://www.leptonica.org/source/leptonica-1.73.tar.gz;
zcat leptonica*tar.gz | tar xf -;
cd leptonica*/;
./configure --disable-shared --enable-static; make; make install;
hash -r;
cd -;
# tesseract
git clone https://github.com/tesseract-ocr/tesseract;
cd tesseract;
./autogen.sh;
./configure --disable-shared --enable-static; make; make install;
cd -;
# ccextractor -- build static
git clone https://github.com/CCExtractor/ccextractor;
cd ccextractor/linux/;
# wget https://sourceforge.net/projects/ccextractor/files/ccextractor/0.82/ccextractor.src.0.82.zip;
# unzip ccextractor*.zip;
# cd ccextractor.*/linux/;
perl -i -pe 's/O3 /O3 -static /' Makefile;
# quick patch:
perl -i -pe 's/(strchr|strstr)\(/$1((char *)/' ../src/gpacmp4/url.c ../src/gpacmp4/error.c;
set +e; # this _will_ FAIL at the end..
make ENABLE_OCR=yes;
set -e;
# I confess hand-compiling (cherrypicking which .a to use when there are 2, etc.) is fragile...
# But it was the _only_ way I could get a fully static build after hours of thrashing...
gcc -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -O3 -std=gnu99 -s -DGPAC_CONFIG_LINUX -DENABLE_OCR -DPNG_NO_CONFIG_H -I/usr/local/include/tesseract -I/usr/local/include/leptonica objs/*.o -o ccextractor \
--static -lm \
/usr/local/lib/libtesseract.a \
/usr/local/lib/liblept.a \
/usr/local/lib/libgif.a \
/usr/local/lib/libwebp.a \
/usr/lib/libjpeg.a \
/usr/lib/libtiff.a \
/usr/lib/libgomp.a \
-lstdc++;
cp ccextractor /tmp/cc/ccextractor.next;
cd -;
# get english lang trained data
wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata;

17
linux/build_hardsubx Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX"
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_UTF8="../src/utf8proc/utf8proc.c"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
protobuf-c
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -L/usr/local/lib -lswscale -lavutil -pthread -lavformat -lavcodec -lxcb-shm -lxcb -lX11 -llzma -lz -lswresample"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

View File

@@ -1,2 +1,16 @@
#!/bin/bash
gcc -g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c') -lm -zmuldefs
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

1
linux/description-pak Normal file
View File

@@ -0,0 +1 @@
Best open source tool for a subtitled world

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_REAL_H" > ../src/lib_ccx/compile_info_real.h
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_real.h
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
echo "Stored all in compile_info_real.h"
echo "Done."

18
mac/build.command Normal file → Executable file
View File

@@ -1 +1,17 @@
g++ -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -I../src/gpacmp4 -I ../src/libpng -I ../src/zlib -o ccextractor $(find ../src/ -name '*.cpp') $(find ../src/ -name '*.c')
#!/bin/bash
cd `dirname $0`
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi -I /usr/local/include/leptonica/ -I /usr/local/include/tesseract/"
SRC_CCX="$(find ../src/lib_ccx -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4 -name '*.c')"
SRC_LIB_HASH="$(find ../src/lib_hash -name '*.c')"
SRC_LIBPNG="$(find ../src/libpng -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c -name '*.c')"
SRC_UTF8="$(find ../src/utf8proc-c -name '*.c')"
SRC_ZLIB="$(find ../src/zlib -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI"
BLD_LINKER="-lm -liconv"
./pre-build.sh
gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER

34
mac/pre-build.sh Executable file
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_REAL_H" > ../src/lib_ccx/compile_info_real.h
echo "#define CCX_CCEXTRACTOR_COMPILE_REAL_H" >> ../src/lib_ccx/compile_info_real.h
echo "#define GIT_COMMIT \"$commit\"" >> ../src/lib_ccx/compile_info_real.h
echo "#define COMPILE_DATE \"$builddate\"" >> ../src/lib_ccx/compile_info_real.h
echo "#endif" >> ../src/lib_ccx/compile_info_real.h
echo "Stored all in compile_info_real.h"
echo "Done."

View File

@@ -0,0 +1,38 @@
#!/bin/bash
TYPE="debian" # can be one of 'slackware', 'debian', 'rpm'
PROGRAM_NAME="ccextractor"
VERSION="0.84"
RELEASE="1"
LICENSE="GPL-2.0"
MAINTAINER="carlos@ccextractor.org"
REQUIRES="gcc,libcurl4-gnutls-dev,tesseract-ocr,tesseract-ocr-dev,libleptonica-dev"
out=$((LC_ALL=C dpkg -s checkinstall) 2>&1)
if [[ $out == *"is not installed"* ]]
then
read -r -p "You have not installed the package 'checkinstall'. Would you like to install it? [Y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
apt-get install -y checkinstall
else
exit 0
fi
fi
mkdir -p ../linux/objs
(cd ../linux; checkinstall \
-y \
--pkgrelease=$RELEASE \
--pkggroup="CCExtractor" \
--backup=no \
--install=no \
--type $TYPE \
--pkgname=$PROGRAM_NAME \
--pkgversion=$VERSION \
--pkglicense=$LICENSE \
--pakdir="../package_creators/build" \
--maintainer=$MAINTAINER \
--nodoc \
--requires=$REQUIRES)

12
raspberrypi.md Normal file
View File

@@ -0,0 +1,12 @@
# Installing on a Raspberry Pi
dependencies for ocr mode:
* libleptonica-dev
* libtesseract-dev
```bash
sudo apt-get install libleptonica-dev libtesseract-dev
```
Other than this you just need to cd into the linux directory and run `make` or `make ENABLE_OCR=yes` if you want ocr enabled.

BIN
src/.DS_Store vendored Normal file

Binary file not shown.

151
src/608.h
View File

@@ -1,151 +0,0 @@
#ifndef __608_H__
enum cc_modes
{
MODE_POPON = 0,
MODE_ROLLUP_2 = 1,
MODE_ROLLUP_3 = 2,
MODE_ROLLUP_4 = 3,
MODE_TEXT = 4,
MODE_PAINTON = 5,
// Fake modes to emulate stuff
MODE_FAKE_ROLLUP_1 = 100
};
struct eia608_screen // A CC buffer
{
unsigned char characters[15][33];
unsigned char colors[15][33];
unsigned char fonts[15][33]; // Extra char at the end for a 0
int row_used[15]; // Any data in row?
int empty; // Buffer completely empty?
};
struct s_context_cc608
{
struct eia608_screen buffer1;
struct eia608_screen buffer2;
int cursor_row, cursor_column;
int visible_buffer;
int srt_counter; // Number of subs currently written
int screenfuls_counter; // Number of meaningful screenfuls written
LLONG current_visible_start_ms; // At what time did the current visible buffer became so?
// unsigned current_visible_start_cc; // At what time did the current visible buffer became so?
enum cc_modes mode;
unsigned char last_c1, last_c2;
int channel; // Currently selected channel
unsigned char color; // Color we are currently using to write
unsigned char font; // Font we are currently using to write
int rollup_base_row;
LLONG ts_start_of_current_line; /* Time at which the first character for current line was received, =-1 no character received yet */
LLONG ts_last_char_received; /* Time at which the last written character was received, =-1 no character received yet */
int new_channel; // The new channel after a channel change
int my_field; // Used for sanity checks
long bytes_processed_608; // To be written ONLY by process_608
struct ccx_s_write *out;
int have_cursor_position;
};
extern unsigned char *enc_buffer;
extern unsigned char str[2048];
extern unsigned enc_buffer_used;
extern unsigned enc_buffer_capacity;
extern int new_sentence;
extern const char *color_text[][2];
int write_cc_buffer_as_srt(struct eia608_screen *data, struct s_context_cc608 *context);
void write_stringz_as_srt(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data);
void capitalize (int line_num, struct eia608_screen *data);
void correct_case (int line_num, struct eia608_screen *data);
int write_cc_buffer_as_sami(struct eia608_screen *data, struct s_context_cc608 *context);
void write_stringz_as_sami(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
int write_cc_buffer_as_smptett(struct eia608_screen *data, struct s_context_cc608 *context);
void write_stringz_as_smptett(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end);
void correct_case (int line_num, struct eia608_screen *data);
void capitalize (int line_num, struct eia608_screen *data);
void find_limit_characters (unsigned char *line, int *first_non_blank, int *last_non_blank);
unsigned get_decoder_line_basic (unsigned char *buffer, int line_num, struct eia608_screen *data);
unsigned get_decoder_line_encoded_for_gui (unsigned char *buffer, int line_num, struct eia608_screen *data);
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data);
void delete_all_lines_but_current (struct eia608_screen *data, int row);
void try_to_add_start_credits(struct s_context_cc608 *context);
void try_to_add_end_credits(struct s_context_cc608 *context);
void write_cc_buffer_to_gui(struct eia608_screen *data, struct s_context_cc608 *context);
void handle_end_of_data(struct s_context_cc608 *context);
void process608(const unsigned char *data, int length, struct s_context_cc608 *context);
void get_char_in_latin_1 (unsigned char *buffer, unsigned char c);
void get_char_in_unicode (unsigned char *buffer, unsigned char c);
int get_char_in_utf_8 (unsigned char *buffer, unsigned char c);
unsigned char cctolower (unsigned char c);
unsigned char cctoupper (unsigned char c);
int general_608_init (void);
LLONG get_visible_end (void);
#define CC608_SCREEN_WIDTH 32
#define REQUEST_BUFFER_CAPACITY(length) if (length>enc_buffer_capacity) \
{enc_buffer_capacity=length*2; enc_buffer=(unsigned char*) realloc (enc_buffer, enc_buffer_capacity); \
if (enc_buffer==NULL) { fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory, bailing out\n"); } \
}
enum color_code
{
COL_WHITE = 0,
COL_GREEN = 1,
COL_BLUE = 2,
COL_CYAN = 3,
COL_RED = 4,
COL_YELLOW = 5,
COL_MAGENTA = 6,
COL_USERDEFINED = 7,
COL_BLACK = 8,
COL_TRANSPARENT = 9
};
enum font_bits
{
FONT_REGULAR = 0,
FONT_ITALICS = 1,
FONT_UNDERLINED = 2,
FONT_UNDERLINED_ITALICS = 3
};
enum command_code
{
COM_UNKNOWN = 0,
COM_ERASEDISPLAYEDMEMORY = 1,
COM_RESUMECAPTIONLOADING = 2,
COM_ENDOFCAPTION = 3,
COM_TABOFFSET1 = 4,
COM_TABOFFSET2 = 5,
COM_TABOFFSET3 = 6,
COM_ROLLUP2 = 7,
COM_ROLLUP3 = 8,
COM_ROLLUP4 = 9,
COM_CARRIAGERETURN = 10,
COM_ERASENONDISPLAYEDMEMORY = 11,
COM_BACKSPACE = 12,
COM_RESUMETEXTDISPLAY = 13,
COM_ALARMOFF =14,
COM_ALARMON = 15,
COM_DELETETOENDOFROW = 16,
COM_RESUMEDIRECTCAPTIONING = 17,
// Non existing commands we insert to have the decoder
// special stuff for us.
COM_FAKE_RULLUP1 = 18
};
#define __608_H__
#endif

View File

@@ -1,438 +0,0 @@
#include "ccextractor.h"
#include "utility.h"
//extern unsigned char encoded_crlf[16];
// Encodes a generic string. Note that since we use the encoders for closed caption
// data, text would have to be encoded as CCs... so using special characters here
// it's a bad idea.
unsigned encode_line (unsigned char *buffer, unsigned char *text)
{
unsigned bytes=0;
while (*text)
{
switch (ccx_options.encoding)
{
case CCX_ENC_UTF_8:
case CCX_ENC_LATIN_1:
*buffer=*text;
bytes++;
buffer++;
break;
case CCX_ENC_UNICODE:
*buffer=*text;
*(buffer+1)=0;
bytes+=2;
buffer+=2;
break;
}
text++;
}
return bytes;
}
void correct_case(int line_num,struct eia608_screen *data)
{
char delim[64] = {
' ' ,'\n','\r', 0x89,0x99,
'!' , '"', '#', '%' , '&',
'\'', '(', ')', ';' , '<',
'=' , '>', '?', '[' ,'\\',
']' , '*', '+', ',' , '-',
'.' , '/', ':', '^' , '_',
'{' , '|', '}', '~' ,'\0' };
char *line = strdup(((char*)data->characters[line_num]));
char *oline = (char*)data->characters[line_num];
char *c = strtok(line,delim);
do
{
char **index = bsearch(&c,spell_lower,spell_words,sizeof(*spell_lower),string_cmp);
if(index)
{
char *correct_c = *(spell_correct + (index - spell_lower));
size_t len=strlen (correct_c);
memcpy(oline + (c - line),correct_c,len);
}
} while ( ( c = strtok(NULL,delim) ) != NULL );
free(line);
}
void capitalize (int line_num, struct eia608_screen *data)
{
for (int i=0;i<CC608_SCREEN_WIDTH;i++)
{
switch (data->characters[line_num][i])
{
case ' ':
case 0x89: // This is a transparent space
case '-':
break;
case '.': // Fallthrough
case '?': // Fallthrough
case '!':
case ':':
new_sentence=1;
break;
default:
if (new_sentence)
data->characters[line_num][i]=cctoupper (data->characters[line_num][i]);
else
data->characters[line_num][i]=cctolower (data->characters[line_num][i]);
new_sentence=0;
break;
}
}
}
void find_limit_characters (unsigned char *line, int *first_non_blank, int *last_non_blank)
{
*last_non_blank=-1;
*first_non_blank=-1;
for (int i=0;i<CC608_SCREEN_WIDTH;i++)
{
unsigned char c=line[i];
if (c!=' ' && c!=0x89)
{
if (*first_non_blank==-1)
*first_non_blank=i;
*last_non_blank=i;
}
}
}
unsigned get_decoder_line_basic (unsigned char *buffer, int line_num, struct eia608_screen *data)
{
unsigned char *line = data->characters[line_num];
int last_non_blank=-1;
int first_non_blank=-1;
unsigned char *orig=buffer; // Keep for debugging
find_limit_characters (line, &first_non_blank, &last_non_blank);
if (!ccx_options.trim_subs)
first_non_blank=0;
if (first_non_blank==-1)
{
*buffer=0;
return 0;
}
int bytes=0;
for (int i=first_non_blank;i<=last_non_blank;i++)
{
char c=line[i];
switch (ccx_options.encoding)
{
case CCX_ENC_UTF_8:
bytes=get_char_in_utf_8 (buffer,c);
break;
case CCX_ENC_LATIN_1:
get_char_in_latin_1 (buffer,c);
bytes=1;
break;
case CCX_ENC_UNICODE:
get_char_in_unicode (buffer,c);
bytes=2;
break;
}
buffer+=bytes;
}
*buffer=0;
return (unsigned) (buffer-orig); // Return length
}
unsigned get_decoder_line_encoded_for_gui (unsigned char *buffer, int line_num, struct eia608_screen *data)
{
unsigned char *line = data->characters[line_num];
unsigned char *orig=buffer; // Keep for debugging
int first=0, last=31;
find_limit_characters(line,&first,&last);
for (int i=first;i<=last;i++)
{
get_char_in_latin_1 (buffer,line[i]);
buffer++;
}
*buffer=0;
return (unsigned) (buffer-orig); // Return length
}
unsigned char *close_tag (unsigned char *buffer, char *tagstack, char tagtype, int *punderlined, int *pitalics, int *pchanged_font)
{
for (int l=strlen (tagstack)-1; l>=0;l--)
{
char cur=tagstack[l];
switch (cur)
{
case 'F':
buffer+= encode_line (buffer,(unsigned char *) "</font>");
(*pchanged_font)--;
break;
case 'U':
buffer+=encode_line (buffer, (unsigned char *) "</u>");
(*punderlined)--;
break;
case 'I':
buffer+=encode_line (buffer, (unsigned char *) "</i>");
(*pitalics)--;
break;
}
tagstack[l]=0; // Remove from stack
if (cur==tagtype) // We closed up to the required tag, done
return buffer;
}
if (tagtype!='A') // All
fatal (EXIT_BUG_BUG, "Mismatched tags in encoding, this is a bug, please report");
return buffer;
}
unsigned get_decoder_line_encoded (unsigned char *buffer, int line_num, struct eia608_screen *data)
{
int col = COL_WHITE;
int underlined = 0;
int italics = 0;
int changed_font=0;
char tagstack[128]=""; // Keep track of opening/closing tags
unsigned char *line = data->characters[line_num];
unsigned char *orig=buffer; // Keep for debugging
int first=0, last=31;
if (ccx_options.trim_subs)
find_limit_characters(line,&first,&last);
for (int i=first;i<=last;i++)
{
// Handle color
int its_col = data->colors[line_num][i];
if (its_col != col && !ccx_options.nofontcolor &&
!(col==COL_USERDEFINED && its_col==COL_WHITE)) // Don't replace user defined with white
{
if (changed_font)
buffer = close_tag(buffer,tagstack,'F',&underlined,&italics,&changed_font);
// Add new font tag
buffer+=encode_line (buffer, (unsigned char*) color_text[its_col][1]);
if (its_col==COL_USERDEFINED)
{
// The previous sentence doesn't copy the whole
// <font> tag, just up to the quote before the color
buffer+=encode_line (buffer, (unsigned char*) usercolor_rgb);
buffer+=encode_line (buffer, (unsigned char*) "\">");
}
if (color_text[its_col][1][0]) // That means a <font> was added to the buffer
{
strcat (tagstack,"F");
changed_font++;
}
col = its_col;
}
// Handle underlined
int is_underlined = data->fonts[line_num][i] & FONT_UNDERLINED;
if (is_underlined && underlined==0 && !ccx_options.notypesetting) // Open underline
{
buffer+=encode_line (buffer, (unsigned char *) "<u>");
strcat (tagstack,"U");
underlined++;
}
if (is_underlined==0 && underlined && !ccx_options.notypesetting) // Close underline
{
buffer = close_tag(buffer,tagstack,'U',&underlined,&italics,&changed_font);
}
// Handle italics
int has_ita = data->fonts[line_num][i] & FONT_ITALICS;
if (has_ita && italics==0 && !ccx_options.notypesetting) // Open italics
{
buffer+=encode_line (buffer, (unsigned char *) "<i>");
strcat (tagstack,"I");
italics++;
}
if (has_ita==0 && italics && !ccx_options.notypesetting) // Close italics
{
buffer = close_tag(buffer,tagstack,'I',&underlined,&italics,&changed_font);
}
int bytes=0;
switch (ccx_options.encoding)
{
case CCX_ENC_UTF_8:
bytes=get_char_in_utf_8 (buffer,line[i]);
break;
case CCX_ENC_LATIN_1:
get_char_in_latin_1 (buffer,line[i]);
bytes=1;
break;
case CCX_ENC_UNICODE:
get_char_in_unicode (buffer,line[i]);
bytes=2;
break;
}
buffer+=bytes;
}
buffer = close_tag(buffer,tagstack,'A',&underlined,&italics,&changed_font);
if (underlined || italics || changed_font)
fatal (EXIT_BUG_BUG, "Not all tags closed in encoding, this is a bug, please report.\n");
*buffer=0;
return (unsigned) (buffer-orig); // Return length
}
void delete_all_lines_but_current (struct eia608_screen *data, int row)
{
for (int i=0;i<15;i++)
{
if (i!=row)
{
memset(data->characters[i],' ',CC608_SCREEN_WIDTH);
data->characters[i][CC608_SCREEN_WIDTH]=0;
memset (data->colors[i],ccx_options.cc608_default_color,CC608_SCREEN_WIDTH+1);
memset (data->fonts[i],FONT_REGULAR,CC608_SCREEN_WIDTH+1);
data->row_used[i]=0;
}
}
}
void fprintf_encoded (FILE *fh, const char *string)
{
REQUEST_BUFFER_CAPACITY(strlen (string)*3);
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) string);
fwrite (enc_buffer,enc_buffer_used,1,fh);
}
void write_cc_buffer_to_gui(struct eia608_screen *data, struct s_context_cc608 *context)
{
unsigned h1,m1,s1,ms1;
unsigned h2,m2,s2,ms2;
LLONG ms_start;
int with_data=0;
for (int i=0;i<15;i++)
{
if (data->row_used[i])
with_data=1;
}
if (!with_data)
return;
ms_start= context->current_visible_start_ms;
ms_start+=subs_delay;
if (ms_start<0) // Drop screens that because of subs_delay start too early
return;
int time_reported=0;
for (int i=0;i<15;i++)
{
if (data->row_used[i])
{
fprintf (stderr, "###SUBTITLE#");
if (!time_reported)
{
LLONG ms_end = get_fts()+subs_delay;
mstotime (ms_start,&h1,&m1,&s1,&ms1);
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
// Note, only MM:SS here as we need to save space in the preview window
fprintf (stderr, "%02u:%02u#%02u:%02u#",
h1*60+m1,s1, h2*60+m2,s2);
time_reported=1;
}
else
fprintf (stderr, "##");
// We don't capitalize here because whatever function that was used
// before to write to file already took care of it.
int length = get_decoder_line_encoded_for_gui (subline, i, data);
fwrite (subline, 1, length, stderr);
fwrite ("\n",1,1,stderr);
}
}
fflush (stderr);
}
void try_to_add_end_credits(struct s_context_cc608 *context)
{
LLONG window, length, st, end;
if (context->out->fh == -1)
return;
window=get_fts()-last_displayed_subs_ms-1;
if (window<ccx_options.endcreditsforatleast.time_in_ms) // Won't happen, window is too short
return;
length=ccx_options.endcreditsforatmost.time_in_ms > window ?
window : ccx_options.endcreditsforatmost.time_in_ms;
st=get_fts()-length-1;
end=get_fts();
switch (ccx_options.write_format)
{
case CCX_OF_SRT:
write_stringz_as_srt(ccx_options.end_credits_text, context, st, end);
break;
case CCX_OF_SAMI:
write_stringz_as_sami(ccx_options.end_credits_text, context, st, end);
break;
case CCX_OF_SMPTETT:
write_stringz_as_smptett(ccx_options.end_credits_text, context, st, end);
break ;
default:
// Do nothing for the rest
break;
}
}
void try_to_add_start_credits(struct s_context_cc608 *context)
{
LLONG st, end, window, length;
LLONG l = context->current_visible_start_ms + subs_delay;
// We have a windows from last_displayed_subs_ms to l - we need to see if it fits
if (l<ccx_options.startcreditsnotbefore.time_in_ms) // Too early
return;
if (last_displayed_subs_ms+1 > ccx_options.startcreditsnotafter.time_in_ms) // Too late
return;
st = ccx_options.startcreditsnotbefore.time_in_ms>(last_displayed_subs_ms+1) ?
ccx_options.startcreditsnotbefore.time_in_ms : (last_displayed_subs_ms+1); // When would credits actually start
end = ccx_options.startcreditsnotafter.time_in_ms<(l-1) ?
ccx_options.startcreditsnotafter.time_in_ms : (l-1);
window = end-st; // Allowable time in MS
if (ccx_options.startcreditsforatleast.time_in_ms>window) // Window is too short
return;
length=ccx_options.startcreditsforatmost.time_in_ms > window ?
window : ccx_options.startcreditsforatmost.time_in_ms;
dbg_print(CCX_DMT_VERBOSE, "Last subs: %lld Current position: %lld\n",
last_displayed_subs_ms, l);
dbg_print(CCX_DMT_VERBOSE, "Not before: %lld Not after: %lld\n",
ccx_options.startcreditsnotbefore.time_in_ms,
ccx_options.startcreditsnotafter.time_in_ms);
dbg_print(CCX_DMT_VERBOSE, "Start of window: %lld End of window: %lld\n",st,end);
if (window>length+2)
{
// Center in time window
LLONG pad=window-length;
st+=(pad/2);
}
end=st+length;
switch (ccx_options.write_format)
{
case CCX_OF_SRT:
write_stringz_as_srt(ccx_options.start_credits_text,context,st,end);
break;
case CCX_OF_SAMI:
write_stringz_as_sami(ccx_options.start_credits_text, context, st, end);
break;
case CCX_OF_SMPTETT:
write_stringz_as_smptett(ccx_options.start_credits_text, context, st, end);
break;
default:
// Do nothing for the rest
break;
}
startcredits_displayed=1;
return;
}

View File

@@ -1,129 +0,0 @@
#include "ccextractor.h"
void write_stringz_as_sami(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
{
sprintf ((char *) str,
"<SYNC start=%llu><P class=\"UNKNOWNCC\">\r\n",
(unsigned long long)ms_start);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write (context->out->fh, enc_buffer,enc_buffer_used);
int len=strlen (string);
unsigned char *unescaped= (unsigned char *) malloc (len+1);
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
if (el==NULL || unescaped==NULL)
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_sami() - not enough memory.\n");
int pos_r=0;
int pos_w=0;
// Scan for \n in the string and replace it with a 0
while (pos_r<len)
{
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
{
unescaped[pos_w]=0;
pos_r+=2;
}
else
{
unescaped[pos_w]=string[pos_r];
pos_r++;
}
pos_w++;
}
unescaped[pos_w]=0;
// Now read the unescaped string (now several string'z and write them)
unsigned char *begin=unescaped;
while (begin<unescaped+len)
{
unsigned int u = encode_line (el, begin);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write(context->out->fh, el, u);
write(context->out->fh, encoded_br, encoded_br_length);
write(context->out->fh, encoded_crlf, encoded_crlf_length);
begin+= strlen ((const char *) begin)+1;
}
sprintf ((char *) str,"</P></SYNC>\r\n");
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
sprintf ((char *) str,
"<SYNC start=%llu><P class=\"UNKNOWNCC\">&nbsp;</P></SYNC>\r\n\r\n",
(unsigned long long)ms_end);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
}
int write_cc_buffer_as_sami(struct eia608_screen *data, struct s_context_cc608 *context)
{
LLONG startms, endms;
int wrote_something=0;
startms = context->current_visible_start_ms;
startms+=subs_delay;
if (startms<0) // Drop screens that because of subs_delay start too early
return 0;
endms = get_visible_end()+subs_delay;
endms--; // To prevent overlapping with next line.
sprintf ((char *) str,
"<SYNC start=%llu><P class=\"UNKNOWNCC\">\r\n",
(unsigned long long)startms);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write (context->out->fh, enc_buffer,enc_buffer_used);
for (int i=0;i<15;i++)
{
if (data->row_used[i])
{
int length = get_decoder_line_encoded (subline, i, data);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write (context->out->fh, subline, length);
wrote_something=1;
if (i!=14)
write (context->out->fh, encoded_br, encoded_br_length);
write (context->out->fh,encoded_crlf, encoded_crlf_length);
}
}
sprintf ((char *) str,"</P></SYNC>\r\n");
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
sprintf ((char *) str,
"<SYNC start=%llu><P class=\"UNKNOWNCC\">&nbsp;</P></SYNC>\r\n\r\n",
(unsigned long long)endms);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
return wrote_something;
}

View File

@@ -1,156 +0,0 @@
#include "ccextractor.h"
// Produces minimally-compliant SMPTE Timed Text (W3C TTML)
// format-compatible output
// See http://www.w3.org/TR/ttaf1-dfxp/ and
// https://www.smpte.org/sites/default/files/st2052-1-2010.pdf
// Copyright (C) 2012 John Kemp
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void write_stringz_as_smptett(char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
{
unsigned h1,m1,s1,ms1;
unsigned h2,m2,s2,ms2;
mstotime (ms_start,&h1,&m1,&s1,&ms1);
mstotime (ms_end-1,&h2,&m2,&s2,&ms2);
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\" end=\"%02u:%02u:%02u.%03u\">\r\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write (context->out->fh, enc_buffer,enc_buffer_used);
int len=strlen (string);
unsigned char *unescaped= (unsigned char *) malloc (len+1);
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
if (el==NULL || unescaped==NULL)
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_sami() - not enough memory.\n");
int pos_r=0;
int pos_w=0;
// Scan for \n in the string and replace it with a 0
while (pos_r<len)
{
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
{
unescaped[pos_w]=0;
pos_r+=2;
}
else
{
unescaped[pos_w]=string[pos_r];
pos_r++;
}
pos_w++;
}
unescaped[pos_w]=0;
// Now read the unescaped string (now several string'z and write them)
unsigned char *begin=unescaped;
while (begin<unescaped+len)
{
unsigned int u = encode_line (el, begin);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write(context->out->fh, el, u);
//write (wb->fh, encoded_br, encoded_br_length);
write(context->out->fh, encoded_crlf, encoded_crlf_length);
begin+= strlen ((const char *) begin)+1;
}
sprintf ((char *) str,"</p>\n");
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\">\n\n",h2,m2,s2,ms2);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write (context->out->fh, enc_buffer,enc_buffer_used);
sprintf ((char *) str,"</p>\n");
}
int write_cc_buffer_as_smptett(struct eia608_screen *data, struct s_context_cc608 *context)
{
unsigned h1,m1,s1,ms1;
unsigned h2,m2,s2,ms2;
LLONG endms;
int wrote_something=0;
LLONG startms = context->current_visible_start_ms;
startms+=subs_delay;
if (startms<0) // Drop screens that because of subs_delay start too early
return 0;
endms = get_visible_end()+subs_delay;
endms--; // To prevent overlapping with next line.
mstotime (startms,&h1,&m1,&s1,&ms1);
mstotime (endms-1,&h2,&m2,&s2,&ms2);
sprintf ((char *) str,"<p begin=\"%02u:%02u:%02u,%03u\" end=\"%02u:%02u:%02u,%03u\">\n",h1,m1,s1,ms1, h2,m2,s2,ms2);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
for (int i=0;i<15;i++)
{
if (data->row_used[i])
{
int length = get_decoder_line_encoded (subline, i, data);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write(context->out->fh, subline, length);
wrote_something=1;
write(context->out->fh, encoded_crlf, encoded_crlf_length);
}
}
sprintf ((char *) str,"</p>\n");
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
write(context->out->fh, enc_buffer, enc_buffer_used);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r%s\n", str);
}
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) str);
//write (wb->fh, enc_buffer,enc_buffer_used);
return wrote_something;
}

View File

@@ -1,279 +0,0 @@
#include <assert.h>
#include <sys/stat.h>
#include "608_spupng.h"
void
draw_row(struct eia608_screen* data, int row, uint8_t * canvas, int rowstride)
{
int column;
int unicode = 0;
uint8_t pen[2];
uint8_t* cell;
int first = -1;
int last = 0;
pen[0] = COL_BLACK;
for (column = 0; column < COLUMNS ; column++) {
if (COL_TRANSPARENT != data->colors[row][column])
{
cell = canvas + ((column+1) * CCW);
get_char_in_unicode((unsigned char*)&unicode, data->characters[row][column]);
pen[1] = data->colors[row][column];
int attr = data->fonts[row][column];
draw_char_indexed(cell, rowstride, pen, unicode, (attr & FONT_ITALICS) != 0, (attr & FONT_UNDERLINED) != 0);
if (first < 0)
{
// draw a printable space before the first non-space char
first = column;
if (unicode != 0x20)
{
cell = canvas + ((first) * CCW);
draw_char_indexed(cell, rowstride, pen, 0x20, 0, 0);
}
}
last = column;
}
}
// draw a printable space after the last non-space char
// unicode should still contain the last character
// check whether it is a space
if (unicode != 0x20)
{
cell = canvas + ((last+2) * CCW);
draw_char_indexed(cell, rowstride, pen, 0x20, 0, 0);
}
}
static png_color palette[10] =
{
{ 0xff, 0xff, 0xff }, // COL_WHITE = 0,
{ 0x00, 0xff, 0x00 }, // COL_GREEN = 1,
{ 0x00, 0x00, 0xff }, // COL_BLUE = 2,
{ 0x00, 0xff, 0xff }, // COL_CYAN = 3,
{ 0xff, 0x00, 0x00 }, // COL_RED = 4,
{ 0xff, 0xff, 0x00 }, // COL_YELLOW = 5,
{ 0xff, 0x00, 0xff }, // COL_MAGENTA = 6,
{ 0xff, 0xff, 0xff }, // COL_USERDEFINED = 7,
{ 0x00, 0x00, 0x00 }, // COL_BLACK = 8
{ 0x00, 0x00, 0x00 } // COL_TRANSPARENT = 9
};
static png_byte alpha[10] =
{
255,
255,
255,
255,
255,
255,
255,
255,
255,
0
};
int
spupng_write_png(struct spupng_t *sp, struct eia608_screen* data,
png_structp png_ptr, png_infop info_ptr,
png_bytep image,
png_bytep* row_pointer,
unsigned int ww, unsigned int wh)
{
unsigned int i;
if (setjmp(png_jmpbuf(png_ptr)))
return 0;
png_init_io (png_ptr, sp->fppng);
png_set_IHDR (png_ptr,
info_ptr,
ww,
wh,
/* bit_depth */ 8,
PNG_COLOR_TYPE_PALETTE,
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
png_set_PLTE (png_ptr, info_ptr, palette, sizeof(palette) / sizeof(palette[0]));
png_set_tRNS (png_ptr, info_ptr, alpha, sizeof(alpha) / sizeof(alpha[0]), NULL);
png_set_gAMA (png_ptr, info_ptr, 1.0 / 2.2);
png_write_info (png_ptr, info_ptr);
for (i = 0; i < wh; i++)
row_pointer[i] = image + i * ww;
png_write_image (png_ptr, row_pointer);
png_write_end (png_ptr, info_ptr);
return 1;
}
int
spupng_export_png(struct spupng_t *sp, struct eia608_screen* data)
{
png_structp png_ptr;
png_infop info_ptr;
png_bytep *row_pointer;
png_bytep image;
int ww, wh, rowstride, row_adv;
int row;
assert ((sizeof(png_byte) == sizeof(uint8_t))
&& (sizeof(*image) == sizeof(uint8_t)));
// Allow space at beginning and end of each row for a padding space
ww = CCW * (COLUMNS+2);
wh = CCH * ROWS;
row_adv = (COLUMNS+2) * CCW * CCH;
rowstride = ww * sizeof(*image);
if (!(row_pointer = (png_bytep*)malloc(sizeof(*row_pointer) * wh))) {
mprint("Unable to allocate %d byte buffer.\n",
sizeof(*row_pointer) * wh);
return 0;
}
if (!(image = (png_bytep)malloc(wh * ww * sizeof(*image)))) {
mprint("Unable to allocate %d KB image buffer.",
wh * ww * sizeof(*image) / 1024);
free(row_pointer);
return 0;
}
// Initialize image to transparent
memset(image, COL_TRANSPARENT, wh * ww * sizeof(*image));
/* draw the image */
for (row = 0; row < ROWS; row++) {
if (data->row_used[row])
draw_row(data, row, image + row * row_adv, rowstride);
}
/* Now save the image */
if (!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
NULL, NULL, NULL)))
goto unknown_error;
if (!(info_ptr = png_create_info_struct(png_ptr))) {
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
goto unknown_error;
}
if (!spupng_write_png (sp, data, png_ptr, info_ptr, image, row_pointer, ww, wh)) {
png_destroy_write_struct (&png_ptr, &info_ptr);
goto write_error;
}
png_destroy_write_struct (&png_ptr, &info_ptr);
free (row_pointer);
free (image);
return 1;
write_error:
unknown_error:
free (row_pointer);
free (image);
return 0;
}
int
spupng_write_ccbuffer(struct spupng_t *sp, struct eia608_screen* data,
struct s_context_cc608 *context)
{
LLONG ms_start = context->current_visible_start_ms + subs_delay;
if (ms_start < 0)
{
dbg_print(CCX_DMT_VERBOSE, "Negative start\n");
return 0;
}
int row;
int empty_buf = 1;
char str[256] = "";
for (row = 0; row < 15; row++)
{
if (data->row_used[row])
{
empty_buf = 0;
break;
}
}
if (empty_buf)
{
dbg_print(CCX_DMT_VERBOSE, "Blank page\n");
return 0;
}
LLONG ms_end = get_visible_end() + subs_delay;
sprintf(sp->pngfile, "%s/sub%04d.png", sp->dirname, sp->fileIndex++);
if ((sp->fppng = fopen(sp->pngfile, "wb")) == NULL)
{
fatal(EXIT_FILE_CREATION_FAILED, "Cannot open %s: %s\n",
sp->pngfile, strerror(errno));
}
if (!spupng_export_png(sp, data))
{
fatal(EXIT_FILE_CREATION_FAILED, "Cannot write %s: %s\n",
sp->pngfile, strerror(errno));
}
fclose(sp->fppng);
write_sputag(sp,ms_start,ms_end);
for (row = 0; row < ROWS; row++)
{
if (data->row_used[row])
{
int len = get_decoder_line_encoded(subline, row, data);
// Check for characters that spumux won't parse
// null chars will be changed to space
// pairs of dashes will be changed to underscores
for (unsigned char* ptr = subline; ptr < subline+len; ptr++)
{
switch (*ptr)
{
case 0:
*ptr = ' ';
break;
case '-':
if (*(ptr+1) == '-')
{
*ptr++ = '_';
*ptr = '_';
}
break;
}
}
strncat(str,(const char*)subline,256);
strncat(str,"\n",256);
}
}
write_spucomment(sp,str);
return 1;
}
int write_cc_buffer_as_spupng(struct eia608_screen *data,struct s_context_cc608 *context)
{
if (0 != context->out->spupng_data)
{
struct spupng_t *sp = (struct spupng_t *) context->out->spupng_data;
return spupng_write_ccbuffer(sp, data, context);
}
return 0;
}

View File

@@ -1,195 +0,0 @@
#include "ccextractor.h"
/* The timing here is not PTS based, but output based, i.e. user delay must be accounted for
if there is any */
void write_stringz_as_srt (char *string, struct s_context_cc608 *context, LLONG ms_start, LLONG ms_end)
{
unsigned h1,m1,s1,ms1;
unsigned h2,m2,s2,ms2;
mstotime (ms_start,&h1,&m1,&s1,&ms1);
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
char timeline[128];
context->srt_counter++;
sprintf(timeline, "%u\r\n", context->srt_counter);
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
write(context->out->fh, enc_buffer, enc_buffer_used);
sprintf (timeline, "%02u:%02u:%02u,%03u --> %02u:%02u:%02u,%03u\r\n",
h1,m1,s1,ms1, h2,m2,s2,ms2);
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
dbg_print(CCX_DMT_608, "\n- - - SRT caption - - -\n");
dbg_print(CCX_DMT_608, "%s",timeline);
write(context->out->fh, enc_buffer, enc_buffer_used);
int len=strlen (string);
unsigned char *unescaped= (unsigned char *) malloc (len+1);
unsigned char *el = (unsigned char *) malloc (len*3+1); // Be generous
if (el==NULL || unescaped==NULL)
fatal (EXIT_NOT_ENOUGH_MEMORY, "In write_stringz_as_srt() - not enough memory.\n");
int pos_r=0;
int pos_w=0;
// Scan for \n in the string and replace it with a 0
while (pos_r<len)
{
if (string[pos_r]=='\\' && string[pos_r+1]=='n')
{
unescaped[pos_w]=0;
pos_r+=2;
}
else
{
unescaped[pos_w]=string[pos_r];
pos_r++;
}
pos_w++;
}
unescaped[pos_w]=0;
// Now read the unescaped string (now several string'z and write them)
unsigned char *begin=unescaped;
while (begin<unescaped+len)
{
unsigned int u = encode_line (el, begin);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write(context->out->fh, el, u);
write(context->out->fh, encoded_crlf, encoded_crlf_length);
begin+= strlen ((const char *) begin)+1;
}
dbg_print(CCX_DMT_608, "- - - - - - - - - - - -\r\n");
write(context->out->fh, encoded_crlf, encoded_crlf_length);
free(el);
}
int write_cc_buffer_as_srt(struct eia608_screen *data, struct s_context_cc608 *context)
{
unsigned h1,m1,s1,ms1;
unsigned h2,m2,s2,ms2;
LLONG ms_start, ms_end;
int wrote_something = 0;
ms_start = context->current_visible_start_ms;
int prev_line_start=-1, prev_line_end=-1; // Column in which the previous line started and ended, for autodash
int prev_line_center1=-1, prev_line_center2=-1; // Center column of previous line text
int empty_buf=1;
for (int i=0;i<15;i++)
{
if (data->row_used[i])
{
empty_buf=0;
break;
}
}
if (empty_buf) // Prevent writing empty screens. Not needed in .srt
return 0;
ms_start+=subs_delay;
if (ms_start<0) // Drop screens that because of subs_delay start too early
return 0;
ms_end=get_visible_end()+subs_delay;
mstotime (ms_start,&h1,&m1,&s1,&ms1);
mstotime (ms_end-1,&h2,&m2,&s2,&ms2); // -1 To prevent overlapping with next line.
char timeline[128];
context->srt_counter++;
sprintf(timeline, "%u\r\n", context->srt_counter);
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
write(context->out->fh, enc_buffer, enc_buffer_used);
sprintf (timeline, "%02u:%02u:%02u,%03u --> %02u:%02u:%02u,%03u\r\n",
h1,m1,s1,ms1, h2,m2,s2,ms2);
enc_buffer_used=encode_line (enc_buffer,(unsigned char *) timeline);
dbg_print(CCX_DMT_608, "\n- - - SRT caption ( %d) - - -\n", context->srt_counter);
dbg_print(CCX_DMT_608, "%s",timeline);
write (context->out->fh, enc_buffer,enc_buffer_used);
for (int i=0;i<15;i++)
{
if (data->row_used[i])
{
if (ccx_options.sentence_cap)
{
capitalize (i,data);
correct_case(i,data);
}
if (ccx_options.autodash && ccx_options.trim_subs)
{
int first=0, last=31, center1=-1, center2=-1;
unsigned char *line = data->characters[i];
int do_dash=1, colon_pos=-1;
find_limit_characters(line,&first,&last);
if (first==-1 || last==-1) // Probably a bug somewhere though
break;
// Is there a speaker named, for example: TOM: What are you doing?
for (int j=first;j<=last;j++)
{
if (line[j]==':')
{
colon_pos=j;
break;
}
if (!isupper (line[j]))
break;
}
if (prev_line_start==-1)
do_dash=0;
if (first==prev_line_start) // Case of left alignment
do_dash=0;
if (last==prev_line_end) // Right align
do_dash=0;
if (first>prev_line_start && last<prev_line_end) // Fully contained
do_dash=0;
if ((first>prev_line_start && first<prev_line_end) || // Overlap
(last>prev_line_start && last<prev_line_end))
do_dash=0;
center1=(first+last)/2;
if (colon_pos!=-1)
{
while (colon_pos<CC608_SCREEN_WIDTH &&
(line[colon_pos]==':' ||
line[colon_pos]==' ' ||
line[colon_pos]==0x89))
colon_pos++; // Find actual text
center2=(colon_pos+last)/2;
}
else
center2=center1;
if (center1>=prev_line_center1-1 && center1<=prev_line_center1+1 && center1!=-1) // Center align
do_dash=0;
if (center2>=prev_line_center2-2 && center1<=prev_line_center2+2 && center1!=-1) // Center align
do_dash=0;
if (do_dash)
write(context->out->fh, "- ", 2);
prev_line_start=first;
prev_line_end=last;
prev_line_center1=center1;
prev_line_center2=center2;
}
int length = get_decoder_line_encoded (subline, i, data);
if (ccx_options.encoding!=CCX_ENC_UNICODE)
{
dbg_print(CCX_DMT_608, "\r");
dbg_print(CCX_DMT_608, "%s\n",subline);
}
write(context->out->fh, subline, length);
write(context->out->fh, encoded_crlf, encoded_crlf_length);
wrote_something=1;
// fprintf (wb->fh,encoded_crlf);
}
}
dbg_print(CCX_DMT_608, "- - - - - - - - - - - -\r\n");
// fprintf (wb->fh, encoded_crlf);
write (context->out->fh, encoded_crlf, encoded_crlf_length);
return wrote_something;
}

1239
src/708.c

File diff suppressed because it is too large Load Diff

292
src/708.h
View File

@@ -1,292 +0,0 @@
#ifndef _INCLUDE_708_
#define _INCLUDE_708_
#define MAX_708_PACKET_LENGTH 128
#define I708_MAX_ROWS 15
#define I708_MAX_COLUMNS 42
#define I708_SCREENGRID_ROWS 75
#define I708_SCREENGRID_COLUMNS 210
#define I708_MAX_WINDOWS 8
enum COMMANDS_C0_CODES
{
NUL=0,
ETX=3,
BS=8,
FF=0xC,
CR=0xD,
HCR=0xE,
EXT1=0x10,
P16=0x18
};
enum COMMANDS_C1_CODES
{
CW0=0x80,
CW1=0x81,
CW2=0x82,
CW3=0x83,
CW4=0x84,
CW5=0x85,
CW6=0x86,
CW7=0x87,
CLW=0x88,
DSW=0x89,
HDW=0x8A,
TGW=0x8B,
DLW=0x8C,
DLY=0x8D,
DLC=0x8E,
RST=0x8F,
SPA=0x90,
SPC=0x91,
SPL=0x92,
RSV93=0x93,
RSV94=0x94,
RSV95=0x95,
RSV96=0x96,
SWA=0x97,
DF0=0x98,
DF1=0x99,
DF2=0x9A,
DF3=0x9B,
DF4=0x9C,
DF5=0x9D,
DF6=0x9E,
DF7=0x9F
};
struct S_COMMANDS_C1
{
int code;
const char *name;
const char *description;
int length;
};
enum eWindowsAttribJustify
{
left=0,
right=1,
center=2,
full=3
};
enum eWindowsAttribPrintDirection
{
pd_left_to_right=0,
pd_right_to_left=1,
pd_top_to_bottom=2,
pd_bottom_to_top=3
};
enum eWindowsAttribScrollDirection
{
sd_left_to_right=0,
sd_right_to_left=1,
sd_top_to_bottom=2,
sd_bottom_to_top=3
};
enum eWindowsAttribScrollDisplayEffect
{
snap=0,
fade=1,
wipe=2
};
enum eWindowsAttribEffectDirection
{
left_to_right=0,
right_to_left=1,
top_to_bottom=2,
bottom_to_top=3
};
enum eWindowsAttribFillOpacity
{
solid=0,
flash=1,
traslucent=2,
transparent=3
};
enum eWindowsAttribBorderType
{
none=0,
raised=1,
depressed=2,
uniform=3,
shadow_left=4,
shadow_right=5
};
enum ePenAttribSize
{
pensize_small=0,
pensize_standard=1,
pensize_large=2
};
enum ePenAttribFontStyle
{
fontstyle_default_or_undefined=0,
monospaced_with_serifs=1,
proportionally_spaced_with_serifs=2,
monospaced_without_serifs=3,
proportionally_spaced_without_serifs=4,
casual_font_type=5,
cursive_font_type=6,
small_capitals=7
};
enum ePanAttribTextTag
{
texttag_dialog=0,
texttag_source_or_speaker_id=1,
texttag_electronic_voice=2,
texttag_foreign_language=3,
texttag_voiceover=4,
texttag_audible_translation=5,
texttag_subtitle_translation=6,
texttag_voice_quality_description=7,
texttag_song_lyrics=8,
texttag_sound_effect_description=9,
texttag_musical_score_description=10,
texttag_expletitive=11,
texttag_undefined_12=12,
texttag_undefined_13=13,
texttag_undefined_14=14,
texttag_not_to_be_displayed=15
};
enum ePanAttribOffset
{
offset_subscript=0,
offset_normal=1,
offset_superscript=2
};
enum ePanAttribEdgeType
{
edgetype_none=0,
edgetype_raised=1,
edgetype_depressed=2,
edgetype_uniform=3,
edgetype_left_drop_shadow=4,
edgetype_right_drop_shadow=5
};
enum eAnchorPoints
{
anchorpoint_top_left = 0,
anchorpoint_top_center = 1,
anchorpoint_top_right =2,
anchorpoint_middle_left = 3,
anchorpoint_middle_center = 4,
anchorpoint_middle_right = 5,
anchorpoint_bottom_left = 6,
anchorpoint_bottom_center = 7,
anchorpoint_bottom_right = 8
};
typedef struct e708Pen_color
{
int fg_color;
int fg_opacity;
int bg_color;
int bg_opacity;
int edge_color;
} e708Pen_color;
typedef struct e708Pen_attribs
{
int pen_size;
int offset;
int text_tag;
int font_tag;
int edge_type;
int underline;
int italic;
} e708Pen_attribs;
typedef struct e708Window_attribs
{
int fill_color;
int fill_opacity;
int border_color;
int border_type01;
int justify;
int scroll_dir;
int print_dir;
int word_wrap;
int border_type;
int display_eff;
int effect_dir;
int effect_speed;
} e708Window_attribs;
typedef struct e708Window
{
int is_defined;
int number; // Handy, in case we only have a pointer to the window
int priority;
int col_lock;
int row_lock;
int visible;
int anchor_vertical;
int relative_pos;
int anchor_horizontal;
int row_count;
int anchor_point;
int col_count;
int pen_style;
int win_style;
unsigned char commands[6]; // Commands used to create this window
e708Window_attribs attribs;
e708Pen_attribs pen;
e708Pen_color pen_color;
int pen_row;
int pen_column;
unsigned char *rows[I708_MAX_ROWS+1]; // Max is 15, but we define an extra one for convenience
int memory_reserved;
int is_empty;
} e708Window;
typedef struct tvscreen
{
unsigned char chars[I708_SCREENGRID_ROWS][I708_SCREENGRID_COLUMNS+1];
}
tvscreen;
typedef struct cc708_service_decoder
{
e708Window windows[I708_MAX_WINDOWS];
int current_window;
int inited;
LLONG current_visible_start_ms;
tvscreen tv1, tv2; // Current and previous "screenfuls", note that we switch between them
int is_empty_tv1, is_empty_tv2;
int cur_tv; // 1 or 2 rather than 0 or 1, to at least be consistent with the decoder
tvscreen *tv; // Pointer to the current TV buffer
char *filename; // Where we are going to write our output
int fh; // Handle to output file. -1 if not yet open
int srt_counter;
}
cc708_service_decoder;
extern int resets_708;
void do_708 (const unsigned char *data, int datalength);
void init_708(void);
unsigned char get_internal_from_G0 (unsigned char g0_char);
unsigned char get_internal_from_G1 (unsigned char g1_char);
unsigned char get_internal_from_G2 (unsigned char g2_char);
unsigned char get_internal_from_G3 (unsigned char g3_char);
void process_character (cc708_service_decoder *decoder, unsigned char internal_char);
#endif

View File

@@ -1,45 +0,0 @@
/********************************************************
256 BYTES IS ENOUGH FOR ALL THE SUPPORTED CHARACTERS IN
EIA-708, SO INTERNALLY WE USE THIS TABLE (FOR CONVENIENCE)
00-1F -> Characters that are in the G2 group in 20-3F,
except for 06, which is used for the closed captions
sign "CC" which is defined in group G3 as 00. (this
is by the article 33).
20-7F -> Group G0 as is - corresponds to the ASCII code
80-9F -> Characters that are in the G2 group in 60-7F
(there are several blank characters here, that's OK)
A0-FF -> Group G1 as is - non-English characters and symbols
*/
unsigned char get_internal_from_G0 (unsigned char g0_char)
{
return g0_char;
}
unsigned char get_internal_from_G1 (unsigned char g1_char)
{
return g1_char;
}
// TODO: Probably not right
// G2: Extended Control Code Set 1
unsigned char get_internal_from_G2 (unsigned char g2_char)
{
if (g2_char>=0x20 && g2_char<=0x3F)
return g2_char-0x20;
if (g2_char>=0x60 && g2_char<=0x7F)
return g2_char+0x20;
// Rest unmapped, so we return a blank space
return 0x20;
}
// TODO: Probably not right
// G3: Future Characters and Icon Expansion
unsigned char get_internal_from_G3 (unsigned char g3_char)
{
if (g3_char==0xa0) // The "CC" (closed captions) sign
return 0x06;
// Rest unmapped, so we return a blank space
return 0x20;
}

View File

@@ -0,0 +1,6 @@
/**
* the configured options and settings for CCExtractor
*/
#define CCExtractor_VERSION_MAJOR @CCEXTRACTOR_VERSION_MAJOR@
#define CCExtractor_VERSION_MINOR @CCEXTRACTOR_VERSION_MINOR@

118
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,118 @@
cmake_minimum_required (VERSION 3.0.2)
project (CCExtractor)
option (WITH_FFMPEG "Build using FFmpeg demuxer and decoder" OFF)
option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF)
option (WITH_SHARING "Build with sharing and translation support" OFF)
# Version number
set (CCEXTRACTOR_VERSION_MAJOR 0)
set (CCEXTRACTOR_VERSION_MINOR 77)
# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/CCExtractorConfig.h.in"
"${PROJECT_BINARY_DIR}/CCExtractorConfig.h"
)
include_directories ("${PROJECT_SOURCE_DIR}")
include_directories ("${PROJECT_SOURCE_DIR}/lib_ccx")
include_directories ("${PROJECT_SOURCE_DIR}/utf8proc")
include_directories ("${PROJECT_SOURCE_DIR}/gpacmp4/")
include_directories ("${PROJECT_SOURCE_DIR}/protobuf-c/")
include_directories ("${PROJECT_SOURCE_DIR}/zvbi")
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash" SOURCEFILE)
# Adding some platform specific library path
link_directories (/opt/local/lib)
link_directories (/usr/local/lib)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall -g -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64")
add_subdirectory (lib_ccx)
aux_source_directory (${PROJECT_SOURCE_DIR} SOURCEFILE)
set (EXTRA_LIBS ${EXTRA_LIBS} ccx)
set (EXTRA_LIBS ${EXTRA_LIBS} m)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (EXTRA_LIBS ${EXTRA_LIBS} iconv)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package (PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PNG libpng )
if(PNG_FOUND)
set (EXTRA_LIBS ${EXTRA_LIBS} png)
else (PNG_FOUND)
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
endif(PNG_FOUND)
else(PKG_CONFIG_FOUND)
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJEXT_SOURCE_DIR}/zlib/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
endif (PKG_CONFIG_FOUND)
########################################################
# Build using FFmpeg libraries
########################################################
if (PKG_CONFIG_FOUND AND WITH_FFMPEG)
pkg_check_modules (AVFORMAT REQUIRED libavformat)
pkg_check_modules (AVUTIL REQUIRED libavutil)
pkg_check_modules (AVCODEC REQUIRED libavcodec)
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_STATIC_LIBRARIES})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
endif (PKG_CONFIG_FOUND AND WITH_FFMPEG)
########################################################
# Build with OCR using leptonica and tesseract libraries
########################################################
if (WITH_OCR)
find_package(PkgConfig)
pkg_check_modules (TESSERACT REQUIRED tesseract)
pkg_check_modules (LEPTONICA REQUIRED lept)
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR ${TESSERACT_CFLAGS} ${LEPTONICA_CFLAGS}")
endif (WITH_OCR)
########################################################
# Build with CC sharing and translation support
########################################################
if (WITH_SHARING)
find_package(PkgConfig)
pkg_check_modules (NANOMSG REQUIRED libnanomsg)
set (EXTRA_LIBS ${EXTRA_LIBS} ${NANOMSG_STATIC_LIBRARIES})
include_directories ("${PROJECT_SOURCE_DIR}/protobuf-c/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SHARING")
endif (WITH_SHARING)
add_executable (ccextractor ${SOURCEFILE})
target_link_libraries (ccextractor ${EXTRA_LIBS})
install (TARGETS ccextractor DESTINATION bin)

View File

@@ -1,147 +0,0 @@
/* This file contains functions that report the user of the GUI of
relevant events. */
#include "ccextractor.h"
static int credits_shown=0;
unsigned long net_activity_gui=0;
/* Print current progress. For percentaje, -1 -> streaming mode */
void activity_progress (int percentaje, int cur_min, int cur_sec)
{
if (!ccx_options.no_progress_bar)
{
if (percentaje==-1)
mprint ("\rStreaming | %02d:%02d", cur_min, cur_sec);
else
mprint ("\r%3d%% | %02d:%02d",percentaje, cur_min, cur_sec);
}
fflush (stdout);
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###PROGRESS#%d#%d#%d\n", percentaje, cur_min, cur_sec);
fflush (stderr);
}
}
void activity_input_file_open (const char *filename)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###INPUTFILEOPEN#%s\n", filename);
fflush (stderr);
}
}
void activity_xds_program_identification_number (unsigned minutes, unsigned hours, unsigned date, unsigned month)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###XDSPROGRAMIDENTIFICATIONNUMBER#%u#%u#%u#%u\n", minutes,hours,date,month);
fflush (stderr);
}
}
void activity_xds_network_call_letters (const char *program_name)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###XDSNETWORKCALLLETTERS#%s\n", program_name);
fflush (stderr);
}
}
void activity_xds_program_name (const char *program_name)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###XDSPROGRAMNAME#%s\n", program_name);
fflush (stderr);
}
}
void activity_xds_program_description (int line_num, const char *program_desc)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###XDSPROGRAMDESC#%d#%s\n", line_num, program_desc);
fflush (stderr);
}
}
void activity_video_info (int hor_size,int vert_size,
const char *aspect_ratio, const char *framerate)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###VIDEOINFO#%u#%u#%s#%s\n",
hor_size,vert_size, aspect_ratio, framerate);
fflush (stderr);
}
}
void activity_message (const char *fmt, ...)
{
if (ccx_options.gui_mode_reports)
{
va_list args;
fprintf (stderr, "###MESSAGE#");
va_start(args, fmt);
fprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
fflush (stderr);
}
}
void activity_input_file_closed (void)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###INPUTFILECLOSED\n");
fflush (stderr);
}
}
void activity_program_number (unsigned program_number)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###TSPROGRAMNUMBER#%u\n",program_number);
fflush (stderr);
}
}
void activity_report_version (void)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###VERSION#CCExtractor#%s\n",VERSION);
fflush (stderr);
}
}
void activity_report_data_read (void)
{
if (ccx_options.gui_mode_reports)
{
fprintf (stderr, "###DATAREAD#%lu\n",net_activity_gui/1000);
fflush (stderr);
}
}
void activity_header (void)
{
if (!credits_shown)
{
credits_shown=1;
mprint ("CCExtractor %s, Carlos Fernandez Sanz, Volker Quetschke.\n", VERSION);
mprint ("Teletext portions taken from Petr Kutalek's telxcc\n");
mprint ("--------------------------------------------------------------------------\n");
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,375 +0,0 @@
#include "ccextractor.h"
// Hold functions to read streams on a bit or byte oriented basis
// plus some data related helper functions.
// Guidelines for all bitsream functions:
// * No function shall advance the pointer past the end marker
// * If bitstream.bitsleft < 0 do not attempt any read access,
// but decrease bitsleft by the number of bits that were
// attempted to read.
// Initialize bitstream
int init_bitstream(struct bitstream *bstr, unsigned char *start, unsigned char *end)
{
bstr->pos = start;
bstr->bpos = 8;
bstr->end = end;
bstr->bitsleft = (bstr->end - bstr->pos)*8;
bstr->error = 0;
bstr->_i_pos = NULL;
bstr->_i_bpos = 0;
if(bstr->bitsleft < 0)
{
// See if we can somehow recover of this disaster by reporting the problem instead of terminating.
mprint ( "init_bitstream: bitstream has negative length!");
return 1;
}
return 0;
}
// Read bnum bits from bitstream bstr with the most significant
// bit read first without advancing the bitstream pointer.
// A 64 bit unsigned integer is returned. 0 is returned when
// there are not enough bits left in the bitstream.
uint64_t next_bits(struct bitstream *bstr, unsigned bnum)
{
uint64_t res = 0;
if(bnum > 64)
fatal(EXIT_BUG_BUG, "next_bits: 64 is maximum bit number, argument: %u!", bnum);
// Sanity check
if(bstr->end - bstr->pos < 0)
fatal(EXIT_BUG_BUG, "next_bits: bitstream has negative length!");
// Keep a negative bitstream.bitsleft, but correct it.
if (bstr->bitsleft <= 0)
{
bstr->bitsleft -= bnum;
return 0;
}
// Calculate the remaining number of bits in bitstream after reading.
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bnum;
if (bstr->bitsleft < 0)
return 0;
// Special case for reading zero bits. Return zero
if(bnum == 0)
return 0;
int vbit = bstr->bpos;
unsigned char *vpos = bstr->pos;
if(vbit < 1 || vbit > 8)
{
fatal(EXIT_BUG_BUG, "next_bits: Illegal bit position value %d!", vbit);
}
while( 1 )
{
if(vpos >= bstr->end)
{
// We should not get here ...
fatal(EXIT_BUG_BUG, "next_bits: Reading after end of data ...");
}
res |= (*vpos & (0x01 << (vbit-1)) ? 1 : 0);
vbit--;
bnum--;
if(vbit == 0)
{
vpos++;
vbit = 8;
}
if(bnum)
{
res <<= 1;
}
else
break;
}
// Remember the bitstream position
bstr->_i_bpos = vbit;
bstr->_i_pos = vpos;
return res;
}
// Read bnum bits from bitstream bstr with the most significant
// bit read first. A 64 bit unsigned integer is returned.
uint64_t read_bits(struct bitstream *bstr, unsigned bnum)
{
uint64_t res = next_bits(bstr, bnum);
// Special case for reading zero bits. Also abort when not enough
// bits are left. Return zero
if(bnum == 0 || bstr->bitsleft < 0)
return 0;
// Advance the bitstream
bstr->bpos = bstr->_i_bpos;
bstr->pos = bstr->_i_pos;
return res;
}
// This function will advance the bitstream by bnum bits, if possible.
// Advancing of more than 64 bits is possible.
// Return TRUE when successfull, otherwise FALSE
int skip_bits(struct bitstream *bstr, unsigned bnum)
{
// Sanity check
if(bstr->end - bstr->pos < 0)
fatal(EXIT_BUG_BUG, "skip_bits: bitstream has negative length!");
// Keep a negative bstr->bitsleft, but correct it.
if (bstr->bitsleft < 0)
{
bstr->bitsleft -= bnum;
return 0;
}
// Calculate the remaining number of bits in bitstream after reading.
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bnum;
if (bstr->bitsleft < 0)
return 0;
// Special case for reading zero bits. Return zero
if(bnum == 0)
return 1;
bstr->bpos -= bnum%8;
bstr->pos += bnum/8;
if (bstr->bpos < 1)
{
bstr->bpos += 8;
bstr->pos += 1;
}
return 1;
}
// Return TRUE if the current position in the bitstream is on a byte
// boundary, i.e., the next bit in the bitstream is the first bit in
// a byte, otherwise return FALSE
int is_byte_aligned(struct bitstream *bstr)
{
// Sanity check
if(bstr->end - bstr->pos < 0)
fatal(EXIT_BUG_BUG, "is_byte_aligned: bitstream has negative length!");
int vbit = bstr->bpos;
if(vbit == 0 || vbit > 8)
{
fatal(EXIT_BUG_BUG, "is_byte_aligned: Illegal bit position value %d!\n", vbit);
}
if (vbit == 8)
return 1;
else
return 0;
}
// Move bitstream to next byte border. Adjust bitsleft.
void make_byte_aligned(struct bitstream *bstr)
{
// Sanity check
if(bstr->end - bstr->pos < 0)
fatal(EXIT_BUG_BUG, "make_byte_aligned: bitstream has negative length!");
int vbit = bstr->bpos;
if(vbit == 0 || vbit > 8)
{
fatal(EXIT_BUG_BUG, "make_byte_aligned: Illegal bit position value %d!\n", vbit);
}
// Keep a negative bstr->bitsleft, but correct it.
if (bstr->bitsleft < 0)
{
// Pay attention to the bit alignment
bstr->bitsleft = (bstr->bitsleft-7)/8 *8;
return;
}
if(bstr->bpos != 8)
{
bstr->bpos = 8;
bstr->pos += 1;
}
// Reset, in case a next_???() function was used before
bstr->bitsleft = 0LL + 8*(bstr->end-bstr->pos-1)+bstr->bpos;
return;
}
// Return pointer to first of bynum bytes from the bitstream if the
// following conditions are TRUE:
// The bitstream is byte aligned and there are enough bytes left in
// it to read bynum bytes. Otherwise return NULL.
// This function does not advance the bitstream pointer.
unsigned char *next_bytes(struct bitstream *bstr, unsigned bynum)
{
// Sanity check
if(bstr->end - bstr->pos < 0)
fatal(EXIT_BUG_BUG, "next_bytes: bitstream has negative length!");
// Keep a negative bstr->bitsleft, but correct it.
if (bstr->bitsleft < 0)
{
bstr->bitsleft -= bynum*8;
return NULL;
}
bstr->bitsleft = 0LL + (bstr->end - bstr->pos - 1)*8 + bstr->bpos - bynum*8;
if (!is_byte_aligned(bstr) || bstr->bitsleft < 0 || bynum < 1)
return NULL;
// Remember the bitstream position
bstr->_i_bpos = 8;
bstr->_i_pos = bstr->pos + bynum;
return bstr->pos;
}
// Return pointer to first of bynum bytes from the bitstream if the
// following conditions are TRUE:
// The bitstream is byte aligned and there are enough bytes left in
// it to read bynum bytes. Otherwise return NULL.
// This function does advance the bitstream pointer.
unsigned char *read_bytes(struct bitstream *bstr, unsigned bynum)
{
unsigned char *res = next_bytes(bstr, bynum);
// Advance the bitstream when a read was possible
if(res)
{
bstr->bpos = bstr->_i_bpos;
bstr->pos = bstr->_i_pos;
}
return res;
}
// Return an integer number with "bytes" precision from the current
// bitstream position. Allowed "bytes" values are 1,2,4,8.
// This function does advance the bitstream pointer when "advance" is
// set to TRUE.
// Numbers come MSB (most significant first), and we need to account for
// little-endian and big-endian CPUs.
uint64_t bitstream_get_num(struct bitstream *bstr, unsigned bytes, int advance)
{
void *bpos;
uint64_t rval=0;
if (advance)
bpos = read_bytes(bstr, bytes);
else
bpos = next_bytes(bstr, bytes);
if (!bpos)
return 0;
switch (bytes)
{
case 1:
case 2:
case 4:
case 8:
break;
default:
fatal (EXIT_BUG_BUG, "bitstream_get_num: Illegal precision value [%u]!",
bytes);
break;
}
for (unsigned i=0;i<bytes;i++)
{
unsigned char *ucpos=((unsigned char *)bpos) +bytes-i-1; // Read backwards
unsigned char uc=*ucpos;
rval=(rval<<8) + uc;
}
return rval;
}
// Read unsigned Exp-Golomb code from bitstream
uint64_t ue(struct bitstream *bstr)
{
uint64_t res = 0;
int zeros=0;
while(!read_bits(bstr,1))
zeros++;
res = (0x01 << zeros) - 1 + read_bits(bstr,zeros);
return res;
}
// Read signed Exp-Golomb code from bitstream
int64_t se(struct bitstream *bstr)
{
int64_t res = 0;
res = ue(bstr);
// The following function might truncate when res+1 overflows
//res = (res+1)/2 * (res % 2 ? 1 : -1);
// Use this:
res = (res/2+(res%2 ? 1 : 0)) * (res % 2 ? 1 : -1);
return res;
}
// Read unsigned integer with bnum bits length. Basically an
// alias for read_bits().
uint64_t u(struct bitstream *bstr, unsigned bnum)
{
return read_bits(bstr, bnum);
}
// Read signed integer with bnum bits length.
int64_t i(struct bitstream *bstr, unsigned bnum)
{
uint64_t res = read_bits(bstr, bnum);
// Special case for reading zero bits. Return zero
if(bnum == 0)
return 0;
return (0xFFFFFFFFFFFFFFFFULL << bnum) | res;
}
// Return the value with the bit order reversed.
uint8_t reverse8(uint8_t data)
{
uint8_t res = 0;
for (int k=0;k<8;k++)
{
res <<= 1;
res |= (data & (0x01 << k) ? 1 : 0);
}
return res;
}

View File

@@ -1,25 +0,0 @@
/* Functions used by both the 608 and 708 decoders. An effort should be
made to reuse, not duplicate, as many functions as possible */
#include "ccextractor.h"
/* This function returns a FTS that is guaranteed to be at least 1 ms later than the end of the previous screen. It shouldn't be needed
obviously but it guarantees there's no timing overlap */
LLONG get_visible_start (void)
{
LLONG fts = get_fts();
if (fts <= minimum_fts)
fts = minimum_fts+1;
dbg_print(CCX_DMT_608, "Visible Start time=%s\n", print_mstime(fts));
return fts;
}
/* This function returns the current FTS and saves it so it can be used by get_visible_start */
LLONG get_visible_end (void)
{
LLONG fts = get_fts();
if (fts>minimum_fts)
minimum_fts=fts;
dbg_print(CCX_DMT_608, "Visible End time=%s\n", print_mstime(fts));
return fts;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,605 +0,0 @@
#ifndef CCX_CCEXTRACTOR_H
#define CCX_CCEXTRACTOR_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <fcntl.h>
#include <stdarg.h>
#include <errno.h>
// compatibility across platforms
#include "platform.h"
#define VERSION "0.70"
extern int cc_buffer_saved; // Do we have anything in the CC buffer already?
extern int ccblocks_in_avc_total; // Total CC blocks found by the AVC code
extern int ccblocks_in_avc_lost; // CC blocks found by the AVC code lost due to overwrites (should be 0)
#include "608.h"
#include "708.h"
#include "bitstream.h"
#include "constants.h"
#define TS_PMT_MAP_SIZE 128
struct ccx_boundary_time
{
int hh,mm,ss;
LLONG time_in_ms;
int set;
};
typedef struct {
// TODO: add more options, and (perhaps) reduce other ccextractor options?
int showStartTime, showEndTime; // Show start and/or end time.
int showMode; // Show which mode if available (E.G.: POP, RU1, ...)
int showCC; // Show which CC channel has been captured.
int relativeTimestamp; // Timestamps relative to start of sample or in UTC?
int xds; // Show XDS or not
int useColors; // Add colors or no colors
} ccx_transcript_format;
extern ccx_transcript_format ccx_default_transcript_settings;
struct ccx_s_options // Options from user parameters
{
int extract; // Extract 1st, 2nd or both fields
int cc_channel; // Channel we want to dump in srt mode
int buffer_input;
int direct_rollup;
int nofontcolor;
int notypesetting;
struct ccx_boundary_time extraction_start, extraction_end; // Segment we actually process
int print_file_reports;
/* subtitle codec type */
enum cxx_code_type codec;
enum cxx_code_type nocodec;
/* Credit stuff */
char *start_credits_text;
char *end_credits_text;
struct ccx_boundary_time startcreditsnotbefore, startcreditsnotafter; // Where to insert start credits, if possible
struct ccx_boundary_time startcreditsforatleast, startcreditsforatmost; // How long to display them?
struct ccx_boundary_time endcreditsforatleast, endcreditsforatmost;
int binary_concat; // Disabled by -ve or --videoedited
int use_gop_as_pts; // Use GOP instead of PTS timing (0=do as needed, 1=always, -1=never)
int fix_padding; // Replace 0000 with 8080 in HDTV (needed for some cards)
int norollup; // If 1, write one line at a time
int forced_ru; // 0=Disabled, 1, 2 or 3=max lines in roll-up mode
int trim_subs; // " Remove spaces at sides? "
int gui_mode_reports; // If 1, output in stderr progress updates so the GUI can grab them
int no_progress_bar; // If 1, suppress the output of the progress to stdout
int sentence_cap ; // FIX CASE? = Fix case?
char *sentence_cap_file; // Extra words file?
int live_stream; /* -1 -> Not a complete file but a live stream, without timeout
0 -> A regular file
>0 -> Live stream with a timeout of this value in seconds */
int messages_target; // 0 = nowhere (quiet), 1=stdout, 2=stderr
/* Levenshtein's parameters, for string comparison */
int levdistmincnt, levdistmaxpct; // Means 2 fails or less is "the same", 10% or less is also "the same"
int investigate_packets; // Look for captions in all packets when everything else fails
int fullbin; // Disable pruning of padding cc blocks
int nosync; // Disable syncing
unsigned hauppauge_mode; // If 1, use PID=1003, process specially and so on
int wtvconvertfix; // Fix broken Windows 7 conversion
int wtvmpeg2;
int auto_myth; // Use myth-tv mpeg code? 0=no, 1=yes, 2=auto
/* MP4 related stuff */
unsigned mp4vidtrack; // Process the video track even if a CC dedicated track exists.
/* General settings */
int usepicorder; // Force the use of pic_order_cnt_lsb in AVC/H.264 data streams
int autodash; // Add dashes (-) before each speaker automatically?
unsigned teletext_mode; // 0=Disabled, 1 = Not found, 2=Found
ccx_transcript_format transcript_settings; // Keeps the settings for generating transcript output files.
char millis_separator;
LLONG screens_to_process; // How many screenfuls we want?
enum ccx_encoding_type encoding;
enum ccx_output_format write_format; // 0=Raw, 1=srt, 2=SMI
enum ccx_output_date_format date_format;
enum color_code cc608_default_color;
char *output_filename;
char *out_elementarystream_filename;
LLONG debug_mask; // dbg_print will use this mask to print or ignore different types
LLONG debug_mask_on_debug; // If we're using temp_debug to enable/disable debug "live", this is the mask when temp_debug=1
unsigned ts_autoprogram ; // Try to find a stream with captions automatically (no -pn needed)
unsigned ts_cappid ; // PID for stream that holds caption information
unsigned ts_forced_cappid ; // If 1, never mess with the selected PID
unsigned ts_forced_program; // Specific program to process in TS files, if ts_forced_program_selected==1
unsigned ts_forced_program_selected;
int ts_datastreamtype ; // User WANTED stream type (i.e. use the stream that has this type)
unsigned ts_forced_streamtype; // User selected (forced) stream type
/* Networking */
in_addr_t udpaddr;
unsigned udpport; // Non-zero => Listen for UDP packets on this port, no files.
int line_terminator_lf; // 0 = CRLF, 1=LF
int noautotimeref; // Do NOT set time automatically?
enum ccx_datasource input_source; // Files, stdin or network
};
struct ts_payload
{
unsigned char *start; // Payload start
unsigned length; // Payload length
unsigned pesstart; // PES or PSI start
unsigned pid; // Stream PID
int counter; // continuity counter
int transport_error; // 0 = packet OK, non-zero damaged
unsigned char section_buf[1024];
int section_index;
int section_size;
};
struct PAT_entry
{
unsigned program_number;
unsigned PMT_PID;
unsigned char *last_pmt_payload;
unsigned last_pmt_length;
};
struct PMT_entry
{
unsigned program_number;
unsigned PMT_PID;
unsigned elementary_PID;
unsigned ccx_stream_type;
unsigned printable_stream_type;
};
struct ccx_s_write
{
int fh;
char *filename;
void* spupng_data;
};
struct gop_time_code
{
int drop_frame_flag;
int time_code_hours;
int time_code_minutes;
int marker_bit;
int time_code_seconds;
int time_code_pictures;
int inited;
LLONG ms;
};
/* Report information */
#define SUB_STREAMS_CNT 10
struct file_report_t
{
unsigned program_cnt;
unsigned width;
unsigned height;
unsigned aspect_ratio;
unsigned frame_rate;
unsigned xds : 1;
unsigned cc_channels_608[4];
unsigned services708[63];
unsigned dvb_sub_pid[SUB_STREAMS_CNT];
unsigned tlt_sub_pid[SUB_STREAMS_CNT];
unsigned mp4_cc_track_cnt;
} file_report;
// Stuff for telcc.c
struct ccx_s_teletext_config {
uint8_t verbose : 1; // should telxcc be verbose?
uint16_t page; // teletext page containing cc we want to filter
uint16_t tid; // 13-bit packet ID for teletext stream
double offset; // time offset in seconds
uint8_t bom : 1; // print UTF-8 BOM characters at the beginning of output
uint8_t nonempty : 1; // produce at least one (dummy) frame
// uint8_t se_mode : 1; // search engine compatible mode => Uses CCExtractor's write_format
// uint64_t utc_refvalue; // UTC referential value => Moved to CCExtractor global, so can be used for 608 too
uint16_t user_page; // Page selected by user, which MIGHT be different to 'page' depending on autodetection stuff
};
#define buffered_skip(bytes) if (bytes<=bytesinbuffer-filebuffer_pos) { \
filebuffer_pos+=bytes; \
result=bytes; \
} else result=buffered_read_opt (NULL,bytes);
#define buffered_read(buffer,bytes) if (bytes<=bytesinbuffer-filebuffer_pos) { \
if (buffer!=NULL) memcpy (buffer,filebuffer+filebuffer_pos,bytes); \
filebuffer_pos+=bytes; \
result=bytes; \
} else { result=buffered_read_opt (buffer,bytes); if (ccx_options.gui_mode_reports && ccx_options.input_source==CCX_DS_NETWORK) {net_activity_gui++; if (!(net_activity_gui%1000))activity_report_data_read();}}
#define buffered_read_4(buffer) if (4<=bytesinbuffer-filebuffer_pos) { \
if (buffer) { buffer[0]=filebuffer[filebuffer_pos]; \
buffer[1]=filebuffer[filebuffer_pos+1]; \
buffer[2]=filebuffer[filebuffer_pos+2]; \
buffer[3]=filebuffer[filebuffer_pos+3]; \
filebuffer_pos+=4; \
result=4; } \
} else result=buffered_read_opt (buffer,4);
#define buffered_read_byte(buffer) if (bytesinbuffer-filebuffer_pos) { \
if (buffer) { *buffer=filebuffer[filebuffer_pos]; \
filebuffer_pos++; \
result=1; } \
} else result=buffered_read_opt (buffer,1);
extern LLONG buffered_read_opt (unsigned char *buffer, unsigned int bytes);
//params.c
void parse_parameters (int argc, char *argv[]);
void usage (void);
int atoi_hex (char *s);
int stringztoms (const char *s, struct ccx_boundary_time *bt);
// general_loop.c
void position_sanity_check ();
int init_file_buffer( void );
LLONG ps_getmoredata( void );
LLONG general_getmoredata( void );
void raw_loop (void);
LLONG process_raw (void);
void general_loop(void);
void processhex (char *filename);
void rcwt_loop( void );
#ifndef __cplusplus
#define false 0
#define true 1
#endif
// activity.c
void activity_header (void);
void activity_progress (int percentaje, int cur_min, int cur_sec);
void activity_report_version (void);
void activity_input_file_closed (void);
void activity_input_file_open (const char *filename);
void activity_message (const char *fmt, ...);
void activity_video_info (int hor_size,int vert_size,
const char *aspect_ratio, const char *framerate);
void activity_program_number (unsigned program_number);
void activity_xds_program_name (const char *program_name);
void activity_xds_network_call_letters (const char *program_name);
void activity_xds_program_identification_number (unsigned minutes, unsigned hours, unsigned date, unsigned month);
void activity_xds_program_description (int line_num, const char *program_desc);
void activity_report_data_read (void);
extern LLONG result;
extern int end_of_file;
extern LLONG inbuf;
extern int ccx_bufferdatatype; // Can be RAW or PES
// asf_functions.c
LLONG asf_getmoredata( void );
// wtv_functions.c
LLONG wtv_getmoredata( void );
// avc_functions.c
LLONG process_avc (unsigned char *avcbuf, LLONG avcbuflen);
void init_avc(void);
// es_functions.c
LLONG process_m2v (unsigned char *data, LLONG length);
extern unsigned top_field_first;
// es_userdata.c
int user_data(struct bitstream *ustream, int udtype);
// bitstream.c - see bitstream.h
// 608.c
int write_cc_buffer(struct s_context_cc608 *context);
unsigned char *debug_608toASC (unsigned char *ccdata, int channel);
// cc_decoders_common.c
LLONG get_visible_start (void);
LLONG get_visible_end (void);
// file_functions.c
LLONG getfilesize (int in);
LLONG gettotalfilessize (void);
void prepare_for_new_file (void);
void close_input_file (void);
int switch_to_next_file (LLONG bytesinbuffer);
int init_sockets (void);
void return_to_buffer (unsigned char *buffer, unsigned int bytes);
// timing.c
void set_fts(void);
LLONG get_fts(void);
LLONG get_fts_max(void);
char *print_mstime( LLONG mstime );
char *print_mstime2buf( LLONG mstime , char *buf );
void print_debug_timing( void );
int gop_accepted(struct gop_time_code* g );
void calculate_ms_gop_time (struct gop_time_code *g);
// sequencing.c
void init_hdcc (void);
void store_hdcc(unsigned char *cc_data, int cc_count, int sequence_number, LLONG current_fts);
void anchor_hdcc(int seq);
void process_hdcc (void);
int do_cb (unsigned char *cc_block);
// mp4.c
int processmp4 (char *file);
// params_dump.c
void params_dump(void);
void print_file_report(void);
// output.c
void init_write (struct ccx_s_write *wb);
void writeraw (const unsigned char *data, int length, struct ccx_s_write *wb);
void writedata(const unsigned char *data, int length, struct s_context_cc608 *context);
void flushbuffer (struct ccx_s_write *wb, int closefile);
void printdata (const unsigned char *data1, int length1,const unsigned char *data2, int length2);
void writercwtdata (const unsigned char *data);
// stream_functions.c
void detect_stream_type (void);
int detect_myth( void );
int read_video_pes_header (unsigned char *header, int *headerlength, int sbuflen);
int read_pts_pes(unsigned char*header, int len);
// ts_functions.c
void init_ts( void );
int ts_readpacket(void);
long ts_readstream(void);
LLONG ts_getmoredata( void );
int write_section(struct ts_payload *payload, unsigned char*buf, int size, int pos);
int parse_PMT (unsigned char *buf,int len, int pos);
int parse_PAT (void);
// myth.c
void myth_loop(void);
// mp4_bridge2bento4.c
void mp4_loop (char *filename);
// xds.c
void process_xds_bytes (const unsigned char hi, int lo);
void do_end_of_xds (unsigned char expected_checksum);
void xds_init();
// ccextractor.c
LLONG calculate_gop_mstime (struct gop_time_code *g);
void set_fts(void);
char *print_mstime( LLONG mstime );
void print_debug_timing( void );
int switch_to_next_file (LLONG bytesinbuffer);
// utility.c
void fatal(int exit_code, const char *fmt, ...);
void dvprint(const char *fmt, ...);
void mprint (const char *fmt, ...);
void subsprintf (const char *fmt, ...);
void dbg_print(LLONG mask, const char *fmt, ...);
void fdprintf (int fd, const char *fmt, ...);
void init_boundary_time (struct ccx_boundary_time *bt);
void sleep_secs (int secs);
void dump (LLONG mask, unsigned char *start, int l, unsigned long abs_start, unsigned clear_high_bit);
bool_t in_array(uint16_t *array, uint16_t length, uint16_t element) ;
int hex2int (char high, char low);
void timestamp_to_srttime(uint64_t timestamp, char *buffer);
void millis_to_date (uint64_t timestamp, char *buffer) ;
int levenshtein_dist (const uint64_t *s1, const uint64_t *s2, unsigned s1len, unsigned s2len);
void init_context_cc608(struct s_context_cc608 *data, int field);
unsigned encode_line (unsigned char *buffer, unsigned char *text);
void buffered_seek (int offset);
void write_subtitle_file_header(struct ccx_s_write *out);
void write_subtitle_file_footer(struct ccx_s_write *out);
extern void build_parity_table(void);
void tlt_process_pes_packet(uint8_t *buffer, uint16_t size) ;
void telxcc_init(void);
void telxcc_close(void);
void mstotime(LLONG milli, unsigned *hours, unsigned *minutes,
unsigned *seconds, unsigned *ms);
extern struct gop_time_code gop_time, first_gop_time, printed_gop;
extern int gop_rollover;
extern LLONG min_pts, sync_pts, current_pts;
extern unsigned rollover_bits;
extern uint32_t global_timestamp, min_global_timestamp;
extern int global_timestamp_inited;
extern LLONG fts_now; // Time stamp of current file (w/ fts_offset, w/o fts_global)
extern LLONG fts_offset; // Time before first sync_pts
extern LLONG fts_fc_offset; // Time before first GOP
extern LLONG fts_max; // Remember the maximum fts that we saw in current file
extern LLONG fts_global; // Duration of previous files (-ve mode)
// Count 608 (per field) and 708 blocks since last set_fts() call
extern int cb_field1, cb_field2, cb_708;
extern int saw_caption_block;
extern unsigned char *buffer;
extern LLONG past;
extern LLONG total_inputsize, total_past; // Only in binary concat mode
extern char **inputfile;
extern int current_file;
extern LLONG result; // Number of bytes read/skipped in last read operation
extern struct sockaddr_in servaddr, cliaddr;
extern int strangeheader;
extern unsigned char startbytes[STARTBYTESLENGTH];
extern unsigned int startbytes_pos;
extern int startbytes_avail; // Needs to be able to hold -1 result.
extern unsigned char *pesheaderbuf;
extern int pts_set; //0 = No, 1 = received, 2 = min_pts set
extern unsigned long long max_dif;
extern int MPEG_CLOCK_FREQ; // This is part of the standard
extern unsigned pts_big_change;
extern unsigned total_frames_count;
extern unsigned total_pulldownfields;
extern unsigned total_pulldownframes;
extern int CaptionGap;
extern unsigned char *filebuffer;
extern LLONG filebuffer_start; // Position of buffer start relative to file
extern int filebuffer_pos; // Position of pointer relative to buffer start
extern int bytesinbuffer; // Number of bytes we actually have on buffer
extern struct s_context_cc608 context_cc608_field_1, context_cc608_field_2;
extern const char *desc[256];
extern FILE *fh_out_elementarystream;
extern int infd;
extern int false_pict_header;
extern int stat_numuserheaders;
extern int stat_dvdccheaders;
extern int stat_scte20ccheaders;
extern int stat_replay5000headers;
extern int stat_replay4000headers;
extern int stat_dishheaders;
extern int stat_hdtv;
extern int stat_divicom;
extern enum ccx_stream_mode_enum stream_mode;
extern int cc_stats[4];
extern LLONG inputsize;
extern LLONG subs_delay;
extern int startcredits_displayed, end_credits_displayed;
extern LLONG last_displayed_subs_ms;
extern int processed_enough;
extern unsigned char usercolor_rgb[8];
extern const char *extension;
extern long FILEBUFFERSIZE; // Uppercase because it used to be a define
extern struct ccx_s_options ccx_options;
extern int temp_debug;
extern unsigned long net_activity_gui;
/* General (ES stream) video information */
extern unsigned current_hor_size;
extern unsigned current_vert_size;
extern unsigned current_aspect_ratio;
extern unsigned current_frame_rate;
extern double current_fps;
extern int end_of_file;
extern LLONG inbuf;
extern enum ccx_bufferdata_type bufferdatatype; // Can be CCX_BUFFERDATA_TYPE_RAW or CCX_BUFFERDATA_TYPE_PES
extern unsigned top_field_first;
extern int firstcall;
extern LLONG minimum_fts; // No screen should start before this FTS
#define MAXBFRAMES 50
#define SORTBUF (2*MAXBFRAMES+1)
extern int cc_data_count[SORTBUF];
extern unsigned char cc_data_pkts[SORTBUF][10*31*3+1];
extern int has_ccdata_buffered;
extern int current_field;
extern int last_reported_progress;
extern int cc_to_stdout;
extern unsigned hauppauge_warning_shown;
extern unsigned char *subline;
extern int saw_gop_header;
extern int max_gop_length;
extern int last_gop_length;
extern int frames_since_last_gop;
extern LLONG fts_at_gop_start;
extern int frames_since_ref_time;
extern enum ccx_stream_mode_enum auto_stream;
extern int num_input_files;
extern char *basefilename;
extern int do_cea708; // Process 708 data?
extern int cea708services[63]; // [] -> 1 for services to be processed
extern struct ccx_s_write wbout1, wbout2, *wbxdsout;
extern char **spell_lower;
extern char **spell_correct;
extern int spell_words;
extern int spell_capacity;
extern unsigned char encoded_crlf[16]; // We keep it encoded here so we don't have to do it many times
extern unsigned int encoded_crlf_length;
extern unsigned char encoded_br[16];
extern unsigned int encoded_br_length;
extern enum ccx_frame_type current_picture_coding_type;
extern int current_tref; // Store temporal reference of current frame
extern int cc608_parity_table[256]; // From myth
// From ts_functions
extern unsigned cap_stream_type;
extern struct ts_payload payload;
extern unsigned char tspacket[188];
extern struct PAT_entry pmt_array[TS_PMT_MAP_SIZE];
extern uint16_t pmt_array_length;
extern unsigned pmtpid;
extern unsigned TS_program_number;
extern unsigned char *last_pat_payload;
extern unsigned last_pat_length;
extern long capbuflen;
#define HAUPPAGE_CCPID 1003 // PID for CC's in some Hauppauge recordings
/* Exit codes. Take this seriously as the GUI depends on them.
0 means OK as usual,
<100 means display whatever was output to stderr as a warning
>=100 means display whatever was output to stdout as an error
*/
#define EXIT_OK 0
#define EXIT_NO_INPUT_FILES 2
#define EXIT_TOO_MANY_INPUT_FILES 3
#define EXIT_INCOMPATIBLE_PARAMETERS 4
#define EXIT_FILE_CREATION_FAILED 5
#define EXIT_UNABLE_TO_DETERMINE_FILE_SIZE 6
#define EXIT_MALFORMED_PARAMETER 7
#define EXIT_READ_ERROR 8
#define EXIT_UNSUPPORTED 9
#define EXIT_NOT_CLASSIFIED 300
#define EXIT_NOT_ENOUGH_MEMORY 500
#define EXIT_ERROR_IN_CAPITALIZATION_FILE 501
#define EXIT_BUFFER_FULL 502
#define EXIT_BUG_BUG 1000
#define EXIT_MISSING_ASF_HEADER 1001
#define EXIT_MISSING_RCWT_HEADER 1002
extern int PIDs_seen[65536];
extern struct PMT_entry *PIDs_programs[65536];
extern LLONG ts_start_of_xds;
//extern int timestamps_on_transcript;
extern unsigned teletext_mode;
#define MAX_TLT_PAGES 1000
extern short int seen_sub_page[MAX_TLT_PAGES];
extern uint64_t utc_refvalue; // UTC referential value
extern struct ccx_s_teletext_config tlt_config;
extern uint32_t tlt_packet_counter;
extern uint32_t tlt_frames_produced;
#endif

View File

@@ -1,125 +0,0 @@
#include "ccextractor.h"
// RCWT header (11 bytes):
//byte(s) value description (All values below are hex numbers, not
// actual numbers or values
//0-2 CCCCED magic number, for Closed Caption CC Extractor Data
//3 CC Creating program. Legal values: CC = CC Extractor
//4-5 0050 Program version number
//6-7 0001 File format version
//8-10 000000 Padding, required :-)
const unsigned char rcwt_header[11]={0xCC, 0xCC, 0xED, 0xCC, 0x00, 0x50, 0, 1, 0, 0, 0};
const unsigned char BROADCAST_HEADER[]={0xff, 0xff, 0xff, 0xff};
const unsigned char LITTLE_ENDIAN_BOM[]={0xff, 0xfe};
const unsigned char UTF8_BOM[]={0xef, 0xbb,0xbf};
const unsigned char DVD_HEADER[8]={0x00,0x00,0x01,0xb2,0x43,0x43,0x01,0xf8};
const unsigned char lc1[1]={0x8a};
const unsigned char lc2[1]={0x8f};
const unsigned char lc3[2]={0x16,0xfe};
const unsigned char lc4[2]={0x1e,0xfe};
const unsigned char lc5[1]={0xff};
const unsigned char lc6[1]={0xfe};
const double framerates_values[16]=
{
0,
24000.0/1001, /* 23.976 */
24.0,
25.0,
30000.0/1001, /* 29.97 */
30.0,
50.0,
60000.0/1001, /* 59.94 */
60.0,
0,
0,
0,
0,
0
};
const char *framerates_types[16]=
{
"00 - forbidden",
"01 - 23.976",
"02 - 24",
"03 - 25",
"04 - 29.97",
"05 - 30",
"06 - 50",
"07 - 59.94",
"08 - 60",
"09 - reserved",
"10 - reserved",
"11 - reserved",
"12 - reserved",
"13 - reserved",
"14 - reserved",
"15 - reserved"
};
const char *aspect_ratio_types[16]=
{
"00 - forbidden",
"01 - 1:1",
"02 - 4:3",
"03 - 16:9",
"04 - 2.21:1",
"05 - reserved",
"06 - reserved",
"07 - reserved",
"08 - reserved",
"09 - reserved",
"10 - reserved",
"11 - reserved",
"12 - reserved",
"13 - reserved",
"14 - reserved",
"15 - reserved"
};
const char *pict_types[8]=
{
"00 - ilegal (0)",
"01 - I",
"02 - P",
"03 - B",
"04 - ilegal (D)",
"05 - ilegal (5)",
"06 - ilegal (6)",
"07 - ilegal (7)"
};
const char *slice_types[10]=
{
"0 - P",
"1 - B",
"2 - I",
"3 - SP",
"4 - SI",
"5 - P",
"6 - B",
"7 - I",
"8 - SP",
"9 - SI"
};
const char *cc_types[4] =
{
"NTSC line 21 field 1 closed captions",
"NTSC line 21 field 2 closed captions",
"DTVCC Channel Packet Data",
"DTVCC Channel Packet Start"
};
enum
{
NTSC_CC_f1 = 0,
NTSC_CC_f2 = 1,
DTVCC_PACKET_DATA = 2,
DTVCC_PACKET_START = 3,
};

View File

@@ -1,840 +0,0 @@
#include <ctype.h>
void get_char_in_latin_1 (unsigned char *buffer, unsigned char c)
{
unsigned char c1='?';
if (c<0x80)
{
// Regular line-21 character set, mostly ASCII except these exceptions
switch (c)
{
case 0x2a: // lowercase a, acute accent
c1=0xe1;
break;
case 0x5c: // lowercase e, acute accent
c1=0xe9;
break;
case 0x5e: // lowercase i, acute accent
c1=0xed;
break;
case 0x5f: // lowercase o, acute accent
c1=0xf3;
break;
case 0x60: // lowercase u, acute accent
c1=0xfa;
break;
case 0x7b: // lowercase c with cedilla
c1=0xe7;
break;
case 0x7c: // division symbol
c1=0xf7;
break;
case 0x7d: // uppercase N tilde
c1=0xd1;
break;
case 0x7e: // lowercase n tilde
c1=0xf1;
break;
default:
c1=c;
break;
}
*buffer=c1;
return;
}
switch (c)
{
// THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
case 0x80: // Registered symbol (R)
c1=0xae;
break;
case 0x81: // degree sign
c1=0xb0;
break;
case 0x82: // 1/2 symbol
c1=0xbd;
break;
case 0x83: // Inverted (open) question mark
c1=0xbf;
break;
case 0x84: // Trademark symbol (TM) - Does not exist in Latin 1
break;
case 0x85: // Cents symbol
c1=0xa2;
break;
case 0x86: // Pounds sterling
c1=0xa3;
break;
case 0x87: // Music note - Not in latin 1, so we use 'pilcrow'
c1=0xb6;
break;
case 0x88: // lowercase a, grave accent
c1=0xe0;
break;
case 0x89: // transparent space, we make it regular
c1=0x20;
break;
case 0x8a: // lowercase e, grave accent
c1=0xe8;
break;
case 0x8b: // lowercase a, circumflex accent
c1=0xe2;
break;
case 0x8c: // lowercase e, circumflex accent
c1=0xea;
break;
case 0x8d: // lowercase i, circumflex accent
c1=0xee;
break;
case 0x8e: // lowercase o, circumflex accent
c1=0xf4;
break;
case 0x8f: // lowercase u, circumflex accent
c1=0xfb;
break;
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
case 0x90: // capital letter A with acute
c1=0xc1;
break;
case 0x91: // capital letter E with acute
c1=0xc9;
break;
case 0x92: // capital letter O with acute
c1=0xd3;
break;
case 0x93: // capital letter U with acute
c1=0xda;
break;
case 0x94: // capital letter U with diaresis
c1=0xdc;
break;
case 0x95: // lowercase letter U with diaeresis
c1=0xfc;
break;
case 0x96: // apostrophe
c1=0x27;
break;
case 0x97: // inverted exclamation mark
c1=0xa1;
break;
case 0x98: // asterisk
c1=0x2a;
break;
case 0x99: // apostrophe (yes, duped). See CCADI source code.
c1=0x27;
break;
case 0x9a: // em dash
c1=0x2d;
break;
case 0x9b: // copyright sign
c1=0xa9;
break;
case 0x9c: // Service Mark - not available in latin 1
break;
case 0x9d: // Full stop (.)
c1=0x2e;
break;
case 0x9e: // Quoatation mark
c1=0x22;
break;
case 0x9f: // Quoatation mark
c1=0x22;
break;
case 0xa0: // uppercase A, grave accent
c1=0xc0;
break;
case 0xa1: // uppercase A, circumflex
c1=0xc2;
break;
case 0xa2: // uppercase C with cedilla
c1=0xc7;
break;
case 0xa3: // uppercase E, grave accent
c1=0xc8;
break;
case 0xa4: // uppercase E, circumflex
c1=0xca;
break;
case 0xa5: // capital letter E with diaresis
c1=0xcb;
break;
case 0xa6: // lowercase letter e with diaresis
c1=0xeb;
break;
case 0xa7: // uppercase I, circumflex
c1=0xce;
break;
case 0xa8: // uppercase I, with diaresis
c1=0xcf;
break;
case 0xa9: // lowercase i, with diaresis
c1=0xef;
break;
case 0xaa: // uppercase O, circumflex
c1=0xd4;
break;
case 0xab: // uppercase U, grave accent
c1=0xd9;
break;
case 0xac: // lowercase u, grave accent
c1=0xf9;
break;
case 0xad: // uppercase U, circumflex
c1=0xdb;
break;
case 0xae: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
c1=0xab;
break;
case 0xaf: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
c1=0xbb;
break;
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
case 0xb0: // Uppercase A, tilde
c1=0xc3;
break;
case 0xb1: // Lowercase a, tilde
c1=0xe3;
break;
case 0xb2: // Uppercase I, acute accent
c1=0xcd;
break;
case 0xb3: // Uppercase I, grave accent
c1=0xcc;
break;
case 0xb4: // Lowercase i, grave accent
c1=0xec;
break;
case 0xb5: // Uppercase O, grave accent
c1=0xd2;
break;
case 0xb6: // Lowercase o, grave accent
c1=0xf2;
break;
case 0xb7: // Uppercase O, tilde
c1=0xd5;
break;
case 0xb8: // Lowercase o, tilde
c1=0xf5;
break;
case 0xb9: // Open curly brace
c1=0x7b;
break;
case 0xba: // Closing curly brace
c1=0x7d;
break;
case 0xbb: // Backslash
c1=0x5c;
break;
case 0xbc: // Caret
c1=0x5e;
break;
case 0xbd: // Underscore
c1=0x5f;
break;
case 0xbe: // Pipe (broken bar)
c1=0xa6;
break;
case 0xbf: // Tilde
c1=0x7e;
break;
case 0xc0: // Uppercase A, umlaut
c1=0xc4;
break;
case 0xc1: // Lowercase A, umlaut
c1=0xe3;
break;
case 0xc2: // Uppercase O, umlaut
c1=0xd6;
break;
case 0xc3: // Lowercase o, umlaut
c1=0xf6;
break;
case 0xc4: // Esszett (sharp S)
c1=0xdf;
break;
case 0xc5: // Yen symbol
c1=0xa5;
break;
case 0xc6: // Currency symbol
c1=0xa4;
break;
case 0xc7: // Vertical bar
c1=0x7c;
break;
case 0xc8: // Uppercase A, ring
c1=0xc5;
break;
case 0xc9: // Lowercase A, ring
c1=0xe5;
break;
case 0xca: // Uppercase O, slash
c1=0xd8;
break;
case 0xcb: // Lowercase o, slash
c1=0xf8;
break;
case 0xcc: // Upper left corner
case 0xcd: // Upper right corner
case 0xce: // Lower left corner
case 0xcf: // Lower right corner
default: // For those that don't have representation
*buffer='?'; // I'll do it eventually, I promise
break; // This are weird chars anyway
}
*buffer=c1;
}
void get_char_in_unicode (unsigned char *buffer, unsigned char c)
{
unsigned char c1,c2;
switch (c)
{
case 0x84: // Trademark symbol (TM)
c2=0x21;
c1=0x22;
break;
case 0x87: // Music note
c2=0x26;
c1=0x6a;
break;
case 0x9c: // Service Mark
c2=0x21;
c1=0x20;
break;
case 0xcc: // Upper left corner
c2=0x23;
c1=0x1c;
break;
case 0xcd: // Upper right corner
c2=0x23;
c1=0x1d;
break;
case 0xce: // Lower left corner
c2=0x23;
c1=0x1e;
break;
case 0xcf: // Lower right corner
c2=0x23;
c1=0x1f;
break;
default: // Everything else, same as latin-1 followed by 00
get_char_in_latin_1 (&c1,c);
c2=0;
break;
}
*buffer=c1;
*(buffer+1)=c2;
}
int get_char_in_utf_8 (unsigned char *buffer, unsigned char c) // Returns number of bytes used
{
if (c<0x80) // Regular line-21 character set, mostly ASCII except these exceptions
{
switch (c)
{
case 0x2a: // lowercase a, acute accent
*buffer=0xc3;
*(buffer+1)=0xa1;
return 2;
case 0x5c: // lowercase e, acute accent
*buffer=0xc3;
*(buffer+1)=0xa9;
return 2;
case 0x5e: // lowercase i, acute accent
*buffer=0xc3;
*(buffer+1)=0xad;
return 2;
case 0x5f: // lowercase o, acute accent
*buffer=0xc3;
*(buffer+1)=0xb3;
return 2;
case 0x60: // lowercase u, acute accent
*buffer=0xc3;
*(buffer+1)=0xba;
return 2;
case 0x7b: // lowercase c with cedilla
*buffer=0xc3;
*(buffer+1)=0xa7;
return 2;
case 0x7c: // division symbol
*buffer=0xc3;
*(buffer+1)=0xb7;
return 2;
case 0x7d: // uppercase N tilde
*buffer=0xc3;
*(buffer+1)=0x91;
return 2;
case 0x7e: // lowercase n tilde
*buffer=0xc3;
*(buffer+1)=0xb1;
return 2;
case 0x7f: // Solid block
*buffer=0xe2;
*(buffer+1)=0x96;
*(buffer+2)=0xa0;
return 3;
default:
*buffer=c;
return 1;
}
}
switch (c)
{
// THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
case 0x80: // Registered symbol (R)
*buffer=0xc2;
*(buffer+1)=0xae;
return 2;
case 0x81: // degree sign
*buffer=0xc2;
*(buffer+1)=0xb0;
return 2;
case 0x82: // 1/2 symbol
*buffer=0xc2;
*(buffer+1)=0xbd;
return 2;
case 0x83: // Inverted (open) question mark
*buffer=0xc2;
*(buffer+1)=0xbf;
return 2;
case 0x84: // Trademark symbol (TM)
*buffer=0xe2;
*(buffer+1)=0x84;
*(buffer+2)=0xa2;
return 3;
case 0x85: // Cents symbol
*buffer=0xc2;
*(buffer+1)=0xa2;
return 2;
case 0x86: // Pounds sterling
*buffer=0xc2;
*(buffer+1)=0xa3;
return 2;
case 0x87: // Music note
*buffer=0xe2;
*(buffer+1)=0x99;
*(buffer+2)=0xaa;
return 3;
case 0x88: // lowercase a, grave accent
*buffer=0xc3;
*(buffer+1)=0xa0;
return 2;
case 0x89: // transparent space, we make it regular
*buffer=0x20;
return 1;
case 0x8a: // lowercase e, grave accent
*buffer=0xc3;
*(buffer+1)=0xa8;
return 2;
case 0x8b: // lowercase a, circumflex accent
*buffer=0xc3;
*(buffer+1)=0xa2;
return 2;
case 0x8c: // lowercase e, circumflex accent
*buffer=0xc3;
*(buffer+1)=0xaa;
return 2;
case 0x8d: // lowercase i, circumflex accent
*buffer=0xc3;
*(buffer+1)=0xae;
return 2;
case 0x8e: // lowercase o, circumflex accent
*buffer=0xc3;
*(buffer+1)=0xb4;
return 2;
case 0x8f: // lowercase u, circumflex accent
*buffer=0xc3;
*(buffer+1)=0xbb;
return 2;
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
case 0x90: // capital letter A with acute
*buffer=0xc3;
*(buffer+1)=0x81;
return 2;
case 0x91: // capital letter E with acute
*buffer=0xc3;
*(buffer+1)=0x89;
return 2;
case 0x92: // capital letter O with acute
*buffer=0xc3;
*(buffer+1)=0x93;
return 2;
case 0x93: // capital letter U with acute
*buffer=0xc3;
*(buffer+1)=0x9a;
return 2;
case 0x94: // capital letter U with diaresis
*buffer=0xc3;
*(buffer+1)=0x9c;
return 2;
case 0x95: // lowercase letter U with diaeresis
*buffer=0xc3;
*(buffer+1)=0xbc;
return 2;
case 0x96: // apostrophe
*buffer=0x27;
return 1;
case 0x97: // inverted exclamation mark
*buffer=0xc2;
*(buffer+1)=0xa1;
return 2;
case 0x98: // asterisk
*buffer=0x2a;
return 1;
case 0x99: // Plain single quote
*buffer=0x27;
return 1;
case 0x9a: // em dash
*buffer=0xe2;
*(buffer+1)=0x80;
*(buffer+2)=0x94;
return 3;
case 0x9b: // copyright sign
*buffer=0xc2;
*(buffer+1)=0xa9;
return 2;
case 0x9c: // Service mark
*buffer=0xe2;
*(buffer+1)=0x84;
*(buffer+2)=0xa0;
return 3;
case 0x9d: // Round bullet
*buffer=0xe2;
*(buffer+1)=0x80;
*(buffer+2)=0xa2;
return 3;
case 0x9e: // Opening double quotes
*buffer=0xe2;
*(buffer+1)=0x80;
*(buffer+2)=0x9c;
return 3;
case 0x9f: // Closing double quotes
*buffer=0xe2;
*(buffer+1)=0x80;
*(buffer+2)=0x9d;
return 3;
case 0xa0: // uppercase A, grave accent
*buffer=0xc3;
*(buffer+1)=0x80;
return 2;
case 0xa1: // uppercase A, circumflex
*buffer=0xc3;
*(buffer+1)=0x82;
return 2;
case 0xa2: // uppercase C with cedilla
*buffer=0xc3;
*(buffer+1)=0x87;
return 2;
case 0xa3: // uppercase E, grave accent
*buffer=0xc3;
*(buffer+1)=0x88;
return 2;
case 0xa4: // uppercase E, circumflex
*buffer=0xc3;
*(buffer+1)=0x8a;
return 2;
case 0xa5: // capital letter E with diaresis
*buffer=0xc3;
*(buffer+1)=0x8b;
return 2;
case 0xa6: // lowercase letter e with diaresis
*buffer=0xc3;
*(buffer+1)=0xab;
return 2;
case 0xa7: // uppercase I, circumflex
*buffer=0xc3;
*(buffer+1)=0x8e;
return 2;
case 0xa8: // uppercase I, with diaresis
*buffer=0xc3;
*(buffer+1)=0x8f;
return 2;
case 0xa9: // lowercase i, with diaresis
*buffer=0xc3;
*(buffer+1)=0xaf;
return 2;
case 0xaa: // uppercase O, circumflex
*buffer=0xc3;
*(buffer+1)=0x94;
return 2;
case 0xab: // uppercase U, grave accent
*buffer=0xc3;
*(buffer+1)=0x99;
return 2;
case 0xac: // lowercase u, grave accent
*buffer=0xc3;
*(buffer+1)=0xb9;
return 2;
case 0xad: // uppercase U, circumflex
*buffer=0xc3;
*(buffer+1)=0x9b;
return 2;
case 0xae: // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
*buffer=0xc2;
*(buffer+1)=0xab;
return 2;
case 0xaf: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
*buffer=0xc2;
*(buffer+1)=0xbb;
return 2;
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
case 0xb0: // Uppercase A, tilde
*buffer=0xc3;
*(buffer+1)=0x83;
return 2;
case 0xb1: // Lowercase a, tilde
*buffer=0xc3;
*(buffer+1)=0xa3;
return 2;
case 0xb2: // Uppercase I, acute accent
*buffer=0xc3;
*(buffer+1)=0x8d;
return 2;
case 0xb3: // Uppercase I, grave accent
*buffer=0xc3;
*(buffer+1)=0x8c;
return 2;
case 0xb4: // Lowercase i, grave accent
*buffer=0xc3;
*(buffer+1)=0xac;
return 2;
case 0xb5: // Uppercase O, grave accent
*buffer=0xc3;
*(buffer+1)=0x92;
return 2;
case 0xb6: // Lowercase o, grave accent
*buffer=0xc3;
*(buffer+1)=0xb2;
return 2;
case 0xb7: // Uppercase O, tilde
*buffer=0xc3;
*(buffer+1)=0x95;
return 2;
case 0xb8: // Lowercase o, tilde
*buffer=0xc3;
*(buffer+1)=0xb5;
return 2;
case 0xb9: // Open curly brace
*buffer=0x7b;
return 1;
case 0xba: // Closing curly brace
*buffer=0x7d;
return 1;
case 0xbb: // Backslash
*buffer=0x5c;
return 1;
case 0xbc: // Caret
*buffer=0x5e;
return 1;
case 0xbd: // Underscore
*buffer=0x5f;
return 1;
case 0xbe: // Pipe (broken bar)
*buffer=0xc2;
*(buffer+1)=0xa6;
return 2;
case 0xbf: // Tilde
*buffer=0x7e; // Not sure
return 1;
case 0xc0: // Uppercase A, umlaut
*buffer=0xc3;
*(buffer+1)=0x84;
return 2;
case 0xc1: // Lowercase A, umlaut
*buffer=0xc3;
*(buffer+1)=0xa4;
return 2;
case 0xc2: // Uppercase O, umlaut
*buffer=0xc3;
*(buffer+1)=0x96;
return 2;
case 0xc3: // Lowercase o, umlaut
*buffer=0xc3;
*(buffer+1)=0xb6;
return 2;
case 0xc4: // Esszett (sharp S)
*buffer=0xc3;
*(buffer+1)=0x9f;
return 2;
case 0xc5: // Yen symbol
*buffer=0xc2;
*(buffer+1)=0xa5;
return 2;
case 0xc6: // Currency symbol
*buffer=0xc2;
*(buffer+1)=0xa4;
return 2;
case 0xc7: // Vertical bar
*buffer=0x7c;
return 1;
case 0xc8: // Uppercase A, ring
*buffer=0xc3;
*(buffer+1)=0x85;
return 2;
case 0xc9: // Lowercase A, ring
*buffer=0xc3;
*(buffer+1)=0xa5;
return 2;
case 0xca: // Uppercase O, slash
*buffer=0xc3;
*(buffer+1)=0x98;
return 2;
case 0xcb: // Lowercase o, slash
*buffer=0xc3;
*(buffer+1)=0xb8;
return 2;
case 0xcc: // Top left corner
*buffer=0xe2;
*(buffer+1)=0x8c;
*(buffer+2)=0x9c;
return 3;
case 0xcd: // Top right corner
*buffer=0xe2;
*(buffer+1)=0x8c;
*(buffer+2)=0x9d;
return 3;
case 0xce: // Bottom left corner
*buffer=0xe2;
*(buffer+1)=0x8c;
*(buffer+2)=0x9e;
return 3;
case 0xcf: // Bottom right corner
*buffer=0xe2;
*(buffer+1)=0x8c;
*(buffer+2)=0x9f;
return 3;
default: //
*buffer='?'; // I'll do it eventually, I promise
return 1; // This are weird chars anyway
}
}
unsigned char cctolower (unsigned char c)
{
if (c>='A' && c<='Z')
return tolower(c);
switch (c)
{
case 0x7d: // uppercase N tilde
return 0x7e;
case 0x90: // capital letter A with acute
return 0x2a;
case 0x91: // capital letter E with acute
return 0x5c;
case 0x92: // capital letter O with acute
return 0x5f;
case 0x93: // capital letter U with acute
return 0x60;
case 0xa2: // uppercase C with cedilla
return 0x7b;
case 0xa0: // uppercase A, grave accent
return 0x88;
case 0xa3: // uppercase E, grave accent
return 0x8a;
case 0xa1: // uppercase A, circumflex
return 0x8b;
case 0xa4: // uppercase E, circumflex
return 0x8c;
case 0xa7: // uppercase I, circumflex
return 0x8d;
case 0xaa: // uppercase O, circumflex
return 0x8e;
case 0xad: // uppercase U, circumflex
return 0x8f;
case 0x94: // capital letter U with diaresis
return 0x95;
case 0xa5: // capital letter E with diaresis
return 0xa6;
case 0xa8: // uppercase I, with diaresis
return 0xa9;
case 0xab: // uppercase U, grave accent
return 0xac;
case 0xb0: // Uppercase A, tilde
return 0xb1;
case 0xb2: // Uppercase I, acute accent
return 0x5e;
case 0xb3: // Uppercase I, grave accent
return 0xb4;
case 0xb5: // Uppercase O, grave accent
return 0xb6;
case 0xb7: // Uppercase O, tilde
return 0xb8;
case 0xc0: // Uppercase A, umlaut
return 0xc1;
case 0xc2: // Uppercase O, umlaut
return 0xc3;
case 0xc8: // Uppercase A, ring
return 0xc9;
case 0xca: // Uppercase O, slash
return 0xcb;
}
return c;
}
unsigned char cctoupper (unsigned char c)
{
if (c>='a' && c<='z')
return toupper(c);
switch (c)
{
case 0x7e: // lowercase n tilde
return 0x7d;
case 0x2a: // lowercase a, acute accent
return 0x90;
case 0x5c: // lowercase e, acute accent
return 0x91;
case 0x5e: // lowercase i, acute accent
return 0xb2;
case 0x5f: // lowercase o, acute accent
return 0x92;
case 0x60: // lowercase u, acute accent
return 0x93;
case 0x7b: // lowercase c with cedilla
return 0xa2;
case 0x88: // lowercase a, grave accent
return 0xa0;
case 0x8a: // lowercase e, grave accent
return 0xa3;
case 0x8b: // lowercase a, circumflex accent
return 0xa1;
case 0x8c: // lowercase e, circumflex accent
return 0xa4;
case 0x8d: // lowercase i, circumflex accent
return 0xa7;
case 0x8e: // lowercase o, circumflex accent
return 0xaa;
case 0x8f: // lowercase u, circumflex accent
return 0xad;
case 0x95: // lowercase letter U with diaeresis
return 0x94;
case 0xa6: // lowercase letter e with diaresis
return 0xa5;
case 0xa9: // lowercase i, with diaresis
return 0xa8;
case 0xac: // lowercase u, grave accent
return 0xab;
case 0xb1: // Lowercase a, tilde
return 0xb0;
case 0xb4: // Lowercase i, grave accent
return 0xb3;
case 0xb6: // Lowercase o, grave accent
return 0xb5;
case 0xb8: // Lowercase o, tilde
return 0xb7;
case 0xc1: // Lowercase A, umlaut
return 0xc0;
case 0xc3: // Lowercase o, umlaut
return 0xc2;
case 0xc9: // Lowercase A, ring
return 0xc8;
case 0xcb: // Lowercase o, slash
return 0xca;
}
return c;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,479 +0,0 @@
#include "ccextractor.h"
// Parse the user data for captions. The udtype variable denotes
// to which type of data it belongs:
// 0 .. sequence header
// 1 .. GOP header
// 2 .. picture header
// Return TRUE if the data parsing finished, FALSE otherwise.
// estream->pos is advanced. Data is only processed if ustream->error
// is FALSE, parsing can set ustream->error to TRUE.
int user_data(struct bitstream *ustream, int udtype)
{
dbg_print(CCX_DMT_VERBOSE, "user_data(%d)\n", udtype);
// Shall not happen
if (ustream->error || ustream->bitsleft <= 0)
{
// ustream->error=1;
return 0; // Actually discarded on call.
// CFS: Seen in a Wobble edited file.
// fatal(EXIT_BUG_BUG, "user_data: Impossible!");
}
// Do something
stat_numuserheaders++;
//header+=4;
unsigned char *ud_header = next_bytes(ustream, 4);
if (ustream->error || ustream->bitsleft <= 0)
{
return 0; // Actually discarded on call.
// CFS: Seen in Stick_VHS.mpg.
// fatal(EXIT_BUG_BUG, "user_data: Impossible!");
}
// DVD CC header, see
// <http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_FORMAT.HTML>
if ( !memcmp(ud_header,"\x43\x43", 2 ) )
{
stat_dvdccheaders++;
// Probably unneeded, but keep looking for extra caption blocks
int maybeextracb = 1;
read_bytes(ustream, 4); // "43 43 01 F8"
unsigned char pattern_flag = (unsigned char) read_bits(ustream,1);
read_bits(ustream,1);
int capcount=(int) read_bits(ustream,5);
int truncate_flag = (int) read_bits(ustream,1); // truncate_flag - one CB extra
int field1packet = 0; // expect Field 1 first
if (pattern_flag == 0x00)
field1packet=1; // expect Field 1 second
dbg_print(CCX_DMT_VERBOSE, "Reading %d%s DVD CC segments\n",
capcount, (truncate_flag?"+1":""));
capcount += truncate_flag;
// This data comes before the first frame header, so
// in order to get the correct timing we need to set the
// current time to one frame after the maximum time of the
// last GOP. Only usefull when there are frames before
// the GOP.
if (fts_max > 0)
fts_now = fts_max + (LLONG) (1000.0/current_fps);
int rcbcount = 0;
for (int i=0; i<capcount; i++)
{
for (int j=0;j<2;j++)
{
unsigned char data[3];
data[0]=read_u8(ustream);
data[1]=read_u8(ustream);
data[2]=read_u8(ustream);
// Obey the truncate flag.
if ( truncate_flag && i == capcount-1 && j == 1 )
{
maybeextracb = 0;
break;
}
/* Field 1 and 2 data can be in either order,
with marker bytes of \xff and \xfe
Since markers can be repeated, use pattern as well */
if ((data[0]&0xFE) == 0xFE) // Check if valid
{
if (data[0]==0xff && j==field1packet)
data[0]=0x04; // Field 1
else
data[0]=0x05; // Field 2
do_cb(data);
rcbcount++;
}
else
{
dbg_print(CCX_DMT_VERBOSE, "Illegal caption segment - stop here.\n");
maybeextracb = 0;
break;
}
}
}
// Theoretically this should not happen, oh well ...
// Deal with extra closed captions some DVD have.
int ecbcount = 0;
while ( maybeextracb && (next_u8(ustream)&0xFE) == 0xFE )
{
for (int j=0;j<2;j++)
{
unsigned char data[3];
data[0]=read_u8(ustream);
data[1]=read_u8(ustream);
data[2]=read_u8(ustream);
/* Field 1 and 2 data can be in either order,
with marker bytes of \xff and \xfe
Since markers can be repeated, use pattern as well */
if ((data[0]&0xFE) == 0xFE) // Check if valid
{
if (data[0]==0xff && j==field1packet)
data[0]=0x04; // Field 1
else
data[0]=0x05; // Field 2
do_cb(data);
ecbcount++;
}
else
{
dbg_print(CCX_DMT_VERBOSE, "Illegal (extra) caption segment - stop here.\n");
maybeextracb = 0;
break;
}
}
}
dbg_print(CCX_DMT_VERBOSE, "Read %d/%d DVD CC blocks\n", rcbcount, ecbcount);
}
// SCTE 20 user data
else if (ud_header[0] == 0x03)
{
if ((ud_header[1]&0x7F) == 0x01)
{
unsigned char cc_data[3*31+1]; // Maximum cc_count is 31
stat_scte20ccheaders++;
read_bytes(ustream, 2); // "03 01"
unsigned cc_count = (unsigned int) read_bits(ustream,5);
dbg_print(CCX_DMT_VERBOSE, "Reading %d SCTE 20 CC blocks\n", cc_count);
unsigned field_number;
unsigned cc_data1;
unsigned cc_data2;
/* unsigned marker; */
for (unsigned j=0;j<cc_count;j++)
{
skip_bits(ustream,2); // priority - unused
field_number = (unsigned int) read_bits(ustream,2);
skip_bits(ustream,5); // line_offset - unused
cc_data1 = (unsigned int) read_bits(ustream,8);
cc_data2 = (unsigned int) read_bits(ustream,8);
/* marker = (unsigned int)read_bits(ustream,1); // TODO: Add syntax check */
if (ustream->bitsleft < 0)
fatal(EXIT_BUG_BUG, "Oops!");
// Field_number is either
// 0 .. forbiden
// 1 .. field 1 (odd)
// 2 .. field 2 (even)
// 3 .. repeated, from repeat_first_field, effectively field 1
if (field_number < 1)
{
// 0 is invalid
cc_data[j*3]=0x00; // Set to invalid
cc_data[j*3+1]=0x00;
cc_data[j*3+2]=0x00;
}
else
{
// Treat field_number 3 as 1
field_number = (field_number - 1) & 0x01;
// top_field_first also affects to which field the caption
// belongs.
if(!top_field_first)
field_number ^= 0x01;
cc_data[j*3]=0x04|(field_number);
cc_data[j*3+1]=reverse8(cc_data1);
cc_data[j*3+2]=reverse8(cc_data2);
}
}
cc_data[cc_count*3]=0xFF;
store_hdcc(cc_data, cc_count, current_tref, fts_now);
dbg_print(CCX_DMT_VERBOSE, "Reading SCTE 20 CC blocks - done\n");
}
// reserved - unspecified
}
// ReplayTV 4000/5000 caption header - parsing information
// derived from CCExtract.bdl
else if ( (ud_header[0] == 0xbb //ReplayTV 4000
|| ud_header[0] == 0x99) //ReplayTV 5000
&& ud_header[1] == 0x02 )
{
unsigned char data[3];
if (ud_header[0]==0xbb)
stat_replay4000headers++;
else
stat_replay5000headers++;
read_bytes(ustream, 2); // "BB 02" or "99 02"
data[0]=0x05; // Field 2
data[1]=read_u8(ustream);
data[2]=read_u8(ustream);
do_cb(data);
read_bytes(ustream, 2); // Skip "CC 02" for R4000 or "AA 02" for R5000
data[0]=0x04; // Field 1
data[1]=read_u8(ustream);
data[2]=read_u8(ustream);
do_cb(data);
}
// HDTV - see A/53 Part 4 (Video)
else if ( !memcmp(ud_header,"\x47\x41\x39\x34", 4 ) )
{
stat_hdtv++;
read_bytes(ustream, 4); // "47 41 39 34"
unsigned char type_code = read_u8(ustream);
if (type_code==0x03) // CC data.
{
skip_bits(ustream,1); // reserved
unsigned char process_cc_data = (unsigned char) read_bits(ustream,1);
skip_bits(ustream,1); // additional_data - unused
unsigned char cc_count = (unsigned char) read_bits(ustream,5);
read_bytes(ustream, 1); // "FF"
if (process_cc_data)
{
dbg_print(CCX_DMT_VERBOSE, "Reading %d HDTV CC blocks\n", cc_count);
int proceed = 1;
unsigned char *cc_data = read_bytes(ustream, cc_count*3);
if (ustream->bitsleft < 0)
fatal(EXIT_BUG_BUG, "Not enough for CC captions!");
// Check for proper marker - This read makes sure that
// cc_count*3+1 bytes are read and available in cc_data.
if (read_u8(ustream)!=0xFF)
proceed=0;
if (!proceed)
{
dbg_print(CCX_DMT_VERBOSE, "\rThe following payload is not properly terminated.\n");
dump (CCX_DMT_VERBOSE, cc_data, cc_count*3+1, 0, 0);
}
dbg_print(CCX_DMT_VERBOSE, "Reading %d HD CC blocks\n", cc_count);
// B-frames might be (temporal) before or after the anchor
// frame they belong to. Store the buffer until the next anchor
// frame occurs. The buffer will be flushed (sorted) in the
// picture header (or GOP) section when the next anchor occurs.
// Please note we store the current value of the global
// fts_now variable (and not get_fts()) as we are going to
// re-create the timeline in process_hdcc() (Slightly ugly).
store_hdcc(cc_data, cc_count, current_tref, fts_now);
dbg_print(CCX_DMT_VERBOSE, "Reading HDTV blocks - done\n");
}
}
// reserved - additional_cc_data
}
// DVB closed caption header for Dish Network (Field 1 only) */
else if ( !memcmp(ud_header,"\x05\x02", 2 ) )
{
// Like HDTV (above) Dish Network captions can be stored at each
// frame, but maximal two caption blocks per frame and only one
// field is stored.
// To process this with the HDTV framework we create a "HDTV" caption
// format compatible array. Two times 3 bytes plus one for the 0xFF
// marker at the end. Pre-init to field 1 and set the 0xFF marker.
static unsigned char dishdata[7] = {0x04, 0, 0, 0x04, 0, 0, 0xFF};
int cc_count;
dbg_print(CCX_DMT_VERBOSE, "Reading Dish Network user data\n");
stat_dishheaders++;
read_bytes(ustream, 2); // "05 02"
// The next bytes are like this:
// header[2] : ID: 0x04 (MPEG?), 0x03 (H264?)
// header[3-4]: Two byte counter (counting (sub-)GOPs?)
// header[5-6]: Two bytes, maybe checksum?
// header[7]: Pattern type
// on B-frame: 0x02, 0x04
// on I-/P-frame: 0x05
unsigned char id = read_u8(ustream);
unsigned dishcount = read_u16(ustream);
unsigned something = read_u16(ustream);
unsigned char type = read_u8(ustream);
dbg_print(CCX_DMT_PARSE, "DN ID: %02X Count: %5u Unknown: %04X Pattern: %X",
id, dishcount, something, type);
unsigned char hi;
// The following block needs 4 to 6 bytes starting from the
// current position
unsigned char *dcd = ustream->pos; // dish caption data
switch (type)
{
case 0x02:
// Two byte caption - always on B-frame
// The following 4 bytes are:
// 0 : 0x09
// 1-2: caption block
// 3 : REPEAT - 02: two bytes
// - 04: four bytes (repeat first two)
dbg_print(CCX_DMT_PARSE, "\n02 %02X %02X:%02X - R:%02X :",
dcd[0], dcd[1], dcd[2], dcd[3]);
cc_count = 1;
dishdata[1]=dcd[1];
dishdata[2]=dcd[2];
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
type=dcd[3]; // repeater (0x02 or 0x04)
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
if (type==0x04 && hi<32) // repeat (only for non-character pairs)
{
cc_count = 2;
dishdata[3]=0x04; // Field 1
dishdata[4]=dishdata[1];
dishdata[5]=dishdata[2];
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
}
else
{
dbg_print(CCX_DMT_PARSE, ":\n");
}
dishdata[cc_count*3] = 0xFF; // Set end marker
store_hdcc(dishdata, cc_count, current_tref, fts_now);
// Ignore 3 (0x0A, followed by two unknown) bytes.
break;
case 0x04:
// Four byte caption - always on B-frame
// The following 5 bytes are:
// 0 : 0x09
// 1-2: caption block
// 3-4: caption block
dbg_print(CCX_DMT_PARSE, "\n04 %02X %02X:%02X:%02X:%02X :",
dcd[0], dcd[1], dcd[2], dcd[3], dcd[4]);
cc_count = 2;
dishdata[1]=dcd[1];
dishdata[2]=dcd[2];
dishdata[3]=0x04; // Field 1
dishdata[4]=dcd[3];
dishdata[5]=dcd[4];
dishdata[6] = 0xFF; // Set end marker
dbg_print(CCX_DMT_PARSE, "%s", debug_608toASC( dishdata, 0) );
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
store_hdcc(dishdata, cc_count, current_tref, fts_now);
// Ignore 4 (0x020A, followed by two unknown) bytes.
break;
case 0x05:
// Buffered caption - always on I-/P-frame
// The following six bytes are:
// 0 : 0x04
// - the following are from previous 0x05 caption header -
// 1 : prev dcd[2]
// 2-3: prev dcd[3-4]
// 4-5: prev dcd[5-6]
dbg_print(CCX_DMT_PARSE, " - %02X pch: %02X %5u %02X:%02X\n",
dcd[0], dcd[1],
(unsigned)dcd[2]*256+dcd[3],
dcd[4], dcd[5]);
dcd+=6; // Skip these 6 bytes
// Now one of the "regular" 0x02 or 0x04 captions follows
dbg_print(CCX_DMT_PARSE, "%02X %02X %02X:%02X",
dcd[0], dcd[1], dcd[2], dcd[3]);
type=dcd[0]; // Number of caption bytes (0x02 or 0x04)
cc_count = 1;
dishdata[1]=dcd[2];
dishdata[2]=dcd[3];
dcd+=4; // Skip the first 4 bytes.
if (type==0x02)
{
type=dcd[0]; // repeater (0x02 or 0x04)
dcd++; // Skip the repeater byte.
dbg_print(CCX_DMT_PARSE, " - R:%02X :%s", type, debug_608toASC( dishdata, 0) );
hi = dishdata[1] & 0x7f; // Get only the 7 low bits
if (type==0x04 && hi<32)
{
cc_count = 2;
dishdata[3]=0x04; // Field 1
dishdata[4]=dishdata[1];
dishdata[5]=dishdata[2];
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
}
else
{
dbg_print(CCX_DMT_PARSE, ":\n");
}
dishdata[cc_count*3] = 0xFF; // Set end marker
}
else
{
dbg_print(CCX_DMT_PARSE, ":%02X:%02X ",
dcd[0], dcd[1]);
cc_count = 2;
dishdata[3]=0x04; // Field 1
dishdata[4]=dcd[0];
dishdata[5]=dcd[1];
dishdata[6] = 0xFF; // Set end marker
dbg_print(CCX_DMT_PARSE, ":%s", debug_608toASC( dishdata, 0) );
dbg_print(CCX_DMT_PARSE, "%s:\n", debug_608toASC( dishdata+3, 0) );
}
store_hdcc(dishdata, cc_count, current_tref, fts_now);
// Ignore 3 (0x0A, followed by 2 unknown) bytes.
break;
default:
// printf ("Unknown?\n");
break;
} // switch
dbg_print(CCX_DMT_VERBOSE, "Reading Dish Network user data - done\n");
}
// CEA 608 / aka "Divicom standard", see:
// http://www.pixeltools.com/tech_tip_closed_captioning.html
else if ( !memcmp(ud_header,"\x02\x09", 2 ) )
{
// Either a documentation or more examples are needed.
stat_divicom++;
unsigned char data[3];
read_bytes(ustream, 2); // "02 09"
read_bytes(ustream, 2); // "80 80" ???
read_bytes(ustream, 2); // "02 0A" ???
data[0]=0x04; // Field 1
data[1]=read_u8(ustream);
data[2]=read_u8(ustream);
do_cb(data);
// This is probably incomplete!
}
else
{
// Some other user data
// 06 02 ... Seems to be DirectTV
dbg_print(CCX_DMT_VERBOSE, "Unrecognized user data:\n");
int udatalen = ustream->end - ustream->pos;
dump (CCX_DMT_VERBOSE, ustream->pos, (udatalen > 128 ? 128 : udatalen),0 ,0);
}
dbg_print(CCX_DMT_VERBOSE, "User data - processed\n");
// Read complete
return 1;
}

View File

@@ -1,501 +0,0 @@
#include "ccextractor.h"
long FILEBUFFERSIZE = 1024*1024*16; // 16 Mbytes no less. Minimize number of real read calls()
LLONG buffered_read_opt_file (unsigned char *buffer, unsigned int bytes);
#ifdef _WIN32
WSADATA wsaData = {0};
int iResult = 0;
#endif
LLONG getfilesize (int in)
{
LLONG current=LSEEK (in, 0, SEEK_CUR);
LLONG length = LSEEK (in,0,SEEK_END);
LSEEK (in,current,SEEK_SET);
return length;
}
LLONG gettotalfilessize (void) // -1 if one or more files failed to open
{
LLONG ts=0;
int h;
for (int i=0;i<num_input_files;i++)
{
if (0 == strcmp(inputfile[i],"-")) // Skip stdin
continue;
#ifdef _WIN32
h=OPEN (inputfile[i],O_RDONLY | O_BINARY);
#else
h=OPEN (inputfile[i],O_RDONLY);
#endif
if (h==-1)
{
mprint ("\rUnable to open %s\r\n",inputfile[i]);
return -1;
}
if (!ccx_options.live_stream)
ts+=getfilesize (h);
close (h);
}
return ts;
}
void prepare_for_new_file (void)
{
// Init per file variables
min_pts=0x01FFFFFFFFLL; // 33 bit
sync_pts=0;
pts_set = 0;
// inputsize=0; Now responsibility of switch_to_next_file()
last_reported_progress=-1;
stat_numuserheaders = 0;
stat_dvdccheaders = 0;
stat_scte20ccheaders = 0;
stat_replay5000headers = 0;
stat_replay4000headers = 0;
stat_dishheaders = 0;
stat_hdtv = 0;
stat_divicom = 0;
total_frames_count = 0;
total_pulldownfields = 0;
total_pulldownframes = 0;
cc_stats[0]=0; cc_stats[1]=0; cc_stats[2]=0; cc_stats[3]=0;
false_pict_header=0;
frames_since_last_gop=0;
frames_since_ref_time=0;
gop_time.inited=0;
first_gop_time.inited=0;
gop_rollover=0;
printed_gop.inited=0;
saw_caption_block=0;
past=0;
pts_big_change=0;
startbytes_pos=0;
startbytes_avail=0;
init_file_buffer();
anchor_hdcc(-1);
firstcall = 1;
}
/* Close input file if there is one and let the GUI know */
void close_input_file (void)
{
if (infd!=-1 && ccx_options.input_source==CCX_DS_FILE)
{
close (infd);
infd=-1;
activity_input_file_closed();
}
}
int init_sockets (void)
{
static int socket_inited=0;
if (!socket_inited)
{
#ifdef _WIN32
WSADATA wsaData = {0};
// Initialize Winsock
iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (iResult != 0) {
wprintf(L"WSAStartup failed: %d\n", iResult);
return 1;
}
#endif
socket_inited=1;
}
return 0;
}
/* Close current file and open next one in list -if any- */
/* bytesinbuffer is the number of bytes read (in some buffer) that haven't been added
to 'past' yet. We provide this number to switch_to_next_file() so a final sanity check
can be done */
int switch_to_next_file (LLONG bytesinbuffer)
{
if (current_file==-1 || !ccx_options.binary_concat)
{
memset (PIDs_seen,0,65536*sizeof (int));
memset (PIDs_programs,0,65536*sizeof (struct PMT_entry *));
}
if (ccx_options.input_source==CCX_DS_STDIN)
{
if (infd!=-1) // Means we had already processed stdin. So we're done.
{
if (ccx_options.print_file_reports)
print_file_report();
return 0;
}
infd=0;
mprint ("\n\r-----------------------------------------------------------------\n");
mprint ("\rReading from standard input\n");
return 1;
}
if (ccx_options.input_source==CCX_DS_NETWORK)
{
if (infd!=-1) // Means we have already bound a socket.
{
if (ccx_options.print_file_reports)
print_file_report();
return 0;
}
if (init_sockets())
return 1;
infd=socket(AF_INET,SOCK_DGRAM,0);
if (IN_MULTICAST(ccx_options.udpaddr))
{
int on = 1;
(void)setsockopt(infd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on));
}
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr=htonl(IN_MULTICAST(ccx_options.udpaddr) ? ccx_options.udpaddr : INADDR_ANY);
servaddr.sin_port=htons(ccx_options.udpport);
if (bind(infd,(struct sockaddr *)&servaddr,sizeof(servaddr)))
{
fatal (EXIT_BUG_BUG, "bind() failed.");
}
if (IN_MULTICAST(ccx_options.udpaddr)) {
struct ip_mreq group;
group.imr_multiaddr.s_addr = htonl(ccx_options.udpaddr);
group.imr_interface.s_addr = htonl(INADDR_ANY);
if (setsockopt(infd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&group, sizeof(group)) < 0)
{
fatal (EXIT_BUG_BUG, "cannot join multicast group.");
}
}
mprint ("\n\r-----------------------------------------------------------------\n");
if (ccx_options.udpaddr == INADDR_ANY)
{
mprint ("\rReading from UDP socket %u\n",ccx_options.udpport);
}
else
{
struct in_addr in;
in.s_addr = htonl(ccx_options.udpaddr);
mprint ("\rReading from UDP socket %s:%u\n", inet_ntoa(in), ccx_options.udpport);
}
return 1;
}
/* Close current and make sure things are still sane */
if (infd!=-1)
{
if (ccx_options.print_file_reports)
print_file_report();
close_input_file ();
if (inputsize>0 && ((past+bytesinbuffer) < inputsize) && !processed_enough)
{
mprint("\n\n\n\nATTENTION!!!!!!\n");
mprint("In switch_to_next_file(): Processing of %s %d ended prematurely %lld < %lld, please send bug report.\n\n",
inputfile[current_file], current_file, past, inputsize);
}
if (ccx_options.binary_concat)
{
total_past+=inputsize;
past=0; // Reset always or at the end we'll have double the size
}
}
for (;;)
{
current_file++;
if (current_file>=num_input_files)
break;
// The following \n keeps the progress percentage from being overwritten.
mprint ("\n\r-----------------------------------------------------------------\n");
mprint ("\rOpening file: %s\n", inputfile[current_file]);
#ifdef _WIN32
infd=OPEN (inputfile[current_file],O_RDONLY | O_BINARY);
#else
infd=OPEN (inputfile[current_file],O_RDONLY);
#endif
if (infd == -1)
mprint ("\rWarning: Unable to open input file [%s]\n", inputfile[current_file]);
else
{
activity_input_file_open (inputfile[current_file]);
if (!ccx_options.live_stream)
{
inputsize = getfilesize (infd);
if (!ccx_options.binary_concat)
total_inputsize=inputsize;
}
return 1; // Succeeded
}
}
return 0;
}
void position_sanity_check ()
{
#ifdef SANITY_CHECK
if (in!=-1)
{
LLONG realpos=LSEEK (in,0,SEEK_CUR);
if (realpos!=past-filebuffer_pos+bytesinbuffer)
{
fatal (EXIT_BUG_BUG, "Position desync, THIS IS A BUG. Real pos =%lld, past=%lld.\n",realpos,past);
}
}
#endif
}
int init_file_buffer(void)
{
filebuffer_start=0;
filebuffer_pos=0;
if (filebuffer==NULL)
{
filebuffer=(unsigned char *) malloc (FILEBUFFERSIZE);
bytesinbuffer=0;
}
if (filebuffer==NULL)
{
fatal (EXIT_NOT_ENOUGH_MEMORY, "Not enough memory\n");
}
return 0;
}
void buffered_seek (int offset)
{
position_sanity_check();
if (offset<0)
{
filebuffer_pos+=offset;
if (filebuffer_pos<0)
{
// We got into the start buffer (hopefully)
if (startbytes_pos+filebuffer_pos < 0)
{
fatal (EXIT_BUG_BUG, "PANIC: Attempt to seek before buffer start, this is a bug!");
}
startbytes_pos+=filebuffer_pos;
filebuffer_pos=0;
}
}
else
{
buffered_read_opt (NULL, offset);
position_sanity_check();
}
}
void sleepandchecktimeout (time_t start)
{
if (ccx_options.input_source==CCX_DS_STDIN)
{
// CFS: Not 100% sure about this. Fine for files, not so sure what happens if stdin is
// real time input from hardware.
sleep_secs (1);
ccx_options.live_stream=0;
return;
}
if (ccx_options.live_stream==-1) // Just sleep, no timeout to check
{
sleep_secs (1);
return;
}
if (time(NULL)>start+ccx_options.live_stream) // More than live_stream seconds elapsed. No more live
ccx_options.live_stream=0;
else
sleep_secs(1);
}
void return_to_buffer (unsigned char *buffer, unsigned int bytes)
{
if (bytes == filebuffer_pos)
{
// Usually we're just going back in the buffer and memcpy would be
// unnecessary, but we do it in case we intentionally messed with the
// buffer
memcpy (filebuffer, buffer, bytes);
filebuffer_pos=0;
return;
}
if (filebuffer_pos>0) // Discard old bytes, because we may need the space
{
// Non optimal since data is moved later again but we don't care since
// we're never here in ccextractor.
memmove (filebuffer,filebuffer+filebuffer_pos,bytesinbuffer-filebuffer_pos);
bytesinbuffer-=filebuffer_pos;
bytesinbuffer=0;
filebuffer_pos=0;
}
if (bytesinbuffer + bytes > FILEBUFFERSIZE)
fatal (EXIT_BUG_BUG, "Invalid return_to_buffer() - please submit a bug report.");
memmove (filebuffer+bytes,filebuffer,bytesinbuffer);
memcpy (filebuffer,buffer,bytes);
bytesinbuffer+=bytes;
}
LLONG buffered_read_opt (unsigned char *buffer, unsigned int bytes)
{
LLONG copied=0;
position_sanity_check();
time_t seconds=0;
if (ccx_options.live_stream>0)
time (&seconds);
if (ccx_options.buffer_input || filebuffer_pos<bytesinbuffer)
{
// Needs to return data from filebuffer_start+pos to filebuffer_start+pos+bytes-1;
int eof = (infd==-1);
while ((!eof || ccx_options.live_stream) && bytes)
{
if (eof)
{
// No more data available inmediately, we sleep a while to give time
// for the data to come up
sleepandchecktimeout (seconds);
}
size_t ready = bytesinbuffer-filebuffer_pos;
if (ready==0) // We really need to read more
{
if (!ccx_options.buffer_input)
{
// We got in the buffering code because of the initial buffer for
// detection stuff. However we don't want more buffering so
// we do the rest directly on the final buffer.
int i;
do
{
// No code for network support here, because network is always
// buffered - if here, then it must be files.
if (buffer!=NULL) // Read
{
i=read (infd,buffer,bytes);
if( i == -1)
fatal (EXIT_READ_ERROR, "Error reading input file!\n");
buffer+=i;
}
else // Seek
{
LLONG op, np;
op =LSEEK (infd,0,SEEK_CUR); // Get current pos
if (op+bytes<0) // Would mean moving beyond start of file: Not supported
return 0;
np =LSEEK (infd,bytes,SEEK_CUR); // Pos after moving
i=(int) (np-op);
}
if (i==0 && ccx_options.live_stream)
{
if (ccx_options.input_source==CCX_DS_STDIN)
{
ccx_options.live_stream = 0;
break;
}
else
{
sleepandchecktimeout (seconds);
}
}
else
{
copied+=i;
bytes-=i;
}
}
while ((i || ccx_options.live_stream ||
(ccx_options.binary_concat && switch_to_next_file(copied))) && bytes);
return copied;
}
// Keep the last 8 bytes, so we have a guaranteed
// working seek (-8) - needed by mythtv.
int keep = bytesinbuffer > 8 ? 8 : bytesinbuffer;
memmove (filebuffer,filebuffer+(FILEBUFFERSIZE-keep),keep);
int i;
if (ccx_options.input_source==CCX_DS_FILE || ccx_options.input_source==CCX_DS_STDIN)
i=read (infd, filebuffer+keep,FILEBUFFERSIZE-keep);
else
{
socklen_t len = sizeof(cliaddr);
i = recvfrom(infd,(char *) filebuffer+keep,FILEBUFFERSIZE-keep,0,(struct sockaddr *)&cliaddr,&len);
}
if( i == -1)
fatal (EXIT_READ_ERROR, "Error reading input stream!\n");
if (i==0)
{
/* If live stream, don't try to switch - acknowledge eof here as it won't
cause a loop end */
if (ccx_options.live_stream || !(ccx_options.binary_concat && switch_to_next_file(copied)))
eof=1;
}
filebuffer_pos=keep;
bytesinbuffer=(int) i+keep;
ready=i;
}
int copy = (int) (ready>=bytes ? bytes:ready);
if (copy)
{
if (buffer!=NULL)
{
memcpy (buffer, filebuffer+filebuffer_pos, copy);
buffer+=copy;
}
filebuffer_pos+=copy;
bytes-=copy;
copied+=copy;
}
}
return copied;
}
else // Read without buffering
{
if (buffer!=NULL)
{
int i;
while (bytes>0 && infd!=-1 &&
((i=read(infd,buffer,bytes))!=0 || ccx_options.live_stream ||
(ccx_options.binary_concat && switch_to_next_file(copied))))
{
if( i == -1)
fatal (EXIT_READ_ERROR, "Error reading input file!\n");
else if (i==0)
sleepandchecktimeout (seconds);
else
{
copied+=i;
bytes-=i;
buffer+=i;
}
}
return copied;
}
// return fread(buffer,1,bytes,in);
//return FSEEK (in,bytes,SEEK_CUR);
while (bytes!=0 && infd!=-1)
{
LLONG op, np;
op =LSEEK (infd,0,SEEK_CUR); // Get current pos
if (op+bytes<0) // Would mean moving beyond start of file: Not supported
return 0;
np =LSEEK (infd,bytes,SEEK_CUR); // Pos after moving
copied=copied+(np-op);
bytes=bytes-(unsigned int) copied;
if (copied==0)
{
if (ccx_options.live_stream)
sleepandchecktimeout (seconds);
else
{
if (ccx_options.binary_concat)
switch_to_next_file(0);
else
break;
}
}
}
return copied;
}
}

View File

@@ -1,826 +0,0 @@
#include "ccextractor.h"
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include "708.h"
#include "dvb_subtitle_decoder.h"
// IMPORTED TRASH INFO, REMOVE
extern long num_nal_unit_type_7;
extern long num_vcl_hrd;
extern long num_nal_hrd;
extern long num_jump_in_frames;
extern long num_unexpected_sei_length;
/* General video information */
unsigned current_hor_size = 0;
unsigned current_vert_size = 0;
unsigned current_aspect_ratio = 0;
unsigned current_frame_rate = 4; // Assume standard fps, 29.97
double current_fps = (double) 30000.0 / 1001; /* 29.97 */ // TODO: Get from framerates_values[] instead
LLONG current_pts = 0;
unsigned rollover_bits = 0; // The PTS rolls over every 26 hours and that can happen in the middle of a stream.
LLONG result; // Number of bytes read/skipped in last read operation
int end_of_file=0; // End of file?
const static unsigned char DO_NOTHING[] = {0x80, 0x80};
LLONG inbuf = 0; // Number of bytes loaded in buffer
int ccx_bufferdatatype = CCX_PES; // Can be RAW, PES, H264 or Hauppage
int current_tref = 0; // Store temporal reference of current frame
enum ccx_frame_type current_picture_coding_type = CCX_FRAME_TYPE_RESET_OR_UNKNOWN;
// Remember if the last header was valid. Used to suppress too much output
// and the expected unrecognized first header for TiVo files.
int strangeheader=0;
unsigned char *filebuffer;
LLONG filebuffer_start; // Position of buffer start relative to file
int filebuffer_pos; // Position of pointer relative to buffer start
int bytesinbuffer; // Number of bytes we actually have on buffer
extern void *cxx_dvb_context;
LLONG process_raw_with_field (void);
// Program stream specific data grabber
LLONG ps_getmoredata(void)
{
int enough = 0;
int payload_read = 0;
static unsigned vpesnum=0;
unsigned char nextheader[512]; // Next header in PS
int falsepack=0;
// Read and return the next video PES payload
do
{
if (BUFSIZE-inbuf<500)
{
mprint("Less than 500 left\n");
enough=1; // Stop when less than 500 bytes are left in buffer
}
else
{
buffered_read(nextheader,6);
past+=result;
if (result!=6)
{
// Consider this the end of the show.
end_of_file=1;
break;
}
// Search for a header that is not a picture header (nextheader[3]!=0x00)
while ( !(nextheader[0]==0x00 && nextheader[1]==0x00
&& nextheader[2]==0x01 && nextheader[3]!=0x00) )
{
if( !strangeheader )
{
mprint ("\nNot a recognized header. Searching for next header.\n");
dump (CCX_DMT_GENERIC_NOTICES, nextheader,6,0,0);
// Only print the message once per loop / unrecognized header
strangeheader = 1;
}
unsigned char *newheader;
// The amount of bytes read into nextheader by the buffered_read above
int hlen = 6;
// Find first 0x00
// If there is a 00 in the first element we need to advance
// one step as clearly bytes 1,2,3 are wrong
newheader = (unsigned char *) memchr (nextheader+1, 0, hlen-1);
if (newheader != NULL )
{
int atpos = newheader-nextheader;
memmove (nextheader,newheader,(size_t)(hlen-atpos));
buffered_read(nextheader+(hlen-atpos),atpos);
past+=result;
if (result!=atpos)
{
end_of_file=1;
break;
}
}
else
{
buffered_read(nextheader,hlen);
past+=result;
if (result!=hlen)
{
end_of_file=1;
break;
}
}
}
if (end_of_file)
{
// No more headers
break;
}
// Found 00-00-01 in nextheader, assume a regular header
strangeheader=0;
// PACK header
if ( nextheader[3]==0xBA)
{
dbg_print(CCX_DMT_VERBOSE, "PACK header\n");
buffered_read(nextheader+6,8);
past+=result;
if (result!=8)
{
// Consider this the end of the show.
end_of_file=1;
break;
}
if ( (nextheader[4]&0xC4)!=0x44 || !(nextheader[6]&0x04)
|| !(nextheader[8]&0x04) || !(nextheader[9]&0x01)
|| (nextheader[12]&0x03)!=0x03 )
{
// broken pack header
falsepack=1;
}
// We don't need SCR/SCR_ext
int stufflen=nextheader[13]&0x07;
if (falsepack)
{
mprint ("Warning: Defective Pack header\n");
}
// If not defect, load stuffing
buffered_skip ((int) stufflen);
past+=stufflen;
// fake a result value as something was skipped
result=1;
continue;
}
// Some PES stream
else if (nextheader[3]>=0xBB && nextheader[3]<=0xDF)
{
// System header
// nextheader[3]==0xBB
// 0xBD Private 1
// 0xBE PAdding
// 0xBF Private 2
// 0xC0-0DF audio
unsigned headerlen=nextheader[4]<<8 | nextheader[5];
dbg_print(CCX_DMT_VERBOSE, "non Video PES (type 0x%2X) - len %u\n",
nextheader[3], headerlen);
// The 15000 here is quite arbitrary, the longest packages I
// know of are 12302 bytes (Private 1 data in RTL recording).
if ( headerlen > 15000 )
{
mprint("Suspicious non Video PES (type 0x%2X) - len %u\n",
nextheader[3], headerlen);
mprint("Do not skip over, search for next.\n");
headerlen = 2;
}
// Skip over it
buffered_skip ((int) headerlen);
past+=headerlen;
// fake a result value as something was skipped
result=1;
continue;
}
// Read the next video PES
else if ((nextheader[3]&0xf0)==0xe0)
{
int hlen; // Dummy variable, unused
int peslen = read_video_pes_header(nextheader, &hlen, 0);
if (peslen < 0)
{
end_of_file=1;
break;
}
vpesnum++;
dbg_print(CCX_DMT_VERBOSE, "PES video packet #%u\n", vpesnum);
int want = (int) ((BUFSIZE-inbuf)>peslen ? peslen : (BUFSIZE-inbuf));
if (want != peslen) {
fatal(EXIT_BUFFER_FULL, "Oh Oh, PES longer than remaining buffer space\n");
}
if (want == 0) // Found package with header but without payload
{
continue;
}
buffered_read (buffer+inbuf,want);
past=past+result;
if (result>0) {
payload_read+=(int) result;
}
inbuf+=result;
if (result!=want) { // Not complete - EOF
end_of_file=1;
break;
}
enough = 1; // We got one PES
} else {
// If we are here this is an unknown header type
mprint("Unknown header %02X\n", nextheader[3]);
strangeheader=1;
}
}
}
while (result!=0 && !enough && BUFSIZE!=inbuf);
dbg_print(CCX_DMT_VERBOSE, "PES data read: %d\n", payload_read);
return payload_read;
}
// Returns number of bytes read, or zero for EOF
LLONG general_getmoredata(void)
{
int bytesread = 0;
int want;
do
{
want = (int) (BUFSIZE-inbuf);
buffered_read (buffer+inbuf,want); // This is a macro.
// 'result' HAS the number of bytes read
past=past+result;
inbuf+=result;
bytesread+=(int) result;
} while (result!=0 && result!=want);
return bytesread;
}
// Hexadecimal dump process
void processhex (char *filename)
{
size_t max=(size_t) inputsize+1; // Enough for the whole thing. Hex dumps are small so we can be lazy here
char *line=(char *) malloc (max);
/* const char *mpeg_header="00 00 01 b2 43 43 01 f8 "; // Always present */
FILE *fr = fopen (filename, "rt");
unsigned char *bytes=NULL;
unsigned byte_count=0;
int warning_shown=0;
while(fgets(line, max-1, fr) != NULL)
{
char *c1, *c2=NULL; // Positions for first and second colons
/* int len; */
long timing;
if (line[0]==';') // Skip comments
continue;
c1=strchr (line,':');
if (c1) c2=strchr (c1+1,':');
if (!c2) // Line doesn't contain what we want
continue;
*c1=0;
*c2=0;
/* len=atoi (line); */
timing=atol (c1+2)*(MPEG_CLOCK_FREQ/1000);
current_pts=timing;
if (pts_set==0)
pts_set=1;
set_fts();
c2++;
/*
if (strlen (c2)==8)
{
unsigned char high1=c2[1];
unsigned char low1=c2[2];
int value1=hex2int (high1,low1);
unsigned char high2=c2[4];
unsigned char low2=c2[5];
int value2=hex2int (high2,low2);
buffer[0]=value1;
buffer[1]=value2;
inbuf=2;
process_raw();
continue;
}
if (strlen (c2)<=(strlen (mpeg_header)+1))
continue; */
c2++; // Skip blank
/*
if (strncmp (c2,mpeg_header,strlen (mpeg_header))) // No idea how to deal with this.
{
if (!warning_shown)
{
warning_shown=1;
mprint ("\nWarning: This file contains data I can't process: Please submit .hex for analysis!\n");
}
continue;
}
// OK, seems like a decent chunk of CCdata.
c2+=strlen (mpeg_header);
*/
byte_count=strlen (c2)/3;
/*
if (atoi (line)!=byte_count+strlen (mpeg_header)/3) // Number of bytes reported don't match actual contents
continue;
*/
if (atoi (line)!=byte_count) // Number of bytes reported don't match actual contents
continue;
if (!byte_count) // Nothing to get from this line except timing info, already done.
continue;
bytes=(unsigned char *) malloc (byte_count);
if (!bytes)
fatal (EXIT_NOT_ENOUGH_MEMORY, "Out of memory.\n");
unsigned char *bytes=(unsigned char *) malloc (byte_count);
for (unsigned i=0;i<byte_count;i++)
{
unsigned char high=c2[0];
unsigned char low=c2[1];
int value=hex2int (high,low);
if (value==-1)
fatal (EXIT_FAILURE, "Incorrect format, unexpected non-hex string.");
bytes[i]=value;
c2+=3;
}
memcpy (buffer, bytes, byte_count);
inbuf=byte_count;
process_raw();
continue;
// New wtv format, everything else hopefully obsolete
int ok=0; // Were we able to process the line?
// Attempt to detect how the data is encoded.
// Case 1 (seen in all elderman's samples):
// 18 : 467 : 00 00 01 b2 43 43 01 f8 03 42 ff fd 54 80 fc 94 2c ff
// Always 03 after header, then something unknown (seen 42, 43, c2, c3...),
// then ff, then data with field info, and terminated with ff.
if (byte_count>3 && bytes[0]==0x03 &&
bytes[2]==0xff && bytes[byte_count-1]==0xff)
{
ok=1;
for (unsigned i=3; i<byte_count-2; i+=3)
{
inbuf=3;
buffer[0]=bytes[i];
buffer[1]=bytes[i+1];
buffer[2]=bytes[i+2];
process_raw_with_field();
}
}
// Case 2 (seen in P2Pfiend samples):
// Seems to match McPoodle's descriptions on DVD encoding
else
{
unsigned char magic=bytes[0];
/* unsigned extra_field_flag=magic&1; */
unsigned caption_count=((magic>>1)&0x1F);
unsigned filler=((magic>>6)&1);
/* unsigned pattern=((magic>>7)&1); */
int always_ff=1;
int current_field=0;
if (filler==0 && caption_count*6==byte_count-1) // Note that we are ignoring the extra field for now...
{
ok=1;
for (unsigned i=1; i<byte_count-2; i+=3)
if (bytes[i]!=0xff)
{
// If we only find FF in the first byte then either there's only field 1 data, OR
// there's alternating field 1 and field 2 data. Don't know how to tell apart. For now
// let's assume that always FF means alternating.
always_ff=0;
break;
}
for (unsigned i=1; i<byte_count-2; i+=3)
{
inbuf=3;
if (always_ff) // Try to tell apart the fields based on the pattern field.
{
buffer[0]=current_field | 4; // | 4 to enable the 'valid' bit
current_field = !current_field;
}
else
buffer[0]=bytes[i];
buffer[1]=bytes[i+1];
buffer[2]=bytes[i+2];
process_raw_with_field();
}
}
}
if (!ok && !warning_shown)
{
warning_shown=1;
mprint ("\nWarning: This file contains data I can't process: Please submit .hex for analysis!\n");
}
free (bytes);
}
fclose(fr);
}
// Raw file process
void raw_loop ()
{
LLONG got;
LLONG processed;
current_pts = 90; // Pick a valid PTS time
pts_set = 1;
set_fts(); // Now set the FTS related variables
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
(unsigned) (current_pts));
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
do
{
inbuf=0;
got=general_getmoredata();
if (got == 0) // Shortcircuit if we got nothing to process
break;
processed=process_raw();
int ccblocks = cb_field1;
current_pts += cb_field1*1001/30*(MPEG_CLOCK_FREQ/1000);
set_fts(); // Now set the FTS related variables including fts_max
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
(unsigned) (current_pts));
dbg_print(CCX_DMT_VIDES, " FTS: %s incl. %d CB\n",
print_mstime(get_fts()), ccblocks);
if (processed<got)
{
mprint ("BUG BUG\n");
}
}
while (inbuf);
}
/* Process inbuf bytes in buffer holding raw caption data (three byte packets, the first being the field).
* The number of processed bytes is returned. */
LLONG process_raw_with_field (void)
{
unsigned char data[3];
data[0]=0x04; // Field 1
current_field=1;
for (unsigned long i=0; i<inbuf; i=i+3)
{
if ( !saw_caption_block && *(buffer+i)==0xff && *(buffer+i+1)==0xff)
{
// Skip broadcast header
}
else
{
data[0]=buffer[i];
data[1]=buffer[i+1];
data[2]=buffer[i+2];
// do_cb increases the cb_field1 counter so that get_fts()
// is correct.
do_cb(data);
}
}
return inbuf;
}
/* Process inbuf bytes in buffer holding raw caption data (two byte packets).
* The number of processed bytes is returned. */
LLONG process_raw (void)
{
unsigned char data[3];
data[0]=0x04; // Field 1
current_field=1;
for (unsigned long i=0; i<inbuf; i=i+2)
{
if ( !saw_caption_block && *(buffer+i)==0xff && *(buffer+i+1)==0xff)
{
// Skip broadcast header
}
else
{
data[1]=buffer[i];
data[2]=buffer[i+1];
// do_cb increases the cb_field1 counter so that get_fts()
// is correct.
do_cb(data);
}
}
return inbuf;
}
void general_loop(void)
{
LLONG overlap=0;
LLONG pos = 0; /* Current position in buffer */
inbuf = 0; // No data yet
end_of_file = 0;
current_picture_coding_type = CCX_FRAME_TYPE_RESET_OR_UNKNOWN;
while (!end_of_file && !processed_enough)
{
/* Get rid of the bytes we already processed */
overlap=inbuf-pos;
if ( pos != 0 ) {
// Only when needed as memmove has been seen crashing
// for dest==source and n >0
memmove (buffer,buffer+pos,(size_t) (inbuf-pos));
inbuf-=pos;
}
pos = 0;
// GET MORE DATA IN BUFFER
LLONG i;
position_sanity_check();
switch (stream_mode)
{
case CCX_SM_ELEMENTARY_OR_NOT_FOUND:
i = general_getmoredata();
break;
case CCX_SM_TRANSPORT:
i = ts_getmoredata();
break;
case CCX_SM_PROGRAM:
i = ps_getmoredata();
break;
case CCX_SM_ASF:
i = asf_getmoredata();
break;
case CCX_SM_WTV:
i = wtv_getmoredata();
break;
default:
fatal(EXIT_BUG_BUG, "Impossible stream_mode");
}
position_sanity_check();
if (fh_out_elementarystream!=NULL)
fwrite (buffer+overlap,1,(size_t) (inbuf-overlap),fh_out_elementarystream);
if (i==0)
{
end_of_file = 1;
memset (buffer+inbuf, 0, (size_t) (BUFSIZE-inbuf)); /* Clear buffer at the end */
}
if (inbuf == 0)
{
/* Done: Get outta here */
break;
}
LLONG got; // Means 'consumed' from buffer actually
static LLONG last_pts = 0x01FFFFFFFFLL;
if (ccx_options.hauppauge_mode)
{
got = process_raw_with_field();
if (pts_set)
set_fts(); // Try to fix timing from TS data
}
else if(ccx_bufferdatatype == CCX_DVB_SUBTITLE)
{
int out_size = 0;
dvbsub_decode(cxx_dvb_context,NULL,&out_size,buffer + 2,inbuf);
set_fts();
got = inbuf;
}
else if (ccx_bufferdatatype == CCX_PES)
{
got = process_m2v (buffer, inbuf);
}
else if (ccx_bufferdatatype == CCX_TELETEXT)
{
// Dispatch to Petr Kutalek 's telxcc.
tlt_process_pes_packet (buffer, (uint16_t) inbuf);
got = inbuf;
}
else if (ccx_bufferdatatype == CCX_PRIVATE_MPEG2_CC)
{
got = inbuf; // Do nothing. Still don't know how to process it
}
else if (ccx_bufferdatatype == CCX_RAW) // Raw two byte 608 data from DVR-MS/ASF
{
// The asf_getmoredata() loop sets current_pts when possible
if (pts_set == 0)
{
mprint("DVR-MS/ASF file without useful time stamps - count blocks.\n");
// Otherwise rely on counting blocks
current_pts = 12345; // Pick a valid PTS time
pts_set = 1;
}
if (current_pts != last_pts)
{
// Only initialize the FTS values and reset the cb
// counters when the PTS is different. This happens frequently
// with ASF files.
if (min_pts==0x01FFFFFFFFLL)
{
// First call
fts_at_gop_start = 0;
}
else
fts_at_gop_start = get_fts();
frames_since_ref_time = 0;
set_fts();
last_pts = current_pts;
}
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
(unsigned) (current_pts));
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
got = process_raw();
}
else if (ccx_bufferdatatype == CCX_H264) // H.264 data from TS file
{
got = process_avc(buffer, inbuf);
}
else
fatal(EXIT_BUG_BUG, "Unknown data type!");
if (got>inbuf)
{
mprint ("BUG BUG\n");
}
pos+=got;
if (ccx_options.live_stream)
{
int cur_sec = (int) (get_fts() / 1000);
int th=cur_sec/10;
if (last_reported_progress!=th)
{
activity_progress (-1,cur_sec/60, cur_sec%60);
last_reported_progress = th;
}
}
else
{
if (total_inputsize>255) // Less than 255 leads to division by zero below.
{
int progress = (int) ((((total_past+past)>>8)*100)/(total_inputsize>>8));
if (last_reported_progress != progress)
{
LLONG t=get_fts();
if (!t && global_timestamp_inited)
t=global_timestamp-min_global_timestamp;
int cur_sec = (int) (t / 1000);
activity_progress(progress, cur_sec/60, cur_sec%60);
last_reported_progress = progress;
}
}
}
position_sanity_check();
}
// Flush remaining HD captions
if (has_ccdata_buffered)
process_hdcc();
if (total_past!=total_inputsize && ccx_options.binary_concat && !processed_enough)
{
mprint("\n\n\n\nATTENTION!!!!!!\n");
mprint("Processing of %s %d ended prematurely %lld < %lld, please send bug report.\n\n",
inputfile[current_file], current_file, past, inputsize);
}
mprint ("\nNumber of NAL_type_7: %ld\n",num_nal_unit_type_7);
mprint ("Number of VCL_HRD: %ld\n",num_vcl_hrd);
mprint ("Number of NAL HRD: %ld\n",num_nal_hrd);
mprint ("Number of jump-in-frames: %ld\n",num_jump_in_frames);
mprint ("Number of num_unexpected_sei_length: %ld", num_unexpected_sei_length);
}
// Raw caption with FTS file process
void rcwt_loop( void )
{
static unsigned char *parsebuf;
static long parsebufsize = 1024;
// As BUFSIZE is a macro this is just a reminder
if (BUFSIZE < (3*0xFFFF + 10))
fatal (EXIT_BUG_BUG, "BUFSIZE too small for RCWT caption block.\n");
// Generic buffer to hold some data
parsebuf = (unsigned char*)malloc(1024);
LLONG currfts;
uint16_t cbcount = 0;
int bread = 0; // Bytes read
buffered_read(parsebuf,11);
past+=result;
bread+=(int) result;
if (result!=11)
{
mprint("Premature end of file!\n");
end_of_file=1;
return;
}
// Expecting RCWT header
if( !memcmp(parsebuf, "\xCC\xCC\xED", 3 ) )
{
dbg_print(CCX_DMT_PARSE, "\nRCWT header\n");
dbg_print(CCX_DMT_PARSE, "File created by %02X version %02X%02X\nFile format revision: %02X%02X\n",
parsebuf[3], parsebuf[4], parsebuf[5],
parsebuf[6], parsebuf[7]);
}
else
{
fatal(EXIT_MISSING_RCWT_HEADER, "Missing RCWT header. Abort.\n");
}
// Initialize first time. As RCWT files come with the correct FTS the
// initial (minimal) time needs to be set to 0.
current_pts = 0;
pts_set=1;
set_fts(); // Now set the FTS related variables
// Loop until no more data is found
while(1)
{
// Read the data header
buffered_read(parsebuf,10);
past+=result;
bread+=(int) result;
if (result!=10)
{
if (result!=0)
mprint("Premature end of file!\n");
// We are done
end_of_file=1;
break;
}
currfts = *((LLONG*)(parsebuf));
cbcount = *((uint16_t*)(parsebuf+8));
dbg_print(CCX_DMT_PARSE, "RCWT data header FTS: %s blocks: %u\n",
print_mstime(currfts), cbcount);
if ( cbcount > 0 )
{
if ( cbcount*3 > parsebufsize) {
parsebuf = (unsigned char*)realloc(parsebuf, cbcount*3);
if (!parsebuf)
fatal(EXIT_NOT_ENOUGH_MEMORY, "Out of memory");
parsebufsize = cbcount*3;
}
buffered_read(parsebuf,cbcount*3);
past+=result;
bread+=(int) result;
if (result!=cbcount*3)
{
mprint("Premature end of file!\n");
end_of_file=1;
break;
}
// Process the data
current_pts = currfts*(MPEG_CLOCK_FREQ/1000);
if (pts_set==0)
pts_set=1;
set_fts(); // Now set the FTS related variables
dbg_print(CCX_DMT_VIDES, "PTS: %s (%8u)",
print_mstime(current_pts/(MPEG_CLOCK_FREQ/1000)),
(unsigned) (current_pts));
dbg_print(CCX_DMT_VIDES, " FTS: %s\n", print_mstime(get_fts()));
for (int j=0; j<cbcount*3; j=j+3)
{
do_cb(parsebuf+j);
}
}
} // end while(1)
dbg_print(CCX_DMT_PARSE, "Processed %d bytes\n", bread);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,59 +1,64 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/base_coding.h>
#include <gpac/constants.h>
#ifndef GPAC_DISABLE_CORE_TOOLS
static const char base_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
GF_EXPORT
u32 gf_base64_encode(char *_in, u32 inSize, char *_out, u32 outSize)
u32 gf_base64_encode(const char *_in, u32 inSize, char *_out, u32 outSize)
{
s32 padding;
u32 i = 0, j = 0;
unsigned char *in = (unsigned char *)_in;
unsigned char *out = (unsigned char *)_out;
if (outSize < (inSize * 4 / 3)) return 0;
while (i < inSize) {
padding = 3 - (inSize - i);
if (padding == 2) {
out[j] = base_64[in[i]>>2];
out[j+1] = base_64[(in[i] & 0x03) << 4];
out[j+2] = '=';
out[j+3] = '=';
} else if (padding == 1) {
out[j] = base_64[in[i]>>2];
out[j+1] = base_64[((in[i] & 0x03) << 4) | ((in[i+1] & 0xf0) >> 4)];
out[j+2] = base_64[(in[i+1] & 0x0f) << 2];
out[j+3] = '=';
} else{
out[j] = base_64[in[i]>>2];
out[j+1] = base_64[((in[i] & 0x03) << 4) | ((in[i+1] & 0xf0) >> 4)];
out[j+2] = base_64[((in[i+1] & 0x0f) << 2) | ((in[i+2] & 0xc0) >> 6)];
out[j+3] = base_64[in[i+2] & 0x3f];
out[j] = base_64[in[i] >> 2];
out[j + 1] = base_64[(in[i] & 0x03) << 4];
out[j + 2] = '=';
out[j + 3] = '=';
}
else if (padding == 1) {
out[j] = base_64[in[i] >> 2];
out[j + 1] = base_64[((in[i] & 0x03) << 4) | ((in[i + 1] & 0xf0) >> 4)];
out[j + 2] = base_64[(in[i + 1] & 0x0f) << 2];
out[j + 3] = '=';
}
else {
out[j] = base_64[in[i] >> 2];
out[j + 1] = base_64[((in[i] & 0x03) << 4) | ((in[i + 1] & 0xf0) >> 4)];
out[j + 2] = base_64[((in[i + 1] & 0x0f) << 2) | ((in[i + 2] & 0xc0) >> 6)];
out[j + 3] = base_64[in[i + 2] & 0x3f];
}
i += 3;
j += 4;
@@ -62,38 +67,41 @@ u32 gf_base64_encode(char *_in, u32 inSize, char *_out, u32 outSize)
}
static const unsigned char index_64[128] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 62, 0xff, 0xff, 0xff, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0xff, 0xff, 0xff, 0xff, 0xff
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 62, 0xff, 0xff, 0xff, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0xff, 0xff, 0xff, 0xff, 0xff
};
#define char64(c) ((c > 127) ? (char) 0xff : index_64[(c)])
/*denoise input*/
u32 load_block(char *in, u32 size, u32 pos, char *out)
{
u32 i, len;
u32 load_block(char *in, u32 size, u32 pos, char *out)
{
u32 i, len;
u8 c;
len = i = 0;
while ((len<4) && ((pos+i)<size)) {
c = in[pos+i];
if ( ((c>='A') && (c<='Z'))
|| ((c>='a') && (c<='z'))
|| ((c>='0') && (c<='9'))
|| (c=='=') || (c=='+') || (c=='/')
) {
while ((len<4) && ((pos + i)<size)) {
c = in[pos + i];
if (((c >= 'A') && (c <= 'Z'))
|| ((c >= 'a') && (c <= 'z'))
|| ((c >= '0') && (c <= '9'))
|| (c == '=') || (c == '+') || (c == '/')
) {
out[len] = c;
len++;
}
i++;
}
while (len<4) { out[len] = (char) 0xFF; len++; }
return pos+i;
while (len<4) {
out[len] = (char)0xFF;
len++;
}
return pos + i;
}
GF_EXPORT
@@ -107,22 +115,24 @@ u32 gf_base64_decode(char *in_buf, u32 inSize, char *out, u32 outSize)
while ((i + 3) < inSize) {
padding = 0;
i = load_block(in_buf, inSize, i, (char*)in);
c[0] = char64(in[0]);
c[0] = char64(in[0]);
padding += (c[0] == 0xff);
c[1] = char64(in[1]);
padding += (c[1] == 0xff);
c[2] = char64(in[2]);
padding += (c[2] == 0xff);
c[3] = char64(in[3]);
c[3] = char64(in[3]);
padding += (c[3] == 0xff);
if (padding == 2) {
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
out[j] = (c[1] & 0x0f) << 4;
} else if (padding == 1) {
out[j] = (c[1] & 0x0f) << 4;
}
else if (padding == 1) {
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
out[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
out[j] = (c[2] & 0x03) << 6;
} else {
out[j] = (c[2] & 0x03) << 6;
}
else {
out[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
out[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
out[j++] = ((c[2] & 0x03) << 6) | (c[3] & 0x3f);
@@ -132,11 +142,6 @@ u32 gf_base64_decode(char *in_buf, u32 inSize, char *out, u32 outSize)
return j;
}
/*
* Copyright (c) ENST 2004 - Philippe de Cuetos
*/
static const char base_16[] = "0123456789abcdef";
GF_EXPORT
@@ -146,14 +151,14 @@ u32 gf_base16_encode(char *_in, u32 inSize, char *_out, u32 outSize)
unsigned char *in = (unsigned char *)_in;
unsigned char *out = (unsigned char *)_out;
if (outSize < (inSize * 2)+1) return 0;
if (outSize < (inSize * 2) + 1) return 0;
for (i=0;i<inSize;i++) {
out[2*i] = base_16[((in[i] & 0xf0) >> 4)];
out[2*i+1] = base_16[(in[i] & 0x0f)];
for (i = 0; i<inSize; i++) {
out[2 * i] = base_16[((in[i] & 0xf0) >> 4)];
out[2 * i + 1] = base_16[(in[i] & 0x0f)];
}
out[(inSize * 2)] = 0;
return i;
}
@@ -162,91 +167,89 @@ u32 gf_base16_encode(char *_in, u32 inSize, char *_out, u32 outSize)
GF_EXPORT
u32 gf_base16_decode(char *in, u32 inSize, char *out, u32 outSize)
{
u32 j=0;
u32 c[2] = {0,0};
u32 j = 0;
u32 c[2] = { 0,0 };
if (outSize < (inSize / 2)) return 0;
if ((inSize % 2) != 0) return 0;
for (j=0;j<inSize/2;j++) {
c[0] = char16(in[2*j]);
c[1] = char16(in[2*j+1]);
out[j] = ((c[0] << 4)&0xf0) | (c[1]&0x0f);
for (j = 0; j<inSize / 2; j++) {
c[0] = char16(in[2 * j]);
c[1] = char16(in[2 * j + 1]);
out[j] = ((c[0] << 4) & 0xf0) | (c[1] & 0x0f);
}
out[inSize/2] = 0;
out[inSize / 2] = 0;
return j;
}
// #include <gpac/zlib.h>
#ifndef GPAC_DISABLE_ZLIB
#include <zlib.h>
#define ZLIB_COMPRESS_SAFE 4
#define HAVE_ZLIB 0
GF_EXPORT
GF_Err gf_gz_compress_payload(char **data, u32 data_len, u32 *max_size)
{
#if HAVE_ZLIB
z_stream stream;
int err;
char *dest = (char *)gf_malloc(sizeof(char)*data_len*ZLIB_COMPRESS_SAFE);
stream.next_in = (Bytef*)(*data) ;
stream.avail_in = (uInt)data_len ;
stream.next_out = ( Bytef*)dest;
stream.avail_out = (uInt)data_len*ZLIB_COMPRESS_SAFE;
stream.zalloc = (alloc_func)NULL;
stream.zfree = (free_func)NULL;
stream.opaque = (voidpf)NULL;
z_stream stream;
int err;
char *dest = (char *)gf_malloc(sizeof(char)*data_len*ZLIB_COMPRESS_SAFE);
stream.next_in = (Bytef*)(*data);
stream.avail_in = (uInt)data_len;
stream.next_out = (Bytef*)dest;
stream.avail_out = (uInt)data_len*ZLIB_COMPRESS_SAFE;
stream.zalloc = (alloc_func)NULL;
stream.zfree = (free_func)NULL;
stream.opaque = (voidpf)NULL;
err = deflateInit(&stream, 9);
if (err != Z_OK) {
err = deflateInit(&stream, 9);
if (err != Z_OK) {
gf_free(dest);
return GF_IO_ERR;
}
}
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
gf_free(dest);
return GF_IO_ERR;
}
if (data_len <stream.total_out) {
GF_LOG(GF_LOG_WARNING, GF_LOG_CORE, ("[GZ] compressed data (%d) larger than input (%d)\n", (u32) stream.total_out, (u32) data_len ));
}
return GF_IO_ERR;
}
if (data_len <stream.total_out) {
GF_LOG(GF_LOG_WARNING, GF_LOG_CORE, ("[GZ] compressed data (%d) larger than input (%d)\n", (u32)stream.total_out, (u32)data_len));
}
if (*max_size < stream.total_out) {
if (*max_size < stream.total_out) {
*max_size = data_len*ZLIB_COMPRESS_SAFE;
*data = gf_realloc(*data, *max_size * sizeof(char));
}
*data = (char*)gf_realloc(*data, *max_size * sizeof(char));
}
memcpy((*data) , dest, sizeof(char)*stream.total_out);
*max_size = stream.total_out;
gf_free(dest);
memcpy((*data), dest, sizeof(char)*stream.total_out);
*max_size = (u32)stream.total_out;
gf_free(dest);
deflateEnd(&stream);
return GF_OK;
#else
return GF_IO_ERR;
#endif
deflateEnd(&stream);
return GF_OK;
}
GF_EXPORT
GF_Err gf_gz_decompress_payload(char *data, u32 data_len, char **uncompressed_data, u32 *out_size)
{
#if HAVE_ZLIB
z_stream d_stream;
GF_Err e = GF_OK;
int err;
u32 size = 4096;
*uncompressed_data = gf_malloc(sizeof(char)*4096);
*uncompressed_data = (char*)gf_malloc(sizeof(char) * 4096);
if (!*uncompressed_data) return GF_OUT_OF_MEM;
d_stream.zalloc = (alloc_func)0;
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
d_stream.next_in = (Bytef*)data;
d_stream.next_in = (Bytef*)data;
d_stream.avail_in = data_len;
d_stream.next_out = (Bytef*) *uncompressed_data;
d_stream.next_out = (Bytef*)*uncompressed_data;
d_stream.avail_out = 4096;
err = inflateInit(&d_stream);
@@ -257,24 +260,25 @@ GF_Err gf_gz_decompress_payload(char *data, u32 data_len, char **uncompressed_da
e = GF_NON_COMPLIANT_BITSTREAM;
break;
}
if (err==Z_STREAM_END) break;
if (err == Z_STREAM_END) break;
size *= 2;
*uncompressed_data = gf_realloc(*uncompressed_data, sizeof(char)*size);
*uncompressed_data = (char*)gf_realloc(*uncompressed_data, sizeof(char)*size);
if (!*uncompressed_data) return GF_OUT_OF_MEM;
d_stream.avail_out = (size - d_stream.total_out);
d_stream.next_out = (Bytef*) ( *uncompressed_data + d_stream.total_out);
d_stream.avail_out = (u32)(size - d_stream.total_out);
d_stream.next_out = (Bytef*)(*uncompressed_data + d_stream.total_out);
}
*out_size = d_stream.total_out;
*out_size = (u32)d_stream.total_out;
inflateEnd(&d_stream);
return e;
}
if (e!=GF_OK) {
if (e != GF_OK) {
gf_free(*uncompressed_data);
*uncompressed_data = NULL;
}
return e;
#else
return GF_IO_ERR;
#endif
}
}
#endif /*GPAC_DISABLE_ZLIB*/
#endif /* GPAC_DISABLE_CORE_TOOLS*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,28 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include "../disable_warnings.h"
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
#ifndef GPAC_DISABLE_ISOM
@@ -30,8 +31,9 @@ void gppa_del(GF_Box *s)
{
GF_3GPPAudioSampleEntryBox *ptr = (GF_3GPPAudioSampleEntryBox *)s;
if (ptr == NULL) return;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)ptr);
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
if (ptr->protection_info) gf_isom_box_del((GF_Box *)ptr->protection_info);
gf_free(ptr);
}
@@ -50,11 +52,8 @@ GF_Err gppa_Read(GF_Box *s, GF_BitStream *bs)
GF_Box *gppa_New(u32 type)
{
GF_3GPPAudioSampleEntryBox *tmp;
GF_SAFEALLOC(tmp, GF_3GPPAudioSampleEntryBox);
if (tmp == NULL) return NULL;
ISOM_DECL_BOX_ALLOC(GF_3GPPAudioSampleEntryBox, type);
gf_isom_audio_sample_entry_init((GF_AudioSampleEntryBox*)tmp);
tmp->type = type;
return (GF_Box *)tmp;
}
@@ -89,19 +88,16 @@ GF_Err gppa_Size(GF_Box *s)
GF_Box *gppv_New(u32 type)
{
GF_3GPPVisualSampleEntryBox *tmp;
GF_SAFEALLOC(tmp, GF_3GPPVisualSampleEntryBox);
if (tmp == NULL) return NULL;
ISOM_DECL_BOX_ALLOC(GF_3GPPVisualSampleEntryBox, type);
gf_isom_video_sample_entry_init((GF_VisualSampleEntryBox *)tmp);
tmp->type = type;
return (GF_Box *)tmp;
}
void gppv_del(GF_Box *s)
{
GF_3GPPVisualSampleEntryBox *ptr = (GF_3GPPVisualSampleEntryBox *)s;
if (ptr == NULL) return;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)ptr);
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
if (ptr->protection_info) gf_isom_box_del((GF_Box *)ptr->protection_info);
gf_free(ptr);
}
@@ -148,10 +144,7 @@ GF_Err gppv_Size(GF_Box *s)
GF_Box *gppc_New(u32 type)
{
GF_3GPPConfigBox *tmp = (GF_3GPPConfigBox *) gf_malloc(sizeof(GF_3GPPConfigBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_3GPPConfigBox));
tmp->type = type;
ISOM_DECL_BOX_ALLOC(GF_3GPPConfigBox, type);
return (GF_Box *)tmp;
}
@@ -182,7 +175,7 @@ GF_Err gppc_Read(GF_Box *s, GF_BitStream *bs)
ptr->cfg.AMR_mode_change_period = gf_bs_read_u8(bs);
ptr->cfg.frames_per_sample = gf_bs_read_u8(bs);
break;
case GF_ISOM_BOX_TYPE_DEVC:
case GF_ISOM_BOX_TYPE_DEVC:
case GF_ISOM_BOX_TYPE_DQCP:
case GF_ISOM_BOX_TYPE_DSMV:
ptr->cfg.frames_per_sample = gf_bs_read_u8(bs);
@@ -252,18 +245,15 @@ GF_Err gppc_Size(GF_Box *s)
GF_Box *ftab_New()
{
GF_FontTableBox *tmp;
GF_SAFEALLOC(tmp, GF_FontTableBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_FTAB;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_FontTableBox, GF_ISOM_BOX_TYPE_FTAB);
return (GF_Box *)tmp;
}
void ftab_del(GF_Box *s)
{
GF_FontTableBox *ptr = (GF_FontTableBox *)s;
if (ptr->fonts) {
u32 i;
for (i=0; i<ptr->entry_count; i++)
for (i = 0; i<ptr->entry_count; i++)
if (ptr->fonts[i].fontName) gf_free(ptr->fonts[i].fontName);
gf_free(ptr->fonts);
}
@@ -274,13 +264,20 @@ GF_Err ftab_Read(GF_Box *s, GF_BitStream *bs)
u32 i;
GF_FontTableBox *ptr = (GF_FontTableBox *)s;
ptr->entry_count = gf_bs_read_u16(bs);
ptr->fonts = (GF_FontRecord *) gf_malloc(sizeof(GF_FontRecord)*ptr->entry_count);
for (i=0; i<ptr->entry_count; i++) {
ptr->size -= 2;
if (ptr->size<ptr->entry_count * 3) {
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] Corrupted ftap box, skipping\n"));
ptr->entry_count = 0;
return GF_OK;
}
ptr->fonts = (GF_FontRecord *)gf_malloc(sizeof(GF_FontRecord)*ptr->entry_count);
memset(ptr->fonts, 0, sizeof(GF_FontRecord)*ptr->entry_count);
for (i = 0; i<ptr->entry_count; i++) {
u32 len;
ptr->fonts[i].fontID = gf_bs_read_u16(bs);
len = gf_bs_read_u8(bs);
if (len) {
ptr->fonts[i].fontName = (char *)gf_malloc(sizeof(char)*(len+1));
ptr->fonts[i].fontName = (char *)gf_malloc(sizeof(char)*(len + 1));
gf_bs_read_data(bs, ptr->fonts[i].fontName, len);
ptr->fonts[i].fontName[len] = 0;
}
@@ -297,13 +294,14 @@ GF_Err ftab_Write(GF_Box *s, GF_BitStream *bs)
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u16(bs, ptr->entry_count);
for (i=0; i<ptr->entry_count; i++) {
for (i = 0; i<ptr->entry_count; i++) {
gf_bs_write_u16(bs, ptr->fonts[i].fontID);
if (ptr->fonts[i].fontName) {
u32 len = strlen(ptr->fonts[i].fontName);
u32 len = (u32)strlen(ptr->fonts[i].fontName);
gf_bs_write_u8(bs, len);
gf_bs_write_data(bs, ptr->fonts[i].fontName, len);
} else {
}
else {
gf_bs_write_u8(bs, 0);
}
}
@@ -316,7 +314,7 @@ GF_Err ftab_Size(GF_Box *s)
GF_Err e = gf_isom_box_get_size(s);
if (e) return e;
s->size += 2;
for (i=0; i<ptr->entry_count; i++) {
for (i = 0; i<ptr->entry_count; i++) {
s->size += 3;
if (ptr->fonts[i].fontName) s->size += strlen(ptr->fonts[i].fontName);
}
@@ -329,17 +327,15 @@ GF_Err ftab_Size(GF_Box *s)
GF_Box *text_New()
{
GF_TextSampleEntryBox *tmp;
GF_SAFEALLOC(tmp, GF_TextSampleEntryBox);
if (!tmp)
return NULL;
tmp->type = GF_ISOM_BOX_TYPE_TEXT;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextSampleEntryBox, GF_ISOM_BOX_TYPE_TEXT);
return (GF_Box *)tmp;
}
void text_del(GF_Box *s)
{
GF_TextSampleEntryBox *ptr = (GF_TextSampleEntryBox*)s;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
if (ptr->textName)
gf_free(ptr->textName);
gf_free(ptr);
@@ -347,17 +343,16 @@ void text_del(GF_Box *s)
GF_Box *tx3g_New()
{
GF_Tx3gSampleEntryBox *tmp;
GF_SAFEALLOC(tmp, GF_Tx3gSampleEntryBox);
if (!tmp)
return NULL;
tmp->type = GF_ISOM_BOX_TYPE_TX3G;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_Tx3gSampleEntryBox, GF_ISOM_BOX_TYPE_TX3G);
return (GF_Box *)tmp;
}
void tx3g_del(GF_Box *s)
{
GF_Tx3gSampleEntryBox *ptr = (GF_Tx3gSampleEntryBox*)s;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
if (ptr->font_table)
gf_isom_box_del((GF_Box *)ptr->font_table);
gf_free(ptr);
@@ -371,9 +366,12 @@ static u32 gpp_read_rgba(GF_BitStream *bs)
g = gf_bs_read_u8(bs);
b = gf_bs_read_u8(bs);
a = gf_bs_read_u8(bs);
col = a; col<<=8;
col |= r; col<<=8;
col |= g; col<<=8;
col = a;
col <<= 8;
col |= r;
col <<= 8;
col |= g;
col <<= 8;
col |= b;
return col;
}
@@ -416,16 +414,24 @@ GF_Err tx3g_Read(GF_Box *s, GF_BitStream *bs)
gpp_read_style(bs, &ptr->default_style);
ptr->size -= 18 + GPP_BOX_SIZE + GPP_STYLE_SIZE;
while (ptr->size) {
while (ptr->size >= 8) {
e = gf_isom_parse_box(&a, bs);
if (e) return e;
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
ptr->size -= a->size;
if (a->type==GF_ISOM_BOX_TYPE_FTAB) {
if (ptr->font_table) gf_isom_box_del((GF_Box *) ptr->font_table);
ptr->font_table = (GF_FontTableBox *)a;
} else {
if (ptr->size<a->size) {
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] Box \"%s\" larger than remaining bytes in tx3g - ignoring box\n", gf_4cc_to_str(a->type)));
ptr->size = 0;
gf_isom_box_del(a);
return GF_OK;
}
ptr->size -= a->size;
if (a->type == GF_ISOM_BOX_TYPE_FTAB) {
if (ptr->font_table) gf_isom_box_del((GF_Box *)ptr->font_table);
ptr->font_table = (GF_FontTableBox *)a;
}
else {
e = gf_isom_box_add_default(s, a);
if (e) return e;
}
}
return GF_OK;
@@ -445,9 +451,9 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
gpp_read_box(bs, &ptr->default_box); /*Default text box*/
gf_bs_read_data(bs, ptr->reserved1, 8); /*Reserved*/
ptr->fontNumber = gf_bs_read_u16(bs); /*Font number*/
ptr->fontFace = gf_bs_read_u16(bs); /*Font face*/
ptr->reserved2 = gf_bs_read_u8(bs); /*Reserved*/
ptr->reserved3 = gf_bs_read_u16(bs); /*Reserved*/
ptr->fontFace = gf_bs_read_u16(bs); /*Font face*/
ptr->reserved2 = gf_bs_read_u8(bs); /*Reserved*/
ptr->reserved3 = gf_bs_read_u16(bs); /*Reserved*/
gf_bs_read_data(bs, ptr->foreground_color, 6); /*Foreground color*/
if (ptr->size < 51)
return GF_ISOM_INVALID_FILE;
@@ -457,10 +463,38 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
pSize = gf_bs_read_u8(bs); /*a Pascal string begins with its size: get textName size*/
ptr->size -= 1;
if (ptr->size < pSize)
return GF_ISOM_INVALID_FILE;
if (ptr->size < pSize) {
u32 s = pSize;
size_t i = 0;
GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string: trying to decode anyway.\n"));
ptr->textName = (char*)gf_malloc((u32)ptr->size + 1 + 1);
do {
char c = (char)s;
if (c == '\0') {
break;
}
else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
ptr->textName[i] = c;
}
else {
gf_free(ptr->textName);
ptr->textName = NULL;
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string and contains non-chars. Abort.\n"));
return GF_ISOM_INVALID_FILE;
}
i++;
if (!ptr->size)
break;
ptr->size--;
s = gf_bs_read_u8(bs);
} while (s);
ptr->textName[i] = '\0'; /*Font name*/
GF_LOG(GF_LOG_WARNING, GF_LOG_CONTAINER, ("[iso file] text box doesn't use a Pascal string: \"%s\" detected.\n", ptr->textName));
return GF_OK;
}
if (pSize) {
ptr->textName = (char*) gf_malloc(pSize+1 * sizeof(char));
ptr->textName = (char*)gf_malloc(pSize + 1 * sizeof(char));
if (gf_bs_read_data(bs, ptr->textName, pSize) != pSize) {
gf_free(ptr->textName);
ptr->textName = NULL;
@@ -475,10 +509,10 @@ GF_Err text_Read(GF_Box *s, GF_BitStream *bs)
void gpp_write_rgba(GF_BitStream *bs, u32 col)
{
gf_bs_write_u8(bs, (col>>16) & 0xFF);
gf_bs_write_u8(bs, (col>>8) & 0xFF);
gf_bs_write_u8(bs, (col >> 16) & 0xFF);
gf_bs_write_u8(bs, (col >> 8) & 0xFF);
gf_bs_write_u8(bs, (col) & 0xFF);
gf_bs_write_u8(bs, (col>>24) & 0xFF);
gf_bs_write_u8(bs, (col >> 24) & 0xFF);
}
void gpp_write_box(GF_BitStream *bs, GF_BoxRecord *rec)
@@ -517,7 +551,7 @@ GF_Err tx3g_Write(GF_Box *s, GF_BitStream *bs)
gpp_write_rgba(bs, ptr->back_color);
gpp_write_box(bs, &ptr->default_box);
gpp_write_style(bs, &ptr->default_style);
return gf_isom_box_write((GF_Box *) ptr->font_table, bs);
return gf_isom_box_write((GF_Box *)ptr->font_table, bs);
}
GF_Err text_Write(GF_Box *s, GF_BitStream *bs)
@@ -540,10 +574,12 @@ GF_Err text_Write(GF_Box *s, GF_BitStream *bs)
gf_bs_write_u8(bs, ptr->reserved2); /*Reserved*/
gf_bs_write_u16(bs, ptr->reserved3); /*Reserved*/
gf_bs_write_data(bs, ptr->foreground_color, 6); /*Foreground color*/
if (ptr->textName && (pSize=strlen(ptr->textName))) {
//pSize assignment below is not a mistake
if (ptr->textName && (pSize = (u16)strlen(ptr->textName))) {
gf_bs_write_u8(bs, pSize); /*a Pascal string begins with its size*/
gf_bs_write_data(bs, ptr->textName, pSize); /*Font name*/
} else {
}
else {
gf_bs_write_u8(bs, 0);
}
return GF_OK;
@@ -557,7 +593,7 @@ GF_Err tx3g_Size(GF_Box *s)
/*base + this + box + style*/
s->size += 18 + GPP_BOX_SIZE + GPP_STYLE_SIZE;
if (ptr->font_table) {
e = gf_isom_box_size((GF_Box *) ptr->font_table);
e = gf_isom_box_size((GF_Box *)ptr->font_table);
if (e) return e;
s->size += ptr->font_table->size;
}
@@ -580,11 +616,8 @@ GF_Err text_Size(GF_Box *s)
GF_Box *styl_New()
{
GF_TextStyleBox *tmp;
GF_SAFEALLOC(tmp, GF_TextStyleBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_STYL;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextStyleBox, GF_ISOM_BOX_TYPE_STYL);
return (GF_Box *)tmp;
}
void styl_del(GF_Box *s)
@@ -601,7 +634,7 @@ GF_Err styl_Read(GF_Box *s, GF_BitStream *bs)
ptr->entry_count = gf_bs_read_u16(bs);
if (ptr->entry_count) {
ptr->styles = (GF_StyleRecord*)gf_malloc(sizeof(GF_StyleRecord)*ptr->entry_count);
for (i=0; i<ptr->entry_count; i++) {
for (i = 0; i<ptr->entry_count; i++) {
gpp_read_style(bs, &ptr->styles[i]);
}
}
@@ -615,10 +648,10 @@ GF_Err styl_Write(GF_Box *s, GF_BitStream *bs)
u32 i;
GF_TextStyleBox*ptr = (GF_TextStyleBox*)s;
e = gf_isom_box_write_header(s, bs);
assert(e == GF_OK);
if (e) return e;
gf_bs_write_u16(bs, ptr->entry_count);
for (i=0; i<ptr->entry_count; i++) gpp_write_style(bs, &ptr->styles[i]);
for (i = 0; i<ptr->entry_count; i++) gpp_write_style(bs, &ptr->styles[i]);
return GF_OK;
}
@@ -635,11 +668,8 @@ GF_Err styl_Size(GF_Box *s)
GF_Box *hlit_New()
{
GF_TextHighlightBox *tmp;
GF_SAFEALLOC(tmp, GF_TextHighlightBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_HLIT;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextHighlightBox, GF_ISOM_BOX_TYPE_HLIT);
return (GF_Box *)tmp;
}
void hlit_del(GF_Box *s)
@@ -679,11 +709,8 @@ GF_Err hlit_Size(GF_Box *s)
GF_Box *hclr_New()
{
GF_TextHighlightColorBox*tmp;
GF_SAFEALLOC(tmp, GF_TextHighlightColorBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_HCLR;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextHighlightColorBox, GF_ISOM_BOX_TYPE_HCLR);
return (GF_Box *)tmp;
}
void hclr_del(GF_Box *s)
@@ -721,11 +748,8 @@ GF_Err hclr_Size(GF_Box *s)
GF_Box *krok_New()
{
GF_TextKaraokeBox*tmp;
GF_SAFEALLOC(tmp, GF_TextKaraokeBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_KROK;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextKaraokeBox, GF_ISOM_BOX_TYPE_KROK);
return (GF_Box *)tmp;
}
void krok_del(GF_Box *s)
@@ -744,7 +768,7 @@ GF_Err krok_Read(GF_Box *s, GF_BitStream *bs)
if (ptr->nb_entries) {
u32 i;
ptr->records = (KaraokeRecord*)gf_malloc(sizeof(KaraokeRecord)*ptr->nb_entries);
for (i=0; i<ptr->nb_entries; i++) {
for (i = 0; i<ptr->nb_entries; i++) {
ptr->records[i].highlight_endtime = gf_bs_read_u32(bs);
ptr->records[i].start_charoffset = gf_bs_read_u16(bs);
ptr->records[i].end_charoffset = gf_bs_read_u16(bs);
@@ -764,7 +788,7 @@ GF_Err krok_Write(GF_Box *s, GF_BitStream *bs)
gf_bs_write_u32(bs, ptr->highlight_starttime);
gf_bs_write_u16(bs, ptr->nb_entries);
for (i=0; i<ptr->nb_entries; i++) {
for (i = 0; i<ptr->nb_entries; i++) {
gf_bs_write_u32(bs, ptr->records[i].highlight_endtime);
gf_bs_write_u16(bs, ptr->records[i].start_charoffset);
gf_bs_write_u16(bs, ptr->records[i].end_charoffset);
@@ -777,7 +801,7 @@ GF_Err krok_Size(GF_Box *s)
GF_TextKaraokeBox*ptr = (GF_TextKaraokeBox*)s;
GF_Err e = gf_isom_box_get_size(s);
if (e) return e;
s->size += 6 * 8*ptr->nb_entries;
s->size += 6 * 8 * ptr->nb_entries;
return GF_OK;
}
@@ -785,11 +809,8 @@ GF_Err krok_Size(GF_Box *s)
GF_Box *dlay_New()
{
GF_TextScrollDelayBox*tmp;
GF_SAFEALLOC(tmp, GF_TextScrollDelayBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_DLAY;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextScrollDelayBox, GF_ISOM_BOX_TYPE_DLAY);
return (GF_Box *)tmp;
}
void dlay_del(GF_Box *s)
@@ -827,11 +848,8 @@ GF_Err dlay_Size(GF_Box *s)
GF_Box *href_New()
{
GF_TextHyperTextBox*tmp;
GF_SAFEALLOC(tmp, GF_TextHyperTextBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_HREF;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextHyperTextBox, GF_ISOM_BOX_TYPE_HREF);
return (GF_Box *)tmp;
}
void href_del(GF_Box *s)
@@ -850,15 +868,15 @@ GF_Err href_Read(GF_Box *s, GF_BitStream *bs)
ptr->endcharoffset = gf_bs_read_u16(bs);
len = gf_bs_read_u8(bs);
if (len) {
ptr->URL = (char *) gf_malloc(sizeof(char) * (len+1));
ptr->URL = (char *)gf_malloc(sizeof(char) * (len + 1));
gf_bs_read_data(bs, ptr->URL, len);
ptr->URL[len] = 0;
}
len = gf_bs_read_u8(bs);
if (len) {
ptr->URL_hint = (char *) gf_malloc(sizeof(char) * (len+1));
ptr->URL_hint = (char *)gf_malloc(sizeof(char) * (len + 1));
gf_bs_read_data(bs, ptr->URL_hint, len);
ptr->URL_hint[len]= 0;
ptr->URL_hint[len] = 0;
}
return GF_OK;
}
@@ -875,17 +893,19 @@ GF_Err href_Write(GF_Box *s, GF_BitStream *bs)
gf_bs_write_u16(bs, ptr->startcharoffset);
gf_bs_write_u16(bs, ptr->endcharoffset);
if (ptr->URL) {
len = strlen(ptr->URL);
len = (u32)strlen(ptr->URL);
gf_bs_write_u8(bs, len);
gf_bs_write_data(bs, ptr->URL, len);
} else {
}
else {
gf_bs_write_u8(bs, 0);
}
if (ptr->URL_hint) {
len = strlen(ptr->URL_hint);
len = (u32)strlen(ptr->URL_hint);
gf_bs_write_u8(bs, len);
gf_bs_write_data(bs, ptr->URL_hint, len);
} else {
}
else {
gf_bs_write_u8(bs, 0);
}
return GF_OK;
@@ -907,11 +927,8 @@ GF_Err href_Size(GF_Box *s)
GF_Box *tbox_New()
{
GF_TextBoxBox*tmp;
GF_SAFEALLOC(tmp, GF_TextBoxBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_TBOX;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextBoxBox, GF_ISOM_BOX_TYPE_TBOX);
return (GF_Box *)tmp;
}
void tbox_del(GF_Box *s)
@@ -950,11 +967,8 @@ GF_Err tbox_Size(GF_Box *s)
GF_Box *blnk_New()
{
GF_TextBlinkBox*tmp;
GF_SAFEALLOC(tmp, GF_TextBlinkBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_BLNK;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextBlinkBox, GF_ISOM_BOX_TYPE_BLNK);
return (GF_Box *)tmp;
}
void blnk_del(GF_Box *s)
@@ -994,11 +1008,8 @@ GF_Err blnk_Size(GF_Box *s)
GF_Box *twrp_New()
{
GF_TextWrapBox*tmp;
GF_SAFEALLOC(tmp, GF_TextWrapBox);
if (!tmp) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_TWRP;
return (GF_Box *) tmp;
ISOM_DECL_BOX_ALLOC(GF_TextWrapBox, GF_ISOM_BOX_TYPE_TWRP);
return (GF_Box *)tmp;
}
void twrp_del(GF_Box *s)
@@ -1036,27 +1047,27 @@ GF_Err twrp_Size(GF_Box *s)
void tsel_del(GF_Box *s)
{
GF_TrackSelectionBox *ptr;
ptr = (GF_TrackSelectionBox *) s;
ptr = (GF_TrackSelectionBox *)s;
if (ptr == NULL) return;
if (ptr->attributeList) gf_free(ptr->attributeList);
gf_free(ptr);
}
GF_Err tsel_Read(GF_Box *s,GF_BitStream *bs)
GF_Err tsel_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->switchGroup = gf_bs_read_u32(bs);
ptr->size -= 4;
if (ptr->size % 4) return GF_ISOM_INVALID_FILE;
ptr->attributeListCount = (u32)ptr->size/4;
ptr->attributeList = (u32 * ) gf_malloc(ptr->attributeListCount*sizeof(u32));
ptr->attributeListCount = (u32)ptr->size / 4;
ptr->attributeList = gf_malloc(ptr->attributeListCount * sizeof(u32));
if (ptr->attributeList == NULL) return GF_OUT_OF_MEM;
for (i=0; i< ptr->attributeListCount; i++) {
for (i = 0; i< ptr->attributeListCount; i++) {
ptr->attributeList[i] = gf_bs_read_u32(bs);
}
return GF_OK;
@@ -1064,13 +1075,8 @@ GF_Err tsel_Read(GF_Box *s,GF_BitStream *bs)
GF_Box *tsel_New()
{
GF_TrackSelectionBox *tmp;
tmp = (GF_TrackSelectionBox *) gf_malloc(sizeof(GF_TrackSelectionBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_TrackSelectionBox));
ISOM_DECL_BOX_ALLOC(GF_TrackSelectionBox, GF_ISOM_BOX_TYPE_TSEL);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_TSEL;
return (GF_Box *)tmp;
}
@@ -1081,26 +1087,26 @@ GF_Err tsel_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs,ptr->switchGroup);
gf_bs_write_u32(bs, ptr->switchGroup);
for (i = 0; i < ptr->attributeListCount; i++ ) {
for (i = 0; i < ptr->attributeListCount; i++) {
gf_bs_write_u32(bs, ptr->attributeList[i]);
}
return GF_OK;
}
GF_Err tsel_Size(GF_Box *s)
{
GF_Err e;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *) s;
GF_TrackSelectionBox *ptr = (GF_TrackSelectionBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 4 + (4*ptr->attributeListCount);
ptr->size += 4 + (4 * ptr->attributeListCount);
return GF_OK;
}
@@ -1109,12 +1115,8 @@ GF_Err tsel_Size(GF_Box *s)
GF_Box *dimC_New()
{
GF_DIMSSceneConfigBox *tmp;
GF_SAFEALLOC(tmp, GF_DIMSSceneConfigBox);
if (tmp == NULL) return NULL;
ISOM_DECL_BOX_ALLOC(GF_DIMSSceneConfigBox, GF_ISOM_BOX_TYPE_DIMC);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_DIMC;
return (GF_Box *)tmp;
}
void dimC_del(GF_Box *s)
@@ -1140,9 +1142,9 @@ GF_Err dimC_Read(GF_Box *s, GF_BitStream *bs)
p->streamType = gf_bs_read_int(bs, 1);
p->containsRedundant = gf_bs_read_int(bs, 2);
s->size -= 3;
i=0;
str[0]=0;
i = 0;
str[0] = 0;
while (1) {
str[i] = gf_bs_read_u8(bs);
if (!str[i]) break;
@@ -1152,8 +1154,8 @@ GF_Err dimC_Read(GF_Box *s, GF_BitStream *bs)
s->size -= i;
p->textEncoding = gf_strdup(str);
i=0;
str[0]=0;
i = 0;
str[0] = 0;
while (1) {
str[i] = gf_bs_read_u8(bs);
if (!str[i]) break;
@@ -1177,8 +1179,8 @@ GF_Err dimC_Write(GF_Box *s, GF_BitStream *bs)
gf_bs_write_int(bs, p->fullRequestHost, 1);
gf_bs_write_int(bs, p->streamType, 1);
gf_bs_write_int(bs, p->containsRedundant, 2);
gf_bs_write_data(bs, p->textEncoding, strlen(p->textEncoding)+1);
gf_bs_write_data(bs, p->contentEncoding, strlen(p->contentEncoding)+1);
gf_bs_write_data(bs, p->textEncoding, (u32)strlen(p->textEncoding) + 1);
gf_bs_write_data(bs, p->contentEncoding, (u32)strlen(p->contentEncoding) + 1);
return GF_OK;
}
GF_Err dimC_Size(GF_Box *s)
@@ -1195,11 +1197,7 @@ GF_Err dimC_Size(GF_Box *s)
GF_Box *diST_New()
{
GF_DIMSScriptTypesBox *tmp;
GF_SAFEALLOC(tmp, GF_DIMSScriptTypesBox);
if (tmp == NULL) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_DIST;
ISOM_DECL_BOX_ALLOC(GF_DIMSScriptTypesBox, GF_ISOM_BOX_TYPE_DIST);
return (GF_Box *)tmp;
}
void diST_del(GF_Box *s)
@@ -1215,8 +1213,8 @@ GF_Err diST_Read(GF_Box *s, GF_BitStream *bs)
char str[1024];
GF_DIMSScriptTypesBox *p = (GF_DIMSScriptTypesBox *)s;
i=0;
str[0]=0;
i = 0;
str[0] = 0;
while (1) {
str[i] = gf_bs_read_u8(bs);
if (!str[i]) break;
@@ -1235,7 +1233,7 @@ GF_Err diST_Write(GF_Box *s, GF_BitStream *bs)
GF_Err e = gf_isom_box_write_header(s, bs);
if (e) return e;
if (p->content_script_types)
gf_bs_write_data(bs, p->content_script_types, strlen(p->content_script_types)+1);
gf_bs_write_data(bs, p->content_script_types, (u32)strlen(p->content_script_types) + 1);
else
gf_bs_write_u8(bs, 0);
return GF_OK;
@@ -1245,7 +1243,7 @@ GF_Err diST_Size(GF_Box *s)
GF_Err e = gf_isom_box_get_size(s);
GF_DIMSScriptTypesBox *p = (GF_DIMSScriptTypesBox *)s;
if (e) return e;
s->size += p->content_script_types ? (strlen(p->content_script_types)+1) : 1;
s->size += p->content_script_types ? (strlen(p->content_script_types) + 1) : 1;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
@@ -1253,44 +1251,36 @@ GF_Err diST_Size(GF_Box *s)
GF_Box *dims_New()
{
GF_DIMSSampleEntryBox *tmp;
GF_SAFEALLOC(tmp, GF_DIMSSampleEntryBox);
tmp->type = GF_ISOM_BOX_TYPE_DIMS;
ISOM_DECL_BOX_ALLOC(GF_DIMSSampleEntryBox, GF_ISOM_BOX_TYPE_DIMS);
return (GF_Box*)tmp;
}
void dims_del(GF_Box *s)
{
GF_DIMSSampleEntryBox *p = (GF_DIMSSampleEntryBox *)s;
gf_isom_sample_entry_predestroy((GF_SampleEntryBox *)s);
if (p->config) gf_isom_box_del((GF_Box *)p->config);
if (p->bitrate ) gf_isom_box_del((GF_Box *)p->bitrate);
if (p->protection_info) gf_isom_box_del((GF_Box *)p->protection_info);
if (p->scripts) gf_isom_box_del((GF_Box *)p->scripts);
gf_free(p);
}
static GF_Err dims_AddBox(GF_Box *s, GF_Box *a)
{
{
GF_DIMSSampleEntryBox *ptr = (GF_DIMSSampleEntryBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_DIMC:
if (ptr->config) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->config = (GF_DIMSSceneConfigBox*)a;
ptr->config = (GF_DIMSSceneConfigBox*)a;
break;
case GF_ISOM_BOX_TYPE_DIST:
if (ptr->scripts) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->scripts = (GF_DIMSScriptTypesBox*)a;
break;
case GF_ISOM_BOX_TYPE_BTRT:
if (ptr->bitrate) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->bitrate = (GF_MPEG4BitRateBox*)a;
ptr->scripts = (GF_DIMSScriptTypesBox*)a;
break;
case GF_ISOM_BOX_TYPE_SINF:
if (ptr->protection_info) ERROR_ON_DUPLICATED_BOX(a, ptr)
ptr->protection_info = (GF_ProtectionInfoBox*)a;
gf_list_add(ptr->protections, a);
break;
default:
gf_isom_box_del(a);
break;
return gf_isom_box_add_default(s, a);
}
return GF_OK;
}
@@ -1319,15 +1309,7 @@ GF_Err dims_Write(GF_Box *s, GF_BitStream *bs)
e = gf_isom_box_write((GF_Box *)p->scripts, bs);
if (e) return e;
}
if (p->bitrate) {
e = gf_isom_box_write((GF_Box *)p->bitrate, bs);
if (e) return e;
}
if (p->protection_info) {
e = gf_isom_box_write((GF_Box *)p->protection_info, bs);
if (e) return e;
}
return GF_OK;
return gf_isom_box_array_write(s, p->protections, bs);
}
GF_Err dims_Size(GF_Box *s)
@@ -1336,28 +1318,18 @@ GF_Err dims_Size(GF_Box *s)
GF_DIMSSampleEntryBox *p = (GF_DIMSSampleEntryBox *)s;
if (e) return e;
s->size += 8;
if (p->config) {
e = gf_isom_box_size((GF_Box *) p->config);
e = gf_isom_box_size((GF_Box *)p->config);
if (e) return e;
p->size += p->config->size;
}
if (p->protection_info) {
e = gf_isom_box_size((GF_Box *) p->protection_info);
if (e) return e;
p->size += p->protection_info->size;
}
if (p->bitrate) {
e = gf_isom_box_size((GF_Box *) p->bitrate);
if (e) return e;
p->size += p->bitrate->size;
}
if (p->scripts) {
e = gf_isom_box_size((GF_Box *) p->scripts);
e = gf_isom_box_size((GF_Box *)p->scripts);
if (e) return e;
p->size += p->scripts->size;
}
return GF_OK;
return gf_isom_box_array_size(s, p->protections);
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/

View File

@@ -0,0 +1,700 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Author: Romain Bouqueau
* Copyright (c) Romain Bouqueau 2012-
* All rights reserved
*
* Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
#ifndef GPAC_DISABLE_ISOM_ADOBE
#ifndef GPAC_DISABLE_ISOM
#ifndef GPAC_DISABLE_ISOM_FRAGMENTS
void abst_del(GF_Box *s)
{
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
if (ptr == NULL) return;
if (ptr->movie_identifier)
gf_free(ptr->movie_identifier);
if (ptr->drm_data)
gf_free(ptr->drm_data);
if (ptr->meta_data)
gf_free(ptr->meta_data);
while (gf_list_count(ptr->server_entry_table)) {
gf_free(gf_list_get(ptr->server_entry_table, 0));
gf_list_rem(ptr->server_entry_table, 0);
}
gf_list_del(ptr->server_entry_table);
while (gf_list_count(ptr->quality_entry_table)) {
gf_free(gf_list_get(ptr->quality_entry_table, 0));
gf_list_rem(ptr->quality_entry_table, 0);
}
gf_list_del(ptr->quality_entry_table);
while (gf_list_count(ptr->segment_run_table_entries)) {
gf_isom_box_del((GF_Box *)gf_list_get(ptr->segment_run_table_entries, 0));
gf_list_rem(ptr->segment_run_table_entries, 0);
}
gf_list_del(ptr->segment_run_table_entries);
while (gf_list_count(ptr->fragment_run_table_entries)) {
gf_isom_box_del((GF_Box *)gf_list_get(ptr->fragment_run_table_entries, 0));
gf_list_rem(ptr->fragment_run_table_entries, 0);
}
gf_list_del(ptr->fragment_run_table_entries);
gf_free(ptr);
}
GF_Err abst_Read(GF_Box *s, GF_BitStream *bs)
{
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
int i;
u32 tmp_strsize = (u32)ptr->size - 8;
char *tmp_str = gf_malloc(sizeof(char)*tmp_strsize);
GF_Err e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->bootstrapinfo_version = gf_bs_read_u32(bs);
ptr->profile = gf_bs_read_int(bs, 2);
ptr->live = gf_bs_read_int(bs, 1);
ptr->update = gf_bs_read_int(bs, 1);
ptr->reserved = gf_bs_read_int(bs, 4);
ptr->time_scale = gf_bs_read_u32(bs);
ptr->current_media_time = gf_bs_read_u64(bs);
ptr->smpte_time_code_offset = gf_bs_read_u64(bs);
i = 0;
tmp_strsize = (u32)ptr->size - 8;
while (tmp_strsize) {
tmp_str[i] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[i])
break;
i++;
}
if (i)
ptr->movie_identifier = gf_strdup(tmp_str);
ptr->server_entry_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->server_entry_count; i++) {
int j = 0;
tmp_strsize = (u32)ptr->size - 8;
while (tmp_strsize) {
tmp_str[j] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[j])
break;
j++;
}
gf_list_insert(ptr->server_entry_table, gf_strdup(tmp_str), i);
}
ptr->quality_entry_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->quality_entry_count; i++) {
int j = 0;
tmp_strsize = (u32)ptr->size - 8;
while (tmp_strsize) {
tmp_str[j] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[j])
break;
j++;
}
gf_list_insert(ptr->quality_entry_table, gf_strdup(tmp_str), i);
}
i = 0;
tmp_strsize = (u32)ptr->size - 8;
while (tmp_strsize) {
tmp_str[i] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[i])
break;
i++;
}
if (i)
ptr->drm_data = gf_strdup(tmp_str);
i = 0;
tmp_strsize = (u32)ptr->size - 8;
while (tmp_strsize) {
tmp_str[i] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[i])
break;
i++;
}
if (i)
ptr->meta_data = gf_strdup(tmp_str);
ptr->segment_run_table_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->segment_run_table_count; i++) {
GF_AdobeSegmentRunTableBox *asrt;
e = gf_isom_parse_box((GF_Box **)&asrt, bs);
if (e) return e;
gf_list_insert(ptr->segment_run_table_entries, asrt, i);
}
ptr->fragment_run_table_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->fragment_run_table_count; i++) {
GF_AdobeFragmentRunTableBox *afrt;
e = gf_isom_parse_box((GF_Box **)&afrt, bs);
if (e) return e;
gf_list_insert(ptr->fragment_run_table_entries, afrt, i);
}
gf_free(tmp_str);
return GF_OK;
}
GF_EXPORT
GF_Box *abst_New()
{
ISOM_DECL_BOX_ALLOC(GF_AdobeBootstrapInfoBox, GF_ISOM_BOX_TYPE_ABST);
tmp->server_entry_table = gf_list_new();
tmp->quality_entry_table = gf_list_new();
tmp->segment_run_table_entries = gf_list_new();
tmp->fragment_run_table_entries = gf_list_new();
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_EXPORT
GF_Err abst_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
unsigned int i;
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->bootstrapinfo_version);
gf_bs_write_int(bs, ptr->profile, 2);
gf_bs_write_int(bs, ptr->live, 1);
gf_bs_write_int(bs, ptr->update, 1);
gf_bs_write_int(bs, ptr->reserved, 4);
gf_bs_write_u32(bs, ptr->time_scale);
gf_bs_write_u64(bs, ptr->current_media_time);
gf_bs_write_u64(bs, ptr->smpte_time_code_offset);
if (ptr->movie_identifier)
gf_bs_write_data(bs, ptr->movie_identifier, (u32)strlen(ptr->movie_identifier) + 1);
else
gf_bs_write_u8(bs, 0);
gf_bs_write_u8(bs, ptr->server_entry_count);
for (i = 0; i<ptr->server_entry_count; i++) {
char *str = (char*)gf_list_get(ptr->server_entry_table, i);
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
}
gf_bs_write_u8(bs, ptr->quality_entry_count);
for (i = 0; i<ptr->quality_entry_count; i++) {
char *str = (char*)gf_list_get(ptr->quality_entry_table, i);
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
}
if (ptr->drm_data)
gf_bs_write_data(bs, ptr->drm_data, (u32)strlen(ptr->drm_data) + 1);
else
gf_bs_write_u8(bs, 0);
if (ptr->meta_data)
gf_bs_write_data(bs, ptr->meta_data, (u32)strlen(ptr->meta_data) + 1);
else
gf_bs_write_u8(bs, 0);
gf_bs_write_u8(bs, ptr->segment_run_table_count);
for (i = 0; i<ptr->segment_run_table_count; i++) {
e = gf_isom_box_write((GF_Box *)gf_list_get(ptr->segment_run_table_entries, i), bs);
if (e) return e;
}
gf_bs_write_u8(bs, ptr->fragment_run_table_count);
for (i = 0; i<ptr->fragment_run_table_count; i++) {
e = gf_isom_box_write((GF_Box *)gf_list_get(ptr->fragment_run_table_entries, i), bs);
if (e) return e;
}
return GF_OK;
}
GF_EXPORT
GF_Err abst_Size(GF_Box *s)
{
GF_Err e;
int i;
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += 25
+ (ptr->movie_identifier ? (strlen(ptr->movie_identifier) + 1) : 1)
+ 1;
for (i = 0; i<ptr->server_entry_count; i++)
s->size += strlen(gf_list_get(ptr->server_entry_table, i)) + 1;
s->size += 1;
for (i = 0; i<ptr->quality_entry_count; i++)
s->size += strlen(gf_list_get(ptr->quality_entry_table, i)) + 1;
s->size += (ptr->drm_data ? (strlen(ptr->drm_data) + 1) : 1)
+ (ptr->meta_data ? (strlen(ptr->meta_data) + 1) : 1)
+ 1;
for (i = 0; i<ptr->segment_run_table_count; i++) {
GF_Box *box = (GF_Box *)gf_list_get(ptr->segment_run_table_entries, i);
e = gf_isom_box_size(box);
if (e) return e;
s->size += box->size;
}
s->size += 1;
for (i = 0; i<ptr->fragment_run_table_count; i++) {
GF_Box *box = (GF_Box *)gf_list_get(ptr->fragment_run_table_entries, i);
e = gf_isom_box_size(box);
if (e) return e;
s->size += box->size;
}
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
void afra_del(GF_Box *s)
{
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
if (ptr == NULL) return;
while (gf_list_count(ptr->local_access_entries)) {
gf_free(gf_list_get(ptr->local_access_entries, 0));
gf_list_rem(ptr->local_access_entries, 0);
}
gf_list_del(ptr->local_access_entries);
while (gf_list_count(ptr->global_access_entries)) {
gf_free(gf_list_get(ptr->global_access_entries, 0));
gf_list_rem(ptr->global_access_entries, 0);
}
gf_list_del(ptr->global_access_entries);
gf_free(ptr);
}
GF_Err afra_Read(GF_Box *s, GF_BitStream *bs)
{
unsigned int i;
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
GF_Err e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->long_ids = gf_bs_read_int(bs, 1);
ptr->long_offsets = gf_bs_read_int(bs, 1);
ptr->global_entries = gf_bs_read_int(bs, 1);
ptr->reserved = gf_bs_read_int(bs, 5);
ptr->time_scale = gf_bs_read_u32(bs);
ptr->entry_count = gf_bs_read_u32(bs);
for (i = 0; i<ptr->entry_count; i++) {
GF_AfraEntry *ae = gf_malloc(sizeof(GF_AfraEntry));
ae->time = gf_bs_read_u64(bs);
if (ptr->long_offsets)
ae->offset = gf_bs_read_u64(bs);
else
ae->offset = gf_bs_read_u32(bs);
gf_list_insert(ptr->local_access_entries, ae, i);
}
if (ptr->global_entries) {
ptr->global_entry_count = gf_bs_read_u32(bs);
for (i = 0; i<ptr->global_entry_count; i++) {
GF_GlobalAfraEntry *ae = gf_malloc(sizeof(GF_GlobalAfraEntry));
ae->time = gf_bs_read_u64(bs);
if (ptr->long_ids) {
ae->segment = gf_bs_read_u32(bs);
ae->fragment = gf_bs_read_u32(bs);
}
else {
ae->segment = gf_bs_read_u16(bs);
ae->fragment = gf_bs_read_u16(bs);
}
if (ptr->long_offsets) {
ae->afra_offset = gf_bs_read_u64(bs);
ae->offset_from_afra = gf_bs_read_u64(bs);
}
else {
ae->afra_offset = gf_bs_read_u32(bs);
ae->offset_from_afra = gf_bs_read_u32(bs);
}
gf_list_insert(ptr->global_access_entries, ae, i);
}
}
return GF_OK;
}
GF_EXPORT
GF_Box *afra_New()
{
ISOM_DECL_BOX_ALLOC(GF_AdobeFragRandomAccessBox, GF_ISOM_BOX_TYPE_AFRA);
tmp->local_access_entries = gf_list_new();
tmp->global_access_entries = gf_list_new();
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err afra_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
unsigned int i;
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_int(bs, ptr->long_ids, 1);
gf_bs_write_int(bs, ptr->long_offsets, 1);
gf_bs_write_int(bs, ptr->global_entries, 1);
gf_bs_write_int(bs, 0, 5);
gf_bs_write_u32(bs, ptr->time_scale);
gf_bs_write_u32(bs, ptr->entry_count);
for (i = 0; i<ptr->entry_count; i++) {
GF_AfraEntry *ae = (GF_AfraEntry *)gf_list_get(ptr->local_access_entries, i);
gf_bs_write_u64(bs, ae->time);
if (ptr->long_offsets)
gf_bs_write_u64(bs, ae->offset);
else
gf_bs_write_u32(bs, (u32)ae->offset);
}
if (ptr->global_entries) {
gf_bs_write_u32(bs, ptr->global_entry_count);
for (i = 0; i<ptr->global_entry_count; i++) {
GF_GlobalAfraEntry *gae = (GF_GlobalAfraEntry *)gf_list_get(ptr->global_access_entries, i);
gf_bs_write_u64(bs, gae->time);
if (ptr->long_ids) {
gf_bs_write_u32(bs, gae->segment);
gf_bs_write_u32(bs, gae->fragment);
}
else {
gf_bs_write_u16(bs, (u16)gae->segment);
gf_bs_write_u16(bs, (u16)gae->fragment);
}
if (ptr->long_offsets) {
gf_bs_write_u64(bs, gae->afra_offset);
gf_bs_write_u64(bs, gae->offset_from_afra);
}
else {
gf_bs_write_u32(bs, (u32)gae->afra_offset);
gf_bs_write_u32(bs, (u32)gae->offset_from_afra);
}
}
}
return GF_OK;
}
GF_Err afra_Size(GF_Box *s)
{
GF_Err e;
GF_AdobeFragRandomAccessBox *ptr = (GF_AdobeFragRandomAccessBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += 9
+ ptr->entry_count * (ptr->long_offsets ? 16 : 12)
+ (ptr->global_entries ? 4 + ptr->global_entry_count * (4 + (ptr->long_offsets ? 16 : 8) + (ptr->long_ids ? 8 : 4)) : 0);
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
void asrt_del(GF_Box *s)
{
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
if (ptr == NULL) return;
while (gf_list_count(ptr->quality_segment_url_modifiers)) {
gf_free(gf_list_get(ptr->quality_segment_url_modifiers, 0));
gf_list_rem(ptr->quality_segment_url_modifiers, 0);
}
gf_list_del(ptr->quality_segment_url_modifiers);
while (gf_list_count(ptr->segment_run_entry_table)) {
gf_free(gf_list_get(ptr->segment_run_entry_table, 0));
gf_list_rem(ptr->segment_run_entry_table, 0);
}
gf_list_del(ptr->segment_run_entry_table);
gf_free(ptr);
}
GF_Err asrt_Read(GF_Box *s, GF_BitStream *bs)
{
unsigned int i;
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
GF_Err e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->quality_entry_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->quality_entry_count; i++) {
int j = 0;
u32 tmp_strsize = (u32)ptr->size - 8;
char *tmp_str = (char*)gf_malloc(tmp_strsize);
while (tmp_strsize) {
tmp_str[j] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[j])
break;
j++;
}
gf_list_insert(ptr->quality_segment_url_modifiers, tmp_str, i);
}
ptr->segment_run_entry_count = gf_bs_read_u32(bs);
for (i = 0; i<ptr->segment_run_entry_count; i++) {
GF_AdobeSegmentRunEntry *sre = gf_malloc(sizeof(GF_AdobeSegmentRunEntry));
sre->first_segment = gf_bs_read_u32(bs);
sre->fragment_per_segment = gf_bs_read_u32(bs);
gf_list_insert(ptr->segment_run_entry_table, sre, i);
}
return GF_OK;
}
GF_EXPORT
GF_Box *asrt_New()
{
ISOM_DECL_BOX_ALLOC(GF_AdobeSegmentRunTableBox, GF_ISOM_BOX_TYPE_ASRT);
tmp->quality_segment_url_modifiers = gf_list_new();
tmp->segment_run_entry_table = gf_list_new();
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err asrt_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
unsigned int i;
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u8(bs, ptr->quality_entry_count);
for (i = 0; i<ptr->quality_entry_count; i++) {
char *str = (char*)gf_list_get(ptr->quality_segment_url_modifiers, i);
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
}
gf_bs_write_u32(bs, ptr->segment_run_entry_count);
for (i = 0; i<ptr->segment_run_entry_count; i++) {
GF_AdobeSegmentRunEntry *sre = (GF_AdobeSegmentRunEntry *)gf_list_get(ptr->segment_run_entry_table, i);
gf_bs_write_u32(bs, sre->first_segment);
gf_bs_write_u32(bs, sre->fragment_per_segment);
}
return GF_OK;
}
GF_Err asrt_Size(GF_Box *s)
{
int i;
GF_Err e;
GF_AdobeSegmentRunTableBox *ptr = (GF_AdobeSegmentRunTableBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += 5;
for (i = 0; i<ptr->quality_entry_count; i++)
s->size += strlen(gf_list_get(ptr->quality_segment_url_modifiers, i)) + 1;
s->size += ptr->segment_run_entry_count * sizeof(GF_AdobeSegmentRunEntry);
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
void afrt_del(GF_Box *s)
{
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
if (ptr == NULL) return;
while (gf_list_count(ptr->quality_segment_url_modifiers)) {
gf_free(gf_list_get(ptr->quality_segment_url_modifiers, 0));
gf_list_rem(ptr->quality_segment_url_modifiers, 0);
}
gf_list_del(ptr->quality_segment_url_modifiers);
while (gf_list_count(ptr->fragment_run_entry_table)) {
gf_free(gf_list_get(ptr->fragment_run_entry_table, 0));
gf_list_rem(ptr->fragment_run_entry_table, 0);
}
gf_list_del(ptr->fragment_run_entry_table);
gf_free(ptr);
}
GF_Err afrt_Read(GF_Box *s, GF_BitStream *bs)
{
unsigned int i;
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
GF_Err e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->timescale = gf_bs_read_u32(bs);
ptr->quality_entry_count = gf_bs_read_u8(bs);
for (i = 0; i<ptr->quality_entry_count; i++) {
int j = 0;
u32 tmp_strsize = (u32)ptr->size - 8;
char *tmp_str = (char*)gf_malloc(tmp_strsize);
while (tmp_strsize) {
tmp_str[j] = gf_bs_read_u8(bs);
tmp_strsize--;
if (!tmp_str[j])
break;
j++;
}
gf_list_insert(ptr->quality_segment_url_modifiers, tmp_str, i);
}
ptr->fragment_run_entry_count = gf_bs_read_u32(bs);
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
GF_AdobeFragmentRunEntry *fre = gf_malloc(sizeof(GF_AdobeFragmentRunEntry));
fre->first_fragment = gf_bs_read_u32(bs);
fre->first_fragment_timestamp = gf_bs_read_u64(bs);
fre->fragment_duration = gf_bs_read_u32(bs);
if (!fre->fragment_duration)
fre->discontinuity_indicator = gf_bs_read_u8(bs);
gf_list_insert(ptr->fragment_run_entry_table, fre, i);
}
return GF_OK;
}
GF_EXPORT
GF_Box *afrt_New()
{
ISOM_DECL_BOX_ALLOC(GF_AdobeFragmentRunTableBox, GF_ISOM_BOX_TYPE_AFRT);
tmp->quality_segment_url_modifiers = gf_list_new();
tmp->fragment_run_entry_table = gf_list_new();
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err afrt_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
unsigned int i;
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->timescale);
gf_bs_write_u8(bs, ptr->quality_entry_count);
for (i = 0; i<ptr->quality_entry_count; i++) {
char *str = (char*)gf_list_get(ptr->quality_segment_url_modifiers, i);
gf_bs_write_data(bs, str, (u32)strlen(str) + 1);
}
gf_bs_write_u32(bs, ptr->fragment_run_entry_count);
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
GF_AdobeFragmentRunEntry *fre = (GF_AdobeFragmentRunEntry *)gf_list_get(ptr->fragment_run_entry_table, i);
gf_bs_write_u32(bs, fre->first_fragment);
gf_bs_write_u64(bs, fre->first_fragment_timestamp);
gf_bs_write_u32(bs, fre->fragment_duration);
if (!fre->fragment_duration)
gf_bs_write_u8(bs, fre->discontinuity_indicator);
}
return GF_OK;
}
GF_Err afrt_Size(GF_Box *s)
{
u32 i;
GF_Err e;
GF_AdobeFragmentRunTableBox *ptr = (GF_AdobeFragmentRunTableBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += 5;
for (i = 0; i<ptr->quality_entry_count; i++)
s->size += strlen(gf_list_get(ptr->quality_segment_url_modifiers, i)) + 1;
s->size += 4;
for (i = 0; i<ptr->fragment_run_entry_count; i++) {
GF_AdobeFragmentRunEntry *fre = (GF_AdobeFragmentRunEntry *)gf_list_get(ptr->fragment_run_entry_table, i);
if (fre->fragment_duration)
s->size += 16;
else
s->size += 17;
}
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
#endif /*GPAC_DISABLE_ISOM_FRAGMENTS*/
#endif /*GPAC_DISABLE_ISOM*/
#endif /*GPAC_DISABLE_ISOM_ADOBE*/

View File

@@ -1,11 +1,26 @@
/*
Author: Andrew Voznytsa <av@polynet.lviv.ua>
Project: GPAC - Multimedia Framework C SDK
Module: ISO Media File Format sub-project
Copyright: (c) 2006, Andrew Voznytsa
License: see License.txt in the top level directory.
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2006-2012
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
@@ -16,7 +31,6 @@ void ilst_del(GF_Box *s)
{
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
if (ptr == NULL) return;
gf_isom_box_array_del(ptr->tags);
gf_free(ptr);
}
@@ -34,8 +48,9 @@ GF_Err ilst_Read(GF_Box *s, GF_BitStream *bs)
if (e) return e;
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
ptr->size -= a->size;
gf_list_add(ptr->tags, a);
} else {
gf_list_add(ptr->other_boxes, a);
}
else {
gf_bs_read_u32(bs);
ptr->size -= 4;
}
@@ -45,11 +60,8 @@ GF_Err ilst_Read(GF_Box *s, GF_BitStream *bs)
GF_Box *ilst_New()
{
GF_ItemListBox *tmp = (GF_ItemListBox *) gf_malloc(sizeof(GF_ItemListBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ItemListBox));
tmp->type = GF_ISOM_BOX_TYPE_ILST;
tmp->tags = gf_list_new();
ISOM_DECL_BOX_ALLOC(GF_ItemListBox, GF_ISOM_BOX_TYPE_ILST);
tmp->other_boxes = gf_list_new();
return (GF_Box *)tmp;
}
@@ -58,31 +70,31 @@ GF_Box *ilst_New()
GF_Err ilst_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
// GF_ItemListBox *ptr = (GF_ItemListBox *)s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
return gf_isom_box_array_write(s, ptr->tags, bs);
return GF_OK;
}
GF_Err ilst_Size(GF_Box *s)
{
GF_Err e;
GF_ItemListBox *ptr = (GF_ItemListBox *)s;
// GF_ItemListBox *ptr = (GF_ItemListBox *)s;
e = gf_isom_box_get_size(s);
if (e) return e;
return gf_isom_box_array_size(s, ptr->tags);
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
void ListItem_del(GF_Box *s)
{
GF_ListItemBox *ptr = (GF_ListItemBox *) s;
GF_ListItemBox *ptr = (GF_ListItemBox *)s;
if (ptr == NULL) return;
if (ptr->data != NULL) {
if (ptr->data->data) gf_free(ptr->data->data);
@@ -91,7 +103,7 @@ void ListItem_del(GF_Box *s)
gf_free(ptr);
}
GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
GF_Err ListItem_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 sub_type;
@@ -100,13 +112,13 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
/*iTunes way: there's a data atom containing the data*/
sub_type = gf_bs_peek_bits(bs, 32, 4);
if (sub_type == GF_ISOM_BOX_TYPE_DATA ) {
if (sub_type == GF_ISOM_BOX_TYPE_DATA) {
e = gf_isom_parse_box(&a, bs);
if (e) return e;
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
ptr->size -= a->size;
if (a && ptr->data) gf_isom_box_del((GF_Box *) ptr->data);
if (a && ptr->data) gf_isom_box_del((GF_Box *)ptr->data);
ptr->data = (GF_DataBox *)a;
}
/*QT way*/
@@ -114,7 +126,7 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
ptr->data->type = 0;
ptr->data->dataSize = gf_bs_read_u16(bs);
gf_bs_read_u16(bs);
ptr->data->data = (char *) gf_malloc(sizeof(char)*(ptr->data->dataSize + 1));
ptr->data->data = (char *)gf_malloc(sizeof(char)*(ptr->data->dataSize + 1));
gf_bs_read_data(bs, ptr->data->data, ptr->data->dataSize);
ptr->data->data[ptr->data->dataSize] = 0;
ptr->size -= ptr->data->dataSize;
@@ -124,17 +136,11 @@ GF_Err ListItem_Read(GF_Box *s,GF_BitStream *bs)
GF_Box *ListItem_New(u32 type)
{
GF_ListItemBox *tmp;
tmp = (GF_ListItemBox *) gf_malloc(sizeof(GF_ListItemBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ListItemBox));
tmp->type = type;
ISOM_DECL_BOX_ALLOC(GF_ListItemBox, type);
tmp->data = (GF_DataBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_DATA);
if (tmp->data == NULL){
if (tmp->data == NULL) {
gf_free(tmp);
return NULL;
}
@@ -147,13 +153,13 @@ GF_Box *ListItem_New(u32 type)
GF_Err ListItem_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ListItemBox *ptr = (GF_ListItemBox *) s;
GF_ListItemBox *ptr = (GF_ListItemBox *)s;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
/*iTune way*/
if (ptr->data->type) return gf_isom_box_write((GF_Box* )ptr->data, bs);
if (ptr->data->type) return gf_isom_box_write((GF_Box*)ptr->data, bs);
/*QT way*/
gf_bs_write_u16(bs, ptr->data->dataSize);
gf_bs_write_u16(bs, 0);
@@ -176,7 +182,7 @@ GF_Err ListItem_Size(GF_Box *s)
ptr->size += ptr->data->size;
}
/*QT way*/
else {
else if (ptr->data) {
ptr->size += ptr->data->dataSize + 4;
}
return GF_OK;
@@ -186,7 +192,7 @@ GF_Err ListItem_Size(GF_Box *s)
void data_del(GF_Box *s)
{
GF_DataBox *ptr = (GF_DataBox *) s;
GF_DataBox *ptr = (GF_DataBox *)s;
if (ptr == NULL) return;
if (ptr->data)
gf_free(ptr->data);
@@ -194,7 +200,7 @@ void data_del(GF_Box *s)
}
GF_Err data_Read(GF_Box *s,GF_BitStream *bs)
GF_Err data_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_DataBox *ptr = (GF_DataBox *)s;
@@ -204,26 +210,21 @@ GF_Err data_Read(GF_Box *s,GF_BitStream *bs)
ptr->reserved = gf_bs_read_int(bs, 32);
ptr->size -= 4;
if (ptr->size) {
ptr->dataSize = (u32) ptr->size;
ptr->dataSize = (u32)ptr->size;
ptr->data = (char*)gf_malloc(ptr->dataSize * sizeof(ptr->data[0]) + 1);
if (ptr->data == NULL) return GF_OUT_OF_MEM;
ptr->data[ptr->dataSize] = 0;
gf_bs_read_data(bs, ptr->data, ptr->dataSize);
}
return GF_OK;
}
GF_Box *data_New()
{
GF_DataBox *tmp;
tmp = (GF_DataBox *) gf_malloc(sizeof(GF_DataBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_DataBox));
ISOM_DECL_BOX_ALLOC(GF_DataBox, GF_ISOM_BOX_TYPE_DATA);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_DATA;
return (GF_Box *)tmp;
}
@@ -233,12 +234,12 @@ GF_Box *data_New()
GF_Err data_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_DataBox *ptr = (GF_DataBox *) s;
GF_DataBox *ptr = (GF_DataBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_int(bs, ptr->reserved, 32);
if(ptr->data != NULL && ptr->dataSize > 0){
if (ptr->data != NULL && ptr->dataSize > 0) {
gf_bs_write_data(bs, ptr->data, ptr->dataSize);
}
return GF_OK;
@@ -251,7 +252,7 @@ GF_Err data_Size(GF_Box *s)
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 4;
if(ptr->data != NULL && ptr->dataSize > 0){
if (ptr->data != NULL && ptr->dataSize > 0) {
ptr->size += ptr->dataSize;
}
return GF_OK;
@@ -271,10 +272,10 @@ GF_MetaBox *gf_isom_apple_get_meta_extensions(GF_ISOFile *mov)
map = udta_getEntry(mov->moov->udta, GF_ISOM_BOX_TYPE_META, NULL);
if (!map) return NULL;
for(i = 0; i < gf_list_count(map->boxList); i++){
meta = (GF_MetaBox*)gf_list_get(map->boxList, i);
for (i = 0; i < gf_list_count(map->other_boxes); i++) {
meta = (GF_MetaBox*)gf_list_get(map->other_boxes, i);
if(meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
if (meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
}
return NULL;
@@ -290,29 +291,30 @@ GF_MetaBox *gf_isom_apple_create_meta_extensions(GF_ISOFile *mov)
if (!mov || !mov->moov) return NULL;
if (!mov->moov->udta){
if (!mov->moov->udta) {
e = moov_AddBox((GF_Box*)mov->moov, gf_isom_box_new(GF_ISOM_BOX_TYPE_UDTA));
if (e) return NULL;
}
map = udta_getEntry(mov->moov->udta, GF_ISOM_BOX_TYPE_META, NULL);
if (map){
for(i = 0; i < gf_list_count(map->boxList); i++){
meta = (GF_MetaBox*)gf_list_get(map->boxList, i);
if (map) {
for (i = 0; i < gf_list_count(map->other_boxes); i++) {
meta = (GF_MetaBox*)gf_list_get(map->other_boxes, i);
if(meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
if (meta != NULL && meta->handler != NULL && meta->handler->handlerType == GF_ISOM_HANDLER_TYPE_MDIR) return meta;
}
}
meta = (GF_MetaBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_META);
if(meta != NULL){
if (meta != NULL) {
meta->handler = (GF_HandlerBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_HDLR);
if(meta->handler == NULL){
if (meta->handler == NULL) {
gf_isom_box_del((GF_Box *)meta);
return NULL;
}
meta->handler->handlerType = GF_ISOM_HANDLER_TYPE_MDIR;
if (!meta->other_boxes) meta->other_boxes = gf_list_new();
gf_list_add(meta->other_boxes, gf_isom_box_new(GF_ISOM_BOX_TYPE_ILST));
udta_AddBox(mov->moov->udta, (GF_Box *)meta);
}

File diff suppressed because it is too large Load Diff

1961
src/gpacmp4/box_code_drm.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,889 +0,0 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Cyril Concolato 2005
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
#ifndef GPAC_DISABLE_ISOM
/* ProtectionInfo Box */
GF_Box *sinf_New()
{
GF_ProtectionInfoBox *tmp = (GF_ProtectionInfoBox *) gf_malloc(sizeof(GF_ProtectionInfoBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ProtectionInfoBox));
tmp->type = GF_ISOM_BOX_TYPE_SINF;
return (GF_Box *)tmp;
}
void sinf_del(GF_Box *s)
{
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
if (ptr == NULL) return;
if (ptr->original_format) gf_isom_box_del((GF_Box *)ptr->original_format);
if (ptr->info) gf_isom_box_del((GF_Box *)ptr->info);
if (ptr->scheme_type) gf_isom_box_del((GF_Box *)ptr->scheme_type);
gf_free(ptr);
}
GF_Err sinf_AddBox(GF_Box *s, GF_Box *a)
{
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_FRMA:
if (ptr->original_format) return GF_ISOM_INVALID_FILE;
ptr->original_format = (GF_OriginalFormatBox*)a;
break;
case GF_ISOM_BOX_TYPE_SCHM:
if (ptr->scheme_type) return GF_ISOM_INVALID_FILE;
ptr->scheme_type = (GF_SchemeTypeBox*)a;
break;
case GF_ISOM_BOX_TYPE_SCHI:
if (ptr->info) return GF_ISOM_INVALID_FILE;
ptr->info = (GF_SchemeInformationBox*)a;
break;
default:
gf_isom_box_del(a);
break;
}
return GF_OK;
}
GF_Err sinf_Read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_read_box_list(s, bs, sinf_AddBox);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err sinf_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
//frma
e = gf_isom_box_write((GF_Box *) ptr->original_format, bs);
if (e) return e;
// schm
e = gf_isom_box_write((GF_Box *) ptr->scheme_type, bs);
if (e) return e;
// schi
e = gf_isom_box_write((GF_Box *) ptr->info, bs);
if (e) return e;
return GF_OK;
}
GF_Err sinf_Size(GF_Box *s)
{
GF_Err e;
GF_ProtectionInfoBox *ptr = (GF_ProtectionInfoBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_get_size(s);
if (e) return e;
e = gf_isom_box_size((GF_Box *) ptr->original_format);
if (e) return e;
ptr->size += ptr->original_format->size;
e = gf_isom_box_size((GF_Box *) ptr->scheme_type);
if (e) return e;
ptr->size += ptr->scheme_type->size;
e = gf_isom_box_size((GF_Box *) ptr->info);
if (e) return e;
ptr->size += ptr->info->size;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OriginalFormat Box */
GF_Box *frma_New()
{
GF_OriginalFormatBox *tmp = (GF_OriginalFormatBox *) gf_malloc(sizeof(GF_OriginalFormatBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_OriginalFormatBox));
tmp->type = GF_ISOM_BOX_TYPE_FRMA;
return (GF_Box *)tmp;
}
void frma_del(GF_Box *s)
{
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
if (ptr == NULL) return;
gf_free(ptr);
}
GF_Err frma_Read(GF_Box *s, GF_BitStream *bs)
{
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
ptr->data_format = gf_bs_read_u32(bs);
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err frma_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->data_format);
return GF_OK;
}
GF_Err frma_Size(GF_Box *s)
{
GF_Err e;
GF_OriginalFormatBox *ptr = (GF_OriginalFormatBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_get_size(s);
if (e) return e;
ptr->size += 4;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* SchemeType Box */
GF_Box *schm_New()
{
GF_SchemeTypeBox *tmp = (GF_SchemeTypeBox *) gf_malloc(sizeof(GF_SchemeTypeBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_SchemeTypeBox));
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_SCHM;
return (GF_Box *)tmp;
}
void schm_del(GF_Box *s)
{
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *)s;
if (ptr == NULL) return;
if (ptr->URI) gf_free(ptr->URI);
gf_free(ptr);
}
GF_Err schm_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *)s;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->scheme_type = gf_bs_read_u32(bs);
ptr->scheme_version = gf_bs_read_u32(bs);
ptr->size -= 8;
if (ptr->size && (ptr->flags & 0x000001)) {
u32 len = (u32) (ptr->size);
ptr->URI = (char*)gf_malloc(sizeof(char)*len);
if (!ptr->URI) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->URI, len);
}
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err schm_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
assert(e == GF_OK);
gf_bs_write_u32(bs, ptr->scheme_type);
gf_bs_write_u32(bs, ptr->scheme_version);
if (ptr->flags & 0x000001) gf_bs_write_data(bs, ptr->URI, strlen(ptr->URI)+1);
return GF_OK;
}
GF_Err schm_Size(GF_Box *s)
{
GF_Err e;
GF_SchemeTypeBox *ptr = (GF_SchemeTypeBox *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 8;
if (ptr->flags & 0x000001) ptr->size += strlen(ptr->URI)+1;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* SchemeInformation Box */
GF_Box *schi_New()
{
GF_SchemeInformationBox *tmp = (GF_SchemeInformationBox *) gf_malloc(sizeof(GF_SchemeInformationBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_SchemeInformationBox));
tmp->type = GF_ISOM_BOX_TYPE_SCHI;
return (GF_Box *)tmp;
}
void schi_del(GF_Box *s)
{
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
if (ptr == NULL) return;
if (ptr->ikms) gf_isom_box_del((GF_Box *)ptr->ikms);
if (ptr->isfm) gf_isom_box_del((GF_Box *)ptr->isfm);
gf_free(ptr);
}
GF_Err schi_AddBox(GF_Box *s, GF_Box *a)
{
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_IKMS:
if (ptr->ikms) return GF_ISOM_INVALID_FILE;
ptr->ikms = (GF_ISMAKMSBox*)a;
return GF_OK;
case GF_ISOM_BOX_TYPE_ISFM:
if (ptr->isfm) return GF_ISOM_INVALID_FILE;
ptr->isfm = (GF_ISMASampleFormatBox*)a;
return GF_OK;
case GF_ISOM_BOX_TYPE_ODKM:
if (ptr->okms) return GF_ISOM_INVALID_FILE;
ptr->okms = (GF_OMADRMKMSBox*)a;
return GF_OK;
default:
gf_isom_box_del(a);
return GF_OK;
}
}
GF_Err schi_Read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_read_box_list(s, bs, schi_AddBox);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err schi_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
if (ptr->ikms) {
e = gf_isom_box_write((GF_Box *) ptr->ikms, bs);
if (e) return e;
}
if (ptr->isfm) {
e = gf_isom_box_write((GF_Box *) ptr->isfm, bs);
if (e) return e;
}
if (ptr->okms) {
e = gf_isom_box_write((GF_Box *) ptr->okms, bs);
if (e) return e;
}
return GF_OK;
}
GF_Err schi_Size(GF_Box *s)
{
GF_Err e;
GF_SchemeInformationBox *ptr = (GF_SchemeInformationBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_get_size(s);
if (e) return e;
if (ptr->ikms) {
e = gf_isom_box_size((GF_Box *) ptr->ikms);
if (e) return e;
ptr->size += ptr->ikms->size;
}
if (ptr->isfm) {
e = gf_isom_box_size((GF_Box *) ptr->isfm);
if (e) return e;
ptr->size += ptr->isfm->size;
}
if (ptr->okms) {
e = gf_isom_box_size((GF_Box *) ptr->okms);
if (e) return e;
ptr->size += ptr->okms->size;
}
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* ISMAKMS Box */
GF_Box *iKMS_New()
{
GF_ISMAKMSBox *tmp = (GF_ISMAKMSBox *) gf_malloc(sizeof(GF_ISMAKMSBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ISMAKMSBox));
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_IKMS;
return (GF_Box *)tmp;
}
void iKMS_del(GF_Box *s)
{
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
if (ptr == NULL) return;
if (ptr->URI) gf_free(ptr->URI);
gf_free(ptr);
}
GF_Err iKMS_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 len;
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
len = (u32) (ptr->size);
ptr->URI = (char*) gf_malloc(sizeof(char)*len);
if (!ptr->URI) return GF_OUT_OF_MEM;
gf_bs_read_data(bs, ptr->URI, len);
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err iKMS_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_data(bs, ptr->URI, strlen(ptr->URI)+1);
return GF_OK;
}
GF_Err iKMS_Size(GF_Box *s)
{
GF_Err e;
GF_ISMAKMSBox *ptr = (GF_ISMAKMSBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += strlen(ptr->URI)+1;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* ISMASampleFormat Box */
GF_Box *iSFM_New()
{
GF_ISMASampleFormatBox *tmp = (GF_ISMASampleFormatBox *) gf_malloc(sizeof(GF_ISMASampleFormatBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ISMASampleFormatBox));
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_ISFM;
return (GF_Box *)tmp;
}
void iSFM_del(GF_Box *s)
{
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
if (ptr == NULL) return;
gf_free(ptr);
}
GF_Err iSFM_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->selective_encryption = gf_bs_read_int(bs, 1);
gf_bs_read_int(bs, 7);
ptr->key_indicator_length = gf_bs_read_u8(bs);
ptr->IV_length = gf_bs_read_u8(bs);
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err iSFM_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_int(bs, ptr->selective_encryption, 1);
gf_bs_write_int(bs, 0, 7);
gf_bs_write_u8(bs, ptr->key_indicator_length);
gf_bs_write_u8(bs, ptr->IV_length);
return GF_OK;
}
GF_Err iSFM_Size(GF_Box *s)
{
GF_Err e;
GF_ISMASampleFormatBox *ptr = (GF_ISMASampleFormatBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 3;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMCommonHeader Box */
GF_Box *ohdr_New()
{
GF_OMADRMCommonHeaderBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMCommonHeaderBox);
if (tmp == NULL) return NULL;
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_OHDR;
tmp->ExtendedHeaders = gf_list_new();
return (GF_Box *)tmp;
}
void ohdr_del(GF_Box *s)
{
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
if (ptr == NULL) return;
gf_isom_box_array_del(ptr->ExtendedHeaders);
if (ptr->ContentID) gf_free(ptr->ContentID);
if (ptr->RightsIssuerURL) gf_free(ptr->RightsIssuerURL);
if (ptr->TextualHeaders) gf_free(ptr->TextualHeaders);
gf_free(ptr);
}
GF_Err ohdr_AddBox(GF_Box *s, GF_Box *a)
{
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
return gf_list_add(ptr->ExtendedHeaders, a);
}
GF_Err ohdr_Read(GF_Box *s, GF_BitStream *bs)
{
u16 cid_len, ri_len;
GF_Err e;
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox*)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->EncryptionMethod = gf_bs_read_u8(bs);
ptr->PaddingScheme = gf_bs_read_u8(bs);
ptr->PlaintextLength = gf_bs_read_u64(bs);
cid_len = gf_bs_read_u16(bs);
ri_len = gf_bs_read_u16(bs);
ptr->TextualHeadersLen = gf_bs_read_u16(bs);
ptr->size -= 1+1+8+2+2+2;
if (ptr->size<cid_len+ri_len+ptr->TextualHeadersLen) return GF_ISOM_INVALID_FILE;
if (cid_len) {
ptr->ContentID = (char *)gf_malloc(sizeof(char)*(cid_len+1));
gf_bs_read_data(bs, ptr->ContentID, cid_len);
ptr->ContentID[cid_len]=0;
}
if (ri_len) {
ptr->RightsIssuerURL = (char *)gf_malloc(sizeof(char)*(ri_len+1));
gf_bs_read_data(bs, ptr->RightsIssuerURL, ri_len);
ptr->RightsIssuerURL[ri_len]=0;
}
if (ptr->TextualHeadersLen) {
ptr->TextualHeaders = (char *)gf_malloc(sizeof(char)*(ptr->TextualHeadersLen+1));
gf_bs_read_data(bs, ptr->TextualHeaders, ptr->TextualHeadersLen);
ptr->TextualHeaders[ptr->TextualHeadersLen] = 0;
}
ptr->size -= cid_len+ri_len+ptr->TextualHeadersLen;
return gf_isom_read_box_list(s, bs, ohdr_AddBox);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err ohdr_Write(GF_Box *s, GF_BitStream *bs)
{
u16 cid_len, ri_len;
GF_Err e;
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u8(bs, ptr->EncryptionMethod);
gf_bs_write_u8(bs, ptr->PaddingScheme);
gf_bs_write_u64(bs, ptr->PlaintextLength);
cid_len = ptr->ContentID ? strlen(ptr->ContentID) : 0;
gf_bs_write_u16(bs, cid_len);
ri_len = ptr->RightsIssuerURL ? strlen(ptr->RightsIssuerURL) : 0;
gf_bs_write_u16(bs, ri_len);
gf_bs_write_u16(bs, ptr->TextualHeadersLen);
if (cid_len) gf_bs_write_data(bs, ptr->ContentID, strlen(ptr->ContentID));
if (ri_len) gf_bs_write_data(bs, ptr->RightsIssuerURL, strlen(ptr->RightsIssuerURL));
if (ptr->TextualHeadersLen) gf_bs_write_data(bs, ptr->TextualHeaders, ptr->TextualHeadersLen);
ptr->size -= cid_len+ri_len+ptr->TextualHeadersLen;
return gf_isom_box_array_write(s, ptr->ExtendedHeaders, bs);
}
GF_Err ohdr_Size(GF_Box *s)
{
GF_Err e;
GF_OMADRMCommonHeaderBox *ptr = (GF_OMADRMCommonHeaderBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 1+1+8+2+2+2;
if (ptr->ContentID) ptr->size += strlen(ptr->ContentID);
if (ptr->RightsIssuerURL) ptr->size += strlen(ptr->RightsIssuerURL);
if (ptr->TextualHeadersLen) ptr->size += ptr->TextualHeadersLen;
return gf_isom_box_array_size(s, ptr->ExtendedHeaders);
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMGroupID Box */
GF_Box *grpi_New()
{
GF_OMADRMGroupIDBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMGroupIDBox);
if (tmp == NULL) return NULL;
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_GRPI;
return (GF_Box *)tmp;
}
void grpi_del(GF_Box *s)
{
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
if (ptr == NULL) return;
if (ptr->GroupID) gf_free(ptr->GroupID);
if (ptr->GroupKey) gf_free(ptr->GroupKey);
gf_free(ptr);
}
GF_Err grpi_Read(GF_Box *s, GF_BitStream *bs)
{
u16 gid_len;
GF_Err e;
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox*)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
gid_len = gf_bs_read_u16(bs);
ptr->GKEncryptionMethod = gf_bs_read_u8(bs);
ptr->GKLength = gf_bs_read_u16(bs);
ptr->size -= 1+2+2;
if (ptr->size<gid_len+ptr->GKLength) return GF_ISOM_INVALID_FILE;
ptr->GroupID = (char *) gf_malloc(sizeof(char)*(gid_len+1));
gf_bs_read_data(bs, ptr->GroupID, gid_len);
ptr->GroupID[gid_len]=0;
ptr->GroupKey = (char *)gf_malloc(sizeof(char)*ptr->GKLength);
gf_bs_read_data(bs, ptr->GroupKey, ptr->GKLength);
ptr->size -= gid_len+ptr->GKLength;
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err grpi_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u16 gid_len;
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gid_len = ptr->GroupID ? strlen(ptr->GroupID) : 0;
gf_bs_write_u16(bs, gid_len);
gf_bs_write_u8(bs, ptr->GKEncryptionMethod);
gf_bs_write_u16(bs, ptr->GKLength);
gf_bs_write_data(bs, ptr->GroupID, gid_len);
gf_bs_write_data(bs, ptr->GroupKey, ptr->GKLength);
return GF_OK;
}
GF_Err grpi_Size(GF_Box *s)
{
GF_Err e;
GF_OMADRMGroupIDBox *ptr = (GF_OMADRMGroupIDBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 2+2+1 + ptr->GKLength;
if (ptr->GroupID) ptr->size += strlen(ptr->GroupID);
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMMutableInformation Box */
GF_Box *mdri_New()
{
GF_OMADRMMutableInformationBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMMutableInformationBox);
if (tmp == NULL) return NULL;
tmp->type = GF_ISOM_BOX_TYPE_MDRI;
tmp->boxes = gf_list_new();
return (GF_Box *)tmp;
}
void mdri_del(GF_Box *s)
{
GF_OMADRMMutableInformationBox*ptr = (GF_OMADRMMutableInformationBox*)s;
if (ptr == NULL) return;
gf_isom_box_array_del(ptr->boxes);
gf_free(ptr);
}
GF_Err mdri_AddBox(GF_Box *s, GF_Box *a)
{
GF_OMADRMMutableInformationBox *ptr = (GF_OMADRMMutableInformationBox *)s;
return gf_list_add(ptr->boxes, a);
}
GF_Err mdri_Read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_read_box_list(s, bs, mdri_AddBox);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err mdri_Write(GF_Box *s, GF_BitStream *bs)
{
GF_OMADRMMutableInformationBox*ptr = (GF_OMADRMMutableInformationBox*)s;
GF_Err e = gf_isom_box_write_header(s, bs);
if (e) return e;
return gf_isom_box_array_write(s, ptr->boxes, bs);
}
GF_Err mdri_Size(GF_Box *s)
{
GF_Err e;
GF_OMADRMMutableInformationBox *ptr = (GF_OMADRMMutableInformationBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_box_get_size(s);
if (e) return e;
return gf_isom_box_array_size(s, ptr->boxes);
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMTransactionTracking Box */
GF_Box *odtt_New()
{
GF_OMADRMTransactionTrackingBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMTransactionTrackingBox);
if (tmp == NULL) return NULL;
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_ODTT;
return (GF_Box *)tmp;
}
void odtt_del(GF_Box *s)
{
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox*)s;
gf_free(ptr);
}
GF_Err odtt_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
gf_bs_read_data(bs, ptr->TransactionID, 16);
ptr->size -= 16;
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err odtt_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OMADRMTransactionTrackingBox *ptr = (GF_OMADRMTransactionTrackingBox*)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_data(bs, ptr->TransactionID, 16);
return GF_OK;
}
GF_Err odtt_Size(GF_Box *s)
{
GF_Err e;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += 16;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMRightsObject Box */
GF_Box *odrb_New()
{
GF_OMADRMRightsObjectBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMRightsObjectBox);
if (tmp == NULL) return NULL;
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_ODRB;
return (GF_Box *)tmp;
}
void odrb_del(GF_Box *s)
{
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox*)s;
if (ptr->oma_ro) gf_free(ptr->oma_ro);
gf_free(ptr);
}
GF_Err odrb_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->oma_ro_size = (u32) ptr->size;
ptr->oma_ro = (char*) gf_malloc(sizeof(char)*ptr->oma_ro_size);
gf_bs_read_data(bs, ptr->oma_ro, ptr->oma_ro_size);
ptr->size = 0;
return GF_OK;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err odrb_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_data(bs, ptr->oma_ro, ptr->oma_ro_size);
return GF_OK;
}
GF_Err odrb_Size(GF_Box *s)
{
GF_Err e;
GF_OMADRMRightsObjectBox *ptr = (GF_OMADRMRightsObjectBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
s->size += ptr->oma_ro_size;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
/* OMADRMKMS Box */
GF_Box *odkm_New()
{
GF_OMADRMKMSBox *tmp;
GF_SAFEALLOC(tmp, GF_OMADRMKMSBox);
if (tmp == NULL) return NULL;
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_ODKM;
return (GF_Box *)tmp;
}
void odkm_del(GF_Box *s)
{
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
if (ptr->hdr) gf_isom_box_del((GF_Box*)ptr->hdr);
if (ptr->fmt) gf_isom_box_del((GF_Box*)ptr->fmt);
gf_free(ptr);
}
GF_Err odkm_Add(GF_Box *s, GF_Box *a)
{
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_OHDR:
if (ptr->hdr) gf_isom_box_del((GF_Box*)ptr->hdr);
ptr->hdr = (GF_OMADRMCommonHeaderBox *)a;
return GF_OK;
case GF_ISOM_BOX_TYPE_ODAF:
if (ptr->fmt) gf_isom_box_del((GF_Box*)ptr->fmt);
ptr->fmt = (GF_OMADRMAUFormatBox*)a;
return GF_OK;
default:
gf_isom_box_del(a);
return GF_OK;
}
}
GF_Err odkm_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
if (s == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
return gf_isom_read_box_list(s, bs, odkm_Add);
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err odkm_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
if (ptr->hdr) {
e = gf_isom_box_write((GF_Box*)ptr->hdr, bs);
if (e) return e;
}
if (ptr->fmt) {
e = gf_isom_box_write((GF_Box*)ptr->fmt, bs);
if (e) return e;
}
return GF_OK;
}
GF_Err odkm_Size(GF_Box *s)
{
GF_Err e;
GF_OMADRMKMSBox *ptr = (GF_OMADRMKMSBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
if (ptr->hdr) {
e = gf_isom_box_size((GF_Box*)ptr->hdr);
if (e) return e;
ptr->size += ptr->hdr->size;
}
if (ptr->fmt) {
e = gf_isom_box_size((GF_Box*)ptr->fmt);
if (e) return e;
ptr->size += ptr->fmt->size;
}
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
#endif /*GPAC_DISABLE_ISOM*/

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Cyril Concolato / Jean Le Feuvre 2005
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Cyril Concolato / Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2012
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
@@ -28,18 +29,14 @@
GF_Box *meta_New()
{
GF_MetaBox *tmp = (GF_MetaBox *) gf_malloc(sizeof(GF_MetaBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_MetaBox));
ISOM_DECL_BOX_ALLOC(GF_MetaBox, GF_ISOM_BOX_TYPE_META);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_META;
tmp->other_boxes = gf_list_new();
return (GF_Box *)tmp;
}
void meta_del(GF_Box *s)
{
u32 count, i;
GF_MetaBox *ptr = (GF_MetaBox *)s;
if (ptr == NULL) return;
gf_isom_box_del((GF_Box *)ptr->handler);
@@ -49,12 +46,8 @@ void meta_del(GF_Box *s)
if (ptr->protections) gf_isom_box_del((GF_Box *)ptr->protections);
if (ptr->item_infos) gf_isom_box_del((GF_Box *)ptr->item_infos);
if (ptr->IPMP_control) gf_isom_box_del((GF_Box *)ptr->IPMP_control);
count = gf_list_count(ptr->other_boxes);
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
gf_isom_box_del(a);
}
gf_list_del(ptr->other_boxes);
if (ptr->item_refs) gf_isom_box_del((GF_Box *)ptr->item_refs);
if (ptr->item_props) gf_isom_box_del((GF_Box *)ptr->item_props);
gf_free(ptr);
}
@@ -62,38 +55,44 @@ GF_Err meta_AddBox(GF_Box *s, GF_Box *a)
{
GF_MetaBox *ptr = (GF_MetaBox *)s;
switch (a->type) {
case GF_ISOM_BOX_TYPE_HDLR:
case GF_ISOM_BOX_TYPE_HDLR:
if (ptr->handler) return GF_ISOM_INVALID_FILE;
ptr->handler = (GF_HandlerBox*)a;
ptr->handler = (GF_HandlerBox*)a;
break;
case GF_ISOM_BOX_TYPE_PITM:
case GF_ISOM_BOX_TYPE_PITM:
if (ptr->primary_resource) return GF_ISOM_INVALID_FILE;
ptr->primary_resource = (GF_PrimaryItemBox*)a;
ptr->primary_resource = (GF_PrimaryItemBox*)a;
break;
case GF_ISOM_BOX_TYPE_DINF:
case GF_ISOM_BOX_TYPE_DINF:
if (ptr->file_locations) return GF_ISOM_INVALID_FILE;
ptr->file_locations = (GF_DataInformationBox*)a;
ptr->file_locations = (GF_DataInformationBox*)a;
break;
case GF_ISOM_BOX_TYPE_ILOC:
case GF_ISOM_BOX_TYPE_ILOC:
if (ptr->item_locations) return GF_ISOM_INVALID_FILE;
ptr->item_locations = (GF_ItemLocationBox*)a;
ptr->item_locations = (GF_ItemLocationBox*)a;
break;
case GF_ISOM_BOX_TYPE_IPRO:
case GF_ISOM_BOX_TYPE_IPRO:
if (ptr->protections) return GF_ISOM_INVALID_FILE;
ptr->protections = (GF_ItemProtectionBox*)a;
ptr->protections = (GF_ItemProtectionBox*)a;
break;
case GF_ISOM_BOX_TYPE_IINF:
case GF_ISOM_BOX_TYPE_IINF:
if (ptr->item_infos) return GF_ISOM_INVALID_FILE;
ptr->item_infos = (GF_ItemInfoBox*)a;
ptr->item_infos = (GF_ItemInfoBox*)a;
break;
//case ???: ptr->IPMP_control = (???*)a; break;
case GF_ISOM_BOX_TYPE_XML:
case GF_ISOM_BOX_TYPE_BXML:
case GF_ISOM_BOX_TYPE_ILST:
gf_list_add(ptr->other_boxes, a); break;
default:
gf_isom_box_del(a);
case GF_ISOM_BOX_TYPE_IREF:
if (ptr->item_refs) return GF_ISOM_INVALID_FILE;
ptr->item_refs = (GF_ItemReferenceBox*)a;
break;
case GF_ISOM_BOX_TYPE_IPRP:
if (ptr->item_props) return GF_ISOM_INVALID_FILE;
ptr->item_props = (GF_ItemPropertiesBox*)a;
break;
//case ???: ptr->IPMP_control = (???*)a; break;
case GF_ISOM_BOX_TYPE_XML:
case GF_ISOM_BOX_TYPE_BXML:
case GF_ISOM_BOX_TYPE_ILST:
default:
return gf_isom_box_add_default(s, a);
}
return GF_OK;
}
@@ -113,96 +112,101 @@ GF_Err meta_Read(GF_Box *s, GF_BitStream *bs)
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err meta_Write(GF_Box *s, GF_BitStream *bs)
{
u32 count, i;
GF_Err e;
GF_MetaBox *ptr = (GF_MetaBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
e = gf_isom_box_write((GF_Box *) ptr->handler, bs);
if (e) return e;
if (ptr->handler) {
e = gf_isom_box_write((GF_Box *)ptr->handler, bs);
if (e) return e;
}
if (ptr->primary_resource) {
e = gf_isom_box_write((GF_Box *) ptr->primary_resource, bs);
e = gf_isom_box_write((GF_Box *)ptr->primary_resource, bs);
if (e) return e;
}
if (ptr->file_locations) {
e = gf_isom_box_write((GF_Box *) ptr->file_locations, bs);
e = gf_isom_box_write((GF_Box *)ptr->file_locations, bs);
if (e) return e;
}
if (ptr->item_locations) {
e = gf_isom_box_write((GF_Box *) ptr->item_locations, bs);
e = gf_isom_box_write((GF_Box *)ptr->item_locations, bs);
if (e) return e;
}
if (ptr->protections) {
e = gf_isom_box_write((GF_Box *) ptr->protections, bs);
e = gf_isom_box_write((GF_Box *)ptr->protections, bs);
if (e) return e;
}
if (ptr->item_infos) {
e = gf_isom_box_write((GF_Box *) ptr->item_infos, bs);
e = gf_isom_box_write((GF_Box *)ptr->item_infos, bs);
if (e) return e;
}
if (ptr->IPMP_control) {
e = gf_isom_box_write((GF_Box *) ptr->IPMP_control, bs);
e = gf_isom_box_write((GF_Box *)ptr->IPMP_control, bs);
if (e) return e;
}
if ((count = gf_list_count(ptr->other_boxes))) {
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
e = gf_isom_box_write(a, bs);
if (e) return e;
}
if (ptr->item_refs) {
e = gf_isom_box_write((GF_Box *)ptr->item_refs, bs);
if (e) return e;
}
if (ptr->item_props) {
e = gf_isom_box_write((GF_Box *)ptr->item_props, bs);
if (e) return e;
}
return GF_OK;
}
GF_Err meta_Size(GF_Box *s)
{
u32 i, count;
GF_Err e;
GF_MetaBox *ptr = (GF_MetaBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
e = gf_isom_box_size((GF_Box *) ptr->handler);
if (e) return e;
ptr->size += ptr->handler->size;
if (ptr->handler) {
e = gf_isom_box_size((GF_Box *)ptr->handler);
if (e) return e;
ptr->size += ptr->handler->size;
}
if (ptr->primary_resource) {
e = gf_isom_box_size((GF_Box *) ptr->primary_resource);
e = gf_isom_box_size((GF_Box *)ptr->primary_resource);
if (e) return e;
ptr->size += ptr->primary_resource->size;
}
if (ptr->file_locations) {
e = gf_isom_box_size((GF_Box *) ptr->file_locations);
e = gf_isom_box_size((GF_Box *)ptr->file_locations);
if (e) return e;
ptr->size += ptr->file_locations->size;
}
if (ptr->item_locations) {
e = gf_isom_box_size((GF_Box *) ptr->item_locations);
e = gf_isom_box_size((GF_Box *)ptr->item_locations);
if (e) return e;
ptr->size += ptr->item_locations->size;
}
if (ptr->protections) {
e = gf_isom_box_size((GF_Box *) ptr->protections);
e = gf_isom_box_size((GF_Box *)ptr->protections);
if (e) return e;
ptr->size += ptr->protections->size;
}
if (ptr->item_infos) {
e = gf_isom_box_size((GF_Box *) ptr->item_infos);
e = gf_isom_box_size((GF_Box *)ptr->item_infos);
if (e) return e;
ptr->size += ptr->item_infos->size;
}
if (ptr->IPMP_control) {
e = gf_isom_box_size((GF_Box *) ptr->IPMP_control);
e = gf_isom_box_size((GF_Box *)ptr->IPMP_control);
if (e) return e;
ptr->size += ptr->IPMP_control->size;
}
if ((count = gf_list_count(ptr->other_boxes))) {
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->other_boxes, i);
e = gf_isom_box_size(a);
if (e) return e;
ptr->size += a->size;
}
if (ptr->item_refs) {
e = gf_isom_box_size((GF_Box *)ptr->item_refs);
if (e) return e;
ptr->size += ptr->item_refs->size;
}
if (ptr->item_props) {
e = gf_isom_box_size((GF_Box *)ptr->item_props);
if (e) return e;
ptr->size += ptr->item_props->size;
}
return GF_OK;
}
@@ -210,11 +214,8 @@ GF_Err meta_Size(GF_Box *s)
GF_Box *xml_New()
{
GF_XMLBox *tmp = (GF_XMLBox *) gf_malloc(sizeof(GF_XMLBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_XMLBox));
ISOM_DECL_BOX_ALLOC(GF_XMLBox, GF_ISOM_BOX_TYPE_XML);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_XML;
return (GF_Box *)tmp;
}
@@ -266,11 +267,8 @@ GF_Err xml_Size(GF_Box *s)
GF_Box *bxml_New()
{
GF_BinaryXMLBox *tmp = (GF_BinaryXMLBox *) gf_malloc(sizeof(GF_BinaryXMLBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_BinaryXMLBox));
ISOM_DECL_BOX_ALLOC(GF_BinaryXMLBox, GF_ISOM_BOX_TYPE_BXML);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_BXML;
return (GF_Box *)tmp;
}
@@ -321,34 +319,35 @@ GF_Err bxml_Size(GF_Box *s)
GF_Box *iloc_New()
{
GF_ItemLocationBox *tmp = (GF_ItemLocationBox *) gf_malloc(sizeof(GF_ItemLocationBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ItemLocationBox));
ISOM_DECL_BOX_ALLOC(GF_ItemLocationBox, GF_ISOM_BOX_TYPE_ILOC);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_ILOC;
tmp->location_entries = gf_list_new();
return (GF_Box *)tmp;
}
void iloc_entry_del(GF_ItemLocationEntry *location)
{
u32 j, extent_count;
extent_count = gf_list_count(location->extent_entries);
for (j = 0; j < extent_count; j++) {
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
gf_free(extent);
}
gf_list_del(location->extent_entries);
gf_free(location);
}
void iloc_del(GF_Box *s)
{
u32 i, j, item_count, extent_count;
u32 i, item_count;
GF_ItemLocationBox *ptr = (GF_ItemLocationBox *)s;
if (ptr == NULL) return;
item_count = gf_list_count(ptr->location_entries);
if (item_count) {
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
extent_count = gf_list_count(location->extent_entries);
for (j = 0; j < extent_count; j++) {
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
gf_free(extent);
}
gf_list_del(location->extent_entries);
gf_free(location);
}
gf_list_del(ptr->location_entries);
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
iloc_entry_del(location);
}
gf_list_del(ptr->location_entries);
gf_free(ptr);
}
@@ -362,14 +361,35 @@ GF_Err iloc_Read(GF_Box *s, GF_BitStream *bs)
ptr->offset_size = gf_bs_read_int(bs, 4);
ptr->length_size = gf_bs_read_int(bs, 4);
ptr->base_offset_size = gf_bs_read_int(bs, 4);
gf_bs_read_int(bs, 4);
item_count = gf_bs_read_u16(bs);
if (ptr->version == 1 || ptr->version == 2) {
ptr->index_size = gf_bs_read_int(bs, 4);
}
else {
gf_bs_read_int(bs, 4);
}
if (ptr->version < 2) {
item_count = gf_bs_read_u16(bs);
}
else {
item_count = gf_bs_read_u32(bs);
}
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location_entry = (GF_ItemLocationEntry *)gf_malloc(sizeof(GF_ItemLocationEntry));
gf_list_add(ptr->location_entries, location_entry);
location_entry->item_ID = gf_bs_read_u16(bs);
if (ptr->version < 2) {
location_entry->item_ID = gf_bs_read_u16(bs);
}
else {
location_entry->item_ID = gf_bs_read_u32(bs);
}
if (ptr->version == 1 || ptr->version == 2) {
location_entry->construction_method = gf_bs_read_u16(bs);
}
else {
location_entry->construction_method = 0;
}
location_entry->data_reference_index = gf_bs_read_u16(bs);
location_entry->base_offset = gf_bs_read_int(bs, 8*ptr->base_offset_size);
location_entry->base_offset = gf_bs_read_int(bs, 8 * ptr->base_offset_size);
#ifndef GPAC_DISABLE_ISOM_WRITE
location_entry->original_base_offset = location_entry->base_offset;
#endif
@@ -379,8 +399,14 @@ GF_Err iloc_Read(GF_Box *s, GF_BitStream *bs)
for (j = 0; j < extent_count; j++) {
GF_ItemExtentEntry *extent_entry = (GF_ItemExtentEntry *)gf_malloc(sizeof(GF_ItemExtentEntry));
gf_list_add(location_entry->extent_entries, extent_entry);
extent_entry->extent_offset = gf_bs_read_int(bs, 8*ptr->offset_size);
extent_entry->extent_length = gf_bs_read_int(bs, 8*ptr->length_size);
if ((ptr->version == 1 || ptr->version == 2) && ptr->index_size > 0) {
extent_entry->extent_index = gf_bs_read_int(bs, 8 * ptr->index_size);;
}
else {
extent_entry->extent_index = 0;
}
extent_entry->extent_offset = gf_bs_read_int(bs, 8 * ptr->offset_size);
extent_entry->extent_length = gf_bs_read_int(bs, 8 * ptr->length_size);
#ifndef GPAC_DISABLE_ISOM_WRITE
extent_entry->original_extent_offset = extent_entry->extent_offset;
#endif
@@ -401,20 +427,36 @@ GF_Err iloc_Write(GF_Box *s, GF_BitStream *bs)
gf_bs_write_int(bs, ptr->offset_size, 4);
gf_bs_write_int(bs, ptr->length_size, 4);
gf_bs_write_int(bs, ptr->base_offset_size, 4);
gf_bs_write_int(bs, 0, 4);
gf_bs_write_int(bs, ptr->index_size, 4);
item_count = gf_list_count(ptr->location_entries);
gf_bs_write_u16(bs, item_count);
if (ptr->version < 2) {
gf_bs_write_u16(bs, item_count);
}
else {
gf_bs_write_u32(bs, item_count);
}
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
gf_bs_write_u16(bs, location->item_ID);
if (ptr->version < 2) {
gf_bs_write_u16(bs, location->item_ID);
}
else {
gf_bs_write_u32(bs, location->item_ID);
}
if (ptr->version == 1 || ptr->version == 2) {
gf_bs_write_u16(bs, location->construction_method);
}
gf_bs_write_u16(bs, location->data_reference_index);
gf_bs_write_long_int(bs, location->base_offset, 8*ptr->base_offset_size);
gf_bs_write_long_int(bs, location->base_offset, 8 * ptr->base_offset_size);
extent_count = gf_list_count(location->extent_entries);
gf_bs_write_u16(bs, extent_count);
for (j=0; j<extent_count; j++) {
for (j = 0; j<extent_count; j++) {
GF_ItemExtentEntry *extent = (GF_ItemExtentEntry *)gf_list_get(location->extent_entries, j);
gf_bs_write_long_int(bs, extent->extent_offset, 8*ptr->offset_size);
gf_bs_write_long_int(bs, extent->extent_length, 8*ptr->length_size);
if ((ptr->version == 1 || ptr->version == 2) && ptr->index_size > 0) {
gf_bs_write_long_int(bs, extent->extent_index, 8 * ptr->index_size);
}
gf_bs_write_long_int(bs, extent->extent_offset, 8 * ptr->offset_size);
gf_bs_write_long_int(bs, extent->extent_length, 8 * ptr->length_size);
}
}
return GF_OK;
@@ -428,12 +470,34 @@ GF_Err iloc_Size(GF_Box *s)
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 4;
if (ptr->index_size) {
ptr->version = 1;
}
item_count = gf_list_count(ptr->location_entries);
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
if (location->construction_method) {
ptr->version = 1;
}
if (location->item_ID > 0xFFFF) {
ptr->version = 2;
}
}
ptr->size += 4;
if (ptr->version == 2) {
ptr->size += 2; // 32 bits item count instead of 16 bits
}
for (i = 0; i < item_count; i++) {
GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i);
extent_count = gf_list_count(location->extent_entries);
ptr->size += 6 + ptr->base_offset_size + extent_count*(ptr->offset_size + ptr->length_size);
if (ptr->version == 2) {
ptr->size += 2; //32 bits item ID instead of 16 bits
}
if (ptr->version == 1 || ptr->version == 2) {
ptr->size += 2; // construction_method
ptr->size += extent_count*ptr->index_size;
}
}
return GF_OK;
}
@@ -441,11 +505,8 @@ GF_Err iloc_Size(GF_Box *s)
GF_Box *pitm_New()
{
GF_PrimaryItemBox *tmp = (GF_PrimaryItemBox *) gf_malloc(sizeof(GF_PrimaryItemBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_PrimaryItemBox));
ISOM_DECL_BOX_ALLOC(GF_PrimaryItemBox, GF_ISOM_BOX_TYPE_PITM);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_PITM;
return (GF_Box *)tmp;
}
@@ -461,7 +522,7 @@ GF_Err pitm_Read(GF_Box *s, GF_BitStream *bs)
GF_Err e;
GF_PrimaryItemBox *ptr = (GF_PrimaryItemBox *)s;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
if (e) return e;
ptr->item_ID = gf_bs_read_u16(bs);
return GF_OK;
}
@@ -485,18 +546,15 @@ GF_Err pitm_Size(GF_Box *s)
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 16;
ptr->size += 2;
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
GF_Box *ipro_New()
{
GF_ItemProtectionBox *tmp = (GF_ItemProtectionBox *) gf_malloc(sizeof(GF_ItemProtectionBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ItemProtectionBox));
ISOM_DECL_BOX_ALLOC(GF_ItemProtectionBox, GF_ISOM_BOX_TYPE_IPRO);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_IPRO;
tmp->protection_information = gf_list_new();
return (GF_Box *)tmp;
}
@@ -518,11 +576,10 @@ void ipro_del(GF_Box *s)
GF_Err ipro_AddBox(GF_Box *s, GF_Box *a)
{
GF_ItemProtectionBox *ptr = (GF_ItemProtectionBox *)s;
if (a->type == GF_ISOM_BOX_TYPE_SINF)
gf_list_add(ptr->protection_information, a);
else
gf_isom_box_del(a);
return GF_OK;
if (a->type == GF_ISOM_BOX_TYPE_SINF)
return gf_list_add(ptr->protection_information, a);
else
return gf_isom_box_add_default(s, a);
}
GF_Err ipro_Read(GF_Box *s, GF_BitStream *bs)
{
@@ -576,11 +633,8 @@ GF_Err ipro_Size(GF_Box *s)
GF_Box *infe_New()
{
GF_ItemInfoEntryBox *tmp = (GF_ItemInfoEntryBox *) gf_malloc(sizeof(GF_ItemInfoEntryBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ItemInfoEntryBox));
ISOM_DECL_BOX_ALLOC(GF_ItemInfoEntryBox, GF_ISOM_BOX_TYPE_INFE);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_INFE;
return (GF_Box *)tmp;
}
@@ -604,29 +658,35 @@ GF_Err infe_Read(GF_Box *s, GF_BitStream *bs)
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
ptr->item_ID = gf_bs_read_u16(bs);
ptr->item_protection_index = gf_bs_read_u16(bs);
ptr->size -= 4;
buf_len = (u32) (ptr->size);
if (ptr->version == 2) {
ptr->item_type = gf_bs_read_u32(bs);
ptr->size -= 4;
}
buf_len = (u32)(ptr->size);
buf = (char*)gf_malloc(buf_len);
if (buf_len != gf_bs_read_data(bs, buf, buf_len)) {
gf_free(buf);
return GF_ISOM_INVALID_FILE;
}
}
string_len = 1;
string_start = 0;
for (i = 0; i < buf_len; i++) {
if (buf[i] == 0) {
if (!ptr->item_name) {
ptr->item_name = (char*)gf_malloc(sizeof(char)*string_len);
memcpy(ptr->item_name, buf+string_start, string_len);
} else if (!ptr->content_type) {
memcpy(ptr->item_name, buf + string_start, string_len);
}
else if (!ptr->content_type) {
ptr->content_type = (char*)gf_malloc(sizeof(char)*string_len);
memcpy(ptr->content_type, buf+string_start, string_len);
} else {
memcpy(ptr->content_type, buf + string_start, string_len);
}
else {
ptr->content_encoding = (char*)gf_malloc(sizeof(char)*string_len);
memcpy(ptr->content_encoding, buf+string_start, string_len);
memcpy(ptr->content_encoding, buf + string_start, string_len);
}
string_start += string_len;
string_len = 0;
@@ -634,7 +694,7 @@ GF_Err infe_Read(GF_Box *s, GF_BitStream *bs)
string_len++;
}
gf_free(buf);
if (!ptr->item_name || !ptr->content_type) return GF_ISOM_INVALID_FILE;
if (!ptr->item_name || (!ptr->content_type && ptr->version < 2)) return GF_ISOM_INVALID_FILE;
return GF_OK;
}
@@ -647,19 +707,40 @@ GF_Err infe_Write(GF_Box *s, GF_BitStream *bs)
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u16(bs, ptr->item_ID);
if (ptr->version == 3) {
gf_bs_write_u32(bs, ptr->item_ID);
}
else {
gf_bs_write_u16(bs, ptr->item_ID);
}
gf_bs_write_u16(bs, ptr->item_protection_index);
if (ptr->version >= 2) {
gf_bs_write_u32(bs, ptr->item_type);
}
if (ptr->item_name) {
len = strlen(ptr->item_name)+1;
len = (u32)strlen(ptr->item_name) + 1;
gf_bs_write_data(bs, ptr->item_name, len);
}
if (ptr->content_type) {
len = strlen(ptr->content_type)+1;
gf_bs_write_data(bs, ptr->content_type, len);
else {
gf_bs_write_byte(bs, 0, 1);
}
if (ptr->content_encoding) {
len = strlen(ptr->content_encoding)+1;
gf_bs_write_data(bs, ptr->content_encoding, len);
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e') || ptr->item_type == GF_4CC('u', 'r', 'i', ' ')) {
if (ptr->content_type) {
len = (u32)strlen(ptr->content_type) + 1;
gf_bs_write_data(bs, ptr->content_type, len);
}
else {
gf_bs_write_byte(bs, 0, 1);
}
}
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e')) {
if (ptr->content_encoding) {
len = (u32)strlen(ptr->content_encoding) + 1;
gf_bs_write_data(bs, ptr->content_encoding, len);
}
else {
gf_bs_write_byte(bs, 0, 1);
}
}
return GF_OK;
}
@@ -671,21 +752,40 @@ GF_Err infe_Size(GF_Box *s)
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
if (ptr->item_type) {
ptr->version = 2;
if (ptr->item_ID > 0xFFFF) {
ptr->version = 3;
}
}
else {
ptr->version = 0;
}
ptr->size += 4;
if (ptr->item_name) ptr->size += strlen(ptr->item_name)+1;
if (ptr->content_type) ptr->size += strlen(ptr->content_type)+1;
if (ptr->content_encoding) ptr->size += strlen(ptr->content_encoding)+1;
if (ptr->version == 3) {
ptr->size += 2; // item_ID on 32 bits (+2 bytes)
}
if (ptr->version >= 2) {
ptr->size += 4; // item_type size
}
if (ptr->item_name) ptr->size += strlen(ptr->item_name) + 1;
else ptr->size += 1;
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e') || ptr->item_type == GF_4CC('u', 'r', 'i', ' ')) {
if (ptr->content_type) ptr->size += strlen(ptr->content_type) + 1;
else ptr->size += 1;
}
if (ptr->item_type == GF_4CC('m', 'i', 'm', 'e')) {
if (ptr->content_encoding) ptr->size += strlen(ptr->content_encoding) + 1;
else ptr->size += 1;
}
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
GF_Box *iinf_New()
{
GF_ItemInfoBox *tmp = (GF_ItemInfoBox *) gf_malloc(sizeof(GF_ItemInfoBox));
if (tmp == NULL) return NULL;
memset(tmp, 0, sizeof(GF_ItemInfoBox));
ISOM_DECL_BOX_ALLOC(GF_ItemInfoBox, GF_ISOM_BOX_TYPE_IINF);
gf_isom_full_box_init((GF_Box *)tmp);
tmp->type = GF_ISOM_BOX_TYPE_IINF;
tmp->item_infos = gf_list_new();
return (GF_Box *)tmp;
}
@@ -713,7 +813,12 @@ GF_Err iinf_Read(GF_Box *s, GF_BitStream *bs)
e = gf_isom_full_box_read(s, bs);
if (e) return e;
count = gf_bs_read_u16(bs);
if (ptr->version == 0) {
count = gf_bs_read_u16(bs);
}
else {
count = gf_bs_read_u32(bs);
}
while (count) {
e = gf_isom_parse_box(&a, bs);
@@ -721,10 +826,10 @@ GF_Err iinf_Read(GF_Box *s, GF_BitStream *bs)
if (ptr->size<a->size) return GF_ISOM_INVALID_FILE;
if (a->type == GF_ISOM_BOX_TYPE_INFE)
gf_list_add(ptr->item_infos, a);
else
gf_list_add(ptr->item_infos, a);
else
gf_isom_box_del(a);
count --;
count--;
}
return GF_OK;
}
@@ -771,6 +876,145 @@ GF_Err iinf_Size(GF_Box *s)
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
GF_Err iref_AddBox(GF_Box *s, GF_Box *a)
{
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
return gf_list_add(ptr->references, a);
}
void iref_del(GF_Box *s)
{
u32 count, i;
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
if (ptr == NULL) return;
count = gf_list_count(ptr->references);
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
gf_isom_box_del(a);
}
gf_list_del(ptr->references);
gf_free(ptr);
}
GF_Err iref_Read(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
e = gf_isom_full_box_read(s, bs);
if (e) return e;
return gf_isom_read_box_list_ex(s, bs, iref_AddBox, s->type);
}
GF_Box *iref_New()
{
ISOM_DECL_BOX_ALLOC(GF_ItemReferenceBox, GF_ISOM_BOX_TYPE_IREF);
tmp->references = gf_list_new();
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err iref_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 count, i;
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
count = gf_list_count(ptr->references);
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
e = gf_isom_box_write(a, bs);
if (e) return e;
}
return e;
}
GF_Err iref_Size(GF_Box *s)
{
GF_Err e;
u32 count, i;
GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_get_size(s);
if (e) return e;
count = gf_list_count(ptr->references);
for (i = 0; i < count; i++) {
GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i);
e = gf_isom_box_size(a);
if (e) return e;
s->size += a->size;
}
return e;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
void ireftype_del(GF_Box *s)
{
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
if (!ptr) return;
if (ptr->to_item_IDs) gf_free(ptr->to_item_IDs);
gf_free(ptr);
}
GF_Err ireftype_Read(GF_Box *s, GF_BitStream *bs)
{
u32 bytesToRead;
u32 i;
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
bytesToRead = (u32)(ptr->size);
if (!bytesToRead) return GF_OK;
ptr->from_item_id = gf_bs_read_u16(bs);
ptr->reference_count = gf_bs_read_u16(bs);
ptr->to_item_IDs = (u32 *)gf_malloc(ptr->reference_count * sizeof(u32));
if (!ptr->to_item_IDs) return GF_OUT_OF_MEM;
for (i = 0; i < ptr->reference_count; i++) {
ptr->to_item_IDs[i] = gf_bs_read_u16(bs);
}
return GF_OK;
}
GF_Box *ireftype_New()
{
ISOM_DECL_BOX_ALLOC(GF_ItemReferenceTypeBox, GF_ISOM_BOX_TYPE_REFI);
return (GF_Box *)tmp;
}
#ifndef GPAC_DISABLE_ISOM_WRITE
GF_Err ireftype_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
ptr->type = ptr->reference_type;
e = gf_isom_box_write_header(s, bs);
ptr->type = GF_ISOM_BOX_TYPE_REFI;
if (e) return e;
gf_bs_write_u16(bs, ptr->from_item_id);
gf_bs_write_u16(bs, ptr->reference_count);
for (i = 0; i < ptr->reference_count; i++) {
gf_bs_write_u16(bs, ptr->to_item_IDs[i]);
}
return GF_OK;
}
GF_Err ireftype_Size(GF_Box *s)
{
GF_Err e;
GF_ItemReferenceTypeBox *ptr = (GF_ItemReferenceTypeBox *)s;
e = gf_isom_box_get_size(s);
if (e) return e;
ptr->size += 4 + (ptr->reference_count * sizeof(u16));
return GF_OK;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
#endif /*GPAC_DISABLE_ISOM*/

File diff suppressed because it is too large Load Diff

505
src/gpacmp4/configfile.c Normal file
View File

@@ -0,0 +1,505 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/config_file.h>
#include <gpac/list.h>
#define MAX_INI_LINE 2046
typedef struct
{
char *name;
char *value;
} IniKey;
typedef struct
{
char *section_name;
GF_List *keys;
} IniSection;
struct __tag_config
{
char *fileName;
GF_List *sections;
Bool hasChanged, skip_changes;
};
static void DelSection(IniSection *ptr)
{
IniKey *k;
if (!ptr) return;
if (ptr->keys) {
while (gf_list_count(ptr->keys)) {
k = (IniKey *)gf_list_get(ptr->keys, 0);
if (k->value) gf_free(k->value);
if (k->name) gf_free(k->name);
gf_free(k);
gf_list_rem(ptr->keys, 0);
}
gf_list_del(ptr->keys);
}
if (ptr->section_name) gf_free(ptr->section_name);
gf_free(ptr);
}
/*!
* \brief Clear the structure
* \param iniFile The structure to clear
*/
static void gf_cfg_clear(GF_Config * iniFile) {
IniSection *p;
if (!iniFile) return;
if (iniFile->sections) {
while (gf_list_count(iniFile->sections)) {
p = (IniSection *)gf_list_get(iniFile->sections, 0);
DelSection(p);
gf_list_rem(iniFile->sections, 0);
}
gf_list_del(iniFile->sections);
}
if (iniFile->fileName)
gf_free(iniFile->fileName);
memset((void *)iniFile, 0, sizeof(GF_Config));
}
/*!
* \brief Parses the config file if any and clears the existing structure
*/
GF_Err gf_cfg_parse_config_file(GF_Config * tmp, const char * filePath, const char * file_name)
{
IniSection *p;
IniKey *k;
FILE *file;
char *ret;
char *line;
u32 line_alloc = MAX_INI_LINE;
char fileName[GF_MAX_PATH];
gf_cfg_clear(tmp);
if (filePath && ((filePath[strlen(filePath) - 1] == '/') || (filePath[strlen(filePath) - 1] == '\\'))) {
strcpy(fileName, filePath);
strcat(fileName, file_name);
}
else if (filePath) {
sprintf(fileName, "%s%c%s", filePath, GF_PATH_SEPARATOR, file_name);
}
else {
strcpy(fileName, file_name);
}
tmp->fileName = gf_strdup(fileName);
tmp->sections = gf_list_new();
file = gf_fopen(fileName, "rt");
if (!file)
return GF_IO_ERR;
/* load the file */
p = NULL;
line = (char*)gf_malloc(sizeof(char)*line_alloc);
memset(line, 0, sizeof(char)*line_alloc);
while (!feof(file)) {
u32 read, nb_pass;
ret = fgets(line, line_alloc, file);
read = (u32)strlen(line);
nb_pass = 1;
while (read + nb_pass == line_alloc) {
line_alloc += MAX_INI_LINE;
line = (char*)gf_realloc(line, sizeof(char)*line_alloc);
ret = fgets(line + read, MAX_INI_LINE, file);
read = (u32)strlen(line);
nb_pass++;
}
if (!ret) continue;
/* get rid of the end of line stuff */
while (1) {
u32 len = (u32)strlen(line);
if (!len) break;
if ((line[len - 1] != '\n') && (line[len - 1] != '\r')) break;
line[len - 1] = 0;
}
if (!strlen(line)) continue;
if (line[0] == '#') continue;
/* new section */
if (line[0] == '[') {
p = (IniSection *)gf_malloc(sizeof(IniSection));
p->keys = gf_list_new();
p->section_name = gf_strdup(line + 1);
p->section_name[strlen(line) - 2] = 0;
while (p->section_name[strlen(p->section_name) - 1] == ']' || p->section_name[strlen(p->section_name) - 1] == ' ') p->section_name[strlen(p->section_name) - 1] = 0;
gf_list_add(tmp->sections, p);
}
else if (strlen(line) && (strchr(line, '=') != NULL)) {
if (!p) {
gf_list_del(tmp->sections);
gf_free(tmp->fileName);
gf_free(tmp);
gf_fclose(file);
gf_free(line);
return GF_IO_ERR;
}
k = (IniKey *)gf_malloc(sizeof(IniKey));
memset((void *)k, 0, sizeof(IniKey));
ret = strchr(line, '=');
if (ret) {
ret[0] = 0;
k->name = gf_strdup(line);
while (k->name[strlen(k->name) - 1] == ' ') k->name[strlen(k->name) - 1] = 0;
ret[0] = '=';
ret += 1;
while (ret[0] == ' ') ret++;
if (ret[0] != 0) {
k->value = gf_strdup(ret);
while (k->value[strlen(k->value) - 1] == ' ') k->value[strlen(k->value) - 1] = 0;
}
else {
k->value = gf_strdup("");
}
}
gf_list_add(p->keys, k);
}
}
gf_free(line);
gf_fclose(file);
return GF_OK;
}
GF_EXPORT
GF_Config *gf_cfg_force_new(const char *filePath, const char* file_name) {
GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config));
memset((void *)tmp, 0, sizeof(GF_Config));
gf_cfg_parse_config_file(tmp, filePath, file_name);
return tmp;
}
GF_EXPORT
GF_Config *gf_cfg_new(const char *filePath, const char* file_name)
{
GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config));
memset((void *)tmp, 0, sizeof(GF_Config));
if (!filePath && !file_name) {
tmp->sections = gf_list_new();
return tmp;
}
if (gf_cfg_parse_config_file(tmp, filePath, file_name)) {
gf_cfg_clear(tmp);
gf_free(tmp);
tmp = NULL;
}
return tmp;
}
GF_EXPORT
char * gf_cfg_get_filename(GF_Config *iniFile)
{
if (!iniFile)
return NULL;
return iniFile->fileName ? gf_strdup(iniFile->fileName) : NULL;
}
GF_EXPORT
GF_Err gf_cfg_save(GF_Config *iniFile)
{
u32 i, j;
IniSection *sec;
IniKey *key;
FILE *file;
if (!iniFile->hasChanged) return GF_OK;
if (iniFile->skip_changes) return GF_OK;
if (!iniFile->fileName) return GF_OK;
file = gf_fopen(iniFile->fileName, "wt");
if (!file) return GF_IO_ERR;
i = 0;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
/*Temporary sections are not saved*/
if (!strnicmp(sec->section_name, "Temp", 4)) continue;
fprintf(file, "[%s]\n", sec->section_name);
j = 0;
while ((key = (IniKey *)gf_list_enum(sec->keys, &j))) {
fprintf(file, "%s=%s\n", key->name, key->value);
}
/* end of section */
fprintf(file, "\n");
}
gf_fclose(file);
return GF_OK;
}
GF_EXPORT
GF_Err gf_cfg_discard_changes(GF_Config *iniFile)
{
if (!iniFile) return GF_BAD_PARAM;
iniFile->skip_changes = GF_TRUE;
return GF_OK;
}
GF_EXPORT
void gf_cfg_del(GF_Config *iniFile)
{
if (!iniFile) return;
gf_cfg_save(iniFile);
gf_cfg_clear(iniFile);
gf_free(iniFile);
}
void gf_cfg_remove(GF_Config *iniFile)
{
if (!iniFile) return;
gf_delete_file(iniFile->fileName);
gf_cfg_clear(iniFile);
gf_free(iniFile);
}
GF_EXPORT
const char *gf_cfg_get_key(GF_Config *iniFile, const char *secName, const char *keyName)
{
u32 i;
IniSection *sec;
IniKey *key;
i = 0;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, sec->section_name)) goto get_key;
}
return NULL;
get_key:
i = 0;
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
if (!strcmp(key->name, keyName)) return key->value;
}
return NULL;
}
GF_EXPORT
const char *gf_cfg_get_ikey(GF_Config *iniFile, const char *secName, const char *keyName)
{
u32 i;
IniSection *sec;
IniKey *key;
i = 0;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!stricmp(secName, sec->section_name)) goto get_key;
}
return NULL;
get_key:
i = 0;
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
if (!stricmp(key->name, keyName)) return key->value;
}
return NULL;
}
GF_EXPORT
GF_Err gf_cfg_set_key(GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue)
{
u32 i;
Bool has_changed = GF_TRUE;
IniSection *sec;
IniKey *key;
if (!iniFile || !secName || !keyName) return GF_BAD_PARAM;
if (!strnicmp(secName, "temp", 4)) has_changed = GF_FALSE;
i = 0;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, sec->section_name)) goto get_key;
}
/* need a new key */
sec = (IniSection *)gf_malloc(sizeof(IniSection));
sec->section_name = gf_strdup(secName);
sec->keys = gf_list_new();
if (has_changed) iniFile->hasChanged = GF_TRUE;
gf_list_add(iniFile->sections, sec);
get_key:
i = 0;
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
if (!strcmp(key->name, keyName)) goto set_value;
}
if (!keyValue) return GF_OK;
/* need a new key */
key = (IniKey *)gf_malloc(sizeof(IniKey));
key->name = gf_strdup(keyName);
key->value = gf_strdup("");
if (has_changed) iniFile->hasChanged = GF_TRUE;
gf_list_add(sec->keys, key);
set_value:
if (!keyValue) {
gf_list_del_item(sec->keys, key);
if (key->name) gf_free(key->name);
if (key->value) gf_free(key->value);
gf_free(key);
if (has_changed) iniFile->hasChanged = GF_TRUE;
return GF_OK;
}
/* same value, don't update */
if (!strcmp(key->value, keyValue)) return GF_OK;
if (key->value) gf_free(key->value);
key->value = gf_strdup(keyValue);
if (has_changed) iniFile->hasChanged = GF_TRUE;
return GF_OK;
}
GF_EXPORT
u32 gf_cfg_get_section_count(GF_Config *iniFile)
{
return gf_list_count(iniFile->sections);
}
GF_EXPORT
const char *gf_cfg_get_section_name(GF_Config *iniFile, u32 secIndex)
{
IniSection *is = (IniSection *)gf_list_get(iniFile->sections, secIndex);
if (!is) return NULL;
return is->section_name;
}
GF_EXPORT
u32 gf_cfg_get_key_count(GF_Config *iniFile, const char *secName)
{
u32 i = 0;
IniSection *sec;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, sec->section_name)) return gf_list_count(sec->keys);
}
return 0;
}
GF_EXPORT
const char *gf_cfg_get_key_name(GF_Config *iniFile, const char *secName, u32 keyIndex)
{
u32 i = 0;
IniSection *sec;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, sec->section_name)) {
IniKey *key = (IniKey *)gf_list_get(sec->keys, keyIndex);
return key ? key->name : NULL;
}
}
return NULL;
}
GF_EXPORT
void gf_cfg_del_section(GF_Config *iniFile, const char *secName)
{
u32 i;
IniSection *p;
if (!iniFile) return;
i = 0;
while ((p = (IniSection*)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, p->section_name)) {
DelSection(p);
gf_list_rem(iniFile->sections, i - 1);
iniFile->hasChanged = GF_TRUE;
return;
}
}
}
GF_EXPORT
GF_Err gf_cfg_insert_key(GF_Config *iniFile, const char *secName, const char *keyName, const char *keyValue, u32 index)
{
u32 i;
IniSection *sec;
IniKey *key;
if (!iniFile || !secName || !keyName || !keyValue) return GF_BAD_PARAM;
i = 0;
while ((sec = (IniSection *)gf_list_enum(iniFile->sections, &i))) {
if (!strcmp(secName, sec->section_name)) break;
}
if (!sec) return GF_BAD_PARAM;
i = 0;
while ((key = (IniKey *)gf_list_enum(sec->keys, &i))) {
if (!strcmp(key->name, keyName)) return GF_BAD_PARAM;
}
key = (IniKey *)gf_malloc(sizeof(IniKey));
key->name = gf_strdup(keyName);
key->value = gf_strdup(keyValue);
gf_list_insert(sec->keys, key, index);
iniFile->hasChanged = GF_TRUE;
return GF_OK;
}
GF_EXPORT
const char *gf_cfg_get_sub_key(GF_Config *iniFile, const char *secName, const char *keyName, u32 sub_index)
{
u32 j;
char *subKeyValue, *returnKey;
char *keyValue;
keyValue = gf_strdup(gf_cfg_get_key(iniFile, secName, keyName));
if (!keyValue) {
return NULL;
}
j = 0;
subKeyValue = strtok((char*)keyValue, ";");
while (subKeyValue != NULL) {
if (j == sub_index) {
returnKey = gf_strdup(subKeyValue);
gf_free(keyValue);
return returnKey;
}
j++;
subKeyValue = strtok(NULL, ";");
}
gf_free(keyValue);
return NULL;
}
GF_EXPORT
GF_Err gf_cfg_set_filename(GF_Config *iniFile, const char * fileName)
{
if (!fileName) return GF_OK;
if (iniFile->fileName) gf_free(iniFile->fileName);
iniFile->fileName = gf_strdup(fileName);
return iniFile->fileName ? GF_OK : GF_OUT_OF_MEM;
}

View File

@@ -1,46 +1,66 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include "../disable_warnings.h"
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/isomedia_dev.h>
#include <gpac/network.h>
#ifndef GPAC_DISABLE_ISOM
static u32 default_write_buffering_size = 0;
GF_EXPORT
GF_Err gf_isom_set_output_buffering(GF_ISOFile *movie, u32 size)
{
#ifndef GPAC_DISABLE_ISOM_WRITE
if (!movie) {
default_write_buffering_size = size;
return GF_OK;
}
if (!movie->editFileMap) return GF_BAD_PARAM;
return gf_bs_set_output_buffering(movie->editFileMap->bs, size);
#else
return GF_NOT_SUPPORTED;
#endif
}
void gf_isom_datamap_del(GF_DataMap *ptr)
{
if (!ptr) return;
if (ptr->szName) gf_free(ptr->szName);
//then delete the structure itself....
switch (ptr->type) {
//file-based
//file-based
case GF_ISOM_DATA_FILE:
gf_isom_fdm_del((GF_FileDataMap *)ptr);
break;
case GF_ISOM_DATA_FILE_MAPPING:
gf_isom_fmo_del((GF_FileMappingDataMap *)ptr);
break;
//not implemented
//not implemented
default:
break;
}
@@ -52,7 +72,7 @@ void gf_isom_datamap_close(GF_MediaInformationBox *minf)
GF_DataEntryBox *ent;
if (!minf || !minf->dataHandler) return;
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->boxList, minf->dataEntryIndex - 1);
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->other_boxes, minf->dataEntryIndex - 1);
//if ent NULL, the data entry was not used (should never happen)
if (ent == NULL) return;
@@ -79,11 +99,11 @@ static Bool IsLargeFile(char *path)
#ifndef _WIN32_WCE
FILE *stream;
s64 size;
stream = gf_f64_open(path, "rb");
stream = gf_fopen(path, "rb");
if (!stream) return 0;
gf_f64_seek(stream, 0, SEEK_END);
size = gf_f64_tell(stream);
fclose(stream);
gf_fseek(stream, 0, SEEK_END);
size = gf_ftell(stream);
gf_fclose(stream);
if (size == -1L) return 0;
if (size > 0xFFFFFFFF) return 1;
#endif
@@ -109,12 +129,21 @@ GF_Err gf_isom_datamap_new(const char *location, const char *parentPath, u8 mode
if (!strcmp(location, "mp4_tmp_edit")) {
#ifndef GPAC_DISABLE_ISOM_WRITE
*outDataMap = gf_isom_fdm_new_temp(parentPath);
if (! (*outDataMap)) return GF_IO_ERR;
if (!(*outDataMap)) {
return GF_IO_ERR;
}
return GF_OK;
#else
return GF_NOT_SUPPORTED;
#endif
}
else if (!strncmp(location, "gmem://", 7)) {
*outDataMap = gf_isom_fdm_new(location, GF_ISOM_DATA_MAP_READ);
if (!(*outDataMap)) {
return GF_IO_ERR;
}
return GF_OK;
}
extern_file = !gf_url_is_local(location);
@@ -126,30 +155,45 @@ GF_Err gf_isom_datamap_new(const char *location, const char *parentPath, u8 mode
}
//TEMP: however, only support for file right now (we'd have to add some callback functions at some point)
if (extern_file) return GF_NOT_SUPPORTED;
if (extern_file) {
return GF_NOT_SUPPORTED;
}
sPath = gf_url_get_absolute_path(location, parentPath);
if (sPath == NULL) return GF_URL_ERROR;
if (sPath == NULL) {
return GF_URL_ERROR;
}
if (mode == GF_ISOM_DATA_MAP_READ_ONLY) {
mode = GF_ISOM_DATA_MAP_READ;
/*It seems win32 file mapping is reported in prog mem usage -> large increases of occupancy. Should not be a pb
/*It seems win32 file mapping is reported in prog mem usage -> large increases of occupancy. Should not be a pb
but unless you want mapping, only regular IO will be used...*/
#if 0
if (IsLargeFile(sPath)) {
*outDataMap = gf_isom_fdm_new(sPath, mode);
} else {
}
else {
*outDataMap = gf_isom_fmo_new(sPath, mode);
}
#else
*outDataMap = gf_isom_fdm_new(sPath, mode);
#endif
} else {
}
else {
*outDataMap = gf_isom_fdm_new(sPath, mode);
if (*outDataMap) {
(*outDataMap)->szName = sPath;
sPath = NULL;
}
}
if (sPath) {
gf_free(sPath);
}
if (!(*outDataMap)) {
return GF_URL_ERROR;
}
gf_free(sPath);
if (! (*outDataMap)) return GF_URL_ERROR;
return GF_OK;
}
@@ -159,57 +203,67 @@ GF_Err gf_isom_datamap_open(GF_MediaBox *mdia, u32 dataRefIndex, u8 Edit)
{
GF_DataEntryBox *ent;
GF_MediaInformationBox *minf;
u32 SelfCont;
u32 SelfCont, count;
GF_Err e = GF_OK;
if ((mdia == NULL) || (! mdia->information) || !dataRefIndex)
if ((mdia == NULL) || (!mdia->information) || !dataRefIndex)
return GF_ISOM_INVALID_MEDIA;
minf = mdia->information;
if (dataRefIndex > gf_list_count(minf->dataInformation->dref->boxList))
return GF_BAD_PARAM;
count = gf_list_count(minf->dataInformation->dref->other_boxes);
if (!count) {
SelfCont = 1;
ent = NULL;
}
else {
if (dataRefIndex > gf_list_count(minf->dataInformation->dref->other_boxes))
return GF_BAD_PARAM;
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->boxList, dataRefIndex - 1);
if (ent == NULL) return GF_ISOM_INVALID_MEDIA;
ent = (GF_DataEntryBox*)gf_list_get(minf->dataInformation->dref->other_boxes, dataRefIndex - 1);
if (ent == NULL) return GF_ISOM_INVALID_MEDIA;
//if the current dataEntry is the desired one, and not self contained, return
if ((minf->dataEntryIndex == dataRefIndex) && (ent->flags != 1)) {
return GF_OK;
//if the current dataEntry is the desired one, and not self contained, return
if ((minf->dataEntryIndex == dataRefIndex) && (ent->flags != 1)) {
return GF_OK;
}
SelfCont = 0;
switch (ent->type) {
case GF_ISOM_BOX_TYPE_URL:
case GF_ISOM_BOX_TYPE_URN:
if (ent->flags == 1) SelfCont = 1;
break;
default:
SelfCont = 1;
break;
}
}
//we need to open a new one
//first close the existing one
if (minf->dataHandler) gf_isom_datamap_close(minf);
SelfCont = 0;
switch (ent->type) {
case GF_ISOM_BOX_TYPE_URL:
case GF_ISOM_BOX_TYPE_URN:
if (ent->flags == 1) SelfCont = 1;
break;
default:
SelfCont = 1;
break;
}
//if self-contained, assign the input file
if (SelfCont) {
//if no edit, open the input file
if (!Edit) {
if (mdia->mediaTrack->moov->mov->movieFileMap == NULL) return GF_ISOM_INVALID_FILE;
minf->dataHandler = mdia->mediaTrack->moov->mov->movieFileMap;
} else {
}
else {
#ifndef GPAC_DISABLE_ISOM_WRITE
if (mdia->mediaTrack->moov->mov->editFileMap == NULL) return GF_ISOM_INVALID_FILE;
minf->dataHandler = mdia->mediaTrack->moov->mov->editFileMap;
#else
//this should never be the case in an read-only MP4 file
return GF_BAD_PARAM;
#endif
#endif
}
//else this is a URL (read mode only)
} else {
e = gf_isom_datamap_new(ent->location, mdia->mediaTrack->moov->mov->fileName, GF_ISOM_DATA_MAP_READ, & mdia->information->dataHandler);
if (e) return (e==GF_URL_ERROR) ? GF_ISOM_UNKNOWN_DATA_REF : e;
//else this is a URL (read mode only)
}
else {
e = gf_isom_datamap_new(ent->location, mdia->mediaTrack->moov->mov->fileName, GF_ISOM_DATA_MAP_READ, &mdia->information->dataHandler);
if (e) return (e == GF_URL_ERROR) ? GF_ISOM_UNKNOWN_DATA_REF : e;
}
//OK, set the data entry index
minf->dataEntryIndex = dataRefIndex;
@@ -233,6 +287,15 @@ u32 gf_isom_datamap_get_data(GF_DataMap *map, char *buffer, u32 bufferLength, u6
}
}
void gf_isom_datamap_flush(GF_DataMap *map)
{
if (!map) return;
if (map->type == GF_ISOM_DATA_FILE) {
GF_FileDataMap *fdm = (GF_FileDataMap *)map;
gf_bs_flush(fdm->bs);
}
}
#ifndef GPAC_DISABLE_ISOM_WRITE
@@ -255,7 +318,7 @@ u64 gf_isom_datamap_get_offset(GF_DataMap *map)
GF_Err gf_isom_datamap_add_data(GF_DataMap *ptr, char *data, u32 dataSize)
{
if (!ptr || !data|| !dataSize) return GF_BAD_PARAM;
if (!ptr || !data || !dataSize) return GF_BAD_PARAM;
switch (ptr->type) {
case GF_ISOM_DATA_FILE:
@@ -267,22 +330,25 @@ GF_Err gf_isom_datamap_add_data(GF_DataMap *ptr, char *data, u32 dataSize)
GF_DataMap *gf_isom_fdm_new_temp(const char *sPath)
{
GF_FileDataMap *tmp = (GF_FileDataMap *) gf_malloc(sizeof(GF_FileDataMap));
GF_FileDataMap *tmp;
GF_SAFEALLOC(tmp, GF_FileDataMap);
if (!tmp) return NULL;
memset(tmp, 0, sizeof(GF_FileDataMap));
tmp->type = GF_ISOM_DATA_FILE;
tmp->mode = GF_ISOM_DATA_MAP_WRITE;
if (!sPath) {
tmp->stream = gf_temp_file_new();
} else {
tmp->stream = gf_temp_file_new(&tmp->temp_file);
}
else {
char szPath[GF_MAX_PATH];
if ((sPath[strlen(sPath)-1] != '\\') && (sPath[strlen(sPath)-1] != '/')) {
sprintf(szPath, "%s%c%p_isotmp", sPath, GF_PATH_SEPARATOR, (void*) tmp);
} else {
sprintf(szPath, "%s%p_isotmp", sPath, (void*) tmp);
if ((sPath[strlen(sPath) - 1] != '\\') && (sPath[strlen(sPath) - 1] != '/')) {
sprintf(szPath, "%s%c%p_isotmp", sPath, GF_PATH_SEPARATOR, (void*)tmp);
}
tmp->stream = gf_f64_open(szPath, "w+b");
else {
sprintf(szPath, "%s%p_isotmp", sPath, (void*)tmp);
}
tmp->stream = gf_fopen(szPath, "w+b");
tmp->temp_file = gf_strdup(szPath);
}
if (!tmp->stream) {
@@ -292,49 +358,78 @@ GF_DataMap *gf_isom_fdm_new_temp(const char *sPath)
}
tmp->bs = gf_bs_from_file(tmp->stream, GF_BITSTREAM_WRITE);
if (!tmp->bs) {
fclose(tmp->stream);
gf_fclose(tmp->stream);
gf_free(tmp);
return NULL;
}
if (default_write_buffering_size) {
gf_bs_set_output_buffering(tmp->bs, default_write_buffering_size);
}
return (GF_DataMap *)tmp;
}
#endif /*GPAC_DISABLE_ISOM_WRITE*/
#include <errno.h>
#include <string.h>
GF_DataMap *gf_isom_fdm_new(const char *sPath, u8 mode)
{
u8 bs_mode;
GF_FileDataMap *tmp = (GF_FileDataMap *) gf_malloc(sizeof(GF_FileDataMap));
GF_FileDataMap *tmp;
GF_SAFEALLOC(tmp, GF_FileDataMap);
if (!tmp) return NULL;
memset(tmp, 0, sizeof(GF_FileDataMap));
tmp->type = GF_ISOM_DATA_FILE;
tmp->mode = mode;
#ifndef GPAC_DISABLE_ISOM_WRITE
//open a temp file
if (!strcmp(sPath, "mp4_tmp_edit")) {
//create a temp file (that only occurs in EDIT/WRITE mode)
tmp->stream = gf_temp_file_new();
bs_mode = GF_BITSTREAM_READ;
//create a temp file (that only occurs in EDIT/WRITE mode)
tmp->stream = gf_temp_file_new(&tmp->temp_file);
// bs_mode = GF_BITSTREAM_READ;
}
#endif
if (!strncmp(sPath, "gmem://", 7)) {
u32 size;
void *mem_address;
if (sscanf(sPath, "gmem://%d@%p", &size, &mem_address) != 2)
return NULL;
tmp->bs = gf_bs_new((const char *)mem_address, size, GF_BITSTREAM_READ);
if (!tmp->bs) {
gf_free(tmp);
return NULL;
}
return (GF_DataMap *)tmp;
}
switch (mode) {
case GF_ISOM_DATA_MAP_READ:
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "rb");
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "rb");
bs_mode = GF_BITSTREAM_READ;
break;
///we open the file in READ/WRITE mode, in case
///we open the file in READ/WRITE mode, in case
case GF_ISOM_DATA_MAP_WRITE:
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "w+b");
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "wb");
if (!strcmp(sPath, "std")) {
tmp->stream = stdout;
tmp->is_stdout = 1;
}
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "w+b");
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "wb");
bs_mode = GF_BITSTREAM_WRITE;
break;
///we open the file in CAT mode, in case
///we open the file in CAT mode, in case
case GF_ISOM_DATA_MAP_CAT:
if (!tmp->stream) tmp->stream = gf_f64_open(sPath, "a+b");
if (tmp->stream) gf_f64_seek(tmp->stream, 0, SEEK_END);
if (!strcmp(sPath, "std")) {
tmp->stream = stdout;
tmp->is_stdout = 1;
}
if (!tmp->stream) tmp->stream = gf_fopen(sPath, "a+b");
if (tmp->stream) gf_fseek(tmp->stream, 0, SEEK_END);
bs_mode = GF_BITSTREAM_WRITE;
break;
default:
@@ -347,10 +442,13 @@ GF_DataMap *gf_isom_fdm_new(const char *sPath, u8 mode)
}
tmp->bs = gf_bs_from_file(tmp->stream, bs_mode);
if (!tmp->bs) {
fclose(tmp->stream);
gf_fclose(tmp->stream);
gf_free(tmp);
return NULL;
}
if (default_write_buffering_size) {
gf_bs_set_output_buffering(tmp->bs, default_write_buffering_size);
}
return (GF_DataMap *)tmp;
}
@@ -358,7 +456,8 @@ void gf_isom_fdm_del(GF_FileDataMap *ptr)
{
if (!ptr || (ptr->type != GF_ISOM_DATA_FILE)) return;
if (ptr->bs) gf_bs_del(ptr->bs);
if (ptr->stream) fclose(ptr->stream);
if (ptr->stream && !ptr->is_stdout)
gf_fclose(ptr->stream);
#ifndef GPAC_DISABLE_ISOM_WRITE
if (ptr->temp_file) {
@@ -378,22 +477,30 @@ u32 gf_isom_fdm_get_data(GF_FileDataMap *ptr, char *buffer, u32 bufferLength, u6
//can we seek till that point ???
if (fileOffset > gf_bs_get_size(ptr->bs)) return 0;
//ouch, we are not at the previous location, do a seek
if (ptr->curPos != fileOffset) {
if (gf_bs_get_position(ptr->bs) != fileOffset) {
//we are not at the previous location, do a seek
if (gf_bs_seek(ptr->bs, fileOffset) != GF_OK) return 0;
ptr->curPos = fileOffset;
}
ptr->curPos = fileOffset;
//read our data.
bytesRead = gf_bs_read_data(ptr->bs, buffer, bufferLength);
//update our cache
if (bytesRead == bufferLength) {
ptr->curPos += bytesRead;
} else {
//rewind to original (if seek fails, return 0 cause this means:
//1- no support for seek on the platform
//2- corrupted file for the OS
fflush(ptr->stream);
gf_bs_seek(ptr->bs, ptr->curPos);
}
else {
gf_bs_get_refreshed_size(ptr->bs);
gf_bs_seek(ptr->bs, fileOffset);
bytesRead = gf_bs_read_data(ptr->bs, buffer, bufferLength);
//update our cache
if (bytesRead == bufferLength) {
ptr->curPos += bytesRead;
}
else {
gf_bs_seek(ptr->bs, ptr->curPos);
bytesRead = 0;
}
}
ptr->last_acces_was_read = 1;
return bytesRead;
@@ -438,7 +545,7 @@ GF_Err FDM_AddData(GF_FileDataMap *ptr, char *data, u32 dataSize)
}
ptr->curPos = gf_bs_get_position(ptr->bs);
//flush the stream !!
fflush(ptr->stream);
if (ptr->stream) fflush(ptr->stream);
return GF_OK;
}
@@ -454,7 +561,6 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
{
GF_FileMappingDataMap *tmp;
HANDLE fileH, fileMapH;
DWORD err;
#ifdef _WIN32_WCE
unsigned short sWPath[MAX_PATH];
#endif
@@ -462,28 +568,28 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
//only in read only
if (mode != GF_ISOM_DATA_MAP_READ) return NULL;
tmp = (GF_FileMappingDataMap *) gf_malloc(sizeof(GF_FileMappingDataMap));
GF_SAFEALLOC(tmp, GF_FileMappingDataMap);
if (!tmp) return NULL;
memset(tmp, 0, sizeof(GF_FileMappingDataMap));
tmp->type = GF_ISOM_DATA_FILE_MAPPING;
tmp->mode = mode;
tmp->mode = mode;
tmp->name = gf_strdup(sPath);
//
// Open the file
// Open the file
//
#ifdef _WIN32_WCE
//convert to WIDE
CE_CharToWide((char *)sPath, sWPath);
fileH = CreateFileForMapping(sWPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL );
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL);
#else
fileH = CreateFile(sPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL );
(FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS), NULL);
#endif
if (fileH == INVALID_HANDLE_VALUE) {
gf_free(tmp->name);
gf_free(tmp);
@@ -506,10 +612,9 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
CloseHandle(fileH);
gf_free(tmp->name);
gf_free(tmp);
err = GetLastError();
return NULL;
}
tmp->byte_map = MapViewOfFile(fileMapH, FILE_MAP_READ, 0, 0, 0);
if (tmp->byte_map == NULL) {
CloseHandle(fileMapH);
@@ -520,7 +625,7 @@ GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode)
}
CloseHandle(fileH);
CloseHandle(fileMapH);
CloseHandle(fileMapH);
//finaly open our bitstream (from buffer)
tmp->bs = gf_bs_new(tmp->byte_map, tmp->file_size, GF_BITSTREAM_READ);
@@ -540,11 +645,8 @@ void gf_isom_fmo_del(GF_FileMappingDataMap *ptr)
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
{
u32 size;
//can we seek till that point ???
if (fileOffset > ptr->file_size) return 0;
size = (u32) fileOffset;
//we do only read operations, so trivial
memcpy(buffer, ptr->byte_map + fileOffset, bufferLength);
@@ -553,9 +655,13 @@ u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLen
#else
GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode) { return gf_isom_fdm_new(sPath, mode); }
void gf_isom_fmo_del(GF_FileMappingDataMap *ptr) { gf_isom_fdm_del((GF_FileDataMap *)ptr); }
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
GF_DataMap *gf_isom_fmo_new(const char *sPath, u8 mode) {
return gf_isom_fdm_new(sPath, mode);
}
void gf_isom_fmo_del(GF_FileMappingDataMap *ptr) {
gf_isom_fdm_del((GF_FileDataMap *)ptr);
}
u32 gf_isom_fmo_get_data(GF_FileMappingDataMap *ptr, char *buffer, u32 bufferLength, u64 fileOffset)
{
return gf_isom_fdm_get_data((GF_FileDataMap *)ptr, buffer, bufferLength, fileOffset);
}

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / MPEG-4 ObjectDescriptor sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <gpac/internal/odf_dev.h>
@@ -73,7 +74,7 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
case GF_ODF_MEDIATIME_TAG:
return gf_odf_new_mediatime();
//File Format Specific
//File Format Specific
case GF_ODF_ISOM_IOD_TAG:
return gf_odf_new_isom_iod();
case GF_ODF_ISOM_OD_TAG:
@@ -93,7 +94,7 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
return gf_odf_new_sup_cid();
case GF_ODF_IPI_PTR_TAG:
return gf_odf_new_ipi_ptr();
//special case for the file format
//special case for the file format
case GF_ODF_ISOM_IPI_PTR_TAG:
desc = gf_odf_new_ipi_ptr();
if (!desc) return desc;
@@ -144,8 +145,8 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
#endif /*GPAC_MINIMAL_ODF*/
default:
//ISO Reserved
if ( (tag >= GF_ODF_ISO_RES_BEGIN_TAG) &&
(tag <= GF_ODF_ISO_RES_END_TAG) ) {
if ((tag >= GF_ODF_ISO_RES_BEGIN_TAG) &&
(tag <= GF_ODF_ISO_RES_END_TAG)) {
return NULL;
}
desc = gf_odf_new_default();
@@ -161,13 +162,13 @@ GF_Descriptor *gf_odf_create_descriptor(u8 tag)
GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
{
switch (desc->tag) {
case GF_ODF_IOD_TAG :
case GF_ODF_IOD_TAG:
return gf_odf_del_iod((GF_InitialObjectDescriptor *)desc);
case GF_ODF_OD_TAG:
return gf_odf_del_od((GF_ObjectDescriptor *)desc);
case GF_ODF_ESD_TAG :
case GF_ODF_ESD_TAG:
return gf_odf_del_esd((GF_ESD *)desc);
case GF_ODF_DCD_TAG :
case GF_ODF_DCD_TAG:
return gf_odf_del_dcd((GF_DecoderConfig *)desc);
case GF_ODF_SLC_TAG:
return gf_odf_del_slc((GF_SLConfig *)desc);
@@ -178,9 +179,9 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
return gf_odf_del_isom_od((GF_IsomObjectDescriptor *)desc);
case GF_ODF_SEGMENT_TAG:
return gf_odf_del_segment((GF_Segment *) desc);
return gf_odf_del_segment((GF_Segment *)desc);
case GF_ODF_MEDIATIME_TAG:
return gf_odf_del_mediatime((GF_MediaTime *) desc);
return gf_odf_del_mediatime((GF_MediaTime *)desc);
case GF_ODF_MUXINFO_TAG:
return gf_odf_del_muxinfo((GF_MuxInfo *)desc);
@@ -201,6 +202,11 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
case GF_ODF_LANG_TAG:
return gf_odf_del_lang((GF_Language *)desc);
case GF_ODF_ESD_INC_TAG:
return gf_odf_del_esd_inc((GF_ES_ID_Inc *)desc);
case GF_ODF_ESD_REF_TAG:
return gf_odf_del_esd_ref((GF_ES_ID_Ref *)desc);
#ifndef GPAC_MINIMAL_ODF
case GF_ODF_CC_TAG:
@@ -211,10 +217,6 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
return gf_odf_del_cc_name((GF_CC_Name *)desc);
case GF_ODF_CI_TAG:
return gf_odf_del_ci((GF_CIDesc *)desc);
case GF_ODF_ESD_INC_TAG:
return gf_odf_del_esd_inc((GF_ES_ID_Inc *)desc);
case GF_ODF_ESD_REF_TAG:
return gf_odf_del_esd_ref((GF_ES_ID_Ref *)desc);
case GF_ODF_TEXT_TAG:
return gf_odf_del_exp_text((GF_ExpandedTextual *)desc);
case GF_ODF_EXT_PL_TAG:
@@ -269,18 +271,18 @@ GF_Err gf_odf_delete_descriptor(GF_Descriptor *desc)
GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSize)
{
switch (desc->tag) {
case GF_ODF_IOD_TAG :
case GF_ODF_IOD_TAG:
return gf_odf_read_iod(bs, (GF_InitialObjectDescriptor *)desc, DescSize);
case GF_ODF_ESD_TAG :
case GF_ODF_ESD_TAG:
return gf_odf_read_esd(bs, (GF_ESD *)desc, DescSize);
case GF_ODF_DCD_TAG :
case GF_ODF_DCD_TAG:
return gf_odf_read_dcd(bs, (GF_DecoderConfig *)desc, DescSize);
case GF_ODF_SLC_TAG :
case GF_ODF_SLC_TAG:
return gf_odf_read_slc(bs, (GF_SLConfig *)desc, DescSize);
case GF_ODF_OD_TAG:
return gf_odf_read_od(bs, (GF_ObjectDescriptor *)desc, DescSize);
//MP4 File Format
//MP4 File Format
case GF_ODF_ISOM_IOD_TAG:
return gf_odf_read_isom_iod(bs, (GF_IsomInitialObjectDescriptor *)desc, DescSize);
case GF_ODF_ISOM_OD_TAG:
@@ -291,11 +293,11 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
return gf_odf_read_esd_ref(bs, (GF_ES_ID_Ref *)desc, DescSize);
case GF_ODF_SEGMENT_TAG:
return gf_odf_read_segment(bs, (GF_Segment *) desc, DescSize);
return gf_odf_read_segment(bs, (GF_Segment *)desc, DescSize);
case GF_ODF_MEDIATIME_TAG:
return gf_odf_read_mediatime(bs, (GF_MediaTime *) desc, DescSize);
return gf_odf_read_mediatime(bs, (GF_MediaTime *)desc, DescSize);
case GF_ODF_MUXINFO_TAG:
return gf_odf_read_muxinfo(bs, (GF_MuxInfo *) desc, DescSize);
return gf_odf_read_muxinfo(bs, (GF_MuxInfo *)desc, DescSize);
case GF_ODF_AUX_VIDEO_DATA:
return gf_odf_read_auxvid(bs, (GF_AuxVideoDescriptor *)desc, DescSize);
@@ -344,14 +346,14 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
return gf_odf_read_smpte_camera(bs, (GF_SMPTECamera *)desc, DescSize);
case GF_ODF_SCI_TAG:
return gf_odf_read_sup_cid(bs, (GF_SCIDesc *)desc, DescSize);
case GF_ODF_IPMP_TL_TAG:
return gf_odf_read_ipmp_tool_list(bs, (GF_IPMP_ToolList *)desc, DescSize);
case GF_ODF_IPMP_TOOL_TAG:
return gf_odf_read_ipmp_tool(bs, (GF_IPMP_Tool *)desc, DescSize);
#endif /*GPAC_MINIMAL_ODF*/
//default:
//default:
case GF_ODF_DSI_TAG:
default:
return gf_odf_read_default(bs, (GF_DefaultDescriptor *)desc, DescSize);
@@ -368,14 +370,14 @@ GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSiz
//
GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
{
switch(desc->tag) {
case GF_ODF_IOD_TAG :
switch (desc->tag) {
case GF_ODF_IOD_TAG:
return gf_odf_size_iod((GF_InitialObjectDescriptor *)desc, outSize);
case GF_ODF_ESD_TAG :
case GF_ODF_ESD_TAG:
return gf_odf_size_esd((GF_ESD *)desc, outSize);
case GF_ODF_DCD_TAG :
case GF_ODF_DCD_TAG:
return gf_odf_size_dcd((GF_DecoderConfig *)desc, outSize);
case GF_ODF_SLC_TAG :
case GF_ODF_SLC_TAG:
return gf_odf_size_slc((GF_SLConfig *)desc, outSize);
case GF_ODF_OD_TAG:
@@ -390,12 +392,12 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
return gf_odf_size_esd_ref((GF_ES_ID_Ref *)desc, outSize);
case GF_ODF_SEGMENT_TAG:
return gf_odf_size_segment((GF_Segment *) desc, outSize);
return gf_odf_size_segment((GF_Segment *)desc, outSize);
case GF_ODF_MEDIATIME_TAG:
return gf_odf_size_mediatime((GF_MediaTime *) desc, outSize);
return gf_odf_size_mediatime((GF_MediaTime *)desc, outSize);
case GF_ODF_MUXINFO_TAG:
return gf_odf_size_muxinfo((GF_MuxInfo *) desc, outSize);
return gf_odf_size_muxinfo((GF_MuxInfo *)desc, outSize);
case GF_ODF_AUX_VIDEO_DATA:
return gf_odf_size_auxvid((GF_AuxVideoDescriptor *)desc, outSize);
@@ -452,7 +454,7 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
#endif /*GPAC_MINIMAL_ODF*/
default:
/*don't write out l descriptors*/
if ((desc->tag>=GF_ODF_MUXINFO_TAG) && (desc->tag<=GF_ODF_LASER_CFG_TAG)) {
if ((desc->tag >= GF_ODF_MUXINFO_TAG) && (desc->tag <= GF_ODF_LASER_CFG_TAG)) {
*outSize = 0;
return GF_OK;
}
@@ -467,14 +469,14 @@ GF_Err gf_odf_size_descriptor(GF_Descriptor *desc, u32 *outSize)
//
GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
{
switch(desc->tag) {
case GF_ODF_IOD_TAG :
switch (desc->tag) {
case GF_ODF_IOD_TAG:
return gf_odf_write_iod(bs, (GF_InitialObjectDescriptor *)desc);
case GF_ODF_ESD_TAG :
case GF_ODF_ESD_TAG:
return gf_odf_write_esd(bs, (GF_ESD *)desc);
case GF_ODF_DCD_TAG :
case GF_ODF_DCD_TAG:
return gf_odf_write_dcd(bs, (GF_DecoderConfig *)desc);
case GF_ODF_SLC_TAG :
case GF_ODF_SLC_TAG:
return gf_odf_write_slc(bs, (GF_SLConfig *)desc);
case GF_ODF_ESD_INC_TAG:
return gf_odf_write_esd_inc(bs, (GF_ES_ID_Inc *)desc);
@@ -489,11 +491,11 @@ GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
case GF_ODF_OD_TAG:
return gf_odf_write_od(bs, (GF_ObjectDescriptor *)desc);
case GF_ODF_SEGMENT_TAG:
return gf_odf_write_segment(bs, (GF_Segment *) desc);
return gf_odf_write_segment(bs, (GF_Segment *)desc);
case GF_ODF_MEDIATIME_TAG:
return gf_odf_write_mediatime(bs, (GF_MediaTime *) desc);
return gf_odf_write_mediatime(bs, (GF_MediaTime *)desc);
case GF_ODF_MUXINFO_TAG:
return gf_odf_write_muxinfo(bs, (GF_MuxInfo *) desc);
return gf_odf_write_muxinfo(bs, (GF_MuxInfo *)desc);
case GF_ODF_AUX_VIDEO_DATA:
return gf_odf_write_auxvid(bs, (GF_AuxVideoDescriptor *)desc);
@@ -550,7 +552,7 @@ GF_Err gf_odf_write_descriptor(GF_BitStream *bs, GF_Descriptor *desc)
#endif /*GPAC_MINIMAL_ODF*/
default:
/*don't write out internal descriptors*/
if ((desc->tag>=GF_ODF_MUXINFO_TAG) && (desc->tag<=GF_ODF_LASER_CFG_TAG))
if ((desc->tag >= GF_ODF_MUXINFO_TAG) && (desc->tag <= GF_ODF_LASER_CFG_TAG))
return GF_OK;
return gf_odf_write_default(bs, (GF_DefaultDescriptor *)desc);
}
@@ -572,7 +574,7 @@ GF_ODCom *gf_odf_create_command(u8 tag)
return gf_odf_new_esd_update();
case GF_ODF_ESD_REMOVE_TAG:
return gf_odf_new_esd_remove();
//special case for ESDRemove in the file format...
//special case for ESDRemove in the file format...
case GF_ODF_ESD_REMOVE_REF_TAG:
com = gf_odf_new_esd_remove();
if (!com) return com;
@@ -585,8 +587,8 @@ GF_ODCom *gf_odf_create_command(u8 tag)
return gf_odf_new_ipmp_remove();
default:
if ( (tag >= GF_ODF_COM_ISO_BEGIN_TAG) &&
( tag <= GF_ODF_COM_ISO_END_TAG) ) {
if ((tag >= GF_ODF_COM_ISO_BEGIN_TAG) &&
(tag <= GF_ODF_COM_ISO_END_TAG)) {
return NULL;
}
com = gf_odf_new_base_command();
@@ -642,7 +644,7 @@ GF_Err gf_odf_read_command(GF_BitStream *bs, GF_ODCom *com, u32 gf_odf_size_comm
case GF_ODF_IPMP_UPDATE_TAG:
return gf_odf_read_ipmp_update(bs, (GF_IPMPUpdate *)com, gf_odf_size_command);
case GF_ODF_IPMP_REMOVE_TAG:
return gf_odf_read_ipmp_remove(bs, (GF_IPMPRemove *)com, gf_odf_size_command);
return gf_odf_read_ipmp_remove(bs, (GF_IPMPRemove *)com, gf_odf_size_command);
default:
return gf_odf_read_base_command(bs, (GF_BaseODCom *)com, gf_odf_size_command);
}
@@ -697,7 +699,7 @@ GF_Err gf_odf_write_command(GF_BitStream *bs, GF_ODCom *com)
return gf_odf_write_ipmp_update(bs, (GF_IPMPUpdate *)com);
case GF_ODF_IPMP_REMOVE_TAG:
return gf_odf_write_ipmp_remove(bs, (GF_IPMPRemove *)com);
default:
return gf_odf_write_base_command(bs, (GF_BaseODCom *)com);
}

File diff suppressed because it is too large Load Diff

1426
src/gpacmp4/drm_sample.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / Authoring Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Authoring Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_PARSERS_AV_H_
#define _GF_PARSERS_AV_H_
@@ -30,211 +31,292 @@
extern "C" {
#endif
/*!
* \file <gpac/avparse.h>
* \brief Utility tools for audio and video raw media parsing.
*/
/*! \defgroup media_grp Media Tools
* You will find in this module the documentation of all media tools in GPAC.
*/
/*!
* \addtogroup avp_grp AV Parsing
* \ingroup media_grp
* \brief Utility tools for audio and video raw media parsing.
*
*This section documents the audio and video parsing functions of the GPAC framework.
* @{
*/
#include <gpac/bitstream.h>
/*basic MPEG (1,2,4) visual object parser (DSI extraction and timing/framing)*/
typedef struct
{
/*video PL*/
u8 VideoPL;
u8 RAP_stream, objectType, has_shape, enh_layer;
/*video resolution*/
u16 width, height;
/*pixel aspect ratio*/
u8 par_num, par_den;
u16 clock_rate;
u8 NumBitsTimeIncrement;
u32 time_increment;
/*for MPEG 1/2*/
Double fps;
} GF_M4VDecSpecInfo;
typedef struct __tag_m4v_parser GF_M4VParser;
/*!
Reduces input width/height to common aspect ration num/denum values
\param width width of the aspect ratio
\param height height of the aspect ratio
*/
void gf_media_reduce_aspect_ratio(u32 *width, u32 *height);
/*!
Reduces input FPS to a more compact value (eg 25000/1000 -> 25/1)
\param timescale timescale of the aspect ratio
\param sample_dur sample duration of the aspect ratio in the given timescale
*/
void gf_media_get_reduced_frame_rate(u32 *timescale, u32 *sample_dur);
/*basic MPEG (1,2,4) visual object parser (DSI extraction and timing/framing)*/
typedef struct
{
/*video PL*/
u8 VideoPL;
u8 RAP_stream, objectType, has_shape, enh_layer;
/*video resolution*/
u16 width, height;
/*pixel aspect ratio*/
u8 par_num, par_den;
u16 clock_rate;
u8 NumBitsTimeIncrement;
u32 time_increment;
/*for MPEG 1/2*/
Double fps;
u32 next_object_start;
} GF_M4VDecSpecInfo;
typedef struct __tag_m4v_parser GF_M4VParser;
#ifndef GPAC_DISABLE_AV_PARSERS
GF_M4VParser *gf_m4v_parser_new(char *data, u64 data_size, Bool mpeg12video);
GF_M4VParser *gf_m4v_parser_bs_new(GF_BitStream *bs, Bool mpeg12video);
void gf_m4v_parser_del(GF_M4VParser *m4v);
GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi);
GF_M4VParser *gf_m4v_parser_new(char *data, u64 data_size, Bool mpeg12video);
GF_M4VParser *gf_m4v_parser_bs_new(GF_BitStream *bs, Bool mpeg12video);
void gf_m4v_parser_del(GF_M4VParser *m4v);
GF_Err gf_m4v_parse_config(GF_M4VParser *m4v, GF_M4VDecSpecInfo *dsi);
/*get a frame (can contain GOP). The parser ALWAYS resync on the next object in the bitstream
thus you can seek the bitstream to copy the payload without re-seeking it */
GF_Err gf_m4v_parse_frame(GF_M4VParser *m4v, GF_M4VDecSpecInfo dsi, u8 *frame_type, u32 *time_inc, u64 *size, u64 *start, Bool *is_coded);
/*returns current object start in bitstream*/
u64 gf_m4v_get_object_start(GF_M4VParser *m4v);
/*returns 1 if current object is a valid MPEG-4 Visual object*/
Bool gf_m4v_is_valid_object_type(GF_M4VParser *m4v);
/*decodes DSI*/
GF_Err gf_m4v_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
/*rewrites PL code in DSI*/
void gf_m4v_rewrite_pl(char **io_dsi, u32 *io_dsi_len, u8 PL);
/*rewrites PAR code in DSI. Negative values will remove the par*/
GF_Err gf_m4v_rewrite_par(char **o_data, u32 *o_dataLen, s32 par_n, s32 par_d);
/*get a frame (can contain GOP). The parser ALWAYS resync on the next object in the bitstream
thus you can seek the bitstream to copy the payload without re-seeking it */
GF_Err gf_m4v_parse_frame(GF_M4VParser *m4v, GF_M4VDecSpecInfo dsi, u8 *frame_type, u32 *time_inc, u64 *size, u64 *start, Bool *is_coded);
/*returns current object start in bitstream*/
u64 gf_m4v_get_object_start(GF_M4VParser *m4v);
/*returns 1 if current object is a valid MPEG-4 Visual object*/
Bool gf_m4v_is_valid_object_type(GF_M4VParser *m4v);
/*decodes DSI/VOSHeader for MPEG4*/
GF_Err gf_m4v_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
/*decodes DSI/VOSHeader for MPEG12*/
GF_Err gf_mpegv12_get_config(char *rawdsi, u32 rawdsi_size, GF_M4VDecSpecInfo *dsi);
/*rewrites PL code in DSI*/
void gf_m4v_rewrite_pl(char **io_dsi, u32 *io_dsi_len, u8 PL);
/*rewrites PAR code in DSI. Negative values will remove the par*/
GF_Err gf_m4v_rewrite_par(char **o_data, u32 *o_dataLen, s32 par_n, s32 par_d);
#endif /*GPAC_DISABLE_AV_PARSERS*/
/*returns readable description of profile*/
const char *gf_m4v_get_profile_name(u8 video_pl);
/*returns readable description of profile*/
const char *gf_m4v_get_profile_name(u8 video_pl);
#ifndef GPAC_DISABLE_AV_PARSERS
s32 gf_mv12_next_start_code(unsigned char *pbuffer, u32 buflen, u32 *optr, u32 *scode);
s32 gf_mv12_next_slice_start(unsigned char *pbuffer, u32 startoffset, u32 buflen, u32 *slice_offset);
s32 gf_mv12_next_start_code(unsigned char *pbuffer, u32 buflen, u32 *optr, u32 *scode);
s32 gf_mv12_next_slice_start(unsigned char *pbuffer, u32 startoffset, u32 buflen, u32 *slice_offset);
#endif /* GPAC_DISABLE_AV_PARSERS*/
#ifndef GPAC_DISABLE_AV_PARSERS
/*MP3 tools*/
u8 gf_mp3_num_channels(u32 hdr);
u16 gf_mp3_sampling_rate(u32 hdr);
u16 gf_mp3_window_size(u32 hdr);
u32 gf_mp3_bit_rate(u32 hdr);
u8 gf_mp3_object_type_indication(u32 hdr);
u8 gf_mp3_layer(u32 hdr);
u16 gf_mp3_frame_size(u32 hdr);
u32 gf_mp3_get_next_header(FILE* in);
u32 gf_mp3_get_next_header_mem(const char *buffer, u32 size, u32 *pos);
/*MP3 tools*/
u8 gf_mp3_num_channels(u32 hdr);
u16 gf_mp3_sampling_rate(u32 hdr);
u16 gf_mp3_window_size(u32 hdr);
u32 gf_mp3_bit_rate(u32 hdr);
u8 gf_mp3_object_type_indication(u32 hdr);
u8 gf_mp3_layer(u32 hdr);
u16 gf_mp3_frame_size(u32 hdr);
u32 gf_mp3_get_next_header(FILE* in);
u32 gf_mp3_get_next_header_mem(const char *buffer, u32 size, u32 *pos);
#endif /*GPAC_DISABLE_AV_PARSERS*/
u8 gf_mp3_version(u32 hdr);
const char *gf_mp3_version_name(u32 hdr);
u8 gf_mp3_version(u32 hdr);
const char *gf_mp3_version_name(u32 hdr);
#if !defined(GPAC_DISABLE_AV_PARSERS) && !defined (GPAC_DISABLE_OGG)
/*vorbis tools*/
typedef struct
{
u32 sample_rate, channels, version;
s32 max_r, avg_r, low_r;
u32 min_block, max_block;
/*vorbis tools*/
typedef struct
{
u32 sample_rate, channels, version;
s32 max_r, avg_r, low_r;
u32 min_block, max_block;
/*do not touch, parser private*/
Bool is_init;
u32 modebits;
Bool mode_flag[64];
} GF_VorbisParser;
/*do not touch, parser private*/
Bool is_init;
u32 modebits;
Bool mode_flag[64];
} GF_VorbisParser;
/*call with vorbis header packets - you MUST initialize the structure to 0 before!!
returns 1 if success, 0 if error.*/
Bool gf_vorbis_parse_header(GF_VorbisParser *vp, char *data, u32 data_len);
/*returns 0 if init error or not a vorbis frame, otherwise returns the number of audio samples
in this frame*/
u32 gf_vorbis_check_frame(GF_VorbisParser *vp, char *data, u32 data_length);
/*call with vorbis header packets - you MUST initialize the structure to 0 before!!
returns 1 if success, 0 if error.*/
Bool gf_vorbis_parse_header(GF_VorbisParser *vp, char *data, u32 data_len);
/*returns 0 if init error or not a vorbis frame, otherwise returns the number of audio samples
in this frame*/
u32 gf_vorbis_check_frame(GF_VorbisParser *vp, char *data, u32 data_length);
#endif /*!defined(GPAC_DISABLE_AV_PARSERS) && !defined (GPAC_DISABLE_OGG)*/
enum
{
GF_M4A_AAC_MAIN = 1,
GF_M4A_AAC_LC = 2,
GF_M4A_AAC_SSR = 3,
GF_M4A_AAC_LTP = 4,
GF_M4A_AAC_SBR = 5,
GF_M4A_AAC_SCALABLE = 6,
GF_M4A_TWINVQ = 7,
GF_M4A_CELP = 8,
GF_M4A_HVXC = 9,
GF_M4A_TTSI = 12,
GF_M4A_MAIN_SYNTHETIC = 13,
GF_M4A_WAVETABLE_SYNTHESIS = 14,
GF_M4A_GENERAL_MIDI = 15,
GF_M4A_ALGO_SYNTH_AUDIO_FX = 16,
GF_M4A_ER_AAC_LC = 17,
GF_M4A_ER_AAC_LTP = 19,
GF_M4A_ER_AAC_SCALABLE = 20,
GF_M4A_ER_TWINVQ = 21,
GF_M4A_ER_BSAC = 22,
GF_M4A_ER_AAC_LD = 23,
GF_M4A_ER_CELP = 24,
GF_M4A_ER_HVXC = 25,
GF_M4A_ER_HILN = 26,
GF_M4A_ER_PARAMETRIC = 27,
GF_M4A_SSC = 28,
GF_M4A_AAC_PS = 29,
GF_M4A_LAYER1 = 32,
GF_M4A_LAYER2 = 33,
GF_M4A_LAYER3 = 34,
GF_M4A_DST = 35,
GF_M4A_ALS = 36
};
enum
{
GF_M4A_AAC_MAIN = 1,
GF_M4A_AAC_LC = 2,
GF_M4A_AAC_SSR = 3,
GF_M4A_AAC_LTP = 4,
GF_M4A_AAC_SBR = 5,
GF_M4A_AAC_SCALABLE = 6,
GF_M4A_TWINVQ = 7,
GF_M4A_CELP = 8,
GF_M4A_HVXC = 9,
GF_M4A_TTSI = 12,
GF_M4A_MAIN_SYNTHETIC = 13,
GF_M4A_WAVETABLE_SYNTHESIS = 14,
GF_M4A_GENERAL_MIDI = 15,
GF_M4A_ALGO_SYNTH_AUDIO_FX = 16,
GF_M4A_ER_AAC_LC = 17,
GF_M4A_ER_AAC_LTP = 19,
GF_M4A_ER_AAC_SCALABLE = 20,
GF_M4A_ER_TWINVQ = 21,
GF_M4A_ER_BSAC = 22,
GF_M4A_ER_AAC_LD = 23,
GF_M4A_ER_CELP = 24,
GF_M4A_ER_HVXC = 25,
GF_M4A_ER_HILN = 26,
GF_M4A_ER_PARAMETRIC = 27,
GF_M4A_SSC = 28,
GF_M4A_AAC_PS = 29,
GF_M4A_LAYER1 = 32,
GF_M4A_LAYER2 = 33,
GF_M4A_LAYER3 = 34,
GF_M4A_DST = 35,
GF_M4A_ALS = 36
};
#ifndef GPAC_DISABLE_AV_PARSERS
static const u32 GF_M4ASampleRates[] =
{
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
16000, 12000, 11025, 8000, 7350, 0, 0, 0
};
static const u32 GF_M4ASampleRates[] =
{
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
16000, 12000, 11025, 8000, 7350, 0, 0, 0
};
/*get Audio type from dsi. return audio codec type:*/
typedef struct
{
u32 nb_chan;
u32 base_object_type, base_sr, base_sr_index;
/*SBR*/
Bool has_sbr;
u32 sbr_object_type, sbr_sr, sbr_sr_index;
/*PS*/
Bool has_ps;
/*PL indication*/
u8 audioPL;
} GF_M4ADecSpecInfo;
/*parses dsi and updates audioPL*/
GF_Err gf_m4a_get_config(char *dsi, u32 dsi_size, GF_M4ADecSpecInfo *cfg);
/*gets audioPL for given cfg*/
u32 gf_m4a_get_profile(GF_M4ADecSpecInfo *cfg);
/*new values should now be defined in 23001-8*/
static const u32 GF_M4ANumChannels[] =
{
1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14
};
GF_Err gf_m4a_write_config(GF_M4ADecSpecInfo *cfg, char **dsi, u32 *dsi_size);
GF_Err gf_m4a_write_config_bs(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg);
GF_Err gf_m4a_parse_config(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg, Bool size_known);
/*returns channel config value (as written in AAC DSI) for the given number of channels*/
u32 gf_m4a_get_channel_cfg(u32 nb_chan);
/*get Audio type from dsi. return audio codec type:*/
typedef struct
{
u32 nb_chan;
u32 base_object_type, base_sr, base_sr_index;
/*SBR*/
Bool has_sbr;
u32 sbr_object_type, sbr_sr, sbr_sr_index;
/*PS*/
Bool has_ps;
/*PL indication*/
u8 audioPL;
/*program config element*/
Bool program_config_element_present, mono_mixdown_present, stereo_mixdown_present, matrix_mixdown_idx_present, pseudo_surround_enable;
u8 element_instance_tag, object_type, sampling_frequency_index, num_front_channel_elements, num_side_channel_elements, num_back_channel_elements, num_lfe_channel_elements, num_assoc_data_elements, num_valid_cc_elements;
u8 mono_mixdown_element_number, stereo_mixdown_element_number, matrix_mixdown_idx;
u8 front_element_is_cpe[15], front_element_tag_select[15];
u8 side_element_is_cpe[15], side_element_tag_select[15];
u8 back_element_is_cpe[15], back_element_tag_select[15];
u8 lfe_element_tag_select[15];
u8 assoc_data_element_tag_select[15];
u8 cc_element_is_ind_sw[15], valid_cc_element_tag_select[15];
u8 comment_field_bytes;
u8 comments[255];
} GF_M4ADecSpecInfo;
/*parses dsi and updates audioPL*/
GF_Err gf_m4a_get_config(char *dsi, u32 dsi_size, GF_M4ADecSpecInfo *cfg);
/*gets audioPL for given cfg*/
u32 gf_m4a_get_profile(GF_M4ADecSpecInfo *cfg);
GF_Err gf_m4a_write_config(GF_M4ADecSpecInfo *cfg, char **dsi, u32 *dsi_size);
GF_Err gf_m4a_write_config_bs(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg);
GF_Err gf_m4a_parse_config(GF_BitStream *bs, GF_M4ADecSpecInfo *cfg, Bool size_known);
#endif /*GPAC_DISABLE_AV_PARSERS*/
const char *gf_m4a_object_type_name(u32 objectType);
const char *gf_m4a_get_profile_name(u8 audio_pl);
const char *gf_m4a_object_type_name(u32 objectType);
const char *gf_m4a_get_profile_name(u8 audio_pl);
#ifndef GPAC_DISABLE_AV_PARSERS
typedef struct
{
u32 bitrate;
u32 sample_rate;
u32 framesize;
u32 channels;
/*only set if full parse*/
u8 fscod, bsid, bsmod, acmod, lfon, brcode;
} GF_AC3Header;
typedef struct
{
u32 bitrate;
u32 sample_rate;
u32 framesize;
u32 channels;
u16 substreams; //bit-mask, used for channel map > 5.1
/*only set if full parse*/
u8 fscod, bsid, bsmod, acmod, lfon, brcode;
} GF_AC3Header;
Bool gf_ac3_parser(u8 *buffer, u32 buffer_size, u32 *pos, GF_AC3Header *out_hdr, Bool full_parse);
Bool gf_ac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
u32 gf_ac3_get_channels(u32 acmod);
u32 gf_ac3_get_bitrate(u32 brcode);
Bool gf_ac3_parser(u8 *buffer, u32 buffer_size, u32 *pos, GF_AC3Header *out_hdr, Bool full_parse);
Bool gf_ac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
Bool gf_eac3_parser_bs(GF_BitStream *bs, GF_AC3Header *hdr, Bool full_parse);
u32 gf_ac3_get_channels(u32 acmod);
u32 gf_ac3_get_bitrate(u32 brcode);
GF_Err gf_avc_get_sps_info(char *sps, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
const char *gf_avc_get_profile_name(u8 video_prof);
GF_Err gf_avc_get_sps_info(char *sps, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
GF_Err gf_avc_get_pps_info(char *pps, u32 pps_size, u32 *pps_id, u32 *sps_id);
//hevc_state is optional but shall be used for layer extensions since all size info is in VPS and not SPS
GF_Err gf_hevc_get_sps_info(char *sps_data, u32 sps_size, u32 *sps_id, u32 *width, u32 *height, s32 *par_n, s32 *par_d);
#endif /*GPAC_DISABLE_AV_PARSERS*/
//get chroma format name from chroma format (1: 420, 2: 422, 3: 444
const char * gf_avc_hevc_get_chroma_format_name(u8 chroma_format);
/*get AVC profile name from profile indication*/
const char *gf_avc_get_profile_name(u8 profile_idc);
/*returns true if given profile is in range extensions*/
Bool gf_avc_is_rext_profile(u8 profile_idc);
/*get HEVC profile name from profile indication*/
const char *gf_hevc_get_profile_name(u8 profile_idc);
/*gets image size (bs must contain the whole image)
@OTI: image type (JPEG=0x6C, PNG=0x6D)
@width, height: image resolution - for jpeg max size if thumbnail included*/
void gf_img_parse(GF_BitStream *bs, u8 *OTI, u32 *mtype, u32 *width, u32 *height, char **dsi, u32 *dsi_len);
/*gets image size (bs must contain the whole image)
@OTI: image type (JPEG=0x6C, PNG=0x6D)
@width, height: image resolution - for jpeg max size if thumbnail included*/
void gf_img_parse(GF_BitStream *bs, u8 *OTI, u32 *mtype, u32 *width, u32 *height, char **dsi, u32 *dsi_len);
GF_Err gf_img_jpeg_dec(char *jpg, u32 jpg_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size, u32 dst_nb_comp);
GF_Err gf_img_jpeg_dec(char *jpg, u32 jpg_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size, u32 dst_nb_comp);
GF_Err gf_img_png_dec(char *png, u32 png_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size);
GF_Err gf_img_file_dec(char *png_file, u32 *oti, u32 *width, u32 *height, u32 *pixel_format, char **dst, u32 *dst_size);
GF_Err gf_img_png_enc(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst, u32 *dst_size);
GF_Err gf_img_png_dec(char *png, u32 png_size, u32 *width, u32 *height, u32 *pixel_format, char *dst, u32 *dst_size);
GF_Err gf_img_file_dec(char *png_file, u32 *oti, u32 *width, u32 *height, u32 *pixel_format, char **dst, u32 *dst_size);
GF_Err gf_img_png_enc(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst, u32 *dst_size);
GF_Err gf_img_png_enc_file(char *data, u32 width, u32 height, s32 stride, u32 pixel_format, char *dst_file);
/*! @} */
#ifdef __cplusplus
}

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_BASE_CODING_H_
#define _GF_BASE_CODING_H_
@@ -29,77 +30,79 @@
extern "C" {
#endif
/*!
* \file <gpac/base_coding.h>
* \brief Base coding functions.
*/
/*!
* \file <gpac/base_coding.h>
* \brief Base 16 and 64 coding.
*/
/*!
* \addtogroup bascod_grp base coding
* \ingroup utils_grp
* \brief Base Coding functions
*
* This section documents the base encoding and decoding functions of the GPAC framework.
* @{
*/
/*!
* \addtogroup bascod_grp Base coding
* \ingroup utils_grp
* \brief Base 16 and 64 coding
*
* This section documents the base encoding and decoding functions of the GPAC framework.
* @{
*/
#include <gpac/tools.h>
/*!
*\brief base64 encoder
*
*Encodes a data buffer to Base64
*\param in_buffer input data buffer
*\param in_buffer_size input data buffer size
*\param out_buffer output Base64 buffer location
*\param out_buffer_size output Base64 buffer allocated size
*\return size of the encoded Base64 buffer
*\note the encoded data buffer is not NULL-terminated.
*/
u32 gf_base64_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*!
*\brief base64 decoder
*
*Decodes a Base64 buffer to data
*\param in_buffer input Base64 buffer
*\param in_buffer_size input Base64 buffer size
*\param out_buffer output data buffer location
*\param out_buffer_size output data buffer allocated size
*\return size of the decoded buffer
*/
u32 gf_base64_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
#ifndef GPAC_DISABLE_CORE_TOOLS
/*!
*\brief base16 encoder
*
*Encodes a data buffer to Base16
*\param in_buffer input data buffer
*\param in_buffer_size input data buffer size
*\param out_buffer output Base16 buffer location
*\param out_buffer_size output Base16 buffer allocated size
*\return size of the encoded Base16 buffer
*\note the encoded data buffer is not NULL-terminated.
*/
u32 gf_base16_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*!
*\brief base64 encoder
*
*Encodes a data buffer to Base64
*\param in_buffer input data buffer
*\param in_buffer_size input data buffer size
*\param out_buffer output Base64 buffer location
*\param out_buffer_size output Base64 buffer allocated size
*\return size of the encoded Base64 buffer
*\note the encoded data buffer is not NULL-terminated.
*/
u32 gf_base64_encode(const char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*!
*\brief base64 decoder
*
*Decodes a Base64 buffer to data
*\param in_buffer input Base64 buffer
*\param in_buffer_size input Base64 buffer size
*\param out_buffer output data buffer location
*\param out_buffer_size output data buffer allocated size
*\return size of the decoded buffer
*/
u32 gf_base64_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*!
*\brief base16 decoder
*
*Decodes a Base16 buffer to data
*\param in_buffer input Base16 buffer
*\param in_buffer_size input Base16 buffer size
*\param out_buffer output data buffer location
*\param out_buffer_size output data buffer allocated size
*\return size of the decoded buffer
*/
u32 gf_base16_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*!
*\brief base16 encoder
*
*Encodes a data buffer to Base16
*\param in_buffer input data buffer
*\param in_buffer_size input data buffer size
*\param out_buffer output Base16 buffer location
*\param out_buffer_size output Base16 buffer allocated size
*\return size of the encoded Base16 buffer
*\note the encoded data buffer is not NULL-terminated.
*/
u32 gf_base16_encode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*! @} */
/*!
*\brief base16 decoder
*
*Decodes a Base16 buffer to data
*\param in_buffer input Base16 buffer
*\param in_buffer_size input Base16 buffer size
*\param out_buffer output data buffer location
*\param out_buffer_size output data buffer allocated size
*\return size of the decoded buffer
*/
u32 gf_base16_decode(char *in_buffer, u32 in_buffer_size, char *out_buffer, u32 out_buffer_size);
/*! @} */
#ifdef __cplusplus
}
#endif
#endif /*GPAC_DISABLE_CORE_TOOLS*/
#endif /*_GF_BASE_CODING_H_*/

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) Jean Le Feuvre 2000-2005
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_BITSTREAM_H_
#define _GF_BITSTREAM_H_
@@ -29,436 +30,504 @@
extern "C" {
#endif
/*!
* \file <gpac/bitstream.h>
* \brief bitstream functions.
*/
/*!
* \file <gpac/bitstream.h>
* \brief bitstream reading and writing.
*/
/*!
* \addtogroup bs_grp bitstream
* \ingroup utils_grp
* \brief BitStream object
*
* This section documents the bitstream object of the GPAC framework.
* \note Unless specified, all functions assume Big-Endian ordering of data in the bitstream.
* @{
*/
/*!
* \addtogroup bs_grp Bitstream
* \ingroup utils_grp
* \brief BitStream object
*
* This section documents the bitstream object of the GPAC framework.
* \note Unless specified, all functions assume Big-Endian ordering of data in the bitstream.
* @{
*/
#include <gpac/tools.h>
enum
{
GF_BITSTREAM_READ = 0,
GF_BITSTREAM_WRITE
};
enum
{
GF_BITSTREAM_READ = 0,
GF_BITSTREAM_WRITE
};
typedef struct __tag_bitstream GF_BitStream;
typedef struct __tag_bitstream GF_BitStream;
/*!
* \brief bitstream constructor
*
* Constructs a bitstream from a buffer (read or write mode)
* \param buffer buffer to read or write. In WRITE mode, this can be NULL to let the bitstream object dynamically allocate memory, in which case the size param is ignored.
* \param size size of the buffer given.
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
* \return new bitstream object
* \note In write mode on an existing data buffer, data overflow is never signaled but simply ignored, it is the caller responsability to ensure it
* does not write more than possible.
*/
GF_BitStream *gf_bs_new(const char *buffer, u64 size, u32 mode);
/*!
* \brief bitstream constructor from file handle
*
* Creates a bitstream from a file handle.
* \param f handle of the file to use. This handle must be created with binary mode.
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
* \return new bitstream object
* \note - You have to open your file in the appropriated mode:\n
* - GF_BITSTREAM_READ: bitstream is constructed for reading\n
* - GF_BITSTREAM_WRITE: bitstream is constructed for writing\n
* \note - you may use any of these modes for a file with read/write access.
* \warning RESULTS ARE UNEXPECTED IF YOU TOUCH THE FILE WHILE USING THE BITSTREAM.
*/
GF_BitStream *gf_bs_from_file(FILE *f, u32 mode);
/*!
* \brief bitstream constructor from file handle
*
* Deletes the bitstream object. If the buffer was created by the bitstream, it is deleted if still present.
*/
void gf_bs_del(GF_BitStream *bs);
/*!
* \brief bitstream constructor
*
* Constructs a bitstream from a buffer (read or write mode)
* \param buffer buffer to read or write. In WRITE mode, this can be NULL to let the bitstream object dynamically allocate memory, in which case the size param is ignored.
* \param size size of the buffer given.
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
* \return new bitstream object
* \note In write mode on an existing data buffer, data overflow is never signaled but simply ignored, it is the caller responsability to ensure it
* does not write more than possible.
*/
GF_BitStream *gf_bs_new(const char *buffer, u64 size, u32 mode);
/*!
* \brief bitstream constructor from file handle
*
* Creates a bitstream from a file handle.
* \param f handle of the file to use. This handle must be created with binary mode.
* \param mode operation mode for this bitstream: GF_BITSTREAM_READ for read, GF_BITSTREAM_WRITE for write.
* \return new bitstream object
* \note - You have to open your file in the appropriated mode:\n
* - GF_BITSTREAM_READ: bitstream is constructed for reading\n
* - GF_BITSTREAM_WRITE: bitstream is constructed for writing\n
* \note - you may use any of these modes for a file with read/write access.
* \warning RESULTS ARE UNEXPECTED IF YOU TOUCH THE FILE WHILE USING THE BITSTREAM.
*/
GF_BitStream *gf_bs_from_file(FILE *f, u32 mode);
/*!
* \brief bitstream constructor from file handle
*
* Deletes the bitstream object. If the buffer was created by the bitstream, it is deleted if still present.
*/
void gf_bs_del(GF_BitStream *bs);
/*!
* \brief integer reading
*
* Reads an integer coded on a number of bit.
* \param bs the target bitstream
* \param nBits the number of bits to read
* \return the integer value read.
*/
u32 gf_bs_read_int(GF_BitStream *bs, u32 nBits);
/*!
* \brief large integer reading
*
* Reads a large integer coded on a number of bit bigger than 32.
* \param bs the target bitstream
* \param nBits the number of bits to read
* \return the large integer value read.
*/
u64 gf_bs_read_long_int(GF_BitStream *bs, u32 nBits);
/*!
* \brief float reading
*
* Reads a float coded as IEEE 32 bit format.
* \param bs the target bitstream
* \return the float value read.
*/
Float gf_bs_read_float(GF_BitStream *bs);
/*!
* \brief double reading
*
* Reads a double coded as IEEE 64 bit format.
* \param bs the target bitstream
* \return the double value read.
*/
Double gf_bs_read_double(GF_BitStream *bs);
/*!
* \brief data reading
*
* Reads a data buffer
* \param bs the target bitstream
* \param data the data buffer to be filled
* \param nbBytes the amount of bytes to read
* \return the number of bytes actually read.
* \warning the data buffer passed must be large enough to hold the desired amount of bytes.
*/
u32 gf_bs_read_data(GF_BitStream *bs, char *data, u32 nbBytes);
/*!
* \brief align char reading
*
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the char value read.
*/
u32 gf_bs_read_u8(GF_BitStream *bs);
/*!
* \brief align short reading
*
* Reads an integer coded on 16 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the short value read.
*/
u32 gf_bs_read_u16(GF_BitStream *bs);
/*!
* \brief align 24-bit integer reading
*
* Reads an integer coded on 24 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u24(GF_BitStream *bs);
/*!
* \brief align integer reading
*
* Reads an integer coded on 32 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u32(GF_BitStream *bs);
/*!
* \brief align large integer reading
*
* Reads an integer coded on 64 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the large integer value read.
*/
u64 gf_bs_read_u64(GF_BitStream *bs);
/*!
* \brief little endian integer reading
*
* Reads an integer coded on 32 bits in little-endian order.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u32_le(GF_BitStream *bs);
/*!
* \brief little endian integer reading
*
* Reads an integer coded on 16 bits in little-endian order.
* \param bs the target bitstream
* \return the integer value read.
*/
u16 gf_bs_read_u16_le(GF_BitStream *bs);
/*!
* \brief sets bitstream write cache size
*
* Sets the write cache size for file-based bitstreams.
* \param bs the target bitstream
* \param size size of the write cache in bytes
* \return error if any.
*/
GF_Err gf_bs_set_output_buffering(GF_BitStream *bs, u32 size);
/*!
* \brief variable length integer reading
*
* Reads an integer coded on a variable number of 4-bits chunks. The number of chunks is given by the number of non-0 bits at the begining.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_vluimsbf5(GF_BitStream *bs);
/*!
* \brief gets bitstream write cache size
*
* Gets the write cache size for file-based bitstreams.
* \param bs the target bitstream
* \return size of the write cache in bytes, 0 if no cache
*/
u32 gf_bs_get_output_buffering(GF_BitStream *bs);
/*!
* \brief bit position
*
* Returns current bit position in the bitstream - only works in memory mode.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_get_bit_offset(GF_BitStream *bs);
/*!
* \brief integer reading
*
* Reads an integer coded on a number of bit.
* \param bs the target bitstream
* \param nBits the number of bits to read
* \return the integer value read.
*/
u32 gf_bs_read_int(GF_BitStream *bs, u32 nBits);
/*!
* \brief large integer reading
*
* Reads a large integer coded on a number of bit bigger than 32.
* \param bs the target bitstream
* \param nBits the number of bits to read
* \return the large integer value read.
*/
u64 gf_bs_read_long_int(GF_BitStream *bs, u32 nBits);
/*!
* \brief float reading
*
* Reads a float coded as IEEE 32 bit format.
* \param bs the target bitstream
* \return the float value read.
*/
Float gf_bs_read_float(GF_BitStream *bs);
/*!
* \brief double reading
*
* Reads a double coded as IEEE 64 bit format.
* \param bs the target bitstream
* \return the double value read.
*/
Double gf_bs_read_double(GF_BitStream *bs);
/*!
* \brief data reading
*
* Reads a data buffer
* \param bs the target bitstream
* \param data the data buffer to be filled
* \param nbBytes the amount of bytes to read
* \return the number of bytes actually read.
* \warning the data buffer passed must be large enough to hold the desired amount of bytes.
*/
u32 gf_bs_read_data(GF_BitStream *bs, char *data, u32 nbBytes);
/*!
* \brief current bit position
*
* Returns bit position in the current byte of the bitstream - only works in memory mode.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_get_bit_position(GF_BitStream *bs);
/*!
* \brief align char reading
*
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the char value read.
*/
u32 gf_bs_read_u8(GF_BitStream *bs);
/*!
* \brief align char reading until reaching the given value
*
* Reads an integer coded on 8 bits starting at a byte boundary in the bitstream until
* the given appears on the bitstream.
* \note the bytes read in the bitstream will only be update if the delimiter is found
* \param bs the target bitstream
* \param delimiter the stop condition
* \param out the resulting value
* \param max_length the maximum length of the output
* \return the number of value read.
*/
u32 gf_bs_read_u8_until_delimiter(GF_BitStream *bs, u8 delimiter, u8* out, u32 max_length);
/*!
* \brief align short reading
*
* Reads an integer coded on 16 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the short value read.
*/
u32 gf_bs_read_u16(GF_BitStream *bs);
/*!
* \brief align 24-bit integer reading
*
* Reads an integer coded on 24 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u24(GF_BitStream *bs);
/*!
* \brief align integer reading
*
* Reads an integer coded on 32 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u32(GF_BitStream *bs);
/*!
* \brief align large integer reading
*
* Reads an integer coded on 64 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \return the large integer value read.
*/
u64 gf_bs_read_u64(GF_BitStream *bs);
/*!
* \brief little endian integer reading
*
* Reads an integer coded on 32 bits in little-endian order.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_u32_le(GF_BitStream *bs);
/*!
* \brief little endian integer reading
*
* Reads an integer coded on 16 bits in little-endian order.
* \param bs the target bitstream
* \return the integer value read.
*/
u16 gf_bs_read_u16_le(GF_BitStream *bs);
/*!
* \brief integer writing
*
* Writes an integer on a given number of bits.
* \param bs the target bitstream
* \param value the integer to write
* \param nBits number of bits used to code the integer
*/
void gf_bs_write_int(GF_BitStream *bs, s32 value, s32 nBits);
/*!
* \brief large integer writing
*
* Writes an integer on a given number of bits greater than 32.
* \param bs the target bitstream
* \param value the large integer to write
* \param nBits number of bits used to code the integer
*/
void gf_bs_write_long_int(GF_BitStream *bs, s64 value, s32 nBits);
/*!
* \brief float writing
*
* Writes a float in IEEE 32 bits format.
* \param bs the target bitstream
* \param value the float to write
*/
void gf_bs_write_float(GF_BitStream *bs, Float value);
/*!
* \brief double writing
*
* Writes a double in IEEE 64 bits format.
* \param bs the target bitstream
* \param value the double to write
*/
void gf_bs_write_double(GF_BitStream *bs, Double value);
/*!
* \brief data writing
*
* Writes a data buffer.
* \param bs the target bitstream
* \param data the data to write
* \param nbBytes number of data bytes to write
*/
u32 gf_bs_write_data(GF_BitStream *bs, const char *data, u32 nbBytes);
/*!
* \brief variable length integer reading
*
* Reads an integer coded on a variable number of 4-bits chunks. The number of chunks is given by the number of non-0 bits at the beginning.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_read_vluimsbf5(GF_BitStream *bs);
/*!
* \brief align char writing
*
* Writes an integer on 8 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the char value to write
*/
void gf_bs_write_u8(GF_BitStream *bs, u32 value);
/*!
* \brief align short writing
*
* Writes an integer on 16 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the short value to write
*/
void gf_bs_write_u16(GF_BitStream *bs, u32 value);
/*!
* \brief align 24-bits integer writing
*
* Writes an integer on 24 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u24(GF_BitStream *bs, u32 value);
/*!
* \brief align integer writing
*
* Writes an integer on 32 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u32(GF_BitStream *bs, u32 value);
/*!
* \brief align large integer writing
*
* Writes an integer on 64 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the large integer value to write
*/
void gf_bs_write_u64(GF_BitStream *bs, u64 value);
/*!
* \brief little endian integer writing
*
* Writes an integer on 32 bits in little-endian order.
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u32_le(GF_BitStream *bs, u32 value);
/*!
* \brief little endian short writing
*
* Writes an integer on 16 bits in little-endian order.
* \param bs the target bitstream
* \param value the short value to write
*/
void gf_bs_write_u16_le(GF_BitStream *bs, u32 value);
/*!
* \brief bit position
*
* Returns current bit position in the bitstream - only works in memory mode.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_get_bit_offset(GF_BitStream *bs);
/*!
* \brief write byte multiple times
*
* Writes a give byte multiple times.
* \param bs the target bitstream
* \param byte the byte value to write
* \param count the number of times the byte should be written
* \return the number of bytes written
*/
u32 gf_bs_write_byte(GF_BitStream *bs, u8 byte, u32 count);
/*!
* \brief current bit position
*
* Returns bit position in the current byte of the bitstream - only works in memory mode.
* \param bs the target bitstream
* \return the integer value read.
*/
u32 gf_bs_get_bit_position(GF_BitStream *bs);
/*!
* \brief end of bitstream management
*
* Assigns a notification callback function for end of stream signaling in read mode
* \param bs the target bitstream
* \param EndOfStream the notification function to use
* \param par opaque user data passed to the bitstream
*/
void gf_bs_set_eos_callback(GF_BitStream *bs, void (*EndOfStream)(void *par), void *par);
/*!
* \brief bitstream alignment
*
* Aligns bitstream to next byte boundary. In write mode, this will write 0 bit values until alignment.
* \param bs the target bitstream
* \return the number of bits read/written until alignment
*/
u8 gf_bs_align(GF_BitStream *bs);
/*!
* \brief capacity query
*
* Returns the number of bytes still available in the bitstream in read mode.
* \param bs the target bitstream
* \return the number of bytes still available in read mode, -1 in write modes.
*/
u64 gf_bs_available(GF_BitStream *bs);
/*!
* \brief buffer fetching
*
* Fetches the internal bitstream buffer in write mode. If a buffer was given at the bitstream construction, or if the bitstream is in read mode, this does nothing.
* \param bs the target bitstream
* \param output address of a memory block to be allocated for bitstream data.
* \param outSize set to the size of the allocated memory block.
* \note
/*!
* \brief integer writing
*
* Writes an integer on a given number of bits.
* \param bs the target bitstream
* \param value the integer to write
* \param nBits number of bits used to code the integer
*/
void gf_bs_write_int(GF_BitStream *bs, s32 value, s32 nBits);
/*!
* \brief large integer writing
*
* Writes an integer on a given number of bits greater than 32.
* \param bs the target bitstream
* \param value the large integer to write
* \param nBits number of bits used to code the integer
*/
void gf_bs_write_long_int(GF_BitStream *bs, s64 value, s32 nBits);
/*!
* \brief float writing
*
* Writes a float in IEEE 32 bits format.
* \param bs the target bitstream
* \param value the float to write
*/
void gf_bs_write_float(GF_BitStream *bs, Float value);
/*!
* \brief double writing
*
* Writes a double in IEEE 64 bits format.
* \param bs the target bitstream
* \param value the double to write
*/
void gf_bs_write_double(GF_BitStream *bs, Double value);
/*!
* \brief data writing
*
* Writes a data buffer.
* \param bs the target bitstream
* \param data the data to write
* \param nbBytes number of data bytes to write
*/
u32 gf_bs_write_data(GF_BitStream *bs, const char *data, u32 nbBytes);
/*!
* \brief align char writing
*
* Writes an integer on 8 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the char value to write
*/
void gf_bs_write_u8(GF_BitStream *bs, u32 value);
/*!
* \brief align short writing
*
* Writes an integer on 16 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the short value to write
*/
void gf_bs_write_u16(GF_BitStream *bs, u32 value);
/*!
* \brief align 24-bits integer writing
*
* Writes an integer on 24 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u24(GF_BitStream *bs, u32 value);
/*!
* \brief align integer writing
*
* Writes an integer on 32 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u32(GF_BitStream *bs, u32 value);
/*!
* \brief align large integer writing
*
* Writes an integer on 64 bits starting at a byte boundary in the bitstream.
* \warning you must not use this function if the bitstream is not aligned
* \param bs the target bitstream
* \param value the large integer value to write
*/
void gf_bs_write_u64(GF_BitStream *bs, u64 value);
/*!
* \brief little endian integer writing
*
* Writes an integer on 32 bits in little-endian order.
* \param bs the target bitstream
* \param value the integer value to write
*/
void gf_bs_write_u32_le(GF_BitStream *bs, u32 value);
/*!
* \brief little endian short writing
*
* Writes an integer on 16 bits in little-endian order.
* \param bs the target bitstream
* \param value the short value to write
*/
void gf_bs_write_u16_le(GF_BitStream *bs, u32 value);
/*!
* \brief write byte multiple times
*
* Writes a give byte multiple times.
* \param bs the target bitstream
* \param byte the byte value to write
* \param count the number of times the byte should be written
* \return the number of bytes written
*/
u32 gf_bs_write_byte(GF_BitStream *bs, u8 byte, u32 count);
/*!
* \brief end of bitstream management
*
* Assigns a notification callback function for end of stream signaling in read mode
* \param bs the target bitstream
* \param EndOfStream the notification function to use
* \param par opaque user data passed to the bitstream
*/
void gf_bs_set_eos_callback(GF_BitStream *bs, void(*EndOfStream)(void *par), void *par);
/*!
* \brief bitstream alignment
*
* Aligns bitstream to next byte boundary. In write mode, this will write 0 bit values until alignment.
* \param bs the target bitstream
* \return the number of bits read/written until alignment
*/
u8 gf_bs_align(GF_BitStream *bs);
/*!
* \brief capacity query
*
* Returns the number of bytes still available in the bitstream in read mode.
* \param bs the target bitstream
* \return the number of bytes still available in read mode, -1 in write modes.
*/
u64 gf_bs_available(GF_BitStream *bs);
/*!
* \brief buffer fetching
*
* Fetches the internal bitstream buffer in write mode. If a buffer was given at the bitstream construction, or if the bitstream is in read mode, this does nothing.
* \param bs the target bitstream
* \param output address of a memory block to be allocated for bitstream data.
* \param outSize set to the size of the allocated memory block.
* \note
* It is the user responsability to destroy the allocated buffer
* Once this function has been called, the internal bitstream buffer is reseted.
*/
void gf_bs_get_content(GF_BitStream *bs, char **output, u32 *outSize);
/*!
* \brief byte skipping
*
* Skips bytes in the bitstream. In Write mode, this will write the 0 integer value for memory-based bitstreams or seek the stream
for file-based bitstream.
* \param bs the target bitstream
* \param nbBytes the number of bytes to skip
*/
void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes);
*/
void gf_bs_get_content(GF_BitStream *bs, char **output, u32 *outSize);
/*!
* \brief byte skipping
*
* Skips bytes in the bitstream. In Write mode, this will write the 0 integer value for memory-based bitstreams or seek the stream
for file-based bitstream.
* \param bs the target bitstream
* \param nbBytes the number of bytes to skip
*/
void gf_bs_skip_bytes(GF_BitStream *bs, u64 nbBytes);
/*!
*\brief bitstream seeking
*
*Seeks the bitstream to a given offset after the begining of the stream. This will perform alignment of the bitstream in all modes.
*\warning Results are unpredictable if seeking beyond the bitstream end is performed.
*\param bs the target bitstream
*\param offset buffer/file offset to seek to
*/
GF_Err gf_bs_seek(GF_BitStream *bs, u64 offset);
/*!
*\brief bitstream seeking
*
*Seeks the bitstream to a given offset after the beginning of the stream. This will perform alignment of the bitstream in all modes.
*\warning Results are unpredictable if seeking beyond the bitstream end is performed.
*\param bs the target bitstream
*\param offset buffer/file offset to seek to
*/
GF_Err gf_bs_seek(GF_BitStream *bs, u64 offset);
/*!
*\brief bitstream truncation
*
*Truncates the bitstream at the current position
*\param bs the target bitstream
*/
void gf_bs_truncate(GF_BitStream *bs);
/*!
*\brief bitstream truncation
*
*Truncates the bitstream at the current position
*\param bs the target bitstream
*/
void gf_bs_truncate(GF_BitStream *bs);
/*!
*\brief bit peeking
*
*Peeks a given number of bits (read without moving the position indicator) for read modes only.
*\param bs the target bitstream
*\param numBits the number of bits to peek
*\param byte_offset
/*!
*\brief bit peeking
*
*Peeks a given number of bits (read without moving the position indicator) for read modes only.
*\param bs the target bitstream
*\param numBits the number of bits to peek
*\param byte_offset
* if set, bitstream is aligned and moved from byte_offset before peeking (byte-aligned picking)
* otherwise, bitstream is not aligned and bits are peeked from current state
*\return the integer value read
*/
u32 gf_bs_peek_bits(GF_BitStream *bs, u32 numBits, u32 byte_offset);
*\return the integer value read
*/
u32 gf_bs_peek_bits(GF_BitStream *bs, u32 numBits, u64 byte_offset);
/*!
*\brief bit reservoir query
*
* Queries the number of bits available in read mode.
*\param bs the target bitstream
*\return number of available bits if position is in the last byte of the buffer/stream, 8 otherwise
*/
u8 gf_bs_bits_available(GF_BitStream *bs);
/*!
*\brief position query
*
*Returns the reading/writting position in the buffer/file.
*\param bs the target bitstream
*\return the read/write position of the bitstream
*/
u64 gf_bs_get_position(GF_BitStream *bs);
/*!
*\brief size query
*
*Returns the size of the associated buffer/file.
*\param bs the target bitstream
*\return the size of the bitstream
*/
u64 gf_bs_get_size(GF_BitStream *bs);
/*!
*\brief file-based size query
*
*Returns the size of a file-based bitstream and force a seek to end of file. This is used in case the file handle
*describes a file being constructed on disk while being read?
*
*\param bs the target bitstream
*\return the disk size of the associated file
*/
u64 gf_bs_get_refreshed_size(GF_BitStream *bs);
/*!
*\brief bit reservoir query
*
* Queries the number of bits available in read mode.
*\param bs the target bitstream
*\return number of available bits if position is in the last byte of the buffer/stream, 8 otherwise
*/
u8 gf_bs_bits_available(GF_BitStream *bs);
/*!
*\brief position query
*
*Returns the reading/writting position in the buffer/file.
*\param bs the target bitstream
*\return the read/write position of the bitstream
*/
u64 gf_bs_get_position(GF_BitStream *bs);
/*!
*\brief size query
*
*Returns the size of the associated buffer/file.
*\param bs the target bitstream
*\return the size of the bitstream
*/
u64 gf_bs_get_size(GF_BitStream *bs);
/*!
*\brief file-based size query
*
*Returns the size of a file-based bitstream and force a seek to end of file. This is used in case the file handle
*describes a file being constructed on disk while being read?
*
*\param bs the target bitstream
*\return the disk size of the associated file
*/
u64 gf_bs_get_refreshed_size(GF_BitStream *bs);
/*!
*\brief transfer content from source bitstream to destination bitstream
*
*Returns the size of the associated buffer/file.
*\param dst the target bitstream
*\param src the source bitstream. This bitstream is empty after calling teh function
*\return error if any
*/
GF_Err gf_bs_transfer(GF_BitStream *dst, GF_BitStream *src);
/*! @} */
/*!
*\brief Flushes bitstream contet to disk
*
*Flushes bitstream contet to disk
*\param bs the target bitstream
*/
void gf_bs_flush(GF_BitStream *bs);
/*!
*\brief Reassigns FILE object for stream-based bitstreams
*
*Reassigns FILE object for stream-based bitstreams. Automatically sets the stream position to the bitstream position
*\param bs the target bitstream
*\param stream the new stream to assign
*/
void gf_bs_reassign(GF_BitStream *bs, FILE *stream);
/*! @} */
#ifdef __cplusplus
}

View File

@@ -0,0 +1,235 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / common tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_CONFIG_FILE_H_
#define _GF_CONFIG_FILE_H_
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \file <gpac/config_file.h>
* \brief configuration file.
*/
/*!
* \addtogroup cfg_grp Configuration File
* \ingroup utils_grp
* \brief Configuration File object
*
* This section documents the configuration file object of the GPAC framework.
* This file is formatted as the INI file mode of WIN32 in sections and keys.\n
*\note For more information on the GPAC configuration file itself, please refer to the GPAC configuration help provided with GPAC.
* @{
*/
#include <gpac/tools.h>
typedef struct __tag_config GF_Config;
/*!
* \brief configuration file initialization
*
* Constructs a configuration file from fileName. If fileName is NULL, the default GPAC configuration file is loaded with the
* proper module directory, font directory and other default options. If fileName is non-NULL no configuration file is found,
* a "light" default configuration file is created.
*\param file name of the configuration file, or NULL for default file
*\param new_cfg Boolean set to true if a new configuration file has been created
*\return the configuration file object, NULL if the file could not be created
*/
GF_Config *gf_cfg_init(const char *file, Bool *new_cfg);
/*!
* \brief configuration file constructor
*
* Constructs a configuration file.
*\param filePath directory the file is located in
*\param fileName name of the configuration file
*\return the configuration file object, NULL if the file does not exist
*/
GF_Config *gf_cfg_new(const char *filePath, const char *fileName);
/*!
* \brief alternative configuration file constructor
*
* Constructs a configuration file. If file does not exist, configuration will be still created
*\param filePath directory the file is located in
*\param fileName name of the configuration file
*\return the configuration file object, never NULL, even if file does not exist
*/
GF_Config *gf_cfg_force_new(const char *filePath, const char *fileName);
/*!
* \brief configuration file destructor
*
*Destroys the configuration file and saves it if needed.
*\param cfgFile the target configuration file
*/
void gf_cfg_del(GF_Config *cfgFile);
/*!
* \brief configuration file destructor
*
*Destroys the configuration file and removes the file from disk.
*\param cfgFile the target configuration file
*/
void gf_cfg_remove(GF_Config *cfgFile);
/*!
* \brief configuration saving
*
*Saves the configuration file if modified.
*\param cfgFile the target configuration file
*/
GF_Err gf_cfg_save(GF_Config *cfgFile);
/*!
* \brief key value query
*
*Gets a key value from its section and name.
*\param cfgFile the target configuration file
*\param secName the desired key parent section name
*\param keyName the desired key name
*\return the desired key value if found, NULL otherwise.
*/
const char *gf_cfg_get_key(GF_Config *cfgFile, const char *secName, const char *keyName);
/*!
* \brief key value query ignoring case
*
*Gets a key value from its section and name. Comparison is performed while ignoring case.
*\param cfgFile the target configuration file
*\param secName the desired key parent section name (case ignored)
*\param keyName the desired key name (case ignored)
*\return the desired key value if found, NULL otherwise.
*/
const char *gf_cfg_get_ikey(GF_Config *cfgFile, const char *secName, const char *keyName);
/*!
* \brief key value update
*
*Sets a key value from its section and name.
*\param cfgFile the target configuration file
*\param secName the desired key parent section name
*\param keyName the desired key name
*\param keyValue the desired key value
*\note this will also create both section and key if they are not found in the configuration file
*/
GF_Err gf_cfg_set_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue);
/*!
* \brief section count query
*
*Gets the number of sections in the configuration file
*\param cfgFile the target configuration file
*\return the number of sections
*/
u32 gf_cfg_get_section_count(GF_Config *cfgFile);
/*!
* \brief section name query
*
*Gets a section name based on its index
*\param cfgFile the target configuration file
*\param secIndex 0-based index of the section to query
*\return the section name if found, NULL otherwise
*/
const char *gf_cfg_get_section_name(GF_Config *cfgFile, u32 secIndex);
/*!
* \brief key count query
*
*Gets the number of keys in a section of the configuration file
*\param cfgFile the target configuration file
*\param secName the target section
*\return the number of keys in the section
*/
u32 gf_cfg_get_key_count(GF_Config *cfgFile, const char *secName);
/*!
* \brief key count query
*
*Gets the number of keys in a section of the configuration file
*\param cfgFile the target configuration file
*\param secName the target section
*\param keyIndex 0-based index of the key in the section
*\return the key name if found, NULL otherwise
*/
const char *gf_cfg_get_key_name(GF_Config *cfgFile, const char *secName, u32 keyIndex);
/*!
* \brief key insertion
*
*Inserts a new key in a given section. Returns an error if a key with the given name
*already exists in the section
*\param cfgFile the target configuration file
*\param secName the target section
*\param keyName the name of the target key
*\param keyValue the value for the new key
*\param index the 0-based index position of the new key
*/
GF_Err gf_cfg_insert_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index);
/*!
* \brief section destrouction
*
*Removes all entries in the given section
*\param cfgFile the target configuration file
*\param secName the target section
*/
void gf_cfg_del_section(GF_Config *cfgFile, const char *secName);
/*!
* get a sub key (separator is ':') in a given key in a given section. Returns an error if the key does not exist
*\param cfgFile the target configuration file
*\param secName the target section
*\param keyName the name of the target key
*\param sub_index the 0-based index position of the sub key*/
const char *gf_cfg_get_sub_key(GF_Config *cfgFile, const char *secName, const char *keyName, u32 sub_index);
/*!
* Get the full filename associated with this config file
* The caller is responsible for freeing memory
* \param iniFile The Configuration
* \return a newly allocated filename
*/
char * gf_cfg_get_filename(GF_Config *iniFile);
/*!
* Set the full filename associated with this config file
* \param iniFile The Configuration
* \param fileName new filename for the config
* \return erroro code
*/
GF_Err gf_cfg_set_filename(GF_Config *iniFile, const char * fileName);
/*!
* Do not save results to file
* \param iniFile The Configuration
* \return error code
*/
GF_Err gf_cfg_discard_changes(GF_Config *iniFile);
/*! @} */
#ifdef __cplusplus
}
#endif
#endif /*_GF_CONFIG_FILE_H_*/

View File

@@ -1,26 +1,27 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Copyright (c) ENST 2008 -
* All rights reserved
*
* This file is part of GPAC
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2008-2012
* All rights reserved
*
* This file is part of GPAC
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_CONFIG_H_
@@ -29,7 +30,7 @@
#define GPAC_CONFIGURATION "(static configuration file)"
/*this file defines all common macros for libgpac compilation
except for symbian32 which uses .mmp directives ... */
except for symbian32 which uses .mmp directives ... */
#if defined(WIN32) || defined(_WIN32_WCE) || defined(GPAC_CONFIG_DARWIN) /*visual studio and xcode*/
/*enables GPAC fixed point*/
@@ -215,5 +216,4 @@
/*disables IETF RTP/SDP/RTSP*/
//#define GPAC_DISABLE_STREAMING
#endif /*_GF_CONFIG_H_*/
#endif /*_GF_CONFIG_H_*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,534 @@
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Events management
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* GPAC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _GF_EVENTS_CONSTANTS_H_
#define _GF_EVENTS_CONSTANTS_H_
/*!
* \file <gpac/events_constants.h>
* \brief Constants for event system used by GPAC playback.
*/
/*!
* \addtogroup evt_grp
* \ingroup playback_grp
* \brief Constants for event system used by GPAC playback.
*
*This section documents the event types used by the terminal, the compositor, input modules and output rendering modules for communication.
* @{
*/
/*
minimal event system
DO NOT CHANGE THEIR POSITION IN THE LIST, USED TO SPEED UP FILTERING OF USER INPUT EVENTS
*/
/*events*/
typedef enum {
/******************************************************
Events used for both GPAC internals and DOM Events
*******************************************************/
/*MouseEvents*/
GF_EVENT_CLICK,
GF_EVENT_MOUSEUP,
GF_EVENT_MOUSEDOWN,
GF_EVENT_MOUSEOVER,
GF_EVENT_MOUSEOUT,
/*!! ALL MOUSE EVENTS SHALL BE DECLARED BEFORE MOUSEMOVE !! */
GF_EVENT_MOUSEMOVE,
/*mouse wheel event*/
GF_EVENT_MOUSEWHEEL,
/*Key Events*/
GF_EVENT_KEYUP,
GF_EVENT_KEYDOWN, /* covers KeyDown, KeyPress and AccessKey */
GF_EVENT_LONGKEYPRESS,
/*character input*/
GF_EVENT_TEXTINPUT,
/******************************************************
Events used for DOM Events only
*******************************************************/
GF_EVENT_TEXTSELECT,
/*DOM UIEvents*/
GF_EVENT_FOCUSIN,
GF_EVENT_FOCUSOUT,
GF_EVENT_ACTIVATE,
GF_EVENT_CHANGE,
GF_EVENT_FOCUS,
GF_EVENT_BLUR,
/*SVG (HTML) Events*/
GF_EVENT_LOAD,
GF_EVENT_UNLOAD,
GF_EVENT_ABORT,
GF_EVENT_ERROR,
GF_EVENT_RESIZE,
GF_EVENT_SCROLL,
GF_EVENT_ZOOM,
GF_EVENT_BEGIN, /*this is a fake event, it is NEVER fired, only used in SMIL begin*/
GF_EVENT_BEGIN_EVENT,
GF_EVENT_END, /*this is a fake event, it is NEVER fired, only used in SMIL end*/
GF_EVENT_END_EVENT,
GF_EVENT_REPEAT, /*this is a fake event, it is NEVER fired, only used in SMIL repeat*/
GF_EVENT_REPEAT_EVENT,
/*DOM MutationEvents - NOT SUPPORTED YET*/
GF_EVENT_TREE_MODIFIED,
GF_EVENT_NODE_INSERTED,
GF_EVENT_NODE_REMOVED,
GF_EVENT_NODE_INSERTED_DOC,
GF_EVENT_NODE_REMOVED_DOC,
GF_EVENT_ATTR_MODIFIED,
GF_EVENT_CHAR_DATA_MODIFIED,
GF_EVENT_NODE_NAME_CHANGED,
GF_EVENT_ATTR_NAME_CHANGED,
GF_EVENT_DCCI_PROP_CHANGE,
/*LASeR events*/
GF_EVENT_ACTIVATED,
GF_EVENT_DEACTIVATED,
GF_EVENT_PAUSE,
GF_EVENT_PAUSED_EVENT,
GF_EVENT_PLAY,
GF_EVENT_REPEAT_KEY,
GF_EVENT_RESUME_EVENT,
GF_EVENT_SHORT_ACCESSKEY,
/*pseudo-event, only used in LASeR coding*/
GF_EVENT_EXECUTION_TIME,
/*HTML5 media events*/
GF_EVENT_MEDIA_SETUP_BEGIN, /*not HTML5 but should be :)*/
GF_EVENT_MEDIA_SETUP_DONE, /*not HTML5 but should be :)*/
GF_EVENT_MEDIA_LOAD_START,
GF_EVENT_MEDIA_LOAD_DONE, /*not HTML5 but should be :)*/
GF_EVENT_MEDIA_PROGRESS,
GF_EVENT_MEDIA_SUSPEND,
GF_EVENT_MEDIA_EMPTIED,
GF_EVENT_MEDIA_STALLED,
GF_EVENT_MEDIA_LOADED_METADATA,
GF_EVENT_MEDIA_LODADED_DATA,
GF_EVENT_MEDIA_CANPLAY,
GF_EVENT_MEDIA_CANPLAYTHROUGH,
GF_EVENT_MEDIA_PLAYING,
GF_EVENT_MEDIA_WAITING,
GF_EVENT_MEDIA_SEEKING,
GF_EVENT_MEDIA_SEEKED,
GF_EVENT_MEDIA_ENDED,
GF_EVENT_MEDIA_DURATION_CHANGED,
GF_EVENT_MEDIA_TIME_UPDATE,
GF_EVENT_MEDIA_RATECHANGE,
GF_EVENT_MEDIA_VOLUME_CHANGED,
GF_EVENT_HTML_MSE_SOURCE_OPEN,
GF_EVENT_HTML_MSE_SOURCE_ENDED,
GF_EVENT_HTML_MSE_SOURCE_CLOSE,
GF_EVENT_HTML_MSE_UPDATE_START,
GF_EVENT_HTML_MSE_UPDATE,
GF_EVENT_HTML_MSE_UPDATE_END,
GF_EVENT_HTML_MSE_UPDATE_ERROR,
GF_EVENT_HTML_MSE_UPDATE_ABORT,
GF_EVENT_HTML_MSE_ADD_SOURCE_BUFFER,
GF_EVENT_HTML_MSE_REMOVE_SOURCE_BUFFER,
GF_EVENT_BATTERY,
GF_EVENT_CPU,
GF_EVENT_UNKNOWN,
/******************************************************
Events used for GPAC internals only
*******************************************************/
/*same as mousedown, generated internally by GPAC*/
GF_EVENT_DBLCLICK,
/*scene attached event, dispatched when the root node of a scene is loaded and
attached to the window or parent object (animation, inline, ...)*/
GF_EVENT_SCENE_ATTACHED,
/*VP resize attached event, dispatched when viewport of a scene is being modified
attached to the window or parent object (animation, inline, ...)*/
GF_EVENT_VP_RESIZE,
/*window events*/
/*size has changed - indicate new w & h in .x end .y fields of event.
When sent from gpac to a video plugin, indicates the output size should be changed. This is only sent when the plugin
manages the output video himself
When sent from a video plugin to gpac, indicates the output size has been changed. This is only sent when the plugin
manages the output video himself
*/
GF_EVENT_SIZE,
/*signals the scene size (if indicated in scene) upon connection (sent to the user event proc only)
if scene size hasn't changed (seeking or other) this event is not sent
*/
GF_EVENT_SCENE_SIZE,
GF_EVENT_SHOWHIDE, /*window show/hide (minimized or other). */
GF_EVENT_SHOWHIDE_NOTIF, /*window has been show/hide (minimized or other). This is sent to the user to signal focus switch in fullscreen*/
GF_EVENT_SET_CURSOR, /*set mouse cursor*/
GF_EVENT_SET_CAPTION, /*set window caption*/
GF_EVENT_MOVE, /*move window*/
GF_EVENT_MOVE_NOTIF, /*move window*/
GF_EVENT_REFRESH, /*window needs repaint (whenever needed, eg restore, hide->show, background refresh, paint)*/
GF_EVENT_QUIT, /*app is being closed - associated structure is evt.message to carry any potential reason for quiting*/
/*video hw setup message:
- when sent from gpac to plugin, indicates that the plugin should re-setup hardware context due to a window resize:
* for 2D output, this means resizing the backbuffer if needed (depending on HW constraints)
* for 3D output, this means re-setup of OpenGL context (depending on HW constraints). Depending on windowing systems
and implementations, it could be possible to resize a window without destroying the GL context.
- when sent from plugin to gpac, indicates that hardware has been setup.
- when sent from gpac to user, indicate aspect ratio has been modified and video output is ready
*/
GF_EVENT_VIDEO_SETUP,
/*queries the list of system colors - only exchanged between compositor and video output*/
GF_EVENT_SYS_COLORS,
/*indicates some text has been pasted - from video output to compositor only*/
GF_EVENT_PASTE_TEXT,
/*queries for text to be copied - from video output to compositor only*/
GF_EVENT_COPY_TEXT,
/*terminal events*/
GF_EVENT_CONNECT, /*signal URL is connected*/
GF_EVENT_DURATION, /*signal duration of presentation*/
GF_EVENT_EOS, /*signal End of scene playback*/
GF_EVENT_AUTHORIZATION, /*indicates a user and pass is queried*/
GF_EVENT_NAVIGATE, /*indicates the user app should load or jump to the given URL.*/
GF_EVENT_NAVIGATE_INFO, /*indicates the link or its description under the mouse pointer*/
GF_EVENT_MESSAGE, /*message from the MPEG-4 terminal*/
GF_EVENT_PROGRESS, /*progress message from the MPEG-4 terminal*/
GF_EVENT_FORWARDED, /*event forwarded by service (MPEG-2, RTP, ...)*/
GF_EVENT_VIEWPOINTS, /*indicates viewpoint list has changed - no struct associated*/
GF_EVENT_STREAMLIST, /*indicates stream list has changed - no struct associated - only used when no scene info is present*/
GF_EVENT_METADATA, /*indicates a change in associated metadata*/
GF_EVENT_MIGRATE, /*indicates a session migration request*/
GF_EVENT_DISCONNECT, /*indicates the current url should be disconnected*/
GF_EVENT_RESOLUTION, /*indicates the screen resolution has changed*/
GF_EVENT_DROPFILE,
/* Events for Keyboad */
GF_EVENT_TEXT_EDITING_START,
GF_EVENT_TEXT_EDITING_END,
GF_EVENT_QUALITY_SWITCHED,
//fire when timeshift depth changes
GF_EVENT_TIMESHIFT_DEPTH,
//fire when position in timeshift buffer changes
GF_EVENT_TIMESHIFT_UPDATE,
//fire when position overflows the timeshift buffer
GF_EVENT_TIMESHIFT_OVERFLOW,
//fire when position underruns the timeshift buffer (eg fast forward / seek in the future)
GF_EVENT_TIMESHIFT_UNDERRUN,
GF_EVENT_MAIN_ADDON_STATE,
GF_EVENT_FROM_SERVICE,
GF_EVENT_ADDON_DETECTED,
GF_EVENT_RELOAD,
GF_EVENT_SENSOR_ORIENTATION,
GF_EVENT_SENSOR_REQUEST,
} GF_EventType;
/*GPAC/DOM3 key codes*/
typedef enum {
GF_KEY_UNIDENTIFIED = 0,
GF_KEY_ACCEPT = 1, /* "Accept" The Accept (Commit) key.*/
GF_KEY_AGAIN, /* "Again" The Again key.*/
GF_KEY_ALLCANDIDATES, /* "AllCandidates" The All Candidates key.*/
GF_KEY_ALPHANUM, /*"Alphanumeric" The Alphanumeric key.*/
GF_KEY_ALT, /*"Alt" The Alt (Menu) key.*/
GF_KEY_ALTGRAPH, /*"AltGraph" The Alt-Graph key.*/
GF_KEY_APPS, /*"Apps" The Application key.*/
GF_KEY_ATTN, /*"Attn" The ATTN key.*/
GF_KEY_BROWSERBACK, /*"BrowserBack" The Browser Back key.*/
GF_KEY_BROWSERFAVORITES, /*"BrowserFavorites" The Browser Favorites key.*/
GF_KEY_BROWSERFORWARD, /*"BrowserForward" The Browser Forward key.*/
GF_KEY_BROWSERHOME, /*"BrowserHome" The Browser Home key.*/
GF_KEY_BROWSERREFRESH, /*"BrowserRefresh" The Browser Refresh key.*/
GF_KEY_BROWSERSEARCH, /*"BrowserSearch" The Browser Search key.*/
GF_KEY_BROWSERSTOP, /*"BrowserStop" The Browser Stop key.*/
GF_KEY_CAPSLOCK, /*"CapsLock" The Caps Lock (Capital) key.*/
GF_KEY_CLEAR, /*"Clear" The Clear key.*/
GF_KEY_CODEINPUT, /*"CodeInput" The Code Input key.*/
GF_KEY_COMPOSE, /*"Compose" The Compose key.*/
GF_KEY_CONTROL, /*"Control" The Control (Ctrl) key.*/
GF_KEY_CRSEL, /*"Crsel" The Crsel key.*/
GF_KEY_CONVERT, /*"Convert" The Convert key.*/
GF_KEY_COPY, /*"Copy" The Copy key.*/
GF_KEY_CUT, /*"Cut" The Cut key.*/
GF_KEY_DOWN, /*"Down" The Down Arrow key.*/
GF_KEY_END, /*"End" The End key.*/
GF_KEY_ENTER, /*"Enter" The Enter key.
Note: This key identifier is also used for the Return (Macintosh numpad) key.*/
GF_KEY_ERASEEOF, /*"EraseEof" The Erase EOF key.*/
GF_KEY_EXECUTE, /*"Execute" The Execute key.*/
GF_KEY_EXSEL, /*"Exsel" The Exsel key.*/
GF_KEY_F1, /*"F1" The F1 key.*/
GF_KEY_F2, /*"F2" The F2 key.*/
GF_KEY_F3, /*"F3" The F3 key.*/
GF_KEY_F4, /*"F4" The F4 key.*/
GF_KEY_F5, /*"F5" The F5 key.*/
GF_KEY_F6, /*"F6" The F6 key.*/
GF_KEY_F7, /*"F7" The F7 key.*/
GF_KEY_F8, /*"F8" The F8 key.*/
GF_KEY_F9, /*"F9" The F9 key.*/
GF_KEY_F10, /*"F10" The F10 key.*/
GF_KEY_F11, /*"F11" The F11 key.*/
GF_KEY_F12, /*"F12" The F12 key.*/
GF_KEY_F13, /*"F13" The F13 key.*/
GF_KEY_F14, /*"F14" The F14 key.*/
GF_KEY_F15, /*"F15" The F15 key.*/
GF_KEY_F16, /*"F16" The F16 key.*/
GF_KEY_F17, /*"F17" The F17 key.*/
GF_KEY_F18, /*"F18" The F18 key.*/
GF_KEY_F19, /*"F19" The F19 key.*/
GF_KEY_F20, /*"F20" The F20 key.*/
GF_KEY_F21, /*"F21" The F21 key.*/
GF_KEY_F22, /*"F22" The F22 key.*/
GF_KEY_F23, /*"F23" The F23 key.*/
GF_KEY_F24, /*"F24" The F24 key.*/
GF_KEY_FINALMODE, /*"FinalMode" The Final Mode (Final) key used on some asian keyboards.*/
GF_KEY_FIND, /*"Find" The Find key.*/
GF_KEY_FULLWIDTH, /*"FullWidth" The Full-Width Characters key.*/
GF_KEY_HALFWIDTH, /*"HalfWidth" The Half-Width Characters key.*/
GF_KEY_HANGULMODE, /*"HangulMode" The Hangul (Korean characters) Mode key.*/
GF_KEY_HANJAMODE, /*"HanjaMode" The Hanja (Korean characters) Mode key.*/
GF_KEY_HELP, /*"Help" The Help key.*/
GF_KEY_HIRAGANA, /*"Hiragana" The Hiragana (Japanese Kana characters) key.*/
GF_KEY_HOME, /*"Home" The Home key.*/
GF_KEY_INSERT, /*"Insert" The Insert (Ins) key.*/
GF_KEY_JAPANESEHIRAGANA, /*"JapaneseHiragana" The Japanese-Hiragana key.*/
GF_KEY_JAPANESEKATAKANA, /*"JapaneseKatakana" The Japanese-Katakana key.*/
GF_KEY_JAPANESEROMAJI, /*"JapaneseRomaji" The Japanese-Romaji key.*/
GF_KEY_JUNJAMODE, /*"JunjaMode" The Junja Mode key.*/
GF_KEY_KANAMODE, /*"KanaMode" The Kana Mode (Kana Lock) key.*/
GF_KEY_KANJIMODE, /*"KanjiMode" The Kanji (Japanese name for ideographic characters of Chinese origin) Mode key.*/
GF_KEY_KATAKANA, /*"Katakana" The Katakana (Japanese Kana characters) key.*/
GF_KEY_LAUNCHAPPLICATION1, /*"LaunchApplication1" The Start Application One key.*/
GF_KEY_LAUNCHAPPLICATION2, /*"LaunchApplication2" The Start Application Two key.*/
GF_KEY_LAUNCHMAIL, /*"LaunchMail" The Start Mail key.*/
GF_KEY_LEFT, /*"Left" The Left Arrow key.*/
GF_KEY_META, /*"Meta" The Meta key.*/
GF_KEY_MEDIANEXTTRACK, /*"MediaNextTrack" The Media Next Track key.*/
GF_KEY_MEDIAPLAYPAUSE, /*"MediaPlayPause" The Media Play Pause key.*/
GF_KEY_MEDIAPREVIOUSTRACK, /*"MediaPreviousTrack" The Media Previous Track key.*/
GF_KEY_MEDIASTOP, /*"MediaStop" The Media Stok key.*/
GF_KEY_MODECHANGE, /*"ModeChange" The Mode Change key.*/
GF_KEY_NONCONVERT, /*"Nonconvert" The Nonconvert (Don't Convert) key.*/
GF_KEY_NUMLOCK, /*"NumLock" The Num Lock key.*/
GF_KEY_PAGEDOWN, /*"PageDown" The Page Down (Next) key.*/
GF_KEY_PAGEUP, /*"PageUp" The Page Up key.*/
GF_KEY_PASTE, /*"Paste" The Paste key.*/
GF_KEY_PAUSE, /*"Pause" The Pause key.*/
GF_KEY_PLAY, /*"Play" The Play key.*/
GF_KEY_PREVIOUSCANDIDATE, /*"PreviousCandidate" The Previous Candidate function key.*/
GF_KEY_PRINTSCREEN, /*"PrintScreen" The Print Screen (PrintScrn, SnapShot) key.*/
GF_KEY_PROCESS, /*"Process" The Process key.*/
GF_KEY_PROPS, /*"Props" The Props key.*/
GF_KEY_RIGHT, /*"Right" The Right Arrow key.*/
GF_KEY_ROMANCHARACTERS, /*"RomanCharacters" The Roman Characters function key.*/
GF_KEY_SCROLL, /*"Scroll" The Scroll Lock key.*/
GF_KEY_SELECT, /*"Select" The Select key.*/
GF_KEY_SELECTMEDIA, /*"SelectMedia" The Select Media key.*/
GF_KEY_SHIFT, /*"Shift" The Shift key.*/
GF_KEY_STOP, /*"Stop" The Stop key.*/
GF_KEY_UP, /*"Up" The Up Arrow key.*/
GF_KEY_UNDO, /*"Undo" The Undo key.*/
GF_KEY_VOLUMEDOWN, /*"VolumeDown" The Volume Down key.*/
GF_KEY_VOLUMEMUTE, /*"VolumeMute" The Volume Mute key.*/
GF_KEY_VOLUMEUP, /*"VolumeUp" The Volume Up key.*/
GF_KEY_WIN, /*"Win" The Windows Logo key.*/
GF_KEY_ZOOM, /*"Zoom" The Zoom key.*/
GF_KEY_BACKSPACE, /*"U+0008" The Backspace (Back) key.*/
GF_KEY_TAB, /*"U+0009" The Horizontal Tabulation (Tab) key.*/
GF_KEY_CANCEL, /*"U+0018" The Cancel key.*/
GF_KEY_ESCAPE, /*"U+001B" The Escape (Esc) key.*/
GF_KEY_SPACE, /*"U+0020" The Space (Spacebar) key.*/
GF_KEY_EXCLAMATION, /*"U+0021" The Exclamation Mark (Factorial, Bang) key (!).*/
GF_KEY_QUOTATION, /*"U+0022" The Quotation Mark (Quote Double) key (").*/
GF_KEY_NUMBER, /*"U+0023" The Number Sign (Pound Sign, Hash, Crosshatch, Octothorpe) key (#).*/
GF_KEY_DOLLAR, /*"U+0024" The Dollar Sign (milreis, escudo) key ($).*/
GF_KEY_AMPERSAND, /*"U+0026" The Ampersand key (&).*/
GF_KEY_APOSTROPHE, /*"U+0027" The Apostrophe (Apostrophe-Quote, APL Quote) key (').*/
GF_KEY_LEFTPARENTHESIS, /*"U+0028" The Left Parenthesis (Opening Parenthesis) key (().*/
GF_KEY_RIGHTPARENTHESIS, /*"U+0029" The Right Parenthesis (Closing Parenthesis) key ()).*/
GF_KEY_STAR, /*"U+002A" The Asterix (Star) key (*).*/
GF_KEY_PLUS, /*"U+002B" The Plus Sign (Plus) key (+).*/
GF_KEY_COMMA, /*"U+002C" The Comma (decimal separator) sign key (,).*/
GF_KEY_HYPHEN, /*"U+002D" The Hyphen-minus (hyphen or minus sign) key (-).*/
GF_KEY_FULLSTOP, /*"U+002E" The Full Stop (period, dot, decimal point) key (.).*/
GF_KEY_SLASH, /*"U+002F" The Solidus (slash, virgule, shilling) key (/).*/
GF_KEY_0, /*"U+0030" The Digit Zero key (0).*/
GF_KEY_1, /*"U+0031" The Digit One key (1).*/
GF_KEY_2, /*"U+0032" The Digit Two key (2).*/
GF_KEY_3, /*"U+0033" The Digit Three key (3).*/
GF_KEY_4, /*"U+0034" The Digit Four key (4).*/
GF_KEY_5, /*"U+0035" The Digit Five key (5).*/
GF_KEY_6, /*"U+0036" The Digit Six key (6).*/
GF_KEY_7, /*"U+0037" The Digit Seven key (7).*/
GF_KEY_8, /*"U+0038" The Digit Eight key (8).*/
GF_KEY_9, /*"U+0039" The Digit Nine key (9).*/
GF_KEY_COLON, /*"U+003A" The Colon key (:).*/
GF_KEY_SEMICOLON, /*"U+003B" The Semicolon key (;).*/
GF_KEY_LESSTHAN, /*"U+003C" The Less-Than Sign key (<).*/
GF_KEY_EQUALS, /*"U+003D" The Equals Sign key (=).*/
GF_KEY_GREATERTHAN, /*"U+003E" The Greater-Than Sign key (>).*/
GF_KEY_QUESTION, /*"U+003F" The Question Mark key (?).*/
GF_KEY_AT, /*"U+0040" The Commercial At (@) key.*/
GF_KEY_A, /*"U+0041" The Latin Capital Letter A key (A).*/
GF_KEY_B, /*"U+0042" The Latin Capital Letter B key (B).*/
GF_KEY_C, /*"U+0043" The Latin Capital Letter C key (C).*/
GF_KEY_D, /*"U+0044" The Latin Capital Letter D key (D).*/
GF_KEY_E, /*"U+0045" The Latin Capital Letter E key (E).*/
GF_KEY_F, /*"U+0046" The Latin Capital Letter F key (F).*/
GF_KEY_G, /*"U+0047" The Latin Capital Letter G key (G).*/
GF_KEY_H, /*"U+0048" The Latin Capital Letter H key (H).*/
GF_KEY_I, /*"U+0049" The Latin Capital Letter I key (I).*/
GF_KEY_J, /*"U+004A" The Latin Capital Letter J key (J).*/
GF_KEY_K, /*"U+004B" The Latin Capital Letter K key (K).*/
GF_KEY_L, /*"U+004C" The Latin Capital Letter L key (L).*/
GF_KEY_M, /*"U+004D" The Latin Capital Letter M key (M).*/
GF_KEY_N, /*"U+004E" The Latin Capital Letter N key (N).*/
GF_KEY_O, /*"U+004F" The Latin Capital Letter O key (O).*/
GF_KEY_P, /*"U+0050" The Latin Capital Letter P key (P).*/
GF_KEY_Q, /*"U+0051" The Latin Capital Letter Q key (Q).*/
GF_KEY_R, /*"U+0052" The Latin Capital Letter R key (R).*/
GF_KEY_S, /*"U+0053" The Latin Capital Letter S key (S).*/
GF_KEY_T, /*"U+0054" The Latin Capital Letter T key (T).*/
GF_KEY_U, /*"U+0055" The Latin Capital Letter U key (U).*/
GF_KEY_V, /*"U+0056" The Latin Capital Letter V key (V).*/
GF_KEY_W, /*"U+0057" The Latin Capital Letter W key (W).*/
GF_KEY_X, /*"U+0058" The Latin Capital Letter X key (X).*/
GF_KEY_Y, /*"U+0059" The Latin Capital Letter Y key (Y).*/
GF_KEY_Z, /*"U+005A" The Latin Capital Letter Z key (Z).*/
GF_KEY_LEFTSQUAREBRACKET, /*"U+005B" The Left Square Bracket (Opening Square Bracket) key ([).*/
GF_KEY_BACKSLASH, /*"U+005C" The Reverse Solidus (Backslash) key (\).*/
GF_KEY_RIGHTSQUAREBRACKET, /*"U+005D" The Right Square Bracket (Closing Square Bracket) key (]).*/
GF_KEY_CIRCUM, /*"U+005E" The Circumflex Accent key (^).*/
GF_KEY_UNDERSCORE, /*"U+005F" The Low Sign (Spacing Underscore, Underscore) key (_).*/
GF_KEY_GRAVEACCENT, /*"U+0060" The Grave Accent (Back Quote) key (`).*/
GF_KEY_LEFTCURLYBRACKET, /*"U+007B" The Left Curly Bracket (Opening Curly Bracket, Opening Brace, Brace Left) key ({).*/
GF_KEY_PIPE, /*"U+007C" The Vertical Line (Vertical Bar, Pipe) key (|).*/
GF_KEY_RIGHTCURLYBRACKET, /*"U+007D" The Right Curly Bracket (Closing Curly Bracket, Closing Brace, Brace Right) key (}).*/
GF_KEY_DEL, /*"U+007F" The Delete (Del) Key.*/
GF_KEY_INVERTEXCLAMATION, /*"U+00A1" The Inverted Exclamation Mark key (<28>).*/
GF_KEY_DEADGRAVE, /*"U+0300" The Combining Grave Accent (Greek Varia, Dead Grave) key.*/
GF_KEY_DEADEACUTE, /*"U+0301" The Combining Acute Accent (Stress Mark, Greek Oxia, Tonos, Dead Eacute) key.*/
GF_KEY_DEADCIRCUM, /*"U+0302" The Combining Circumflex Accent (Hat, Dead Circumflex) key.*/
GF_KEY_DEADTILDE, /*"U+0303" The Combining Tilde (Dead Tilde) key.*/
GF_KEY_DEADMACRON, /*"U+0304" The Combining Macron (Long, Dead Macron) key.*/
GF_KEY_DEADBREVE, /*"U+0306" The Combining Breve (Short, Dead Breve) key.*/
GF_KEY_DEADABOVEDOT, /*"U+0307" The Combining Dot Above (Derivative, Dead Above Dot) key.*/
GF_KEY_DEADDIARESIS, /*"U+0308" The Combining Diaeresis (Double Dot Abode, Umlaut, Greek Dialytika, Double Derivative, Dead Diaeresis) key.*/
GF_KEY_DEADRINGABOVE, /*"U+030A" The Combining Ring Above (Dead Above Ring) key.*/
GF_KEY_DEADDOUBLEACUTE, /*"U+030B" The Combining Double Acute Accent (Dead Doubleacute) key.*/
GF_KEY_DEADCARON, /*"U+030C" The Combining Caron (Hacek, V Above, Dead Caron) key.*/
GF_KEY_DEADCEDILLA, /*"U+0327" The Combining Cedilla (Dead Cedilla) key.*/
GF_KEY_DEADOGONEK, /*"U+0328" The Combining Ogonek (Nasal Hook, Dead Ogonek) key.*/
GF_KEY_DEADIOTA, /*"U+0345" The Combining Greek Ypogegrammeni (Greek Non-Spacing Iota Below, Iota Subscript, Dead Iota) key.*/
GF_KEY_EURO, /*"U+20AC" The Euro Currency Sign key (<28>).*/
GF_KEY_DEADVOICESOUND, /*"U+3099" The Combining Katakana-Hiragana Voiced Sound Mark (Dead Voiced Sound) key.*/
GF_KEY_DEADSEMIVOICESOUND, /*"U+309A" The Combining Katakana-Hiragana Semi-Voiced Sound Mark (Dead Semivoiced Sound) key. */
/* STB */
GF_KEY_CHANNELUP, /*ChannelUp*/
GF_KEY_CHANNELDOWN, /*ChannelDown*/
GF_KEY_TEXT, /*Text*/
GF_KEY_INFO, /*Info*/
GF_KEY_EPG, /*EPG*/
GF_KEY_RECORD, /*Record*/
GF_KEY_BEGINPAGE, /*BeginPage*/
/* end STB */
/*non-dom keys, used in LASeR*/
GF_KEY_CELL_SOFT1, /*soft1 key of cell phones*/
GF_KEY_CELL_SOFT2, /*soft2 key of cell phones*/
/*for joystick handling*/
GF_KEY_JOYSTICK
} GF_KeyCode;
/*key modifiers state - set by terminal (not set by video driver)*/
typedef enum
{
GF_KEY_MOD_SHIFT = (1),
GF_KEY_MOD_CTRL = (1 << 2),
GF_KEY_MOD_ALT = (1 << 3),
GF_KEY_EXT_NUMPAD = (1 << 4),
GF_KEY_EXT_LEFT = (1 << 5),
GF_KEY_EXT_RIGHT = (1 << 6)
} GF_KeyModifier;
/*sensor signaling*/
enum
{
GF_CURSOR_NORMAL = 0x00,
GF_CURSOR_ANCHOR,
GF_CURSOR_TOUCH,
/*discSensor, cylinderSensor, sphereSensor*/
GF_CURSOR_ROTATE,
/*proximitySensor & proximitySensor2D*/
GF_CURSOR_PROXIMITY,
/*planeSensor & planeSensor2D*/
GF_CURSOR_PLANE,
/*collision*/
GF_CURSOR_COLLIDE,
GF_CURSOR_HIDE,
};
/*Mutation AttrChangeType Signaling*/
enum
{
GF_MUTATION_ATTRCHANGE_MODIFICATION = 0x01,
GF_MUTATION_ATTRCHANGE_ADDITION = 0x02,
GF_MUTATION_ATTRCHANGE_REMOVAL = 0x03,
};
enum
{
//regular even codes
GF_EVT_REGULAR = 0,
/*events forwarded from MPEG-2 stack*/
GF_EVT_MPEG2 = 1,
};
/*! @} */
#endif

Some files were not shown because too many files have changed in this diff Show More