Skip to content

Commit cdb68ca

Browse files
fix: Apply clang-format to header files
Apply clang-format 19.1.1+ formatting to resolve style violations: - src/c64u-audio.h - src/c64u-network.h - src/c64u-protocol.h - src/c64u-record.h - src/c64u-source.h - src/c64u-types.h - src/c64u-video.h - src/plugin-support.h All files now comply with project formatting standards. No functional changes made.
1 parent b9fa454 commit cdb68ca

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
lines changed

src/c64u-audio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ struct c64u_source;
77
// Audio thread function
88
void *audio_thread_func(void *data);
99

10-
#endif // C64U_AUDIO_H
10+
#endif // C64U_AUDIO_H

src/c64u-network.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ socket_t create_tcp_socket(const char *ip, uint32_t port);
7474
int c64u_get_socket_error(void);
7575
const char *c64u_get_socket_error_string(int error);
7676

77-
#endif // C64U_NETWORK_H
77+
#endif // C64U_NETWORK_H

src/c64u-protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ void init_async_retry_system(struct c64u_source *context);
3939
void shutdown_async_retry_system(struct c64u_source *context);
4040
void *async_retry_thread(void *data);
4141

42-
#endif // C64U_PROTOCOL_H
42+
#endif // C64U_PROTOCOL_H

src/c64u-record.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ void c64u_record_init(struct c64u_source *context);
1919
void c64u_record_cleanup(struct c64u_source *context);
2020
void c64u_record_update_settings(struct c64u_source *context, void *settings);
2121

22-
#endif // C64U_RECORD_H
22+
#endif // C64U_RECORD_H

src/c64u-source.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ void c64u_defaults(obs_data_t *settings);
2121
void c64u_start_streaming(struct c64u_source *context);
2222
void c64u_stop_streaming(struct c64u_source *context);
2323

24-
#endif // C64U_SOURCE_H
24+
#endif // C64U_SOURCE_H

src/c64u-types.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
struct frame_packet {
1414
uint16_t line_num;
1515
uint8_t lines_per_packet;
16-
uint8_t packet_data[780 - 12]; // C64U_VIDEO_PACKET_SIZE - C64U_VIDEO_HEADER_SIZE
16+
uint8_t packet_data[780 - 12]; // C64U_VIDEO_PACKET_SIZE - C64U_VIDEO_HEADER_SIZE
1717
bool received;
1818
};
1919

