• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ProtocolInfos类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.fourthline.cling.support.model.ProtocolInfos的典型用法代码示例。如果您正苦于以下问题:Java ProtocolInfos类的具体用法?Java ProtocolInfos怎么用?Java ProtocolInfos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProtocolInfos类属于org.fourthline.cling.support.model包,在下文中一共展示了ProtocolInfos类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:26,代码来源:YaaccUpnpServerService.java


示例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;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:25,代码来源:YaaccUpnpServerService.java


示例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);
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:18,代码来源:GetProtocolInfo.java


示例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;
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:14,代码来源:MediaServer.java


示例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);
    }
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:15,代码来源:ConnectionManagerService.java


示例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});
    }
 
开发者ID:airsonic,项目名称:airsonic,代码行数:50,代码来源:UPnPService.java


示例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();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:44,代码来源:OpenbitTestCases.java


示例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();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:44,代码来源:OpenbitTestCases.java


示例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"));
	
	
	
	
	
	
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:82,代码来源:YaaccUpnpServerService.java


示例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});
    }
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:54,代码来源:UPnPService.java


示例11: getSinkProtocolInfo

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public ProtocolInfos getSinkProtocolInfo() {
	return super.getSinkProtocolInfo();
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:4,代码来源:ConnectionService.java


示例12: AbstractPeeringConnectionManagerService

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
protected AbstractPeeringConnectionManagerService(ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo,
                                                  ConnectionInfo... activeConnections) {
    super(sourceProtocolInfo, sinkProtocolInfo, activeConnections);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:5,代码来源:AbstractPeeringConnectionManagerService.java


示例13: getSourceProtocolInfo

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
synchronized public ProtocolInfos getSourceProtocolInfo() {
    return sourceProtocolInfo;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:ConnectionManagerService.java


示例14: getSinkProtocolInfo

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
synchronized public ProtocolInfos getSinkProtocolInfo() {
    return sinkProtocolInfo;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:ConnectionManagerService.java


示例15: received

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public abstract void received(ActionInvocation actionInvocation,
ProtocolInfos sinkProtocolInfos, ProtocolInfos sourceProtocolInfos);
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:3,代码来源:GetProtocolInfo.java


示例16: received

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
public void received(ActionInvocation paramActionInvocation,
		ProtocolInfos paramProtocolInfos1, ProtocolInfos paramProtocolInfos2) {
	this.handler.sendEmptyMessage(DMCControlMessage.CONNECTIONSUCESSED);
	// TODO

}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:7,代码来源:GetProtocolInfoCallback.java


示例17: createMediaServerDevice

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("FutureSonic"));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("FutureSonic Media Streamer", new ManufacturerDetails("FutureSonic"),
                new ModelDetails("FutureSonic", licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("futuresonic-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});
    }
 
开发者ID:FutureSonic,项目名称:FutureSonic-Server,代码行数:53,代码来源:UPnPService.java


示例18: 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 = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("Madsonic Media Streamer", 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("madsonic-512.png"));

        @SuppressWarnings("unchecked")
		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.
            }
        }

        @SuppressWarnings("unchecked")
		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
        @SuppressWarnings("unchecked")
		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});
    }
 
开发者ID:MadMarty,项目名称:madsonic-server-5.1,代码行数:57,代码来源:UPnPService.java


示例19: createMediaServerDevice

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("Madsonic"));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("Madsonic Media Streamer", new ManufacturerDetails("Madsonic"),
                new ModelDetails("Madsonic", licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("madsonic-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});
    }
 
开发者ID:MadMarty,项目名称:madsonic-server-5.0,代码行数:53,代码来源:UPnPService.java


示例20: PeeringConnectionManager

import org.fourthline.cling.support.model.ProtocolInfos; //导入依赖的package包/类
PeeringConnectionManager(ProtocolInfos sourceProtocolInfo, ProtocolInfos sinkProtocolInfo) {
	super(sourceProtocolInfo, sinkProtocolInfo);
}
 
开发者ID:trishika,项目名称:DroidUPnP,代码行数:4,代码来源:PeeringConnectionManager.java



注:本文中的org.fourthline.cling.support.model.ProtocolInfos类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DistCpOptionSwitch类代码示例发布时间:2022-05-22
下一篇:
Java CloseCode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap