Mercurial > mplayer.hg
comparison libvo/vo_md5.c @ 1:3b5f5d1c5041
Initial revision
author | arpi_esp |
---|---|
date | Sat, 24 Feb 2001 20:28:24 +0000 |
parents | |
children | 2184c8945d42 |
comparison
equal
deleted
inserted
replaced
0:c1bb2c071d63 | 1:3b5f5d1c5041 |
---|---|
1 #define DISP | |
2 | |
3 /* | |
4 * video_out_pgm.c, pgm interface | |
5 * | |
6 * | |
7 * Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. | |
8 * | |
9 * Hacked into mpeg2dec by | |
10 * | |
11 * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> | |
12 * | |
13 * 15 & 16 bpp support added by Franck Sicard <Franck.Sicard@solsoft.fr> | |
14 * | |
15 * Xv image suuport by Gerd Knorr <kraxel@goldbach.in-berlin.de> | |
16 */ | |
17 | |
18 #include <stdio.h> | |
19 #include <stdlib.h> | |
20 #include <string.h> | |
21 | |
22 #include "config.h" | |
23 #include "video_out.h" | |
24 #include "video_out_internal.h" | |
25 | |
26 LIBVO_EXTERN (md5) | |
27 | |
28 static vo_info_t vo_info = | |
29 { | |
30 "MD5 sum", | |
31 "md5", | |
32 "walken", | |
33 "" | |
34 }; | |
35 | |
36 extern vo_functions_t video_out_pgm; | |
37 | |
38 static FILE * md5_file; | |
39 static int framenum = -2; | |
40 | |
41 static uint32_t | |
42 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) | |
43 { | |
44 md5_file = fopen ("md5", "w"); | |
45 return video_out_pgm.init (width, height, d_width,d_height,fullscreen, title, format); | |
46 } | |
47 | |
48 static const vo_info_t* | |
49 get_info(void) | |
50 { | |
51 return &vo_info; | |
52 } | |
53 | |
54 static void flip_page (void) | |
55 { | |
56 } | |
57 | |
58 //static uint32_t draw_slice(uint8_t * src[], uint32_t slice_num) | |
59 static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) | |
60 { | |
61 return 0; | |
62 } | |
63 | |
64 extern uint32_t output_pgm_frame (char * fname, uint8_t * src[]); | |
65 | |
66 static uint32_t draw_frame(uint8_t * src[]) | |
67 { | |
68 char buf[100]; | |
69 char buf2[100]; | |
70 FILE * f; | |
71 int i; | |
72 | |
73 if (++framenum < 0) | |
74 return 0; | |
75 | |
76 sprintf (buf, "%d.pgm", framenum); | |
77 output_pgm_frame (buf, src); | |
78 | |
79 sprintf (buf2, "md5sum %s", buf); | |
80 f = popen (buf2, "r"); | |
81 i = fread (buf2, 1, sizeof(buf2), f); | |
82 pclose (f); | |
83 fwrite (buf2, 1, i, md5_file); | |
84 | |
85 remove (buf); | |
86 | |
87 return 0; | |
88 } | |
89 | |
90 static uint32_t | |
91 query_format(uint32_t format) | |
92 { | |
93 switch(format){ | |
94 case IMGFMT_YV12: | |
95 return 1; | |
96 } | |
97 return 0; | |
98 } | |
99 | |
100 | |
101 static void | |
102 uninit(void) | |
103 { | |
104 } | |
105 | |
106 |