Examples of DiskManagerFileInfo


Examples of org.gudy.azureus2.core3.disk.DiskManagerFileInfo

         
    long  offset = 0;
   
    for (int i=0;i<files.length;i++){
     
      DiskManagerFileInfo f = files[i];
             
      enhanced_files[i] = new EnhancedDownloadManagerFile( f, offset );
     
      offset += f.getLength();
    }
   
   
    int primary_index = PlayUtils.getPrimaryFileIndex( download_manager );
   
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

           
            download = (Download)obj;
           
          }else{
           
            DiskManagerFileInfo file = (DiskManagerFileInfo)obj;
           
            try{
              download  = file.getDownload();
             
            }catch( DownloadException e ){ 
             
              Debug.printStackTrace(e);
             
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

                   
                    long  total_time = (eta*100 )/(100-last_percent);
                   
                    long   total_write = total_time*write_speed;
                   
                    DiskManagerFileInfo file = job.getFile();
                   
                    long  length = file.getLength();

                    if ( length > 0 ){

                      double over_write = ((double)total_write)/length;
                   
                      if ( over_write > 5.0 ){
                         
                        failed( new TranscodeException( "Overwrite limit exceeded, abandoning transcode" ));
                         
                        provider_job[0].cancel();   
                      }
                    } 
                  }
                }else{
                 
                  eta_samples = 0;
                }
              }
            }
           
            public void
            failed(
              TranscodeException    e )
            {
              if ( error[0] == null ){
             
                error[0] = e;
              }
             
              xcode_sem.release();
            }
           
            public void
            complete()
            {
              xcode_sem.release();
            }
          };
       
        boolean  direct_input = job.useDirectInput();
         
        if ( job.isStream()){
         
          /*
          provider_job[0] =
            provider.transcode(
              adapter,
              job.getFile(),
              profile,
              new File( "C:\\temp\\arse").toURI().toURL());
          */
         
          pipe = new TranscodePipeStreamSource2(
                new TranscodePipeStreamSource2.streamListener()
                {
                  public void
                  gotStream(
                    InputStream is )
                  {
                    job.setStream( is );
                  }
                });
         
          provider_job[0] =
            provider.transcode(
              xcode_adapter,
              provider_analysis,
              direct_input,
              job.getFile(),
              profile,
              new URL( "tcp://127.0.0.1:" + pipe.getPort()));
 
        }else{
                   
          File output_file = transcode_file.getCacheFile();
         
          provider_job[0] =
            provider.transcode(
              xcode_adapter,
              provider_analysis,
              direct_input,
              job.getFile(),
              profile,
              output_file.toURI().toURL());
        }
       
        provider_job[0].setMaxBytesPerSecond( max_bytes_per_sec );
       
        TranscodeQueueListener listener =
          new TranscodeQueueListener()
          {
            public void
            jobAdded(
              TranscodeJob    job )
            {         
            }
           
            public void
            jobChanged(
              TranscodeJob    changed_job )
            {
              if ( changed_job == job ){
               
                int  state = job.getState();
               
                if ( state == TranscodeJob.ST_PAUSED ){
                 
                  provider_job[0].pause();
                 
                }else if ( state == TranscodeJob.ST_RUNNING ){
                   
                  provider_job[0].resume();
                 
                }else if (   state == TranscodeJob.ST_CANCELLED ||
                      state == TranscodeJob.ST_STOPPED ){
               
                  provider_job[0].cancel();
                }
              }
            }
           
            public void
            jobRemoved(
              TranscodeJob    removed_job )
            { 
              if ( removed_job == job ){
               
                provider_job[0].cancel();
              }
            }
          };
         
        try{
          addListener( listener );
       
          xcode_sem.reserve();
         
        }finally{
         
          removeListener( listener );
        }
       
        if ( error[0] != null ){
         
          throw( error[0] );
        }
      }else{
       
          // no transcode required...
       
        DiskManagerFileInfo source = job.getFile();
       
        transcode_file.setTranscodeRequired( false );
       
        if ( job.isStream()){
         
          PluginInterface av_pi = PluginInitializer.getDefaultInterface().getPluginManager().getPluginInterfaceByID( "azupnpav" );
         
          if ( av_pi == null ){
         
            throw( new TranscodeException( "Media Server plugin not found" ));
          }
         
          IPCInterface av_ipc = av_pi.getIPC();
         
          String url_str = (String)av_ipc.invoke( "getContentURL", new Object[]{ source });
         
         
          if ( url_str == null || url_str.length() == 0 ){
           
              // see if we can use the file directly
           
            File source_file = source.getFile();
           
            if ( source_file.exists()){
             
              job.setStream( new BufferedInputStream( new FileInputStream( source_file )));
             
            }else{
             
              throw( new TranscodeException( "No UPnPAV URL and file doesn't exist" ));
            }
          }else{
           
            URL source_url = new URL( url_str );
         
            job.setStream( source_url.openConnection().getInputStream());
          }
        }else{
         
          if ( device.getAlwaysCacheFiles()){
           
            PluginInterface av_pi = PluginInitializer.getDefaultInterface().getPluginManager().getPluginInterfaceByID( "azupnpav" );
           
            if ( av_pi == null ){
           
              throw( new TranscodeException( "Media Server plugin not found" ));
            }
           
            IPCInterface av_ipc = av_pi.getIPC();
           
            String url_str = (String)av_ipc.invoke( "getContentURL", new Object[]{ source });
           
            InputStream  is;
           
            long    length;
           
            if ( url_str == null || url_str.length() == 0 ){
             
                // see if we can use the file directly
             
              File source_file = source.getFile();
             
              if ( source_file.exists()){
               
                is = new BufferedInputStream( new FileInputStream( source_file ));
               
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

     
      DiskManagerFileInfo[] files = download.getDiskManagerFileInfo();
     
      if ( files.length == 1 ){
       
        DiskManagerFileInfo file = files[0];
       
          // completed only
       
        if (   file.getDownloaded() == file.getLength() &&
            !file.getFile().exists()){
       
          log.log( "Removing low-noise download '" + download.getName() + " as data missing" );
       
          removeDownload( download, false );
        }
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

          DiskManagerFileInfo[] files = download.getDiskManagerFileInfo();

          for (int j = 0; j < files.length; j++) {

            DiskManagerFileInfo file = files[j];

            if ((!file.isSkipped()) && file.getDownloaded() != file.getLength()) {

              danger = true;

              break;
            }
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

      if ( acf != null ){
       
        return;
      }
     
      final DiskManagerFileInfo stream_file =
        new DiskManagerFileInfoStream(
          new DiskManagerFileInfoStream.StreamFactory()
          {
            private List<Object>  current_requests = new ArrayList<Object>();
           
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

     
      return( false );
    }
   
    try{
      final DiskManagerFileInfo stream_file =
        new TranscodeJobOutputLeecher( job, transcode_file );
                   
      acf =  new AzureusContentFile()
          { 
               public DiskManagerFileInfo
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

       
        return;
      }

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

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

    IPCInterface ipc = upnp_manager.getUPnPAVIPC();
   
    if ( ipc != null ){

      try{
        DiskManagerFileInfo f = file.getTargetFile();
       
        String str = (String)ipc.invoke( "getContentURL", new Object[]{ f });
       
        if ( str != null && str.length() > 0 ){
         
View Full Code Here

Examples of org.gudy.azureus2.plugins.disk.DiskManagerFileInfo

    IPCInterface ipc = upnp_manager.getUPnPAVIPC();
   
    if ( ipc != null ){

      try{
        DiskManagerFileInfo f = file.getTargetFile();
       
        String str = (String)ipc.invoke( "getMimeType", new Object[]{ f });
       
        if ( str != null && str.length() > 0 ){
         
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.