de.humatic.dsj.sink
Class WMNetSink

java.lang.Object
  extended by de.humatic.dsj.sink.Sink
      extended by de.humatic.dsj.sink.NetworkSink
          extended by de.humatic.dsj.sink.WMSink
              extended by de.humatic.dsj.sink.WMNetSink

public class WMNetSink
extends WMSink

WMNetSink may be used to stream any DSFiltergraph's data to the network using the same pseudo mms over http mechanisms that Windows Media Encoder uses.
To receive the stream connect to %localPort on the computer this sink is running on by specifing a url like http://machineThatStreams:8080/anyFilename.asf in DSMovie constructors or in WindowsMedia Player.
The maximum number of clients is 50. For bigger WindowsMedia streaming projects you need to use the WMPushSink and a WindowsMedia server.
Quality and bitrate of the stream are controlled by the supplied WindowsMedia profile. If this is null dsj will try to choose reasonable defaults. When supplying your own profile take into account that the number of streams in the profile must match those of the source, i.e. when you want to stream an audio file you must supply an audio only profile. Note that the WindowsMedia components used here are not optimized for low latency, and thus are not really suitable for audio/video conferencing applications.


Field Summary
 
Fields inherited from class de.humatic.dsj.sink.NetworkSink
DSHOW, WM_NET, WM_PUSH
 
Fields inherited from class de.humatic.dsj.sink.Sink
connected, CONTROLABLE, DISPLAY_LOCAL, DS_NETWORK, DUAL_OUTPUT, DUMP, FILE, flags, FORCE_PREVIEW_BRANCH, LOCAL, majorType, NO_CONTROLS, NO_TRANSCODE, PLAY_OUT, PREVIEW, SHOW_DIALOGS, SHOW_DLG_SAVE, subType, WM_NETWORK
 
Constructor Summary
WMNetSink(DSFiltergraph graph, int localPort, DSFilterInfo profile, boolean displayLocal)
           
 
Method Summary
 void addAccessEntry(boolean allow, java.net.InetAddress address, java.net.InetAddress mask)
          Governs access rights for client connections.
 void clearAccessControlList()
          Clears all entries previously added to the access control list.
 java.lang.String getClientAddress(int cIndex)
          Returns a String containing IP and port (exp: "192.168.0.1:4050") of the client at cIndex (0 based) or null if there is no client at the given index..
 int getClientCount()
          Returns the number of clients currently connected to this sink.
 void setMaxClients(int mc)
          Limits the number of clients that can connect to this sink.
 
Methods inherited from class de.humatic.dsj.sink.WMSink
close, getLocalAddress, getPort, getProfile, start
 
Methods inherited from class de.humatic.dsj.sink.NetworkSink
fromXML, getStreamWriterInfo, setStreamWriter, toString
 
Methods inherited from class de.humatic.dsj.sink.Sink
getAudioEncoderInfo, getFlags, getMultiplexerInfo, getOutputPath, getVideoEncoderInfo, getWriterInfo, setAudioEncoder, setFlags, setMultiplexer, setVideoEncoder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WMNetSink

public WMNetSink(DSFiltergraph graph,
                 int localPort,
                 DSFilterInfo profile,
                 boolean displayLocal)
Method Detail

setMaxClients

public void setMaxClients(int mc)
                   throws DSJException
Limits the number of clients that can connect to this sink. The default is 5, maximum is 50.
This method must be called before connecting the sink.

Throws:
DSJException

addAccessEntry

public void addAccessEntry(boolean allow,
                           java.net.InetAddress address,
                           java.net.InetAddress mask)
                    throws DSJException
Governs access rights for client connections. By default no limitations are imposed.
This method may be called multiple times to grant / deny access for multiple IP ranges.
Both IPv4 and IPv6 addresses are allowed, but address and mask must both be of either type.
The mask parameter defines which bits in %address are checked on connection. For example if address is 192.168.0.1 and mask is 255.255.255.0 then only the highest 24 bits would be examined, leading to all IPs between 192.168.0.1 and 192.168.0.255 being granted or denied access according to the boolean parameter.
This method must only be called after the sink has been connected.

Throws:
DSJException

clearAccessControlList

public void clearAccessControlList()
                            throws DSJException
Clears all entries previously added to the access control list.

Throws:
DSJException

getClientCount

public int getClientCount()
Returns the number of clients currently connected to this sink.


getClientAddress

public java.lang.String getClientAddress(int cIndex)
Returns a String containing IP and port (exp: "192.168.0.1:4050") of the client at cIndex (0 based) or null if there is no client at the given index..