Skip to content

Commit b79b874

Browse files
committed
samples: drivers: video: tcpserversink: add _dev suffix to variable
Variables that holds pointers to 'const struct device' typically end-up with '_dev'. The tcpserversink video sample did not have it. Add it. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 0fcc13e commit b79b874

File tree

1 file changed

+12
-12
lines changed
  • samples/drivers/video/tcpserversink/src

1 file changed

+12
-12
lines changed

samples/drivers/video/tcpserversink/src/main.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ int main(void)
4040
struct video_format fmt;
4141
struct video_caps caps;
4242
enum video_buf_type type = VIDEO_BUF_TYPE_OUTPUT;
43-
const struct device *video;
43+
const struct device *video_dev;
4444

45-
video = DEVICE_DT_GET(DT_CHOSEN(zephyr_camera));
46-
if (!device_is_ready(video)) {
47-
LOG_ERR("%s: video device not ready.", video->name);
45+
video_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_camera));
46+
if (!device_is_ready(video_dev)) {
47+
LOG_ERR("%s: video device not ready.", video_dev->name);
4848
return 0;
4949
}
5050

@@ -75,14 +75,14 @@ int main(void)
7575

7676
/* Get capabilities */
7777
caps.type = type;
78-
if (video_get_caps(video, &caps)) {
78+
if (video_get_caps(video_dev, &caps)) {
7979
LOG_ERR("Unable to retrieve video capabilities");
8080
return 0;
8181
}
8282

8383
/* Get default/native format */
8484
fmt.type = type;
85-
if (video_get_format(video, &fmt)) {
85+
if (video_get_format(video_dev, &fmt)) {
8686
LOG_ERR("Unable to retrieve video format");
8787
return 0;
8888
}
@@ -119,11 +119,11 @@ int main(void)
119119

120120
/* Enqueue Buffers */
121121
for (i = 0; i < ARRAY_SIZE(buffers); i++) {
122-
video_enqueue(video, buffers[i]);
122+
video_enqueue(video_dev, buffers[i]);
123123
}
124124

125125
/* Start video capture */
126-
if (video_stream_start(video, type)) {
126+
if (video_stream_start(video_dev, type)) {
127127
LOG_ERR("Unable to start video");
128128
return 0;
129129
}
@@ -134,7 +134,7 @@ int main(void)
134134
i = 0;
135135
vbuf->type = type;
136136
do {
137-
ret = video_dequeue(video, &vbuf, K_FOREVER);
137+
ret = video_dequeue(video_dev, &vbuf, K_FOREVER);
138138
if (ret) {
139139
LOG_ERR("Unable to dequeue video buf");
140140
return 0;
@@ -150,18 +150,18 @@ int main(void)
150150
close(client);
151151
}
152152

153-
(void)video_enqueue(video, vbuf);
153+
(void)video_enqueue(video_dev, vbuf);
154154
} while (!ret);
155155

156156
/* stop capture */
157-
if (video_stream_stop(video, type)) {
157+
if (video_stream_stop(video_dev, type)) {
158158
LOG_ERR("Unable to stop video");
159159
return 0;
160160
}
161161

162162
/* Flush remaining buffers */
163163
do {
164-
ret = video_dequeue(video, &vbuf, K_NO_WAIT);
164+
ret = video_dequeue(video_dev, &vbuf, K_NO_WAIT);
165165
} while (!ret);
166166

167167
} while (1);

0 commit comments

Comments
 (0)