本文整理汇总了Java中javax.media.rtp.event.ReceiveStreamEvent类的典型用法代码示例。如果您正苦于以下问题:Java ReceiveStreamEvent类的具体用法?Java ReceiveStreamEvent怎么用?Java ReceiveStreamEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReceiveStreamEvent类属于javax.media.rtp.event包,在下文中一共展示了ReceiveStreamEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import javax.media.rtp.event.ReceiveStreamEvent; //导入依赖的package包/类
public void update( ReceiveStreamEvent event) {
String timestamp= getTimestamp();
StringBuffer sb= new StringBuffer();
if( event instanceof InactiveReceiveStreamEvent) {
sb.append( timestamp + " Inactive Receive Stream");
} else if( event instanceof ByeEvent) {
sb.append( timestamp + " Bye");
} else {
System.out.println( "ReceiveStreamEvent: "+ event);
}
tx.rtcpReport( sb.toString());
}
示例2: update
import javax.media.rtp.event.ReceiveStreamEvent; //导入依赖的package包/类
public void update(ReceiveStreamEvent evt) {
ReceiveStream stream = evt.getReceiveStream();
BrokerFactory.getLoggingBroker().logDebug("Got RSE: "+evt);
try {
playerDataSource = stream.getDataSource();
if (player == null) {
player = Manager.createProcessor(playerDataSource);
player.configure();
while (player.getState() == Processor.Configuring) {
Thread.sleep(100);
}
TrackControl trackControl = null;
TrackControl[] trackControls = player.getTrackControls();
for (int i = 0; i < trackControls.length; i++) {
if (trackControls[i].getFormat() instanceof AudioFormat) {
trackControls[i].setFormat(new AudioFormat(AudioFormat.LINEAR, 8000, 8, 1,
AudioFormat.LITTLE_ENDIAN, AudioFormat.UNSIGNED));
}
}
player.realize();
while (player.getState() != Player.Realized) {
Thread.sleep(10);
}
DataSource out = player.getDataOutput();
BrokerFactory.getLoggingBroker().logDebug("content type="+out.getContentType());
silenceDS = new SilenceDataSink();
for (int i = 0; i < pickupListeners.size(); i++) {
silenceDS.addPickupListener((PickupListener)pickupListeners.elementAt(i));
}
for (int i = 0; i < silenceListeners.size(); i++) {
silenceDS.addSilenceListener((SilenceListener)silenceListeners.elementAt(i));
}
silenceDS.setSource(out);
silenceDS.addDataSinkListener(this);
silenceDS.start();
player.start();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: update
import javax.media.rtp.event.ReceiveStreamEvent; //导入依赖的package包/类
public void update(ReceiveStreamEvent receiveStreamEvent) {
}