Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/media/sound/SoftJitterCorrector.java
/* * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.media.sound; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; /** * A jitter corrector to be used with SoftAudioPusher. * * @author Karl Helgason */ public final class SoftJitterCorrector extends AudioInputStream { private static class JitterStream extends InputStream { static int MAX_BUFFER_SIZE = 1048576; boolean active = true; Thread thread; AudioInputStream stream; // Cyclic buffer int writepos = 0; int readpos = 0; byte[][] buffers; private final Object buffers_mutex = new Object(); // Adapative Drift Statistics int w_count = 1000; int w_min_tol = 2; int w_max_tol = 10; int w = 0; int w_min = -1; // Current read buffer int bbuffer_pos = 0; int bbuffer_max = 0; byte[] bbuffer = null; public byte[] nextReadBuffer() { synchronized (buffers_mutex) { if (writepos > readpos) { int w_m = writepos - readpos; if (w_m < w_min) w_min = w_m; int buffpos = readpos; readpos++; return buffers[buffpos % buffers.length]; } w_min = -1; w = w_count - 1; } while (true) { try { Thread.sleep(1); } catch (InterruptedException e) { //e.printStackTrace(); return null; } synchronized (buffers_mutex) { if (writepos > readpos) { w = 0; w_min = -1; w = w_count - 1; int buffpos = readpos; readpos++; return buffers[buffpos % buffers.length]; } } } } public byte[] nextWriteBuffer() { synchronized (buffers_mutex) { return buffers[writepos % buffers.length]; } } public void commit() { synchronized (buffers_mutex) { writepos++; if ((writepos - readpos) > buffers.length) { int newsize = (writepos - readpos) + 10; newsize = Math.max(buffers.length * 2, newsize); buffers = new byte[newsize][buffers[0].length]; } } } JitterStream(AudioInputStream s, int buffersize, int smallbuffersize) { this.w_count = 10 * (buffersize / smallbuffersize); if (w_count < 100) w_count = 100; this.buffers = new byte[(buffersize/smallbuffersize)+10][smallbuffersize]; this.bbuffer_max = MAX_BUFFER_SIZE / smallbuffersize; this.stream = s; Runnable runnable = new Runnable() { @Override public void run() { AudioFormat format = stream.getFormat(); int bufflen = buffers[0].length; int frames = bufflen / format.getFrameSize(); long nanos = (long) (frames * 1000000000.0 / format.getSampleRate()); long now = System.nanoTime(); long next = now + nanos; int correction = 0; while (true) { synchronized (JitterStream.this) { if (!active) break; } int curbuffsize; synchronized (buffers) { curbuffsize = writepos - readpos; if (correction == 0) { w++; if (w_min != Integer.MAX_VALUE) { if (w == w_count) { correction = 0; if (w_min < w_min_tol) { correction = (w_min_tol + w_max_tol) / 2 - w_min; } if (w_min > w_max_tol) { correction = (w_min_tol + w_max_tol) / 2 - w_min; } w = 0; w_min = Integer.MAX_VALUE; } } } } while (curbuffsize > bbuffer_max) { synchronized (buffers) { curbuffsize = writepos - readpos; } synchronized (JitterStream.this) { if (!active) break; } try { Thread.sleep(1); } catch (InterruptedException e) { //e.printStackTrace(); } } if (correction < 0) correction++; else { byte[] buff = nextWriteBuffer(); try { int n = 0; while (n != buff.length) { int s = stream.read(buff, n, buff.length - n); if (s < 0) throw new EOFException(); if (s == 0) Thread.yield(); n += s; } } catch (IOException e1) { //e1.printStackTrace(); } commit(); } if (correction > 0) { correction--; next = System.nanoTime() + nanos; continue; } long wait = next - System.nanoTime(); if (wait > 0) { try { Thread.sleep(wait / 1000000L); } catch (InterruptedException e) { //e.printStackTrace(); } } next += nanos; } } }; thread = new Thread(null, runnable, "JitterCorrector", 0, false); thread.setDaemon(true); thread.setPriority(Thread.MAX_PRIORITY); thread.start(); } @Override public void close() throws IOException { synchronized (this) { active = false; } try { thread.join(); } catch (InterruptedException e) { //e.printStackTrace(); } stream.close(); } @Override public int read() throws IOException { byte[] b = new byte[1]; if (read(b) == -1) return -1; return b[0] & 0xFF; } public void fillBuffer() { bbuffer = nextReadBuffer(); bbuffer_pos = 0; } @Override public int read(byte[] b, int off, int len) { if (bbuffer == null) fillBuffer(); int bbuffer_len = bbuffer.length; int offlen = off + len; while (off < offlen) { if (available() == 0) fillBuffer(); else { byte[] bbuffer = this.bbuffer; int bbuffer_pos = this.bbuffer_pos; while (off < offlen && bbuffer_pos < bbuffer_len) b[off++] = bbuffer[bbuffer_pos++]; this.bbuffer_pos = bbuffer_pos; } } return len; } @Override public int available() { return bbuffer.length - bbuffer_pos; } } public SoftJitterCorrector(AudioInputStream stream, int buffersize, int smallbuffersize) { super(new JitterStream(stream, buffersize, smallbuffersize), stream.getFormat(), stream.getFrameLength()); } }
⏎ com/sun/media/sound/SoftJitterCorrector.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, 160073👍, 5💬
Popular Posts:
MXP1 is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but c...
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...
What Is mail.jar of JavaMail 1.4.2? I got the JAR file from javamail-1.4.2.zip. mail.jar in javamail...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...
JDK 11 jdk.httpserver.jmod is the JMOD file for JDK 11 HTTP Server module. JDK 11 HTTP Server module...