Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 130) sorted by relevance

123456

/cts/suite/audio_quality/lib/src/audio/
DAudioSignalFactory.cpp28 android::sp<Buffer> buffer(new Buffer(bufferSize)); in generateSineWave() local
31 int16_t* data = reinterpret_cast<int16_t*>(buffer->getData()); in generateSineWave()
42 buffer->setSize(buffer->getCapacity()); in generateSineWave()
43 return buffer; in generateSineWave()
49 android::sp<Buffer> buffer(new Buffer(bufferSize, bufferSize)); in generateWhiteNoise() local
53 int16_t* data = reinterpret_cast<int16_t*>(buffer->getData()); in generateWhiteNoise()
66 buffer->setSize(buffer->getCapacity()); in generateWhiteNoise()
67 return buffer; in generateWhiteNoise()
74 android::sp<Buffer> buffer(new Buffer(bufferSize, bufferSize)); in generateZeroSound() local
77 int16_t* data = reinterpret_cast<int16_t*>(buffer->getData()); in generateZeroSound()
[all …]
DAudioPlaybackLocal.cpp82 bool AudioPlaybackLocal::doPlaybackOrRecord(android::sp<Buffer>& buffer) in doPlaybackOrRecord() argument
84 if (buffer->amountToHandle() < (size_t)mSizes) { in doPlaybackOrRecord()
85 mSizes = buffer->amountToHandle(); in doPlaybackOrRecord()
87 if (pcm_write(mPcmHandle, buffer->getUnhanledData(), mSizes)) { in doPlaybackOrRecord()
91 buffer->increaseHandled(mSizes); in doPlaybackOrRecord()
92 LOGV("AudioPlaybackLocal::doPlaybackOrRecord %d", buffer->amountHandled()); in doPlaybackOrRecord()
DAudioRecordingLocal.cpp71 bool AudioRecordingLocal::doPlaybackOrRecord(android::sp<Buffer>& buffer) in doPlaybackOrRecord() argument
74 if (buffer->amountToHandle() < (size_t)mSizes) { in doPlaybackOrRecord()
75 toRead = buffer->amountToHandle(); in doPlaybackOrRecord()
81 if (pcm_read(mPcmHandle, buffer->getUnhanledData(), readSize)) { in doPlaybackOrRecord()
85 buffer->increaseHandled(readSize); in doPlaybackOrRecord()
88 LOGV("AudioRecordingLocal::doPlaybackOrRecord %d", buffer->amountHandled()); in doPlaybackOrRecord()
DAudioRemote.cpp45 bool AudioRemotePlayback::startPlaybackOrRecord(android::sp<Buffer>& buffer, int numberRepetition) in startPlaybackOrRecord() argument
72 bool AudioRemoteRecording::startPlaybackOrRecord(android::sp<Buffer>& buffer, in startPlaybackOrRecord() argument
75 bool stereo = buffer->isStereo(); in startPlaybackOrRecord()
76 return mRemote->startRecording(stereo, mSamplingRate, mMode, mVolume, buffer); in startPlaybackOrRecord()
/cts/libs/json/src/com/android/json/stream/
DJsonReader.java187 private final char[] buffer = new char[1024]; field in JsonReader
650 if ((pos < limit || fillBuffer(1)) && buffer[pos] == '>') { in objectValue()
693 System.arraycopy(buffer, pos, buffer, 0, limit); in fillBuffer()
700 while ((total = in.read(buffer, limit, buffer.length - limit)) != -1) { in fillBuffer()
711 int c = buffer[pos++]; in nextNonWhitespace()
725 char peek = buffer[pos]; in nextNonWhitespace()
777 char c = buffer[pos++]; in skipToEndOfLine()
788 if (buffer[pos + c] != toFind.charAt(c)) { in skipTo()
813 int c = buffer[pos++]; in nextString()
819 return new String(buffer, start, pos - start - 1); in nextString()
[all …]
/cts/tests/tests/content/src/android/content/res/cts/
DRawResourceTest.java44 final byte[] buffer = new byte[10]; in verifyTextAsset()
48 while ((readCount = is.read(buffer, 0, buffer.length)) > 0) { in verifyTextAsset()
52 + " but found " + ((char) buffer[i]), in verifyTextAsset()
53 buffer[i], expectedString.charAt(curIndex)); in verifyTextAsset()
58 readCount = is.read(buffer, 0, buffer.length); in verifyTextAsset()
62 readCount = is.read(buffer, buffer.length, 0); in verifyTextAsset()
/cts/tools/dex-tools/src/dex/reader/
DDexEncodedValueImpl.java30 private final DexBuffer buffer; field in DexEncodedValueImpl
47 public DexEncodedValueImpl(DexBuffer buffer, DexAnnotation annotation, in DexEncodedValueImpl() argument
49 this.buffer = buffer; in DexEncodedValueImpl()
58 typeAndValueArg = buffer.readUByte(); in parseValue()
136 return new DexEncodedAnnotationImpl(buffer, annotation, typeIds, in getAnnotationValue()
146 int size = buffer.readUleb128(); in getArrayValue()
149 values.add(new DexEncodedValueImpl(buffer, annotation, typeIds, in getArrayValue()
161 int fieldOffset = buffer.readInt(valueArg + 1); in getEnumValue()
176 buffer.skip(valueArg + 1); in getMethodValue()
186 int fieldOffset = buffer.readInt(valueArg + 1); in getFieldValue()
[all …]
DDexClassImpl.java41 private final DexBuffer buffer; field in DexClassImpl
69 public DexClassImpl(DexBuffer buffer, ClassDefItem classDefItem, in DexClassImpl() argument
72 this.buffer = buffer; in DexClassImpl()
120 buffer.setPosition(classDefItem.annotations_off); in parseAnnotationDirectory()
122 annotationDir.class_annotations_off = buffer.readUInt(); in parseAnnotationDirectory()
123 annotationDir.fields_size = buffer.readUInt(); in parseAnnotationDirectory()
124 annotationDir.methods_size = buffer.readUInt(); in parseAnnotationDirectory()
125 annotationDir.annotated_params_size = buffer.readUInt(); in parseAnnotationDirectory()
132 annotationDir.fieldAnnotations[i].fieldIdx = buffer in parseAnnotationDirectory()
134 annotationDir.fieldAnnotations[i].annotationsOff = buffer in parseAnnotationDirectory()
[all …]
DDexParameterImpl.java31 private final DexBuffer buffer; field in DexParameterImpl
36 public DexParameterImpl(DexBuffer buffer, String typeName, in DexParameterImpl() argument
39 this.buffer = buffer; in DexParameterImpl()
51 buffer.setPosition(annotationOffset); in parseAnnotations()
52 final int size = buffer.readUInt(); in parseAnnotations()
54 annotations.add(new DexAnnotationImpl(buffer.createCopy(), in parseAnnotations()
55 buffer.readUInt(), typeIds, stringPool, fieldIdItems)); in parseAnnotations()
DDexMethodImpl.java39 private DexBuffer buffer; field in DexMethodImpl
54 public DexMethodImpl(DexBuffer buffer, DexClass declaringClass, in DexMethodImpl() argument
59 this.buffer = buffer; in DexMethodImpl()
76 buffer.setPosition(parameterAnnotation.annotationsOff); in parseParameterAnnotations()
77 int numberOfParameters = buffer.readUInt(); in parseParameterAnnotations()
79 parameterIdToIndex.put(i, buffer.readUInt()); in parseParameterAnnotations()
87 buffer.setPosition(methodAnnotation.annotationsOff); in parseAnnotations()
88 final int size = buffer.readUInt(); in parseAnnotations()
90 annotations.add(new DexAnnotationImpl(buffer.createCopy(), in parseAnnotations()
91 buffer.readUInt(), typeIds, stringPool, fieldIdItems)); in parseAnnotations()
[all …]
DDexEncodedAnnotationImpl.java32 private final DexBuffer buffer; field in DexEncodedAnnotationImpl
39 public DexEncodedAnnotationImpl(DexBuffer buffer, DexAnnotation annotation, in DexEncodedAnnotationImpl() argument
41 this.buffer = buffer; in DexEncodedAnnotationImpl()
50 typeIdx = buffer.readUleb128(); in parseEncodedAnnotation()
51 int size = buffer.readUleb128(); in parseEncodedAnnotation()
54 values.add(new DexAnnotationAttributeImpl(buffer, annotation, in parseEncodedAnnotation()
DDexAnnotationImpl.java29 private DexBuffer buffer; field in DexAnnotationImpl
38 public DexAnnotationImpl(DexBuffer buffer, int offset, int[] typeIds, in DexAnnotationImpl() argument
40 this.buffer = buffer; in DexAnnotationImpl()
49 buffer.setPosition(offset); in parseAnnotations()
50 visibility = Visibility.get(buffer.readUByte()); in parseAnnotations()
51 encodedAnnotation = new DexEncodedAnnotationImpl(buffer, this, typeIds, in parseAnnotations()
DDexAnnotationAttributeImpl.java29 private DexBuffer buffer; field in DexAnnotationAttributeImpl
34 public DexAnnotationAttributeImpl(DexBuffer buffer, in DexAnnotationAttributeImpl() argument
37 this.buffer = buffer; in DexAnnotationAttributeImpl()
46 nameIdx = buffer.readUleb128(); in parseValue()
47 value = new DexEncodedValueImpl(buffer, annotation, typeIds, in parseValue()
DDexFieldImpl.java31 private DexBuffer buffer; field in DexFieldImpl
42 public DexFieldImpl(DexBuffer buffer, DexClass declaringClass, in DexFieldImpl() argument
46 this.buffer = buffer; in DexFieldImpl()
60 buffer.setPosition(fieldAnnotation.annotationsOff); in parseAnnotations()
61 final int size = buffer.readUInt(); in parseAnnotations()
63 annotations.add(new DexAnnotationImpl(buffer.createCopy(), in parseAnnotations()
64 buffer.readUInt(), typeIds, stringPool, fieldIdItems)); in parseAnnotations()
DDexFileImpl.java38 private final DexBuffer buffer; field in DexFileImpl
42 public DexFileImpl(DexBuffer buffer, String[] stringPool, int[] typeIds, in DexFileImpl() argument
45 this.buffer = buffer; in DexFileImpl()
63 classes.add(new DexClassImpl(buffer.createCopy(), in getDefinedClasses()
/cts/suite/audio_quality/test/
DBufferTest.cpp41 UniquePtr<Buffer> buffer(new Buffer(BUFFER_SIZE, BUFFER_SIZE, true)); in TEST_F() local
42 ASSERT_TRUE(buffer.get() != NULL); in TEST_F()
43 int16_t* data = (int16_t*)buffer->getData(); in TEST_F()
50 ASSERT_TRUE(buffer->saveToFile(file)); in TEST_F()
66 UniquePtr<Buffer> buffer(new Buffer(BUFFER_SIZE, BUFFER_SIZE, true)); in TEST_F() local
67 ASSERT_TRUE(buffer.get() != NULL); in TEST_F()
68 int16_t* data = (int16_t*)buffer->getData(); in TEST_F()
80 buffer->changeToMono(Buffer::EKeepCh0); in TEST_F()
81 ASSERT_TRUE((*buffer) == (*bufferl)); in TEST_F()
DAudioSignalFactoryTest.cpp25 void testSignalBasic(android::sp<Buffer>& buffer, int maxPositive, in testSignalBasic() argument
27 ASSERT_TRUE(buffer->getSize() == (unsigned int)(AudioHardware::E2BPS * 2 * samples)); in testSignalBasic()
28 int16_t* data = reinterpret_cast<int16_t*>(buffer->getData()); in testSignalBasic()
44 android::sp<Buffer> buffer = AudioSignalFactory::generateSineWave(AudioHardware::E2BPS, in TEST_F() local
46 testSignalBasic(buffer, maxPositive, AudioHardware::ESampleRate_44100, signalFreq, samples); in TEST_F()
53 android::sp<Buffer> buffer = AudioSignalFactory::generateWhiteNoise(AudioHardware::E2BPS, in TEST_F() local
55 testSignalBasic(buffer, maxPositive, AudioHardware::ESampleRate_44100, signalFreq, samples); in TEST_F()
DClientInterfaceTest.cpp67 android::sp<Buffer> buffer = AudioSignalFactory::generateSineWave(AudioHardware::E2BPS, in TEST_F() local
71 ASSERT_TRUE(audio->downloadData(name, buffer, id)); in TEST_F()
86 android::sp<Buffer> buffer(new Buffer(samples * 2, samples * 2, false)); in TEST_F() local
89 AudioHardware::EModeVoice, 100, buffer)); in TEST_F()
91 ASSERT_TRUE(buffer->amountHandled() == (samples * 2)); in TEST_F()
/cts/suite/audio_quality/lib/src/
DSignalProcessingImpl.cpp129 android::sp<Buffer>* buffer = reinterpret_cast<android::sp<Buffer>*>(inputs[i]); in run() local
130 mBuffer.write<int32_t>((int32_t)((*buffer)->isStereo() ? EAudioStereo : EAudioMono)); in run()
131 int dataLen = (*buffer)->getSize(); in run()
137 if (!send((*buffer)->getData(), dataLen)) { in run()
141 LOGD("%d-th param buffer %d, stereo:%d", i, dataLen, (*buffer)->isStereo()); in run()
191 android::sp<Buffer>* buffer = reinterpret_cast<android::sp<Buffer>*>(outputs[i]); in run() local
192 … if (buffer->get() == NULL) { // data not allocated, this can happen for unknown-length output in run()
193 *buffer = new Buffer(dataLen, dataLen, (type == EAudioStereo) ? true: false); in run()
194 if (buffer->get() == NULL) { in run()
199 bool isStereo = (*buffer)->isStereo(); in run()
[all …]
/cts/suite/cts/deviceTests/opengl/jni/graphics/
DGLUtils.cpp48 char* buffer = new char[length + 1]; in openTextFile() local
49 int num = AAsset_read(asset, buffer, length); in openTextFile()
53 delete[] buffer; in openTextFile()
56 buffer[length] = '\0'; in openTextFile()
57 return buffer; in openTextFile()
94 char* buffer = openTextFile(path); in loadMesh() local
95 if (buffer == NULL) { in loadMesh()
99 int numVertices = readInt(buffer + index); in loadMesh()
107 vertices[vIndex + 0] = readFloat(buffer + index); in loadMesh()
109 vertices[vIndex + 1] = readFloat(buffer + index); in loadMesh()
[all …]
/cts/libs/deviceutil/src/android/cts/util/
DFileUtils.java116 byte[] buffer = new byte[4096]; in copyToFile()
118 while ((bytesRead = inputStream.read(buffer)) >= 0) { in copyToFile()
119 out.write(buffer, 0, bytesRead); in copyToFile()
140 byte[] buffer = new byte[numBytes]; in createFile()
143 output.write(buffer); in createFile()
151 byte[] buffer = new byte[32768]; in readInputStreamFully()
154 while ((count = is.read(buffer)) != -1) { in readInputStreamFully()
155 os.write(buffer, 0, count); in readInputStreamFully()
/cts/tests/tests/drm/jni/
Dandroid_drm_cts_NativeCodeTest.cpp38 char buffer[128]; in android_drm_cts_InstallDrmEngineTest() local
39 if (fgets(buffer, sizeof(buffer), f) != NULL) { in android_drm_cts_InstallDrmEngineTest()
41 if (!strncmp(buffer, match, strlen(match))) { in android_drm_cts_InstallDrmEngineTest()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/wavelib/
DPipeShort.java44 public int write(short[] buffer, int offset, int count) in write() argument
51 System.arraycopy(buffer, offset, mBuffer, rear, written); in write()
57 System.arraycopy(buffer, offset + written, mBuffer, 0, count); in write()
86 public int read(short[] buffer, int offset, int count) in read() argument
103 System.arraycopy(mBuffer, front, buffer, offset, red); in read()
110 System.arraycopy(mBuffer, 0, buffer, offset + red, count); in read()
/cts/suite/audio_quality/lib/src/task/
DTaskSound.cpp69 android::sp<Buffer> buffer; in run() local
74 buffer = Buffer::loadFromFile(tokens->at(1)); in run()
83 buffer = AudioSignalFactory::generateSineWave(AudioHardware::E2BPS, amplitude, in run()
93 buffer = AudioSignalFactory::generateWhiteNoise(AudioHardware::E2BPS, amplitude, in run()
100 if (buffer.get() == NULL) { in run()
103 if (!getTestCase()->registerBuffer(id, buffer)) { in run()
109 if (!getTestCase()->getRemoteAudio()->downloadData(id, buffer, downloadId)) { in run()
DTaskOutput.cpp57 android::sp<Buffer> buffer = getTestCase()->findBuffer(mId); in start() local
58 if (buffer.get() == NULL) { in start()
62 buffer->restart(); // reset to play from beginning in start()
64 if (!hw->startPlaybackOrRecord(buffer)) { in start()
74 if (!remote->startPlaybackForRemoteData(id, buffer->isStereo())) { in start()

123456