mirror of https://github.com/jetkvm/kvm.git
fix: update process title when video state changes
This commit is contained in:
parent
06dbead5cb
commit
1a3582c877
|
|
@ -373,6 +373,8 @@ void set_streaming_flag(bool flag)
|
||||||
pthread_mutex_lock(&streaming_mutex);
|
pthread_mutex_lock(&streaming_mutex);
|
||||||
streaming_flag = flag;
|
streaming_flag = flag;
|
||||||
pthread_mutex_unlock(&streaming_mutex);
|
pthread_mutex_unlock(&streaming_mutex);
|
||||||
|
|
||||||
|
video_send_format_report();
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_streaming_stopped(bool stopped)
|
void set_streaming_stopped(bool stopped)
|
||||||
|
|
@ -380,6 +382,8 @@ void set_streaming_stopped(bool stopped)
|
||||||
pthread_mutex_lock(&streaming_stopped_mutex);
|
pthread_mutex_lock(&streaming_stopped_mutex);
|
||||||
streaming_stopped = stopped;
|
streaming_stopped = stopped;
|
||||||
pthread_mutex_unlock(&streaming_stopped_mutex);
|
pthread_mutex_unlock(&streaming_stopped_mutex);
|
||||||
|
|
||||||
|
video_send_format_report();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_streaming_stopped()
|
bool get_streaming_stopped()
|
||||||
|
|
@ -545,6 +549,8 @@ void *run_video_stream(void *arg)
|
||||||
uint32_t num = 0;
|
uint32_t num = 0;
|
||||||
VIDEO_FRAME_INFO_S stFrame;
|
VIDEO_FRAME_INFO_S stFrame;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (streaming_flag)
|
while (streaming_flag)
|
||||||
{
|
{
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
|
|
@ -654,8 +660,6 @@ void *run_video_stream(void *arg)
|
||||||
|
|
||||||
set_streaming_stopped(true);
|
set_streaming_stopped(true);
|
||||||
|
|
||||||
video_send_format_report();
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -718,8 +722,6 @@ void video_start_streaming()
|
||||||
|
|
||||||
// Only set streaming_thread after successful creation
|
// Only set streaming_thread after successful creation
|
||||||
streaming_thread = new_thread;
|
streaming_thread = new_thread;
|
||||||
|
|
||||||
video_send_format_report();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wait_for_streaming_stopped()
|
bool wait_for_streaming_stopped()
|
||||||
|
|
@ -755,8 +757,6 @@ void video_stop_streaming()
|
||||||
streaming_thread = NULL;
|
streaming_thread = NULL;
|
||||||
|
|
||||||
log_info("video streaming stopped");
|
log_info("video streaming stopped");
|
||||||
|
|
||||||
video_send_format_report();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t video_get_streaming_status() {
|
uint8_t video_get_streaming_status() {
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,10 @@ func updateProcessTitle(state *VideoState) {
|
||||||
procPrefix = "jetkvm: [native]"
|
procPrefix = "jetkvm: [native]"
|
||||||
} else {
|
} else {
|
||||||
status := "active"
|
status := "active"
|
||||||
if !state.Ready {
|
if state.Streaming == VideoStreamingStatusInactive {
|
||||||
status = "starting"
|
status = "inactive"
|
||||||
|
} else if !state.Ready {
|
||||||
|
status = "not ready"
|
||||||
} else if state.Error != "" {
|
} else if state.Error != "" {
|
||||||
status = state.Error
|
status = state.Error
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue