Mercurial > mplayer.hg
annotate libvo/vo_md5.c @ 6055:3ca1f8cf7bfc
various updates by Diego Biurrun <diego@biurrun.de>
author | arpi |
---|---|
date | Sun, 12 May 2002 01:41:24 +0000 |
parents | 32e1f5042f65 |
children | eca7dbad0166 |
rev | line source |
---|---|
1 | 1 /* |
2 * video_out_pgm.c, pgm interface | |
3 * | |
4 * | |
5 * Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. | |
6 * | |
7 * Hacked into mpeg2dec by | |
8 * | |
9 * Aaron Holtzman <aholtzma@ess.engr.uvic.ca> | |
10 * | |
11 * 15 & 16 bpp support added by Franck Sicard <Franck.Sicard@solsoft.fr> | |
12 * | |
13 * Xv image suuport by Gerd Knorr <kraxel@goldbach.in-berlin.de> | |
14 */ | |
15 | |
16 #include <stdio.h> | |
17 #include <stdlib.h> | |
18 #include <string.h> | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
19 #include <errno.h> |
1 | 20 |
21 #include "config.h" | |
22 #include "video_out.h" | |
23 #include "video_out_internal.h" | |
24 | |
25 LIBVO_EXTERN (md5) | |
26 | |
27 static vo_info_t vo_info = | |
28 { | |
29 "MD5 sum", | |
30 "md5", | |
31 "walken", | |
32 "" | |
33 }; | |
34 | |
35 extern vo_functions_t video_out_pgm; | |
491 | 36 extern char vo_pgm_filename[24]; |
1 | 37 |
38 static FILE * md5_file; | |
39 | |
40 static uint32_t | |
4448
ab4ec4b99531
change init to config in vo_gl and vo_md5 like in the other vo_ modules -- fixes crash caused by the changeover
rfelker
parents:
4433
diff
changeset
|
41 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info) |
1 | 42 { |
43 md5_file = fopen ("md5", "w"); | |
4433 | 44 return video_out_pgm.config (width, height, d_width,d_height,fullscreen, title, format,info); |
1 | 45 } |
46 | |
47 static const vo_info_t* | |
48 get_info(void) | |
49 { | |
50 return &vo_info; | |
51 } | |
52 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
53 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
54 { |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
55 } |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
56 |
1 | 57 static void flip_page (void) |
58 { | |
491 | 59 char buf2[100]; |
60 FILE * f; | |
61 int i; | |
62 | |
63 video_out_pgm.flip_page(); | |
64 | |
1095 | 65 snprintf (buf2, 100, "md5sum %s", vo_pgm_filename); |
491 | 66 f = popen (buf2, "r"); |
67 i = fread (buf2, 1, sizeof(buf2), f); | |
68 pclose (f); | |
69 fwrite (buf2, 1, i, md5_file); | |
70 | |
71 remove (vo_pgm_filename); | |
72 | |
1 | 73 } |
74 | |
75 //static uint32_t draw_slice(uint8_t * src[], uint32_t slice_num) | |
76 static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) | |
77 { | |
491 | 78 return video_out_pgm.draw_slice(image,stride,w,h,x,y); |
1 | 79 } |
80 | |
491 | 81 //extern uint32_t output_pgm_frame (char * fname, uint8_t * src[]); |
1 | 82 |
83 static uint32_t draw_frame(uint8_t * src[]) | |
84 { | |
85 return 0; | |
86 } | |
87 | |
88 static uint32_t | |
89 query_format(uint32_t format) | |
90 { | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
91 return video_out_pgm.control(VOCTRL_QUERY_FORMAT, &format); |
1 | 92 } |
93 | |
94 | |
95 static void | |
96 uninit(void) | |
97 { | |
491 | 98 video_out_pgm.uninit(); |
99 fclose(md5_file); | |
1 | 100 } |
101 | |
102 | |
31 | 103 static void check_events(void) |
104 { | |
105 } | |
106 | |
4352 | 107 static uint32_t preinit(const char *arg) |
108 { | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
109 if(arg) |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
110 { |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
111 printf("vo_md5: Unknown subdevice: %s\n",arg); |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
112 return ENOSYS; |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
113 } |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
114 return 0; |
4352 | 115 } |
31 | 116 |
4596 | 117 static uint32_t control(uint32_t request, void *data, ...) |
4352 | 118 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
119 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
120 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
121 return query_format(*((uint32_t*)data)); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
122 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
123 return VO_NOTIMPL; |
4352 | 124 } |