Package javax.media.protocol

Examples of javax.media.protocol.ContentDescriptor


      // TODO: what is the right place to apply ContentDescriptor.mimeTypeToPackageName?
      contentTypeStr = ContentDescriptor.mimeTypeToPackageName(conn.getContentType());
    }
   

    contentType = new ContentDescriptor(contentTypeStr);
    sources = new URLSourceStream[1];
    sources[0] = new URLSourceStream();
                                 
    connected = true;
  }
View Full Code Here


     
      String s = getContentTypeFor(path)// TODO: use our own mime mapping
      if (s == null)
        throw new IOException("Unknown content type for path: " + path);
      // TODO: what is the right place to apply ContentDescriptor.mimeTypeToPackageName?
      contentType = new ContentDescriptor(ContentDescriptor.mimeTypeToPackageName(s));
      sources = new RAFPullSourceStream[1];
      sources[0] = new RAFPullSourceStream();
                                   
      connected = true;
    }
View Full Code Here

      if (!openAndStartDemux())
      {  postControllerErrorEvent("Failed to openAndStartDemux")// TODO: we could get a more specific error, like resource not available, from the function.
        return false;
      }
      if (mode == PLAYER)
      {  filterGraph = FilterGraphBuilder.buildGraphToRenderer(new ContentDescriptor(getSource().getContentType()), demux);
      }
      else
      buildMux();
        filterGraph = FilterGraphBuilder.buildGraphToMux(new ContentDescriptor(getSource().getContentType()), demux, mux, muxInputFormats, muxInputTrackNumbers);
      }
      }
      catch (Exception e)
      {  logger.log(Level.WARNING, "" + e, e);
        closeDemux();
View Full Code Here

    this.contentDescriptor = contentDescriptor;
  }
 
  public RawBufferMux()
  {
    this(new ContentDescriptor(ContentDescriptor.RAW));
  }
View Full Code Here

  public static final String BOUNDARY = "--ssBoundaryFMJ";
  public static final String TIMESTAMP_KEY = "X-FMJ-Timestamp"; // will be ignored by most recipients, but with FMJ we have the option of timing the playback based on this.

  public MultipartMixedReplaceMux()
  {
    super(new ContentDescriptor("multipart.x_mixed_replace"));
  }
View Full Code Here

* @author Martin Harvan
*/
public class GsmMux extends AbstractStreamCopyMux {

