13
13
struct frame_packet {
14
14
uint16_t line_num ;
15
15
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
17
17
bool received ;
18
18
};
19
19
@@ -22,7 +22,7 @@ struct frame_assembly {
22
22
uint16_t frame_num ;
23
23
uint16_t expected_packets ;
24
24
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
26
26
bool complete ;
27
27
uint64_t start_time ;
28
28
};
@@ -31,11 +31,11 @@ struct c64u_source {
31
31
obs_source_t * source ;
32
32
33
33
// 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)
37
37
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
39
39
uint32_t video_port ;
40
40
uint32_t audio_port ;
41
41
bool streaming ;
@@ -46,8 +46,8 @@ struct c64u_source {
46
46
uint8_t * video_buffer ;
47
47
48
48
// 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)
51
51
bool frame_ready ;
52
52
bool buffer_swap_pending ;
53
53
@@ -91,34 +91,34 @@ struct c64u_source {
91
91
92
92
// Frame timing
93
93
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)
95
95
96
96
// 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
106
106
107
107
// 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
115
115
116
116
// Auto-start control
117
117
bool auto_start_attempted ;
118
118
119
119
// 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?
122
122
123
123
// Frame saving for analysis
124
124
bool save_frames ;
@@ -130,11 +130,11 @@ struct c64u_source {
130
130
FILE * video_file ;
131
131
FILE * audio_file ;
132
132
FILE * timing_file ;
133
- char session_folder [800 ]; // Current session folder path
133
+ char session_folder [800 ]; // Current session folder path
134
134
uint64_t recording_start_time ;
135
135
uint32_t recorded_frames ;
136
136
uint32_t recorded_audio_samples ;
137
137
pthread_mutex_t recording_mutex ;
138
138
};
139
139
140
- #endif // C64U_TYPES_H
140
+ #endif // C64U_TYPES_H
0 commit comments