diff options
Diffstat (limited to 'src/plugins/test_mpeg.c')
-rw-r--r-- | src/plugins/test_mpeg.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/plugins/test_mpeg.c b/src/plugins/test_mpeg.c new file mode 100644 index 0000000..88d8bd6 --- /dev/null +++ b/src/plugins/test_mpeg.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | This file is part of libextractor. | ||
3 | (C) 2012 Vidyut Samanta and Christian Grothoff | ||
4 | |||
5 | libextractor is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | libextractor is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with libextractor; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file plugins/test_mpeg.c | ||
22 | * @brief testcase for mpeg plugin | ||
23 | * @author Christian Grothoff | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "test_lib.h" | ||
27 | |||
28 | |||
29 | |||
30 | /** | ||
31 | * Main function for the MPEG testcase. | ||
32 | * | ||
33 | * @param argc number of arguments (ignored) | ||
34 | * @param argv arguments (ignored) | ||
35 | * @return 0 on success | ||
36 | */ | ||
37 | int | ||
38 | main (int argc, char *argv[]) | ||
39 | { | ||
40 | struct SolutionData melt_sol[] = | ||
41 | { | ||
42 | { | ||
43 | EXTRACTOR_METATYPE_MIMETYPE, | ||
44 | EXTRACTOR_METAFORMAT_UTF8, | ||
45 | "text/plain", | ||
46 | "video/mpeg", | ||
47 | strlen ("video/mpeg") + 1, | ||
48 | 0 | ||
49 | }, | ||
50 | { | ||
51 | EXTRACTOR_METATYPE_IMAGE_DIMENSIONS, | ||
52 | EXTRACTOR_METAFORMAT_UTF8, | ||
53 | "text/plain", | ||
54 | "320x208", | ||
55 | strlen ("320x208") + 1, | ||
56 | 0 | ||
57 | }, | ||
58 | { | ||
59 | EXTRACTOR_METATYPE_FORMAT_VERSION, | ||
60 | EXTRACTOR_METAFORMAT_UTF8, | ||
61 | "text/plain", | ||
62 | "MPEG1", | ||
63 | strlen ("MPEG1") + 1, | ||
64 | 0 | ||
65 | }, | ||
66 | #if 0 | ||
67 | /* GOP is somehow not working for this example */ | ||
68 | { | ||
69 | EXTRACTOR_METATYPE_DURATION, | ||
70 | EXTRACTOR_METAFORMAT_UTF8, | ||
71 | "text/plain", | ||
72 | "0:0:0 (0 frames)", /* FIXME: this is obviously the wrong answer */ | ||
73 | strlen ("0:0:0 (0 frames)") + 1, | ||
74 | 0 | ||
75 | }, | ||
76 | #endif | ||
77 | { 0, 0, NULL, NULL, 0, -1 } | ||
78 | }; | ||
79 | struct ProblemSet ps[] = | ||
80 | { | ||
81 | { "testdata/mpeg_melt.mpg", | ||
82 | melt_sol }, | ||
83 | { NULL, NULL } | ||
84 | }; | ||
85 | return ET_main ("mpeg", ps); | ||
86 | } | ||
87 | |||
88 | /* end of test_mpeg.c */ | ||