Search in sources :

Example 1 with JinglePayloadType

use of org.jivesoftware.smackx.jingleold.packet.JingleContentDescription.JinglePayloadType in project Smack by igniterealtime.

the class JingleContentDescriptionProvider method parsePayload.

/**
     * Parse a iq/jingle/description/payload-type element.
     *
     * @param parser the input to parse
     * @return a payload type element
     */
protected JinglePayloadType parsePayload(final XmlPullParser parser) {
    int ptId = 0;
    String ptName;
    int ptChannels = 0;
    try {
        ptId = Integer.parseInt(parser.getAttributeValue("", "id"));
    } catch (Exception e) {
    }
    ptName = parser.getAttributeValue("", "name");
    try {
        ptChannels = Integer.parseInt(parser.getAttributeValue("", "channels"));
    } catch (Exception e) {
    }
    return new JinglePayloadType(new PayloadType(ptId, ptName, ptChannels));
}
Also used : JinglePayloadType(org.jivesoftware.smackx.jingleold.packet.JingleContentDescription.JinglePayloadType) SmackException(org.jivesoftware.smack.SmackException) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) IOException(java.io.IOException) JinglePayloadType(org.jivesoftware.smackx.jingleold.packet.JingleContentDescription.JinglePayloadType) PayloadType(org.jivesoftware.smackx.jingleold.media.PayloadType)

Aggregations

IOException (java.io.IOException)1 SmackException (org.jivesoftware.smack.SmackException)1 PayloadType (org.jivesoftware.smackx.jingleold.media.PayloadType)1 JinglePayloadType (org.jivesoftware.smackx.jingleold.packet.JingleContentDescription.JinglePayloadType)1 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)1