use of com.aws.iot.edgeconnectorforkvs.videorecorder.model.RecorderCapability in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class RecorderCameraRtsp method buildRtpDepayPath.
private Pad buildRtpDepayPath(Structure capStruct) {
Pad rtpDepaySinkPad = null;
boolean hasMedia = this.gstCore.hasStructureField(capStruct, "media");
boolean hasEncode = this.gstCore.hasStructureField(capStruct, "encoding-name");
if (hasMedia && hasEncode) {
String media = this.gstCore.getStructureString(capStruct, "media");
String encode = this.gstCore.getStructureString(capStruct, "encoding-name");
log.debug("media = " + media + ", encoding = " + encode);
if (!media.equals("video") && !media.equals("audio")) {
log.warn("Unsupported RTP media type: " + media);
} else if (!ConfigRtp.DEPAY_INFO.containsKey(encode)) {
log.warn("Unsupported RTP encode: " + encode);
} else {
RecorderCapability recCap = null;
Element depayElm = this.gstCore.newElement(ConfigRtp.DEPAY_INFO.get(encode));
if (media.equals("video")) {
recCap = RecorderCapability.VIDEO_ONLY;
} else {
recCap = RecorderCapability.AUDIO_ONLY;
}
this.gstCore.addPipelineElements(this.pipeline, depayElm);
if (ConfigCodec.PARSE_INFO.containsKey(encode)) {
Element parseElm = this.gstCore.newElement(ConfigCodec.PARSE_INFO.get(encode));
Pad parsePad = this.gstCore.getElementStaticPad(parseElm, "src");
this.gstCore.addPipelineElements(this.pipeline, parseElm);
this.gstCore.linkManyElement(depayElm, parseElm);
this.getPadListener().onNotify(recCap, parsePad);
this.gstCore.playElement(parseElm);
} else {
Pad depayPad = this.gstCore.getElementStaticPad(depayElm, "src");
this.getPadListener().onNotify(recCap, depayPad);
}
this.gstCore.playElement(depayElm);
rtpDepaySinkPad = this.gstCore.getElementStaticPad(depayElm, "sink");
}
}
return rtpDepaySinkPad;
}
use of com.aws.iot.edgeconnectorforkvs.videorecorder.model.RecorderCapability in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class RecorderBranchBaseUnitTest method getMembersTest_invokeGetter_nonNullValue.
@Test
public void getMembersTest_invokeGetter_nonNullValue() {
RecorderCapability cap = RecorderCapability.VIDEO_AUDIO;
RecorderBranchTest testBranch = new RecorderBranchTest(cap);
Assertions.assertEquals(cap, testBranch.getCapability());
Assertions.assertNotNull(testBranch.getGstDao());
Assertions.assertNotNull(testBranch.getPipe());
Assertions.assertNotNull(testBranch.isAttachedExplicitly());
Assertions.assertNotNull(testBranch.isBranchAttached());
}
use of com.aws.iot.edgeconnectorforkvs.videorecorder.model.RecorderCapability in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class RecorderBranchBaseUnitTest method getMuxerTest_getMuxerByInvalidType_throwException.
@Test
public void getMuxerTest_getMuxerByInvalidType_throwException() {
RecorderCapability cap = RecorderCapability.VIDEO_AUDIO;
ContainerType type = ContainerType.UNSUPPORTED;
RecorderBranchTest testBranch = new RecorderBranchTest(cap);
Assertions.assertThrows(IllegalArgumentException.class, () -> testBranch.getMuxer(type, true));
}
use of com.aws.iot.edgeconnectorforkvs.videorecorder.model.RecorderCapability in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class RecorderBranchBaseUnitTest method getExtensionTest_getExtensionByType_mkv.
@Test
public void getExtensionTest_getExtensionByType_mkv() {
RecorderCapability cap = RecorderCapability.VIDEO_AUDIO;
ContainerType type = ContainerType.MATROSKA;
RecorderBranchTest testBranch = new RecorderBranchTest(cap);
Assertions.assertEquals("mkv", testBranch.getExtension(type));
}
use of com.aws.iot.edgeconnectorforkvs.videorecorder.model.RecorderCapability in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class RecorderBranchBaseUnitTest method getExtensionTest_getExtensionByInvalidType_throwException.
@Test
public void getExtensionTest_getExtensionByInvalidType_throwException() {
RecorderCapability cap = RecorderCapability.VIDEO_AUDIO;
ContainerType type = ContainerType.UNSUPPORTED;
RecorderBranchTest testBranch = new RecorderBranchTest(cap);
Assertions.assertThrows(IllegalArgumentException.class, () -> testBranch.getExtension(type));
}
Aggregations