re-organize folder structure

This commit is contained in:
Maik Jurischka
2025-12-19 13:04:26 +01:00
parent 01ef031fcd
commit 34ed5b2216
20 changed files with 22 additions and 15 deletions

28
scripts/build.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Build script for gstreamerViewer
set -e # Exit on error
echo "=== Building gstreamerViewer ==="
# Create build directory if it doesn't exist
if [ ! -d "build" ]; then
echo "Creating build directory..."
mkdir -p build
fi
cd build
echo "Running CMake..."
cmake ..
echo "Building with make..."
make -j$(nproc)
echo ""
echo "=== Build successful! ==="
echo "Executable: $(pwd)/gstreamerViewer"
echo ""
echo "To run the application:"
echo " cd build && ./gstreamerViewer"
echo ""

28
scripts/run.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Run script for gstreamerViewer
SOCKET="/tmp/vizion_control.sock"
EXECUTABLE="./build/gstreamerViewer"
# Check if executable exists
if [ ! -f "$EXECUTABLE" ]; then
echo "Error: Executable not found at $EXECUTABLE"
echo "Please run ./build.sh first to build the application."
exit 1
fi
# Check if VizionStreamer socket exists
if [ ! -S "$SOCKET" ]; then
echo "Warning: VizionStreamer socket not found at $SOCKET"
echo "Please ensure VizionStreamer backend is running."
echo ""
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
echo "Starting gstreamerViewer..."
cd build
./gstreamerViewer

52
scripts/test_connection.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Test script to verify VizionStreamer connection
SOCKET="/tmp/vizion_control.sock"
echo "=== VizionStreamer Connection Test ==="
echo ""
# Check if socket exists
if [ ! -S "$SOCKET" ]; then
echo "❌ FAIL: Socket not found at $SOCKET"
echo "Please ensure VizionStreamer backend is running."
exit 1
fi
echo "✓ Socket found at $SOCKET"
echo ""
# Test get_status command
echo "Testing get_status command..."
RESPONSE=$(echo '{"command":"get_status"}' | socat - UNIX-CONNECT:$SOCKET 2>/dev/null)
if [ $? -eq 0 ]; then
echo "✓ Connection successful"
echo "Response: $RESPONSE"
echo ""
else
echo "❌ FAIL: Could not connect to socket"
exit 1
fi
# Test get_formats command
echo "Testing get_formats command..."
FORMATS=$(echo '{"command":"get_formats"}' | socat - UNIX-CONNECT:$SOCKET 2>/dev/null)
if [ $? -eq 0 ]; then
echo "✓ get_formats successful"
# Pretty print if python3 is available
if command -v python3 &> /dev/null; then
echo "$FORMATS" | python3 -m json.tool 2>/dev/null || echo "$FORMATS"
else
echo "$FORMATS"
fi
echo ""
else
echo "❌ FAIL: Could not get formats"
exit 1
fi
echo "=== All tests passed! ==="
echo "VizionStreamer backend is ready for use."