A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Referencia de la estructura audio_stream_in
#include <
audio.h
>
Definición en la línea
404
del archivo
audio.h
.
int(* get_capture_position)(const struct
audio_stream_in
*stream, int64_t *frames, int64_t *time)
|
Muestra un recuento reciente de la cantidad de fotogramas de audio recibidos y la hora del reloj asociada con ese recuento de fotogramas.
frames es el recuento total de fotogramas recibidos. Esto debe hacerse lo antes posible en la canalización de captura. En general, los fotogramas no deben ser negativos ni ir hacia atrás.
time es el tiempo MONOTONIC del reloj cuando se midieron los fotogramas. En general, el tiempo debe ser una cantidad positiva y no debe ir hacia atrás.
El estado que se muestra es 0 si se realiza correctamente, -ENOSYS si el dispositivo no está listo o disponible, o -EINVAL si los argumentos son nulos o no son válidos.
Definición en la línea
449
del archivo
audio.h
.
Muestra la cantidad de fotogramas de entrada perdidos en el controlador de audio desde la última llamada a esta función. Se espera que el controlador de audio restablezca el valor a 0 y reinicie el recuento cuando se devuelva el valor actual mediante esta llamada a función. Por lo general, esta pérdida ocurre cuando el proceso del espacio de usuario está bloqueado más tiempo que la capacidad de los búferes del controlador de audio.
Unidad: Es la cantidad de fotogramas de audio de entrada.
Definición en la línea
433
del archivo
audio.h
.
ssize_t(* read)(struct
audio_stream_in
*stream, void *buffer, size_t bytes)
|
Lee el búfer de audio desde el controlador de audio. Devuelve la cantidad de bytes leídos o un status_t negativo. Si se leyó al menos una trama antes del error, la operación de lectura debe mostrar ese recuento de bytes y, luego, mostrar un error en la llamada posterior.
Definición en la línea
420
del archivo
audio.h
.
Establece el aumento de entrada para el controlador de audio. Este método es para uso futuro
Definición en la línea
414
del archivo
audio.h
.
La documentación de esta struct se generó a partir del siguiente archivo:
-
hardware/libhardware/include/hardware/
audio.h
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-27 (UTC)"],[],[],null,["# Android Hardware Abstraction Layer: audio_stream_in Struct Reference\n\naudio_stream_in Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \naudio_stream_in Struct Reference \n\n`\n#include \u003c\n`[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)`\n\u003e\n`\n\n|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [audio_stream](/reference/hal/structaudio__stream) | [common](/reference/hal/structaudio__stream__in#a9975d0888d3a4eecf4f0144ea954a80f) |\n| ||\n| int(\\* | [set_gain](/reference/hal/structaudio__stream__in#a928a709953a9cf43e9594699946d968b) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, float gain) |\n| ||\n| ssize_t(\\* | [read](/reference/hal/structaudio__stream__in#ae29cb94a8369b1b06cdfc51b3ef3d61d) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, void \\*buffer, size_t bytes) |\n| ||\n| uint32_t(\\* | [get_input_frames_lost](/reference/hal/structaudio__stream__in#ac35c041acf754e3ec3e83763080e8209) )(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream) |\n| ||\n| int(\\* | [get_capture_position](/reference/hal/structaudio__stream__in#a7049256b82aad74e1dc976a3d5406985) )(const struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, int64_t \\*frames, int64_t \\*time) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[404](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\nField Documentation\n-------------------\n\n\n|------------------------------------------------------------------|\n| struct [audio_stream](/reference/hal/structaudio__stream) common |\n\n\nCommon methods of the audio stream in. This\n*must*\nbe the first member of\n[audio_stream_in](/reference/hal/structaudio__stream__in)\nas users of this structure will cast a\n[audio_stream](/reference/hal/structaudio__stream)\nto\n[audio_stream_in](/reference/hal/structaudio__stream__in)\npointer in contexts where it's known the\n[audio_stream](/reference/hal/structaudio__stream)\nreferences an\n[audio_stream_in](/reference/hal/structaudio__stream__in)\n.\n\n\nDefinition at line\n[410](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* get_capture_position)(const struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, int64_t \\*frames, int64_t \\*time) |\n\n\nReturn a recent count of the number of audio frames received and the clock time associated with that frame count.\n\n\nframes is the total frame count received. This should be as early in the capture pipeline as possible. In general, frames should be non-negative and should not go \"backwards\".\n\n\ntime is the clock MONOTONIC time when frames was measured. In general, time should be a positive quantity and should not go \"backwards\".\n\n\nThe status returned is 0 on success, -ENOSYS if the device is not ready/available, or -EINVAL if the arguments are null or otherwise invalid.\n\n\nDefinition at line\n[449](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|---------------------------------------------------------------------------------------------------------------|\n| uint32_t(\\* get_input_frames_lost)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream) |\n\n\nReturn the amount of input frames lost in the audio driver since the last call of this function. Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers.\n\n\nUnit: the number of input audio frames\n\n\nDefinition at line\n[433](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| ssize_t(\\* read)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, void \\*buffer, size_t bytes) |\n\n\nRead audio buffer in from audio driver. Returns number of bytes read, or a negative status_t. If at least one frame was read prior to the error, read should return that byte count and then return an error in the subsequent call.\n\n\nDefinition at line\n[420](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n|---------------------------------------------------------------------------------------------------------|\n| int(\\* set_gain)(struct [audio_stream_in](/reference/hal/structaudio__stream__in) \\*stream, float gain) |\n\n\nset the input gain for the audio driver. This method is for for future use\n\n\nDefinition at line\n[414](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\nof file\n[audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [audio.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/audio.h)"]]