From 0428ac525dd3a438185d7645008173c07eb164d1 Mon Sep 17 00:00:00 2001 From: jrobble Date: Thu, 15 May 2025 11:20:03 -0400 Subject: [PATCH 1/3] Add support for feed-forward multi-track video requests. --- detection/api/include/MPFDetectionComponent.h | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/detection/api/include/MPFDetectionComponent.h b/detection/api/include/MPFDetectionComponent.h index 8bda7ab..a3c5fbf 100644 --- a/detection/api/include/MPFDetectionComponent.h +++ b/detection/api/include/MPFDetectionComponent.h @@ -98,6 +98,46 @@ namespace MPF { namespace COMPONENT { }; + struct MPFMultiTrackVideoJob : MPFJob { + const int start_frame; + const int stop_frame; + const bool has_feed_forward_tracks; + const std::vector feed_forward_tracks; + + MPFMultiTrackVideoJob(std::string job_name, + std::string data_uri, + int start_frame, + int stop_frame, + Properties job_properties, + Properties media_properties) + : MPFJob(std::move(job_name), + std::move(data_uri), + std::move(job_properties), + std::move(media_properties)) + , start_frame(start_frame) + , stop_frame(stop_frame) + , has_feed_forward_tracks(false) { + } + + MPFMultiTrackVideoJob(std::string job_name, + std::string data_uri, + int start_frame, + int stop_frame, + std::vector tracks, + Properties job_properties, + Properties media_properties) + : MPFJob(std::move(job_name), + std::move(data_uri), + std::move(job_properties), + std::move(media_properties)) + , start_frame(start_frame) + , stop_frame(stop_frame) + , has_feed_forward_tracks(true) + , feed_forward_tracks(std::move(tracks)) { + } + }; + + struct MPFImageJob : MPFJob { const bool has_feed_forward_location; const MPFImageLocation feed_forward_location; @@ -205,6 +245,10 @@ namespace MPF { namespace COMPONENT { virtual std::vector GetDetections(const MPFVideoJob &job) = 0; + virtual std::vector GetDetections(const MPFMultiTrackVideoJob &job) { + throw std::runtime_error{"MPFMultiTrackVideoJob is not currently supported."}; + } + virtual std::vector GetDetections(const MPFImageJob &job) = 0; virtual std::vector GetDetections(const MPFAudioJob &job) = 0; From 674509216b62343198a6db0d88d652a8fcda2c3b Mon Sep 17 00:00:00 2001 From: jrobble Date: Thu, 15 May 2025 15:46:15 -0400 Subject: [PATCH 2/3] Refactor "multi track" to "all tracks". --- detection/api/include/MPFDetectionComponent.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/detection/api/include/MPFDetectionComponent.h b/detection/api/include/MPFDetectionComponent.h index a3c5fbf..94f42e8 100644 --- a/detection/api/include/MPFDetectionComponent.h +++ b/detection/api/include/MPFDetectionComponent.h @@ -98,13 +98,13 @@ namespace MPF { namespace COMPONENT { }; - struct MPFMultiTrackVideoJob : MPFJob { + struct MPFAllVideoTracksJob : MPFJob { const int start_frame; const int stop_frame; const bool has_feed_forward_tracks; const std::vector feed_forward_tracks; - MPFMultiTrackVideoJob(std::string job_name, + MPFAllVideoTracksJob(std::string job_name, std::string data_uri, int start_frame, int stop_frame, @@ -119,7 +119,7 @@ namespace MPF { namespace COMPONENT { , has_feed_forward_tracks(false) { } - MPFMultiTrackVideoJob(std::string job_name, + MPFAllVideoTracksJob(std::string job_name, std::string data_uri, int start_frame, int stop_frame, @@ -245,8 +245,8 @@ namespace MPF { namespace COMPONENT { virtual std::vector GetDetections(const MPFVideoJob &job) = 0; - virtual std::vector GetDetections(const MPFMultiTrackVideoJob &job) { - throw std::runtime_error{"MPFMultiTrackVideoJob is not currently supported."}; + virtual std::vector GetDetections(const MPFAllVideoTracksJob &job) { + throw std::runtime_error{"MPFAllVideoTracksJob is not currently supported."}; } virtual std::vector GetDetections(const MPFImageJob &job) = 0; From 82b4f93f144c6381ba85a37cd51290c1f65f7e42 Mon Sep 17 00:00:00 2001 From: jrobble Date: Mon, 20 Oct 2025 17:09:24 -0400 Subject: [PATCH 3/3] Remove GetDetections(const MPFAllVideoTracksJob &job). --- detection/api/include/MPFDetectionComponent.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/detection/api/include/MPFDetectionComponent.h b/detection/api/include/MPFDetectionComponent.h index 94f42e8..bf13945 100644 --- a/detection/api/include/MPFDetectionComponent.h +++ b/detection/api/include/MPFDetectionComponent.h @@ -245,10 +245,6 @@ namespace MPF { namespace COMPONENT { virtual std::vector GetDetections(const MPFVideoJob &job) = 0; - virtual std::vector GetDetections(const MPFAllVideoTracksJob &job) { - throw std::runtime_error{"MPFAllVideoTracksJob is not currently supported."}; - } - virtual std::vector GetDetections(const MPFImageJob &job) = 0; virtual std::vector GetDetections(const MPFAudioJob &job) = 0;