Class ClientBroadcastStream

    • Field Detail

      • automaticRecording

        protected boolean automaticRecording
        Whether or not to automatically record the associated stream.
      • bytesReceived

        protected volatile long bytesReceived
        Total number of bytes received.
      • checkVideoCodec

        protected volatile boolean checkVideoCodec
        Is there need to check video codec?
      • checkAudioCodec

        protected volatile boolean checkAudioCodec
        Is there need to check audio codec?
      • chunkSize

        protected int chunkSize
        Data is sent by chunks, each of them has size
      • closed

        protected AtomicBoolean closed
        Is this stream still active?
      • connMsgOut

        protected transient IMessageOutput connMsgOut
        Output endpoint that providers use
      • firstPacketTime

        protected long firstPacketTime
        Stores timestamp of first packet
      • livePipe

        protected transient IPipe livePipe
        Pipe for live streaming
      • publishedName

        protected String publishedName
        Stream published name
      • parameters

        protected Map<String,​String> parameters
        Streaming parameters
      • sendStartNotification

        protected boolean sendStartNotification
        Is there need to send start notification?
      • listeners

        protected transient Set<IStreamListener> listeners
        Listeners to get notified about received packets.
      • latestTimeStamp

        protected volatile long latestTimeStamp
      • registerJMX

        protected boolean registerJMX
        Whether or not to register with JMX.
      • localAliases

        protected static CopyOnWriteArraySet<String> localAliases
        Stream name aliases for the entire server instance.
      • nameAlias

        protected String nameAlias
        Publish alias for the stream name.
    • Constructor Detail

      • ClientBroadcastStream

        public ClientBroadcastStream()
    • Method Detail

      • checkSendNotifications

        protected void checkSendNotifications​(IEvent event)
        Check and send notification if necessary
        Parameters:
        event - Event
      • close

        public void close()
        Closes stream, unsubscribes provides, sends stoppage notifications and broadcast close notification.
        Specified by:
        close in interface ClientBroadcastStreamMXBean
        Specified by:
        close in interface IStream
      • dispatchEvent

        public void dispatchEvent​(IEvent event)
        Dispatches event
        Specified by:
        dispatchEvent in interface IEventDispatcher
        Parameters:
        event - Event to dispatch
      • getCurrentTimestamp

        public int getCurrentTimestamp()
        Return the currently active timestamp inside the stream.
        Specified by:
        getCurrentTimestamp in interface IStreamStatistics
        Returns:
        the timestamp in milliseconds
      • isAutomaticRecording

        public boolean isAutomaticRecording()
        Returns:
        the automaticRecording
      • setAutomaticRecording

        public void setAutomaticRecording​(boolean automaticRecording)
        Parameters:
        automaticRecording - the automaticRecording to set
      • setRegisterJMX

        public void setRegisterJMX​(boolean registerJMX)
        Parameters:
        registerJMX - the registerJMX to set
      • notifyBroadcastClose

        protected void notifyBroadcastClose()
        Notifies handler on stream broadcast close
      • notifyRecordingStop

        protected void notifyRecordingStop()
        Notifies handler on stream recording stop
      • notifyBroadcastStart

        protected void notifyBroadcastStart()
        Notifies handler on stream broadcast start
      • notifyChunkSize

        protected void notifyChunkSize()
        Send OOB control message with chunk size
      • sendPublishStartNotify

        protected void sendPublishStartNotify()
        Sends publish start notifications
      • sendPublishStopNotify

        protected void sendPublishStopNotify()
        Sends publish stop notifications
      • sendRecordFailedNotify

        protected void sendRecordFailedNotify​(String reason)
        Sends record failed notifications
      • sendRecordStartNotify

        protected void sendRecordStartNotify()
        Sends record start notifications
      • sendRecordStopNotify

        protected void sendRecordStopNotify()
        Sends record stop notifications
      • pushMessage

        protected void pushMessage​(StatusMessage msg)
        Pushes a message out to a consumer.
        Parameters:
        msg - StatusMessage
      • sendStartNotifications

        protected void sendStartNotifications​(IEventListener source)
      • stopRecording

        public void stopRecording()
        Stops any currently active recording.
      • isRecording

        public boolean isRecording()
      • addStreamListener

        public void addStreamListener​(IStreamListener listener)
        Add a listener to be notified about received packets.
        Specified by:
        addStreamListener in interface IBroadcastStream
        Parameters:
        listener - the listener to add
      • removeStreamListener

        public void removeStreamListener​(IStreamListener listener)
        Remove a listener from being notified about received packets.
        Specified by:
        removeStreamListener in interface IBroadcastStream
        Parameters:
        listener - the listener to remove
      • getRecordFile

        protected File getRecordFile​(IScope scope,
                                     String name)
        Get the file we'd be recording to based on scope and given name.
        Parameters:
        scope - scope
        name - record name
        Returns:
        file
      • registerJMX

        protected void registerJMX()
      • unregisterJMX

        protected void unregisterJMX()
      • hasAlias

        public boolean hasAlias()
        Description copied from interface: IClientBroadcastStream
        Returns whether or not an subscribe-side alias for this stream exists.
        Specified by:
        hasAlias in interface IClientBroadcastStream
        Returns:
        true if an alias has been added and false otherwise
      • setNameAlias

        public void setNameAlias​(String nameAlias)
        Description copied from interface: IClientBroadcastStream
        Sets the publish-side alias for the streams name. Subsequent calls will replace an existing alias if already set.
        Specified by:
        setNameAlias in interface IClientBroadcastStream
        Parameters:
        nameAlias - alias to set for the streams name or null to clear it
      • aliasRegistered

        public boolean aliasRegistered​(String alias)
        Description copied from interface: IClientBroadcastStream
        Returns whether or not an alias is in-use / registered already; this includes both publish and subscribe aliases within a server instance.
        Specified by:
        aliasRegistered in interface IClientBroadcastStream
        Parameters:
        alias - the name to check against publish and subscribe aliases
        Returns:
        true if registered and false otherwise