@@ -22,7 +22,7 @@ struct frame_assembly {
2222
uint16_t frame_num;
2323
uint16_t expected_packets;
2424
uint16_t received_packets;
25-
struct frame_packet packets[68]; // C64U_MAX_PACKETS_PER_FRAME
25+
struct frame_packet packets[68]; // C64U_MAX_PACKETS_PER_FRAME
2626
bool complete;
2727
uint64_t start_time;
2828
};
@@ -31,11 +31,11 @@ struct c64u_source {
3131
obs_source_t *source;
3232

3333
// Configuration
34-
char hostname[64]; // C64U hostname or IP as entered by user
35-
char ip_address[64]; // C64U IP Address (resolved from hostname)
36-
char obs_ip_address[64]; // OBS IP Address (this machine)
34+
char hostname[64]; // C64U hostname or IP as entered by user
35+
char ip_address[64]; // C64U IP Address (resolved from hostname)
36+
char obs_ip_address[64]; // OBS IP Address (this machine)
3737
bool auto_detect_ip;
38-
bool initial_ip_detected; // Flag to track if initial IP detection was done
38+
bool initial_ip_detected; // Flag to track if initial IP detection was done
3939
uint32_t video_port;
4040
uint32_t audio_port;
4141
bool streaming;
@@ -46,8 +46,8 @@ struct c64u_source {
4646
uint8_t *video_buffer;
4747

4848
// Double buffering for smooth video
49-
uint32_t *frame_buffer_front; // For rendering (OBS thread)
50-
uint32_t *frame_buffer_back; // For UDP assembly (video thread)
49+
uint32_t *frame_buffer_front; // For rendering (OBS thread)
50+
uint32_t *frame_buffer_back; // For UDP assembly (video thread)
5151
bool frame_ready;
5252
bool buffer_swap_pending;
5353

@@ -91,34 +91,34 @@ struct c64u_source {
9191

9292
// Frame timing
9393
uint64_t last_frame_time;
94-
uint64_t frame_interval_ns; // Target frame interval (20ms for 50Hz PAL)
94+
uint64_t frame_interval_ns; // Target frame interval (20ms for 50Hz PAL)
9595

9696
// Async retry mechanism for network recovery
97-
pthread_t retry_thread; // Background thread for async retries
98-
bool retry_thread_active; // Is retry thread running?
99-
pthread_mutex_t retry_mutex; // Mutex for retry state
100-
pthread_cond_t retry_cond; // Condition variable for retry signaling
101-
uint64_t last_udp_packet_time; // Timestamp of last UDP packet
102-
bool needs_retry; // Flag indicating retry is needed
103-
uint32_t retry_count; // Number of retry attempts
104-
uint32_t consecutive_failures; // Number of consecutive TCP failures
105-
bool retry_shutdown; // Signal to shutdown retry thread
97+
pthread_t retry_thread; // Background thread for async retries
98+
bool retry_thread_active; // Is retry thread running?
99+
pthread_mutex_t retry_mutex; // Mutex for retry state
100+
pthread_cond_t retry_cond; // Condition variable for retry signaling
101+
uint64_t last_udp_packet_time; // Timestamp of last UDP packet
102+
bool needs_retry; // Flag indicating retry is needed
103+
uint32_t retry_count; // Number of retry attempts
104+
uint32_t consecutive_failures; // Number of consecutive TCP failures
105+
bool retry_shutdown; // Signal to shutdown retry thread
106106

107107
// Rendering delay
108-
uint32_t render_delay_frames; // Delay in frames before making buffer available to OBS
109-
uint32_t *delayed_frame_queue; // Circular buffer for delayed frames
110-
uint32_t delay_queue_size; // Current size of delay queue
111-
uint32_t delay_queue_head; // Head position in delay queue
112-
uint32_t delay_queue_tail; // Tail position in delay queue
113-
uint16_t *delay_sequence_queue; // Sequence numbers for delayed frames
114-
pthread_mutex_t delay_mutex; // Mutex for delay queue access
108+
uint32_t render_delay_frames; // Delay in frames before making buffer available to OBS
109+
uint32_t *delayed_frame_queue; // Circular buffer for delayed frames
110+
uint32_t delay_queue_size; // Current size of delay queue
111+
uint32_t delay_queue_head; // Head position in delay queue
112+
uint32_t delay_queue_tail; // Tail position in delay queue
113+
uint16_t *delay_sequence_queue; // Sequence numbers for delayed frames
114+
pthread_mutex_t delay_mutex; // Mutex for delay queue access
115115

116116
// Auto-start control
117117
bool auto_start_attempted;
118118

119119
// Logo display for network issues
120-
gs_texture_t *logo_texture; // Loaded logo texture
121-
bool logo_load_attempted; // Have we tried to load the logo?
120+
gs_texture_t *logo_texture; // Loaded logo texture
121+
bool logo_load_attempted; // Have we tried to load the logo?
122122

123123
// Frame saving for analysis
124124
bool save_frames;
@@ -130,11 +130,11 @@ struct c64u_source {
130130
FILE *video_file;
131131
FILE *audio_file;
132132
FILE *timing_file;
133-
char session_folder[800]; // Current session folder path
133+
char session_folder[800]; // Current session folder path
134134
uint64_t recording_start_time;
135135
uint32_t recorded_frames;
136136
uint32_t recorded_audio_samples;
137137
pthread_mutex_t recording_mutex;
138138
};
139139

140-
#endif // C64U_TYPES_H
140+
#endif // C64U_TYPES_H

src/c64u-video.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ void clear_delay_queue(struct c64u_source *context);
3636
// Video thread function
3737
void *video_thread_func(void *data);
3838

39-
#endif // C64U_VIDEO_H
39+
#endif // C64U_VIDEO_H

src/plugin-support.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ extern "C" {
2727
#include <stdarg.h>
2828
#include <string.h>
2929

30-
extern const char *PLUGIN_NAME;
31-
extern const char *PLUGIN_VERSION;
30+
extern const char *PLUGIN_NAME;
31+
extern const char *PLUGIN_VERSION;
3232

33-
void obs_log(int log_level, const char *format, ...);
34-
extern void blogva(int log_level, const char *format, va_list args);
33+
void obs_log(int log_level, const char *format, ...);
34+
extern void blogva(int log_level, const char *format, va_list args);
3535

3636
#ifdef __cplusplus
3737
}

0 commit comments

Comments
 (0)