Package javax.media

Examples of javax.media.Format


    Object owner = ((Owned)cs[i]).getOwner();

    // Check to see if the owner is a Codec.
    // Then check for the output format.
    if (owner instanceof Codec) {
        Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
        for (int j = 0; j < fmts.length; j++) {
      if (fmts[j].matches(jpegFmt)) {
          qc = (QualityControl)cs[i];
              qc.setQuality(val);
          System.err.println("- Set quality to " +
View Full Code Here


    Object owner = ((Owned)cs[i]).getOwner();

    // Check to see if the owner is a Codec.
    // Then check for the output format.
    if (owner instanceof Codec) {
        Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
        for (int j = 0; j < fmts.length; j++) {
      if (fmts[j].matches(jpegFmt)) {
          qc = (QualityControl)cs[i];
              qc.setQuality(val);
          System.err.println("- Set quality to " +
View Full Code Here

  return nanos;
    }

    void pushData(Buffer buffer, BufferTransferHandler bth,
             PushBufferStream pbs) {
  Format format = buffer.getFormat();
  int index;
  // Check if this buffer is from the next data source
  // Keep the buffer around until its length becomes zero.
  // This happens when a corresponding buffer from the current
  //  datasource comes in and consumes the buffer.
View Full Code Here

    // get the formats, check the type and set the new
    // formats. Realize the proc and get the datasource
    // Set the local variables with datasource/stream/format
    // information
    for (int i = 0; i < tracks.length; i++) {
        Format format = tracks[i].getFormat();
        Format [] supported = tracks[i].getSupportedFormats();
        if (format instanceof AudioFormat) {
            for (int j = 0; j < supported.length; j++) {
                if (supported[j].matches(preferredAudioFormat)) {
                    preferredAudioFormat = (AudioFormat) supported[j];
View Full Code Here

   * @param args
   */
  public static void main(String[] args)
  {
    final String urlStr = URLUtils.createUrlStr(new File("samplemedia/gulp2.wav"));//"file://samplemedia/gulp2.wav";
    Format format;
    // TODO: if receiver has JMF in classpath after FMJ, and JMF defaults for PIM set to true, no audio is heard.
    format = new AudioFormat(AudioFormat.ULAW_RTP, 8000, 8, 1);
    //format = new AudioFormat(AudioFormat.ULAW_RTP, 8000.0, 8, 1, AudioFormat.LITTLE_ENDIAN, AudioFormat.SIGNED);
    //format = new AudioFormat(BonusAudioFormatEncodings.ALAW_RTP, 8000, 8, 1);
    //format = new AudioFormat(BonusAudioFormatEncodings.SPEEX_RTP, 8000, 8, 1, -1, AudioFormat.SIGNED);
View Full Code Here

  p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));

  // Query for the processor for supported formats.
  // Then set it on the processor.
  TrackControl tcs[] = p.getTrackControls();
  Format f[] = tcs[0].getSupportedFormats();
  if (f == null || f.length <= 0) {
      System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
      return false;
  }
View Full Code Here

    /**
     * Set the target transcode format on the processor.
     */
    boolean setTrackFormats(Processor p) {

  Format supported[];

  TrackControl [] tracks = p.getTrackControls();

  // Do we have at least one track?
  if (tracks == null || tracks.length < 1) {
View Full Code Here

    Object owner = ((Owned)cs[i]).getOwner();

    // Check to see if the owner is a Codec.
    // Then check for the output format.
    if (owner instanceof Codec) {
        Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
        for (int j = 0; j < fmts.length; j++) {
      if (fmts[j].matches(jpegFmt)) {
          qc = (QualityControl)cs[i];
              qc.setQuality(val);
          System.err.println("- Set quality to " +
View Full Code Here

  boolean programmed = false;

  // Search through the tracks for a video track
  for (int i = 0; i < tracks.length; i++) {
      Format format = tracks[i].getFormat();
      if tracks[i].isEnabled() &&
      format instanceof VideoFormat &&
      !programmed) {
   
    // Found a video track. Try to program it to output JPEG/RTP
View Full Code Here

    Object owner = ((Owned)cs[i]).getOwner();

    // Check to see if the owner is a Codec.
    // Then check for the output format.
    if (owner instanceof Codec) {
        Format fmts[] = ((Codec)owner).getSupportedOutputFormats(null);
        for (int j = 0; j < fmts.length; j++) {
      if (fmts[j].matches(jpegFmt)) {
          qc = (QualityControl)cs[i];
              qc.setQuality(val);
          System.err.println("- Setting quality to " +
View Full Code Here

TOP

Related Classes of javax.media.Format

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.