_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q173700
NIOUtils.fetchFrom
test
public static ByteBuffer fetchFrom(ByteBuffer buf, ReadableByteChannel ch, int size) throws IOException { ByteBuffer result = buf.duplicate(); result.limit(size); NIOUtils.readFromChannel(ch, result); result.flip(); return result; }
java
{ "resource": "" }
q173701
H264Utils.joinNALUnits
test
public static ByteBuffer joinNALUnits(List<ByteBuffer> nalUnits) { int size = 0; for (ByteBuffer nal : nalUnits) { size += 4 + nal.remaining(); } ByteBuffer allocate = ByteBuffer.allocate(size); joinNALUnitsToBuffer(nalUnits, allocate); return allocate; }
java
{ "resource": "" }
q173702
H264Utils.joinNALUnitsToBuffer
test
public static void joinNALUnitsToBuffer(List<ByteBuffer> nalUnits, ByteBuffer out) { for (ByteBuffer nal : nalUnits) { out.putInt(1); out.put(nal.duplicate()); } }
java
{ "resource": "" }
q173703
Profile.forInt
test
public static Profile forInt(int i) { Profile p; if(i<=0||i>ALL.length) p = UNKNOWN; else p = ALL[i-1]; return p; }
java
{ "resource": "" }
q173704
BaseResampler.normalizeAndGenerateFixedPrecision
test
public static void normalizeAndGenerateFixedPrecision(double[] taps, int precBits, short[] out) { double sum = 0; for (int i = 0; i < taps.length; i++) { sum += taps[i]; } int sumFix = 0; int precNum = 1 << precBits; for (int i = 0; i < taps.length; i++) { ...
java
{ "resource": "" }
q173705
SegmentReader.readToNextMarkerPartial
test
public final State readToNextMarkerPartial(ByteBuffer out) throws IOException { if (done) return State.STOP; int skipOneMarker = curMarker >= 0x100 && curMarker <= 0x1ff ? 1 : 0; int written = out.position(); do { while (buf.hasRemaining()) { if (c...
java
{ "resource": "" }
q173706
SegmentReader.readToNextMarkerNewBuffer
test
public ByteBuffer readToNextMarkerNewBuffer() throws IOException { if (done) return null; List<ByteBuffer> buffers = new ArrayList<ByteBuffer>(); readToNextMarkerBuffers(buffers); return NIOUtils.combineBuffers(buffers); }
java
{ "resource": "" }
q173707
ImageSequenceDemuxer.getMaxAvailableFrame
test
public int getMaxAvailableFrame() { if (maxAvailableFrame == -1) { int firstPoint = 0; for (int i = MAX_MAX; i > 0; i /= 2) { if (new File(String.format(namePattern, i)).exists()) { firstPoint = i; break; } ...
java
{ "resource": "" }
q173708
InplaceMP4Editor.modify
test
public boolean modify(File file, MP4Edit edit) throws IOException { SeekableByteChannel fi = null; try { fi = NIOUtils.rwChannel(file); List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit); if (fragments == null) return false; ...
java
{ "resource": "" }
q173709
InplaceMP4Editor.copy
test
public boolean copy(File src, File dst, MP4Edit edit) throws IOException { SeekableByteChannel fi = null; SeekableByteChannel fo = null; try { fi = NIOUtils.readableChannel(src); fo = NIOUtils.writableChannel(dst); List<Tuple._2<Atom, ByteBuffer>> fragments =...
java
{ "resource": "" }
q173710
QTTimeUtil.getEditedDuration
test
public static long getEditedDuration(TrakBox track) { List<Edit> edits = track.getEdits(); if (edits == null) return track.getDuration(); long duration = 0; for (Edit edit : edits) { duration += edit.getDuration(); } return duration; }
java
{ "resource": "" }
q173711
QTTimeUtil.frameToTimevalue
test
public static long frameToTimevalue(TrakBox trak, int frameNumber) { TimeToSampleBox stts = NodeBox.findFirstPath(trak, TimeToSampleBox.class, Box.path("mdia.minf.stbl.stts")); TimeToSampleEntry[] timeToSamples = stts.getEntries(); long pts = 0; int sttsInd = 0, sttsSubInd = frameNumber;...
java
{ "resource": "" }
q173712
QTTimeUtil.timevalueToFrame
test
public static int timevalueToFrame(TrakBox trak, long tv) { TimeToSampleEntry[] tts = NodeBox.findFirstPath(trak, TimeToSampleBox.class, Box.path("mdia.minf.stbl.stts")).getEntries(); int frame = 0; for (int i = 0; tv > 0 && i < tts.length; i++) { long rem = tv / tts[i].getSampleDura...
java
{ "resource": "" }
q173713
QTTimeUtil.mediaToEdited
test
public static long mediaToEdited(TrakBox trak, long mediaTv, int movieTimescale) { if (trak.getEdits() == null) return mediaTv; long accum = 0; for (Edit edit : trak.getEdits()) { if (mediaTv < edit.getMediaTime()) return accum; long duration =...
java
{ "resource": "" }
q173714
QTTimeUtil.editedToMedia
test
public static long editedToMedia(TrakBox trak, long editedTv, int movieTimescale) { if (trak.getEdits() == null) return editedTv; long accum = 0; for (Edit edit : trak.getEdits()) { long duration = trak.rescale(edit.getDuration(), movieTimescale); if (accum +...
java
{ "resource": "" }
q173715
QTTimeUtil.qtPlayerFrameNo
test
public static int qtPlayerFrameNo(MovieBox movie, int mediaFrameNo) { TrakBox videoTrack = movie.getVideoTrack(); long editedTv = mediaToEdited(videoTrack, frameToTimevalue(videoTrack, mediaFrameNo), movie.getTimescale()); return tv2QTFrameNo(movie, editedTv); }
java
{ "resource": "" }
q173716
QTTimeUtil.qtPlayerTime
test
public static String qtPlayerTime(MovieBox movie, int mediaFrameNo) { TrakBox videoTrack = movie.getVideoTrack(); long editedTv = mediaToEdited(videoTrack, frameToTimevalue(videoTrack, mediaFrameNo), movie.getTimescale()); int sec = (int) (editedTv / videoTrack.getTimescale()); return S...
java
{ "resource": "" }
q173717
QTTimeUtil.timevalueToTimecodeFrame
test
public static int timevalueToTimecodeFrame(TrakBox timecodeTrack, RationalLarge tv, int movieTimescale) { TimecodeSampleEntry se = (TimecodeSampleEntry) timecodeTrack.getSampleEntries()[0]; return (int) ((2 * tv.multiplyS(se.getTimescale()) / se.getFrameDuration()) + 1) / 2; }
java
{ "resource": "" }
q173718
QTTimeUtil.formatTimecode
test
public static String formatTimecode(TrakBox timecodeTrack, int counter) { TimecodeSampleEntry tmcd = NodeBox.findFirstPath(timecodeTrack, TimecodeSampleEntry.class, Box.path("mdia.minf.stbl.stsd.tmcd")); byte nf = tmcd.getNumFrames(); String tc = String.format("%02d", counter % nf); cou...
java
{ "resource": "" }
q173719
Packed4BitList._7
test
public static int _7(int val0, int val1, int val2, int val3, int val4, int val5, int val6) { return (7 << 28) | ((val0 & 0xf) << 24) | ((val1 & 0xf) << 20) | ((val2 & 0xf) << 16) | ((val3 & 0xf) << 12) | ((val4 & 0xf) << 8) | ((val5 & 0xf) << 4) | ((val6 & 0xf)); }
java
{ "resource": "" }
q173720
Packed4BitList.set
test
public static int set(int list, int val, int n) { int cnt = (list >> 28) & 0xf; int newc = n + 1; cnt = newc > cnt ? newc : cnt; return (list & CLEAR_MASK[n]) | ((val & 0xff) << (n << 2)) | (cnt << 28); }
java
{ "resource": "" }
q173721
ColorSpace.matches
test
public boolean matches(ColorSpace inputColor) { if (inputColor == this) return true; if (inputColor == ANY || this == ANY) return true; if ((inputColor == ANY_INTERLEAVED || this == ANY_INTERLEAVED || inputColor == ANY_PLANAR || this == ANY_PLANAR) && inpu...
java
{ "resource": "" }
q173722
ColorSpace.compSize
test
public Size compSize(Size size, int comp) { if (compWidth[comp] == 0 && compHeight[comp] == 0) return size; return new Size(size.getWidth() >> compWidth[comp], size.getHeight() >> compHeight[comp]); }
java
{ "resource": "" }
q173723
MP4Demuxer.createRawMP4Demuxer
test
public static MP4Demuxer createRawMP4Demuxer(SeekableByteChannel input) throws IOException { return new MP4Demuxer(input) { @Override protected AbstractMP4DemuxerTrack newTrack(TrakBox trak) { return new MP4DemuxerTrack(movie, trak, this.input); } }; ...
java
{ "resource": "" }
q173724
BitStream.readCache
test
protected int readCache(boolean peek) throws AACException { int i; if(pos>buffer.length-WORD_BYTES) throw AACException.endOfStream(); else i = ((buffer[pos]&BYTE_MASK)<<24) |((buffer[pos+1]&BYTE_MASK)<<16) |((buffer[pos+2]&BYTE_MASK)<<8) |(buffer[pos+3]&BYTE_MASK); if(!peek) pos += WORD_BYTES; ...
java
{ "resource": "" }
q173725
WavHeader.createWavHeader
test
public static WavHeader createWavHeader(AudioFormat format, int samples) { WavHeader w = new WavHeader("RIFF", 40, "WAVE", new FmtChunk((short) 1, (short) format.getChannels(), format.getSampleRate(), format.getSampleRate() * format.getChannels() * (format.getSampleSizeInBits() >> 3), ...
java
{ "resource": "" }
q173726
WavHeader.multiChannelWav
test
public static WavHeader multiChannelWav(WavHeader[] headers) { WavHeader w = emptyWavHeader(); int totalSize = 0; for (int i = 0; i < headers.length; i++) { WavHeader wavHeader = headers[i]; totalSize += wavHeader.dataSize; } w.dataSize = totalSize; ...
java
{ "resource": "" }
q173727
AACDecoderConfig.parseMP4DecoderSpecificInfo
test
public static AACDecoderConfig parseMP4DecoderSpecificInfo(byte[] data) throws AACException { final IBitStream _in = BitStream.createBitStream(data); final AACDecoderConfig config = new AACDecoderConfig(); try { config.profile = readProfile(_in); int sf = _in.readBits(4); if(sf==0xF) config.sampleFrequ...
java
{ "resource": "" }
q173728
MQEncoder.encode
test
public void encode(int symbol, Context cm) throws IOException { int rangeLps = MQConst.pLps[cm.getState()]; if (symbol == cm.getMps()) { range -= rangeLps; offset += rangeLps; if (range < 0x8000) { while (range < 0x8000) renormaliz...
java
{ "resource": "" }
q173729
SliceHeaderReader.readDecoderPicMarking
test
private static void readDecoderPicMarking(NALUnit nalUnit, SliceHeader sh, BitReader _in) { if (nalUnit.type == NALUnitType.IDR_SLICE) { boolean noOutputOfPriorPicsFlag = readBool(_in, "SH: no_output_of_prior_pics_flag"); boolean longTermReferenceFlag = readBool(_in, "SH: long_term_refer...
java
{ "resource": "" }
q173730
Util.split
test
public static Pair<List<Edit>> split(MovieBox movie, TrakBox track, long tvMv) { return splitEdits(track.getEdits(), new Rational(track.getTimescale(), movie.getTimescale()), tvMv); }
java
{ "resource": "" }
q173731
Decoder.decodeFrame
test
public void decodeFrame(byte[] frame, SampleBuffer buffer) throws AACException { if (frame != null) _in.setData(frame); Logger.debug("bits left " + _in.getBitsLeft()); try { decode(buffer); } catch (AACException e) { if (!e.isEndOfStream()) ...
java
{ "resource": "" }
q173732
SampleBuffer.setBigEndian
test
public void setBigEndian(boolean bigEndian) { if(bigEndian!=this.bigEndian) { byte tmp; for(int i = 0; i<data.length; i += 2) { tmp = data[i]; data[i] = data[i+1]; data[i+1] = tmp; } this.bigEndian = bigEndian; } }
java
{ "resource": "" }
q173733
MBDeblocker.deblockMBP
test
public void deblockMBP(EncodedMB cur, EncodedMB left, EncodedMB top) { int[][] vertStrength = new int[4][4]; int[][] horizStrength = new int[4][4]; calcStrengthForBlocks(cur, left, vertStrength, LOOKUP_IDX_P_V, LOOKUP_IDX_Q_V); calcStrengthForBlocks(cur, top, horizStrength, LOOKUP_IDX_P...
java
{ "resource": "" }
q173734
SequenceEncoder.encodeNativeFrame
test
public void encodeNativeFrame(Picture pic) throws IOException { if (pic.getColor() != ColorSpace.RGB) throw new IllegalArgumentException("The input images is expected in RGB color."); ColorSpace sinkColor = sink.getInputColor(); LoanerPicture toEncode; if (sinkColor != null) { toEncode = pixelStore.getPi...
java
{ "resource": "" }
q173735
EbmlUtil.ebmlEncodeLen
test
public static byte[] ebmlEncodeLen(long value, int length) { byte[] b = new byte[length]; for (int idx = 0; idx < length; idx++) { // Rightmost bytes should go to end of array to preserve big-endian notation b[length - idx - 1] = (byte) ((value >>> (8 * idx)) & 0xFFL); } ...
java
{ "resource": "" }
q173736
EbmlUtil.ebmlLength
test
public static int ebmlLength(long v) { if (v == 0) return 1; int length = 8; while (length > 0 && (v & ebmlLengthMasks[length]) == 0) length--; return length; }
java
{ "resource": "" }
q173737
FLVWriter.addPacket
test
public void addPacket(FLVTag pkt) throws IOException { if (!writePacket(writeBuf, pkt)) { writeBuf.flip(); startOfLastPacket -= out.write(writeBuf); writeBuf.clear(); if (!writePacket(writeBuf, pkt)) throw new RuntimeException("Unexpected"); ...
java
{ "resource": "" }
q173738
FLVReader.repositionFile
test
public boolean repositionFile() throws IOException { int payloadSize = 0; for (int i = 0; i < REPOSITION_BUFFER_READS; i++) { while (readBuf.hasRemaining()) { payloadSize = ((payloadSize & 0xffff) << 8) | (readBuf.get() & 0xff); int pointerPos = readBuf.positi...
java
{ "resource": "" }
q173739
MDecoder.decodeBin
test
public int decodeBin(int m) { int bin; int qIdx = (range >> 6) & 0x3; int rLPS = MConst.rangeLPS[qIdx][cm[0][m]]; range -= rLPS; int rs8 = range << 8; if (code < rs8) { // MPS if (cm[0][m] < 62) cm[0][m]++; renormaliz...
java
{ "resource": "" }
q173740
MDecoder.decodeBinBypass
test
public int decodeBinBypass() { code <<= 1; --nBitsPending; if (nBitsPending <= 0) readOneByte(); int tmp = code - (range << 8); if (tmp < 0) { // System.out.println("CABAC BIT [-1]: 0"); return 0; } else { // System.out.prin...
java
{ "resource": "" }
q173741
MPEGUtil.gotoMarker
test
public static final ByteBuffer gotoMarker(ByteBuffer buf, int n, int mmin, int mmax) { if (!buf.hasRemaining()) return null; int from = buf.position(); ByteBuffer result = buf.slice(); result.order(ByteOrder.BIG_ENDIAN); int val = 0xffffffff; while (buf.hasR...
java
{ "resource": "" }
q173742
SampleFrequency.forInt
test
public static SampleFrequency forInt(int i) { final SampleFrequency freq; if (i >= 0 && i < 12) freq = values()[i]; else freq = SAMPLE_FREQUENCY_NONE; return freq; }
java
{ "resource": "" }
q173743
MPEGPredDbl.predictPlane
test
@Override public void predictPlane(byte[] ref, int refX, int refY, int refW, int refH, int refVertStep, int refVertOff, int[] tgt, int tgtY, int tgtW, int tgtH, int tgtVertStep) { super.predictPlane(ref, refX << 1, refY << 1, refW, refH, refVertStep, refVertOff, tgt, tgtY, tgtW << 2, tgtH << 2, ...
java
{ "resource": "" }
q173744
SparseIDCT.start
test
public static final void start(int[] block, int dc) { dc <<= DC_SHIFT; for (int i = 0; i < 64; i += 4) { block[i + 0] = dc; block[i + 1] = dc; block[i + 2] = dc; block[i + 3] = dc; } }
java
{ "resource": "" }
q173745
SparseIDCT.coeff
test
public static final void coeff(int[] block, int ind, int level) { for (int i = 0; i < 64; i += 4) { block[i] += COEFF[ind][i] * level; block[i + 1] += COEFF[ind][i + 1] * level; block[i + 2] += COEFF[ind][i + 2] * level; block[i + 3] += COEFF[ind][i + 3] * level; ...
java
{ "resource": "" }
q173746
SparseIDCT.finish
test
public static final void finish(int block[]) { for (int i = 0; i < 64; i += 4) { block[i] = div(block[i]); block[i + 1] = div(block[i + 1]); block[i + 2] = div(block[i + 2]); block[i + 3] = div(block[i + 3]); } }
java
{ "resource": "" }
q173747
BitsBuffer.concatBits
test
public void concatBits(BitsBuffer a) { if(a.len==0) return; int al = a.bufa; int ah = a.bufb; int bl, bh; if(len>32) { //mask off superfluous high b bits bl = bufa; bh = bufb&((1<<(len-32))-1); //left shift a len bits ah = al<<(len-32); al = 0; } else { bl = bufa&((1<<(len))-1); b...
java
{ "resource": "" }
q173748
BitsBuffer.rewindReverse32
test
static int rewindReverse32(int v, int len) { v = ((v>>S[0])&B[0])|((v<<S[0])&~B[0]); v = ((v>>S[1])&B[1])|((v<<S[1])&~B[1]); v = ((v>>S[2])&B[2])|((v<<S[2])&~B[2]); v = ((v>>S[3])&B[3])|((v<<S[3])&~B[3]); v = ((v>>S[4])&B[4])|((v<<S[4])&~B[4]); //shift off low bits ...
java
{ "resource": "" }
q173749
BitsBuffer.rewindReverse64
test
static int[] rewindReverse64(int hi, int lo, int len) { int[] i = new int[2]; if(len<=32) { i[0] = 0; i[1] = rewindReverse32(lo, len); } else { lo = ((lo>>S[0])&B[0])|((lo<<S[0])&~B[0]); hi = ((hi>>S[0])&B[0])|((hi<<S[0])&~B[0]); lo = ((lo>>S[1])&B[1])|((lo<<S[1])&~B[1]...
java
{ "resource": "" }
q173750
SourceImpl.seekToKeyFrame
test
protected int seekToKeyFrame(int frame) throws IOException { if (videoInputTrack instanceof SeekableDemuxerTrack) { SeekableDemuxerTrack seekable = (SeekableDemuxerTrack) videoInputTrack; seekable.gotoSyncFrame(frame); return (int) seekable.getCurFrame(); } else { ...
java
{ "resource": "" }
q173751
SourceImpl.getPixelBuffer
test
protected LoanerPicture getPixelBuffer(ByteBuffer firstFrame) { VideoCodecMeta videoMeta = getVideoCodecMeta(); Size size = videoMeta.getSize(); return pixelStore.getPicture((size.getWidth() + 15) & ~0xf, (size.getHeight() + 15) & ~0xf, videoMeta.getColor()); }
java
{ "resource": "" }
q173752
GainControl.getGainChangePointID
test
private int getGainChangePointID(int lngain) { for(int i = 0; i<ID_GAIN; i++) { if(lngain==LN_GAIN[i]) return i; } return 0; //shouldn't happen }
java
{ "resource": "" }
q173753
DataConvert.fromByte
test
public static int[] fromByte(byte[] b, int depth, boolean isBe) { if (depth == 24) if (isBe) return from24BE(b); else return from24LE(b); else if (depth == 16) if (isBe) return from16BE(b); else ...
java
{ "resource": "" }
q173754
DataConvert.toByte
test
public static byte[] toByte(int[] ia, int depth, boolean isBe) { if (depth == 24) if (isBe) return to24BE(ia); else return to24LE(ia); else if (depth == 16) if (isBe) return to16BE(ia); else r...
java
{ "resource": "" }
q173755
AudioUtil.toFloat
test
public static void toFloat(AudioFormat format, ByteBuffer buf, FloatBuffer floatBuf) { if (!format.isSigned()) throw new NotSupportedException("Unsigned PCM is not supported ( yet? )."); if (format.getSampleSizeInBits() != 16 && format.getSampleSizeInBits() != 24) throw new NotS...
java
{ "resource": "" }
q173756
AudioUtil.fromFloat
test
public static void fromFloat(FloatBuffer floatBuf, AudioFormat format, ByteBuffer buf) { if (!format.isSigned()) throw new NotSupportedException("Unsigned PCM is not supported ( yet? )."); if (format.getSampleSizeInBits() != 16 && format.getSampleSizeInBits() != 24) throw new No...
java
{ "resource": "" }
q173757
AudioUtil.interleave
test
public static void interleave(AudioFormat format, ByteBuffer[] ins, ByteBuffer outb) { int bytesPerSample = format.getSampleSizeInBits() >> 3; int bytesPerFrame = bytesPerSample * ins.length; int max = 0; for (int i = 0; i < ins.length; i++) if (ins[i].remaining() > max) ...
java
{ "resource": "" }
q173758
AudioUtil.deinterleave
test
public static void deinterleave(AudioFormat format, ByteBuffer inb, ByteBuffer[] outs) { int bytesPerSample = format.getSampleSizeInBits() >> 3; int bytesPerFrame = bytesPerSample * outs.length; while (inb.remaining() >= bytesPerFrame) { for (int j = 0; j < outs.length; j++) { ...
java
{ "resource": "" }
q173759
TrakBox.getCodedSize
test
public Size getCodedSize() { SampleEntry se = getSampleEntries()[0]; if (!(se instanceof VideoSampleEntry)) throw new IllegalArgumentException("Not a video track"); VideoSampleEntry vse = (VideoSampleEntry) se; return new Size(vse.getWidth(), vse.getHeight()); }
java
{ "resource": "" }
q173760
SliceGroupMapBuilder.buildBoxOutMap
test
public static int[] buildBoxOutMap(int picWidthInMbs, int picHeightInMbs, boolean changeDirection, int numberOfMbsInBox) { int picSizeInMbs = picWidthInMbs * picHeightInMbs; int[] groups = new int[picSizeInMbs]; int changeDirectionInt = changeDirection ? 1 : 0; for (int i =...
java
{ "resource": "" }
q173761
SliceGroupMapBuilder.buildWipeMap
test
public static int[] buildWipeMap(int picWidthInMbs, int picHeightInMbs, int sizeOfUpperLeftGroup, boolean changeDirection) { int picSizeInMbs = picWidthInMbs * picHeightInMbs; int[] groups = new int[picSizeInMbs]; int changeDirectionInt = changeDirection ? 1 : 0; int k = 0;...
java
{ "resource": "" }
q173762
MXFMetadata.readULBatch
test
protected static UL[] readULBatch(ByteBuffer _bb) { int count = _bb.getInt(); _bb.getInt(); UL[] result = new UL[count]; for (int i = 0; i < count; i++) { result[i] = UL.read(_bb); } return result; }
java
{ "resource": "" }
q173763
MXFMetadata.readInt32Batch
test
protected static int[] readInt32Batch(ByteBuffer _bb) { int count = _bb.getInt(); _bb.getInt(); int[] result = new int[count]; for (int i = 0; i < count; i++) { result[i] = _bb.getInt(); } return result; }
java
{ "resource": "" }
q173764
MBlockDecoderUtils.calcMVPredictionMedian
test
public static int calcMVPredictionMedian(int a, int b, int c, int d, boolean aAvb, boolean bAvb, boolean cAvb, boolean dAvb, int ref, int comp) { if (!cAvb) { c = d; cAvb = dAvb; } if (aAvb && !bAvb && !cAvb) { b = c = a; bAvb = cAvb ...
java
{ "resource": "" }
q173765
H264Encoder.encodeFrame
test
public EncodedFrame encodeFrame(Picture pic, ByteBuffer _out) { if (pic.getColor() != ColorSpace.YUV420J) throw new IllegalArgumentException("Input picture color is not supported: " + pic.getColor()); if (frameNumber >= keyInterval) { frameNumber = 0; } ...
java
{ "resource": "" }
q173766
H264Encoder.encodeIDRFrame
test
public ByteBuffer encodeIDRFrame(Picture pic, ByteBuffer _out) { frameNumber = 0; return doEncodeFrame(pic, _out, true, frameNumber, SliceType.I); }
java
{ "resource": "" }
q173767
H264Encoder.encodePFrame
test
public ByteBuffer encodePFrame(Picture pic, ByteBuffer _out) { frameNumber++; return doEncodeFrame(pic, _out, true, frameNumber, SliceType.P); }
java
{ "resource": "" }
q173768
ContainerFormat.getSupportedCodecs
test
public java.util.Collection<Codec.ID> getSupportedCodecs() { final java.util.List<Codec.ID> retval = new java.util.LinkedList<Codec.ID>(); final java.util.Set<Codec.ID> uniqueSet = new java.util.HashSet<Codec.ID>(); int numCodecs = getNumSupportedCodecs(); for(int i = 0; i < n...
java
{ "resource": "" }
q173769
ContainerFormat.getSupportedTags
test
public java.util.Collection<Long> getSupportedTags() { final java.util.List<Long> retval = new java.util.LinkedList<Long>(); final java.util.Set<Long> uniqueSet = new java.util.HashSet<Long>(); int numCodecs = getNumSupportedCodecs(); for(int i = 0; i < numCodecs; i++) { ...
java
{ "resource": "" }
q173770
JNIMemoryManager.addReference
test
final boolean addReference(final JNIReference ref) { /* Implementation note: This method is extremely * hot, and so I've unrolled the lock and unlock * methods from above. Take care if you change * them to change the unrolled versions here. * */ // First try to grab the non blocking...
java
{ "resource": "" }
q173771
JNIMemoryManager.gcInternal
test
void gcInternal() { JNIReference ref = null; while ((ref = (JNIReference) mRefQueue.poll()) != null) { ref.delete(); } }
java
{ "resource": "" }
q173772
JNIMemoryManager.flush
test
final public void flush() { blockingLock(); try { int numSurvivors = sweepAndCollect(); for(int i = 0; i < numSurvivors; i++) { final JNIReference ref = mValidReferences[i]; if (ref != null) ref.delete(); } sweepAndCollect(); // finally, reset the ...
java
{ "resource": "" }
q173773
JNILibrary.load
test
@SuppressWarnings("deprecation") public static void load(String appname, JNILibrary library) { // we force ALL work on all libraries to be synchronized synchronized (mLock) { deleteTemporaryFiles(); try { library.load(appname); } catch (UnsatisfiedLinkError e) { // failed; fa...
java
{ "resource": "" }
q173774
JNILibrary.unpackLibrary
test
private boolean unpackLibrary(String path) { boolean retval = false; try { final Enumeration<URL> c = JNILibrary.class.getClassLoader() .getResources(path); while (c.hasMoreElements()) { final URL url = c.nextElement(); log.trace("path: {}; url: {}", path, url); i...
java
{ "resource": "" }
q173775
JNILibrary.deleteTemporaryFiles
test
private static void deleteTemporaryFiles() { final File dir = getTmpDir(); final FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(HUMBLE_TEMP_EXTENSION); } }; final File markers[] = dir.listFiles(filter); for (File...
java
{ "resource": "" }
q173776
AudioChannel.getDefaultLayout
test
public static AudioChannel.Layout getDefaultLayout(int numChannels) { return AudioChannel.Layout.swigToEnum(VideoJNI.AudioChannel_getDefaultLayout(numChannels)); }
java
{ "resource": "" }
q173777
AudioChannel.getChannelFromLayoutAtIndex
test
public static AudioChannel.Type getChannelFromLayoutAtIndex(AudioChannel.Layout layout, int index) { return AudioChannel.Type.swigToEnum(VideoJNI.AudioChannel_getChannelFromLayoutAtIndex(layout.swigValue(), index)); }
java
{ "resource": "" }
q173778
MediaPacket.make
test
public static MediaPacket make() { long cPtr = VideoJNI.MediaPacket_make__SWIG_0(); return (cPtr == 0) ? null : new MediaPacket(cPtr, false); }
java
{ "resource": "" }
q173779
Version.getVersionInfo
test
public static String getVersionInfo() { final Class<?> c = Version.class; final StringBuilder b = new StringBuilder(); final Package p = c.getPackage(); b.append("Class: " + c.getCanonicalName() + "; "); b.append("Specification Vendor: " + p.getSpecificationVendor() + "; "); b.append("Speci...
java
{ "resource": "" }
q173780
Global.getDefaultTimeBase
test
public static Rational getDefaultTimeBase() { long cPtr = VideoJNI.Global_getDefaultTimeBase(); return (cPtr == 0) ? null : new Rational(cPtr, false); }
java
{ "resource": "" }
q173781
Demuxer.make
test
public static Demuxer make() { long cPtr = VideoJNI.Demuxer_make(); return (cPtr == 0) ? null : new Demuxer(cPtr, false); }
java
{ "resource": "" }
q173782
DecodeAndPlayVideo.playVideo
test
private static void playVideo(String filename) throws InterruptedException, IOException { /* * Start by creating a container object, in this case a demuxer since * we are reading, to get video data from. */ Demuxer demuxer = Demuxer.make(); /* * Open the demuxer with the filename passed...
java
{ "resource": "" }
q173783
DecodeAndPlayVideo.displayVideoAtCorrectTime
test
private static BufferedImage displayVideoAtCorrectTime(long streamStartTime, final MediaPicture picture, final MediaPictureConverter converter, BufferedImage image, final ImageFrame window, long systemStartTime, final Rational systemTimeBase, final Rational streamTimebase) throws InterruptedExce...
java
{ "resource": "" }
q173784
CodecDescriptor.make
test
public static CodecDescriptor make(Codec.ID id) { long cPtr = VideoJNI.CodecDescriptor_make(id.swigValue()); return (cPtr == 0) ? null : new CodecDescriptor(cPtr, false); }
java
{ "resource": "" }
q173785
Configuration.printOption
test
public static void printOption(java.io.PrintStream stream, Configurable configObj, Property prop) { if (prop.getType() != Property.Type.PROPERTY_FLAGS) { stream.printf(" %s; default= %s; type=%s;\n", prop.getName(), configObj.getPropertyAsString(prop.getName()), prop...
java
{ "resource": "" }
q173786
HumbleIO.registerFactory
test
static HumbleIO registerFactory(String protocolPrefix) { URLProtocolManager manager = URLProtocolManager.getManager(); manager.registerFactory(protocolPrefix, mFactory); return mFactory; }
java
{ "resource": "" }
q173787
HumbleIO.generateUniqueName
test
static public String generateUniqueName(Object src, String extension) { StringBuilder builder = new StringBuilder(); builder.append(UUID.randomUUID().toString()); if (src != null) { builder.append("-"); builder.append(src.getClass().getName()); builder.append("-"); builder.appe...
java
{ "resource": "" }
q173788
MediaAudioResampler.make
test
public static MediaAudioResampler make(AudioChannel.Layout outLayout, int outSampleRate, AudioFormat.Type outFormat, AudioChannel.Layout inLayout, int inSampleRate, AudioFormat.Type inFormat) { long cPtr = VideoJNI.MediaAudioResampler_make(outLayout.swigValue(), outSampleRate, outFormat.swigValue(), inLayout.swigVa...
java
{ "resource": "" }
q173789
Codec.getSupportedVideoFrameRates
test
public java.util.Collection<Rational> getSupportedVideoFrameRates() { java.util.List<Rational> retval = new java.util.LinkedList<Rational>(); int count = getNumSupportedVideoFrameRates(); for(int i=0;i<count;i++) { Rational rate = getSupportedVideoFrameRate(i); if (rate != null) ...
java
{ "resource": "" }
q173790
Codec.getSupportedVideoPixelFormats
test
public java.util.Collection<PixelFormat.Type> getSupportedVideoPixelFormats() { java.util.List<PixelFormat.Type> retval = new java.util.LinkedList<PixelFormat.Type>(); int count = getNumSupportedVideoPixelFormats(); for(int i=0;i<count;i++) { PixelFormat.Type type = getSupportedVideoPixe...
java
{ "resource": "" }
q173791
Codec.getSupportedAudioSampleRates
test
public java.util.Collection<Integer> getSupportedAudioSampleRates() { java.util.List<Integer> retval = new java.util.LinkedList<Integer>(); int count = getNumSupportedAudioSampleRates(); for(int i=0;i<count;i++) { int rate = getSupportedAudioSampleRate(i); if (rate != 0) re...
java
{ "resource": "" }
q173792
Codec.getSupportedAudioFormats
test
public java.util.Collection<AudioFormat.Type> getSupportedAudioFormats() { java.util.List<AudioFormat.Type> retval = new java.util.LinkedList<AudioFormat.Type>(); int count = getNumSupportedAudioFormats(); for(int i=0;i<count;i++) { AudioFormat.Type fmt = getSupportedAudioFormat(i); ...
java
{ "resource": "" }
q173793
Codec.getSupportedAudioChannelLayouts
test
public java.util.Collection<AudioChannel.Layout> getSupportedAudioChannelLayouts() { java.util.List<AudioChannel.Layout> retval = new java.util.LinkedList<AudioChannel.Layout>(); int count = getNumSupportedAudioChannelLayouts(); for(int i=0;i<count;i++) { AudioChannel.Layout layout = get...
java
{ "resource": "" }
q173794
Coder.setFlag
test
public void setFlag(Coder.Flag flag, boolean value) { VideoJNI.Coder_setFlag(swigCPtr, this, flag.swigValue(), value); }
java
{ "resource": "" }
q173795
Coder.setFlag2
test
public void setFlag2(Coder.Flag2 flag, boolean value) { VideoJNI.Coder_setFlag2(swigCPtr, this, flag.swigValue(), value); }
java
{ "resource": "" }
q173796
DemuxerStream.getDecoder
test
public Decoder getDecoder() { long cPtr = VideoJNI.DemuxerStream_getDecoder(swigCPtr, this); return (cPtr == 0) ? null : new Decoder(cPtr, false); }
java
{ "resource": "" }
q173797
DemuxerStream.getDemuxer
test
public Demuxer getDemuxer() { long cPtr = VideoJNI.DemuxerStream_getDemuxer(swigCPtr, this); return (cPtr == 0) ? null : new Demuxer(cPtr, false); }
java
{ "resource": "" }
q173798
MuxerFormat.getFormats
test
public static java.util.Collection<MuxerFormat> getFormats() { java.util.Collection<MuxerFormat> retval = new java.util.HashSet<MuxerFormat>(); int count = getNumFormats(); for(int i = 0; i< count;++i) { MuxerFormat fmt = getFormat(i); if (fmt != null) retval.add(fmt); ...
java
{ "resource": "" }
q173799
FilterGraph.make
test
public static FilterGraph make() { long cPtr = VideoJNI.FilterGraph_make(); return (cPtr == 0) ? null : new FilterGraph(cPtr, false); }
java
{ "resource": "" }