Package org.red5.server.stream

Examples of org.red5.server.stream.IProviderService


      log.debug("Name of CLient and Stream to be recorded: "+broadcastid);   
      //log.debug("Application.getInstance()"+Application.getInstance());
      log.debug("Scope "+conn);
      log.debug("Scope "+conn.getScope());
      // Get a reference to the current broadcast stream.
      ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance()
          .getBroadcastStream(conn.getScope(), broadcastid);
   
     
      // Save the stream to disk.
      if (isScreenData) {
        stream.addStreamListener(new StreamScreenListener(streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
      } else {
          
        log.debug("### stream "+stream);
        log.debug("### streamName "+streamName);
        log.debug("### conn.getScope() "+conn.getScope());
        log.debug("### flvRecordingMetaDataId "+flvRecordingMetaDataId);
        log.debug("### isScreenData "+isScreenData);
        log.debug("### isInterview "+isInterview);
       
        if (isInterview) {
         
          //Additionally record the Video Signal
          stream.addStreamListener(new StreamScreenListener("AV_"+streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
        }
       
        stream.addStreamListener(new StreamAudioListener(streamName, conn.getScope(), flvRecordingMetaDataId, isScreenData, isInterview));
      }
      //Just for Debug Purpose
      //stream.saveAs(streamName+"_DEBUG", false);
    } catch (Exception e) {
      log.error("Error while saving stream: " + streamName, e);
View Full Code Here


     
      if (streamToClose == null) {
        log.debug("Could not aquire Stream, maybe already closed");
      }
     
      ClientBroadcastStream stream = (ClientBroadcastStream) streamToClose;
      // Stop recording.
      stream.stopRecording();
     
    } catch (Exception err) {
      log.error("[stopRecordingShow]",err);
    }
  }
View Full Code Here

     
      if (streamToClose == null) {
        log.debug("Could not aquire Stream, maybe already closed");
      }
     
      ClientBroadcastStream stream = (ClientBroadcastStream) streamToClose;

      if (stream.getStreamListeners() != null) {
       
        for (Iterator<IStreamListener> iter = stream.getStreamListeners().iterator();iter.hasNext();) {
         
          IStreamListener iStreamListener = iter.next();
         
          ListenerAdapter listenerAdapter = (ListenerAdapter) iStreamListener;
         
          log.debug("Stream Closing ?? "+listenerAdapter.getFlvRecordingMetaDataId()+ " " +flvRecordingMetaDataId);
         
          if (listenerAdapter.getFlvRecordingMetaDataId().equals(flvRecordingMetaDataId)) {
            log.debug("Stream Closing :: "+flvRecordingMetaDataId);
            listenerAdapter.closeStream();
          }
         
        }
       
        for (IStreamListener iStreamListener : stream.getStreamListeners()) {
          stream.removeStreamListener(iStreamListener);
        }
     
      }
     
      // Just for Debugging
View Full Code Here

    log.debug("Name of CLient and Stream to be recorded: "+broadcastid);   
    //log.debug("Application.getInstance()"+Application.getInstance());
    log.debug("Scope "+conn);
    log.debug("Scope "+conn.getScope());
    // Get a reference to the current broadcast stream.
    ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance()
        .getBroadcastStream(conn.getScope(), Long.valueOf(broadcastid).toString());
    try {
      // Save the stream to disk.
      stream.saveAs(streamName, false);
    } catch (Exception e) {
      log.error("Error while saving stream: " + streamName, e);
    }
  }
View Full Code Here

   * @param conn
   */
  public static void stopRecordingShow(IConnection conn, long broadcastId) throws Exception {
    log.debug("** stopRecordingShow: "+conn);
    log.debug("### Stop recording show for broadcastId: "+ broadcastId + " || " + conn.getScope().getContextPath());
    ClientBroadcastStream stream = (ClientBroadcastStream) ScopeApplicationAdapter.getInstance().
                        getBroadcastStream(conn.getScope(), Long.valueOf(broadcastId).toString());
    // Stop recording.
    stream.stopRecording();
  }
View Full Code Here

  /* Wrapper around the stream interfaces */

  /** {@inheritDoc} */
  public boolean hasBroadcastStream(IScope scope, String name) {
    IProviderService service = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    return (service.getLiveProviderInput(scope, name, false) != null);
  }
View Full Code Here

   * @param scope
   *            Scope to retrieve broadcasted stream names
   * @return List of broadcasted stream names.
   */
  public Set<String> getBroadcastStreamNames(IScope scope) {
    IProviderService service = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    return service.getBroadcastStreamNames(scope);
  }
View Full Code Here

   *
   * @return <code>true</code> if scope has VOD stream with given name,
   *         <code>false</code> otherwise.
   */
  public boolean hasOnDemandStream(IScope scope, String name) {
    IProviderService service = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    IMessageInput msgIn = service.getVODProviderInput(scope, name);
    if (msgIn instanceof AbstractPipe) {
      ((AbstractPipe) msgIn).close();
    }
    return (msgIn != null);
  }
View Full Code Here

   *            Stream name
   * @return Stream length in seconds (?)
   */
  public double getStreamLength(String name) {
    double duration = 0;
    IProviderService provider = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    File file = provider.getVODProviderFile(scope, name);
    if (file != null && file.canRead()) {
      IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
      IStreamableFileService service = factory.getService(file);
      if (service != null) {
        ITagReader reader = null;
View Full Code Here

      long playItemSize = -1;
      String playItemName = "";
      if (item != null) {
        playItemName = item.getName();
        //get file size in bytes if available
        IProviderService providerService = (IProviderService) scope.getContext().getBean(IProviderService.BEAN_NAME);
        if (providerService != null) {
          File file = providerService.getVODProviderFile(scope, playItemName);
          if (file != null) {
            playItemSize = file.length();
          } else {
            log.debug("File was null, this is ok for live streams");
          }
View Full Code Here

TOP

Related Classes of org.red5.server.stream.IProviderService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.