octoshape.osa2
Class StreamPusher

java.lang.Object
  extended by octoshape.osa2.StreamSuperClass
      extended by octoshape.osa2.StreamPusher

public final class StreamPusher
extends StreamSuperClass

Represents a class which is able to push a stream into the Octoshape system.

A new StreamPusher object can be obtained from the OctoshapeSystem object.

Pushing will be done using the Octoshape client.

After construction set options using setOctolinkOption(String, String) and setMediaSourceUrlOption(String, String), if necessary, and then call call initialize() to begin pushing.

Note that pushing will only begin if the OctoshapeSystem object has a connection to the Octoshape client. Calling initialize() at a time when the OctoshapeSystem does not have such a connection, will set the StreamPusher is waiting position, and it will then proceed as soon as a connection is obtained.

Use the requestPushStatus(PushStatusListener) method to get information about the status of the pushing.

Note that the StreamPusher object does not report problems in the same way that the StreamPlayer does. The only way to obtain information about if the pushing is working, is by using the requestPushStatus(PushStatusListener) method.

Note that the Octoshape client must be set up to allow pushing (trust xml setting).


Field Summary
 
Fields inherited from class octoshape.osa2.StreamSuperClass
STATUS_CLOSED, STATUS_INITIALIZING, STATUS_READY, STATUS_UNINITIALIZED
 
Method Summary
 java.lang.String getOctolink()
          Gets the octolink set in the constructor.
 void initialize()
          Will begin initialization of the StreamPusher.
 void requestPushStatus(PushStatusListener listener)
          Request push status.
 void setMediaSourceUrlOption(java.lang.String option, java.lang.String value)
          Setting arbitrary low-level Option for the media server supplying the stream.
 void setOctolinkOption(java.lang.String option, java.lang.String value)
          Setting arbitrary low-level OctosLink option.
 java.lang.String toString()
           
 
Methods inherited from class octoshape.osa2.StreamSuperClass
close, getStatus, setProgressListener, setStatusChangedListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

initialize

public void initialize()
Will begin initialization of the StreamPusher.

Should be called after setting options.

Note that it should not be necessary to call this more than once. If pushing could not be done (perhaps because we could not get data from the media source URL, or any other problem), then the StreamPusher will try to set everything up again after a few seconds. I.e. the StreamPusher has an internal loop where it repeatedly tries to re-set up the pushing if it is not working. To stop this loop use the StreamSuperClass.close(Runnable) method.

The requestPushStatus(PushStatusListener) method will report in the text description when a re-setup is scheduled to occur.

Note that if the open method of the OctoshapeSystem has not been called, then the initialization can not proceed. In this case the status will go to STATUS_INITIALIZING, but nothing further will happen until the OctoshapeSystem is opened, then the initialization will continue.


getOctolink

public java.lang.String getOctolink()
Gets the octolink set in the constructor.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

requestPushStatus

public void requestPushStatus(PushStatusListener listener)
Request push status.

Parameters:
listener - The listener that will be called with the status result.

setOctolinkOption

public void setOctolinkOption(java.lang.String option,
                              java.lang.String value)
Setting arbitrary low-level OctosLink option.

Note that this method must be called before calling initialize(), for instance immediately after construction.

This method should not be used unless explicitly being told to do by an Octoshape developer. If an unknown option is set, or the value of a known option is not given in correct format, the session may close and pushing may not be possible.

Parameters:
option -
value -

setMediaSourceUrlOption

public void setMediaSourceUrlOption(java.lang.String option,
                                    java.lang.String value)
Setting arbitrary low-level Option for the media server supplying the stream.

Note that this method must be called before calling initialize(), for instance immediately after construction.

This method should not be used unless explicitly being told to do by an Octoshape developer. If an unknown option is set, or the value of a known option is not given in correct format, the session may close and pushing may not be possible.

Parameters:
option -
value -