Skip to content

Commit

Permalink
Gstreamer fixes (#71)
Browse files Browse the repository at this point in the history
Add Image capture and passing into monitor through zmq as buffers.

TODO: add kafka output of images.

---------

Co-authored-by: Chris Kennedy <chris.kennedy@ltnglobal.com>
  • Loading branch information
groovybits and ltn-chriskennedy committed Apr 8, 2024
1 parent 0821df1 commit 3460e64
Show file tree
Hide file tree
Showing 11 changed files with 847 additions and 415 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ src/bin/probe.rs.main
src/bin/probe.rs.staging
.env
src/stream_data_capnp.rs
images/*.jpg
build

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ gstreamer-app = { version = "0.20", optional = true }
gstreamer-video = { version = "0.20", optional = true }
crossbeam = "0.8.4"
image = "0.25.1"
num_cpus = "1.16.0"
threadpool = "1.8.1"

[build-dependencies]
capnpc = "0.18.0"
Empty file added images/.keep
Empty file.
1 change: 1 addition & 0 deletions schema/stream_data.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ struct StreamDataCapnp {
hostName @47 :Text;
kernelVersion @48 :Text;
osVersion @49 :Text;
hasImage @50 :UInt8;
}
37 changes: 28 additions & 9 deletions scripts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# Exit immediately if a command exits with a non-zero status.
set -e

FEATURES=
if [ "$1" != "" ]; then
FEATURES="--features $1"
fi

BUILD=release-with-debug

# Function to prompt for installation
prompt_install() {
while true; do
Expand Down Expand Up @@ -64,9 +71,13 @@ if [ "$OS" = "Linux" ]; then

# Build with SCL
echo "Building project (CentOS 7)..."
run_with_scl cargo build
run_with_scl cargo build --release
run_with_scl cargo build --profile=release-with-debug
if [ "$BUILD" = "release" ]; then
run_with_scl cargo build $FEATURES --release
elif [ "$BUILD" = "release-with-debug" ]; then
run_with_scl cargo build $FEATURES --profile=release-with-debug
else
run_with_scl cargo build $FEATURES
fi
fi
fi
# Add elif blocks here for other specific Linux distributions
Expand All @@ -75,17 +86,25 @@ elif [ "$OS" = "Darwin" ]; then
# macOS specific setup
# Build on macOS
echo "Building project (macOS)..."
cargo build
cargo build --release
cargo build --profile=release-with-debug
if [ "$BUILD" = "release" ]; then
cargo build $FEATURES --profile=release-with-debug
elif [ "$BUILD" == "release-with-debug" ]; then
cargo build $FEATURES --release
else
cargo build $FEATURES
fi
else
echo "Generic Unix-like OS detected."
# Generic Unix/Linux setup
# Build for generic Unix/Linux
echo "Building project..."
cargo build
cargo build --release
cargo build --profile=release-with-debug
if [ "$BUILD" = "release" ]; then
cargo build $FEATURES --release
elif [ "$BUILD" == "release-with-debug" ]; then
cargo build $FEATURES --profile=release-with-debug
else
cargo build $FEATURES
fi
fi

echo "Build completed successfully."
Loading

0 comments on commit 3460e64

Please sign in to comment.