Mercurial > mplayer.hg
annotate libvo/vo_md5sum.c @ 13777:50b4c7da30b5
lavcresample & sweep filters
author | michael |
---|---|
date | Wed, 27 Oct 2004 18:16:24 +0000 |
parents | 07708ec98d87 |
children | 3673ad04ebfb |
rev | line source |
---|---|
13395
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
1 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
2 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
3 /* |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
4 * vo_md5sum.c, md5sum Video Output Driver for MPlayer |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
5 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
6 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
7 * Written by Ivo van Poorten. (GPL)2004 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
8 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
9 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
10 * Changelog |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
11 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
12 * 2004-09-13 First draft. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
13 * 2004-09-16 Second draft. It now acts on VOCTRL_DRAW_IMAGE and does not |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
14 * maintain a local copy of the image if the format is YV12. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
15 * Speed improvement and uses less memory. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
16 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
17 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
18 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
19 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
20 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
21 /* Global Includes */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
22 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
23 #include <stdio.h> |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
24 #include <stdlib.h> |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
25 #include <string.h> |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
26 #include <errno.h> |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
27 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
28 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
29 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
30 /* Local Includes */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
31 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
32 #include "config.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
33 #include "mp_msg.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
34 #include "video_out.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
35 #include "video_out_internal.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
36 #include "mplayer.h" /* for exit_player() */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
37 #include "help_mp.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
38 #include "md5sum.h" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
39 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
40 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
41 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
42 /* Defines */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
43 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
44 /* Used for temporary buffers to store file- and pathnames */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
45 #define BUFLENGTH 512 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
46 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
47 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
48 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
49 /* Info */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
50 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
51 static vo_info_t info= |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
52 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
53 "md5sum of each frame", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
54 "md5sum", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
55 "Ivo van Poorten (ivop@euronet.nl)", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
56 "" |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
57 }; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
58 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
59 LIBVO_EXTERN (md5sum) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
60 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
61 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
62 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
63 /* Global Variables */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
64 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
65 char *md5sum_outfile = NULL; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
66 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
67 FILE *md5sum_fd; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
68 int framenum = 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
69 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
70 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
71 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
72 /** \brief Memory allocation failed. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
73 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
74 * The video output driver failed to allocate a block of memory it needed. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
75 * It displays a message and exits the player. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
76 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
77 * \return nothing It does not return. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
78 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
79 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
80 void md5sum_malloc_failed(void) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
81 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s\n", info.short_name, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
82 MSGTR_MemAllocFailed); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
83 exit_player(MSGTR_Exit_error); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
84 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
85 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
86 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
87 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
88 /** \brief An error occured while writing to a file. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
89 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
90 * The program failed to write data to a file. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
91 * It displays a message and exits the player. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
92 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
93 * \return nothing It does not return. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
94 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
95 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
96 void md5sum_write_error(void) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
97 mp_msg(MSGT_VO, MSGL_ERR, MSGTR_ErrorWritingFile, info.short_name); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
98 exit_player(MSGTR_Exit_error); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
99 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
100 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
101 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
102 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
103 /** \brief Pre-initialisation. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
104 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
105 * This function is called before initialising the video output driver. It |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
106 * parses all suboptions and sets variables accordingly. If an error occurs |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
107 * (like an option being out of range, not having any value or an unknown |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
108 * option is stumbled upon) the player will exit. It also sets default |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
109 * values if necessary. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
110 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
111 * \param arg A string containing all the suboptions passed to the video |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
112 * output driver. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
113 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
114 * \return 0 All went well. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
115 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
116 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
117 static uint32_t preinit(const char *arg) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
118 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
119 char *buf; /* buf is used to store parsed string values */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
120 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
121 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
122 MSGTR_VO_ParsingSuboptions); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
123 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
124 if (arg) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
125 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
126 while (*arg != '\0') { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
127 if (!strncmp(arg, ":", 1)) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
128 arg++; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
129 continue; /* multiple ':' is not really an error */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
130 } else if (!strncmp(arg, "outfile=", 8)) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
131 arg += 8; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
132 buf = malloc(strlen(arg)+1); /* maximum length possible */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
133 if (!buf) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
134 md5sum_malloc_failed(); /* message and exit_player! */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
135 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
136 if (sscanf(arg, "%[^:]", buf) == 1) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
137 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %s\n", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
138 info.short_name, "outfile", buf); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
139 arg += strlen(buf); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
140 md5sum_outfile = strdup(buf); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
141 if (!md5sum_outfile) md5sum_malloc_failed(); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
142 free(buf); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
143 } else { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
144 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
145 info.short_name, "outfile", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
146 MSGTR_VO_NoValueSpecified); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
147 exit_player(MSGTR_Exit_error); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
148 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
149 } else { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
150 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %-20s...\n", info.short_name, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
151 MSGTR_VO_UnknownSuboptions, arg); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
152 exit_player(MSGTR_Exit_error); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
153 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
154 } /* end while */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
155 } /* endif */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
156 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
157 /* If md5sum_outfile is not set by an option, resort to default of |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
158 "md5sums" */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
159 if (!md5sum_outfile) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
160 md5sum_outfile = strdup("md5sums"); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
161 if (!md5sum_outfile) md5sum_malloc_failed(); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
162 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
163 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
164 mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
165 MSGTR_VO_SuboptionsParsedOK); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
166 return 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
167 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
168 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
169 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
170 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
171 /** \brief Configure the video output driver. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
172 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
173 * This functions configures the video output driver. It opens the output |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
174 * file to which this driver will write all the MD5 sums. If something |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
175 * goes wrong, the player will exit. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
176 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
177 * \return 0 All went well. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
178 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
179 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
180 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
181 uint32_t d_height, uint32_t fullscreen, char *title, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
182 uint32_t format) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
183 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
184 if (vo_config_count > 0 ) { /* Already configured */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
185 return 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
186 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
187 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
188 if ( (md5sum_fd = fopen(md5sum_outfile, "w") ) == NULL ) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
189 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
190 MSGTR_VO_CantCreateFile); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
191 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
192 info.short_name, MSGTR_VO_GenericError, strerror(errno) ); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
193 exit_player(MSGTR_Exit_error); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
194 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
195 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
196 return 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
197 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
198 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
199 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
200 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
201 /** \brief Write MD5 sum to output file. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
202 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
203 * This function writes an ASCII representation of a 16-byte hexadecimal |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
204 * MD5 sum to our output file. The file descriptor is a global variable. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
205 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
206 * \param md5sum Sixteen bytes that represent an MD5 sum. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
207 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
208 * \return None The player will exit if a write error occurs. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
209 */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
210 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
211 static void md5sum_output_sum(unsigned char *md5sum) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
212 int i; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
213 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
214 for(i=0; i<16; i++) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
215 if ( fprintf(md5sum_fd, "%02x", md5sum[i]) < 0 ) md5sum_write_error(); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
216 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
217 if ( fprintf(md5sum_fd, " frame%08d\n", framenum) < 0 ) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
218 md5sum_write_error(); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
219 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
220 framenum++; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
221 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
222 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
223 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
224 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
225 static uint32_t draw_frame(uint8_t *src[]) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
226 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
227 mp_msg(MSGT_VO, MSGL_V, "%s: draw_frame() is called!\n", info.short_name); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
228 return -1; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
229 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
230 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
231 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
232 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
233 static uint32_t draw_image(mp_image_t *mpi) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
234 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
235 unsigned char md5sum[16]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
236 uint32_t w = mpi->w; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
237 uint32_t h = mpi->h; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
238 uint8_t *rgbimage = mpi->planes[0]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
239 uint8_t *planeY = mpi->planes[0]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
240 uint8_t *planeU = mpi->planes[1]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
241 uint8_t *planeV = mpi->planes[2]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
242 uint32_t strideY = mpi->stride[0]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
243 uint32_t strideU = mpi->stride[1]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
244 uint32_t strideV = mpi->stride[2]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
245 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
246 auth_md5Ctx md5_context; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
247 int i; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
248 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
249 if (mpi->flags & MP_IMGFLAG_PLANAR) { /* Planar */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
250 if (mpi->flags & MP_IMGFLAG_YUV) { /* Planar YUV */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
251 auth_md5InitCtx(&md5_context); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
252 for (i=0; i<h; i++) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
253 auth_md5SumCtx(&md5_context, planeY + i * strideY, w); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
254 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
255 w = w / 2; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
256 h = h / 2; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
257 for (i=0; i<h; i++) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
258 auth_md5SumCtx(&md5_context, planeU + i * strideU, w); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
259 auth_md5SumCtx(&md5_context, planeV + i * strideV, w); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
260 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
261 auth_md5CloseCtx(&md5_context, md5sum); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
262 md5sum_output_sum(md5sum); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
263 return VO_TRUE; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
264 } else { /* Planar RGB */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
265 return VO_FALSE; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
266 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
267 } else { /* Packed */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
268 if (mpi->flags & MP_IMGFLAG_YUV) { /* Packed YUV */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
269 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
270 return VO_FALSE; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
271 } else { /* Packed RGB */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
272 auth_md5Sum(md5sum, rgbimage, mpi->w * (mpi->bpp >> 3) * mpi->h); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
273 md5sum_output_sum(md5sum); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
274 return VO_TRUE; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
275 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
276 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
277 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
278 return VO_FALSE; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
279 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
280 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
281 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
282 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
283 static uint32_t draw_slice(uint8_t *src[], int stride[], int w, int h, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
284 int x, int y) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
285 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
286 return 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
287 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
288 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
289 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
290 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
291 static uint32_t query_format(uint32_t format) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
292 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
293 switch (format) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
294 case IMGFMT_RGB24: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
295 case IMGFMT_YV12: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
296 return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
297 default: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
298 return 0; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
299 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
300 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
301 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
302 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
303 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
304 static uint32_t control(uint32_t request, void *data, ...) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
305 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
306 switch (request) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
307 case VOCTRL_QUERY_FORMAT: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
308 return query_format(*((uint32_t*)data)); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
309 case VOCTRL_DRAW_IMAGE: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
310 return draw_image(data); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
311 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
312 return VO_NOTIMPL; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
313 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
314 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
315 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
316 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
317 static void uninit(void) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
318 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
319 if (md5sum_outfile) { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
320 free(md5sum_outfile); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
321 md5sum_outfile = NULL; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
322 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
323 if (md5sum_fd) fclose(md5sum_fd); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
324 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
325 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
326 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
327 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
328 static void check_events(void) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
329 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
330 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
331 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
332 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
333 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
334 static void draw_osd(void) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
335 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
336 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
337 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
338 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
339 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
340 static void flip_page (void) |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
341 { |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
342 } |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
343 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
344 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
345 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
346 #undef BUFLENGTH |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
347 #undef MD5SUM_RGB_MODE |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
348 #undef MD5SUM_YUV_MODE |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
349 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
350 /* ------------------------------------------------------------------------- */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
351 |