Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Informacje o strukturze audio_stream_in
#include <
audio.h
>
Definicja w wierszu
404
pliku
audio.h
.
int(* get_capture_position)(const struct
audio_stream_in
*stream, int64_t *frames, int64_t *time)
|
Zwraca ostatnią liczbę otrzymanych klatek audio i związany z nią czas zegara.
frames to łączna liczba otrzymanych klatek. Powinien on być jak najwcześniejszy w potoku przechwytywania. Ogólnie mówiąc, klatki nie powinny być ujemne i nie powinny być „cofnięte”.
time to czas zegara MONOTONIC, w którym mierzono ramki. Ogólnie czas powinien być dodatnią wartością i nie powinien być „odwrotny”.
Zwrócony stan to 0 w przypadku powodzenia, -ENOSYS, jeśli urządzenie nie jest gotowe/dostępne lub -EINVAL, jeśli argumenty są puste lub nieprawidłowe.
Definicja w wierszu
449
pliku
audio.h
.
Zwraca liczbę ramek wejściowych utraconych w sterowniku audio od ostatniego wywołania tej funkcji. Sterownik audio ma zresetować wartość do 0 i ponownie rozpocząć zliczanie po zwróceniu bieżącej wartości przez to wywołanie funkcji. Zwykle dzieje się tak, gdy proces przestrzeni użytkownika jest zablokowany dłużej niż pojemność buforów sterownika audio.
Jednostka: liczba wejść do ramki audio
Definicja w wierszu
433
pliku
audio.h
.
ssize_t(* read)(struct
audio_stream_in
*stream, void *buffer, size_t bytes)
|
Odczyt bufora audio z sterownika audio. Zwraca liczbę odczytanych bajtów lub wartość negatywną status_t. Jeśli przed wystąpieniem błędu odczytano co najmniej 1 ramkę, funkcja read powinna zwrócić liczbę bajtów, a w następnym wywołaniu – błąd.
Definicja w wierszu
420
pliku
audio.h
.
ustaw wzmocnienie wejścia dla sterownika audio. Ta metoda jest przeznaczona do użycia w przyszłości
Definicja w wierszu
414
pliku
audio.h
.
Dokumentacja tego typu danych została wygenerowana z tego pliku:
-
hardware/libhardware/include/hardware/
audio.h
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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)"]]