Stefan Schuermans commited on 2017-05-20 16:55:59
Showing 59 changed files, with 584 additions and 584 deletions.
"FlexiPix" is a registered trademark
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-# FlexiPix library |
|
1 |
+# EtherPix library |
|
2 | 2 |
# |
3 | 3 |
# Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
4 | 4 |
# |
... | ... |
@@ -15,7 +15,7 @@ |
15 | 15 |
# You should have received a copy of the GNU Lesser General Public License |
16 | 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
|
18 |
-LIBTARGET := libflexipix |
|
18 |
+LIBTARGET := libetherpix |
|
19 | 19 |
VER_MAJ := 1 |
20 | 20 |
VER_MIN := 1 |
21 | 21 |
VER_REV := 0 |
... | ... |
@@ -25,13 +25,13 @@ SRCS := $(wildcard src/*.c) |
25 | 25 |
EX_SRCS := $(wildcard examples/src/*.c) |
26 | 26 |
|
27 | 27 |
CFLAGS := -Wall -Wextra -Werror -O3 |
28 |
-DEFINES := -DFLP_VER_MAJ=$(VER_MAJ) -DFLP_VER_MIN=$(VER_MIN) \ |
|
29 |
- -DFLP_VER_REV=$(VER_REV) |
|
28 |
+DEFINES := -DETP_VER_MAJ=$(VER_MAJ) -DETP_VER_MIN=$(VER_MIN) \ |
|
29 |
+ -DETP_VER_REV=$(VER_REV) |
|
30 | 30 |
INCLUDES := -Iinclude |
31 | 31 |
SH_LDFLAGS := |
32 | 32 |
SH_LIBS := |
33 | 33 |
EX_LDFLAGS := -Llib |
34 |
-EX_LIBS := -lflexipix -lm |
|
34 |
+EX_LIBS := -letherpix -lm |
|
35 | 35 |
STOW_DIR := /usr/local/stow |
36 | 36 |
DEF_PREFIX := /usr/local |
37 | 37 |
|
... | ... |
@@ -96,7 +96,7 @@ TARGET := lib/$(LIBTARGET).a |
96 | 96 |
SH_TARGET := lib/$(LIBTARGET).$(LEXT)$(LEXTSUF) |
97 | 97 |
|
98 | 98 |
ENV_PREFIX := $(shell echo $$PREFIX) |
99 |
-STOW_PREFIX := $(STOW_DIR)/libflexipix-$(VERSION) |
|
99 |
+STOW_PREFIX := $(STOW_DIR)/libetherpix-$(VERSION) |
|
100 | 100 |
ifneq ($(ENV_PREFIX),) |
101 | 101 |
PREFIX := $(ENV_PREFIX) |
102 | 102 |
else |
... | ... |
@@ -157,8 +157,8 @@ clean: |
157 | 157 |
$(EX_DEPS) $(EX_OBJS) $(EX_TARGETS) |
158 | 158 |
|
159 | 159 |
install: all |
160 |
- $(INSTALL) -d $(PREFIX)/include/flexipix |
|
161 |
- $(INSTALL) -m 644 -t $(PREFIX)/include/flexipix $(wildcard include/flexipix/*.h) |
|
160 |
+ $(INSTALL) -d $(PREFIX)/include/etherpix |
|
161 |
+ $(INSTALL) -m 644 -t $(PREFIX)/include/etherpix $(wildcard include/etherpix/*.h) |
|
162 | 162 |
$(INSTALL) -d $(PREFIX)/lib |
163 | 163 |
$(INSTALL) -m 644 -t $(PREFIX)/lib $(TARGET) $(SH_TARGET) |
164 | 164 |
ifeq ($(OS),linux) |
... | ... |
@@ -171,5 +171,5 @@ endif |
171 | 171 |
uninstall: |
172 | 172 |
rm -f $(PREFIX)/lib/$(notdir $(SH_TARGET)) |
173 | 173 |
rm -f $(PREFIX)/lib/$(notdir $(TARGET)) |
174 |
- rm -rf $(PREFIX)/include/flexipix |
|
174 |
+ rm -rf $(PREFIX)/include/etherpix |
|
175 | 175 |
|
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-FlexiPix library |
|
1 |
+EtherPix library |
|
2 | 2 |
|
3 | 3 |
FlexPix is a large scale display architecure that is driven using UDP/IP. |
4 | 4 |
It consists of single pixels that are connected to chains. A number of those |
... | ... |
@@ -7,7 +7,7 @@ receives data over ethernet and distributes it to the pixel chains. |
7 | 7 |
|
8 | 8 |
The protocol used on UDP is MCUF (microcontroller unit frame, see |
9 | 9 |
http://wiki.blinkenarea.org/index.php/MicroControllerUnitFrame). However, |
10 |
-as FlexiPix displays can have more than 65536 pixels, multiple MCUF packets |
|
10 |
+as EtherPix displays can have more than 65536 pixels, multiple MCUF packets |
|
11 | 11 |
are sent for one frame - a single MCUF frame to every distributor. |
12 | 12 |
The coordinates of the pixels in the MCUF packets do not correspond to pixel |
13 | 13 |
locations, but to pixel addresses. The y coordinate is the number of the |
... | ... |
@@ -15,7 +15,7 @@ output of the distributor and the x coordinate is the number of the pixel |
15 | 15 |
in the chain. The number of channels is always 3 (RGB) and the maximum value |
16 | 16 |
is always 255 (8 bit per channel). |
17 | 17 |
|
18 |
-This library can be used to send the required UDP packets to the FlexiPix |
|
18 |
+This library can be used to send the required UDP packets to the EtherPix |
|
19 | 19 |
display to make it show images and/or videos. |
20 | 20 |
As the libarary has to know how the pixels are wired and where there are |
21 | 21 |
located (i.e. which pixel in the source image they represent), a rather |
... | ... |
@@ -1,8 +1,8 @@ |
1 |
-# FlexiPix config file generator |
|
1 |
+# EtherPix config file generator |
|
2 | 2 |
# |
3 | 3 |
# Copyright 2010-2017 Stefan Schuermans <stefan schuermans info> |
4 | 4 |
|
5 |
-TARGET := flexipix_config_gen |
|
5 |
+TARGET := etherpix_config_gen |
|
6 | 6 |
VER := 1 |
7 | 7 |
VERMIN := 1 |
8 | 8 |
VERREV := 0 |
... | ... |
@@ -13,8 +13,8 @@ CPP := g++ |
13 | 13 |
INSTALL := install |
14 | 14 |
|
15 | 15 |
CFLAGS := -W -Wall -O3 |
16 |
-DEFINES := -DFLPCG_VER_MAJ=$(VER) -DFLPCG_VER_MIN=$(VERMIN) \ |
|
17 |
- -DFLPCG_VER_REV=$(VERREV) |
|
16 |
+DEFINES := -DETPCG_VER_MAJ=$(VER) -DETPCG_VER_MIN=$(VERMIN) \ |
|
17 |
+ -DETPCG_VER_REV=$(VERREV) |
|
18 | 18 |
INCLUDES := |
19 | 19 |
LDFLAGS := |
20 | 20 |
LIBS := -ldime -lm |
... | ... |
@@ -28,7 +28,7 @@ VERSION := $(VER).$(VERMIN).$(VERREV) |
28 | 28 |
|
29 | 29 |
ENV_PREFIX := $(shell echo $$PREFIX) |
30 | 30 |
STOW_DIR := /usr/local/stow |
31 |
-STOW_PREFIX := $(STOW_DIR)/flpConfigGen-$(VERSION) |
|
31 |
+STOW_PREFIX := $(STOW_DIR)/etpConfigGen-$(VERSION) |
|
32 | 32 |
DEF_PREFIX := /usr/local |
33 | 33 |
ifneq ($(ENV_PREFIX),) |
34 | 34 |
PREFIX := $(ENV_PREFIX) |
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
DRAWINGS := $(wildcard *.dxf) |
2 | 2 |
|
3 |
-CONFIGS := $(DRAWINGS:.dxf=.flp) |
|
3 |
+CONFIGS := $(DRAWINGS:.dxf=.etp) |
|
4 | 4 |
|
5 |
-CFGGEN := ../src/flexipix_config_gen |
|
5 |
+CFGGEN := ../src/etherpix_config_gen |
|
6 | 6 |
|
7 | 7 |
.PHONY: all clean |
8 | 8 |
.SUFFIXES: |
... | ... |
@@ -10,7 +10,7 @@ CFGGEN := ../src/flexipix_config_gen |
10 | 10 |
|
11 | 11 |
all: $(CONFIGS) |
12 | 12 |
|
13 |
-%.flp: %.dxf $(CFGGEN) |
|
13 |
+%.etp: %.dxf $(CFGGEN) |
|
14 | 14 |
$(CFGGEN) $< $@ |
15 | 15 |
|
16 | 16 |
clean: |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix config file generator |
|
2 |
+ * EtherPix config file generator |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2017 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -398,11 +398,11 @@ int main(int argc, char *argv[]) |
398 | 398 |
{ |
399 | 399 |
// get parameters |
400 | 400 |
if (argc != 3) { |
401 |
- std::cerr << "FlexiPix config file generator " |
|
402 |
- << FLPCG_VER_MAJ << "." |
|
403 |
- << FLPCG_VER_MIN << "." |
|
404 |
- << FLPCG_VER_REV << std::endl |
|
405 |
- << "usage: " << argv[0] << " <schematic_drawing.dxf> <config.flp>" |
|
401 |
+ std::cerr << "EtherPix config file generator " |
|
402 |
+ << ETPCG_VER_MAJ << "." |
|
403 |
+ << ETPCG_VER_MIN << "." |
|
404 |
+ << ETPCG_VER_REV << std::endl |
|
405 |
+ << "usage: " << argv[0] << " <schematic_drawing.dxf> <config.etp>" |
|
406 | 406 |
<< std::endl; |
407 | 407 |
return -1; |
408 | 408 |
} |
... | ... |
@@ -1,7 +1,7 @@ |
1 |
-# FlexiPix configuration file |
|
1 |
+# EtherPix configuration file |
|
2 | 2 |
|
3 | 3 |
# the address to bind the local socket to |
4 |
-# - the FlexiPix network 10.70.80.0/16 must be reachable from this address |
|
4 |
+# - the EtherPix network 10.70.80.0/16 must be reachable from this address |
|
5 | 5 |
bindAddr = 0.0.0.0:0 |
6 | 6 |
|
7 | 7 |
# the size of the display |
... | ... |
@@ -1,7 +1,7 @@ |
1 |
-# FlexiPix configuration file |
|
1 |
+# EtherPix configuration file |
|
2 | 2 |
|
3 | 3 |
# the address to bind the local socket to |
4 |
-# - the FlexiPix network 10.70.80.0/16 must be reachable from this address |
|
4 |
+# - the EtherPix network 10.70.80.0/16 must be reachable from this address |
|
5 | 5 |
bindAddr = 0.0.0.0:0 |
6 | 6 |
|
7 | 7 |
# the size of the display |
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
#include <stdio.h> |
3 | 3 |
#include <unistd.h> |
4 | 4 |
|
5 |
-#include <flexipix/flexipix.h> |
|
5 |
+#include <etherpix/etherpix.h> |
|
6 | 6 |
|
7 | 7 |
#ifdef WINDOWS |
8 | 8 |
#include <winsock.h> |
... | ... |
@@ -17,8 +17,8 @@ typedef struct userdata_s { |
17 | 17 |
|
18 | 18 |
/* callback function called during display creation, |
19 | 19 |
the p_ctx parameter is the userdata supplied in the call |
20 |
- to flp_display_create() */ |
|
21 |
-void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
|
20 |
+ to etp_display_create() */ |
|
21 |
+void msg(void *p_ctx, etp_msg_type_t type, const char *fmt, ...) |
|
22 | 22 |
{ |
23 | 23 |
userdata_t *p_userdata = (userdata_t *)p_ctx; |
24 | 24 |
va_list va; |
... | ... |
@@ -29,13 +29,13 @@ void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
29 | 29 |
|
30 | 30 |
/* type tells if the message is an error, a warning or an information */ |
31 | 31 |
switch (type) { |
32 |
- case flp_msg_type_err: |
|
32 |
+ case etp_msg_type_err: |
|
33 | 33 |
printf("ERROR: "); |
34 | 34 |
break; |
35 |
- case flp_msg_type_warn: |
|
35 |
+ case etp_msg_type_warn: |
|
36 | 36 |
printf("WARNING: "); |
37 | 37 |
break; |
38 |
- case flp_msg_type_info: |
|
38 |
+ case etp_msg_type_info: |
|
39 | 39 |
printf("INFORMATION: "); |
40 | 40 |
break; |
41 | 41 |
} |
... | ... |
@@ -51,12 +51,12 @@ int main(int argc, char *argv[]) |
51 | 51 |
{ |
52 | 52 |
const char *config; |
53 | 53 |
userdata_t userdata = { 42, 42.0, '!' }; /* just an example */ |
54 |
- flp_display_t *p_display; |
|
54 |
+ etp_display_t *p_display; |
|
55 | 55 |
unsigned int width, height, i; |
56 |
- flp_u8_t white[3] = { 255, 255, 255 }; |
|
56 |
+ etp_u8_t white[3] = { 255, 255, 255 }; |
|
57 | 57 |
|
58 | 58 |
if (argc < 2) { |
59 |
- printf("usage: %s <config.flp>\n", argv[0]); |
|
59 |
+ printf("usage: %s <config.etp>\n", argv[0]); |
|
60 | 60 |
return -1; |
61 | 61 |
} |
62 | 62 |
config = argv[1]; |
... | ... |
@@ -72,33 +72,33 @@ int main(int argc, char *argv[]) |
72 | 72 |
deliver messages to the callback function msg(), |
73 | 73 |
the last parameter is passed as first parameter to msg() |
74 | 74 |
and can be used to supply some user defined data */ |
75 |
- p_display = flp_display_create(config, msg, (void *)&userdata); |
|
75 |
+ p_display = etp_display_create(config, msg, (void *)&userdata); |
|
76 | 76 |
if (!p_display) { |
77 | 77 |
printf("could not create display\n"); |
78 | 78 |
return -1; |
79 | 79 |
} |
80 | 80 |
|
81 |
- flp_display_get_size(p_display, &width, &height); |
|
81 |
+ etp_display_get_size(p_display, &width, &height); |
|
82 | 82 |
printf("width: %5u\nheight: %5u\n", width, height); |
83 | 83 |
|
84 | 84 |
printf("blink\n"); |
85 | 85 |
for (i = 0; i < 5; ++i) { |
86 | 86 |
|
87 | 87 |
printf("on\n"); |
88 |
- flp_display_data_fmt(p_display, white, 0, 0, 0, 0, width, height, |
|
89 |
- flp_pixfmt_rgb24); |
|
90 |
- flp_display_send(p_display); |
|
88 |
+ etp_display_data_fmt(p_display, white, 0, 0, 0, 0, width, height, |
|
89 |
+ etp_pixfmt_rgb24); |
|
90 |
+ etp_display_send(p_display); |
|
91 | 91 |
usleep(100000); |
92 | 92 |
|
93 | 93 |
printf("off\n"); |
94 |
- flp_display_data_clear(p_display); |
|
95 |
- flp_display_send(p_display); |
|
94 |
+ etp_display_data_clear(p_display); |
|
95 |
+ etp_display_send(p_display); |
|
96 | 96 |
usleep(500000); |
97 | 97 |
|
98 | 98 |
} /* for (i ...) */ |
99 | 99 |
printf("done\n"); |
100 | 100 |
|
101 |
- flp_display_free(p_display); |
|
101 |
+ etp_display_free(p_display); |
|
102 | 102 |
|
103 | 103 |
#ifdef WINDOWS |
104 | 104 |
WSACleanup(); |
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
#include <stdio.h> |
3 | 3 |
#include <stdlib.h> |
4 | 4 |
|
5 |
-#include <flexipix/flexipix.h> |
|
5 |
+#include <etherpix/etherpix.h> |
|
6 | 6 |
|
7 | 7 |
#ifdef WINDOWS |
8 | 8 |
#include <winsock.h> |
... | ... |
@@ -17,8 +17,8 @@ typedef struct userdata_s { |
17 | 17 |
|
18 | 18 |
/* callback function called during display creation, |
19 | 19 |
the p_ctx parameter is the userdata supplied in the call |
20 |
- to flp_display_create() */ |
|
21 |
-void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
|
20 |
+ to etp_display_create() */ |
|
21 |
+void msg(void *p_ctx, etp_msg_type_t type, const char *fmt, ...) |
|
22 | 22 |
{ |
23 | 23 |
userdata_t *p_userdata = (userdata_t *)p_ctx; |
24 | 24 |
va_list va; |
... | ... |
@@ -29,13 +29,13 @@ void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
29 | 29 |
|
30 | 30 |
/* type tells if the message is an error, a warning or an information */ |
31 | 31 |
switch (type) { |
32 |
- case flp_msg_type_err: |
|
32 |
+ case etp_msg_type_err: |
|
33 | 33 |
printf("ERROR: "); |
34 | 34 |
break; |
35 |
- case flp_msg_type_warn: |
|
35 |
+ case etp_msg_type_warn: |
|
36 | 36 |
printf("WARNING: "); |
37 | 37 |
break; |
38 |
- case flp_msg_type_info: |
|
38 |
+ case etp_msg_type_info: |
|
39 | 39 |
printf("INFORMATION: "); |
40 | 40 |
break; |
41 | 41 |
} |
... | ... |
@@ -51,13 +51,13 @@ int main(int argc, char *argv[]) |
51 | 51 |
{ |
52 | 52 |
const char *config; |
53 | 53 |
userdata_t userdata = { 42, 42.0, '!' }; /* just an example */ |
54 |
- flp_displayer_t *p_displayer; |
|
54 |
+ etp_displayer_t *p_displayer; |
|
55 | 55 |
unsigned int width, height, i, j, c, x, y; |
56 |
- flp_u8_t *p_image; |
|
56 |
+ etp_u8_t *p_image; |
|
57 | 57 |
char line[64]; |
58 | 58 |
|
59 | 59 |
if (argc < 2) { |
60 |
- printf("usage: %s <config.flp>\n", argv[0]); |
|
60 |
+ printf("usage: %s <config.etp>\n", argv[0]); |
|
61 | 61 |
return -1; |
62 | 62 |
} |
63 | 63 |
config = argv[1]; |
... | ... |
@@ -76,25 +76,25 @@ int main(int argc, char *argv[]) |
76 | 76 |
deliver messages to the callback function msg(), |
77 | 77 |
the last parameter is passed as first parameter to msg() |
78 | 78 |
and can be used to supply some user defined data */ |
79 |
- p_displayer = flp_displayer_create(config, msg, (void *)&userdata); |
|
79 |
+ p_displayer = etp_displayer_create(config, msg, (void *)&userdata); |
|
80 | 80 |
if (!p_displayer) { |
81 | 81 |
printf("could not create displayer\n"); |
82 | 82 |
return -1; |
83 | 83 |
} |
84 | 84 |
|
85 |
- flp_displayer_get_size(p_displayer, &width, &height); |
|
85 |
+ etp_displayer_get_size(p_displayer, &width, &height); |
|
86 | 86 |
printf("width: %5u\nheight: %5u\n", width, height); |
87 | 87 |
|
88 | 88 |
/* create a buffer for the image */ |
89 |
- p_image = (flp_u8_t *)malloc(height * width * 3); |
|
89 |
+ p_image = (etp_u8_t *)malloc(height * width * 3); |
|
90 | 90 |
if (!p_image) { |
91 |
- flp_displayer_free(p_displayer); |
|
91 |
+ etp_displayer_free(p_displayer); |
|
92 | 92 |
printf("out of memory\n"); |
93 | 93 |
return -1; |
94 | 94 |
} |
95 | 95 |
|
96 | 96 |
/* make displayer start sending data to distributors */ |
97 |
- flp_displayer_activate(p_displayer); |
|
97 |
+ etp_displayer_activate(p_displayer); |
|
98 | 98 |
|
99 | 99 |
/* The following loop will spent most waiting for user input. |
100 | 100 |
While it is waiting, the displayer will periodically sent |
... | ... |
@@ -126,17 +126,17 @@ int main(int argc, char *argv[]) |
126 | 126 |
} |
127 | 127 |
|
128 | 128 |
/* set new image */ |
129 |
- flp_displayer_data_fmt(p_displayer, p_image, |
|
129 |
+ etp_displayer_data_fmt(p_displayer, p_image, |
|
130 | 130 |
3, /* consecutive pixels are 3 bytes apart */ |
131 | 131 |
width*3, /* consecutive lines width*3 bytes apart */ |
132 |
- 0, 0, width, height, flp_pixfmt_rgb24); |
|
132 |
+ 0, 0, width, height, etp_pixfmt_rgb24); |
|
133 | 133 |
/* force sending data to distris immediately */ |
134 |
- flp_displayer_send(p_displayer); |
|
134 |
+ etp_displayer_send(p_displayer); |
|
135 | 135 |
|
136 | 136 |
} /* while (1) */ |
137 | 137 |
|
138 | 138 |
free(p_image); |
139 |
- flp_displayer_free(p_displayer); |
|
139 |
+ etp_displayer_free(p_displayer); |
|
140 | 140 |
|
141 | 141 |
#ifdef WINDOWS |
142 | 142 |
WSACleanup(); |
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
#include <stdio.h> |
3 | 3 |
#include <stdlib.h> |
4 | 4 |
|
5 |
-#include <flexipix/flexipix.h> |
|
5 |
+#include <etherpix/etherpix.h> |
|
6 | 6 |
|
7 | 7 |
#ifdef WINDOWS |
8 | 8 |
#include <winsock.h> |
... | ... |
@@ -17,8 +17,8 @@ typedef struct userdata_s { |
17 | 17 |
|
18 | 18 |
/* callback function called during display creation, |
19 | 19 |
the p_ctx parameter is the userdata supplied in the call |
20 |
- to flp_display_create() */ |
|
21 |
-void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
|
20 |
+ to etp_display_create() */ |
|
21 |
+void msg(void *p_ctx, etp_msg_type_t type, const char *fmt, ...) |
|
22 | 22 |
{ |
23 | 23 |
userdata_t *p_userdata = (userdata_t *)p_ctx; |
24 | 24 |
va_list va; |
... | ... |
@@ -29,13 +29,13 @@ void msg(void *p_ctx, flp_msg_type_t type, const char *fmt, ...) |
29 | 29 |
|
30 | 30 |
/* type tells if the message is an error, a warning or an information */ |
31 | 31 |
switch (type) { |
32 |
- case flp_msg_type_err: |
|
32 |
+ case etp_msg_type_err: |
|
33 | 33 |
printf("ERROR: "); |
34 | 34 |
break; |
35 |
- case flp_msg_type_warn: |
|
35 |
+ case etp_msg_type_warn: |
|
36 | 36 |
printf("WARNING: "); |
37 | 37 |
break; |
38 |
- case flp_msg_type_info: |
|
38 |
+ case etp_msg_type_info: |
|
39 | 39 |
printf("INFORMATION: "); |
40 | 40 |
break; |
41 | 41 |
} |
... | ... |
@@ -51,12 +51,12 @@ int main(int argc, char *argv[]) |
51 | 51 |
{ |
52 | 52 |
const char *config; |
53 | 53 |
userdata_t userdata = { 42, 42.0, '!' }; /* just an example */ |
54 |
- flp_display_t *p_display; |
|
54 |
+ etp_display_t *p_display; |
|
55 | 55 |
unsigned int width, height, i, x, y; |
56 |
- flp_u8_t *p_image; |
|
56 |
+ etp_u8_t *p_image; |
|
57 | 57 |
|
58 | 58 |
if (argc < 2) { |
59 |
- printf("usage: %s <config.flp>\n", argv[0]); |
|
59 |
+ printf("usage: %s <config.etp>\n", argv[0]); |
|
60 | 60 |
return -1; |
61 | 61 |
} |
62 | 62 |
config = argv[1]; |
... | ... |
@@ -72,42 +72,42 @@ int main(int argc, char *argv[]) |
72 | 72 |
deliver messages to the callback function msg(), |
73 | 73 |
the last parameter is passed as first parameter to msg() |
74 | 74 |
and can be used to supply some user defined data */ |
75 |
- p_display = flp_display_create(config, msg, (void *)&userdata); |
|
75 |
+ p_display = etp_display_create(config, msg, (void *)&userdata); |
|
76 | 76 |
if (!p_display) { |
77 | 77 |
printf("could not create display\n"); |
78 | 78 |
return -1; |
79 | 79 |
} |
80 | 80 |
|
81 |
- flp_display_get_size(p_display, &width, &height); |
|
81 |
+ etp_display_get_size(p_display, &width, &height); |
|
82 | 82 |
printf("width: %5u\nheight: %5u\n", width, height); |
83 | 83 |
|
84 | 84 |
/* create an image with a nice fade: |
85 | 85 |
black to red from left to right, |
86 | 86 |
black to green from top to bottom */ |
87 |
- p_image = (flp_u8_t *)malloc(height * width * 3); |
|
87 |
+ p_image = (etp_u8_t *)malloc(height * width * 3); |
|
88 | 88 |
if (!p_image) { |
89 |
- flp_display_free(p_display); |
|
89 |
+ etp_display_free(p_display); |
|
90 | 90 |
printf("out of memory\n"); |
91 | 91 |
return -1; |
92 | 92 |
} |
93 | 93 |
i = 0; |
94 | 94 |
for (y = 0; y < height; ++y) { |
95 | 95 |
for (x = 0; x < width; ++x) { |
96 |
- p_image[i++] = (flp_u8_t)(255.0*x/(width-1)+0.5); /* red */ |
|
97 |
- p_image[i++] = (flp_u8_t)(255.0*y/(height-1)+0.5); /* green */ |
|
96 |
+ p_image[i++] = (etp_u8_t)(255.0*x/(width-1)+0.5); /* red */ |
|
97 |
+ p_image[i++] = (etp_u8_t)(255.0*y/(height-1)+0.5); /* green */ |
|
98 | 98 |
p_image[i++] = 0; /* no blue */ |
99 | 99 |
} |
100 | 100 |
} |
101 | 101 |
|
102 | 102 |
/* output image */ |
103 |
- flp_display_data_fmt(p_display, p_image, |
|
103 |
+ etp_display_data_fmt(p_display, p_image, |
|
104 | 104 |
3, /* consecutive pixels are 3 bytes apart */ |
105 | 105 |
width*3, /* consecutive lines are width*3 bytes apart */ |
106 |
- 0, 0, width, height, flp_pixfmt_rgb24); |
|
107 |
- flp_display_send(p_display); |
|
106 |
+ 0, 0, width, height, etp_pixfmt_rgb24); |
|
107 |
+ etp_display_send(p_display); |
|
108 | 108 |
|
109 | 109 |
free(p_image); |
110 |
- flp_display_free(p_display); |
|
110 |
+ etp_display_free(p_display); |
|
111 | 111 |
|
112 | 112 |
#ifdef WINDOWS |
113 | 113 |
WSACleanup(); |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,61 +17,61 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_DISPLAY_H |
|
21 |
-#define FLP_INC_DISPLAY_H |
|
20 |
+#ifndef ETP_INC_DISPLAY_H |
|
21 |
+#define ETP_INC_DISPLAY_H |
|
22 | 22 |
|
23 |
-#include <flexipix/msg.h> |
|
24 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/msg.h> |
|
24 |
+#include <etherpix/types.h> |
|
25 | 25 |
|
26 | 26 |
/** |
27 |
- * \brief create a new FlexiPix display |
|
27 |
+ * \brief create a new EtherPix display |
|
28 | 28 |
* |
29 | 29 |
* \param[in] sz_config_file name of config file to read |
30 | 30 |
* \param[in] p_msg_func message callback function or NULL |
31 | 31 |
* \param[in] p_msg_ctx user context for message callback |
32 |
- * \return pointer to new FlexiPix display on success |
|
32 |
+ * \return pointer to new EtherPix display on success |
|
33 | 33 |
* or NULL on error |
34 | 34 |
*/ |
35 |
-flp_display_t *flp_display_create(const char *sz_config_file, |
|
36 |
- flp_msg_func_p_t p_msg_func, |
|
35 |
+etp_display_t *etp_display_create(const char *sz_config_file, |
|
36 |
+ etp_msg_func_p_t p_msg_func, |
|
37 | 37 |
void *p_msg_ctx); |
38 | 38 |
|
39 | 39 |
/** |
40 |
- * \brief free a FlexiPix display |
|
40 |
+ * \brief free a EtherPix display |
|
41 | 41 |
* |
42 |
- * \param[in] p_display pointer to FlexiPix display |
|
42 |
+ * \param[in] p_display pointer to EtherPix display |
|
43 | 43 |
*/ |
44 |
-void flp_display_free(flp_display_t *p_display); |
|
44 |
+void etp_display_free(etp_display_t *p_display); |
|
45 | 45 |
|
46 | 46 |
/** |
47 | 47 |
* \brief get size of display |
48 | 48 |
* |
49 |
- * \param[in] p_display pointer to FlexiPix display |
|
49 |
+ * \param[in] p_display pointer to EtherPix display |
|
50 | 50 |
* \param[out] p_width width of display |
51 | 51 |
* \param[out] p_height height of display |
52 | 52 |
*/ |
53 |
-void flp_display_get_size(flp_display_t *p_display, |
|
53 |
+void etp_display_get_size(etp_display_t *p_display, |
|
54 | 54 |
unsigned int *p_width, unsigned int *p_height); |
55 | 55 |
|
56 | 56 |
/** |
57 |
- * \brief clear image data to output on FlexiPix display |
|
57 |
+ * \brief clear image data to output on EtherPix display |
|
58 | 58 |
* |
59 | 59 |
* clears the stored image data, |
60 | 60 |
* stored image data can later be sent to the distributors using |
61 |
- * flp_display_send() |
|
61 |
+ * etp_display_send() |
|
62 | 62 |
* |
63 |
- * \param[in] p_display pointer to FlexiPix display |
|
63 |
+ * \param[in] p_display pointer to EtherPix display |
|
64 | 64 |
*/ |
65 |
-void flp_display_data_clear(flp_display_t *p_display); |
|
65 |
+void etp_display_data_clear(etp_display_t *p_display); |
|
66 | 66 |
|
67 | 67 |
/** |
68 |
- * \brief set image data to output on FlexiPix display |
|
68 |
+ * \brief set image data to output on EtherPix display |
|
69 | 69 |
* |
70 | 70 |
* updates (part of) the stored image data, |
71 | 71 |
* stored image data can later be sent to the distributors using |
72 |
- * flp_display_send() |
|
72 |
+ * etp_display_send() |
|
73 | 73 |
* |
74 |
- * \param[in] p_display pointer to FlexiPix display |
|
74 |
+ * \param[in] p_display pointer to EtherPix display |
|
75 | 75 |
* \param[in] p_data pointer to rectangular section of image data |
76 | 76 |
* \param[in] stride_x stride between two pixels in X direction |
77 | 77 |
* \param[in] stride_y stride between two pixels in Y direction |
... | ... |
@@ -81,19 +81,19 @@ void flp_display_data_clear(flp_display_t *p_display); |
81 | 81 |
* \param[in] height height of rectangular area |
82 | 82 |
* \param[in] pixfmt format of pixel data |
83 | 83 |
*/ |
84 |
-void flp_display_data_fmt(flp_display_t *p_display, flp_u8_t *p_data, |
|
84 |
+void etp_display_data_fmt(etp_display_t *p_display, etp_u8_t *p_data, |
|
85 | 85 |
int stride_x, int stride_y, |
86 | 86 |
unsigned int x, unsigned int y, |
87 | 87 |
unsigned int width, unsigned int height, |
88 |
- flp_pixfmt_t pixfmt); |
|
88 |
+ etp_pixfmt_t pixfmt); |
|
89 | 89 |
|
90 | 90 |
/** |
91 |
- * \brief set image data to output on FlexiPix display |
|
91 |
+ * \brief set image data to output on EtherPix display |
|
92 | 92 |
* |
93 |
- * see flp_display_data_fmt for documentation |
|
94 |
- * pixfmt is fixed to flp_pixfmt_rgb24 |
|
93 |
+ * see etp_display_data_fmt for documentation |
|
94 |
+ * pixfmt is fixed to etp_pixfmt_rgb24 |
|
95 | 95 |
*/ |
96 |
-void flp_display_data(flp_display_t *p_display, flp_u8_t *p_data, |
|
96 |
+void etp_display_data(etp_display_t *p_display, etp_u8_t *p_data, |
|
97 | 97 |
int stride_x, int stride_y, |
98 | 98 |
unsigned int x, unsigned int y, |
99 | 99 |
unsigned int width, unsigned int height); |
... | ... |
@@ -103,9 +103,9 @@ void flp_display_data(flp_display_t *p_display, flp_u8_t *p_data, |
103 | 103 |
* |
104 | 104 |
* sends the currently stored image data to all configured distributors |
105 | 105 |
* |
106 |
- * \param[in] p_display pointer to FlexiPix display |
|
106 |
+ * \param[in] p_display pointer to EtherPix display |
|
107 | 107 |
*/ |
108 |
-void flp_display_send(flp_display_t *p_display); |
|
108 |
+void etp_display_send(etp_display_t *p_display); |
|
109 | 109 |
|
110 |
-#endif /* #ifndef FLP_INC_DISPLAY_H */ |
|
110 |
+#endif /* #ifndef ETP_INC_DISPLAY_H */ |
|
111 | 111 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,47 +17,47 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_DISPLAYER_H |
|
21 |
-#define FLP_INC_DISPLAYER_H |
|
20 |
+#ifndef ETP_INC_DISPLAYER_H |
|
21 |
+#define ETP_INC_DISPLAYER_H |
|
22 | 22 |
|
23 |
-#include <flexipix/msg.h> |
|
24 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/msg.h> |
|
24 |
+#include <etherpix/types.h> |
|
25 | 25 |
|
26 | 26 |
/** |
27 |
- * \brief create a new FlexiPix displayer |
|
27 |
+ * \brief create a new EtherPix displayer |
|
28 | 28 |
* |
29 | 29 |
* A displayer manages a display and ensures that a the current |
30 | 30 |
* image data is sent often enough to the distributors so |
31 | 31 |
* that the pixels do detect a timeout and turn off automatically. |
32 | 32 |
* The displayer uses a thread to do this. |
33 | 33 |
* Initially, the new displayer is inactive and has to be activated |
34 |
- * using flp_displayer_activate(). |
|
34 |
+ * using etp_displayer_activate(). |
|
35 | 35 |
* |
36 | 36 |
* \param[in] sz_config_file name of config file to read |
37 | 37 |
* \param[in] p_msg_func message callback function or NULL |
38 | 38 |
* \param[in] p_msg_ctx user context for message callback |
39 |
- * \return pointer to new FlexiPix displayer on success |
|
39 |
+ * \return pointer to new EtherPix displayer on success |
|
40 | 40 |
* or NULL on error |
41 | 41 |
*/ |
42 |
-flp_displayer_t *flp_displayer_create(const char *sz_config_file, |
|
43 |
- flp_msg_func_p_t p_msg_func, |
|
42 |
+etp_displayer_t *etp_displayer_create(const char *sz_config_file, |
|
43 |
+ etp_msg_func_p_t p_msg_func, |
|
44 | 44 |
void *p_msg_ctx); |
45 | 45 |
|
46 | 46 |
/** |
47 |
- * \brief free a FlexiPix displayer |
|
47 |
+ * \brief free a EtherPix displayer |
|
48 | 48 |
* |
49 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
49 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
50 | 50 |
*/ |
51 |
-void flp_displayer_free(flp_displayer_t *p_displayer); |
|
51 |
+void etp_displayer_free(etp_displayer_t *p_displayer); |
|
52 | 52 |
|
53 | 53 |
/** |
54 | 54 |
* \brief get size of display managed by displayer |
55 | 55 |
* |
56 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
56 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
57 | 57 |
* \param[out] p_width width of display |
58 | 58 |
* \param[out] p_height height of display |
59 | 59 |
*/ |
60 |
-void flp_displayer_get_size(flp_displayer_t *p_displayer, |
|
60 |
+void etp_displayer_get_size(etp_displayer_t *p_displayer, |
|
61 | 61 |
unsigned int *p_width, unsigned int *p_height); |
62 | 62 |
|
63 | 63 |
/** |
... | ... |
@@ -68,9 +68,9 @@ void flp_displayer_get_size(flp_displayer_t *p_displayer, |
68 | 68 |
* this function might trigger sending of data if the last |
69 | 69 |
* sending time was too long ago |
70 | 70 |
* |
71 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
71 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
72 | 72 |
*/ |
73 |
-void flp_displayer_activate(flp_displayer_t *p_displayer); |
|
73 |
+void etp_displayer_activate(etp_displayer_t *p_displayer); |
|
74 | 74 |
|
75 | 75 |
/** |
76 | 76 |
* \brief deactivate the displayer |
... | ... |
@@ -78,25 +78,25 @@ void flp_displayer_activate(flp_displayer_t *p_displayer); |
78 | 78 |
* set the displayer to deactive, i.e. prevent it from sening image |
79 | 79 |
* data to the distributors automatically, |
80 | 80 |
* |
81 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
81 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
82 | 82 |
*/ |
83 |
-void flp_displayer_deactivate(flp_displayer_t *p_displayer); |
|
83 |
+void etp_displayer_deactivate(etp_displayer_t *p_displayer); |
|
84 | 84 |
|
85 | 85 |
/** |
86 |
- * \brief clear image data to output on FlexiPix displayer |
|
86 |
+ * \brief clear image data to output on EtherPix displayer |
|
87 | 87 |
* |
88 | 88 |
* clears the stored image data |
89 | 89 |
* |
90 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
90 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
91 | 91 |
*/ |
92 |
-void flp_displayer_data_clear(flp_displayer_t *p_displayer); |
|
92 |
+void etp_displayer_data_clear(etp_displayer_t *p_displayer); |
|
93 | 93 |
|
94 | 94 |
/** |
95 |
- * \brief set image data to output on FlexiPix display |
|
95 |
+ * \brief set image data to output on EtherPix display |
|
96 | 96 |
* |
97 | 97 |
* updates (part of) the stored image data |
98 | 98 |
* |
99 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
99 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
100 | 100 |
* \param[in] p_data pointer to rectangular section of image data |
101 | 101 |
* \param[in] stride_x stride between two pixels in X direction |
102 | 102 |
* \param[in] stride_y stride between two pixels in Y direction |
... | ... |
@@ -106,19 +106,19 @@ void flp_displayer_data_clear(flp_displayer_t *p_displayer); |
106 | 106 |
* \param[in] height height of rectangular area |
107 | 107 |
* \param[in] pixfmt format of pixel data |
108 | 108 |
*/ |
109 |
-void flp_displayer_data_fmt(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
|
109 |
+void etp_displayer_data_fmt(etp_displayer_t *p_displayer, etp_u8_t *p_data, |
|
110 | 110 |
int stride_x, int stride_y, |
111 | 111 |
unsigned int x, unsigned int y, |
112 | 112 |
unsigned int width, unsigned int height, |
113 |
- flp_pixfmt_t pixfmt); |
|
113 |
+ etp_pixfmt_t pixfmt); |
|
114 | 114 |
|
115 | 115 |
/** |
116 |
- * \brief set image data to output on FlexiPix display |
|
116 |
+ * \brief set image data to output on EtherPix display |
|
117 | 117 |
* |
118 |
- * see flp_displayer_data_fmt for documentation |
|
119 |
- * pixfmt is fixed to flp_pixfmt_rgb24 |
|
118 |
+ * see etp_displayer_data_fmt for documentation |
|
119 |
+ * pixfmt is fixed to etp_pixfmt_rgb24 |
|
120 | 120 |
*/ |
121 |
-void flp_displayer_data(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
|
121 |
+void etp_displayer_data(etp_displayer_t *p_displayer, etp_u8_t *p_data, |
|
122 | 122 |
int stride_x, int stride_y, |
123 | 123 |
unsigned int x, unsigned int y, |
124 | 124 |
unsigned int width, unsigned int height); |
... | ... |
@@ -128,9 +128,9 @@ void flp_displayer_data(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
128 | 128 |
* |
129 | 129 |
* this only works if the displayer is active |
130 | 130 |
* |
131 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
131 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
132 | 132 |
*/ |
133 |
-void flp_displayer_send(flp_displayer_t *p_displayer); |
|
133 |
+void etp_displayer_send(etp_displayer_t *p_displayer); |
|
134 | 134 |
|
135 |
-#endif /* #ifndef FLP_INC_DISPLAYER_H */ |
|
135 |
+#endif /* #ifndef ETP_INC_DISPLAYER_H */ |
|
136 | 136 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,14 +17,14 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_FLEXIPIX_H |
|
21 |
-#define FLP_INC_FLEXIPIX_H |
|
20 |
+#ifndef ETP_INC_ETHERPIX_H |
|
21 |
+#define ETP_INC_ETHERPIX_H |
|
22 | 22 |
|
23 |
-#include <flexipix/display.h> |
|
24 |
-#include <flexipix/displayer.h> |
|
25 |
-#include <flexipix/info.h> |
|
26 |
-#include <flexipix/msg.h> |
|
27 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/display.h> |
|
24 |
+#include <etherpix/displayer.h> |
|
25 |
+#include <etherpix/info.h> |
|
26 |
+#include <etherpix/msg.h> |
|
27 |
+#include <etherpix/types.h> |
|
28 | 28 |
|
29 |
-#endif /* #ifndef FLP_INC_FLEXIPIX_H */ |
|
29 |
+#endif /* #ifndef ETP_INC_ETHERPIX_H */ |
|
30 | 30 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_INFO_H |
|
21 |
-#define FLP_INC_INFO_H |
|
20 |
+#ifndef ETP_INC_INFO_H |
|
21 |
+#define ETP_INC_INFO_H |
|
22 | 22 |
|
23 | 23 |
/** |
24 | 24 |
* \brief get version of the library |
... | ... |
@@ -27,8 +27,8 @@ |
27 | 27 |
* \param[out] p_minor minor version |
28 | 28 |
* \param[out] p_revision revision number |
29 | 29 |
*/ |
30 |
-void flp_get_version(unsigned int *p_major, unsigned int *p_minor, |
|
30 |
+void etp_get_version(unsigned int *p_major, unsigned int *p_minor, |
|
31 | 31 |
unsigned int *p_revision); |
32 | 32 |
|
33 |
-#endif /* #ifndef FLP_INC_INC_H */ |
|
33 |
+#endif /* #ifndef ETP_INC_INC_H */ |
|
34 | 34 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,15 +17,15 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_MSG_H |
|
21 |
-#define FLP_INC_MSG_H |
|
20 |
+#ifndef ETP_INC_MSG_H |
|
21 |
+#define ETP_INC_MSG_H |
|
22 | 22 |
|
23 | 23 |
/** message type */ |
24 |
-typedef enum flp_msg_type_s { |
|
25 |
- flp_msg_type_err, /**< error message */ |
|
26 |
- flp_msg_type_warn, /**< warning message */ |
|
27 |
- flp_msg_type_info, /**< information message */ |
|
28 |
-} flp_msg_type_t; |
|
24 |
+typedef enum etp_msg_type_s { |
|
25 |
+ etp_msg_type_err, /**< error message */ |
|
26 |
+ etp_msg_type_warn, /**< warning message */ |
|
27 |
+ etp_msg_type_info, /**< information message */ |
|
28 |
+} etp_msg_type_t; |
|
29 | 29 |
|
30 | 30 |
/** |
31 | 31 |
* \brief type for message callback function |
... | ... |
@@ -35,12 +35,12 @@ typedef enum flp_msg_type_s { |
35 | 35 |
* \param[in] sz_fmt format string |
36 | 36 |
* \param[in] ... arguments for format string |
37 | 37 |
*/ |
38 |
-typedef void (*flp_msg_func_p_t)(void *p_ctx, flp_msg_type_t type, |
|
38 |
+typedef void (*etp_msg_func_p_t)(void *p_ctx, etp_msg_type_t type, |
|
39 | 39 |
const char *sz_fmt, ...) |
40 | 40 |
#ifdef __GNUC__ |
41 | 41 |
__attribute__ ((format (printf, 3, 4))) |
42 | 42 |
#endif |
43 | 43 |
; |
44 | 44 |
|
45 |
-#endif /* #ifndef FLP_INC_MSG_H */ |
|
45 |
+#endif /* #ifndef ETP_INC_MSG_H */ |
|
46 | 46 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,29 +17,29 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_INC_TYPES_H |
|
21 |
-#define FLP_INC_TYPES_H |
|
20 |
+#ifndef ETP_INC_TYPES_H |
|
21 |
+#define ETP_INC_TYPES_H |
|
22 | 22 |
|
23 | 23 |
#include <stdint.h> |
24 | 24 |
|
25 | 25 |
/** a single byte */ |
26 |
-typedef uint8_t flp_u8_t; |
|
26 |
+typedef uint8_t etp_u8_t; |
|
27 | 27 |
|
28 |
-/** a FlexiPix display */ |
|
29 |
-typedef struct flp_display_s flp_display_t; |
|
28 |
+/** a EtherPix display */ |
|
29 |
+typedef struct etp_display_s etp_display_t; |
|
30 | 30 |
|
31 | 31 |
/** format of pixel data */ |
32 |
-typedef enum flp_pixfmt_e { |
|
33 |
- flp_pixfmt_rgb24, /**< 24 bit RGB data, 3 bytes: red, green, blue */ |
|
34 |
- flp_pixfmt_bgr24, /**< 24 bit BGR data, 3 bytes: blue, green, red */ |
|
35 |
-} flp_pixfmt_t; |
|
32 |
+typedef enum etp_pixfmt_e { |
|
33 |
+ etp_pixfmt_rgb24, /**< 24 bit RGB data, 3 bytes: red, green, blue */ |
|
34 |
+ etp_pixfmt_bgr24, /**< 24 bit BGR data, 3 bytes: blue, green, red */ |
|
35 |
+} etp_pixfmt_t; |
|
36 | 36 |
|
37 | 37 |
/** |
38 | 38 |
* \brief a displayer |
39 | 39 |
* |
40 | 40 |
* sends pictures to a display whenever the maximum interval expired |
41 | 41 |
*/ |
42 |
-typedef struct flp_displayer_s flp_displayer_t; |
|
42 |
+typedef struct etp_displayer_s etp_displayer_t; |
|
43 | 43 |
|
44 |
-#endif /* #ifndef FLP_INC_TYPES_H */ |
|
44 |
+#endif /* #ifndef ETP_INC_TYPES_H */ |
|
45 | 45 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,21 +17,21 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_CONFIG_H |
|
21 |
-#define FLP_CONFIG_H |
|
20 |
+#ifndef ETP_CONFIG_H |
|
21 |
+#define ETP_CONFIG_H |
|
22 | 22 |
|
23 |
-#include <flexipix/msg.h> |
|
24 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/msg.h> |
|
24 |
+#include <etherpix/types.h> |
|
25 | 25 |
#include <intern/types.h> |
26 | 26 |
|
27 | 27 |
/** context information for processing config file */ |
28 |
-typedef struct flp_config_ctx_s |
|
28 |
+typedef struct etp_config_ctx_s |
|
29 | 29 |
{ |
30 |
- flp_display_t *p_display; /**< display to configure */ |
|
30 |
+ etp_display_t *p_display; /**< display to configure */ |
|
31 | 31 |
unsigned int line_no; /**< current line in config file */ |
32 |
- flp_msg_func_p_t p_msg_func; /**< message callback function or NULL */ |
|
32 |
+ etp_msg_func_p_t p_msg_func; /**< message callback function or NULL */ |
|
33 | 33 |
void *p_msg_ctx; /**< user context for message callback */ |
34 |
-} flp_config_ctx_t; |
|
34 |
+} etp_config_ctx_t; |
|
35 | 35 |
|
36 | 36 |
/** |
37 | 37 |
* \brief process distributor from config file |
... | ... |
@@ -41,7 +41,7 @@ typedef struct flp_config_ctx_s |
41 | 41 |
* \param[in] p_value value of setting |
42 | 42 |
* \return 0 in case of success, -1 in case of error |
43 | 43 |
*/ |
44 |
-int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
44 |
+int etp_config_proc_distri(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
45 | 45 |
char *value); |
46 | 46 |
|
47 | 47 |
/** |
... | ... |
@@ -52,7 +52,7 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
52 | 52 |
* \param[in] p_value value of setting |
53 | 53 |
* \return 0 in case of success, -1 in case of error |
54 | 54 |
*/ |
55 |
-int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
55 |
+int etp_config_proc_mapping(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
56 | 56 |
char *value); |
57 | 57 |
|
58 | 58 |
/** |
... | ... |
@@ -65,7 +65,7 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
65 | 65 |
* \param[in] pix number of pixel |
66 | 66 |
* \return 0 in case of success, -1 in case of error |
67 | 67 |
*/ |
68 |
-int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
|
68 |
+int etp_config_proc_pixel(etp_config_ctx_t *p_ctx, char *sz_pixel, |
|
69 | 69 |
unsigned int distri, unsigned int out, |
70 | 70 |
unsigned int pix); |
71 | 71 |
|
... | ... |
@@ -77,7 +77,7 @@ int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
77 | 77 |
* \param[in] p_value value of setting |
78 | 78 |
* \return 0 in case of success, -1 in case of error |
79 | 79 |
*/ |
80 |
-int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
80 |
+int etp_config_proc_output(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
81 | 81 |
char *value); |
82 | 82 |
|
83 | 83 |
/** |
... | ... |
@@ -88,7 +88,7 @@ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
88 | 88 |
* \param[in] p_value value of setting |
89 | 89 |
* \return 0 in case of success, -1 in case of error |
90 | 90 |
*/ |
91 |
-int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
|
91 |
+int etp_config_proc_setting(etp_config_ctx_t *p_ctx, char *p_setting, |
|
92 | 92 |
char *p_value); |
93 | 93 |
|
94 | 94 |
/** |
... | ... |
@@ -98,7 +98,7 @@ int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
98 | 98 |
* \param[in] p_line line to process |
99 | 99 |
* \return 0 in case of success, -1 in case of error |
100 | 100 |
*/ |
101 |
-int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line); |
|
101 |
+int etp_config_proc_line(etp_config_ctx_t *p_ctx, char *p_line); |
|
102 | 102 |
|
103 | 103 |
/** |
104 | 104 |
* \brief process config file |
... | ... |
@@ -109,9 +109,9 @@ int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line); |
109 | 109 |
* \param[in] p_msg_ctx user context for message callback |
110 | 110 |
* \return 0 in case of success, -1 in case of error |
111 | 111 |
*/ |
112 |
-int flp_config_proc_file(flp_display_t *p_display, |
|
112 |
+int etp_config_proc_file(etp_display_t *p_display, |
|
113 | 113 |
const char *sz_config_file, |
114 |
- flp_msg_func_p_t p_msg_func, void *p_msg_ctx); |
|
114 |
+ etp_msg_func_p_t p_msg_func, void *p_msg_ctx); |
|
115 | 115 |
|
116 |
-#endif /* #ifndef FLP_CONFIG_H */ |
|
116 |
+#endif /* #ifndef ETP_CONFIG_H */ |
|
117 | 117 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,14 +17,14 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_CONST_DATA_H |
|
21 |
-#define FLP_CONST_DATA_H |
|
20 |
+#ifndef ETP_CONST_DATA_H |
|
21 |
+#define ETP_CONST_DATA_H |
|
22 | 22 |
|
23 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/types.h> |
|
24 | 24 |
#include <intern/types.h> |
25 | 25 |
|
26 | 26 |
/** data of MCUF header */ |
27 |
-extern const flp_u8_t flp_mcuf_hdr[FLP_MCUF_HDR_LEN]; |
|
27 |
+extern const etp_u8_t etp_mcuf_hdr[ETP_MCUF_HDR_LEN]; |
|
28 | 28 |
|
29 |
-#endif /* #ifndef FLP_CONST_DATA_H */ |
|
29 |
+#endif /* #ifndef ETP_CONST_DATA_H */ |
|
30 | 30 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,48 +17,48 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_CONSTANTS_H |
|
21 |
-#define FLP_CONSTANTS_H |
|
20 |
+#ifndef ETP_CONSTANTS_H |
|
21 |
+#define ETP_CONSTANTS_H |
|
22 | 22 |
|
23 |
-/* FlexiPix hardware constants */ |
|
24 |
-#define FLP_DISTRI_MAX_CNT (4096) /**< maximum number of distributors |
|
23 |
+/* EtherPix hardware constants */ |
|
24 |
+#define ETP_DISTRI_MAX_CNT (4096) /**< maximum number of distributors |
|
25 | 25 |
* that can be in the system, |
26 | 26 |
* number of distributor addresses |
27 | 27 |
* available */ |
28 |
-#define FLP_OUTPUT_MAX_CNT (128) /**< maximum number of outputs per |
|
28 |
+#define ETP_OUTPUT_MAX_CNT (128) /**< maximum number of outputs per |
|
29 | 29 |
* distributor */ |
30 |
-#define FLP_PIXEL_MAX_CNT (128) /**< maximum number of pixels that can |
|
30 |
+#define ETP_PIXEL_MAX_CNT (128) /**< maximum number of pixels that can |
|
31 | 31 |
* be connected to an output of a |
32 | 32 |
* distributor */ |
33 | 33 |
|
34 | 34 |
/* MCUF constants */ |
35 |
-#define FLP_MCUF_HDR ("\x23\x54\x26\x66" \ |
|
35 |
+#define ETP_MCUF_HDR ("\x23\x54\x26\x66" \ |
|
36 | 36 |
"\x00\x00\x00\x00" \ |
37 | 37 |
"\x00\x03\x00\xFF") /**< data of MCUF header */ |
38 |
-#define FLP_MCUF_HDR_LEN (12) /**< length of MCUF header */ |
|
39 |
-#define FLP_MCUF_HDR_OFS_OUTPUTS (5) /**< offset of output count |
|
38 |
+#define ETP_MCUF_HDR_LEN (12) /**< length of MCUF header */ |
|
39 |
+#define ETP_MCUF_HDR_OFS_OUTPUTS (5) /**< offset of output count |
|
40 | 40 |
* in MCUF data */ |
41 |
-#define FLP_MCUF_HDR_OFS_PIXELS (7) /**< offset of pixel count |
|
41 |
+#define ETP_MCUF_HDR_OFS_PIXELS (7) /**< offset of pixel count |
|
42 | 42 |
* in MCUF data */ |
43 |
-#define FLP_MCUF_MAX_FRAME_INTERVAL_MS (1000) /**< maximum interval between |
|
43 |
+#define ETP_MCUF_MAX_FRAME_INTERVAL_MS (1000) /**< maximum interval between |
|
44 | 44 |
two MCUF frames */ |
45 | 45 |
|
46 | 46 |
/* fixed settings constants */ |
47 |
-#define FLP_DEST_IP_BASE (0x0A465000) /**< base IP address of distributors, |
|
47 |
+#define ETP_DEST_IP_BASE (0x0A465000) /**< base IP address of distributors, |
|
48 | 48 |
* i.e. IP address of distributor 0, |
49 | 49 |
* 10.70.80.0 */ |
50 |
-#define FLP_DEST_IP_STEP (0x00000001) /**< IP adress step of distributors, |
|
50 |
+#define ETP_DEST_IP_STEP (0x00000001) /**< IP adress step of distributors, |
|
51 | 51 |
* i.e. increment of IP address for |
52 | 52 |
* every distributor address, |
53 | 53 |
* 0.0.0.1 */ |
54 |
-#define FLP_DEST_PORT (2323) /**< UDP port the distributors |
|
54 |
+#define ETP_DEST_PORT (2323) /**< UDP port the distributors |
|
55 | 55 |
* listen on */ |
56 | 56 |
|
57 | 57 |
/* default settings constants */ |
58 |
-#define FLP_BIND_IP (0x00000000) /**< default IP to bind to |
|
58 |
+#define ETP_BIND_IP (0x00000000) /**< default IP to bind to |
|
59 | 59 |
* (first IP octect in LSB) */ |
60 |
-#define FLP_BIND_PORT (0) /**< default port to bind to */ |
|
60 |
+#define ETP_BIND_PORT (0) /**< default port to bind to */ |
|
61 | 61 |
|
62 | 62 |
|
63 |
-#endif /* #ifndef FLP_CONSTANTS_H */ |
|
63 |
+#endif /* #ifndef ETP_CONSTANTS_H */ |
|
64 | 64 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_DISPLAYER_H |
|
21 |
-#define FLP_DISPLAYER_H |
|
20 |
+#ifndef ETP_DISPLAYER_H |
|
21 |
+#define ETP_DISPLAYER_H |
|
22 | 22 |
|
23 | 23 |
#include <intern/thread.h> |
24 | 24 |
|
... | ... |
@@ -28,7 +28,7 @@ |
28 | 28 |
* \param[in] vp_displayer pointer to displayer object |
29 | 29 |
* \return unused, always NULL |
30 | 30 |
*/ |
31 |
-FLP_THREAD_FUNC(flp_displayer_thread); |
|
31 |
+ETP_THREAD_FUNC(etp_displayer_thread); |
|
32 | 32 |
|
33 |
-#endif /* #ifndef FLP_DISPLAYER_H */ |
|
33 |
+#endif /* #ifndef ETP_DISPLAYER_H */ |
|
34 | 34 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_MAPPING_H |
|
21 |
-#define FLP_MAPPING_H |
|
20 |
+#ifndef ETP_MAPPING_H |
|
21 |
+#define ETP_MAPPING_H |
|
22 | 22 |
|
23 | 23 |
#include <intern/types.h> |
24 | 24 |
|
... | ... |
@@ -29,7 +29,7 @@ |
29 | 29 |
* |
30 | 30 |
* \param[in,out] p_mapping mapping to precalculate |
31 | 31 |
*/ |
32 |
-void flp_mapping_precalc(flp_mapping_t *p_mapping); |
|
32 |
+void etp_mapping_precalc(etp_mapping_t *p_mapping); |
|
33 | 33 |
|
34 |
-#endif /* #ifndef FLP_MAPPING_H */ |
|
34 |
+#endif /* #ifndef ETP_MAPPING_H */ |
|
35 | 35 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_MISSING_H |
|
21 |
-#define FLP_MISSING_H |
|
20 |
+#ifndef ETP_MISSING_H |
|
21 |
+#define ETP_MISSING_H |
|
22 | 22 |
|
23 | 23 |
#include <string.h> |
24 | 24 |
|
... | ... |
@@ -32,5 +32,5 @@ static inline char * strerror_r(int errnum, char *buf, size_t buflen) |
32 | 32 |
} |
33 | 33 |
#endif |
34 | 34 |
|
35 |
-#endif /* #ifndef FLP_MISSING_H */ |
|
35 |
+#endif /* #ifndef ETP_MISSING_H */ |
|
36 | 36 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_NET_H |
|
21 |
-#define FLP_NET_H |
|
20 |
+#ifndef ETP_NET_H |
|
21 |
+#define ETP_NET_H |
|
22 | 22 |
|
23 | 23 |
#ifdef WINDOWS |
24 | 24 |
# include <stdint.h> |
... | ... |
@@ -35,9 +35,9 @@ |
35 | 35 |
|
36 | 36 |
/** type of socket descriptor */ |
37 | 37 |
#ifdef WINDOWS |
38 |
-typedef SOCKET flp_sock_t; |
|
38 |
+typedef SOCKET etp_sock_t; |
|
39 | 39 |
#else |
40 |
-typedef int flp_sock_t; |
|
40 |
+typedef int etp_sock_t; |
|
41 | 41 |
#endif |
42 | 42 |
|
43 | 43 |
#ifdef WINDOWS |
... | ... |
@@ -63,7 +63,7 @@ static inline int closesocket(int fd) |
63 | 63 |
* \param[in] sock socket descriptor to check |
64 | 64 |
* \return 1 if valid, 0 if not valid |
65 | 65 |
*/ |
66 |
-static inline int flp_sock_is_valid(flp_sock_t sock) |
|
66 |
+static inline int etp_sock_is_valid(etp_sock_t sock) |
|
67 | 67 |
{ |
68 | 68 |
#ifdef WINDOWS |
69 | 69 |
return sock != INVALID_SOCKET; |
... | ... |
@@ -77,7 +77,7 @@ static inline int flp_sock_is_valid(flp_sock_t sock) |
77 | 77 |
* \param[in] buf pointer to buffer to place text into |
78 | 78 |
* \param[in] buflen size of buffer |
79 | 79 |
*/ |
80 |
-static inline void flp_sock_get_last_error(char *buf, size_t buflen) |
|
80 |
+static inline void etp_sock_get_last_error(char *buf, size_t buflen) |
|
81 | 81 |
{ |
82 | 82 |
#ifdef WINDOWS |
83 | 83 |
int err = WSAGetLastError(); |
... | ... |
@@ -88,5 +88,5 @@ static inline void flp_sock_get_last_error(char *buf, size_t buflen) |
88 | 88 |
#endif |
89 | 89 |
} |
90 | 90 |
|
91 |
-#endif /* #ifndef FLP_NET_H */ |
|
91 |
+#endif /* #ifndef ETP_NET_H */ |
|
92 | 92 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_PARSE_H |
|
21 |
-#define FLP_PARSE_H |
|
20 |
+#ifndef ETP_PARSE_H |
|
21 |
+#define ETP_PARSE_H |
|
22 | 22 |
|
23 | 23 |
#include <intern/net.h> |
24 | 24 |
|
... | ... |
@@ -31,7 +31,7 @@ |
31 | 31 |
* \param[out] end location in text where parsing ended |
32 | 32 |
* \return 0 in case of success, -1 in case of error |
33 | 33 |
*/ |
34 |
-int flp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
|
34 |
+int etp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
|
35 | 35 |
char **end); |
36 | 36 |
|
37 | 37 |
/** |
... | ... |
@@ -41,7 +41,7 @@ int flp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
41 | 41 |
* \param[out] addr address parsed from text |
42 | 42 |
* \return 0 in case of success, -1 in case of error |
43 | 43 |
*/ |
44 |
-int flp_parse_addr(char *text, struct sockaddr_in *addr); |
|
44 |
+int etp_parse_addr(char *text, struct sockaddr_in *addr); |
|
45 | 45 |
|
46 |
-#endif /* #ifndef FLP_PARSE_H */ |
|
46 |
+#endif /* #ifndef ETP_PARSE_H */ |
|
47 | 47 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_STRTOD_NOLOC_H |
|
21 |
-#define FLP_STRTOD_NOLOC_H |
|
20 |
+#ifndef ETP_STRTOD_NOLOC_H |
|
21 |
+#define ETP_STRTOD_NOLOC_H |
|
22 | 22 |
|
23 | 23 |
/** |
24 | 24 |
* \brief own version of strtod ignoring locale |
... | ... |
@@ -30,7 +30,7 @@ |
30 | 30 |
* \param[out] endptr filled with pointer to |
31 | 31 |
* \return value read from the string |
32 | 32 |
*/ |
33 |
-double flp_strtod_noloc(const char *nptr, char **endptr); |
|
33 |
+double etp_strtod_noloc(const char *nptr, char **endptr); |
|
34 | 34 |
|
35 |
-#endif /* #ifndef FLP_STRTOD_NOLOC_H */ |
|
35 |
+#endif /* #ifndef ETP_STRTOD_NOLOC_H */ |
|
36 | 36 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,8 +17,8 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_THREAD_H |
|
21 |
-#define FLP_THREAD_H |
|
20 |
+#ifndef ETP_THREAD_H |
|
21 |
+#define ETP_THREAD_H |
|
22 | 22 |
|
23 | 23 |
#ifdef WINDOWS |
24 | 24 |
# include <windows.h> |
... | ... |
@@ -31,37 +31,37 @@ |
31 | 31 |
|
32 | 32 |
/** signature to define or declare thread function */ |
33 | 33 |
#ifdef WINDOWS |
34 |
-# define FLP_THREAD_FUNC(func) DWORD (__stdcall func)(LPVOID vp_displayer) |
|
34 |
+# define ETP_THREAD_FUNC(func) DWORD (__stdcall func)(LPVOID vp_displayer) |
|
35 | 35 |
#else |
36 |
-# define FLP_THREAD_FUNC(func) void * (func)(void *vp_displayer) |
|
36 |
+# define ETP_THREAD_FUNC(func) void * (func)(void *vp_displayer) |
|
37 | 37 |
#endif |
38 | 38 |
|
39 | 39 |
/** return a void pointer from a thread function */ |
40 | 40 |
#ifdef WINDOWS |
41 |
-# define FLP_THREAD_RETURN(vp) return (DWORD)(vp); |
|
41 |
+# define ETP_THREAD_RETURN(vp) return (DWORD)(vp); |
|
42 | 42 |
#else |
43 |
-# define FLP_THREAD_RETURN(vp) return (vp); |
|
43 |
+# define ETP_THREAD_RETURN(vp) return (vp); |
|
44 | 44 |
#endif |
45 | 45 |
|
46 | 46 |
/** type for a thread ID */ |
47 | 47 |
#ifdef WINDOWS |
48 |
-typedef HANDLE flp_thread_id_t; |
|
48 |
+typedef HANDLE etp_thread_id_t; |
|
49 | 49 |
#else |
50 |
-typedef pthread_t flp_thread_id_t; |
|
50 |
+typedef pthread_t etp_thread_id_t; |
|
51 | 51 |
#endif |
52 | 52 |
|
53 | 53 |
/** type for a mutex */ |
54 | 54 |
#ifdef WINDOWS |
55 |
-typedef HANDLE flp_thread_mutex_t; |
|
55 |
+typedef HANDLE etp_thread_mutex_t; |
|
56 | 56 |
#else |
57 |
-typedef pthread_mutex_t flp_thread_mutex_t; |
|
57 |
+typedef pthread_mutex_t etp_thread_mutex_t; |
|
58 | 58 |
#endif |
59 | 59 |
|
60 | 60 |
/** type for a condition */ |
61 | 61 |
#ifdef WINDOWS |
62 |
-typedef HANDLE flp_thread_cond_t; |
|
62 |
+typedef HANDLE etp_thread_cond_t; |
|
63 | 63 |
#else |
64 |
-typedef pthread_cond_t flp_thread_cond_t; |
|
64 |
+typedef pthread_cond_t etp_thread_cond_t; |
|
65 | 65 |
#endif |
66 | 66 |
|
67 | 67 |
/** |
... | ... |
@@ -71,8 +71,8 @@ typedef pthread_cond_t flp_thread_cond_t; |
71 | 71 |
* \param[in] p_data user data pointer |
72 | 72 |
* \return 1 if successful, 0 on error |
73 | 73 |
*/ |
74 |
-static inline int flp_thread_create(flp_thread_id_t *p_tid, |
|
75 |
- FLP_THREAD_FUNC(*func), |
|
74 |
+static inline int etp_thread_create(etp_thread_id_t *p_tid, |
|
75 |
+ ETP_THREAD_FUNC(*func), |
|
76 | 76 |
void * p_data) |
77 | 77 |
{ |
78 | 78 |
#ifdef WINDOWS |
... | ... |
@@ -89,7 +89,7 @@ static inline int flp_thread_create(flp_thread_id_t *p_tid, |
89 | 89 |
* \brief join a thread |
90 | 90 |
* \param[in] tid thread ID |
91 | 91 |
*/ |
92 |
-static inline void flp_thread_join(flp_thread_id_t tid) |
|
92 |
+static inline void etp_thread_join(etp_thread_id_t tid) |
|
93 | 93 |
{ |
94 | 94 |
#ifdef WINDOWS |
95 | 95 |
WaitForSingleObject(tid, INFINITE); |
... | ... |
@@ -104,7 +104,7 @@ static inline void flp_thread_join(flp_thread_id_t tid) |
104 | 104 |
* \param[in] *p_mtx mutex variable |
105 | 105 |
* \return 1 if successful, 0 on error |
106 | 106 |
*/ |
107 |
-static inline int flp_thread_mutex_init(flp_thread_mutex_t *p_mtx) |
|
107 |
+static inline int etp_thread_mutex_init(etp_thread_mutex_t *p_mtx) |
|
108 | 108 |
{ |
109 | 109 |
#ifdef WINDOWS |
110 | 110 |
HANDLE h = CreateMutex(NULL, FALSE, NULL); |
... | ... |
@@ -120,7 +120,7 @@ static inline int flp_thread_mutex_init(flp_thread_mutex_t *p_mtx) |
120 | 120 |
* \brief destroy mutex |
121 | 121 |
* \param[in] *p_mtx mutex variable |
122 | 122 |
*/ |
123 |
-static inline void flp_thread_mutex_destroy(flp_thread_mutex_t *p_mtx) |
|
123 |
+static inline void etp_thread_mutex_destroy(etp_thread_mutex_t *p_mtx) |
|
124 | 124 |
{ |
125 | 125 |
#ifdef WINDOWS |
126 | 126 |
CloseHandle(*p_mtx); |
... | ... |
@@ -133,7 +133,7 @@ static inline void flp_thread_mutex_destroy(flp_thread_mutex_t *p_mtx) |
133 | 133 |
* \brief lock mutex |
134 | 134 |
* \param[in] *p_mtx mutex variable |
135 | 135 |
*/ |
136 |
-static inline void flp_thread_mutex_lock(flp_thread_mutex_t *p_mtx) |
|
136 |
+static inline void etp_thread_mutex_lock(etp_thread_mutex_t *p_mtx) |
|
137 | 137 |
{ |
138 | 138 |
#ifdef WINDOWS |
139 | 139 |
WaitForSingleObject(*p_mtx, INFINITE); |
... | ... |
@@ -146,7 +146,7 @@ static inline void flp_thread_mutex_lock(flp_thread_mutex_t *p_mtx) |
146 | 146 |
* \brief unlock mutex |
147 | 147 |
* \param[in] *p_mtx mutex variable |
148 | 148 |
*/ |
149 |
-static inline void flp_thread_mutex_unlock(flp_thread_mutex_t *p_mtx) |
|
149 |
+static inline void etp_thread_mutex_unlock(etp_thread_mutex_t *p_mtx) |
|
150 | 150 |
{ |
151 | 151 |
#ifdef WINDOWS |
152 | 152 |
ReleaseMutex(*p_mtx); |
... | ... |
@@ -160,7 +160,7 @@ static inline void flp_thread_mutex_unlock(flp_thread_mutex_t *p_mtx) |
160 | 160 |
* \param[in] *p_cond conition variable |
161 | 161 |
* \return 1 if successful, 0 on error |
162 | 162 |
*/ |
163 |
-static inline int flp_thread_cond_init(flp_thread_cond_t *p_cond) |
|
163 |
+static inline int etp_thread_cond_init(etp_thread_cond_t *p_cond) |
|
164 | 164 |
{ |
165 | 165 |
#ifdef WINDOWS |
166 | 166 |
HANDLE h = CreateEvent(NULL, FALSE, FALSE, NULL); |
... | ... |
@@ -176,7 +176,7 @@ static inline int flp_thread_cond_init(flp_thread_cond_t *p_cond) |
176 | 176 |
* \brief destroy condition |
177 | 177 |
* \param[in] *p_cond condition variable |
178 | 178 |
*/ |
179 |
-static inline void flp_thread_cond_destroy(flp_thread_cond_t *p_cond) |
|
179 |
+static inline void etp_thread_cond_destroy(etp_thread_cond_t *p_cond) |
|
180 | 180 |
{ |
181 | 181 |
#ifdef WINDOWS |
182 | 182 |
CloseHandle(*p_cond); |
... | ... |
@@ -189,7 +189,7 @@ static inline void flp_thread_cond_destroy(flp_thread_cond_t *p_cond) |
189 | 189 |
* \brief signal condition |
190 | 190 |
* \param[in] *p_cond condition variable |
191 | 191 |
*/ |
192 |
-static inline void flp_thread_cond_signal(flp_thread_cond_t *p_cond) |
|
192 |
+static inline void etp_thread_cond_signal(etp_thread_cond_t *p_cond) |
|
193 | 193 |
{ |
194 | 194 |
#ifdef WINDOWS |
195 | 195 |
SetEvent(*p_cond); |
... | ... |
@@ -203,12 +203,12 @@ static inline void flp_thread_cond_signal(flp_thread_cond_t *p_cond) |
203 | 203 |
* \param[in] *p_cond condition variable |
204 | 204 |
* \param[in] *p_mtx mutex variable to unlock while waiting |
205 | 205 |
*/ |
206 |
-static inline void flp_thread_cond_wait(flp_thread_cond_t *p_cond, |
|
207 |
- flp_thread_mutex_t *p_mtx) |
|
206 |
+static inline void etp_thread_cond_wait(etp_thread_cond_t *p_cond, |
|
207 |
+ etp_thread_mutex_t *p_mtx) |
|
208 | 208 |
{ |
209 | 209 |
#ifdef WINDOWS |
210 | 210 |
/* the unlock/wait-begin and wait-end/lock are atomic for pthread, |
211 |
- but this is not needed for libflexipix... */ |
|
211 |
+ but this is not needed for libetherpix... */ |
|
212 | 212 |
ReleaseMutex(*p_mtx); /* unlock mutex */ |
213 | 213 |
WaitForSingleObject(*p_cond, INFINITE); /* wait for condition */ |
214 | 214 |
WaitForSingleObject(*p_mtx, INFINITE); /* lock mutex again */ |
... | ... |
@@ -225,15 +225,15 @@ static inline void flp_thread_cond_wait(flp_thread_cond_t *p_cond, |
225 | 225 |
* \param[in] millisecs number of milliseconds to wait at most |
226 | 226 |
* \return 0 for condition singnaled, 1 for timeout |
227 | 227 |
*/ |
228 |
-static inline int flp_thread_cond_timedwait(flp_thread_cond_t *p_cond, |
|
229 |
- flp_thread_mutex_t *p_mtx, |
|
228 |
+static inline int etp_thread_cond_timedwait(etp_thread_cond_t *p_cond, |
|
229 |
+ etp_thread_mutex_t *p_mtx, |
|
230 | 230 |
struct timeval *p_now, |
231 | 231 |
unsigned int millisecs) |
232 | 232 |
{ |
233 | 233 |
#ifdef WINDOWS |
234 | 234 |
int ret; |
235 | 235 |
/* the unlock/wait-begin and wait-end/lock are atomic for pthread, |
236 |
- but this is not needed for libflexipix... */ |
|
236 |
+ but this is not needed for libetherpix... */ |
|
237 | 237 |
ReleaseMutex(*p_mtx); /* unlock mutex */ |
238 | 238 |
ret = WaitForSingleObject(*p_cond, millisecs); /* wait for condition */ |
239 | 239 |
WaitForSingleObject(*p_mtx, INFINITE); /* lock mutex again */ |
... | ... |
@@ -251,5 +251,5 @@ static inline int flp_thread_cond_timedwait(flp_thread_cond_t *p_cond, |
251 | 251 |
#endif |
252 | 252 |
} |
253 | 253 |
|
254 |
-#endif /* #ifndef FLP_THREAD_H */ |
|
254 |
+#endif /* #ifndef ETP_THREAD_H */ |
|
255 | 255 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,10 +17,10 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#ifndef FLP_TYPES_H |
|
21 |
-#define FLP_TYPES_H |
|
20 |
+#ifndef ETP_TYPES_H |
|
21 |
+#define ETP_TYPES_H |
|
22 | 22 |
|
23 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/types.h> |
|
24 | 24 |
#include <intern/constants.h> |
25 | 25 |
#include <intern/net.h> |
26 | 26 |
#include <intern/thread.h> |
... | ... |
@@ -30,64 +30,64 @@ |
30 | 30 |
* values of channels are mapped according to following formula: |
31 | 31 |
* <display value> := <base> + <factor> * <original value> ^ (1 / <gamma>) |
32 | 32 |
*/ |
33 |
-typedef struct flp_mapping_s { |
|
33 |
+typedef struct etp_mapping_s { |
|
34 | 34 |
double base; /**< base constant for brightness correction */ |
35 | 35 |
double factor; /**< factor for contrast modification */ |
36 | 36 |
double gamma; /**< gamma correction factor, must be > 0.0 */ |
37 |
- flp_u8_t table[256]; /**< precalculated mapping table, |
|
37 |
+ etp_u8_t table[256]; /**< precalculated mapping table, |
|
38 | 38 |
* index: source image value |
39 | 39 |
* value: display value */ |
40 |
-} flp_mapping_t; |
|
40 |
+} etp_mapping_t; |
|
41 | 41 |
|
42 | 42 |
/** information about a pixel */ |
43 |
-typedef struct flp_pixel_s { |
|
43 |
+typedef struct etp_pixel_s { |
|
44 | 44 |
int x, y; /**< coordinates of pixel in movie (-1 if unknown yet) */ |
45 |
-} flp_pixel_t; |
|
45 |
+} etp_pixel_t; |
|
46 | 46 |
|
47 | 47 |
/** information about a distributor */ |
48 |
-typedef struct flp_distri_s { |
|
48 |
+typedef struct etp_distri_s { |
|
49 | 49 |
unsigned int distri; /**< number of this distributor */ |
50 | 50 |
unsigned int output_cnt; /**< number of outputs of this distributor */ |
51 | 51 |
unsigned int pixel_cnt; /**< number of pixels connected to every output */ |
52 | 52 |
struct sockaddr_in addr; /**< network address of distributor */ |
53 |
- flp_mapping_t mapping[3]; /**< mapping information for red, green |
|
53 |
+ etp_mapping_t mapping[3]; /**< mapping information for red, green |
|
54 | 54 |
* and blue channel */ |
55 |
- flp_pixel_t *p_pixels; /**< array with information about pixels |
|
55 |
+ etp_pixel_t *p_pixels; /**< array with information about pixels |
|
56 | 56 |
* of this distributor, |
57 | 57 |
* index = output * pixel_cnt + pixel, |
58 | 58 |
* malloc-ed */ |
59 | 59 |
unsigned int msg_len; /**< size of a message to send to distributor */ |
60 |
- flp_u8_t *p_msg_buf; /**< buffer for current message to send |
|
60 |
+ etp_u8_t *p_msg_buf; /**< buffer for current message to send |
|
61 | 61 |
* to distributor, |
62 | 62 |
* malloc-ed */ |
63 |
-} flp_distri_t; |
|
63 |
+} etp_distri_t; |
|
64 | 64 |
|
65 | 65 |
/** information about a display */ |
66 |
-struct flp_display_s { |
|
66 |
+struct etp_display_s { |
|
67 | 67 |
struct sockaddr_in bind_addr; /**< local network address to bind to */ |
68 |
- flp_pixel_t size; /**< size of display */ |
|
69 |
- flp_distri_t *distri_ptrs |
|
70 |
- [FLP_DISTRI_MAX_CNT]; /**< information about distributors, |
|
68 |
+ etp_pixel_t size; /**< size of display */ |
|
69 |
+ etp_distri_t *distri_ptrs |
|
70 |
+ [ETP_DISTRI_MAX_CNT]; /**< information about distributors, |
|
71 | 71 |
* distributors are malloc-ed */ |
72 | 72 |
unsigned int distri_cnt; /**< total number of distris */ |
73 | 73 |
unsigned int output_cnt; /**< total number of outputs */ |
74 | 74 |
unsigned long pixel_cnt; /**< total number of pixels */ |
75 |
- flp_sock_t sock; /**< socket to send UDP packets */ |
|
75 |
+ etp_sock_t sock; /**< socket to send UDP packets */ |
|
76 | 76 |
}; |
77 | 77 |
|
78 | 78 |
/** a displayer |
79 | 79 |
* |
80 | 80 |
* sends pictures to a display whenever the maximum interval expired |
81 | 81 |
*/ |
82 |
-struct flp_displayer_s { |
|
83 |
- flp_display_t *p_display; /**< display managed by this displayer */ |
|
84 |
- flp_thread_mutex_t mtx; /**< mutex to lock msg_buf of distris */ |
|
85 |
- flp_thread_cond_t cond; /**< condition to wake up thread on new frame */ |
|
86 |
- flp_thread_id_t tid; /**< id of output thread */ |
|
82 |
+struct etp_displayer_s { |
|
83 |
+ etp_display_t *p_display; /**< display managed by this displayer */ |
|
84 |
+ etp_thread_mutex_t mtx; /**< mutex to lock msg_buf of distris */ |
|
85 |
+ etp_thread_cond_t cond; /**< condition to wake up thread on new frame */ |
|
86 |
+ etp_thread_id_t tid; /**< id of output thread */ |
|
87 | 87 |
volatile int active; /**< if to output to distris */ |
88 | 88 |
volatile int send; /**< set to force immediate sending to distris */ |
89 | 89 |
volatile int end; /**< set to signal end to thread */ |
90 | 90 |
}; |
91 | 91 |
|
92 |
-#endif /* #ifndef FLP_TYPES_H */ |
|
92 |
+#endif /* #ifndef ETP_TYPES_H */ |
|
93 | 93 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -22,8 +22,8 @@ |
22 | 22 |
#include <stdlib.h> |
23 | 23 |
#include <string.h> |
24 | 24 |
|
25 |
-#include <flexipix/msg.h> |
|
26 |
-#include <flexipix/types.h> |
|
25 |
+#include <etherpix/msg.h> |
|
26 |
+#include <etherpix/types.h> |
|
27 | 27 |
#include <intern/const_data.h> |
28 | 28 |
#include <intern/constants.h> |
29 | 29 |
#include <intern/config.h> |
... | ... |
@@ -42,19 +42,19 @@ |
42 | 42 |
* \param[in] p_value value of setting |
43 | 43 |
* \return 0 in case of success, -1 in case of error |
44 | 44 |
*/ |
45 |
-int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
45 |
+int etp_config_proc_distri(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
46 | 46 |
char *p_value) |
47 | 47 |
{ |
48 | 48 |
char *ptr; |
49 | 49 |
unsigned long val; |
50 | 50 |
unsigned int distri, out, pix, i; |
51 |
- flp_distri_t *p_distri; |
|
51 |
+ etp_distri_t *p_distri; |
|
52 | 52 |
|
53 | 53 |
/* get distributor number */ |
54 | 54 |
val = strtoul(p_setting_part2, &ptr, 0); |
55 |
- if (ptr == p_setting_part2 || *ptr != 0 || val >= FLP_DISTRI_MAX_CNT) { |
|
55 |
+ if (ptr == p_setting_part2 || *ptr != 0 || val >= ETP_DISTRI_MAX_CNT) { |
|
56 | 56 |
if (p_ctx->p_msg_func) |
57 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
57 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
58 | 58 |
"invalid distributor number \"%s\"" |
59 | 59 |
" in line %u of config file\n", |
60 | 60 |
p_setting_part2, p_ctx->line_no); |
... | ... |
@@ -63,25 +63,25 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
63 | 63 |
distri = (unsigned int)val; |
64 | 64 |
|
65 | 65 |
/* get number of outputs and pixels */ |
66 |
- if (flp_parse_two_nos(p_value, &out, &pix, &ptr) || *ptr != 0) { |
|
66 |
+ if (etp_parse_two_nos(p_value, &out, &pix, &ptr) || *ptr != 0) { |
|
67 | 67 |
if (p_ctx->p_msg_func) |
68 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
68 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
69 | 69 |
"invalid distributor size \"%s\"" |
70 | 70 |
" in line %u of config file\n", |
71 | 71 |
p_value, p_ctx->line_no); |
72 | 72 |
return -1; |
73 | 73 |
} |
74 |
- if (out >= FLP_OUTPUT_MAX_CNT) { |
|
74 |
+ if (out >= ETP_OUTPUT_MAX_CNT) { |
|
75 | 75 |
if (p_ctx->p_msg_func) |
76 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
76 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
77 | 77 |
"invalid number of outputs \"%u\"" |
78 | 78 |
" in line %u of config file\n", |
79 | 79 |
out, p_ctx->line_no); |
80 | 80 |
return -1; |
81 | 81 |
} |
82 |
- if (pix >= FLP_PIXEL_MAX_CNT) { |
|
82 |
+ if (pix >= ETP_PIXEL_MAX_CNT) { |
|
83 | 83 |
if (p_ctx->p_msg_func) |
84 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
84 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
85 | 85 |
"invalid number of pixels \"%u\"" |
86 | 86 |
" in line %u of config file\n", |
87 | 87 |
pix, p_ctx->line_no); |
... | ... |
@@ -91,7 +91,7 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
91 | 91 |
/* check if distributor is already present */ |
92 | 92 |
if (p_ctx->p_display->distri_ptrs[distri]) { |
93 | 93 |
if (p_ctx->p_msg_func) |
94 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
94 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
95 | 95 |
"duplicate definition of distributor \"%u\"" |
96 | 96 |
" in line %u of config file\n", |
97 | 97 |
distri, p_ctx->line_no); |
... | ... |
@@ -99,10 +99,10 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
/* create a new distributor */ |
102 |
- p_distri = (flp_distri_t *)malloc(sizeof (flp_distri_t)); |
|
102 |
+ p_distri = (etp_distri_t *)malloc(sizeof (etp_distri_t)); |
|
103 | 103 |
if (!p_distri) { |
104 | 104 |
if (p_ctx->p_msg_func) |
105 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, "out of memory\n"); |
|
105 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, "out of memory\n"); |
|
106 | 106 |
return -1; |
107 | 107 |
} |
108 | 108 |
p_distri->distri = distri; |
... | ... |
@@ -110,23 +110,23 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
110 | 110 |
p_distri->pixel_cnt = pix; |
111 | 111 |
/* initialize address to default */ |
112 | 112 |
p_distri->addr.sin_family = AF_INET; |
113 |
- p_distri->addr.sin_addr.s_addr = htonl(FLP_DEST_IP_BASE + |
|
114 |
- p_distri->distri * FLP_DEST_IP_STEP); |
|
115 |
- p_distri->addr.sin_port = htons(FLP_DEST_PORT); |
|
113 |
+ p_distri->addr.sin_addr.s_addr = htonl(ETP_DEST_IP_BASE + |
|
114 |
+ p_distri->distri * ETP_DEST_IP_STEP); |
|
115 |
+ p_distri->addr.sin_port = htons(ETP_DEST_PORT); |
|
116 | 116 |
/* initialize mapping information */ |
117 | 117 |
for (i = 0; i < 3; i++) { |
118 | 118 |
p_distri->mapping[i].base = 0.0; |
119 | 119 |
p_distri->mapping[i].gamma = 1.0; |
120 | 120 |
p_distri->mapping[i].factor = 1.0; |
121 |
- flp_mapping_precalc(&p_distri->mapping[i]); |
|
121 |
+ etp_mapping_precalc(&p_distri->mapping[i]); |
|
122 | 122 |
} |
123 | 123 |
/* create and initialize pixel array */ |
124 | 124 |
p_distri->p_pixels = |
125 |
- (flp_pixel_t *)malloc(out * pix * sizeof (flp_pixel_t)); |
|
125 |
+ (etp_pixel_t *)malloc(out * pix * sizeof (etp_pixel_t)); |
|
126 | 126 |
if (!p_distri->p_pixels) { |
127 | 127 |
free(p_distri); |
128 | 128 |
if (p_ctx->p_msg_func) |
129 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, "out of memory\n"); |
|
129 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, "out of memory\n"); |
|
130 | 130 |
return -1; |
131 | 131 |
} |
132 | 132 |
for (i = 0; i < out * pix; i++) { |
... | ... |
@@ -134,19 +134,19 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
134 | 134 |
p_distri->p_pixels[i].y = -1; |
135 | 135 |
} |
136 | 136 |
/* create and initialize message buffer */ |
137 |
- p_distri->msg_len = FLP_MCUF_HDR_LEN + out * pix * 3; |
|
138 |
- p_distri->p_msg_buf = (flp_u8_t *)malloc(p_distri->msg_len); |
|
137 |
+ p_distri->msg_len = ETP_MCUF_HDR_LEN + out * pix * 3; |
|
138 |
+ p_distri->p_msg_buf = (etp_u8_t *)malloc(p_distri->msg_len); |
|
139 | 139 |
if (!p_distri->p_msg_buf) { |
140 | 140 |
free(p_distri->p_pixels); |
141 | 141 |
free(p_distri); |
142 | 142 |
if (p_ctx->p_msg_func) |
143 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, "out of memory\n"); |
|
143 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, "out of memory\n"); |
|
144 | 144 |
return -1; |
145 | 145 |
} |
146 | 146 |
memset(p_distri->p_msg_buf, 0, p_distri->msg_len); |
147 |
- memcpy(p_distri->p_msg_buf, flp_mcuf_hdr, FLP_MCUF_HDR_LEN); |
|
148 |
- p_distri->p_msg_buf[FLP_MCUF_HDR_OFS_OUTPUTS] = (flp_u8_t)out; |
|
149 |
- p_distri->p_msg_buf[FLP_MCUF_HDR_OFS_PIXELS] = (flp_u8_t)pix; |
|
147 |
+ memcpy(p_distri->p_msg_buf, etp_mcuf_hdr, ETP_MCUF_HDR_LEN); |
|
148 |
+ p_distri->p_msg_buf[ETP_MCUF_HDR_OFS_OUTPUTS] = (etp_u8_t)out; |
|
149 |
+ p_distri->p_msg_buf[ETP_MCUF_HDR_OFS_PIXELS] = (etp_u8_t)pix; |
|
150 | 150 |
/* store pointer to distributor */ |
151 | 151 |
p_ctx->p_display->distri_ptrs[distri] = p_distri; |
152 | 152 |
|
... | ... |
@@ -164,28 +164,28 @@ int flp_config_proc_distri(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
164 | 164 |
* \param[in] p_value value of setting |
165 | 165 |
* \return 0 in case of success, -1 in case of error |
166 | 166 |
*/ |
167 |
-int flp_config_proc_distri_addr(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
167 |
+int etp_config_proc_distri_addr(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
168 | 168 |
char *p_value) |
169 | 169 |
{ |
170 | 170 |
char *ptr; |
171 | 171 |
unsigned long val; |
172 | 172 |
unsigned int distri; |
173 |
- flp_distri_t *p_distri; |
|
173 |
+ etp_distri_t *p_distri; |
|
174 | 174 |
|
175 | 175 |
/* get distributor number */ |
176 | 176 |
val = strtoul(p_setting_part2, &ptr, 0); |
177 | 177 |
if (ptr == p_setting_part2 || *ptr != 0) { |
178 | 178 |
if (p_ctx->p_msg_func) |
179 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
179 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
180 | 180 |
"invalid mapping specifier \"%s\"" |
181 | 181 |
" in line %u of config file\n", |
182 | 182 |
p_setting_part2, p_ctx->line_no); |
183 | 183 |
return -1; |
184 | 184 |
} |
185 | 185 |
distri = (unsigned int)val; |
186 |
- if (distri >= FLP_DISTRI_MAX_CNT) { |
|
186 |
+ if (distri >= ETP_DISTRI_MAX_CNT) { |
|
187 | 187 |
if (p_ctx->p_msg_func) |
188 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
188 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
189 | 189 |
"invalid distributor number \"%u\"" |
190 | 190 |
" in line %u of config file\n", |
191 | 191 |
distri, p_ctx->line_no); |
... | ... |
@@ -196,7 +196,7 @@ int flp_config_proc_distri_addr(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
196 | 196 |
p_distri = p_ctx->p_display->distri_ptrs[distri]; |
197 | 197 |
if (!p_distri) { |
198 | 198 |
if (p_ctx->p_msg_func) |
199 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
199 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
200 | 200 |
"no distributor with number \"%u\"" |
201 | 201 |
" in line %u of config file\n", |
202 | 202 |
distri, p_ctx->line_no); |
... | ... |
@@ -204,9 +204,9 @@ int flp_config_proc_distri_addr(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
204 | 204 |
} |
205 | 205 |
|
206 | 206 |
/* get address */ |
207 |
- if (flp_parse_addr(p_value, &p_distri->addr)) { |
|
207 |
+ if (etp_parse_addr(p_value, &p_distri->addr)) { |
|
208 | 208 |
if (p_ctx->p_msg_func) |
209 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
209 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
210 | 210 |
"invalid address \"%s\" for distributor with number" |
211 | 211 |
" \"%u\" in line %u of config file\n", |
212 | 212 |
p_value, distri, p_ctx->line_no); |
... | ... |
@@ -224,13 +224,13 @@ int flp_config_proc_distri_addr(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
224 | 224 |
* \param[in] p_value value of setting |
225 | 225 |
* \return 0 in case of success, -1 in case of error |
226 | 226 |
*/ |
227 |
-int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
227 |
+int etp_config_proc_mapping(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
228 | 228 |
char *p_value) |
229 | 229 |
{ |
230 | 230 |
char *ptr, *ptr2; |
231 | 231 |
unsigned long val; |
232 | 232 |
unsigned int distri, chan; |
233 |
- flp_distri_t *p_distri; |
|
233 |
+ etp_distri_t *p_distri; |
|
234 | 234 |
double base, factor, gamma; |
235 | 235 |
|
236 | 236 |
/* get distributor number */ |
... | ... |
@@ -239,16 +239,16 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
239 | 239 |
|| (*ptr != 0 && *ptr != ' ' && *ptr != '\t' |
240 | 240 |
&& *ptr != '\r' && *ptr != '\n')) { |
241 | 241 |
if (p_ctx->p_msg_func) |
242 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
242 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
243 | 243 |
"invalid mapping specifier \"%s\"" |
244 | 244 |
" in line %u of config file\n", |
245 | 245 |
p_setting_part2, p_ctx->line_no); |
246 | 246 |
return -1; |
247 | 247 |
} |
248 | 248 |
distri = (unsigned int)val; |
249 |
- if (distri >= FLP_DISTRI_MAX_CNT) { |
|
249 |
+ if (distri >= ETP_DISTRI_MAX_CNT) { |
|
250 | 250 |
if (p_ctx->p_msg_func) |
251 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
251 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
252 | 252 |
"invalid distributor number \"%u\"" |
253 | 253 |
" in line %u of config file\n", |
254 | 254 |
distri, p_ctx->line_no); |
... | ... |
@@ -266,7 +266,7 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
266 | 266 |
chan = 2; |
267 | 267 |
else { |
268 | 268 |
if (p_ctx->p_msg_func) |
269 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
269 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
270 | 270 |
"invalid channel \"%s\"" |
271 | 271 |
" in line %u of config file\n", ptr, |
272 | 272 |
p_ctx->line_no); |
... | ... |
@@ -277,7 +277,7 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
277 | 277 |
p_distri = p_ctx->p_display->distri_ptrs[distri]; |
278 | 278 |
if (!p_distri) { |
279 | 279 |
if (p_ctx->p_msg_func) |
280 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
280 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
281 | 281 |
"no distributor with number \"%u\"" |
282 | 282 |
" in line %u of config file\n", |
283 | 283 |
distri, p_ctx->line_no); |
... | ... |
@@ -285,34 +285,34 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
285 | 285 |
} |
286 | 286 |
|
287 | 287 |
/* get mapping parameters: base, factor, gamma */ |
288 |
- base = flp_strtod_noloc(p_value, &ptr); |
|
288 |
+ base = etp_strtod_noloc(p_value, &ptr); |
|
289 | 289 |
if (ptr == p_value |
290 | 290 |
|| (*ptr != 0 && *ptr != ' ' && *ptr != '\t' |
291 | 291 |
&& *ptr != '\r' && *ptr != '\n')) { |
292 | 292 |
if (p_ctx->p_msg_func) |
293 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
293 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
294 | 294 |
"invalid mapping parameters \"%s\"" |
295 | 295 |
" in line %u of config file\n", |
296 | 296 |
p_value, p_ctx->line_no); |
297 | 297 |
return -1; |
298 | 298 |
} |
299 |
- factor = flp_strtod_noloc(ptr, &ptr2); |
|
299 |
+ factor = etp_strtod_noloc(ptr, &ptr2); |
|
300 | 300 |
if (ptr2 == ptr |
301 | 301 |
|| (*ptr2 != 0 && *ptr2 != ' ' && *ptr2 != '\t' |
302 | 302 |
&& *ptr2 != '\r' && *ptr2 != '\n')) { |
303 | 303 |
if (p_ctx->p_msg_func) |
304 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
304 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
305 | 305 |
"invalid mapping parameters \"%s\"" |
306 | 306 |
" in line %u of config file\n", |
307 | 307 |
p_value, p_ctx->line_no); |
308 | 308 |
return -1; |
309 | 309 |
} |
310 |
- gamma = flp_strtod_noloc(ptr2, &ptr); |
|
310 |
+ gamma = etp_strtod_noloc(ptr2, &ptr); |
|
311 | 311 |
if (ptr == ptr2 |
312 | 312 |
|| (*ptr != 0 && *ptr != ' ' && *ptr != '\t' |
313 | 313 |
&& *ptr != '\r' && *ptr != '\n')) { |
314 | 314 |
if (p_ctx->p_msg_func) |
315 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
315 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
316 | 316 |
"invalid mapping parameters \"%s\"" |
317 | 317 |
" in line %u of config file\n", |
318 | 318 |
p_value, p_ctx->line_no); |
... | ... |
@@ -320,7 +320,7 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
320 | 320 |
} |
321 | 321 |
if (gamma <= 0.0) { |
322 | 322 |
if (p_ctx->p_msg_func) |
323 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
323 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
324 | 324 |
"invalid gamma value \"%f\"" |
325 | 325 |
" in line %u of config file\n", |
326 | 326 |
gamma, p_ctx->line_no); |
... | ... |
@@ -331,7 +331,7 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
331 | 331 |
p_distri->mapping[chan].base = base; |
332 | 332 |
p_distri->mapping[chan].factor = factor; |
333 | 333 |
p_distri->mapping[chan].gamma = gamma; |
334 |
- flp_mapping_precalc(&p_distri->mapping[chan]); |
|
334 |
+ etp_mapping_precalc(&p_distri->mapping[chan]); |
|
335 | 335 |
|
336 | 336 |
return 0; |
337 | 337 |
} |
... | ... |
@@ -346,20 +346,20 @@ int flp_config_proc_mapping(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
346 | 346 |
* \param[in] pix number of pixel |
347 | 347 |
* \return 0 in case of success, -1 in case of error |
348 | 348 |
*/ |
349 |
-int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
|
349 |
+int etp_config_proc_pixel(etp_config_ctx_t *p_ctx, char *sz_pixel, |
|
350 | 350 |
unsigned int distri, unsigned int out, |
351 | 351 |
unsigned int pix) |
352 | 352 |
{ |
353 |
- flp_distri_t *p_distri = p_ctx->p_display->distri_ptrs[distri]; |
|
353 |
+ etp_distri_t *p_distri = p_ctx->p_display->distri_ptrs[distri]; |
|
354 | 354 |
char *ptr; |
355 | 355 |
unsigned int x, y, idx; |
356 | 356 |
|
357 | 357 |
/* get coordinates of pixel */ |
358 |
- if (flp_parse_two_nos(sz_pixel, &x, &y, &ptr) || *ptr != 0 |
|
358 |
+ if (etp_parse_two_nos(sz_pixel, &x, &y, &ptr) || *ptr != 0 |
|
359 | 359 |
|| (int)x < 0 || (int)x >= p_ctx->p_display->size.x |
360 | 360 |
|| (int)y < 0 || (int)y >= p_ctx->p_display->size.y) { |
361 | 361 |
if (p_ctx->p_msg_func) |
362 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
362 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
363 | 363 |
"invalid pixel \"%s\"" |
364 | 364 |
" in line %u of config file\n", |
365 | 365 |
sz_pixel, p_ctx->line_no); |
... | ... |
@@ -367,9 +367,9 @@ int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
367 | 367 |
} |
368 | 368 |
|
369 | 369 |
/* check pixel number */ |
370 |
- if (pix >= FLP_PIXEL_MAX_CNT || pix >= p_distri->pixel_cnt) { |
|
370 |
+ if (pix >= ETP_PIXEL_MAX_CNT || pix >= p_distri->pixel_cnt) { |
|
371 | 371 |
if (p_ctx->p_msg_func) |
372 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
372 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
373 | 373 |
"too many pixels (more than %u)" |
374 | 374 |
" in line %u of config file\n", |
375 | 375 |
p_distri->pixel_cnt, p_ctx->line_no); |
... | ... |
@@ -381,7 +381,7 @@ int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
381 | 381 |
if (p_distri->p_pixels[idx].x >= 0 |
382 | 382 |
&& p_distri->p_pixels[idx].y >= 0) { |
383 | 383 |
if (p_ctx->p_msg_func) |
384 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
384 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
385 | 385 |
"pixel %u of output %u of distributor %u already set" |
386 | 386 |
" to pixel %u,%u in line %u of config file\n", |
387 | 387 |
pix, out, distri, p_distri->p_pixels[idx].x, |
... | ... |
@@ -407,34 +407,34 @@ int flp_config_proc_pixel(flp_config_ctx_t *p_ctx, char *sz_pixel, |
407 | 407 |
* \param[in] p_value value of setting |
408 | 408 |
* \return 0 in case of success, -1 in case of error |
409 | 409 |
*/ |
410 |
-int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
410 |
+int etp_config_proc_output(etp_config_ctx_t *p_ctx, char *p_setting_part2, |
|
411 | 411 |
char *p_value) |
412 | 412 |
{ |
413 | 413 |
char *ptr, *p_pos, *p_white, white; |
414 | 414 |
unsigned int distri, out, pix; |
415 |
- flp_distri_t *p_distri; |
|
415 |
+ etp_distri_t *p_distri; |
|
416 | 416 |
int err; |
417 | 417 |
|
418 | 418 |
/* get number of distributor and output */ |
419 |
- if (flp_parse_two_nos(p_setting_part2, &distri, &out, &ptr) || *ptr != 0) { |
|
419 |
+ if (etp_parse_two_nos(p_setting_part2, &distri, &out, &ptr) || *ptr != 0) { |
|
420 | 420 |
if (p_ctx->p_msg_func) |
421 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
421 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
422 | 422 |
"invalid output specifier \"%s\"" |
423 | 423 |
" in line %u of config file\n", |
424 | 424 |
p_setting_part2, p_ctx->line_no); |
425 | 425 |
return -1; |
426 | 426 |
} |
427 |
- if (distri >= FLP_DISTRI_MAX_CNT) { |
|
427 |
+ if (distri >= ETP_DISTRI_MAX_CNT) { |
|
428 | 428 |
if (p_ctx->p_msg_func) |
429 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
429 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
430 | 430 |
"invalid distributor number \"%u\"" |
431 | 431 |
" in line %u of config file\n", |
432 | 432 |
distri, p_ctx->line_no); |
433 | 433 |
return -1; |
434 | 434 |
} |
435 |
- if (out >= FLP_OUTPUT_MAX_CNT) { |
|
435 |
+ if (out >= ETP_OUTPUT_MAX_CNT) { |
|
436 | 436 |
if (p_ctx->p_msg_func) |
437 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
437 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
438 | 438 |
"invalid output number \"%u\"" |
439 | 439 |
" in line %u of config file\n", |
440 | 440 |
out, p_ctx->line_no); |
... | ... |
@@ -445,7 +445,7 @@ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
445 | 445 |
p_distri = p_ctx->p_display->distri_ptrs[distri]; |
446 | 446 |
if (!p_distri) { |
447 | 447 |
if (p_ctx->p_msg_func) |
448 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
448 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
449 | 449 |
"no distributor with number \"%u\"" |
450 | 450 |
" in line %u of config file\n", |
451 | 451 |
distri, p_ctx->line_no); |
... | ... |
@@ -454,7 +454,7 @@ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
454 | 454 |
/* check output number */ |
455 | 455 |
if (out >= p_distri->output_cnt) { |
456 | 456 |
if (p_ctx->p_msg_func) |
457 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
457 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
458 | 458 |
"no output with output number \"%u\"" |
459 | 459 |
" in line %u of config file\n", |
460 | 460 |
out, p_ctx->line_no); |
... | ... |
@@ -480,7 +480,7 @@ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
480 | 480 |
/* process item: a pixel */ |
481 | 481 |
white = *p_white; /* terminate item */ |
482 | 482 |
*p_white = 0; |
483 |
- if (flp_config_proc_pixel(p_ctx, p_pos, distri, out, pix)) /* process */ |
|
483 |
+ if (etp_config_proc_pixel(p_ctx, p_pos, distri, out, pix)) /* process */ |
|
484 | 484 |
err = -1; /* remember errors */ |
485 | 485 |
pix++; /* count pixels */ |
486 | 486 |
*p_white = white; /* undo termination */ |
... | ... |
@@ -504,7 +504,7 @@ int flp_config_proc_output(flp_config_ctx_t *p_ctx, char *p_setting_part2, |
504 | 504 |
* \param[in] p_value value of setting |
505 | 505 |
* \return 0 in case of success, -1 in case of error |
506 | 506 |
*/ |
507 |
-int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
|
507 |
+int etp_config_proc_setting(etp_config_ctx_t *p_ctx, char *p_setting, |
|
508 | 508 |
char *p_value) |
509 | 509 |
{ |
510 | 510 |
char *ptr; |
... | ... |
@@ -520,25 +520,25 @@ int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
520 | 520 |
|
521 | 521 |
/* bind address for UDP output */ |
522 | 522 |
if (!strcmp(p_setting, "bindAddr")) { |
523 |
- if (flp_parse_addr(p_value, &p_ctx->p_display->bind_addr)) { |
|
523 |
+ if (etp_parse_addr(p_value, &p_ctx->p_display->bind_addr)) { |
|
524 | 524 |
if (p_ctx->p_msg_func) |
525 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
525 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
526 | 526 |
"invalid address \"%s\" for \"%s\"" |
527 | 527 |
" in line %u of config file\n", |
528 | 528 |
p_value, p_setting, p_ctx->line_no); |
529 | 529 |
return -1; |
530 | 530 |
} |
531 | 531 |
if (p_ctx->p_msg_func) |
532 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_info, "bind address: %s\n", p_value); |
|
532 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_info, "bind address: %s\n", p_value); |
|
533 | 533 |
return 0; |
534 | 534 |
} |
535 | 535 |
|
536 | 536 |
/* size of display */ |
537 | 537 |
if (!strcmp(p_setting, "size")) { |
538 |
- if (flp_parse_two_nos(p_value, &x, &y, &ptr) |
|
538 |
+ if (etp_parse_two_nos(p_value, &x, &y, &ptr) |
|
539 | 539 |
|| (int)x <= 0 || (int)y <= 0) { |
540 | 540 |
if (p_ctx->p_msg_func) |
541 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_err, |
|
541 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_err, |
|
542 | 542 |
"invalid value \"%s\" for \"%s\"" |
543 | 543 |
" in line %u of config file\n", |
544 | 544 |
p_value, p_setting, p_ctx->line_no); |
... | ... |
@@ -551,23 +551,23 @@ int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
551 | 551 |
|
552 | 552 |
/* distributor */ |
553 | 553 |
if (!strncmp(p_setting, "distributor ", 12)) |
554 |
- return flp_config_proc_distri(p_ctx, p_setting + 12, p_value); |
|
554 |
+ return etp_config_proc_distri(p_ctx, p_setting + 12, p_value); |
|
555 | 555 |
|
556 | 556 |
/* distributor address */ |
557 | 557 |
if (!strncmp(p_setting, "distributorAddr ", 16)) |
558 |
- return flp_config_proc_distri_addr(p_ctx, p_setting + 16, p_value); |
|
558 |
+ return etp_config_proc_distri_addr(p_ctx, p_setting + 16, p_value); |
|
559 | 559 |
|
560 | 560 |
/* mapping */ |
561 | 561 |
if (!strncmp(p_setting, "mapping ", 8)) |
562 |
- return flp_config_proc_mapping(p_ctx, p_setting + 8, p_value); |
|
562 |
+ return etp_config_proc_mapping(p_ctx, p_setting + 8, p_value); |
|
563 | 563 |
|
564 | 564 |
/* output */ |
565 | 565 |
if (!strncmp(p_setting, "output ", 7)) |
566 |
- return flp_config_proc_output(p_ctx, p_setting + 7, p_value); |
|
566 |
+ return etp_config_proc_output(p_ctx, p_setting + 7, p_value); |
|
567 | 567 |
|
568 | 568 |
/* unknown setting */ |
569 | 569 |
if (p_ctx->p_msg_func) |
570 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_warn, |
|
570 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_warn, |
|
571 | 571 |
"unknown setting \"%s\"" |
572 | 572 |
" in line %u of config file, ignored\n", |
573 | 573 |
p_setting, p_ctx->line_no); |
... | ... |
@@ -581,7 +581,7 @@ int flp_config_proc_setting(flp_config_ctx_t *p_ctx, char *p_setting, |
581 | 581 |
* \param[in] p_line line to process |
582 | 582 |
* \return 0 in case of success, -1 in case of error |
583 | 583 |
*/ |
584 |
-int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line) |
|
584 |
+int etp_config_proc_line(etp_config_ctx_t *p_ctx, char *p_line) |
|
585 | 585 |
{ |
586 | 586 |
char *p_hash, *p_equal, *p_setting, *p_value; |
587 | 587 |
int i; |
... | ... |
@@ -609,7 +609,7 @@ int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line) |
609 | 609 |
p_equal = strchr(p_line, '='); |
610 | 610 |
if (!p_equal) { /* no equal sign found */ |
611 | 611 |
if (p_ctx->p_msg_func) |
612 |
- p_ctx->p_msg_func(p_ctx->p_msg_ctx, flp_msg_type_warn, |
|
612 |
+ p_ctx->p_msg_func(p_ctx->p_msg_ctx, etp_msg_type_warn, |
|
613 | 613 |
"invalid line %u in config file, ignored\n", |
614 | 614 |
p_ctx->line_no); |
615 | 615 |
return 0; |
... | ... |
@@ -631,7 +631,7 @@ int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line) |
631 | 631 |
|| *p_value == '\r' || *p_value == '\n'; p_value++); |
632 | 632 |
|
633 | 633 |
/* process setting */ |
634 |
- return flp_config_proc_setting(p_ctx, p_setting, p_value); |
|
634 |
+ return etp_config_proc_setting(p_ctx, p_setting, p_value); |
|
635 | 635 |
} |
636 | 636 |
|
637 | 637 |
/** |
... | ... |
@@ -643,11 +643,11 @@ int flp_config_proc_line(flp_config_ctx_t *p_ctx, char *p_line) |
643 | 643 |
* \param[in] p_msg_ctx user context for message callback |
644 | 644 |
* \return 0 in case of success, -1 in case of error |
645 | 645 |
*/ |
646 |
-int flp_config_proc_file(flp_display_t *p_display, |
|
646 |
+int etp_config_proc_file(etp_display_t *p_display, |
|
647 | 647 |
const char *sz_config_file, |
648 |
- flp_msg_func_p_t p_msg_func, void *p_msg_ctx) |
|
648 |
+ etp_msg_func_p_t p_msg_func, void *p_msg_ctx) |
|
649 | 649 |
{ |
650 |
- flp_config_ctx_t ctx; |
|
650 |
+ etp_config_ctx_t ctx; |
|
651 | 651 |
FILE *file; |
652 | 652 |
|
653 | 653 |
/* set up context */ |
... | ... |
@@ -658,13 +658,13 @@ int flp_config_proc_file(flp_display_t *p_display, |
658 | 658 |
/* check if file is present */ |
659 | 659 |
if (!sz_config_file || !sz_config_file[0]) { |
660 | 660 |
if (p_msg_func) |
661 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
661 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
662 | 662 |
"no config file specified\n"); |
663 | 663 |
return -1; |
664 | 664 |
} |
665 | 665 |
|
666 | 666 |
if (p_msg_func) |
667 |
- p_msg_func(p_msg_ctx, flp_msg_type_info, |
|
667 |
+ p_msg_func(p_msg_ctx, etp_msg_type_info, |
|
668 | 668 |
"using config file \"%s\"\n", |
669 | 669 |
sz_config_file); |
670 | 670 |
|
... | ... |
@@ -674,7 +674,7 @@ int flp_config_proc_file(flp_display_t *p_display, |
674 | 674 |
if (p_msg_func) { |
675 | 675 |
char errmsg[256]; |
676 | 676 |
strerror_r(errno, errmsg, sizeof(errmsg)); |
677 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
677 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
678 | 678 |
"cannot open config file \"%s\" for reading: %s\n", |
679 | 679 |
sz_config_file, errmsg); |
680 | 680 |
} |
... | ... |
@@ -697,7 +697,7 @@ int flp_config_proc_file(flp_display_t *p_display, |
697 | 697 |
if (!feof(file)) { /* not at end of file */ |
698 | 698 |
char dummy[4096]; |
699 | 699 |
if (p_msg_func) |
700 |
- p_msg_func(p_msg_ctx, flp_msg_type_warn, |
|
700 |
+ p_msg_func(p_msg_ctx, etp_msg_type_warn, |
|
701 | 701 |
"line %u too long in config file, truncated\n", |
702 | 702 |
ctx.line_no); |
703 | 703 |
/* jump over in rest of line */ |
... | ... |
@@ -709,7 +709,7 @@ int flp_config_proc_file(flp_display_t *p_display, |
709 | 709 |
} |
710 | 710 |
|
711 | 711 |
/* process line from file */ |
712 |
- if (flp_config_proc_line(&ctx, line)) |
|
712 |
+ if (etp_config_proc_line(&ctx, line)) |
|
713 | 713 |
return -1; |
714 | 714 |
|
715 | 715 |
ctx.line_no++; |
... | ... |
@@ -719,7 +719,7 @@ int flp_config_proc_file(flp_display_t *p_display, |
719 | 719 |
fclose(file); |
720 | 720 |
|
721 | 721 |
if (p_msg_func) |
722 |
- p_msg_func(p_msg_ctx, flp_msg_type_info, |
|
722 |
+ p_msg_func(p_msg_ctx, etp_msg_type_info, |
|
723 | 723 |
"%ux%u input format, %u distributors, %u outputs, %lu pixels\n", |
724 | 724 |
p_display->size.x, p_display->size.y, |
725 | 725 |
p_display->distri_cnt, p_display->output_cnt, |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,12 +17,12 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#include <flexipix/types.h> |
|
20 |
+#include <etherpix/types.h> |
|
21 | 21 |
#include <intern/const_data.h> |
22 | 22 |
#include <intern/types.h> |
23 | 23 |
|
24 | 24 |
/** data of MCUF header */ |
25 |
-const flp_u8_t flp_mcuf_hdr[FLP_MCUF_HDR_LEN] = { |
|
25 |
+const etp_u8_t etp_mcuf_hdr[ETP_MCUF_HDR_LEN] = { |
|
26 | 26 |
0x23, 0x54, 0x26, 0x66, |
27 | 27 |
0x00, 0x00, 0x00, 0x00, |
28 | 28 |
0x00, 0x03, 0x00, 0xFF |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -21,44 +21,44 @@ |
21 | 21 |
#include <stdlib.h> |
22 | 22 |
#include <string.h> |
23 | 23 |
|
24 |
-#include <flexipix/display.h> |
|
25 |
-#include <flexipix/msg.h> |
|
26 |
-#include <flexipix/types.h> |
|
24 |
+#include <etherpix/display.h> |
|
25 |
+#include <etherpix/msg.h> |
|
26 |
+#include <etherpix/types.h> |
|
27 | 27 |
#include <intern/config.h> |
28 | 28 |
#include <intern/constants.h> |
29 | 29 |
#include <intern/net.h> |
30 | 30 |
#include <intern/types.h> |
31 | 31 |
|
32 | 32 |
/** |
33 |
- * \brief create a new FlexiPix display |
|
33 |
+ * \brief create a new EtherPix display |
|
34 | 34 |
* |
35 | 35 |
* \param[in] sz_config_file name of config file to read |
36 | 36 |
* \param[in] p_msg_func message callback function or NULL |
37 | 37 |
* \param[in] p_msg_ctx user context for message callback |
38 |
- * \return pointer to new FlexiPix display on success |
|
38 |
+ * \return pointer to new EtherPix display on success |
|
39 | 39 |
* or NULL on error |
40 | 40 |
*/ |
41 |
-flp_display_t *flp_display_create(const char *sz_config_file, |
|
42 |
- flp_msg_func_p_t p_msg_func, |
|
41 |
+etp_display_t *etp_display_create(const char *sz_config_file, |
|
42 |
+ etp_msg_func_p_t p_msg_func, |
|
43 | 43 |
void *p_msg_ctx) |
44 | 44 |
{ |
45 |
- flp_display_t *p_display; |
|
45 |
+ etp_display_t *p_display; |
|
46 | 46 |
|
47 | 47 |
/* basic display setup */ |
48 | 48 |
|
49 | 49 |
/* create display structure */ |
50 |
- p_display = (flp_display_t *)calloc(1, sizeof (flp_display_t)); |
|
50 |
+ p_display = (etp_display_t *)calloc(1, sizeof (etp_display_t)); |
|
51 | 51 |
if (!p_display) { |
52 | 52 |
if (p_msg_func) |
53 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
53 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
54 | 54 |
"out of memory\n"); |
55 | 55 |
return NULL; |
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
/* set default bind address */ |
59 | 59 |
p_display->bind_addr.sin_family = AF_INET; |
60 |
- p_display->bind_addr.sin_port = htons(FLP_BIND_PORT); |
|
61 |
- p_display->bind_addr.sin_addr.s_addr = htonl(FLP_BIND_IP); |
|
60 |
+ p_display->bind_addr.sin_port = htons(ETP_BIND_PORT); |
|
61 |
+ p_display->bind_addr.sin_addr.s_addr = htonl(ETP_BIND_IP); |
|
62 | 62 |
|
63 | 63 |
/* no socket yet */ |
64 | 64 |
p_display->sock = -1; |
... | ... |
@@ -66,12 +66,12 @@ flp_display_t *flp_display_create(const char *sz_config_file, |
66 | 66 |
/* config file */ |
67 | 67 |
|
68 | 68 |
/* read config file */ |
69 |
- if(flp_config_proc_file(p_display, sz_config_file, |
|
69 |
+ if(etp_config_proc_file(p_display, sz_config_file, |
|
70 | 70 |
p_msg_func, p_msg_ctx)) { |
71 |
- flp_display_free(p_display); /* cleanup everything that config file |
|
71 |
+ etp_display_free(p_display); /* cleanup everything that config file |
|
72 | 72 |
processing might heave created already */ |
73 | 73 |
if (p_msg_func) |
74 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, "reading config file failed\n"); |
|
74 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, "reading config file failed\n"); |
|
75 | 75 |
return NULL; |
76 | 76 |
} |
77 | 77 |
|
... | ... |
@@ -79,12 +79,12 @@ flp_display_t *flp_display_create(const char *sz_config_file, |
79 | 79 |
|
80 | 80 |
/* create socket */ |
81 | 81 |
p_display->sock = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP); |
82 |
- if (!flp_sock_is_valid(p_display->sock)) { |
|
83 |
- flp_display_free(p_display); |
|
82 |
+ if (!etp_sock_is_valid(p_display->sock)) { |
|
83 |
+ etp_display_free(p_display); |
|
84 | 84 |
if (p_msg_func) { |
85 | 85 |
char errmsg[256]; |
86 |
- flp_sock_get_last_error(errmsg, sizeof(errmsg)); |
|
87 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
86 |
+ etp_sock_get_last_error(errmsg, sizeof(errmsg)); |
|
87 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
88 | 88 |
"could not create UDP socket: %s\n", errmsg); |
89 | 89 |
} |
90 | 90 |
return NULL; |
... | ... |
@@ -93,11 +93,11 @@ flp_display_t *flp_display_create(const char *sz_config_file, |
93 | 93 |
/* bind socket */ |
94 | 94 |
if (bind(p_display->sock, (struct sockaddr *)&p_display->bind_addr, |
95 | 95 |
sizeof (p_display->bind_addr))) { |
96 |
- flp_display_free(p_display); |
|
96 |
+ etp_display_free(p_display); |
|
97 | 97 |
if (p_msg_func) { |
98 | 98 |
char errmsg[256]; |
99 |
- flp_sock_get_last_error(errmsg, sizeof(errmsg)); |
|
100 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
99 |
+ etp_sock_get_last_error(errmsg, sizeof(errmsg)); |
|
100 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
101 | 101 |
"could not bind UDP socket to \"%s:%u\": %s\n", |
102 | 102 |
inet_ntoa(p_display->bind_addr.sin_addr), |
103 | 103 |
(unsigned int)ntohs(p_display->bind_addr.sin_port), errmsg); |
... | ... |
@@ -107,26 +107,26 @@ flp_display_t *flp_display_create(const char *sz_config_file, |
107 | 107 |
|
108 | 108 |
/* clear display */ |
109 | 109 |
|
110 |
- flp_display_data_clear(p_display); |
|
110 |
+ etp_display_data_clear(p_display); |
|
111 | 111 |
|
112 | 112 |
return p_display; |
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
/** |
116 |
- * \brief free a FlexiPix display |
|
116 |
+ * \brief free a EtherPix display |
|
117 | 117 |
* |
118 |
- * \param[in] p_display pointer to FlexiPix display |
|
118 |
+ * \param[in] p_display pointer to EtherPix display |
|
119 | 119 |
*/ |
120 |
-void flp_display_free(flp_display_t *p_display) |
|
120 |
+void etp_display_free(etp_display_t *p_display) |
|
121 | 121 |
{ |
122 | 122 |
int i; |
123 | 123 |
|
124 | 124 |
if (p_display) { |
125 | 125 |
|
126 | 126 |
/* free distributors */ |
127 |
- for (i = 0; i < FLP_DISTRI_MAX_CNT; i++) { |
|
127 |
+ for (i = 0; i < ETP_DISTRI_MAX_CNT; i++) { |
|
128 | 128 |
if (p_display->distri_ptrs[i]) { |
129 |
- flp_distri_t *p_distri = p_display->distri_ptrs[i]; |
|
129 |
+ etp_distri_t *p_distri = p_display->distri_ptrs[i]; |
|
130 | 130 |
free(p_distri->p_pixels); |
131 | 131 |
free(p_distri->p_msg_buf); |
132 | 132 |
free(p_distri); |
... | ... |
@@ -134,7 +134,7 @@ void flp_display_free(flp_display_t *p_display) |
134 | 134 |
} |
135 | 135 |
|
136 | 136 |
/* close network connection */ |
137 |
- if (flp_sock_is_valid(p_display->sock)) |
|
137 |
+ if (etp_sock_is_valid(p_display->sock)) |
|
138 | 138 |
closesocket(p_display->sock); |
139 | 139 |
|
140 | 140 |
/* free display structutre */ |
... | ... |
@@ -146,11 +146,11 @@ void flp_display_free(flp_display_t *p_display) |
146 | 146 |
/** |
147 | 147 |
* \brief get size of display |
148 | 148 |
* |
149 |
- * \param[in] p_display pointer to FlexiPix display |
|
149 |
+ * \param[in] p_display pointer to EtherPix display |
|
150 | 150 |
* \param[out] p_width width of display |
151 | 151 |
* \param[out] p_height height of display |
152 | 152 |
*/ |
153 |
-void flp_display_get_size(flp_display_t *p_display, |
|
153 |
+void etp_display_get_size(etp_display_t *p_display, |
|
154 | 154 |
unsigned int *p_width, unsigned int *p_height) |
155 | 155 |
{ |
156 | 156 |
*p_width = (unsigned int)p_display->size.x; |
... | ... |
@@ -158,30 +158,30 @@ void flp_display_get_size(flp_display_t *p_display, |
158 | 158 |
} |
159 | 159 |
|
160 | 160 |
/** |
161 |
- * \brief clear image data to output on FlexiPix display |
|
161 |
+ * \brief clear image data to output on EtherPix display |
|
162 | 162 |
* |
163 | 163 |
* clears the stored image data, |
164 | 164 |
* stored image data can later be sent to the distributors using |
165 |
- * flp_display_send() |
|
165 |
+ * etp_display_send() |
|
166 | 166 |
* |
167 |
- * \param[in] p_display pointer to FlexiPix display |
|
167 |
+ * \param[in] p_display pointer to EtherPix display |
|
168 | 168 |
*/ |
169 |
-void flp_display_data_clear(flp_display_t *p_display) |
|
169 |
+void etp_display_data_clear(etp_display_t *p_display) |
|
170 | 170 |
{ |
171 |
- flp_u8_t black[3] = { 0, 0, 0 }; |
|
172 |
- flp_display_data_fmt(p_display, black, 0, 0, |
|
171 |
+ etp_u8_t black[3] = { 0, 0, 0 }; |
|
172 |
+ etp_display_data_fmt(p_display, black, 0, 0, |
|
173 | 173 |
0, 0, p_display->size.x, p_display->size.y, |
174 |
- flp_pixfmt_rgb24); |
|
174 |
+ etp_pixfmt_rgb24); |
|
175 | 175 |
} |
176 | 176 |
|
177 | 177 |
/** |
178 |
- * \brief set image data to output on FlexiPix display |
|
178 |
+ * \brief set image data to output on EtherPix display |
|
179 | 179 |
* |
180 | 180 |
* updates (part of) the stored image data, |
181 | 181 |
* stored image data can later be sent to the distributors using |
182 |
- * flp_display_send() |
|
182 |
+ * etp_display_send() |
|
183 | 183 |
* |
184 |
- * \param[in] p_display pointer to FlexiPix display |
|
184 |
+ * \param[in] p_display pointer to EtherPix display |
|
185 | 185 |
* \param[in] p_data pointer to rectangular section of image data |
186 | 186 |
* \param[in] stride_x stride between two pixels in X direction |
187 | 187 |
* \param[in] stride_y stride between two pixels in Y direction |
... | ... |
@@ -191,26 +191,26 @@ void flp_display_data_clear(flp_display_t *p_display) |
191 | 191 |
* \param[in] height height of rectangular area |
192 | 192 |
* \param[in] pixfmt format of pixel data |
193 | 193 |
*/ |
194 |
-void flp_display_data_fmt(flp_display_t *p_display, flp_u8_t *p_data, |
|
194 |
+void etp_display_data_fmt(etp_display_t *p_display, etp_u8_t *p_data, |
|
195 | 195 |
int stride_x, int stride_y, |
196 | 196 |
unsigned int x, unsigned int y, |
197 | 197 |
unsigned int width, unsigned int height, |
198 |
- flp_pixfmt_t pixfmt) |
|
198 |
+ etp_pixfmt_t pixfmt) |
|
199 | 199 |
{ |
200 | 200 |
unsigned int distri, out, pix, i; |
201 |
- flp_distri_t *p_distri; |
|
202 |
- flp_u8_t *dest, *src; |
|
203 |
- flp_pixel_t *p_pixel; |
|
201 |
+ etp_distri_t *p_distri; |
|
202 |
+ etp_u8_t *dest, *src; |
|
203 |
+ etp_pixel_t *p_pixel; |
|
204 | 204 |
int rx, ry; |
205 | 205 |
|
206 | 206 |
/* set data for all distributors */ |
207 |
- for (distri = 0; distri < FLP_DISTRI_MAX_CNT; distri++) { |
|
207 |
+ for (distri = 0; distri < ETP_DISTRI_MAX_CNT; distri++) { |
|
208 | 208 |
p_distri = p_display->distri_ptrs[distri]; |
209 | 209 |
if (p_distri) { |
210 | 210 |
|
211 | 211 |
/* set pointer to start of RGB data for pixels in message buffer |
212 | 212 |
(header is already set up and stays the same) */ |
213 |
- dest = p_distri->p_msg_buf + FLP_MCUF_HDR_LEN; |
|
213 |
+ dest = p_distri->p_msg_buf + ETP_MCUF_HDR_LEN; |
|
214 | 214 |
|
215 | 215 |
/* get RGB data of pixels for every output */ |
216 | 216 |
for (out = 0, i = 0; out < p_distri->output_cnt; out++) { |
... | ... |
@@ -226,12 +226,12 @@ void flp_display_data_fmt(flp_display_t *p_display, flp_u8_t *p_data, |
226 | 226 |
/* get pixel data and map it */ |
227 | 227 |
src = (p_data + rx * stride_x + ry * stride_y); |
228 | 228 |
switch (pixfmt) { |
229 |
- case flp_pixfmt_rgb24: |
|
229 |
+ case etp_pixfmt_rgb24: |
|
230 | 230 |
dest[0] = p_distri->mapping[0].table[src[0]]; |
231 | 231 |
dest[1] = p_distri->mapping[1].table[src[1]]; |
232 | 232 |
dest[2] = p_distri->mapping[2].table[src[2]]; |
233 | 233 |
break; |
234 |
- case flp_pixfmt_bgr24: |
|
234 |
+ case etp_pixfmt_bgr24: |
|
235 | 235 |
dest[0] = p_distri->mapping[0].table[src[2]]; |
236 | 236 |
dest[1] = p_distri->mapping[1].table[src[1]]; |
237 | 237 |
dest[2] = p_distri->mapping[2].table[src[0]]; |
... | ... |
@@ -252,18 +252,18 @@ void flp_display_data_fmt(flp_display_t *p_display, flp_u8_t *p_data, |
252 | 252 |
} |
253 | 253 |
|
254 | 254 |
/** |
255 |
- * \brief set image data to output on FlexiPix display |
|
255 |
+ * \brief set image data to output on EtherPix display |
|
256 | 256 |
* |
257 |
- * see flp_display_data_fmt for documentation |
|
258 |
- * pixfmt is fixed to flp_pixfmt_rgb24 |
|
257 |
+ * see etp_display_data_fmt for documentation |
|
258 |
+ * pixfmt is fixed to etp_pixfmt_rgb24 |
|
259 | 259 |
*/ |
260 |
-void flp_display_data(flp_display_t *p_display, flp_u8_t *p_data, |
|
260 |
+void etp_display_data(etp_display_t *p_display, etp_u8_t *p_data, |
|
261 | 261 |
int stride_x, int stride_y, |
262 | 262 |
unsigned int x, unsigned int y, |
263 | 263 |
unsigned int width, unsigned int height) |
264 | 264 |
{ |
265 |
- flp_display_data_fmt(p_display, p_data, stride_x, stride_y, |
|
266 |
- x, y, width, height, flp_pixfmt_rgb24); |
|
265 |
+ etp_display_data_fmt(p_display, p_data, stride_x, stride_y, |
|
266 |
+ x, y, width, height, etp_pixfmt_rgb24); |
|
267 | 267 |
} |
268 | 268 |
|
269 | 269 |
/** |
... | ... |
@@ -271,15 +271,15 @@ void flp_display_data(flp_display_t *p_display, flp_u8_t *p_data, |
271 | 271 |
* |
272 | 272 |
* sends the currently stored image data to all configured distributors |
273 | 273 |
* |
274 |
- * \param[in] p_display pointer to FlexiPix display |
|
274 |
+ * \param[in] p_display pointer to EtherPix display |
|
275 | 275 |
*/ |
276 |
-void flp_display_send(flp_display_t *p_display) |
|
276 |
+void etp_display_send(etp_display_t *p_display) |
|
277 | 277 |
{ |
278 | 278 |
unsigned int distri; |
279 |
- flp_distri_t *p_distri; |
|
279 |
+ etp_distri_t *p_distri; |
|
280 | 280 |
|
281 | 281 |
/* send data to all distributors */ |
282 |
- for (distri = 0; distri < FLP_DISTRI_MAX_CNT; distri++) { |
|
282 |
+ for (distri = 0; distri < ETP_DISTRI_MAX_CNT; distri++) { |
|
283 | 283 |
p_distri = p_display->distri_ptrs[distri]; |
284 | 284 |
if (p_distri) { |
285 | 285 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -20,43 +20,43 @@ |
20 | 20 |
#include <sys/time.h> |
21 | 21 |
#include <stdlib.h> |
22 | 22 |
|
23 |
-#include <flexipix/display.h> |
|
24 |
-#include <flexipix/displayer.h> |
|
25 |
-#include <flexipix/msg.h> |
|
26 |
-#include <flexipix/types.h> |
|
23 |
+#include <etherpix/display.h> |
|
24 |
+#include <etherpix/displayer.h> |
|
25 |
+#include <etherpix/msg.h> |
|
26 |
+#include <etherpix/types.h> |
|
27 | 27 |
#include <intern/displayer.h> |
28 | 28 |
#include <intern/thread.h> |
29 | 29 |
#include <intern/types.h> |
30 | 30 |
|
31 | 31 |
/** |
32 |
- * \brief create a new FlexiPix displayer |
|
32 |
+ * \brief create a new EtherPix displayer |
|
33 | 33 |
* |
34 | 34 |
* A displayer manages a display and ensures that a the current |
35 | 35 |
* image data is sent often enough to the distributors so |
36 | 36 |
* that the pixels do detect a timeout and turn off automatically. |
37 | 37 |
* The displayer uses a thread to do this. |
38 | 38 |
* Initially, the new displayer is inactive and has to be activated |
39 |
- * using flp_displayer_activate(). |
|
39 |
+ * using etp_displayer_activate(). |
|
40 | 40 |
* |
41 | 41 |
* \param[in] sz_config_file name of config file to read |
42 | 42 |
* \param[in] p_msg_func message callback function or NULL |
43 | 43 |
* \param[in] p_msg_ctx user context for message callback |
44 |
- * \return pointer to new FlexiPix displayer on success |
|
44 |
+ * \return pointer to new EtherPix displayer on success |
|
45 | 45 |
* or NULL on error |
46 | 46 |
*/ |
47 |
-flp_displayer_t *flp_displayer_create(const char *sz_config_file, |
|
48 |
- flp_msg_func_p_t p_msg_func, |
|
47 |
+etp_displayer_t *etp_displayer_create(const char *sz_config_file, |
|
48 |
+ etp_msg_func_p_t p_msg_func, |
|
49 | 49 |
void *p_msg_ctx) |
50 | 50 |
{ |
51 |
- flp_displayer_t *p_displayer; |
|
51 |
+ etp_displayer_t *p_displayer; |
|
52 | 52 |
|
53 | 53 |
/* set up basic structure and display */ |
54 | 54 |
|
55 | 55 |
/* create displayer structure */ |
56 |
- p_displayer = (flp_displayer_t *)calloc(1, sizeof (flp_displayer_t)); |
|
56 |
+ p_displayer = (etp_displayer_t *)calloc(1, sizeof (etp_displayer_t)); |
|
57 | 57 |
if (!p_displayer) { |
58 | 58 |
if (p_msg_func) |
59 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
59 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
60 | 60 |
"out of memory\n"); |
61 | 61 |
return NULL; |
62 | 62 |
} |
... | ... |
@@ -67,12 +67,12 @@ flp_displayer_t *flp_displayer_create(const char *sz_config_file, |
67 | 67 |
p_displayer->end = 0; /* do not end yet */ |
68 | 68 |
|
69 | 69 |
/* set up managed display */ |
70 |
- p_displayer->p_display = flp_display_create(sz_config_file, |
|
70 |
+ p_displayer->p_display = etp_display_create(sz_config_file, |
|
71 | 71 |
p_msg_func, p_msg_ctx); |
72 | 72 |
if (!p_displayer->p_display) { |
73 | 73 |
free(p_displayer); |
74 | 74 |
if (p_msg_func) |
75 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
75 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
76 | 76 |
"could not create display\n"); |
77 | 77 |
return NULL; |
78 | 78 |
} |
... | ... |
@@ -80,35 +80,35 @@ flp_displayer_t *flp_displayer_create(const char *sz_config_file, |
80 | 80 |
/* set up output thread */ |
81 | 81 |
|
82 | 82 |
/* initialize mutex */ |
83 |
- if (!flp_thread_mutex_init(&p_displayer->mtx)) { |
|
84 |
- flp_display_free(p_displayer->p_display); |
|
83 |
+ if (!etp_thread_mutex_init(&p_displayer->mtx)) { |
|
84 |
+ etp_display_free(p_displayer->p_display); |
|
85 | 85 |
free(p_displayer); |
86 | 86 |
if (p_msg_func) |
87 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
87 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
88 | 88 |
"could not initialize mutex\n"); |
89 | 89 |
return NULL; |
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
/* initialize condition */ |
93 |
- if (!flp_thread_cond_init(&p_displayer->cond)) { |
|
94 |
- flp_thread_mutex_destroy(&p_displayer->mtx); |
|
95 |
- flp_display_free(p_displayer->p_display); |
|
93 |
+ if (!etp_thread_cond_init(&p_displayer->cond)) { |
|
94 |
+ etp_thread_mutex_destroy(&p_displayer->mtx); |
|
95 |
+ etp_display_free(p_displayer->p_display); |
|
96 | 96 |
free(p_displayer); |
97 | 97 |
if (p_msg_func) |
98 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
98 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
99 | 99 |
"could not initialize condition\n"); |
100 | 100 |
return NULL; |
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
/* create thread */ |
104 |
- if (!flp_thread_create(&p_displayer->tid, flp_displayer_thread, |
|
104 |
+ if (!etp_thread_create(&p_displayer->tid, etp_displayer_thread, |
|
105 | 105 |
(void *)p_displayer)) { |
106 |
- flp_thread_cond_destroy(&p_displayer->cond); |
|
107 |
- flp_thread_mutex_destroy(&p_displayer->mtx); |
|
108 |
- flp_display_free(p_displayer->p_display); |
|
106 |
+ etp_thread_cond_destroy(&p_displayer->cond); |
|
107 |
+ etp_thread_mutex_destroy(&p_displayer->mtx); |
|
108 |
+ etp_display_free(p_displayer->p_display); |
|
109 | 109 |
free(p_displayer); |
110 | 110 |
if (p_msg_func) |
111 |
- p_msg_func(p_msg_ctx, flp_msg_type_err, |
|
111 |
+ p_msg_func(p_msg_ctx, etp_msg_type_err, |
|
112 | 112 |
"could not create thread\n"); |
113 | 113 |
return NULL; |
114 | 114 |
} |
... | ... |
@@ -117,21 +117,21 @@ flp_displayer_t *flp_displayer_create(const char *sz_config_file, |
117 | 117 |
} |
118 | 118 |
|
119 | 119 |
/** |
120 |
- * \brief free a FlexiPix displayer |
|
120 |
+ * \brief free a EtherPix displayer |
|
121 | 121 |
* |
122 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
122 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
123 | 123 |
*/ |
124 |
-void flp_displayer_free(flp_displayer_t *p_displayer) |
|
124 |
+void etp_displayer_free(etp_displayer_t *p_displayer) |
|
125 | 125 |
{ |
126 | 126 |
/* tear down thread */ |
127 | 127 |
p_displayer->end = 1; |
128 |
- flp_thread_cond_signal(&p_displayer->cond); |
|
129 |
- flp_thread_join(p_displayer->tid); |
|
130 |
- flp_thread_cond_destroy(&p_displayer->cond); |
|
131 |
- flp_thread_mutex_destroy(&p_displayer->mtx); |
|
128 |
+ etp_thread_cond_signal(&p_displayer->cond); |
|
129 |
+ etp_thread_join(p_displayer->tid); |
|
130 |
+ etp_thread_cond_destroy(&p_displayer->cond); |
|
131 |
+ etp_thread_mutex_destroy(&p_displayer->mtx); |
|
132 | 132 |
|
133 | 133 |
/* free managed display */ |
134 |
- flp_display_free(p_displayer->p_display); |
|
134 |
+ etp_display_free(p_displayer->p_display); |
|
135 | 135 |
|
136 | 136 |
/* free basic structure */ |
137 | 137 |
free(p_displayer); |
... | ... |
@@ -140,16 +140,16 @@ void flp_displayer_free(flp_displayer_t *p_displayer) |
140 | 140 |
/** |
141 | 141 |
* \brief get size of display managed by displayer |
142 | 142 |
* |
143 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
143 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
144 | 144 |
* \param[out] p_width width of display |
145 | 145 |
* \param[out] p_height height of display |
146 | 146 |
*/ |
147 |
-void flp_displayer_get_size(flp_displayer_t *p_displayer, |
|
147 |
+void etp_displayer_get_size(etp_displayer_t *p_displayer, |
|
148 | 148 |
unsigned int *p_width, unsigned int *p_height) |
149 | 149 |
{ |
150 |
- flp_thread_mutex_lock(&p_displayer->mtx); |
|
151 |
- flp_display_get_size(p_displayer->p_display, p_width, p_height); |
|
152 |
- flp_thread_mutex_unlock(&p_displayer->mtx); |
|
150 |
+ etp_thread_mutex_lock(&p_displayer->mtx); |
|
151 |
+ etp_display_get_size(p_displayer->p_display, p_width, p_height); |
|
152 |
+ etp_thread_mutex_unlock(&p_displayer->mtx); |
|
153 | 153 |
} |
154 | 154 |
|
155 | 155 |
/** |
... | ... |
@@ -160,12 +160,12 @@ void flp_displayer_get_size(flp_displayer_t *p_displayer, |
160 | 160 |
* this function might trigger sending of data if the last |
161 | 161 |
* sending time was too long ago |
162 | 162 |
* |
163 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
163 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
164 | 164 |
*/ |
165 |
-void flp_displayer_activate(flp_displayer_t *p_displayer) |
|
165 |
+void etp_displayer_activate(etp_displayer_t *p_displayer) |
|
166 | 166 |
{ |
167 | 167 |
p_displayer->active = 1; |
168 |
- flp_thread_cond_signal(&p_displayer->cond); |
|
168 |
+ etp_thread_cond_signal(&p_displayer->cond); |
|
169 | 169 |
} |
170 | 170 |
|
171 | 171 |
/** |
... | ... |
@@ -174,34 +174,34 @@ void flp_displayer_activate(flp_displayer_t *p_displayer) |
174 | 174 |
* set the displayer to deactive, i.e. prevent it from sening image |
175 | 175 |
* data to the distributors automatically, |
176 | 176 |
* |
177 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
177 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
178 | 178 |
*/ |
179 |
-void flp_displayer_deactivate(flp_displayer_t *p_displayer) |
|
179 |
+void etp_displayer_deactivate(etp_displayer_t *p_displayer) |
|
180 | 180 |
{ |
181 | 181 |
p_displayer->active = 0; |
182 | 182 |
/* no need to signal condition: thread does not need to do something yet */ |
183 | 183 |
} |
184 | 184 |
|
185 | 185 |
/** |
186 |
- * \brief clear image data to output on FlexiPix displayer |
|
186 |
+ * \brief clear image data to output on EtherPix displayer |
|
187 | 187 |
* |
188 | 188 |
* clears the stored image data |
189 | 189 |
* |
190 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
190 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
191 | 191 |
*/ |
192 |
-void flp_displayer_data_clear(flp_displayer_t *p_displayer) |
|
192 |
+void etp_displayer_data_clear(etp_displayer_t *p_displayer) |
|
193 | 193 |
{ |
194 |
- flp_thread_mutex_lock(&p_displayer->mtx); |
|
195 |
- flp_display_data_clear(p_displayer->p_display); |
|
196 |
- flp_thread_mutex_unlock(&p_displayer->mtx); |
|
194 |
+ etp_thread_mutex_lock(&p_displayer->mtx); |
|
195 |
+ etp_display_data_clear(p_displayer->p_display); |
|
196 |
+ etp_thread_mutex_unlock(&p_displayer->mtx); |
|
197 | 197 |
} |
198 | 198 |
|
199 | 199 |
/** |
200 |
- * \brief set image data to output on FlexiPix display |
|
200 |
+ * \brief set image data to output on EtherPix display |
|
201 | 201 |
* |
202 | 202 |
* updates (part of) the stored image data |
203 | 203 |
* |
204 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
204 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
205 | 205 |
* \param[in] p_data pointer to rectangular section of image data |
206 | 206 |
* \param[in] stride_x stride between two pixels in X direction |
207 | 207 |
* \param[in] stride_y stride between two pixels in Y direction |
... | ... |
@@ -211,31 +211,31 @@ void flp_displayer_data_clear(flp_displayer_t *p_displayer) |
211 | 211 |
* \param[in] height height of rectangular area |
212 | 212 |
* \param[in] pixfmt format of pixel data |
213 | 213 |
*/ |
214 |
-void flp_displayer_data_fmt(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
|
214 |
+void etp_displayer_data_fmt(etp_displayer_t *p_displayer, etp_u8_t *p_data, |
|
215 | 215 |
int stride_x, int stride_y, |
216 | 216 |
unsigned int x, unsigned int y, |
217 | 217 |
unsigned int width, unsigned int height, |
218 |
- flp_pixfmt_t pixfmt) |
|
218 |
+ etp_pixfmt_t pixfmt) |
|
219 | 219 |
{ |
220 |
- flp_thread_mutex_lock(&p_displayer->mtx); |
|
221 |
- flp_display_data_fmt(p_displayer->p_display, p_data, stride_x, stride_y, |
|
220 |
+ etp_thread_mutex_lock(&p_displayer->mtx); |
|
221 |
+ etp_display_data_fmt(p_displayer->p_display, p_data, stride_x, stride_y, |
|
222 | 222 |
x, y, width, height, pixfmt); |
223 |
- flp_thread_mutex_unlock(&p_displayer->mtx); |
|
223 |
+ etp_thread_mutex_unlock(&p_displayer->mtx); |
|
224 | 224 |
} |
225 | 225 |
|
226 | 226 |
/** |
227 |
- * \brief set image data to output on FlexiPix display |
|
227 |
+ * \brief set image data to output on EtherPix display |
|
228 | 228 |
* |
229 |
- * see flp_displayer_data_fmt for documentation |
|
230 |
- * pixfmt is fixed to flp_pixfmt_rgb24 |
|
229 |
+ * see etp_displayer_data_fmt for documentation |
|
230 |
+ * pixfmt is fixed to etp_pixfmt_rgb24 |
|
231 | 231 |
*/ |
232 |
-void flp_displayer_data(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
|
232 |
+void etp_displayer_data(etp_displayer_t *p_displayer, etp_u8_t *p_data, |
|
233 | 233 |
int stride_x, int stride_y, |
234 | 234 |
unsigned int x, unsigned int y, |
235 | 235 |
unsigned int width, unsigned int height) |
236 | 236 |
{ |
237 |
- flp_displayer_data_fmt(p_displayer, p_data, stride_x, stride_y, |
|
238 |
- x, y, width, height, flp_pixfmt_rgb24); |
|
237 |
+ etp_displayer_data_fmt(p_displayer, p_data, stride_x, stride_y, |
|
238 |
+ x, y, width, height, etp_pixfmt_rgb24); |
|
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
/** |
... | ... |
@@ -243,12 +243,12 @@ void flp_displayer_data(flp_displayer_t *p_displayer, flp_u8_t *p_data, |
243 | 243 |
* |
244 | 244 |
* this only works if the displayer is active |
245 | 245 |
* |
246 |
- * \param[in] p_displayer pointer to FlexiPix displayer |
|
246 |
+ * \param[in] p_displayer pointer to EtherPix displayer |
|
247 | 247 |
*/ |
248 |
-void flp_displayer_send(flp_displayer_t *p_displayer) |
|
248 |
+void etp_displayer_send(etp_displayer_t *p_displayer) |
|
249 | 249 |
{ |
250 | 250 |
p_displayer->send = 1; |
251 |
- flp_thread_cond_signal(&p_displayer->cond); |
|
251 |
+ etp_thread_cond_signal(&p_displayer->cond); |
|
252 | 252 |
} |
253 | 253 |
|
254 | 254 |
/** |
... | ... |
@@ -257,14 +257,14 @@ void flp_displayer_send(flp_displayer_t *p_displayer) |
257 | 257 |
* \param[in] vp_displayer pointer to displayer object |
258 | 258 |
* \return unused, always NULL |
259 | 259 |
*/ |
260 |
-FLP_THREAD_FUNC(flp_displayer_thread) |
|
260 |
+ETP_THREAD_FUNC(etp_displayer_thread) |
|
261 | 261 |
{ |
262 |
- flp_displayer_t *p_displayer = (flp_displayer_t *)vp_displayer; |
|
262 |
+ etp_displayer_t *p_displayer = (etp_displayer_t *)vp_displayer; |
|
263 | 263 |
struct timeval last, now, delta; |
264 | 264 |
int timed_send; |
265 |
- int interval_ms = FLP_MCUF_MAX_FRAME_INTERVAL_MS; |
|
265 |
+ int interval_ms = ETP_MCUF_MAX_FRAME_INTERVAL_MS; |
|
266 | 266 |
|
267 |
- flp_thread_mutex_lock(&p_displayer->mtx); |
|
267 |
+ etp_thread_mutex_lock(&p_displayer->mtx); |
|
268 | 268 |
|
269 | 269 |
gettimeofday(&last, NULL); /* initialize last to some valid time */ |
270 | 270 |
|
... | ... |
@@ -290,13 +290,13 @@ FLP_THREAD_FUNC(flp_displayer_thread) |
290 | 290 |
|
291 | 291 |
/* send if send requested or late enough */ |
292 | 292 |
if (p_displayer->send || timed_send) { |
293 |
- flp_display_send(p_displayer->p_display); /* send */ |
|
293 |
+ etp_display_send(p_displayer->p_display); /* send */ |
|
294 | 294 |
last = now; /* remember last send time */ |
295 | 295 |
p_displayer->send = 0; /* clear send request */ |
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
/* sleep until next frame has to be sent */ |
299 |
- flp_thread_cond_timedwait(&p_displayer->cond, &p_displayer->mtx, |
|
299 |
+ etp_thread_cond_timedwait(&p_displayer->cond, &p_displayer->mtx, |
|
300 | 300 |
&last, interval_ms); |
301 | 301 |
|
302 | 302 |
} /* if (p_displayer->active) */ |
... | ... |
@@ -305,14 +305,14 @@ FLP_THREAD_FUNC(flp_displayer_thread) |
305 | 305 |
else { |
306 | 306 |
|
307 | 307 |
/* sleep */ |
308 |
- flp_thread_cond_wait(&p_displayer->cond, &p_displayer->mtx); |
|
308 |
+ etp_thread_cond_wait(&p_displayer->cond, &p_displayer->mtx); |
|
309 | 309 |
|
310 | 310 |
} /* if (p_displayer->active) ... else */ |
311 | 311 |
|
312 | 312 |
} /* while(!p_displayer->end) */ |
313 | 313 |
|
314 |
- flp_thread_mutex_unlock(&p_displayer->mtx); |
|
314 |
+ etp_thread_mutex_unlock(&p_displayer->mtx); |
|
315 | 315 |
|
316 |
- FLP_THREAD_RETURN(NULL); |
|
316 |
+ ETP_THREAD_RETURN(NULL); |
|
317 | 317 |
} |
318 | 318 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -17,7 +17,7 @@ |
17 | 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
*/ |
19 | 19 |
|
20 |
-#include <flexipix/info.h> |
|
20 |
+#include <etherpix/info.h> |
|
21 | 21 |
|
22 | 22 |
/** |
23 | 23 |
* \brief get version of the library |
... | ... |
@@ -26,11 +26,11 @@ |
26 | 26 |
* \param[out] p_minor minor version |
27 | 27 |
* \param[out] p_revision revision number |
28 | 28 |
*/ |
29 |
-void flp_get_version(unsigned int *p_major, unsigned int *p_minor, |
|
29 |
+void etp_get_version(unsigned int *p_major, unsigned int *p_minor, |
|
30 | 30 |
unsigned int *p_revision) |
31 | 31 |
{ |
32 |
- *p_major = FLP_VER_MAJ; |
|
33 |
- *p_minor = FLP_VER_MIN; |
|
34 |
- *p_revision = FLP_VER_REV; |
|
32 |
+ *p_major = ETP_VER_MAJ; |
|
33 |
+ *p_minor = ETP_VER_MIN; |
|
34 |
+ *p_revision = ETP_VER_REV; |
|
35 | 35 |
} |
36 | 36 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -19,7 +19,7 @@ |
19 | 19 |
|
20 | 20 |
#include <math.h> |
21 | 21 |
|
22 |
-#include <flexipix/types.h> |
|
22 |
+#include <etherpix/types.h> |
|
23 | 23 |
#include <intern/mapping.h> |
24 | 24 |
#include <intern/types.h> |
25 | 25 |
|
... | ... |
@@ -30,7 +30,7 @@ |
30 | 30 |
* |
31 | 31 |
* \param[in,out] p_mapping mapping to precalculate |
32 | 32 |
*/ |
33 |
-void flp_mapping_precalc(flp_mapping_t *p_mapping) |
|
33 |
+void etp_mapping_precalc(etp_mapping_t *p_mapping) |
|
34 | 34 |
{ |
35 | 35 |
double gamma_1; |
36 | 36 |
int v; |
... | ... |
@@ -47,7 +47,7 @@ void flp_mapping_precalc(flp_mapping_t *p_mapping) |
47 | 47 |
else if (val > 1.0) |
48 | 48 |
p_mapping->table[v] = 255; |
49 | 49 |
else |
50 |
- p_mapping->table[v] = (flp_u8_t)(val * 255.0 + 0.5); |
|
50 |
+ p_mapping->table[v] = (etp_u8_t)(val * 255.0 + 0.5); |
|
51 | 51 |
} |
52 | 52 |
} |
53 | 53 |
|
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -32,7 +32,7 @@ |
32 | 32 |
* \param[out] end location in text where parsing ended |
33 | 33 |
* \return 0 in case of success, -1 in case of error |
34 | 34 |
*/ |
35 |
-int flp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
|
35 |
+int etp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
|
36 | 36 |
char **end) |
37 | 37 |
{ |
38 | 38 |
char *ptr1, *ptr2; |
... | ... |
@@ -67,7 +67,7 @@ int flp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2, |
67 | 67 |
* \param[out] addr address parsed from text |
68 | 68 |
* \return 0 in case of success, -1 in case of error |
69 | 69 |
*/ |
70 |
-int flp_parse_addr(char *text, struct sockaddr_in *addr) |
|
70 |
+int etp_parse_addr(char *text, struct sockaddr_in *addr) |
|
71 | 71 |
{ |
72 | 72 |
char *p_colon, *p_host, *p_port, *p_port_end; |
73 | 73 |
in_addr_t ip; |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * FlexiPix library |
|
2 |
+ * EtherPix library |
|
3 | 3 |
* |
4 | 4 |
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info> |
5 | 5 |
* |
... | ... |
@@ -31,7 +31,7 @@ |
31 | 31 |
* \param[out] endptr filled with pointer to |
32 | 32 |
* \return value read from the string |
33 | 33 |
*/ |
34 |
-double flp_strtod_noloc(const char *nptr, char **endptr) |
|
34 |
+double etp_strtod_noloc(const char *nptr, char **endptr) |
|
35 | 35 |
{ |
36 | 36 |
double sign = 1.0, value = 0.0, weight = 0.1; |
37 | 37 |
int exp_sign = 1, exp_value = 0; |
38 | 38 |