}
private ContentPacketExtension createContentPacketExtention(SendersEnum senders, String name, MediaDevice dev, MediaFormat fmt, int payloadId ) {
this.senders = senders;
ContentPacketExtension content = new ContentPacketExtension();
RtpDescriptionPacketExtension description = new RtpDescriptionPacketExtension();
// fill in the basic content:
content.setCreator(creator);
content.setName(name);
if (senders != null && senders != SendersEnum.both)
content.setSenders(senders);
// RTP description
content.addChildExtension(description);
// now fill in the RTP description
if (fmt == null) {
List<MediaFormat> formats = dev.getSupportedFormats();
description.setMedia(formats.get(0).getMediaType().toString());
for (MediaFormat mf : formats)
description.addPayloadType(formatToPayloadType(mf, dynamicPayloadTypes, payloadId));
} else {
description.setMedia(fmt.getMediaType().toString());
description.addPayloadType(formatToPayloadType(fmt, dynamicPayloadTypes, payloadId));
}
return content;
}