Skip to content

Commit

Permalink
Support C610,Gstreamer and audio Player by GStreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
caihy0414 authored and Ubuntu committed Dec 8, 2023
1 parent b998960 commit 80b96f2
Show file tree
Hide file tree
Showing 17 changed files with 1,391 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/gstreamer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: gstreamer

on: [push, pull_request, workflow_dispatch]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
BOARD: GSTREAMER
CC: gcc-10
CXX: g++-10

jobs:
x64-gstreamer:
runs-on: ubuntu-latest

steps:
- name: Install libgstreamer
run: sudo apt install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev -y
- name: Git checkout
uses: actions/checkout@v2

- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DBOARD=${{ env.BOARD }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DBUILD_WEBRTC_SAMPLES=ON -DBUILD_KVS_SAMPLES=ON -DBUILD_SAVE_FRAME_SAMPLES=ON

- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel 4

- name: Test
run: ctest -C ${{ env.BUILD_TYPE }}
72 changes: 72 additions & 0 deletions .github/workflows/qualcomm-qcs610.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: qualcomm-qcs610

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
branches: [main]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
BOARD: QCS610

jobs:
ecr-prepare:
runs-on: ubuntu-latest

steps:
- name: Configure AWS credentials
id: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: codingspirit/amazon-ecr-login@master

- name: Set ECR credentials
id: set-ecr-credentials
run: |
gh auth login --with-token <<< ${{ secrets.PA_TOKEN }}
gh secret set --env ECR ECR_REGISTRY --body ${{ steps.login-ecr.outputs.registry }} --repo ${{ github.repository }}
gh secret set --env ECR ECR_USERNAME --body ${{ steps.login-ecr.outputs.docker_username }} --repo ${{ github.repository }}
gh secret set --env ECR ECR_PASSWORD --body ${{ steps.login-ecr.outputs.docker_password }} --repo ${{ github.repository }}
qualcomm:
environment: ECR
needs: ecr-prepare
runs-on: ubuntu-latest
strategy:
matrix:
container:
["482862934379.dkr.ecr.us-east-1.amazonaws.com/qualcomm:latest"]
container:
image: ${{ matrix.container }}
credentials:
username: ${{ secrets.ECR_USERNAME }}
password: ${{ secrets.ECR_PASSWORD }}

steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Configure CMake
run: |
. /usr/local/fullstack-virtualization-debug-x86_64/environment-setup-aarch64-oe-linux
cmake -B ${{ github.workspace }}/build -DBOARD=${{ env.BOARD }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DBUILD_WEBRTC_SAMPLES=ON -DBUILD_KVS_SAMPLES=ON -DBUILD_SAVE_FRAME_SAMPLES=ON
- name: Build
run: |
. /usr/local/fullstack-virtualization-debug-x86_64/environment-setup-aarch64-oe-linux
cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel 4
- name: Test
run: |
. /usr/local/fullstack-virtualization-debug-x86_64/environment-setup-aarch64-oe-linux
ctest -C ${{ env.BUILD_TYPE }}
32 changes: 32 additions & 0 deletions 3rdparty/GSTREAMER/GSTREAMERGstCmd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once

// video:
// gst-launch-1.0 -e rtspsrc location=rtsp://192.168.0.60:554/stream0 latency=500 ! rtph264depay ! queue ! h264parse config-interval=1 ! mpegtsmux name=muxer ! tcpserversink host=127.0.0.1 port=8501 &
// "tcpclientsrc host=127.0.0.1 port=8502 ! tsdemux name=muxer ! h264parse ! appsink name=sink"
#define GST_LAUNCH_VIDEO_PIPELINE_CMD \
"tcpclientsrc host=%s port=%s ! tsdemux name=muxer ! h264parse ! appsink name=%s"

// audio:
// gst-launch-1.0 -e rtspsrc location=rtsp://192.168.0.60:554/stream0 latency=500 ! rtppcmadepay ! queue ! tcpserversink host=127.0.0.1 port=8503 &
// "tcpclientsrc host=127.0.0.1 port=8503 ! appsink name=sink"
#define GST_LAUNCH_AUDIO_PIPELINE_CMD \
"tcpclientsrc host=%s port=%s ! appsink name=%s"

// audio player:
// "appsrc name=alawsrc ! capsfilter caps=audio/x-alaw,rate=8000,channels=1 ! alawdec ! autoaudiosink"
#define GST_LAUNCH_AUDIO_PLAYER_PIPELINE_CMD \
"appsrc name=%s ! capsfilter caps=audio/x-alaw,rate=8000,channels=1 ! alawdec ! autoaudiosink"
Loading

0 comments on commit 80b96f2

Please sign in to comment.