in src/main/java/com/aws/iot/edgeconnectorforkvs/videorecorder/base/RecorderBranchBase.java [142:184]
private void bindPath(Element recorderElmSrc, RecorderCapability capsToBind)
throws IllegalArgumentException {
Pad entryPadSink = null;
// Only a video or a audio pad can be bound at each request
if (capsToBind == RecorderCapability.AUDIO_ONLY) {
if (this.capability == RecorderCapability.AUDIO_ONLY
|| this.capability == RecorderCapability.VIDEO_AUDIO) {
entryPadSink = this.getEntryAudioPad();
} else {
log.warn("Not supported capability to bind branch: " + capsToBind);
}
}
if (capsToBind == RecorderCapability.VIDEO_ONLY) {
if (this.capability == RecorderCapability.VIDEO_ONLY
|| this.capability == RecorderCapability.VIDEO_AUDIO) {
entryPadSink = this.getEntryVideoPad();
} else {
log.warn("Not supported capability to bind branch: " + capsToBind);
}
}
if (entryPadSink != null) {
Pad recorderSrcPad = this.gstCore.getElementRequestPad(recorderElmSrc, "src_%u");
Element queueElm = this.gstCore.newElement("queue");
Pad quePadSrc = this.gstCore.getElementStaticPad(queueElm, "src");
Pad quePadSink = this.gstCore.getElementStaticPad(queueElm, "sink");
this.gstCore.setElement(queueElm, "flush-on-eos", true);
this.gstCore.setElement(queueElm, "leaky", 2);
// Link elements
this.gstCore.addPipelineElements(this.pipeline, queueElm);
this.gstCore.linkPad(recorderSrcPad, quePadSink);
this.gstCore.linkPad(quePadSrc, entryPadSink);
// Add to hash map
this.teeSrc2Que.put(recorderElmSrc, queueElm);
this.teeSrcPad2Tee.put(recorderSrcPad, recorderElmSrc);
this.gstCore.syncElementParentState(queueElm);
}
}