Package javax.media

Examples of javax.media.Format


    return supportedOuts;
      else {
    // If an input format is given, we use that input format
    // as the output since we are not modifying the bit stream
    // at all.
    Format outs[] = new Format[1];
    outs[0] = in;
    return outs;
      }
  }
View Full Code Here


  // This will limit the supported formats reported from
  // Track.getSupportedFormats to only valid RTP formats.
  ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
  processor.setContentDescriptor(cd);

  Format supported[];
  Format chosen;
  boolean atLeastOneTrack = false;

  // Program the tracks.
  for (int i = 0; i < tracks.length; i++) {
      Format format = tracks[i].getFormat();
      if (tracks[i].isEnabled()) {

    supported = tracks[i].getSupportedFormats();

    // We've set the output content to the RAW_RTP.
View Full Code Here

     */
    Format checkForVideoSizes(Format original, Format supported) {

  int width, height;
  Dimension size = ((VideoFormat)original).getSize();
  Format jpegFmt = new Format(VideoFormat.JPEG_RTP);
  Format h263Fmt = new Format(VideoFormat.H263_RTP);

  if (supported.matches(jpegFmt)) {
      // For JPEG, make sure width and height are divisible by 8.
      width = (size.width % 8 == 0 ? size.width :
        (int)(size.width / 8) * 8);
 
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

     * We'll loop through the tracks and try to find a track
     * that can be converted to the given format.
     */
    boolean setEachTrackFormat(Processor p, TrackControl tcs[], Format fmt) {

  Format supported[];
  Format f;

  for (int i = 0; i < tcs.length; i++) {

      supported = tcs[i].getSupportedFormats();

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

      System.err.println("No output url is specified");
      prUsage();
  }

  int j = 0;
  Format fmts[] = new Format[audFmt.size() + vidFmt.size()];
  Format fmt;

  // Parse the audio format spec. into real AudioFormat's.
  for (i = 0; i < audFmt.size(); i++) {

      if ((fmt = parseAudioFormat((String)audFmt.elementAt(i))) == null) {
View Full Code Here

     * Try matching the data formats and find common ones for concatenation.
     */
    public boolean tryMatch(ProcInfo pInfo[], int type, int trackID) {

  TrackControl tc = pInfo[0].tracksByType[type][trackID].tc;
  Format origFmt = tc.getFormat();
  Format newFmt, oldFmt;
  Format supported[] = tc.getSupportedFormats();

  for (int i = 0; i < supported.length; i++) {

      if (supported[i] instanceof AudioFormat) {
    // If it's not the original format, then for audio, we'll
View Full Code Here

  if (procID >= pInfo.length)
      return true;

  boolean matched = false;
  TrackControl tc = pInfo[procID].tracksByType[type][trackID].tc;
  Format supported[] = tc.getSupportedFormats();

  for (int i = 0; i < supported.length; i++) {
      if (candidate.matches(supported[i]) &&
    tryTranscode(pInfo, procID+1, type, trackID, candidate)) {
    matched = true;
View Full Code Here

    /**
     * Utility function to check for raw (linear) audio.
     */
    boolean isRawAudio(TrackInfo tInfo) {
  Format fmt = tInfo.tc.getFormat();
  return (fmt instanceof AudioFormat) &&
    fmt.getEncoding().equalsIgnoreCase(AudioFormat.LINEAR);
    }
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.