1
|
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 {
|
15
|
93 // switch(format){
|
|
94 // case IMGFMT_YV12:
|
|
95 // return 1;
|
|
96 // }
|
1
|
97 return 0;
|
|
98 }
|
|
99
|
|
100
|
|
101 static void
|
|
102 uninit(void)
|
|
103 {
|
|
104 }
|
|
105
|
|
106
|
31
|
107 static void check_events(void)
|
|
108 {
|
|
109 }
|
|
110
|
|
111
|