AudioCapture.h 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // Notice Regarding Standards. AMD does not provide a license or sublicense to
  3. // any Intellectual Property Rights relating to any standards, including but not
  4. // limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4;
  5. // AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3
  6. // (collectively, the "Media Technologies"). For clarity, you will pay any
  7. // royalties due for such third party technologies, which may include the Media
  8. // Technologies that are owed as a result of AMD providing the Software to you.
  9. //
  10. // MIT license
  11. //
  12. // Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining a copy
  15. // of this software and associated documentation files (the "Software"), to deal
  16. // in the Software without restriction, including without limitation the rights
  17. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18. // copies of the Software, and to permit persons to whom the Software is
  19. // furnished to do so, subject to the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be included in
  22. // all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  30. // THE SOFTWARE.
  31. //
  32. //-------------------------------------------------------------------------------------------------
  33. // Audio session interface declaration
  34. //-------------------------------------------------------------------------------------------------
  35. #ifndef AMF_AudioCapture_h
  36. #define AMF_AudioCapture_h
  37. #pragma once
  38. #include "Component.h"
  39. // Set to capture from either a microphone or desktop
  40. #define AUDIOCAPTURE_SOURCE L"AudioCaptureSource" // amf_bool true for microphone, false for desktop;
  41. // In the case of capturing a microphone, the AUDIOCAPTURE_DEVICE_ACTIVE property
  42. // can be set to -1 so that the active input devices are looked up. If the initialization
  43. // is successful then the AUDIOCAPTURE_DEVICE_NAME and AUDIOCAPTURE_DEVICE_COUNT
  44. // properties will be set.
  45. #define AUDIOCAPTURE_DEVICE_ACTIVE L"AudioCaptureDeviceActive" // amf_int64
  46. #define AUDIOCAPTURE_DEVICE_COUNT L"AudioCaptureDeviceCount" // amf_int64
  47. #define AUDIOCAPTURE_DEVICE_NAME L"AudioCaptureDeviceName" // String
  48. // Codec used for audio capture
  49. #define AUDIOCAPTURE_CODEC L"AudioCaptureCodec" // amf_int64, AV_CODEC_ID_PCM_F32LE
  50. // Sample rate used for audio capture
  51. #define AUDIOCAPTURE_SAMPLERATE L"AudioCaptureSampleRate" // amf_int64, 44100 in samples
  52. // Sample count used for audio capture
  53. #define AUDIOCAPTURE_SAMPLES L"AudioCaptureSampleCount" // amf_int64, 1024
  54. // Bitrate used for audio capture
  55. #define AUDIOCAPTURE_BITRATE L"AudioCaptureBitRate" // amf_int64, in bits
  56. // Channel count used for audio capture
  57. #define AUDIOCAPTURE_CHANNELS L"AudioCaptureChannelCount" // amf_int64, 2
  58. // Channel layout used for audio capture
  59. #define AUDIOCAPTURE_CHANNEL_LAYOUT L"AudioCaptureChannelLayout" // amf_int64, AMF_AUDIO_CHANNEL_LAYOUT
  60. // Format used for audio capture
  61. #define AUDIOCAPTURE_FORMAT L"AudioCaptureFormat" // amf_int64, AMFAF_U8
  62. // Block alignment
  63. #define AUDIOCAPTURE_BLOCKALIGN L"AudioCaptureBlockAlign" // amf_int64, bytes
  64. // Audio frame size
  65. #define AUDIOCAPTURE_FRAMESIZE L"AudioCaptureFrameSize" // amf_int64, bytes
  66. // Audio low latency state
  67. #define AUDIOCAPTURE_LOWLATENCY L"AudioCaptureLowLatency" // amf_int64;
  68. // Optional interface that provides current time
  69. #define AUDIOCAPTURE_CURRENT_TIME_INTERFACE L"CurrentTimeInterface" // interface to current time object
  70. extern "C"
  71. {
  72. // Component that allows the recording of inputs such as microphones or the audio that is being
  73. // rendered. The direction that is captured is controlled by the AUDIOCAPTURE_CAPTURE property
  74. //
  75. AMF_RESULT AMF_CDECL_CALL AMFCreateComponentAudioCapture(amf::AMFContext* pContext, amf::AMFComponent** ppComponent);
  76. }
  77. #endif // #ifndef AMF_AudioCapture_h