fix: GPS采集端修复
This commit is contained in:
@@ -745,6 +745,8 @@ int video_pipeline_run(const video_pipeline_config_t *config, video_pipeline_sta
|
||||
int sws_src_format = -1;
|
||||
uint32_t hard_backpressure_since_ms = 0;
|
||||
uint32_t last_soft_drop_log_ms = 0;
|
||||
const char *gpsd_host = env_or_default("OMNI_GPSD_HOST", "127.0.0.1");
|
||||
int gps_buffer_started = 0;
|
||||
|
||||
memset(&sender, 0, sizeof(sender));
|
||||
if (stats == NULL) {
|
||||
@@ -792,6 +794,11 @@ int video_pipeline_run(const video_pipeline_config_t *config, video_pipeline_sta
|
||||
video_pipeline_set_errno_error(stats, "failed to start video sender");
|
||||
goto cleanup;
|
||||
}
|
||||
if (gps_buffer_init(gpsd_host) != 0) {
|
||||
fprintf(stderr, "[video_pipeline] failed to start GPS buffer using %s:2947\n", gpsd_host);
|
||||
} else {
|
||||
gps_buffer_started = 1;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&stats->mutex);
|
||||
stats->connected = 1;
|
||||
@@ -1070,6 +1077,9 @@ cleanup:
|
||||
pthread_mutex_lock(&stats->mutex);
|
||||
stats->connected = 0;
|
||||
pthread_mutex_unlock(&stats->mutex);
|
||||
if (gps_buffer_started) {
|
||||
gps_buffer_cleanup();
|
||||
}
|
||||
if (fd >= 0) {
|
||||
(void) ioctl(fd, VIDIOC_STREAMOFF, &type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user