我在玩 jitsi。得到了示例形式的源代码。我稍微修改了一下。这是我所拥有的。我正在尝试在 ffplay 或任何其他播放器的 VLC 中播放传输的流,但我不能。
我使用这些应用程序参数来运行代码:
--local-port-base=5000 --remote-host=localhost --remote-port-base=10000
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
package com.company;
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
import org.jitsi.service.libjitsi.LibJitsi;
import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.device.MediaDevice;
import org.jitsi.service.neomedia.format.MediaFormat;
import org.jitsi.service.neomedia.format.MediaFormatFactory;
import java.io.PrintStream;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
/**
* Implements an example application in the fashion of JMF's AVTransmit2 example
* which demonstrates the use of the …Run Code Online (Sandbox Code Playgroud) 我试图在OS X 10.10上以编程方式配置代理.scutil --proxy显示正确的设置,系统实际使用它们,但新的设置不会出现在网络首选项的代理选项卡上(在系统偏好设置中).
SCDynamicStoreRef dynamicStore = SCDynamicStoreCreate(NULL, CFSTR(APP_NAME), NULL, NULL);
CFDictionaryRef ipv4key = SCDynamicStoreCopyValue(dynamicStore, CFSTR("State:/Network/Global/IPv4"));
CFStringRef primaryServiceId = CFDictionaryGetValue(ipv4key, CFSTR("PrimaryService"));
CFStringRef primaryServicePath = CFStringCreateWithFormat(NULL, NULL, CFSTR("Setup:/Network/Service/%@/Proxies"), primaryServiceId);
CFDictionaryRef proxySettings = SCDynamicStoreCopyValue(dynamicStore, primaryServicePath);
//clone currnt values for update new values
CFMutableDictionaryRef mutableProxySettings = CFDictionaryCreateMutableCopy(NULL, 0, proxySettings);
Run Code Online (Sandbox Code Playgroud)
然后为每个值我做CFStringRef host = ...;
CFDictionaryReplaceValue(mutableProxySettings, kSCPropNetProxiesHTTPProxy, host);
Run Code Online (Sandbox Code Playgroud)
然后
Boolean success = SCDynamicStoreSetValue(dynamicStore, primaryServicePath, mutableProxySettings);
Run Code Online (Sandbox Code Playgroud)
设置已更新,但未显示在代理选项卡上如何使它们出现在那里?