How to turn off auto-capture when gstreamer pipeline runs? only on-demand

Hi Michael,
Please refer to attachment.

# Install 
sudo apt-get install libgstreamer1.0-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev

# compile with below command
g++ -Wall -std=c++11  gst_jpg_on_demand.cpp -o test $(pkg-config --cflags --libs gstreamer-app-1.0)

gst_jpg_on_demand.zip (1.61 KB)