I'm working on modifying the WebRTC C SDK for sending and receiving streams on Amazon Kinesis based on here. Specifically, I've implemented custom functionalities within the sendGstreamerAudioVideo and receiveGstreamerAudioVideo functions in my .c file, assuming that the kvslugin is installed (source here).
File main.c
#include "Samples.h"
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
PVOID receiveGstreamerAudioVideo(PVOID args){
...
pipeline = gst_parse_launch("filesrc location=./samples.mp4 ! x264enc "
" ! kvsplugin stream-name=Foo channel-name=Foo log-level=3", &error);
...
}
PVOID sendGstreamerAudioVideo(PVOID args){
...
gchar* fileSinkDescription = "multifilesink name=multifilesink location=./test_rtc/frame_%d.h264";
audioVideoDescription = g_strjoin(" ", audioDescription, videoDescription, fileSinkDescription, NULL);
pipeline = gst_parse_launch(audioVideoDescription, &error);
appsrcAudio = gst_bin_get_by_name(GST_BIN(pipeline), "appsrc-audio");
...
}
INT32 main(INT32 argc, CHAR* argv[])
{
...
STATUS retStatus = STATUS_SUCCESS;
PSampleConfiguration pSampleConfiguration = NULL;
pSampleConfiguration->videoSource = sendGstreamerAudioVideo;
pSampleConfiguration->mediaType = SAMPLE_STREAMING_VIDEO_ONLY;
pSampleConfiguration->receiveAudioVideoSource = receiveGstreamerAudioVideo;
...
CHK_STATUS(initKvsWebRtc());
CHK_STATUS(initSignaling(pSampleConfiguration, SAMPLE_MASTER_CLIENT_ID));
// Checking for termination
CHK_STATUS(sessionCleanupWait(pSampleConfiguration));
...
}
File Sample.h:
#include <com/amazonaws/kinesis/video/webrtcclient/Include.h>
typedef struct {
...
startRoutine audioSource;
startRoutine videoSource;
startRoutine receiveAudioVideoSource;
SampleStreamingMediaType mediaType;
...
} SampleConfiguration, *PSampleConfiguration;
While testing, I am unsure about the successful launch of the pipeline. The code runs without errors, but the printf statements within sendGstreamerAudioVideo and receiveGstreamerAudioVideo functions do not produce any output.
I would expect the video send to Kinesis Stream and frames are extracted and saved locally. Any assistance in troubleshooting would be greatly appreciated. Thank you.