Package org.red5.server.api.stream

Examples of org.red5.server.api.stream.IStreamFilenameGenerator


          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         
          HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
          messageObj.put(0, "kick");
         
          this.scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
View Full Code Here


    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

  /** {@inheritDoc} */
  public void saveAs(String name, boolean isAppend) throws IOException, ResourceNotFoundException, ResourceExistException {
    try {
      IScope scope = getScope();
      IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);

      String filename = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
      Resource res = scope.getContext().getResource(filename);
      if (!isAppend) {
        if (res.exists()) {
          // Per livedoc of FCS/FMS:
          // When "live" or "record" is used,
View Full Code Here

   * @param name
   * @return file
   */
  public static File getRecordFile(IScope scope, String name) {
    // get stream filename generator
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, DefaultStreamFilenameGenerator.class);
    // generate filename
    String fileName = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
    File file = null;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(fileName);
    } else {
      Resource resource = scope.getContext().getResource(fileName);
      if (resource.exists()) {
        try {
View Full Code Here

        name = service.prepareFilename(name);
        break;
      }
    }
    // look for a custom filename gen class
    IStreamFilenameGenerator filenameGenerator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class,
        DefaultStreamFilenameGenerator.class);
    // get the filename
    String filename = filenameGenerator.generateFilename(scope, name, GenerationType.PLAYBACK);
    File file;
    try {
      // most likely case first
      if (!filenameGenerator.resolvesToAbsolutePath()) {
        try {
          file = scope.getContext().getResource(filename).getFile();
        } catch (FileNotFoundException e) {
          log.debug("File {} not found, nulling it", filename);
          file = null;
View Full Code Here

        name = service.prepareFilename(name);
        break;
      }
    }

    IStreamFilenameGenerator filenameGenerator = (IStreamFilenameGenerator) ScopeUtils.getScopeService(scope, IStreamFilenameGenerator.class, ExternalStreamFilenameGenerator.class);

    String filename = filenameGenerator.generateFilename(scope, name, GenerationType.PLAYBACK);
    File file;
    if (filenameGenerator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    return file;
View Full Code Here

      // TODO: throw other exception here?
      throw new IOException("stream is no longer connected");
    }
    IScope scope = conn.getScope();
    // Get stream filename generator
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
        .getScopeService(scope, IStreamFilenameGenerator.class,
            DefaultStreamFilenameGenerator.class);

    // Generate filename
    String filename = generator.generateFilename(scope, name, ".flv",
        GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    // If append mode is on...
View Full Code Here

  /** {@inheritDoc} */
  public void saveAs(String name, boolean isAppend) throws IOException,
      ResourceNotFoundException, ResourceExistException {
    try {
    IScope scope = getScope();
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
    .getScopeService(scope, IStreamFilenameGenerator.class,
        DefaultStreamFilenameGenerator.class);
   
    String filename = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    if (!isAppend) {
View Full Code Here

      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);
         
View Full Code Here

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
View Full Code Here

TOP

Related Classes of org.red5.server.api.stream.IStreamFilenameGenerator

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.