本文整理汇总了Java中org.fourthline.cling.support.model.ProtocolInfos类的典型用法代码示例。如果您正苦于以下问题:Java ProtocolInfos类的具体用法?Java ProtocolInfos怎么用?Java ProtocolInfos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtocolInfos类属于org.fourthline.cling.support.model包,在下文中一共展示了ProtocolInfos类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createServerConnectionManagerService
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
/**
* creates a ConnectionManagerService.
*
* @return the service
*/
@SuppressWarnings("unchecked")
private LocalService<ConnectionManagerService> createServerConnectionManagerService() {
LocalService<ConnectionManagerService> service = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
final ProtocolInfos sourceProtocols = getSourceProtocolInfos();
service.setManager(new DefaultServiceManager<ConnectionManagerService>(service, ConnectionManagerService.class) {
@Override
protected int getLockTimeoutMillis() {
return 1000;
}
@Override
protected ConnectionManagerService createServiceInstance() throws Exception {
return new ConnectionManagerService(sourceProtocols, null);
}
});
return service;
}
示例2: createRendererConnectionManagerService
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
/**
* creates a ConnectionManagerService.
*
* @return the service
*/
@SuppressWarnings("unchecked")
private LocalService<ConnectionManagerService> createRendererConnectionManagerService() {
LocalService<ConnectionManagerService> service = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
final ProtocolInfos sinkProtocols = getSinkProtocolInfos();
service.setManager(new DefaultServiceManager<ConnectionManagerService>(service, ConnectionManagerService.class) {
@Override
protected int getLockTimeoutMillis() {
return 1000;
}
@Override
protected ConnectionManagerService createServiceInstance() throws Exception {
return new ConnectionManagerService(null, sinkProtocols);
}
});
return service;
}
示例3: success
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
@Override
public void success(ActionInvocation invocation) {
try {
ActionArgumentValue sink = invocation.getOutput("Sink");
ActionArgumentValue source = invocation.getOutput("Source");
received(invocation,
sink != null ? new ProtocolInfos(sink.toString()) : null,
source != null ? new ProtocolInfos(source.toString())
: null);
} catch (Exception ex) {
invocation.setFailure(new ActionException(ErrorCode.ACTION_FAILED,
"Can't parse ProtocolInfo response: " + ex, ex));
failure(invocation, null);
}
}
示例4: createProtocolInfos
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
private ProtocolInfos createProtocolInfos() {
ProtocolInfos infos = new ProtocolInfos("http-get:*:audio/mpeg:*");
infos.add(new ProtocolInfo("http-get:*:audio/x-wav:*"));
infos.add(new ProtocolInfo("http-get:*:audio/aac:*"));
infos.add(new ProtocolInfo("http-get:*:image/bmp:*"));
infos.add(new ProtocolInfo("http-get:*:image/jpeg:*"));
infos.add(new ProtocolInfo("http-get:*:image/png:*"));
infos.add(new ProtocolInfo("http-get:*:image/gif:*"));
infos.add(new ProtocolInfo("http-get:*:video/mpeg:*"));
infos.add(new ProtocolInfo("http-get:*:video/mp4:*"));
infos.add(new ProtocolInfo("http-get:*:video/3gpp:*"));
return infos;
}
示例5: ConnectionManagerService
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public ConnectionManagerService(PropertyChangeSupport propertyChangeSupport,
ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo,
ConnectionInfo... activeConnections) {
this.propertyChangeSupport =
propertyChangeSupport == null
? new PropertyChangeSupport(this) : propertyChangeSupport;
this.sourceProtocolInfo = sourceProtocolInfo;
this.sinkProtocolInfo = sinkProtocolInfo;
for (ConnectionInfo activeConnection : activeConnections) {
this.activeConnections.put(activeConnection.getConnectionID(), activeConnection);
}
}
示例6: createMediaServerDevice
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {
String serverName = settingsService.getDlnaServerName();
DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier(serverName));
DeviceType type = new UDADeviceType("MediaServer", 1);
// TODO: DLNACaps
DeviceDetails details = new DeviceDetails(serverName, new ManufacturerDetails(serverName),
new ModelDetails(serverName),
new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);
Icon icon = new Icon("image/png", 512, 512, 32, "logo-512", getClass().getResourceAsStream("logo-512.png"));
LocalService<CustomContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(CustomContentDirectory.class);
contentDirectoryservice.setManager(new DefaultServiceManager<CustomContentDirectory>(contentDirectoryservice) {
@Override
protected CustomContentDirectory createServiceInstance() throws Exception {
return dispatchingContentDirectory;
}
});
final ProtocolInfos protocols = new ProtocolInfos();
for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
if (dlnaProfile == DLNAProfiles.NONE) {
continue;
}
try {
protocols.add(new DLNAProtocolInfo(dlnaProfile));
} catch (Exception e) {
// Silently ignored.
}
}
LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
@Override
protected ConnectionManagerService createServiceInstance() throws Exception {
return new ConnectionManagerService(protocols, null);
}
});
// For compatibility with Microsoft
LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
receiverService.setManager(new DefaultServiceManager<>(receiverService, MSMediaReceiverRegistrarService.class));
return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
}
示例7: testConnectionManagerActionGetProtocolInfoMS
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public void testConnectionManagerActionGetProtocolInfoMS() {
UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_TABLET);
Device<?, ?, ?> device = upnpClient
.getDevice(OPENBIT_TABLET);
Service avservice = getConnectionManagerService(device);
Log.d(getClass().getName(), "Action GetProtocolInfo ");
actionFinished = false;
ActionCallback actionCallback = new GetProtocolInfo(avservice) {
@Override
public void success(ActionInvocation invocation) {
super.success(invocation);
displaySuccess(invocation);
}
@Override
public void failure(ActionInvocation actioninvocation,
UpnpResponse upnpresponse, String s) {
Log.d(getClass().getName(), "Failure UpnpResponse: "
+ upnpresponse);
Log.d(getClass().getName(),
upnpresponse != null? "UpnpResponse: " + upnpresponse.getResponseDetails() : "");
Log.d(getClass().getName(),
"s: " + s);
actionFinished = true;
}
@Override
public void received(ActionInvocation arg0, ProtocolInfos arg1,
ProtocolInfos arg2) {
Log.d(getClass().getName(), "ProtocolInfos 1: " + arg1);
Log.d(getClass().getName(), "ProtocolInfos 2: " + arg2);
}
};
upnpClient.getControlPoint().execute(actionCallback);
waitForActionComplete();
}
示例8: testConnectionManagerActionGetProtocolInfo
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public void testConnectionManagerActionGetProtocolInfo() {
UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_AVTRANSPORT_DEVICE);
Device<?, ?, ?> device = upnpClient
.getDevice(OPENBIT_AVTRANSPORT_DEVICE);
Service avservice = getConnectionManagerService(device);
Log.d(getClass().getName(), "Action GetProtocolInfo ");
actionFinished = false;
ActionCallback actionCallback = new GetProtocolInfo(avservice) {
@Override
public void success(ActionInvocation invocation) {
super.success(invocation);
displaySuccess(invocation);
}
@Override
public void failure(ActionInvocation actioninvocation,
UpnpResponse upnpresponse, String s) {
Log.d(getClass().getName(), "Failure UpnpResponse: "
+ upnpresponse);
Log.d(getClass().getName(),
upnpresponse != null? "UpnpResponse: " + upnpresponse.getResponseDetails() : "");
Log.d(getClass().getName(),
"s: " + s);
actionFinished = true;
}
@Override
public void received(ActionInvocation arg0, ProtocolInfos arg1,
ProtocolInfos arg2) {
Log.d(getClass().getName(), "ProtocolInfos 1: " + arg1);
Log.d(getClass().getName(), "ProtocolInfos 2: " + arg2);
}
};
upnpClient.getControlPoint().execute(actionCallback);
waitForActionComplete();
}
示例9: getSourceProtocolInfos
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
/**
* @return
*/
private ProtocolInfos getSourceProtocolInfos() {
return new ProtocolInfos(
new ProtocolInfo("http-get:*:audio:*"),
new ProtocolInfo("http-get:*:audio/mpeg:*"),
new ProtocolInfo("http-get:*:audio/x-mpegurl:*"),
new ProtocolInfo("http-get:*:audio/x-wav:*"),
new ProtocolInfo("http-get:*:audio/mpeg:DLNA.ORG_PN=MP3"),
new ProtocolInfo("http-get:*:audio/mpeg:DLNA.ORG_PN=MP2"),
new ProtocolInfo("http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE"),
new ProtocolInfo("http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO"),
new ProtocolInfo("http-get:*:audio/x-flac:*"),
new ProtocolInfo("http-get:*:audio/x-aiff:*"),
new ProtocolInfo("http-get:*:audio/x-ogg:*"),
new ProtocolInfo("http-get:*:audio/wav:*"),
new ProtocolInfo("http-get:*:audio/x-ape:*"),
new ProtocolInfo("http-get:*:audio/x-m4a:*"),
new ProtocolInfo("http-get:*:audio/x-m4b:*"),
new ProtocolInfo("http-get:*:audio/x-wavpack:*"),
new ProtocolInfo("http-get:*:audio/x-musepack:*"),
new ProtocolInfo("http-get:*:audio/basic:*"),
new ProtocolInfo("http-get:*:audio/L16;rate=11025;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=22050;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=88200;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=96000;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo("http-get:*:audio/L16;rate=192000;channels=2:DLNA.ORG_PN=LPCM"),
new ProtocolInfo(Protocol.HTTP_GET, ProtocolInfo.WILDCARD, "audio/mpeg", "DLNA.ORG_PN=MP3;DLNA.ORG_OP=01"),
new ProtocolInfo("http-get:*:audio/mpeg:DLNA.ORG_PN=MP3"),
new ProtocolInfo("http-get:*:audio/mpeg:DLNA.ORG_PN=MP3X"),
new ProtocolInfo("http-get:*:audio/x-ms-wma:*"),
new ProtocolInfo("http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE"),
new ProtocolInfo("http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL"),
new ProtocolInfo("http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO"),
new ProtocolInfo("http-get:*:image/gif:*"),
new ProtocolInfo("http-get:*:image/jpeg:*"),
new ProtocolInfo("http-get:*:image/png:*"),
new ProtocolInfo("http-get:*:image/x-ico:*"),
new ProtocolInfo("http-get:*:image/x-ms-bmp:*"),
new ProtocolInfo("http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG"),
new ProtocolInfo("http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED"),
new ProtocolInfo("http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM"),
new ProtocolInfo("http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN"),
new ProtocolInfo("http-get:*:image/x-ycbcr-yuv420:*"),
new ProtocolInfo("http-get:*:video/mp4:*"),
new ProtocolInfo("http-get:*:video/mpeg:*"),
new ProtocolInfo("http-get:*:video/quicktime:*"),
new ProtocolInfo("http-get:*:video/x-flc:*"),
new ProtocolInfo("http-get:*:video/x-msvideo:*"),
new ProtocolInfo(Protocol.HTTP_GET, ProtocolInfo.WILDCARD, "video/mpeg", "DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=01;DLNA.ORG_CI=0"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC_XAC3"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL_XAC3"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_PAL"),
new ProtocolInfo("http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_PAL_XAC3"),
new ProtocolInfo("http-get:*:video/wtv:*"),
new ProtocolInfo("http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L4_SO_G726"),
new ProtocolInfo("http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L5_SO_G726"),
new ProtocolInfo("http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_SP_G726"),
new ProtocolInfo("http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:*"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE"),
new ProtocolInfo("http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3"));
}
示例10: createMediaServerDevice
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {
String serverName = settingsService.getDlnaServerName();
DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier(serverName));
DeviceType type = new UDADeviceType("MediaServer", 1);
// TODO: DLNACaps
Version version = versionService.getLocalVersion();
String versionString = version == null ? null : version.toString();
String licenseEmail = settingsService.getLicenseEmail();
String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);
DeviceDetails details = new DeviceDetails(serverName, new ManufacturerDetails(serverName),
new ModelDetails(serverName, licenseString, versionString),
new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);
Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("subsonic-512.png"));
LocalService<FolderBasedContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(FolderBasedContentDirectory.class);
contentDirectoryservice.setManager(new DefaultServiceManager<FolderBasedContentDirectory>(contentDirectoryservice) {
@Override
protected FolderBasedContentDirectory createServiceInstance() throws Exception {
return folderBasedContentDirectory;
}
});
final ProtocolInfos protocols = new ProtocolInfos();
for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
if (dlnaProfile == DLNAProfiles.NONE) {
continue;
}
try {
protocols.add(new DLNAProtocolInfo(dlnaProfile));
} catch (Exception e) {
// Silently ignored.
}
}
LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
@Override
protected ConnectionManagerService createServiceInstance() throws Exception {
return new ConnectionManagerService(protocols, null);
}
});
// For compatibility with Microsoft
LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
receiverService.setManager(new DefaultServiceManager<MSMediaReceiverRegistrarService>(receiverService, MSMediaReceiverRegistrarService.class));
return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
}
示例11: getSinkProtocolInfo
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public ProtocolInfos getSinkProtocolInfo() {
return super.getSinkProtocolInfo();
}
示例12: AbstractPeeringConnectionManagerService
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
protected AbstractPeeringConnectionManagerService(ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo,
ConnectionInfo... activeConnections) {
super(sourceProtocolInfo, sinkProtocolInfo, activeConnections);
}
示例13: getSourceProtocolInfo
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
synchronized public ProtocolInfos getSourceProtocolInfo() {
return sourceProtocolInfo;
}
示例14: getSinkProtocolInfo
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
synchronized public ProtocolInfos getSinkProtocolInfo() {
return sinkProtocolInfo;
}
示例15: received
import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public abstract void received(ActionInvocation actionInvocation,
ProtocolInfos sinkProtocolInfos, ProtocolInfos sourceProtocolInfos);