Mercurial > mplayer.hg
annotate libvo/vo_md5.c @ 10788:c11c87536da4
some updates
author | alex |
---|---|
date | Mon, 01 Sep 2003 19:11:44 +0000 |
parents | 5b39e79af5fe |
children | e5fa67e8907e |
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 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
25 static vo_info_t info = |
1 | 26 { |
27 "MD5 sum", | |
28 "md5", | |
29 "walken", | |
30 "" | |
31 }; | |
32 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
33 LIBVO_EXTERN (md5) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
34 |
1 | 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 | |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
4737
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) |
1 | 42 { |
43 md5_file = fopen ("md5", "w"); | |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
4737
diff
changeset
|
44 return video_out_pgm.config (width, height, d_width,d_height,fullscreen, title, format); |
1 | 45 } |
46 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
47 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
48 { |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
49 } |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1095
diff
changeset
|
50 |
1 | 51 static void flip_page (void) |
52 { | |
491 | 53 char buf2[100]; |
54 FILE * f; | |
55 int i; | |
56 | |
57 video_out_pgm.flip_page(); | |
58 | |
1095 | 59 snprintf (buf2, 100, "md5sum %s", vo_pgm_filename); |
491 | 60 f = popen (buf2, "r"); |
61 i = fread (buf2, 1, sizeof(buf2), f); | |
62 pclose (f); | |
63 fwrite (buf2, 1, i, md5_file); | |
64 | |
65 remove (vo_pgm_filename); | |
66 | |
1 | 67 } |
68 | |
69 //static uint32_t draw_slice(uint8_t * src[], uint32_t slice_num) | |
70 static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) | |
71 { | |
491 | 72 return video_out_pgm.draw_slice(image,stride,w,h,x,y); |
1 | 73 } |
74 | |
491 | 75 //extern uint32_t output_pgm_frame (char * fname, uint8_t * src[]); |
1 | 76 |
77 static uint32_t draw_frame(uint8_t * src[]) | |
78 { | |
79 return 0; | |
80 } | |
81 | |
82 static uint32_t | |
83 query_format(uint32_t format) | |
84 { | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
85 return video_out_pgm.control(VOCTRL_QUERY_FORMAT, &format); |
1 | 86 } |
87 | |
88 | |
89 static void | |
90 uninit(void) | |
91 { | |
491 | 92 video_out_pgm.uninit(); |
93 fclose(md5_file); | |
1 | 94 } |
95 | |
96 | |
31 | 97 static void check_events(void) |
98 { | |
99 } | |
100 | |
4352 | 101 static uint32_t preinit(const char *arg) |
102 { | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
103 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
|
104 { |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
105 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
|
106 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
|
107 } |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4596
diff
changeset
|
108 return 0; |
4352 | 109 } |
31 | 110 |
4596 | 111 static uint32_t control(uint32_t request, void *data, ...) |
4352 | 112 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
113 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
114 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
115 return query_format(*((uint32_t*)data)); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
116 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
117 return VO_NOTIMPL; |
4352 | 118 } |