Examples of QualityControl


Examples of javax.media.control.QualityControl

    */
   //------------------------------------------------------------------------------------------
    void setJPEGQuality(Player p, float val) {

    Control cs[] = p.getControls();
    QualityControl qc = null;
    VideoFormat jpegFmt = new VideoFormat(VideoFormat.JPEG);

    // Loop through the controls to find the Quality control for
     // the JPEG encoder.
    for (int i = 0; i < cs.length; i++) {

        if (cs[i] instanceof QualityControl &&
      cs[i] instanceof Owned) {
      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 " +
            val + " on " + qc);
            break;
        }
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.