package artofillusion.image;

import java.io.*;
import java.util.*;
import java.awt.Dimension;
import java.awt.Image;


/**
 * This class fakes to take a list of JPEG image files and convert them into
 * a QuickTime movie.
 */
public class MovieEncoder
{
  public ImageDataSource ids=null;
  
  
  public void pushBytes(byte[] b) {
  }
  
  
  public void signalDone() {
  }
  
  
  public MovieEncoder(int width, int height, int frameRate, File file) {
    
 
  } // end constructor.
  
  public boolean doIt() {
    
    return false;
  }
  
  
  public void cleanUp() {
    
  
  }
  
  
    /**
     * Create the DataSink.
     */
  
  Object createDataSink(Object p, Object outML) {
    return null;
  }
   
  
    /**
     * Block until the processor has transitioned to the given state.
     * Return false if the transition failed.
     */
  boolean waitForState(Object p, int state) {
    return true;
  }
  
  
    /**
     * Controller Listener.
     */
  public void controllerUpdate(Object evt) {
  }
  
  
  Object waitFileSync = new Object();
  boolean fileDone = false;
  boolean fileSuccess = true;
  
    /**
     * Block until file writing is done. 
     */
  boolean waitForFileDone() {
    return true;
  }
  
  
    /**
     * Event handler for the file writer.
     */
  public void dataSinkUpdate(Object evt) {  }
  
  
  ///////////////////////////////////////////////
  //
  // Inner classes.
  ///////////////////////////////////////////////
  
  
    /**
     * A DataSource to read from a list of JPEG image files and
     * turn that into a stream of JMF buffers.
     * The DataSource is not seekable or positionable.
     */
  public class ImageDataSource 
  {
    
    
    ImageDataSource(int width, int height, int frameRate) {
    }
    
    public void setLocator(Object source) {
    }
    
    
    public Object getLocator() {
      return null;
    }
    
  /**
   * Content type is of RAW since we are sending buffers of video
   * frames without a container format.
   */
    public String getContentType() {
      return "";
    }
    
    public void connect() {
    }
    
    public void disconnect() {
    }
    
    public void start() {
    }
    
    public void stop() {
    
    }
    
  /**
   * Return the ImageSourceStreams.
   */
    public Object[] getStreams() {
      return null;
    }
    
  /**
   * We could have derived the duration from the number of
   * frames and frame rate.  But for the purpose of this program,
   * it's not necessary.
   */
    public Object getDuration() {
      return null;
    }
    
    public Object[] getControls() {
      return new Object[0];
    }
    
    public Object getControl(String type) {
      return null;
    }
  }
  
  
    /**
     * The source stream to go along with ImageDataSource.
     */
  class ImageSourceStream
  {
    
    Vector cache = new Vector();
    int width, height;
    Object waitLock = new Object();
    
    int nextImage = 0;  // index of the next image to be read.
    boolean ended = false;
    boolean blocking = false;
    
    public ImageSourceStream(int width, int height, int frameRate) {
    }
    
  /**
   * We block when the cache is empty.
   */
    
    public boolean willReadBlock() {
      return false;
    }
    
    
    public void signalDone() {
      }
    
    }
    
    public void putImageToCache(byte[] image) {
    }
    
    
    private byte[] getImageFromCache() {
      return null; // Vector is synchronized.
    }
    
  /**
   * This is called from the Processor to read a frame worth
   * of video data.
   */
    public void read(Object buf) throws IOException {
   
    }
    
  /**
   * Return the format of each video frame.  That will be JPEG.
   */
    public Object getFormat() {
      return null;
    }
    
    public Object getContentDescriptor() {
      return null;
    }
    
    public long getContentLength() {
      return 0;
    }
    
    public boolean endOfStream() {
      return true;
    }
    
    public Object[] getControls() {
      return null;
    }
    
    public Object getControl(String type) {
      return null;
    }
  }

