Mercurial > mplayer.hg
annotate libvo/vo_bl.c @ 36536:a2bf6994df8c
vo_bl: RGB output support.
Patch by Stefan Schuermans [stefan blinkenarea org].
author | reimar |
---|---|
date | Sun, 19 Jan 2014 12:06:03 +0000 |
parents | 9bd54104cdee |
children | 3b2228019b6a |
rev | line source |
---|---|
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
1 /* |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
2 * playback using the Blinkenlights UDP protocol (and to files) |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
3 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
4 * UDP socket handling copied from bsender.c part of blib-0.6: |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
5 * http://sven.gimp.org/blinkenlights/ |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
6 * copyright (c) 2001-2001 The Blinkenlights Crew: |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
7 * Sven Neumann <sven@gimp.org> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
8 * Michael Natterer <mitch@gimp.org> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
9 * Daniel Mack <daniel@yoobay.net> |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
10 * copyright (C) 2004 Stefan Schuermans <1stein@schuermans.info> |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
11 * other stuff: copyright (C) 2002 Rik Snel |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
12 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
13 * This file is part of MPlayer. |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
14 * |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
15 * MPlayer is free software; you can redistribute it and/or modify |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
16 * it under the terms of the GNU General Public License as published by |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
17 * the Free Software Foundation; either version 2 of the License, or |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
18 * (at your option) any later version. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
19 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
20 * MPlayer is distributed in the hope that it will be useful, |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
23 * GNU General Public License for more details. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
24 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
25 * You should have received a copy of the GNU General Public License along |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
26 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
27481
diff
changeset
|
27 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
28 */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
29 |
33842
a4efd6c16f8a
vo_bl: Move config.h #include to the top of the #include list.
diego
parents:
33412
diff
changeset
|
30 #include "config.h" |
a4efd6c16f8a
vo_bl: Move config.h #include to the top of the #include list.
diego
parents:
33412
diff
changeset
|
31 |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
32 #include <stdio.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
33 #include <stdlib.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
34 #include <string.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
35 #include <unistd.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
36 #include <fcntl.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
37 #include <errno.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
38 #include <sys/stat.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
39 #include <sys/types.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
40 #include <sys/time.h> |
33412
2a2e9b6551d8
configure: Convert HAVE_SYS_MMAN_H into a 0/1 definition.
diego
parents:
33305
diff
changeset
|
41 #if HAVE_SYS_MMAN_H |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
42 #include <sys/mman.h> |
26105 | 43 #endif |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
44 #include <sys/ioctl.h> |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
45 |
10281 | 46 #include <netdb.h> |
47 #include <sys/socket.h> | |
48 #include <netinet/in.h> | |
49 | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
50 #include "video_out.h" |
36495 | 51 #define NO_DRAW_FRAME |
52 #define NO_DRAW_SLICE | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
53 #include "video_out_internal.h" |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
13000
diff
changeset
|
54 #include "mp_msg.h" |
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
13000
diff
changeset
|
55 #include "m_option.h" |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
56 #include "fastmemcpy.h" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
57 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
58 static const vo_info_t info = |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
59 { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
60 "Blinkenlights driver: http://www.blinkenlights.de", |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
61 "bl", |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
62 "Rik Snel <snel@phys.uu.nl>", |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
63 "" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
64 }; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
65 |
25220
c9e9ac2008c2
Mark the vo_functions_t definitions as const where possible.
reimar
parents:
25216
diff
changeset
|
66 const LIBVO_EXTERN (bl) |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7326
diff
changeset
|
67 |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
68 /* General variables */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
69 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
70 static unsigned char *image = NULL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
71 static unsigned char *tmp = NULL; |
25521
5b70080c41d2
Remove unused static variables, fixes the warnings:
diego
parents:
25520
diff
changeset
|
72 static int framenum; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
73 static char *bl_subdevice = NULL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
74 static int prevpts = -1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
75 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
76 typedef struct { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
77 char *name; /* filename */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
78 FILE *fp; |
15158
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
79 int header_written; /* if header was written already */ |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
80 } bl_file_t; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
81 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
82 typedef struct { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
83 char *name; /* hostname */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
84 int port; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
85 int fd; /* file descriptor */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
86 } bl_host_t; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
87 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
88 typedef struct { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
89 char *name; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
90 int img_format; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
91 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
92 int channels; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
93 int width; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
94 int height; |
36535 | 95 int bpc; /* bits per component: bpc = 8, channels = 3 => bpp = 24*/ |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
96 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
97 /* file output functions */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
98 int (*init_file)(bl_file_t *file); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
99 void (*write_frame)(bl_file_t *file, unsigned char *i, int duration); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
100 void (*close_file)(bl_file_t *file); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
101 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
102 /* network output functions */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
103 int (*init_connection)(bl_host_t *host); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
104 void (*send_frame)(bl_host_t *host); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
105 void (*close_connection)(bl_host_t *host); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
106 } bl_properties_t; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
107 |
36498 | 108 static bl_properties_t *bl; |
109 static bl_properties_t cur_bl; | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
110 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
111 /* arbitrary limit because I am too lazy to do proper memory management */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
112 #define BL_MAX_FILES 16 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
113 #define BL_MAX_HOSTS 16 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
114 static bl_file_t bl_files[BL_MAX_FILES]; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
115 static bl_host_t bl_hosts[BL_MAX_HOSTS]; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
116 static int no_bl_files = 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
117 static int no_bl_hosts = 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
118 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
119 typedef struct { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
120 uint32_t magic; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
121 uint16_t height; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
122 uint16_t width; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
123 uint16_t channels; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
124 uint16_t maxval; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
125 unsigned char data[0]; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
126 } bl_packet_t; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
127 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
128 static bl_packet_t *bl_packet = NULL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
129 static int bl_size; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
130 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
131 /* bml output functions */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
132 static int bml_init(bl_file_t *f) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
133 f->fp = fopen(f->name, "w"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
134 if (!f->fp) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
135 mp_msg(MSGT_VO, MSGL_ERR, "bl: error opening %s\n", f->name); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
136 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
137 } |
15158
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
138 f->header_written = 0; |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
139 return 0; |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
140 } |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
141 |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
142 static void bml_write_frame(bl_file_t *f, unsigned char *i, int duration) { |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
143 int j, k; |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
144 if( ! f->header_written ) |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
145 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
146 fprintf(f->fp, |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
147 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
148 "<blm width=\"%d\" height=\"%d\" bits=\"%d\" channels=\"%d\">\n" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
149 " <header>\n" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
150 " <title>Movie autogenerated by MPlayer</title>\n" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
151 " <url>http://www.mplayerhq.hu</url>\n" |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
152 " </header>\n", bl->width, bl->height, bl->bpc, bl->channels); |
15158
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
153 f->header_written = 1; |
d570dfbf9ef6
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
13787
diff
changeset
|
154 } |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
155 fprintf(f->fp, " <frame duration=\"%d\">\n", duration); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
156 for (j = 0; j < bl->height; j++) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
157 fprintf(f->fp, " <row>"); |
36513 | 158 for (k = 0; k < bl->width * bl->channels; k++) |
36514
855d2d796453
vo_bl: cosmetics, use more readable array indexing syntax.
reimar
parents:
36513
diff
changeset
|
159 fprintf(f->fp, "%02x", i[j * bl->width * bl->channels + k]); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
160 fprintf(f->fp, "</row>\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
161 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
162 fprintf(f->fp, " </frame>\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
163 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
164 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
165 static void bml_close(bl_file_t *f) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
166 fprintf(f->fp, "</blm>\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
167 fclose(f->fp); |
36502 | 168 f->fp = NULL; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
169 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
170 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
171 /* Blinkenlights UDP protocol */ |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
172 static int udp_init(bl_host_t *h) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
173 struct sockaddr_in addr; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
174 struct hostent *dest; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
175 |
36501
d0234dff2dc4
vo_bl: move assignment to a place where it actuall has an effect.
reimar
parents:
36500
diff
changeset
|
176 h->fd = -1; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
177 dest = gethostbyname(h->name); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
178 if (!dest) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
179 mp_msg(MSGT_VO, MSGL_ERR, |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
180 "unable to resolve host %s\n", h->name); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
181 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
182 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
183 |
28697
5b749a93fc89
Use memset to make sure all parts of struct sockaddr_in are always initialized.
reimar
parents:
27509
diff
changeset
|
184 memset(&addr, 0, sizeof(addr)); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
185 addr.sin_family = AF_INET; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
186 addr.sin_port = htons(h->port); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
187 |
23458
973e53dc7df5
Do not use fast_memcpy for small size copy, esp. when the size is constant
reimar
parents:
23457
diff
changeset
|
188 memcpy(&addr.sin_addr.s_addr, dest->h_addr_list[0], dest->h_length); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
189 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
190 h->fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
191 if (h->fd < 0) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
192 mp_msg(MSGT_VO, MSGL_ERR, |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
193 "couldn't create socket for %s\n", h->name); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
194 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
195 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
196 if (connect(h->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
197 mp_msg(MSGT_VO, MSGL_ERR, "couldn't connect socket for %s\n", |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
198 h->name); |
27481
03c589c49c6d
Remove Windows-specific #ifdefs, the file does not compile on MinGW anyway.
diego
parents:
27474
diff
changeset
|
199 close(h->fd); |
36502 | 200 h->fd = -1; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
201 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
202 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
203 return 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
204 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
205 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
206 static void udp_send(bl_host_t *h) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
207 if (send(h->fd, bl_packet, bl_size, 0) != bl_size) |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
208 mp_msg(MSGT_VO, MSGL_ERR, "unable to send to %s\n", h->name); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
209 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
210 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
211 static void udp_close(bl_host_t *h) { |
27481
03c589c49c6d
Remove Windows-specific #ifdefs, the file does not compile on MinGW anyway.
diego
parents:
27474
diff
changeset
|
212 close(h->fd); |
36502 | 213 h->fd = -1; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
214 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
215 |
36536 | 216 #define NO_BLS 4 |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
217 |
36498 | 218 static const bl_properties_t bls[NO_BLS] = { |
36496 | 219 { "hdl", IMGFMT_Y8, 1, 18, 8, 8, |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
220 &bml_init, &bml_write_frame, &bml_close, |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
221 &udp_init, &udp_send, &udp_close }, |
36496 | 222 { "arcade", IMGFMT_Y8, 1, 26, 20, 8, |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
223 &bml_init, &bml_write_frame, &bml_close, |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
224 &udp_init, &udp_send, &udp_close }, |
36496 | 225 { "grayscale", IMGFMT_Y8, 1, -1, -1, 8, /* use width and height of movie */ |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
226 &bml_init, &bml_write_frame, &bml_close, |
36536 | 227 &udp_init, &udp_send, &udp_close }, |
228 { "rgb", IMGFMT_RGB24, 3, -1, -1, 8, /* use width and height of movie */ | |
229 &bml_init, &bml_write_frame, &bml_close, | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
230 &udp_init, &udp_send, &udp_close } }; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
231 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
232 static int config(uint32_t width, uint32_t height, uint32_t d_width, |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
15158
diff
changeset
|
233 uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
234 { |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
235 void * ptr; |
36498 | 236 int reset_width = bl->width < 0; |
237 int reset_height = bl->height < 0; | |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
238 |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
239 /* adapt size of Blinkenlights UDP stream to size of movie */ |
36509 | 240 if (reset_width) bl->width = width; /* use width of movie */ |
241 if (reset_height) bl->height = height; /* use height of movie */ | |
242 | |
36511
6e88ef2077a4
vo_bl: Simplify/avoid duplicating size calculations.
reimar
parents:
36510
diff
changeset
|
243 bl_size = 12 + bl->width*bl->height*bl->channels; |
6e88ef2077a4
vo_bl: Simplify/avoid duplicating size calculations.
reimar
parents:
36510
diff
changeset
|
244 |
36510 | 245 /* check for maximum size of UDP packet */ |
36511
6e88ef2077a4
vo_bl: Simplify/avoid duplicating size calculations.
reimar
parents:
36510
diff
changeset
|
246 if (bl_size > 65507) { |
36510 | 247 mp_msg(MSGT_VO, MSGL_ERR, "bl: %dx%d-%d does not fit into an UDP packet\n", |
248 bl->width, bl->height, bl->channels); | |
249 goto err_out; | |
250 } | |
36508 | 251 |
36510 | 252 /* resize or allocate frame and tmp buffers */ |
36512 | 253 free(bl_packet); |
254 bl_packet = calloc(bl_size, 1); /* space for header and image data */ | |
255 if (!bl_packet) { | |
36510 | 256 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n"); |
257 goto err_out; | |
258 } | |
36512 | 259 image = ((unsigned char*)bl_packet + 12); /* pointer to image data */ |
36510 | 260 |
36511
6e88ef2077a4
vo_bl: Simplify/avoid duplicating size calculations.
reimar
parents:
36510
diff
changeset
|
261 ptr = realloc(tmp, bl_size); /* space for image data only, could be slightly smaller */ |
36510 | 262 if (!ptr) { |
263 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n"); | |
264 goto err_out; | |
265 } | |
266 tmp = ptr; | |
36508 | 267 |
268 bl_packet->magic = htonl(0x23542666); | |
269 bl_packet->width = htons(bl->width); | |
270 bl_packet->height = htons(bl->height); | |
271 bl_packet->channels = htons(bl->channels); | |
272 bl_packet->maxval = htons((1 << bl->bpc) - 1); | |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
273 |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
274 framenum = 0; |
36536 | 275 if (format != bl->img_format) { |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
276 mp_msg(MSGT_VO, MSGL_ERR, "vo_bl called with wrong format"); |
36498 | 277 goto err_out; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
278 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
279 if (width > bl->width) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
280 mp_msg(MSGT_VO, MSGL_ERR, "bl: width of movie too large %d > %d\n", width, bl->width); |
36498 | 281 goto err_out; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
282 } |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
283 if (height > bl->height) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
284 mp_msg(MSGT_VO, MSGL_ERR, "bl: height of movie too large %d > %d\n", height, bl->height); |
36498 | 285 goto err_out; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
286 } |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
287 mp_msg(MSGT_VO, MSGL_V, "vo_config bl called\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
288 return 0; |
36498 | 289 err_out: |
290 // undo changes that might make variables mismatch | |
291 // our actual allocations | |
292 if (reset_width) bl->width = -1; | |
293 if (reset_height) bl->height = -1; | |
294 return 1; | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
295 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
296 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
297 static void draw_osd(void) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
298 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
299 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
300 static void flip_page (void) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
301 int i; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
302 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
303 if (prevpts >= 0) for (i = 0; i < no_bl_files; i++) |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
304 bl->write_frame(&bl_files[i], tmp, (vo_pts - prevpts)/90); |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22283
diff
changeset
|
305 fast_memcpy(tmp, image, bl->width*bl->height*bl->channels); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
306 prevpts = vo_pts; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
307 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
308 for (i = 0; i < no_bl_hosts; i++) bl->send_frame(&bl_hosts[i]); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
309 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
310 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
311 framenum++; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
312 return; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
313 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
314 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15952
diff
changeset
|
315 static int query_format(uint32_t format) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
316 if (format == bl->img_format) |
36495 | 317 return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE|VOCAP_NOSLICES; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
318 return 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
319 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
320 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
321 static void uninit(void) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
322 int i; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
323 mp_msg(MSGT_VO, MSGL_V, "bl: uninit called\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
324 free(bl_packet); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
325 bl_packet = NULL; |
36499 | 326 free(tmp); |
327 tmp = NULL; | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
328 free(bl_subdevice); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
329 bl_subdevice = NULL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
330 for (i = 0; i < no_bl_files; i++) bl->close_file(&bl_files[i]); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
331 for (i = 0; i < no_bl_hosts; i++) bl->close_connection(&bl_hosts[i]); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
332 no_bl_files = 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
333 no_bl_hosts = 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
334 bl = NULL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
335 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
336 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
337 static void check_events(void) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
338 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
339 |
36495 | 340 static uint32_t draw_image(mp_image_t *mpi) { |
36513 | 341 memcpy_pic(image, mpi->planes[0], mpi->w * bl->channels, mpi->h, |
342 bl->width * bl->channels, mpi->stride[0]); | |
36495 | 343 return VO_TRUE; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
344 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
345 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15952
diff
changeset
|
346 static int preinit(const char *arg) { |
36505 | 347 char *p; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
348 int end = 0, i; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
349 if (!arg || strlen(arg) == 0) { |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
350 mp_msg(MSGT_VO, MSGL_ERR, "bl: subdevice must be given, example: -vo bl:arcade:host=localhost:2323\n"); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
351 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
352 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
353 |
36500 | 354 bl_subdevice = strdup(arg); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
355 if (!bl_subdevice) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
356 mp_msg(MSGT_VO, MSGL_ERR, "bl: out of memory error\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
357 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
358 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
359 p = bl_subdevice; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
360 mp_msg(MSGT_VO, MSGL_V, "bl: preinit called with %s\n", arg); |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
361 for (i = 0; i < NO_BLS; i++) { |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
362 if (!strncmp(p, bls[i].name, strlen(bls[i].name))) |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
363 break; |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
364 } |
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
365 if (i >= NO_BLS) { |
36505 | 366 char txt[256]; |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
367 txt[0] = 0; |
36504 | 368 for (i = 0; i < NO_BLS; i++) { |
369 int pos = strlen(txt); | |
370 snprintf(txt + pos, sizeof(txt) - pos, "%s%s", | |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
371 txt[0] == 0 ? "" : i == NO_BLS - 1 ? " or " : ", ", bls[i].name ); |
36504 | 372 } |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
373 mp_msg(MSGT_VO, MSGL_ERR, "bl: subdevice must start with %s\nbl: i.e. -vo bl:arcade:host=localhost:2323\n", txt); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
374 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
375 } |
36498 | 376 // Global data arrays should not be modified, otherwise behaviour |
377 // becomes too confusing. | |
378 cur_bl = bls[i]; | |
379 bl = &cur_bl; | |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
380 p += strlen(bls[i].name); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
381 if (*p == '\0') { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
382 no_bl_hosts = 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
383 bl_hosts[0].name = "localhost"; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
384 bl_hosts[0].port = 2323; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
385 mp_msg(MSGT_VO, MSGL_V, "bl: no hosts/files specified, using localhost:2323\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
386 end = 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
387 } else if (*p != ':') { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
388 mp_msg(MSGT_VO, MSGL_ERR, "bl: syntax error in subdevice\n"); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
389 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
390 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
391 p++; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
392 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
393 while (!end) { |
36505 | 394 char *q = p + 5; |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
395 if (!strncmp(p, "file=", 5)) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
396 if (no_bl_files == BL_MAX_FILES) { |
13000
076e87baf7c0
--Patch by Stefan '1stein' Schuermans <1stein@schuermans.info>:
rik
parents:
10594
diff
changeset
|
397 mp_msg(MSGT_VO, MSGL_ERR, "bl: maximum number of files reached (%d)\n", BL_MAX_FILES); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
398 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
399 } |
36507 | 400 p = q; |
36506 | 401 q += strcspn(q, ","); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
402 if (*q == '\0') end = 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
403 *q = '\0'; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
404 bl_files[no_bl_files].name = p; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
405 mp_msg(MSGT_VO, MSGL_V, "blfile[%d]: %s\n", |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
406 no_bl_files, p); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
407 no_bl_files++; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
408 } else if (!strncmp(p, "host=", 5)) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
409 if (no_bl_hosts == BL_MAX_HOSTS) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
410 mp_msg(MSGT_VO, MSGL_ERR, "bl: maximum number of hosts reached (%d)\n", BL_MAX_HOSTS); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
411 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
412 } |
36507 | 413 p = q; |
36506 | 414 q += strcspn(q, ",:"); |
36507 | 415 |
416 bl_hosts[no_bl_hosts].port = 2323; // default port | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
417 if (*q == ':') { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
418 *q++ = '\0'; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
419 bl_hosts[no_bl_hosts].port = atoi(q); |
36506 | 420 q += strcspn(q, ","); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
421 } |
36507 | 422 |
423 if (*q == '\0') end = 1; | |
424 *q = '\0'; | |
425 bl_hosts[no_bl_hosts].name = p; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
426 mp_msg(MSGT_VO, MSGL_V, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
427 "blhost[%d]: %s:%d\n", |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
428 no_bl_hosts, p, |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
429 bl_hosts[no_bl_hosts].port); |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
430 no_bl_hosts++; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
431 } else { |
25675
fcac7e2a38fc
fix bug in error message (found by Diego through a compiler warning)
rik
parents:
25521
diff
changeset
|
432 mp_msg(MSGT_VO, MSGL_ERR, "bl: syntax error in entry %d in subdevice %s, should be a comma separated\nlist of host=name:port and file=foo.bml\n", no_bl_hosts + no_bl_files, arg); |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
433 return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
434 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
435 p = ++q; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
436 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
437 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
438 /* open all files */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
439 for (i = 0; i < no_bl_files; i++) |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
440 if (bl->init_file(&bl_files[i])) return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
441 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
442 /* open all sockets */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28697
diff
changeset
|
443 for (i = 0; i < no_bl_hosts; i++) |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
444 if (bl->init_connection(&bl_hosts[i])) return 1; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
445 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
446 |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
447 return 0; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
448 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
449 |
33305
ddb45e9443ec
Remove the variable arguments from the libvo control() functions.
iive
parents:
29263
diff
changeset
|
450 static int control(uint32_t request, void *data) { |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
451 switch (request) { |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
452 case VOCTRL_QUERY_FORMAT: |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
453 return query_format(*((uint32_t*)data)); |
36495 | 454 case VOCTRL_DRAW_IMAGE: |
455 return draw_image(data); | |
7326
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
456 } |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
457 return VO_NOTIMPL; |
ec3e58120e2a
extensible blinkenlights driver, can currently be used for the Arcade http://www.blinkenlights.de/arcade
rik
parents:
diff
changeset
|
458 } |