    public GsmMux() {
        super(new ContentDescriptor(FileTypeDescriptor.GSM));
    }
View Full Code Here

{
  private static final Logger logger = LoggerSingleton.logger;

  public RTPSyncBufferMux()
  {
    super(new ContentDescriptor(ContentDescriptor.RAW_RTP));
  }
View Full Code Here

//     PlugInManager.DEMULTIPLEXER:
    if ((flags & JMF) != 0)
    {
      result.add(new PlugInInfo("com.ibm.media.parser.video.MpegParser",
        new Format[] {
          new ContentDescriptor("audio.mpeg"),
          new ContentDescriptor("video.mpeg"),
          new ContentDescriptor("audio.mpeg"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.audio.WavParser",
        new Format[] {
          new ContentDescriptor("audio.x_wav"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.audio.AuParser",
        new Format[] {
          new ContentDescriptor("audio.basic"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.audio.AiffParser",
        new Format[] {
          new ContentDescriptor("audio.x_aiff"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.audio.GsmParser",
        new Format[] {
          new ContentDescriptor("audio.x_gsm"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
    }
//     FMJ overrides to come before SUN ones:
//      this one needs to be after the audio parsers, otherwise it will be used instead of them in some cases.
//     TODO: why does the sun one get an NPE?
//     TODO: this causes audio not to play properly:
    if ((flags & FMJ) != 0)
    {      result.add(new PlugInInfo("net.sf.fmj.media.parser.RawPushBufferParser",
            new Format[] {
              new ContentDescriptor("raw"),
            },
            new Format[] {},
            PlugInManager.DEMULTIPLEXER));
    // end FMJ override.
    }
    if ((flags & JMF) != 0)
    {
      result.add(new PlugInInfo("com.sun.media.parser.RawStreamParser",
        new Format[] {
          new ContentDescriptor("raw"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.RawBufferParser",
        new Format[] {
          new ContentDescriptor("raw"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.RawPullStreamParser",
        new Format[] {
          new ContentDescriptor("raw"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.RawPullBufferParser",
        new Format[] {
          new ContentDescriptor("raw"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.video.QuicktimeParser",
        new Format[] {
          new ContentDescriptor("video.quicktime"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.parser.video.AviParser",
        new Format[] {
          new ContentDescriptor("video.x_msvideo"),
        },
        new Format[] {},
        PlugInManager.DEMULTIPLEXER));
 
  //     PlugInManager.CODEC:
      result.add(new PlugInInfo("com.sun.media.codec.audio.mpa.JavaDecoder",
        new Format[] {
          new AudioFormat("mpegaudio", 16000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 22050.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 24000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 32000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 44100.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 48000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.video.cinepak.JavaDecoder",
        new Format[] {
          new VideoFormat("cvid", null, -1, Format.byteArray, -1.0f),
        },
        new Format[] {
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.video.h263.JavaDecoder",
        new Format[] {
          new VideoFormat("h263", null, -1, Format.byteArray, -1.0f),
          new VideoFormat("h263/rtp", null, -1, Format.byteArray, -1.0f),
        },
        new Format[] {
          new RGBFormat(null, -1, null, -1.0f, -1, 0xffffffff, 0xffffffff, 0xffffffff, -1, -1, -1, -1),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.video.colorspace.JavaRGBConverter",
        new Format[] {
          new RGBFormat(null, -1, null, -1.0f, -1, 0xffffffff, 0xffffffff, 0xffffffff, -1, -1, -1, -1),
        },
        new Format[] {
          new RGBFormat(null, -1, null, -1.0f, -1, 0xffffffff, 0xffffffff, 0xffffffff, -1, -1, -1, -1),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.video.colorspace.JavaRGBToYUV",
        new Format[] {
          new RGBFormat(null, -1, Format.byteArray, -1.0f, 24, 0xffffffff, 0xffffffff, 0xffffffff, -1, -1, -1, -1),
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, -1, -1),
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, -1, -1),
        },
        new Format[] {
          new YUVFormat(null, -1, Format.byteArray, -1.0f, 2, -1, -1, -1, -1, -1),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.PCMToPCM",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 16, 2, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 2, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      // this one appears to be designed to convert to RTP-friendly audio formats?
      result.add(new PlugInInfo("com.ibm.media.codec.audio.rc.RCModule",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 2, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 16, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 2, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", 8000.0, 16, 2, 0, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", 8000.0, 16, 1, 0, 1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.rc.RateCvrt",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.msadpcm.JavaDecoder",
        new Format[] {
          new AudioFormat("msadpcm", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ulaw.JavaDecoder",
        new Format[] {
          new AudioFormat("ULAW", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.alaw.JavaDecoder",
        new Format[] {
          new AudioFormat("alaw", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.dvi.JavaDecoder",
        new Format[] {
          new AudioFormat("dvi/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.g723.JavaDecoder",
        new Format[] {
          new AudioFormat("g723", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("g723/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.gsm.JavaDecoder",
        new Format[] {
          new AudioFormat("gsm", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("gsm/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.gsm.JavaDecoder_ms",
        new Format[] {
          new AudioFormat("gsm/ms", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ima4.JavaDecoder",
        new Format[] {
          new AudioFormat("ima4", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ima4.JavaDecoder_ms",
        new Format[] {
          new AudioFormat("ima4/ms", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ulaw.JavaEncoder",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 16, 2, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("LINEAR", -1.0, 8, 2, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.dvi.JavaEncoder",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 1, 0, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("dvi/rtp", -1.0, 4, 1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.gsm.JavaEncoder",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 1, 0, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("gsm", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.gsm.JavaEncoder_ms",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, 1, 0, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new com.sun.media.format.WavAudioFormat("gsm/ms", -1.0, -1, -1, -1, -1, -1, -1, -1.0f, Format.byteArray, null),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ima4.JavaEncoder",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, -1, 0, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("ima4", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.ima4.JavaEncoder_ms",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, 16, -1, 0, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new com.sun.media.format.WavAudioFormat("ima4/ms", -1.0, -1, -1, -1, -1, -1, -1, -1.0f, Format.byteArray, null),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.ulaw.Packetizer",
        new Format[] {
          new AudioFormat("ULAW", -1.0, 8, 1, -1, -1, 8, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("ULAW/rtp", -1.0, 8, 1, -1, -1, 8, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.ulaw.DePacketizer",
        new Format[] {
          new AudioFormat("ULAW/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("ULAW", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.mpa.Packetizer",
        new Format[] {
          new AudioFormat("mpeglayer3", 16000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 22050.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 24000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 32000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 44100.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 48000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 16000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 22050.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 24000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 32000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 44100.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 48000.0, -1, -1, -1, 1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("mpegaudio/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.audio.mpa.DePacketizer",
        new Format[] {
          new AudioFormat("mpegaudio/rtp", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("mpegaudio", 44100.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 48000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 32000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 22050.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 24000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 16000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 11025.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 12000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpegaudio", 8000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 44100.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 48000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 32000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 22050.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 24000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 16000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 11025.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 12000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
          new AudioFormat("mpeglayer3", 8000.0, 16, -1, 1, 1, -1, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.gsm.Packetizer",
        new Format[] {
          new AudioFormat("gsm", 8000.0, -1, 1, -1, -1, 264, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("gsm/rtp", 8000.0, -1, 1, -1, -1, 264, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.ibm.media.codec.audio.g723.Packetizer",
        new Format[] {
          new AudioFormat("g723", 8000.0, -1, 1, -1, -1, 192, -1.0, Format.byteArray),
        },
        new Format[] {
          new AudioFormat("g723/rtp", 8000.0, -1, 1, -1, -1, 192, -1.0, Format.byteArray),
        },
        PlugInManager.CODEC));
    }
   
    // mgodehardt: disabled this, is added later, we ask the class for input and output formats
    /*if ((flags & FMJ) != 0)
    {  result.add(new PlugInInfo("net.sf.fmj.media.codec.video.jpeg.Packetizer",
          new Format[] {
            new JPEGFormat(),
          },
          new Format[] {
            new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
          },
          PlugInManager.CODEC));
    }*/
   
    if ((flags & JMF) != 0)
    {

      result.add(new PlugInInfo("com.sun.media.codec.video.jpeg.Packetizer",
        new Format[] {
          new JPEGFormat(),    // TODO: VideoFormat?
        },
        new Format[] {
          new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
        },
        PlugInManager.CODEC));
    }
    if ((flags & FMJ) != 0)
    {  result.add(new PlugInInfo("net.sf.fmj.media.codec.video.jpeg.DePacketizer",
          new Format[] {
            new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
          },
          new Format[] {
            new JPEGFormat(),
          },
          PlugInManager.CODEC));
    }
    if ((flags & JMF) != 0)
    {

      result.add(new PlugInInfo("com.sun.media.codec.video.jpeg.DePacketizer",
        new Format[] {
          new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
        },
        new Format[] {
          new JPEGFormat()// TODO: VideoFormat?
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.video.mpeg.Packetizer",
        new Format[] {
          new VideoFormat("mpeg", null, -1, Format.byteArray, -1.0f),
        },
        new Format[] {
          new VideoFormat("mpeg/rtp", null, -1, Format.byteArray, -1.0f),
        },
        PlugInManager.CODEC));
      result.add(new PlugInInfo("com.sun.media.codec.video.mpeg.DePacketizer",
        new Format[] {
          new VideoFormat("mpeg/rtp", null, -1, Format.byteArray, -1.0f),
        },
        new Format[] {
          new VideoFormat("mpeg", null, -1, Format.byteArray, -1.0f),
        },
        PlugInManager.CODEC));
    }
//     PlugInManager.EFFECT:

//     PlugInManager.RENDERER:
    if ((flags & JMF) != 0)
    {
      result.add(new PlugInInfo("com.sun.media.renderer.audio.JavaSoundRenderer",
        new Format[] {
          new AudioFormat("LINEAR", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
          new AudioFormat("ULAW", -1.0, -1, -1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {},
        PlugInManager.RENDERER));
      result.add(new PlugInInfo("com.sun.media.renderer.audio.SunAudioRenderer",
        new Format[] {
          new AudioFormat("ULAW", 8000.0, 8, 1, -1, -1, -1, -1.0, Format.byteArray),
        },
        new Format[] {},
        PlugInManager.RENDERER));
      result.add(new PlugInInfo("com.sun.media.renderer.video.AWTRenderer",
        new Format[] {
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1),
          new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1),
        },
        new Format[] {},
        PlugInManager.RENDERER));
      result.add(new PlugInInfo("com.sun.media.renderer.video.LightWeightRenderer",
          new Format[] {
            new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1),
            new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1),
          },
          new Format[] {},
          PlugInManager.RENDERER));
 
      result.add(new PlugInInfo("com.sun.media.renderer.video.JPEGRenderer",
        new Format[] {
          new JPEGFormat(),
        },
        new Format[] {},
        PlugInManager.RENDERER));
 
  //     PlugInManager.MULTIPLEXER:
      result.add(new PlugInInfo("com.sun.media.multiplexer.RawBufferMux",
        new Format[] {},
        new Format[] {
          new ContentDescriptor("raw"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.RawSyncBufferMux",
        new Format[] {},
        new Format[] {
          new ContentDescriptor("raw"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.RTPSyncBufferMux",
        new Format[] {},
        new Format[] {
          new ContentDescriptor("raw.rtp"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.audio.GSMMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("audio.x_gsm"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.audio.MPEGMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("audio.mpeg"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.audio.WAVMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("audio.x_wav"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.audio.AIFFMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("audio.x_aiff"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.audio.AUMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("audio.basic"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.video.AVIMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("video.x_msvideo"),
        },
        PlugInManager.MULTIPLEXER));
      result.add(new PlugInInfo("com.sun.media.multiplexer.video.QuicktimeMux",
        new Format[] {},
        new Format[] {
          new FileTypeDescriptor("video.quicktime"),
        },
        PlugInManager.MULTIPLEXER));
    }
   
    if ((flags & FMJ) != 0)
    {
      result.add("net.sf.fmj.media.codec.video.jpeg.Packetizer");
     
      result.add("net.sf.fmj.media.renderer.video.SimpleSwingRenderer");
      result.add("net.sf.fmj.media.renderer.video.SimpleAWTRenderer");
      result.add("net.sf.fmj.media.renderer.video.Java2dRenderer");
      result.add("net.sf.fmj.media.renderer.video.JPEGRTPRenderer");
      result.add("net.sf.fmj.media.renderer.video.JPEGRenderer");

      result.add("net.sf.fmj.media.parser.JavaSoundParser");
      result.add("net.sf.fmj.media.codec.JavaSoundCodec");
      result.add("net.sf.fmj.media.renderer.audio.JavaSoundRenderer");
           
            result.add("net.sf.fmj.media.codec.audio.gsm.Decoder");
            result.add("net.sf.fmj.media.codec.audio.gsm.Encoder");
            result.add("net.sf.fmj.media.codec.audio.gsm.DePacketizer");
            result.add("net.sf.fmj.media.codec.audio.gsm.Packetizer");
            result.add("net.sf.fmj.media.multiplexer.audio.GsmMux");
            result.add("net.sf.fmj.media.parser.GsmParser");

      result.add("net.sf.fmj.media.codec.audio.ulaw.Decoder");
      result.add("net.sf.fmj.media.codec.audio.ulaw.Encoder");
      result.add("net.sf.fmj.media.codec.audio.ulaw.DePacketizer");
      result.add("net.sf.fmj.media.codec.audio.ulaw.Packetizer");
      result.add("net.sf.fmj.media.codec.audio.RateConverter");
     
      result.add("net.sf.fmj.media.codec.audio.alaw.Decoder");
      result.add("net.sf.fmj.media.codec.audio.alaw.Encoder");
      result.add("net.sf.fmj.media.codec.audio.alaw.DePacketizer");
      result.add("net.sf.fmj.media.codec.audio.alaw.Packetizer");
      result.add("net.sf.fmj.media.codec.video.jpeg.JpegEncoder");
      result.add("net.sf.fmj.media.codec.video.lossless.GIFEncoder");
      result.add("net.sf.fmj.media.codec.video.lossless.GIFDecoder");
      result.add("net.sf.fmj.media.codec.video.lossless.PNGEncoder");
      result.add("net.sf.fmj.media.codec.video.lossless.PNGDecoder");
     
      result.add("net.sf.fmj.media.parser.RawPushBufferParser");
      //result.add("net.sf.fmj.media.parser.RawPullStreamParser"); // TODO: test and add.  Does it conflict with RawPushBufferParser?
      result.add("net.sf.fmj.media.multiplexer.RTPSyncBufferMux");
      result.add("net.sf.fmj.media.multiplexer.RawBufferMux");
      result.add("net.sf.fmj.media.multiplexer.audio.AIFFMux");
      result.add("net.sf.fmj.media.multiplexer.audio.AUMux");
      //result.add("net.sf.fmj.media.multiplexer.audio.JavaSoundAUMux"); // not needed, AUMux works fine.
      result.add("net.sf.fmj.media.multiplexer.audio.WAVMux");
     
      // TODO: the filter graph builder can't quite deal with this one yet:
      //result.add("net.sf.fmj.media.codec.video.ImageScaler");
     
            if ( !DISABLE_OGG )
            {
          result.add("net.sf.fmj.theora_java.JavaOggParser");
      }
     
//      if (OSUtils.isMacOSX() || OSUtils.isWindows())
//      {
//        result.add("net.sf.fmj.qt.QTParser");
//      }
     
      result.add("net.sf.fmj.media.parser.MultipartMixedReplaceParser");
      result.add("net.sf.fmj.media.multiplexer.MultipartMixedReplaceMux");
     
      result.add("net.sf.fmj.media.parser.XmlMovieParser");
      result.add("net.sf.fmj.media.multiplexer.XmlMovieMux");
      result.add("net.sf.fmj.media.multiplexer.audio.CsvAudioMux");
     
     
     
         // SIP communicator packetizers/depacketizers.
          result.add("net.java.sip.communicator.impl.media.codec.audio.speex.JavaEncoder");
          result.add("net.java.sip.communicator.impl.media.codec.audio.speex.JavaDecoder");
          result.add("net.java.sip.communicator.impl.media.codec.audio.ilbc.JavaEncoder");
          result.add("net.java.sip.communicator.impl.media.codec.audio.ilbc.JavaDecoder");
         
          // t4l jpeg encoder/decoder:
          result.add("com.t4l.jmf.JPEGDecoder");
          //result.add("com.t4l.jmf.JPEGEncoder");  // TODO: FMJ has a JPEG encoder above, need to merge and get best of both worlds
    }
   
    if ((flags & FMJ_NATIVE) != 0)
    {
      // ffmpeg-java parser: may not be in classpath
      result.add("net.sf.fmj.ffmpeg_java.FFMPEGParser");
      result.add("net.sf.fmj.theora_java.NativeOggParser");
    }   
   
    if ((flags & THIRD_PARTY) != 0)
    {
      // JFFMPEG: may not be in classpath
      // JFFMPEG is not needed for ogg playback, because JavaSound with an spi can handle
      // ogg audio files.  net.sourceforge.jffmpeg.demux.ogg.OggDemux does not appear to split
      // out the video stream, so if this demux gets used instead of net.sf.fmj.theora_java.OGGParser,
      // audio will play but no video.
//        result.add("net.sourceforge.jffmpeg.demux.ogg.OggDemux");
//          result.add("net.sourceforge.jffmpeg.AudioDecoder");
         
//          result.add("net.sourceforge.jffmpeg.demux.avi.AviDemux");
//          result.add("net.sourceforge.jffmpeg.VideoDecoder");
//          result.add("net.sourceforge.jffmpeg.AudioDecoder");
//          PlugInManager.removePlugIn("com.sun.media.parser.video.AviParser", PlugInManager.DEMULTIPLEXER);

          // FOBS4JMF: may not be in classpath
          result.add("com.omnividea.media.parser.video.Parser");
          result.add("com.omnividea.media.codec.video.NativeDecoder");
          result.add("com.omnividea.media.codec.audio.NativeDecoder");
          result.add("com.omnividea.media.codec.video.JavaDecoder");
          // protocol: com.omnividea - also added in JmfRegistry
    }
   
    if ((flags & FMJ) != 0 && (flags & JMF) != 0)
    {
      // TODO: verify that mp3s play with JMF installed.
//      // remove the audio/mpeg from ibm's: - this can result in a demux with no renderer.
//          if (PlugInManager.removePlugIn("com.ibm.media.parser.video.MpegParser", PlugInManager.DEMULTIPLEXER))
//          {
        result.add(new PlugInInfo("com.ibm.media.parser.video.MpegParser",
            new Format[] {
              //new ContentDescriptor("audio.mpeg"),
              new ContentDescriptor("video.mpeg"),
              //new ContentDescriptor("audio.mpeg"),
            },
            new Format[] {},
            PlugInManager.DEMULTIPLEXER));
          //}
View Full Code Here

    assertTrue(new Time(1.0).getNanoseconds() == Time.ONE_SECOND);
  }
 
  public void testContentDescriptor()
  {
    assertTrue(new ContentDescriptor(ContentDescriptor.CONTENT_UNKNOWN).getContentType().equals("UnknownContent"));
    assertTrue(new ContentDescriptor(ContentDescriptor.CONTENT_UNKNOWN).getEncoding().equals("UnknownContent"));
    assertTrue(new ContentDescriptor(ContentDescriptor.CONTENT_UNKNOWN).toString().equals("UnknownContent"));
   
    assertTrue(new ContentDescriptor(ContentDescriptor.MIXED).getContentType().equals("application.mixed-data"));
    assertTrue(new ContentDescriptor(ContentDescriptor.MIXED).toString().equals("application.mixed-data"));
    assertTrue(ContentDescriptor.mimeTypeToPackageName("viddeo/mpexg").equals("viddeo.mpexg"));
    assertTrue(ContentDescriptor.mimeTypeToPackageName("xyz").equals("xyz"));
    assertTrue(ContentDescriptor.mimeTypeToPackageName("a/b/c").equals("a.b.c"));
    assertTrue(ContentDescriptor.mimeTypeToPackageName("a-b-c").equals("a_b_c"));
    assertEquals(ContentDescriptor.mimeTypeToPackageName("!@#$%^&*()"), "__________");
    {
      byte[] b = new byte[256];
      for (int i = 0; i < 256; ++i)
      {  b[i] = (byte) i;
      }
      String s = new String(b);
      final String sTarget = "______________________________________________..0123456789_______abcdefghijklmnopqrstuvwxyz______abcdefghijklmnopqrstuvwxyz_____________________________________________________________________________________________________________________________________";
      assertEquals(ContentDescriptor.mimeTypeToPackageName(s), sTarget);
    }
   
   
    assertEquals(new ContentDescriptor("abc").getDataType(), ContentDescriptor.byteArray);
    assertEquals(new ContentDescriptor("video.quicktime").getDataType(), ContentDescriptor.byteArray);
   
 
    assertEquals(new ContentDescriptor("text/plain").getContentType(), "text/plain");
    assertEquals(ContentDescriptor.MIXED, "application.mixed-data");
   
  }
View Full Code Here

{
  private static final Logger logger = LoggerSingleton.logger;

  public XmlMovieMux()
  {
    super(new ContentDescriptor("video.xml"));
  }
View Full Code Here

TOP

Related Classes of javax.media.protocol.ContentDescriptor

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.