| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <SAMI> | ||
| <Head> | ||
| <title> | ||
| </title> | ||
| <STYLE TYPE="text/css"> | ||
| <!-- | ||
| P { | ||
| text-align: center; | ||
| font-family: Helvetica; | ||
| font-size: 10pt; | ||
| color: #ffffff; | ||
| } | ||
| .EN {Name:English; lang: en-US; SAMI_Type: CC;} | ||
| --> | ||
| </STYLE> | ||
| </Head> | ||
|
|
||
| <BODY> | ||
| <SYNC start=0><P Class="EN"></P></SYNC> | ||
| <SYNC start=2000><P Class="EN">Mary had a little lamb.</P></SYNC> | ||
| <SYNC start=4000><P Class="EN">Mary had a little lamb<br>little lamb...</P></SYNC> | ||
| <SYNC start=6000><P Class="EN">Mary had a little lamb<br>little lamb...<br>little lamb...</P></SYNC> | ||
| <SYNC start=8000><P Class="EN">Mary had a little lamb<br><i>Maybe italics works?</i><br>its fleece was white as snow.</P></SYNC> | ||
| <SYNC start=10000><P Class="EN"></P></SYNC> | ||
|
|
||
| </BODY> | ||
| </SAMI> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| 1 | ||
| 00:00:10.000 --> 00:00:15.500 | ||
| Mary had a little lamb | ||
|
|
||
| 2 | ||
| 00:00:16.000 --> 00:00:20.000 | ||
| Mary had a little lamb | ||
| little lamb... | ||
|
|
||
| 3 | ||
| 00:00:20,500 --> 00:00:25,000 | ||
| Mary had a little lamb | ||
| little lamb... | ||
| little lamb... | ||
|
|
||
| 4 | ||
| 00:00:30,000 --> 00:00:39,900 | ||
| Mary had a little lamb | ||
| {\i1}What, no italics?{\i0} | ||
| its fleece was white as snow. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [00:00:10] | ||
| Mary had a little lamb | ||
|
|
||
| [00:00:16] | ||
| Mary had a little lamb|little lamb... | ||
|
|
||
| [00:00:20] | ||
| Mary had a little lamb|little lamb...|little lamb... | ||
|
|
||
| [00:00:30] | ||
| Mary had a little lamb|its fleece was white as snow. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| !: This is a Sub Station Alpha v3.x script. | ||
|
|
||
| Title: Lupin TV ep. 3 | ||
|
|
||
| ScriptType: v3.00 | ||
| Collisions: Reverse | ||
| PlayResY: 480 | ||
| PlayResX: 640 | ||
| PlayDepth: 24 | ||
|
|
||
| Timer: 100.0000 | ||
|
|
||
| Style: Default,Arial,20,65535,65280,16777215,0,-1,0,2,3,2,30,35,35,255 | ||
| Style: Normal1,Arial,18,65535,65408,16777215,0,-1,0,1,3,2,30,30,30,255 | ||
| Style: owari,Arial,18,65535,65280,16777215,0,-1,0,2,3,2,40,40,35,255 | ||
| Style: songgreen,Arial,18,65280,16777215,65535,0,-1,0,2,3,2,35,35,35,255 | ||
| Style: top,Arial,20,65535,65280,16777215,0,-1,0,2,3,2,45,45,380,255 | ||
|
|
||
| Dialogue: Marked=0,0:00:02.07,0:00:11.81,*Default,Credit,0000,0000,0300,,Lupin III | ||
| Dialogue: Marked=0,0:00:14.00,0:00:19.01,Normal1,Credit,0000,0000,0000,,{\fs20\c&HFFFFFF&\a1}Song of Lupin III\nCharley Kohsei | ||
| Dialogue: Marked=0,0:00:28.91,0:00:33.01,Normal1,Credit,0000,0000,0000,,{\fs20\c&HFFFFFF&}Original idea\nMonkey Punch | ||
| Dialogue: Marked=0,0:01:37.46,0:01:38.66,owari,Fujiko,0000,0000,0000,,It's fantastic, Lupin. | ||
| Dialogue: Marked=0,0:01:38.95,0:01:41.75,owari,Lupin,0000,0000,0000,,Yeah, love is wonderful. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [Script Info] | ||
| Title: Spirited Away | ||
| Original Script: Ian Roberts | ||
| Original Translation: Eisuke Ishibashi | ||
| ScriptType: v4.00 | ||
| Collisions: Normal | ||
| PlayResY: 480 | ||
| PlayDepth: 0 | ||
| Wav: 0, 28688,H:\3.wav | ||
| LastWav: 1 | ||
| Timer: 100.0000 | ||
|
|
||
| [V4 Styles] | ||
| Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding | ||
| Style: ICredit,Gill Sans Condensed,36,16777215,65535,65535,-2147483640,-1,0,1,3,0,2,70,70,40,0,0 | ||
| Style: IDefault,Gill Sans Condensed,30,65535,65535,65535,-2147483640,-1,0,1,3,0,2,70,70,40,0,0 | ||
| Style: IScreenText,Gill Sans Condensed,30,16744576,65535,65535,-2147483640,-1,0,1,3,5,2,70,70,40,0,0 | ||
|
|
||
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
|
||
| [Events] | ||
| Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text | ||
| Dialogue: Marked=0,0:00:06.60,0:00:08.90,IScreenText,,0000,0000,0000,,{\a10}See you again... Best wishes | ||
| Dialogue: Marked=0,0:00:11.84,0:00:14.74,ICredit,,0000,0000,0100,,{\a2}Story, Script & Direction - MIYAZAKI Hayao | ||
| Dialogue: Marked=0,0:00:15.00,0:00:18.52,ICredit,,0000,0000,0100,,Mary had a little lamb, its fleece was white as snow. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| 00:01:31.00,00:01:33.00 | ||
| String1 w/periods | ||
|
|
||
| 00:01:34.32,00:01:36.72 | ||
| String2 w/periods[br]what? | ||
|
|
||
| 00:01:37,39,00:01:39,76 | ||
| String3 w/commas|line 2|line 3[part of line 3] | ||
|
|
||
| 00:01:37,39,00:01:39,76 | ||
| [This collapses | ||
| to one line...] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {T 00:01:31:00,00:01:33:00 | ||
| String1 w/periods | ||
| } | ||
|
|
||
| {T 00:01:34:32,00:01:36:72 | ||
| String2 w/periods | ||
| what? | ||
| } | ||
|
|
||
| {T 00:01:37:39,00:01:39:76 | ||
| String3 w/commas | ||
| line 2 | ||
| line 3[part of line 3] | ||
| } | ||
|
|
||
| {T 00:01:37:39,00:01:39:76 | ||
| [This is one line...] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| 00:01:10:This is a subtitle. | ||
| 00:01:30 | ||
| 00:02:20:This is a second subtitle. | ||
| 00:03:30:This is a third subtitle. | ||
| 00:04:40:This is a fourth subtitle. | ||
| 00:05:00 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,343 @@ | ||
| /* | ||
| * Class TextXineDemux | ||
| * | ||
| * Copyright (c) David Hampton 2020 | ||
| * | ||
| * 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 | ||
| */ | ||
| #include <iostream> | ||
| #include "test_xine_demux.h" | ||
| #include "captions/xine_demux_sputext.h" | ||
|
|
||
| void TextXineDemux::initTestCase() | ||
| { | ||
| QDir::setCurrent("libmythtv/test/test_xine_demux"); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_microdvd(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/microdvd.sub"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_MICRODVD); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 17); | ||
| QCOMPARE(sub_data.subtitles[0].lines, 1); | ||
| QCOMPARE(sub_data.subtitles[14].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[15].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[16].lines, 1); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_srt(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/subrip.srt"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_SUBRIP); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 4); | ||
| QCOMPARE(sub_data.subtitles[3].lines, 3); | ||
| QVERIFY(!QString(sub_data.subtitles[3].text[1]).contains("{\\i1}")); | ||
| QVERIFY(!QString(sub_data.subtitles[3].text[1]).contains("</i>")); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_subviewer_data(void) | ||
| { | ||
| QTest::addColumn<QString>("filename"); | ||
| QTest::addColumn<int>("format"); | ||
|
|
||
| QTest::newRow("subviewer") << "samples/subviewer.sub" << FORMAT_SUBVIEWER; | ||
| QTest::newRow("subviewer2") << "samples/subviewer2.sub" << FORMAT_SUBVIEWER2; | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_subviewer(void) | ||
| { | ||
| QFETCH(QString, filename); | ||
| QFETCH(int, format); | ||
|
|
||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file(filename); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, format); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 4); | ||
| QCOMPARE(sub_data.subtitles[1].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[2].lines, 3); | ||
| QCOMPARE(sub_data.subtitles[3].lines, 1); | ||
| QVERIFY(QString(sub_data.subtitles[2].text[0]).contains("String3")); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_smi(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/sami.smi"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| // Loses first blank line. | ||
| // Loses last line (regardless of if blank). | ||
| QCOMPARE(sub_data.format, FORMAT_SAMI); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 4); | ||
| QCOMPARE(sub_data.subtitles[3].lines, 3); | ||
| QVERIFY(!QString(sub_data.subtitles[3].text[1]).contains("</i>")); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_vplayer(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/vplayer.txt"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_VPLAYER); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 5); | ||
| QCOMPARE(sub_data.subtitles[3].lines, 1); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_rt(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/realtext.txt"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_RT); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 8); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_ssa_ass_data(void) | ||
| { | ||
| QTest::addColumn<QString>("filename"); | ||
| QTest::addColumn<int>("expectedLines"); | ||
|
|
||
| QTest::newRow("subtitles.v3.ssa") << "samples/substationalpha.v3.ssa" << 5; | ||
| QTest::newRow("subtitles.v4.ssa") << "samples/substationalpha.v4.ssa" << 3; | ||
| QTest::newRow("subtitles.ass") << "samples/advancedssa.ass" << 3; | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_ssa_ass(void) | ||
| { | ||
| QFETCH(QString, filename); | ||
| QFETCH(int, expectedLines); | ||
|
|
||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file(filename); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| // Loses first blank line. | ||
| // Loses last line (regardless of if blank). | ||
| QCOMPARE(sub_data.format, FORMAT_SSA); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, expectedLines); | ||
| } | ||
|
|
||
| // Phoenix Japanimation Society | ||
| void TextXineDemux::test_captions_pjs(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/phoenixjapanimationsociety.pjs"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_PJS); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 2); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_mpsub(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/mpsub.sub"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_MPSUB); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 3); | ||
| QCOMPARE(sub_data.subtitles[0].lines, 1); | ||
| QCOMPARE(sub_data.subtitles[1].lines, 2); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_aqtitle(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/aqtitles.aqt.sub"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_AQTITLE); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 6); | ||
| QCOMPARE(sub_data.subtitles[0].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[4].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[5].lines, 1); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_jaco(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/jaco.sub"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_JACOBSUB); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 37); | ||
| // Lines containing the "RLB" directive are skipped, altering the | ||
| // line numbers compared to the original file. | ||
| QCOMPARE(sub_data.subtitles[0].lines, 3); | ||
| QCOMPARE(sub_data.subtitles[4].lines, 1); | ||
| QVERIFY(QString(sub_data.subtitles[4].text[0]).startsWith("(And")); | ||
| QCOMPARE(sub_data.subtitles[5].lines, 3); | ||
| QCOMPARE(sub_data.subtitles[6].lines, 2); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_subrip09(void) | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/subrip09.srt"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_SUBRIP09); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 4); | ||
| QCOMPARE(sub_data.subtitles[2].lines, 3); | ||
| QCOMPARE(sub_data.subtitles[3].lines, 2); | ||
| QVERIFY(QString(sub_data.subtitles[3].text[1]).contains("fleece")); | ||
| } | ||
|
|
||
| void TextXineDemux::test_captions_mpl2(void) // MPL | ||
| { | ||
| demux_sputext_t sub_data {}; | ||
|
|
||
| QFile file("samples/mpl2.mpl.sub"); | ||
| QCOMPARE(file.exists(), true); | ||
| QCOMPARE(file.open(QIODevice::ReadOnly | QIODevice::Text), true); | ||
|
|
||
| QByteArray ba = file.readAll(); | ||
| sub_data.rbuffer_text = ba.data(); | ||
| sub_data.rbuffer_len = ba.size(); | ||
|
|
||
| subtitle_t *loaded_subs = sub_read_file(&sub_data); | ||
|
|
||
| QCOMPARE(sub_data.format, FORMAT_MPL2); | ||
| QVERIFY(loaded_subs != nullptr); | ||
| QCOMPARE(sub_data.num, 6); | ||
| QCOMPARE(sub_data.subtitles[0].lines, 1); | ||
| QCOMPARE(sub_data.subtitles[1].lines, 2); | ||
| QCOMPARE(sub_data.subtitles[2].lines, 1); | ||
| QCOMPARE(sub_data.subtitles[5].lines, 2); | ||
| } | ||
|
|
||
| void TextXineDemux::cleanupTestCase() | ||
| { | ||
| } | ||
|
|
||
| QTEST_APPLESS_MAIN(TextXineDemux) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Class TextXineDemux | ||
| * | ||
| * Copyright (c) David Hampton 2020 | ||
| * | ||
| * 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 | ||
| */ | ||
|
|
||
| #include <QtTest/QtTest> | ||
| #include <iostream> | ||
|
|
||
| class TextXineDemux : public QObject | ||
| { | ||
| Q_OBJECT | ||
|
|
||
| private slots: | ||
| static void initTestCase(); | ||
| static void test_captions_microdvd(void); | ||
| static void test_captions_srt(void); | ||
| static void test_captions_subviewer_data(void); | ||
| static void test_captions_subviewer(void); | ||
| static void test_captions_smi(void); | ||
| static void test_captions_vplayer(void); | ||
| static void test_captions_rt(void); | ||
| static void test_captions_ssa_ass_data(void); | ||
| static void test_captions_ssa_ass(void); | ||
| static void test_captions_pjs(void); | ||
| static void test_captions_mpsub(void); | ||
| static void test_captions_aqtitle(void); | ||
| static void test_captions_jaco(void); | ||
| static void test_captions_subrip09(void); | ||
| static void test_captions_mpl2(void); | ||
| static void cleanupTestCase(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| include ( ../../../../settings.pro ) | ||
|
|
||
| QT += xml sql network testlib widgets | ||
|
|
||
| TEMPLATE = app | ||
| TARGET = test_xine_demux | ||
| DEPENDPATH += . ../.. | ||
| INCLUDEPATH += . ../.. ../../../libmyth ../../../libmythbase | ||
| INCLUDEPATH += ../../../../external/FFmpeg | ||
| POST_TARGETDEPS = ../../$(OBJECTS_DIR)xine_demux_sputext.o | ||
|
|
||
| # Directly add objects w/non-exported functions | ||
| LIBS += ../../$(OBJECTS_DIR)xine_demux_sputext.o | ||
|
|
||
| # Add all the necessary libraries | ||
| LIBS += -L../../../libmythbase -lmythbase-$$LIBVERSION | ||
| LIBS += -L../../../libmythui -lmythui-$$LIBVERSION | ||
| LIBS += -L../../../libmythupnp -lmythupnp-$$LIBVERSION | ||
| LIBS += -L../../../libmythservicecontracts -lmythservicecontracts-$$LIBVERSION | ||
| LIBS += -L../../../libmyth -lmyth-$$LIBVERSION | ||
| LIBS += -L../../../../external/FFmpeg/libavcodec -lmythavcodec | ||
| LIBS += -L../../../../external/FFmpeg/libswscale -lmythswscale | ||
| LIBS += -L../../../../external/FFmpeg/libavformat -lmythavformat | ||
| LIBS += -L../../../../external/FFmpeg/libavutil -lmythavutil | ||
| LIBS += -L../../../../external/FFmpeg/libswresample -lmythswresample | ||
| LIBS += -L../../../../external/FFmpeg/libavfilter -lmythavfilter | ||
| LIBS += -L../../../../external/FFmpeg/libpostproc -lmythpostproc | ||
| using_mheg:LIBS += -L../../../libmythfreemheg -lmythfreemheg-$$LIBVERSION | ||
| LIBS += -L../.. -lmythtv-$$LIBVERSION | ||
|
|
||
| contains(QMAKE_CXX, "g++") { | ||
| QMAKE_CXXFLAGS += -O0 -fprofile-arcs -ftest-coverage | ||
| QMAKE_LFLAGS += -fprofile-arcs | ||
| } | ||
|
|
||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libavutil | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libswscale | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libavformat | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libavcodec | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libavfilter | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libpostproc | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../../external/FFmpeg/libswresample | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythbase | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmyth | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythui | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythupnp | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythservicecontracts | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../../../libmythfreemheg | ||
| QMAKE_LFLAGS += -Wl,$$_RPATH_$(PWD)/../.. | ||
|
|
||
| # Input | ||
| HEADERS += test_xine_demux.h | ||
| SOURCES += test_xine_demux.cpp | ||
|
|
||
| QMAKE_CLEAN += $(TARGET) | ||
| QMAKE_CLEAN += ; ( cd $(OBJECTS_DIR) && rm -f *.gcov *.gcda *.gcno ) | ||
|
|
||
| LIBS += $$EXTRA_LIBS $$LATE_LIBS | ||
|
|
||
| # Fix runtime linking | ||
| linux:QMAKE_LFLAGS += -Wl,--disable-new-dtags |