rtp_java.rar

  • pop
    了解作者
  • Java
    开发工具
  • 10KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2014-04-17 13:10
    上传日期
基于Java的rtp编程是现代多媒体协议的主要协议,是实时通行的基础。望大家相互学习。
rtp_java.rar
  • video_rtp264.doc
    66KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b7c883d2fbb00075a52d3/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b7c883d2fbb00075a52d3/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">package<span class="ff2 fc1"> video.rtp.test;</span></div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">public<span class="ff2 fc1"> </span>class<span class="ff2 fc1"> RtpPacket {</span></div><div class="t m0 x1 h4 y4 ff2 fs0 fc2 sc0 ls0 ws0">// RTP packet buffer containing both the RTP he<span class="_ _0"></span>ader and </div><div class="t m0 x1 h4 y5 ff2 fs0 fc2 sc0 ls0 ws0">payload</div><div class="t m0 x2 h3 y6 ff1 fs0 fc0 sc0 ls0 ws0">byte<span class="ff2 fc1">[] <span class="fc3">packet</span>;</span></div><div class="t m0 x2 h4 y7 ff2 fs0 fc2 sc0 ls0 ws0">/* RTP packet length */</div><div class="t m0 x2 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">int<span class="ff2 fc1"> <span class="fc3">packet_len</span>;</span></div><div class="t m0 x2 h4 y9 ff2 fs0 fc4 sc0 ls0 ws0">/** Creates a new RTP packe<span class="_ _0"></span>t */</div><div class="t m0 x2 h3 ya ff1 fs0 fc0 sc0 ls0 ws0">public<span class="ff2 fc1"> RtpPacket(</span>byte<span class="ff2 fc1">[] buffer, </span>int<span class="ff2 fc1"> packet_length) {</span></div><div class="t m0 x3 h4 yb ff2 fs0 fc3 sc0 ls0 ws0">packet<span class="fc1"> = buffer;</span></div><div class="t m0 x3 h4 yc ff2 fs0 fc3 sc0 ls0 ws0">packet_len<span class="fc1"> = packet_length;</span></div><div class="t m0 x3 h3 yd ff1 fs0 fc0 sc0 ls0 ws0">if<span class="ff2 fc1"> (<span class="fc3">packet_len</span> &lt; 12)</span></div><div class="t m0 x4 h4 ye ff2 fs0 fc3 sc0 ls0 ws0">packet_len<span class="fc1"> = 12;</span></div><div class="t m0 x3 h4 yf ff2 fs0 fc1 sc0 ls0 ws0">init(0x0F);</div><div class="t m0 x2 h4 y10 ff2 fs0 fc1 sc0 ls0 ws0">}</div><div class="t m0 x2 h4 y11 ff2 fs0 fc2 sc0 ls0 ws0">/* RTP header length */</div><div class="t m0 x2 h4 y12 ff2 fs0 fc2 sc0 ls0 ws0">// int header_len;</div><div class="t m0 x2 h4 y13 ff2 fs0 fc4 sc0 ls0 ws0">/** Gets the RTP packet */</div><div class="t m0 x2 h3 y14 ff1 fs0 fc0 sc0 ls0 ws0">public<span class="ff2 fc1"> </span>byte<span class="ff2 fc1">[] getPacket() {</span></div><div class="t m0 x3 h3 y15 ff1 fs0 fc0 sc0 ls0 ws0">return<span class="ff2 fc1"> <span class="fc3">packet</span>; }</span></div><div class="t m0 x2 h4 y16 ff2 fs0 fc4 sc0 ls0 ws0">/** Gets the RTP packet len<span class="_ _0"></span>gth */</div><div class="t m0 x2 h3 y17 ff1 fs0 fc0 sc0 ls0 ws0">public<span class="ff2 fc1"> </span>int<span class="ff2 fc1"> getLength() {</span></div><div class="t m0 x3 h3 y18 ff1 fs0 fc0 sc0 ls0 ws0">return<span class="ff2 fc1"> <span class="fc3">packet_len</span>;<span class="_ _1"> </span>}</span></div><div class="t m0 x2 h4 y19 ff2 fs0 fc4 sc0 ls0 ws0">/** Gets the RTP header len<span class="_ _0"></span>gth */</div><div class="t m0 x2 h3 y1a ff1 fs0 fc0 sc0 ls0 ws0">public<span class="ff2 fc1"> </span>int<span class="ff2 fc1"> getHeaderLength() {</span></div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