Skip to content

Commit cb0d81f

Browse files
committed
dvs,blue: compilation fixes
+ IWYU
1 parent e7b9a25 commit cb0d81f

File tree

5 files changed

+48
-17
lines changed

5 files changed

+48
-17
lines changed

src/video_capture/bluefish444.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,29 @@
3535
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
*/
3737

38+
#include <cassert> // for assert
39+
#include <cstdint> // for uint32_t
40+
#include <cstdio> // for NULL, printf, snprintf
41+
#include <cstdlib> // for atoi, free, calloc
42+
#include <cstring> // for strlen, memset, strcmp, strdup
3843
#include <iomanip>
3944
#include <iostream>
45+
#include <pthread.h> // for pthread_cond_signal, pthread_mutex...
4046
#include <queue>
4147

4248
#include "bluefish444_common.h"
4349

4450
#include "audio/types.h"
4551
#include "audio/utils.h"
52+
#include "compat/strings.h" // for strcasecmp, strncasecmp
4653
#include "debug.h"
4754
#include "host.h"
4855
#include "lib_common.h"
4956
#include "tv.h"
57+
#include "types.h" // for video_frame, tile, video_desc, dev...
5058
#include "video.h"
5159
#include "video_capture.h"
60+
#include "video_capture_params.h" // for vidcap_params_get_fmt, vidcap_para...
5261

5362
#ifndef UINT
5463
#define UINT uint32_t

src/video_capture/dvs.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,16 @@
4949
*
5050
*/
5151

52+
#include <errno.h> // for ETIMEDOUT
53+
#include <ctype.h> // for isdigit
54+
#include <pthread.h>
5255
#include <stdbool.h>
53-
#include <stdio.h>
5456
#include <stdint.h>
57+
#include <stdio.h>
5558
#include <stdlib.h>
56-
#include <pthread.h>
57-
59+
#include <string.h> // for strtok, strchr, strncmp, memset
60+
#include <time.h> // for timespec
61+
#include <sys/time.h> // for timeval, gettimeofday
5862

5963
#include "host.h"
6064
#include "audio/types.h"
@@ -63,11 +67,13 @@
6367
#include "lib_common.h"
6468
#include "video.h"
6569
#include "video_capture.h"
70+
#include "video_capture_params.h" // for vidcap_params_get_fmt, vidcap_para...
6671
#include "video_display.h"
6772
#include "video_display/dvs.h"
6873
#include "tv.h"
6974
#include "types.h"
7075
#include "dvs_clib.h" /* From the DVS SDK */
76+
#include "dvs_errors.h" // for SV_OK
7177
#include "dvs_fifo.h" /* From the DVS SDK */
7278

7379
struct vidcap_dvs_state {
@@ -411,7 +417,7 @@ static int vidcap_dvs_init(const struct vidcap_params *params, void **state)
411417
}
412418
s->hd_video_mode |= val;
413419
if (s->mode == NULL) {
414-
log_msg(LOG_LEVEL_ERROR, "[DVS] Mode detected, however unknown. Report to " PACKAGE_BUGREPORT ".\n");
420+
bug_msg(LOG_LEVEL_ERROR, "[DVS] Mode detected, however unknown. ");
415421
goto error_detect;
416422
}
417423
printf("[DVS] Autodetected video mode: %dx%d @ %2.2fFPS.\n", s->mode->width, s->mode->height, s->mode->fps);
@@ -667,7 +673,7 @@ static void vidcap_dvs_probe(struct device_info **available_cards, int *count, v
667673
snprintf(cards[card_idx].name, sizeof cards[card_idx].name,
668674
"DVS card #%d", card_idx);
669675
snprintf(cards[card_idx].extra, sizeof cards[card_idx].extra,
670-
"\"embeddedAudioAvailable\":\"t\"", card_idx);
676+
"\"embeddedAudioAvailable\":\"t\"");
671677

672678
sv_close(sv);
673679
card_idx++;

src/video_display/bluefish444.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <pulec@cesnet.cz>
44
*/
55
/*
6-
* Copyright (c) 2013-2025 CESNET
6+
* Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -46,24 +46,30 @@
4646

4747
#include "video_display.h"
4848

49+
#include <algorithm> // for max
4950
#include <cassert>
51+
#include <cmath> // for fabs
5052
#include <cstdint>
53+
#include <cstdlib> // for abort, atoi, calloc
5154
#include <cstdio>
55+
#include <cstring> // for memcpy, memset, strlen, strcmp
5256
#include <iomanip>
5357
#include <iostream>
58+
#include <pthread.h> // for pthread_mutex_lock, pthread_mutex_un...
5459
#include <queue>
5560
#include <sstream>
5661
#include <stdexcept>
57-
#include <string>
5862
#include <vector>
5963

6064
#include "bluefish444_common.h"
6165

6266
#include "audio/types.h"
67+
#include "compat/strings.h" // for strncasecmp
6368
#include "debug.h"
6469
#include "host.h"
6570
#include "lib_common.h"
6671
#include "tv.h"
72+
#include "types.h" // for video_desc, device_info, tile, inter...
6773
#include "utils/ring_buffer.h"
6874
#include "video.h"
6975
#include "video_display.h"

src/video_display/dvs.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
1010
* Colin Perkins <csp@isi.edu>
1111
*
12-
* Copyright (c) 2005-2023 CESNET z.s.p.o.
12+
* Copyright (c) 2005-2026 CESNET, zájmové sdružené právnických osob
1313
* Copyright (c) 2001-2003 University of Southern California
1414
*
1515
* Redistribution and use in source and binary forms, with or without
@@ -49,9 +49,11 @@
4949
*
5050
*/
5151

