<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119    PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY AUDIO       PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-rtcweb-audio.xml'>
]>

<?rfc toc="yes" ?>
<?rfc tocompact="no" ?>
<?rfc tocindent="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>

<rfc
  category="std"
  ipr="trust200902"
  docName="draft-guduru-ietf-rtcweb-codec-preferences-00">

  <front>
    <title abbrev="WebRTC-Codec-Preferences">
    WebRTC Codec Preferences
    </title>

    <author initials="K" surname="Guduru" fullname="Kiran Kumar Guduru">
      <organization abbrev="Samsung Electronics">Samsung Electronics</organization>
      <address>
        <postal>
          <street>Samsung RnD Institute India - Bangalore</street>
          <city>Bangalore</city>
          <region>Doddanakundi</region>
          <code>560037</code>
          <country>India</country>
        </postal>
        <phone>+91-888-4995166</phone>
        <email>kiran.guduru@samsung.com</email>
      </address>
    </author>   
    
    <date year="2014" />

    <area>RAI</area>
    <workgroup>rtcweb</workgroup>

    <abstract>
      <t>
   WebRTC working group prefers mandatory to implement codecs inside
   the browser to achieve guaranteed interoperability between two
   WebRTC peers. WebRTC allows browser implementors to support vendor
   specific codecs apart from mandatory codecs. This document explains
   the way to give preferences for media codecs in WebRTC context out
   of the available codecs in browser for creating the offer / answer.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
    
      <t>
   WebRTC specified mandatory to implement codecs for attaining
   the interoperability between browsers and to increase the success
   rate <xref target="I-D.ietf-rtcweb-audio" />. Browser implementors may support other
   codecs apart from mandatory to implement codecs. This specification
   describes a mechanism for JavaScript application to check the
   available codecs, to give preferences among the available codecs and
   to remove some codecs if the application don't want to use them. This
   specification extends RTCPeerConnection by adding two new methods,
   getSupportedAudioCodecs and getSupportedVideoCodecs and the offer /
   answer options with sequences of audio and video codec list.
   This process will avoid the SDP mangling for removing and re-ordering
   of codecs. 
      </t>
 </section>
      <section anchor="terms" title="Terminology">
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
          "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
          this document are to be interpreted as described in 
          <xref target='RFC2119' />.
        </t>
      </section>   
      
     <section anchor="aduio_codecs" title="getSupportedAudioCodecs">
      <t>
   The getSupportedAudioCodes method of RTCPeerConnection returns the
   supported audio codecs. This function SHOULD be called before calling
   createOffer or createAnswer mehtod.
      </t> 
    </section>       
    <section anchor="video_codecs" title="getSupportedVideoCodecs">
      <t>
   The getSupportedVideoCodes method of RTCPeerConnection returns the
   supported video codecs. This function SHOULD be called before calling
   createOffer or createAnswer mehtod.
      </t> 
      </section>      
      <section anchor="options" title="RTCOfferAnswerOptions">  
            <t>
   createOffer and createAnswer methods supports optional "options"
   attribute. A sequence of audio and video codecs, namely
   preferedAudioCodecs and preferedVideoCodecs respectively, in
   applications prefered order SHOULD be included as optional
   constraints in RTCOfferAnswerOptions. Next sections explain
   about preferedAudioCodecs and preferdVideoCodecs.
           </t>        
      <section anchor="prefered_audio_codecs" title="preferedAudioCodecs">  
            <t>
   preferedAudioCodecs optional constraint is a sequence of audio codecs
   in the applications prefered order. If the application does not
   specify any codec preference, then this attribute MUST not be added
   to RTCOfferAnswerOptions. If options attribute is not present in the
   createOffer/createAnswer, browser SHOULD arrange the codecs with
   previously specified preference, if specified earlier for that
   session, otherwise browser MAY arrange the codecs with its own
   preferences. The prefered codec sequence MAY contain the same number
   of audio codecs returned by getSupportedAudioCodecs. Audio codecs
   other than those supported by browser SHOULD be ignored, if present
   in preferedAudioCodecs. If the preferedAudioCodecs does not contain
   atleast one audio codec returned by getAudioCodecs, browser SHOULD
   fire an error event UNSUPPORTED_CODECS. The offer/answer SHOULD_NOT
   contain audo codecs other than those specified in preferedAudioCodecs
   and the order of preference SHOULD be with high priority for the
   codecs first in the preferedAudioCodecs sequence.
           </t>   
      </section>
      <section anchor="prefered_video_codecs" title="preferedVideoCodecs">  
            <t>
   preferedVideoCodecs optional constraint is a sequence of video codecs
   in the applications prefered order. If the application does not
   specify any codec preference, then this attribute MUST not be added
   to RTCOfferAnswerOptions. If options attribute is not present in the
   createOffer/createAnswer, browser SHOULD arrange the codecs with
   previously specified preference, if specified earlier for that
   session, otherwise browser MAY arrange the codecs with its own
   preferences. The prefered codec sequence MAY contain the same number
   of video codecs returned by getSupportedVideoCodecs. Video codecs
   other than those supported by browser SHOULD be ignored, if present
   in preferedVideoCodecs. If the preferedVideoCodecs does not contain
   atleast one video codec returned by getVideoCodecs, browser SHOULD
   fire an error event UNSUPPORTED_CODECS. The offer/answer SHOULD_NOT
   contain audo codecs other than those specified by preferedVideoCodecs
   and the order of preference SHOULD be with high priority for the 
   codecs first in the preferedVideoCodecs sequence.
           </t>   
      </section>
      </section>
  
      <section anchor="security" title="Security Considerations">
        <t>
           TBD. 
        </t>
      </section>

    <section anchor="iana" title="IANA Considerations">
      <t>
        This document requires no actions from IANA.
      </t>
    </section> 
   
    <section anchor="acknowledgement" title="Acknowledgements">
      <t>
        TBD.
      </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC2119; 
      &AUDIO; 
    </references>
  </back>
</rfc>
    
