2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
audio_stream_in 구조체 참조
#include <
audio.h
>
audio.h
파일의
404
строке에 정의되어 있습니다.
int(* get_capture_position)(const struct
audio_stream_in
*stream, int64_t *frames, int64_t *time)
|
수신된 최근 오디오 프레임 수와 해당 프레임 수와 연결된 시계 시간을 반환합니다.
frames는 수신된 총 프레임 수입니다. 캡처 파이프라인에서 최대한 빨리 실행해야 합니다. 일반적으로 프레임은 양수여야 하며 '뒤로' 이동해서는 안 됩니다.
time은 프레임이 측정된 시계 MONOTONIC 시간입니다. 일반적으로 시간은 양수여야 하며 '뒤로' 이동해서는 안 됩니다.
반환되는 상태는 성공 시 0이고, 기기가 준비되지 않았거나 사용할 수 없는 경우에는 -ENOSYS이고, 인수가 null이거나 유효하지 않은 경우에는 -EINVAL입니다.
audio.h
파일의
449
라인에 정의되어 있습니다.
이 함수를 마지막으로 호출한 이후 오디오 드라이버에서 손실된 입력 프레임 수를 반환합니다. 오디오 드라이버는 이 함수 호출에 의해 현재 값을 반환하면 값을 0으로 재설정하고 계산을 다시 시작해야 합니다. 이러한 손실은 일반적으로 사용자 공간 프로세스가 오디오 드라이버 버퍼의 용량보다 오래 차단될 때 발생합니다.
단위: 입력 오디오 프레임 수
audio.h
파일의
433
라인에 정의되어 있습니다.
ssize_t(* read)(struct
audio_stream_in
*stream, void *buffer, size_t bytes)
|
오디오 드라이버에서 오디오 버퍼를 읽습니다. 읽은 바이트 수 또는 음수 status_t를 반환합니다. 오류가 발생하기 전에 프레임이 하나 이상 읽혔다면 read는 해당 바이트 수를 반환한 다음 후속 호출에서 오류를 반환해야 합니다.
audio.h
FILE의
420
라인에 정의되어 있습니다.
오디오 드라이버의 입력 게인을 설정합니다. 이 메서드는 향후 사용하기 위한 것입니다.
audio.h
파일의
414
행에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
audio.h
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 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)"]]