52-
#include <stdbool.h>
53-
5452
#include <assert.h>
53+
#include <math.h> // for fabs
54+
#include <pthread.h> // for pthread_mutex_unlock, pthread_cond_init
55+
#include <stdbool.h> // for false, true, bool
56+
#include <stdint.h> // for int32_t, uint32_t
5557
#include <stdio.h>
5658
#include <stdlib.h>
5759
#include <string.h>
@@ -67,9 +69,11 @@
6769
#include "video_display.h"
6870
#include "video_display/dvs.h"
6971
#include "tv.h"
72+
#include "types.h" // for video_desc, tile, device_info, video_...
7073
#include "utils/ring_buffer.h"
7174

7275
#include "dvs_clib.h" /* From the DVS SDK */
76+
#include "dvs_errors.h" // for SV_OK
7377
#include "dvs_fifo.h" /* From the DVS SDK */
7478

7579
#define HDSP_MAGIC 0x12345678
@@ -331,7 +335,6 @@ volatile int worker_waiting;
331335
int frames;
332336
struct timeval t, t0;
333337

334-
pthread_t thread_id;
335338
bool should_exit;
336339
};
337340

@@ -805,7 +808,7 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i
805808

806809
free(name);
807810

808-
pthread_create(&s->thread_id, NULL, display_aggregate_run, s);
811+
pthread_create(&s->thread_id, NULL, display_dvs_run, s);
809812
return (void *)s;
810813

811814
error:
@@ -887,7 +890,7 @@ static void display_dvs_put_audio_frame(void *state, const struct audio_frame *f
887890
ring_buffer_write(s->audio_ring_buffer, frame->data, frame->data_len);
888891
}
889892

890-
static int display_dvs_reconfigure_audio(void *state, int quant_samples, int channels,
893+
static bool display_dvs_reconfigure_audio(void *state, int quant_samples, int channels,
891894
int sample_rate) {
892895
bool ret;
893896
struct state_hdsp *s = (struct state_hdsp *)state;

src/video_display/sage.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Dalibor Matura <255899@mail.muni.cz>
99
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
1010
*
11-
* Copyright (c) 2005-2023 CESNET z.s.p.o.
11+
* Copyright (c) 2005-2026 CESNET, zájmové sdružení právnických osob
1212
*
1313
* Redistribution and use in source and binary forms, with or without
1414
* modification, is permitted provided that the following conditions
@@ -46,9 +46,17 @@
4646
*
4747
*/
4848

49+
#include <cstdint> // for uint32_t
50+
#include <cstdio> // for printf, fprintf, stderr, perror
51+
#include <cstdlib> // for free, calloc, abort
52+
#include <cstring> // for NULL, strlen, memcpy, strcmp, strncmp
53+
#include <sys/stat.h> // for stat
54+
4955
#include "debug.h"
5056
#include "host.h"
5157
#include "lib_common.h"
58+
#include "types.h" // for tile, video_desc, device_info, DXT1, codec_t
59+
#include "video_frame.h" // for vf_alloc, vf_free, vf_get_tile
5260
#include "video.h"
5361
#include "video_display.h"
5462

@@ -101,8 +109,6 @@ struct state_sage {
101109
volatile bool should_exit;
102110
bool is_tx;
103111
bool deinterlace;
104-
105-
pthread_t thread_id;
106112
};
107113

108114
/** Prototyping */
@@ -111,7 +117,7 @@ static int display_sage_handle_events(void)
111117
return 0;
112118
}
113119

114-
static void display_sage_run(void *arg)
120+
static void *display_sage_run(void *arg)
115121
{
116122
struct state_sage *s = (struct state_sage *)arg;
117123
s->magic = MAGIC_SAGE;
@@ -160,6 +166,7 @@ static void display_sage_run(void *arg)
160166
s->frames = 0;
161167
}
162168
}
169+
return nullptr;
163170
}
164171

165172
static void *display_sage_init(struct module *parent, const char *fmt, unsigned int flags)

0 commit comments

Comments
 (0)