Examples of AzureusContentFile


Examples of com.aelitis.azureus.core.content.AzureusContentFile

    }
   
    try{
      TranscodeFileImpl transcode_file = allocateFile( profile, false, source, false );
     
      AzureusContentFile acf = (AzureusContentFile)transcode_file.getTransientProperty( UPNPAV_FILE_KEY );

      if ( acf != null ){
       
        return;
      }
     
      final String tf_key = transcode_file.getKey();

      synchronized( acf_map ){
       
        acf = acf_map.get( tf_key );
      }
     
      if ( acf != null ){
       
        return;
      }
     
      final DiskManagerFileInfo stream_file =
        new DiskManagerFileInfoStream(
          new DiskManagerFileInfoStream.StreamFactory()
          {
            private List<Object>  current_requests = new ArrayList<Object>();
           
            public StreamDetails
            getStream(
              Object    request )
           
              throws IOException
            {           
              try{
                TranscodeJobImpl job = getManager().getTranscodeManager().getQueue().add(
                    (TranscodeTarget)DeviceUPnPImpl.this,
                    profile,
                    source,
                    false,
                    true,
                    TranscodeTarget.TRANSCODE_UNKNOWN );
                 
                synchronized( this ){
               
                  current_requests.add( request );
                }
               
                while( true ){
                 
                  InputStream is = job.getStream( 1000 );
                 
                  if ( is != null ){
                   
                    return( new StreamWrapper( is, job ));
                  }
                 
                  int  state = job.getState();
                 
                  if ( state == TranscodeJobImpl.ST_FAILED ){
                   
                    throw( new IOException( "Transcode failed: " + job.getError()));
                   
                  }else if ( state == TranscodeJobImpl.ST_CANCELLED ){
                   
                    throw( new IOException( "Transcode failed: job cancelled" ));
 
                  }else if ( state == TranscodeJobImpl.ST_COMPLETE ){
                   
                    throw( new IOException( "Job complete but no stream!" ));
                  }
                 
                  synchronized( this ){
                   
                    if ( !current_requests.contains( request )){
                     
                      break;
                    }
                  }
                 
                  System.out.println( "waiting for stream" );
                 
                }
               
                IOException error = new IOException( "Stream request cancelled" );
               
                job.failed( error );
               
                throw( error );
               
              }catch( IOException e ){
               
                throw( e );
               
              }catch( Throwable e ){
               
                throw( new IOException( "Failed to add transcode job: " + Debug.getNestedExceptionMessage(e)));
               
              }finally{
               
                synchronized( this ){
               
                  current_requests.remove( request );
                }
              }
            }
           
            public void
            destroyed(
              Object request )
            {
              synchronized( this ){
               
                current_requests.remove( request );
              }
            }
          },
          transcode_file.getCacheFile());
                   
      acf =  new AzureusContentFile()
          { 
               public DiskManagerFileInfo
               getFile()
               {
                 return( stream_file );
View Full Code Here

Examples of com.aelitis.azureus.core.content.AzureusContentFile

        // if the file completed transcoding then we leave the result around for
        // the user to re-use
     
      if ( transcode_file != null && !transcode_file.isComplete()){
       
        AzureusContentFile acf = null;
       
        synchronized( this ){
 
          if ( dynamic_xcode_map != null ){
         
View Full Code Here

Examples of com.aelitis.azureus.core.content.AzureusContentFile

      return( transcode_file.isComplete());
    }
   
    final String tf_key = transcode_file.getKey();

    AzureusContentFile  acf;
   
    synchronized( acf_map ){
     
      acf = acf_map.get( tf_key );
    }
   
    if ( acf != null ){
     
      return( true );
    }
   
    IPCInterface      ipc  = upnpav_ipc;

    if ( ipc == null ){
     
      return( false );
    }
   
    if ( transcode_file.getDurationMillis() == 0 ){
     
      return( false );
    }
   
    try{
      final DiskManagerFileInfo stream_file =
        new TranscodeJobOutputLeecher( job, transcode_file );
                   
      acf =  new AzureusContentFile()
          { 
               public DiskManagerFileInfo
               getFile()
               {
                 return( stream_file );
View Full Code Here

Examples of com.aelitis.azureus.core.content.AzureusContentFile

        syncCategories( transcode_file, _new_file );

        return;
      }
     
      AzureusContentFile acf = (AzureusContentFile)transcode_file.getTransientProperty( UPNPAV_FILE_KEY );
     
      if ( acf != null ){
       
        return;
      }

      final String tf_key  = transcode_file.getKey();

      synchronized( acf_map ){
       
        acf = acf_map.get( tf_key );
      }
     
      if ( acf != null ){
       
        return;
      }

      try{
        final DiskManagerFileInfo   f     = transcode_file.getTargetFile();
             
        acf =
          new AzureusContentFile()
          {
            public DiskManagerFileInfo
              getFile()
            {
              return( f );
View Full Code Here

Examples of com.aelitis.azureus.core.content.AzureusContentFile

   
    if ( type == TranscodeTargetListener.CT_PROPERTY ){
     
      if ( data == TranscodeFile.PT_CATEGORY ){
       
        AzureusContentFile  acf;
       
        synchronized( acf_map ){
       
          acf = acf_map.get(((TranscodeFileImpl)file).getKey());
        }
View Full Code Here

Examples of com.aelitis.azureus.core.content.AzureusContentFile

      return;
    }

    synchronized( this ){

      AzureusContentFile acf = (AzureusContentFile)file.getTransientProperty( UPNPAV_FILE_KEY );

      if ( acf == null ){
   
        return;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.