Lines Matching refs:descriptor
36 const RingBufferDescriptor *descriptor) { in AudioEndpoint_validateQueueDescriptor() argument
37 if (descriptor == nullptr) { in AudioEndpoint_validateQueueDescriptor()
42 if (descriptor->capacityInFrames < 1 in AudioEndpoint_validateQueueDescriptor()
43 || descriptor->capacityInFrames > RIDICULOUSLY_LARGE_BUFFER_CAPACITY) { in AudioEndpoint_validateQueueDescriptor()
45 descriptor->capacityInFrames); in AudioEndpoint_validateQueueDescriptor()
50 if (descriptor->bytesPerFrame < 1 in AudioEndpoint_validateQueueDescriptor()
51 || descriptor->bytesPerFrame > RIDICULOUSLY_LARGE_FRAME_SIZE) { in AudioEndpoint_validateQueueDescriptor()
53 descriptor->bytesPerFrame); in AudioEndpoint_validateQueueDescriptor()
57 if (descriptor->dataAddress == nullptr) { in AudioEndpoint_validateQueueDescriptor()
63 descriptor->dataAddress); in AudioEndpoint_validateQueueDescriptor()
65 descriptor->readCounterAddress, in AudioEndpoint_validateQueueDescriptor()
66 descriptor->writeCounterAddress); in AudioEndpoint_validateQueueDescriptor()
70 uint8_t value = descriptor->dataAddress[0]; in AudioEndpoint_validateQueueDescriptor()
74 descriptor->dataAddress[0] = value * 3; in AudioEndpoint_validateQueueDescriptor()
77 if (descriptor->readCounterAddress) { in AudioEndpoint_validateQueueDescriptor()
78 fifo_counter_t counter = *descriptor->readCounterAddress; in AudioEndpoint_validateQueueDescriptor()
81 *descriptor->readCounterAddress = counter; in AudioEndpoint_validateQueueDescriptor()
85 if (descriptor->writeCounterAddress) { in AudioEndpoint_validateQueueDescriptor()
86 fifo_counter_t counter = *descriptor->writeCounterAddress; in AudioEndpoint_validateQueueDescriptor()
89 *descriptor->writeCounterAddress = counter; in AudioEndpoint_validateQueueDescriptor()
115 const RingBufferDescriptor *descriptor = &pEndpointDescriptor->upMessageQueueDescriptor; in configure() local
116 if(descriptor->bytesPerFrame != sizeof(AAudioServiceMessage)) { in configure()
118 descriptor->bytesPerFrame); in configure()
122 if(descriptor->readCounterAddress == nullptr || descriptor->writeCounterAddress == nullptr) { in configure()
134 descriptor->bytesPerFrame, in configure()
135 descriptor->capacityInFrames, in configure()
136 descriptor->readCounterAddress, in configure()
137 descriptor->writeCounterAddress, in configure()
138 descriptor->dataAddress in configure()
147 aaudio_result_t AudioEndpoint::configureDataQueue(const RingBufferDescriptor& descriptor, in configureDataQueue() argument
149 aaudio_result_t result = AudioEndpoint_validateQueueDescriptor("data", &descriptor); in configureDataQueue()
154 ALOGV("configure() data framesPerBurst = %d", descriptor.framesPerBurst); in configureDataQueue()
156 descriptor.readCounterAddress); in configureDataQueue()
161 ? descriptor.readCounterAddress // read by other side in configureDataQueue()
162 : descriptor.writeCounterAddress; // written by other side in configureDataQueue()
166 int64_t *readCounterAddress = (descriptor.readCounterAddress == nullptr) in configureDataQueue()
168 : descriptor.readCounterAddress; in configureDataQueue()
169 int64_t *writeCounterAddress = (descriptor.writeCounterAddress == nullptr) in configureDataQueue()
171 : descriptor.writeCounterAddress; in configureDataQueue()
174 size_t bufferSizeBytes = descriptor.capacityInFrames * descriptor.bytesPerFrame; in configureDataQueue()
175 memset(descriptor.dataAddress, 0, bufferSizeBytes); in configureDataQueue()
178 descriptor.bytesPerFrame, in configureDataQueue()
179 descriptor.capacityInFrames, in configureDataQueue()
182 descriptor.dataAddress in configureDataQueue()
184 uint32_t threshold = descriptor.capacityInFrames / 2; in configureDataQueue()