_tframeCount = new LongByReference();
long nowCount = _tframeCount.getValue(); if( nowCount - frameCount > 1 ) {
public LongByReference(long value) { super(8); setValue(value); }
public long block() { LongByReference result = new LongByReference(); emit("block", result); return result.getValue(); } public void switchTo(Pad pad, long stop_time, long start_time) {
@Override public Pointer getPointer(long offset) { if (Platform.getPlatform().longSize() == 32) { IntByReference ref = new IntByReference(getInt(offset)); return ref.getPointer().getPointer(0); } else { LongByReference ref = new LongByReference(getLong(offset)); return ref.getPointer().getPointer(0); } }
public long getValue() { return getPointer().getLong(0); } }
public void getLatency(long[] minmax) { LongByReference minRef = new LongByReference(); LongByReference maxRef = new LongByReference(); gst().gst_app_src_get_latency(this, minRef, minRef); if ((minmax == null) || (minmax.length != 2)) minmax = new long[2]; minmax[0] = minRef.getValue(); minmax[1] = maxRef.getValue(); }
public void setValue(long value) { getPointer().setLong(0, value); }
public void getLatency(long[] minmax) { LongByReference minRef = new LongByReference(); LongByReference maxRef = new LongByReference(); gst().gst_app_src_get_latency(this, minRef, minRef); if ((minmax == null) || (minmax.length != 2)) minmax = new long[2]; minmax[0] = minRef.getValue(); minmax[1] = maxRef.getValue(); }
public static void setCurrentThreadAffinityMask(final long mask) throws Exception { final CLibrary lib = CLibrary.INSTANCE; final int cpuMaskSize = Long.SIZE / 8; try { final int ret = lib.sched_setaffinity(0, cpuMaskSize, new LongByReference(mask)); if (ret < 0) { throw new Exception("sched_setaffinity( 0, (" + cpuMaskSize + ") , &(" + mask + ") ) return " + ret); } } catch (final Throwable e) { throw new Exception(e); } }
public long get() { return getValue().getValue(); } public void set(long v) {
public LongByReference(long value) { super(8); setValue(value); }
public long getValue() { return getPointer().getLong(0); } }
@Override public long getAffinity() { final CLibrary lib = CLibrary.INSTANCE; final LongByReference cpuset1 = new LongByReference(0); final LongByReference cpuset2 = new LongByReference(0); try { final int ret = lib.GetProcessAffinityMask(-1, cpuset1, cpuset2); if (ret < 0) throw new IllegalStateException("sched_getaffinity((" + Long.SIZE / 8 + ") , &(" + cpuset1 + ") ) return " + ret); return cpuset1.getValue(); } catch (Exception e) { e.printStackTrace(); } return 0; }
@Override public void setAffinity(final long affinity) { final CLibrary lib = CLibrary.INSTANCE; try { //fixme: where are systems with more then 64 cores... final int ret = lib.sched_setaffinity(0, Long.SIZE / 8, new LongByReference(affinity)); if (ret < 0) { throw new IllegalStateException("sched_setaffinity((" + Long.SIZE / 8 + ") , &(" + affinity + ") ) return " + ret); } } catch (LastErrorException e) { throw new IllegalStateException("sched_getaffinity((" + Long.SIZE / 8 + ") , &(" + affinity + ") ) errorNo=" + e.getErrorCode(), e); } } }
public long get() { return getValue().getValue(); } public void set(long v) {
public LongByReference(long value) { super(8); setValue(value); }
public long getValue() { return getPointer().getLong(0); } }
@Override public long getAffinity() { final CLibrary lib = CLibrary.INSTANCE; // TODO where are systems with 64+ cores... final LongByReference cpuset = new LongByReference(0L); try { final int ret = lib.sched_getaffinity(0, Long.SIZE / 8, cpuset); if (ret < 0) throw new IllegalStateException("sched_getaffinity((" + Long.SIZE / 8 + ") , &(" + cpuset + ") ) return " + ret); return cpuset.getValue(); } catch (LastErrorException e) { throw new IllegalStateException("sched_getaffinity((" + Long.SIZE / 8 + ") , &(" + cpuset + ") ) errorNo=" + e.getErrorCode(), e); } }
private long getLongSockopt(int option) { Memory value = new Memory(Long.SIZE / 8); LongByReference length = new LongByReference(Long.SIZE / 8); zmq.zmq_getsockopt(ptr, option, value, length); return value.getLong(0); }