質問編集履歴
3
図の添付
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,6 +22,8 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
+
|
26
|
+
|
25
27
|
該当箇所と推測した箇所を抜粋しました。
|
26
28
|
|
27
29
|
```ここに言語を入力
|
2
図の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,12 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
やりたいことを具体的に言うと添付図の
|
20
|
+
|
21
|
+
ストリーミングボタンを一番上に配置させたいです。
|
22
|
+
|
23
|
+
|
24
|
+
|
19
25
|
該当箇所と推測した箇所を抜粋しました。
|
20
26
|
|
21
27
|
```ここに言語を入力
|
1
指摘があったので
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,3 +13,185 @@
|
|
13
13
|
|
14
14
|
|
15
15
|
ESP32-CAMのHTTPD関数のどこを修正すればブラウザの表示が変わりますか?
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
該当箇所と推測した箇所を抜粋しました。
|
20
|
+
|
21
|
+
```ここに言語を入力
|
22
|
+
|
23
|
+
static esp_err_t cmd_handler(httpd_req_t *req){
|
24
|
+
|
25
|
+
char* buf;
|
26
|
+
|
27
|
+
size_t buf_len;
|
28
|
+
|
29
|
+
char variable[32] = {0,};
|
30
|
+
|
31
|
+
char value[32] = {0,};
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
buf_len = httpd_req_get_url_query_len(req) + 1;
|
36
|
+
|
37
|
+
if (buf_len > 1) {
|
38
|
+
|
39
|
+
buf = (char*)malloc(buf_len);
|
40
|
+
|
41
|
+
if(!buf){
|
42
|
+
|
43
|
+
httpd_resp_send_500(req);
|
44
|
+
|
45
|
+
return ESP_FAIL;
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
if (httpd_req_get_url_query_str(req, buf, buf_len) == ESP_OK) {
|
50
|
+
|
51
|
+
if (httpd_query_key_value(buf, "var", variable, sizeof(variable)) == ESP_OK &&
|
52
|
+
|
53
|
+
httpd_query_key_value(buf, "val", value, sizeof(value)) == ESP_OK) {
|
54
|
+
|
55
|
+
} else {
|
56
|
+
|
57
|
+
free(buf);
|
58
|
+
|
59
|
+
httpd_resp_send_404(req);
|
60
|
+
|
61
|
+
return ESP_FAIL;
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
} else {
|
66
|
+
|
67
|
+
free(buf);
|
68
|
+
|
69
|
+
httpd_resp_send_404(req);
|
70
|
+
|
71
|
+
return ESP_FAIL;
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
free(buf);
|
76
|
+
|
77
|
+
} else {
|
78
|
+
|
79
|
+
httpd_resp_send_404(req);
|
80
|
+
|
81
|
+
return ESP_FAIL;
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
int val = atoi(value);
|
88
|
+
|
89
|
+
sensor_t * s = esp_camera_sensor_get();
|
90
|
+
|
91
|
+
int res = 0;
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
if(!strcmp(variable, "framesize")) {
|
96
|
+
|
97
|
+
if(s->pixformat == PIXFORMAT_JPEG) res = s->set_framesize(s, (framesize_t)val);
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
else if(!strcmp(variable, "quality")) res = s->set_quality(s, val);
|
102
|
+
|
103
|
+
else if(!strcmp(variable, "contrast")) res = s->set_contrast(s, val);
|
104
|
+
|
105
|
+
else if(!strcmp(variable, "brightness")) res = s->set_brightness(s, val);
|
106
|
+
|
107
|
+
else if(!strcmp(variable, "saturation")) res = s->set_saturation(s, val);
|
108
|
+
|
109
|
+
else if(!strcmp(variable, "gainceiling")) res = s->set_gainceiling(s, (gainceiling_t)val);
|
110
|
+
|
111
|
+
else if(!strcmp(variable, "colorbar")) res = s->set_colorbar(s, val);
|
112
|
+
|
113
|
+
else if(!strcmp(variable, "awb")) res = s->set_whitebal(s, val);
|
114
|
+
|
115
|
+
else if(!strcmp(variable, "agc")) res = s->set_gain_ctrl(s, val);
|
116
|
+
|
117
|
+
else if(!strcmp(variable, "aec")) res = s->set_exposure_ctrl(s, val);
|
118
|
+
|
119
|
+
else if(!strcmp(variable, "hmirror")) res = s->set_hmirror(s, val);
|
120
|
+
|
121
|
+
else if(!strcmp(variable, "vflip")) res = s->set_vflip(s, val);
|
122
|
+
|
123
|
+
else if(!strcmp(variable, "awb_gain")) res = s->set_awb_gain(s, val);
|
124
|
+
|
125
|
+
else if(!strcmp(variable, "agc_gain")) res = s->set_agc_gain(s, val);
|
126
|
+
|
127
|
+
else if(!strcmp(variable, "aec_value")) res = s->set_aec_value(s, val);
|
128
|
+
|
129
|
+
else if(!strcmp(variable, "aec2")) res = s->set_aec2(s, val);
|
130
|
+
|
131
|
+
else if(!strcmp(variable, "dcw")) res = s->set_dcw(s, val);
|
132
|
+
|
133
|
+
else if(!strcmp(variable, "bpc")) res = s->set_bpc(s, val);
|
134
|
+
|
135
|
+
else if(!strcmp(variable, "wpc")) res = s->set_wpc(s, val);
|
136
|
+
|
137
|
+
else if(!strcmp(variable, "raw_gma")) res = s->set_raw_gma(s, val);
|
138
|
+
|
139
|
+
else if(!strcmp(variable, "lenc")) res = s->set_lenc(s, val);
|
140
|
+
|
141
|
+
else if(!strcmp(variable, "special_effect")) res = s->set_special_effect(s, val);
|
142
|
+
|
143
|
+
else if(!strcmp(variable, "wb_mode")) res = s->set_wb_mode(s, val);
|
144
|
+
|
145
|
+
else if(!strcmp(variable, "ae_level")) res = s->set_ae_level(s, val);
|
146
|
+
|
147
|
+
else if(!strcmp(variable, "face_detect")) {
|
148
|
+
|
149
|
+
detection_enabled = val;
|
150
|
+
|
151
|
+
if(!detection_enabled) {
|
152
|
+
|
153
|
+
recognition_enabled = 0;
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
else if(!strcmp(variable, "face_enroll")) is_enrolling = val;
|
160
|
+
|
161
|
+
else if(!strcmp(variable, "face_recognize")) {
|
162
|
+
|
163
|
+
recognition_enabled = val;
|
164
|
+
|
165
|
+
if(recognition_enabled){
|
166
|
+
|
167
|
+
detection_enabled = val;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
else {
|
174
|
+
|
175
|
+
res = -1;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
if(res){
|
182
|
+
|
183
|
+
return httpd_resp_send_500(req);
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
|
190
|
+
|
191
|
+
return httpd_resp_send(req, NULL, 0);
|
192
|
+
|
193
|
+
}
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
```
|