/*
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jitsi.service.neomedia;

/**
 * The <tt>MediaType</tt> enumeration contains a list of media types
 * currently known to and handled by the <tt>MediaService</tt>.
 *
 * @author Emil Ivov
 */
public enum MediaType
{
    /**
     * Represents an AUDIO media type.
     */
    AUDIO("audio"),

    /**
     * Represents a VIDEO media type.
     */
    VIDEO("video"),

    /**
     * Represents a (chat-) MESSAGE media type.
     */
    MESSAGE("message"),

    /**
     * Represents a DATA media type.
     * @deprecated In RFC4566. Still defined to avoid parsing errors.
     */
    @Deprecated
    CONTROL("control"),

    /**
     * Represents a DATA media type.
     * @deprecated In RFC4566. Still defined to avoid parsing errors.
     */
    @Deprecated
    DATA("data");

    /**
     * The name of this <tt>MediaType</tt>.
     */
    private final String mediaTypeName;

    /**
     * Creates a <tt>MediaType</tt> instance with the specified name.
     *
     * @param mediaTypeName the name of the <tt>MediaType</tt> we'd like to
     * create.
     */
    private MediaType(String mediaTypeName)
    {
        this.mediaTypeName = mediaTypeName;
    }

    /**
     * Returns the name of this MediaType (e.g. "audio", "message" or "video").
     * The name returned by this method is meant for use by session description
     * mechanisms such as SIP/SDP or XMPP/Jingle.
     *
     * @return the name of this MediaType (e.g. "audio" or "video").
     */
    @Override
    public String toString()
    {
        return mediaTypeName;
    }

    /**
     * Returns a <tt>MediaType</tt> value corresponding to the specified
     * <tt>mediaTypeName</tt> or in other words <tt>AUDIO</tt>, <tt>MESSAGE</tt>
     * or <tt>VIDEO</tt>.
     *
     * @param mediaTypeName the name that we'd like to parse.
     * @return a <tt>MediaType</tt> value corresponding to the specified
     * <tt>mediaTypeName</tt>.
     *
     * @throws IllegalArgumentException in case <tt>mediaTypeName</tt> is not a
     * valid or currently supported media type.
     */
    public static MediaType parseString(String mediaTypeName)
        throws IllegalArgumentException
    {
        if(AUDIO.toString().equals(mediaTypeName))
            return AUDIO;

        if(MESSAGE.toString().equals(mediaTypeName))
            return MESSAGE;

        if(VIDEO.toString().equals(mediaTypeName))
            return VIDEO;

        if(DATA.toString().equals(mediaTypeName))
            return DATA;

        throw new IllegalArgumentException(
            mediaTypeName + " is not a currently supported MediaType");
    }
}

@@ -773,16 +773,190 @@
 tt%3E.%0A *%0A
+ * @see %3Ca href=%22http://www.iana.org/assignments/sdp-parameters/sdp-parameters.xhtml#sdp-parameters-1%22%3E%0A *     Session Description Protocol (SDP) Parameters, media%3C/a%3E%0A *%0A *%0A
  * @auth
@@ -1179,61 +1179,329 @@
 s a 
-(chat-) MESSAGE media type.%0A     */%0A    MESSAGE(%22mess
+TEXT media type. See RFC4103.%0A     */%0A    TEXT(%22text%22),%0A%0A    /**%0A     * Represents an APPLICATION media type.%0A     */%0A    APPLICATION(%22application%22),%0A%0A    /**%0A     * Represents a (chat-) MESSAGE media type.%0A     */%0A    MESSAGE(%22message%22),%0A%0A    /**%0A     * Represents an IMAGE media type. See RFC6466.%0A     */%0A    IMAGE(%22im
 age%22

Add missing media types from RFC4566 and RFC6466