<JSTORM> JMF JSTORM http://wwwjstormpekr
Issued by: < > Document Information Document title: Document file name: Revision number: <10> Issued by: JMF2_ doc Issue Date: <2000/8/25 > Status: < > raica@nownurinet : < > junoyoon@orgionet final Content Information Audience Abstract Reference Benchmark information (JFC) JMF -, RTP JSTORM <2/24>
Issued by: < > Document Approvals Signature date Signature date Revision History Revision Date Author Description of change JSTORM <3/24>
Issued by: < > Table of Contents 5 7 RTP 9 Packetizer Depacketizer 9 RTP 10 RTP I10 RTP II13 18 Sunarchives 18 JSTORM <4/24>
Issued by: < > JMF,,, RTP,, <1> MediaPlayer MediaPlayer, startmedia (Overloading) DisplayFrame MediaPlayer JFrame displayframe, JSTORM <5/24>
Issued by: < >,,, <1> DisplayFrame, JSTORM <6/24>
Issued by: < > [ : BroadCasterstartBroadcast() -> BroadCastersetProcessor()] JMF 20 JavaSound JMF 20, ( ), CaptureDeviceManager CaptureDeviceManager,,, CaptureDeviceManager CaptureDeviceInfo JMF CaptureDeviceInfo,, MediaLocator getlocator() MediaLocator getlocator, MediaLocator, ( ) DataSource DataSource Player, Processor, CaptureDeviceInfo getlocator() MediaLocator DataSource, DataSource,, DataSource JSTORM <7/24>
Issued by: < >, CaptureDeviceManager CaptureDeviceInfo Processor (1) CaptureDeviceManager (CaptureDeviceInfo ) Format null null (2) CaptureDeviceInfo (3) Processor Processor Vector devicelist = CaptureDeviceManagergetDeviceList(new AudioFormat(AudioFormatLINEAR, 44100, 16, 2)); <-- (1) CaptureDeviceInfo di = null; if (devicelistsize() > 0) di = (CaptureDeviceInfo)deviceListfirstElement(); <-- (2) else{ Systemexit(-1); try { thisprocessor = ManagercreateProcessor(digetLocator()); <-- (3) catch(exception e){ eprintstacktrace(); return true; return false; JSTORM <8/24>
Issued by: < > RTP RTP,, url payload RTP Packetizer Depacketizer PacketizerDepacketizer,, Packetizer, Depacketizer < 2> < 2>, Processor JSTORM <9/24>
Issued by: < > RTP RTP MediaLocatorDataSink SessionManager MediaLocator SessionManager RTP I', RTP II RTP I 1) MediaLocatorDataSink, Processor Processor (1) RTP RTP Packetizer ( setenabled(false) ), RTP 'RTP ' (2) MediaLocator URL, MediaLocator DataSink, DataSink (3) DataSink DataSource dsurlrtp://8833255:22224/ audio/1 (4) start() 8833255 processorconfigure(); while(processorgetstate()!= ProcessorConfigured){ JSTORM <10/24>
Issued by: < > processorsetcontentdescriptor( new ContentDescriptor(ContentDescriptorRAW)); TrackControl track[] = processorgettrackcontrols(); boolean encodingok = false; for(int i=0; i < tracklength; i++){ if(!encodingok && track[i]getformat() instanceof AudioFormat){ if( ((FormatControl)track[i])setFormat( new AudioFormat(AudioFormatGSM_RTP, 8000, 8, 1)) == null) <--(1) track[i]setenabled(false); else { track[i]setenabled(true); encodingok = true; else if(track[i]getformat() instanceof VideoFormat){ track[i]setenabled(false); if (encodingok){ processorrealize(); while(processorgetstate()!= ProcessorRealized){ DataSource ds = null; try{ ds = processorgetdataoutput(); catch(exception e){ eprintstacktrace(); processordeallocate(); processorclose(); try{ String url = "rtp://255255255255:22224/audio/1"; <--- (2) MediaLocator m = new MediaLocator(url); DataSink d = ManagercreateDataSink(ds, m); <--- (3) dopen(); JSTORM <11/24>
Issued by: < > dstart(); <--- (4) processorstart(); catch(exception e){ eprintstacktrace(); setbutton(state_stopped); else{ processordeallocate(); processorclose(); setbutton(state_stopped);,,, 2) RTP MediaLocator, MediaLocatorRTP RTP urlmedialoactor MediaLocator (Player ), ManagerPlayer, RTP Player (3) player realize realize,, realize, RTP Player Processor RTP RealizedCompleteEvent ManagercreateRealizedPlayer() Player RTP Block String url = "rtp://883368:22224/audio/1"; <-- (1) MediaLocator mrl = new MediaLocator(url); <-- (2) if(mrl == null){ Systemoutprintln(" RTP Session "); return; JSTORM <12/24>
Issued by: < > try{ player = ManagercreatePlayer(mrl); catch(noplayerexception e){ return; catch(malformedurlexception e){ return; catch(ioexception e){ return; playerrealize(); <-- (3) RTP II SessionManager SessionManager SessionManager SessionManager, RTCP SessionManager Participant CNAME(canonical name) SDES(source description) RTCP SessionManager ReceiveStreamSendStream RTP Stream ReceiveStream, SendStream Processor ReceiveStreamSessionManager RTP SendStream, SessionManager createsendstream < : RTPUtil>SessionManager RTPUtil JMF API Guide JMStudio RTP RTPUtil JMStudio JMStudio JSTORM <13/24>
Issued by: < >, < : RTPUtil> SessionManager static SessionManager ( (1) ) ( (2) ) public class RTPUtil{ public static SessionManager createmanager(string address, String sport, String sttl) { return createmanager(address, new Integer(sport)intValue(), new Integer(sttl)intValue()); public static SessionManager createmanager(string address, int port, int ttl) { SessionManager mgr = (SessionManager)new comsunmediartprtpsessionmgr(); if (mgr == null) return null; mgraddformat(new AudioFormat(AudioFormatDVI_RTP, 44100, 4, 1), 18); String cname = mgrgeneratecname(); String username = null; try { username = SystemgetProperty("username"); catch (SecurityException e){ username = "jmf-user"; SessionAddress localaddr = new SessionAddress(); try{ InetAddress destaddr = InetAddressgetByName(address); SessionAddress sessaddr = new SessionAddress(destaddr, port, destaddr, port + 1); SourceDescription[] userdesclist= new SourceDescription[] JSTORM <14/24>
Issued by: < > { new SourceDescription(SourceDescription SOURCE_DESC_EMAIL, "jmf-user@suncom",1, false), new SourceDescription(SourceDescription SOURCE_DESC_CNAME, cname, 1, false), ; new SourceDescription(SourceDescription SOURCE_DESC_TOOL, "JMF RTP Player v20",1, false) mgrinitsession(localaddr, <---- (1) userdesclist, 005, 025); mgrstartsession(sessaddr,ttl,null); <---- (2) catch (Exception e) { eprintstacktrace(); Systemerrprintln(egetMessage()); return null; return mgr; 1) [ : BroadcasterstartBroadcast()] 'RTP I' RTP Audio RTPUtil SessionManager SessionManager SendStream ( (2) ) DataSource DataSource 0 SendStream SendStreamProcessor start JSTORM <15/24>
Issued by: < > processorconfigure(); while(processorgetstate()!= ProcessorConfigured){ processorsetcontentdescriptor( new ContentDescriptor(ContentDescriptorRAW)); TrackControl track[] = processorgettrackcontrols(); boolean encodingok = false; for(int i=0; i < tracklength; i++){ if(!encodingok && track[i]getformat() instanceof AudioFormat){ if( ((FormatControl)track[i])setFormat( new AudioFormat(AudioFormatGSM_RTP, 8000, 8, 1)) == null) track[i]setenabled(false); else { track[i]setenabled(true); encodingok = true; else if(track[i]getformat() instanceof VideoFormat){ track[i]setenabled(false); if (encodingok){ processorrealize(); while(processorgetstate()!= ProcessorRealized){ DataSource ds = null; try{ ds = processorgetdataoutput(); catch(exception e){ eprintstacktrace(); processordeallocate(); processorclose(); setbutton(state_stopped); try{ manager = RTPUtilcreateManager("883363", "22224", "1"); <---- (1) if(manager == null){ Systemoutprintln("12312"); Systemexit(0); JSTORM <16/24>
Issued by: < > SendStream sendstream = managercreatesendstream(ds, 0); <----- (2) sendstreamstart(); processorstart(); catch(exception e){ eprintstacktrace(); setbutton(state_stopped); else{ processordeallocate(); processorclose(); setbutton(state_stopped); 2) [ : RTPDialogopen() -> RTPDialogopenSession(), MediaPlayerupdate()] SessionManager ReceiveStream, ReceiveStream RTP SessionManager (ReceiveStream ), ReceiveStreamListener ReceiveStreamListener update() ReceiveStreamEvent, ReceiveStream NewReceiveStreamEvent (1) instanceof (2) ReceiveStream (3) DataSource ReceiveStream DataSource public void update( ReceiveStreamEvent event) { SessionManager source = (SessionManager)eventgetSource(); Systemoutprintln(eventtoString() ); if (event instanceof NewReceiveStreamEvent) <------ (1) { String cname = "Online Broadcast"; ReceiveStream stream = null; try { JSTORM <17/24>
Issued by: < > stream =((NewReceiveStreamEvent)event) <------ (2) getreceivestream(); Participant part = streamgetparticipant(); if (part!= null) cname = partgetcname(); // get a handle over the ReceiveStream datasource DataSource dsource = streamgetdatasource(); <--- (3) thisstartmedia(dsource); catch (Exception e) { Systemerrprintln("NewReceiveStreamEvent exception " + egetmessage()); return;, JMF JMF Sunarchives Sunarchives, Q&A Java, JMF,,, URL http://archivesjavasuncom JSTORM <18/24>
Issued by: < > JSTORM <19/24>
Issued by: < > JSTORM <20/24>
Issued by: < > JSTORM <21/24>
Issued by: < > JSTORM <22/24>
Issued by: < > JSTORM <23/24>
Issued by: < > JSTORM <24/24>