1.5. Example applications
The SDK includes a number of example applications to demonstrate the various features and capabilities of the SDK. These are intended to be used as a starting point for your own applications, and to show how to use the SDK in a real-world context.
1.5.1. Building
The demos are standalone set of independent applications which link to an installed SDK instance.
You can build and run them from anywhere, as long as you set the PX_SDK_INCLUDE_DIR
and
PX_SDK_LIB_DIR
variables in the CMake configuration to point to your SDK installation
directory.
To build, simply create a build
directory within the demo directory, cd
into the build
folder and and run cmake ..
then make
.
The created executables will be in the samples/bin
directory.
1.5.2. Hello SDK Application
The hello-sdk
application is a minimal example demonstrating how to integrate and use the Proximie
SDK for basic video preview functionality. It is intended as a starting point for new projects and for
testing SDK installation and linking.
Features:
Prints the Proximie SDK version to the console.
Accepts a
--videosrc
command-line option to select the video source (e.g.,test
for a test pattern,screen
for screen capture, or a V4L2 device path).Creates a video input and displays it in a preview window for a short period.
Writes a DOT file representing the video pipeline graph.
Exits automatically after a demonstration period.
Usage:
./hello-sdk --videosrc=test
Replace test
with another source as needed (e.g., /dev/video0
for a webcam).
Source: samples/src/hello-sdk/hello.cpp
This app is useful for verifying your SDK build and environment, and as a template for more advanced applications.
1.5.3. Auth Application
The auth
application demonstrates how to perform authentication with the Proximie SDK using
various supported methods. It does not perform any video or session operations, focusing solely on
authentication logic.
Features:
Uses the example
Authentication
class to handle authentication.Accepts multiple authentication options via command-line arguments (client ID, client secret, username, password, refresh token, domain).
Attempts each authentication mode in turn until one succeeds.
Prints authentication status and errors to the console.
Usage:
./auth --client-id=YOUR_ID --client-secret=YOUR_SECRET --username=YOUR_USER --password=YOUR_PASS --domain=YOUR_DOMAIN
You can supply different combinations of authentication options. The app will try each mode until successful.
Source: samples/src/auth/main.cpp
This app is useful for verifying authentication credentials and SDK connectivity, and as a reference for integrating authentication into your own applications.
1.5.4. Sessions Application
The sessions
application demonstrates how to authenticate with the Proximie SDK and fetch or
create a session for the authenticated user. It is focused on REST API usage and session management,
without any video streaming or GStreamer dependencies.
Features:
Authenticates using the example
Authentication
class.Retrieves an active session for the user, or creates a new one if none exist.
Demonstrates use of the
PxRestApi::ProximieServices
class for session management.Accepts various authentication and session options via command-line arguments (such as domain and organisation).
Usage:
./sessions --client-id=YOUR_ID --client-secret=YOUR_SECRET --username=YOUR_USER --password=YOUR_PASS --domain=YOUR_DOMAIN --organisation=ORG_ID
You can supply different authentication options; the app will try each mode until successful. If no active session is found, a new session will be created in the specified organisation.
Source: samples/src/sessions/main.cpp
This app is useful for testing authentication and REST API access, and as a reference for integrating session management in your own applications.
1.5.5. Full Demo
This demo brings together many of the available functions in the SDK into one place. As such, it can be harder to follow and break down into individual components.
Features used include:
Logging
Adaptive streaming
Preview
Starting feeds
Writing DOT files
Recording
Authentication
Getting and creating Sessions
Media server session
Feed notifications
Rotate and crop
Audio