rtsp_conn_info *conn = (rtsp_conn_info *)arg;
// #include <syscall.h>
// debug(1, "Connection %d: rtp_buffered_audio_processor PID %d start", conn->connection_number,
- syscall(SYS_gettid));
+ // syscall(SYS_gettid));
conn->incoming_ssrc = 0; // reset
conn->resampler_ssrc = 0;
void ap2_event_receiver_cleanup_handler(void *arg) {
rtsp_conn_info *conn = (rtsp_conn_info *)arg;
- debug(1, "Connection %d: AP2 Event Receiver Cleanup start.", conn->connection_number);
+ debug(3, "Connection %d: AP2 Event Receiver Cleanup start.", conn->connection_number);
// only update these things if you're (still) the principal conn
#ifdef CONFIG_METADATA
if (principal_conn == conn) {
config.airplay_statusflags &= (0xffffffff - (1 << 11)); // DeviceSupportsRelay
build_bonjour_strings(conn);
- debug(1, "Connection %d: SETUP mdns_update on %s.", conn->connection_number,
+ debug(3, "Connection %d: SETUP mdns_update on %s.", conn->connection_number,
get_category_string(conn->airplay_stream_category));
mdns_update(NULL, secondary_txt_records);
principal_conn = NULL;
}
pthread_cleanup_pop(1); // release the principal_conn lock
- debug(1, "Connection %d: AP2 Event Receiver Cleanup exit.", conn->connection_number);
+ debug(2, "Connection %d: AP2 Event Receiver Cleanup exit.", conn->connection_number);
}
void *ap2_event_receiver(void *arg) {
debug(3, "Connection %d: Packet Received on Event Port with contents: \"%s\".",
conn->connection_number, packet);
} else {
- debug(1, "Connection %d: Event Port connection closed by client",
+ debug(2, "Connection %d: Event Port connection closed by client",
conn->connection_number);
finished = 1;
}
}
} while (finished == 0);
- debug(1, "Connection %d: AP2 Event Receiver RTP thread starting \"normal\" exit.",
+ debug(3, "Connection %d: AP2 Event Receiver RTP thread starting \"normal\" exit.",
conn->connection_number);
pthread_cleanup_pop(1); // close the socket
pthread_cleanup_pop(1); // do the cleanup
pthread_cleanup_pop(1); // delete the structured buffer
- debug(1, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.",
+ debug(2, "Connection %d: AP2 Event Receiver RTP thread \"normal\" exit.",
conn->connection_number);
} else {
debug(1, "Could not allocate a structured buffer!");
} else if (conn->airplay_stream_type == buffered_stream) {
- debug(1,
+ debug(3,
"Connection %d: Delete Buffered Audio Stream thread by player_thread_cleanup_handler",
conn->connection_number);
pthread_cancel(conn->rtp_buffered_audio_thread);
pthread_join(conn->rtp_buffered_audio_thread, NULL);
- debug(1,
+ debug(3,
"Connection %d: Deleted Buffered Audio Stream thread by player_thread_cleanup_handler",
conn->connection_number);
} else {
sizeof(timing_list_message) - 1 - strlen(timing_list_message));
ptp_send_control_message_string(timing_list_message);
}
-
-void clear_ptp_clock() { ptp_send_control_message_string("T"); }
#endif
enum rtsp_read_request_response rtsp_read_request(rtsp_conn_info *conn, rtsp_message **the_packet) {
} else {
char errorstring[1024];
strerror_r(errno, (char *)errorstring, sizeof(errorstring));
- debug(1, "Connection %d RTSP port closed by client with error %d: \"%s\".",
+ debug(2, "Connection %d RTSP port closed by client with error %d: \"%s\".",
conn->connection_number, errno, (char *)errorstring);
}
close(conn->fd); // close it from our end too...
plist_get_string_val(timingProtocol, &timingProtocolString);
if (timingProtocolString) {
if (strcmp(timingProtocolString, "PTP") == 0) {
- debug(1, "Connection %d: AP2 PTP connection from %s:%u (\"%s\") to self at %s:%u.",
+ debug(2, "Connection %d: AP2 PTP connection from %s:%u (\"%s\") to self at %s:%u.",
conn->connection_number, conn->client_ip_string, conn->client_rtsp_port,
clientNameString, conn->self_ip_string, conn->self_rtsp_port);
conn->airplay_stream_category = ptp_stream;
if (ptp_shm_interface_open() !=
0) // it should be open already, but just in case it isn't...
die("Can not access the NQPTP service. Has it stopped running?");
- // clear_ptp_clock();
debug_log_rtsp_message(3, "SETUP \"PTP\" message", req);
plist_t groupUUID = plist_dict_get_item(messagePlist, "groupUUID");
if (groupUUID) {
activity_monitor_signify_activity(1);
- debug(1, "Connection %d: create rtp_buffered_audio_thread", conn->connection_number);
+ // debug(1, "Connection %d: create rtp_buffered_audio_thread", conn->connection_number);
named_pthread_create_with_priority(&conn->rtp_buffered_audio_thread, 2,
&rtp_buffered_audio_processor, (void *)conn,
int oldState;
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
- debug(1, "Connection %d: %s rtsp_conversation_thread_func_cleanup_function called.",
+ debug(3, "Connection %d: %s rtsp_conversation_thread_func_cleanup_function called.",
conn->connection_number, get_category_string(conn->airplay_stream_category));
if (conn->player_thread) {
if (conn->fd > 0) {
debug(
- 1,
+ 2,
"Connection %d: terminating -- closing RTSP connection socket %d: from %s:%u to self at "
"%s:%u.",
conn->connection_number, conn->fd, conn->client_ip_string, conn->client_rtsp_port,
free(conn->rtp_event_thread);
conn->rtp_event_thread = NULL;
conn->ap2_event_receiver_exited = 0;
- debug(1, "Connection %d: %s event thread deleted.", conn->connection_number,
+ debug(3, "Connection %d: %s event thread deleted.", conn->connection_number,
get_category_string(conn->airplay_stream_category));
#endif
if (rc)
debug(1, "Connection %d: error %d destroying flush_mutex.", conn->connection_number, rc);
- debug(1, "Connection %d: Closed.", conn->connection_number);
+ debug(3, "Connection %d: Closed.", conn->connection_number);
conn->running = 0; // for the garbage collector
pthread_setcancelstate(oldState, NULL);
}
#endif
void exit_rtsp_listener() {
- debug(1, "exit_rtsp_listener begins");
+ debug(3, "exit_rtsp_listener begins");
if (type_of_exit_cleanup != TOE_emergency) {
pthread_cancel(rtsp_listener_thread);
pthread_join(rtsp_listener_thread, NULL); // not sure you need this
}
- debug(1, "exit_rtsp_listener ends");
+ debug(2, "exit_rtsp_listener ends");
}
void exit_function() {
#define STANDARD_PACKET_SIZE 4096
void buffered_tcp_reader_cleanup_handler(__attribute__((unused)) void *arg) {
- debug(1, "Buffered TCP Reader Thread Exit via Cleanup.");
+ debug(2, "Buffered TCP Reader Thread Exit via Cleanup.");
}
void *buffered_tcp_reader(void *arg) {
} else if (nread == 0) {
descriptor->closed = 1;
debug(
- 1,
+ 2,
"buffered audio port closed by remote end. Terminating the buffered_tcp_reader thread.");
finished = 1;
} else if (nread > 0) {
usleep(10000); // give other threads a chance to run...
} while (finished == 0);
- debug(1, "Buffered TCP Reader Thread Exit \"Normal\" Exit Begin.");
+ debug(2, "Buffered TCP Reader Thread Exit \"Normal\" Exit Begin.");
pthread_cleanup_pop(1); // close the socket
pthread_cleanup_pop(1); // cleanup
- debug(1, "Buffered TCP Reader Thread Exit \"Normal\" Exit.");
+ debug(2, "Buffered TCP Reader Thread Exit \"Normal\" Exit.");
pthread_exit(NULL);
}