// filename format: video=hwnd:audio=device_id
//  hwnd for screen capture: special window handle; 0 indicate desktop
//  device_id for wave capture: device identifier, such as -1 for WAVE_MAPPER

// -f gdicapture: enable gdi(screen/wave) capture input

// -pause_pointer <address of pause flag>: integer value of pause flag pointer

// -capture_offset <%d,%d>: offset on x and y against the final source window
// -capture_flags <flags>: +/-showframe: whether show flashing frame or not
//                         +/-client: whether capture client dc or window dc
//                         +/-cursor: whether capture cursor or not
//                         +/-checkbound: whether check input bound or not
// -framerate <frame rate>: e.g. 30000/1001 (-> 29.97)
// -video_size <frame size>: such as 640x480 or hd720

// -ar/sample_rate <sample rate>: 8000, 11025, 22050 or 44100
// -ac/channels <channels>: 1 or 2
// -sample_fmt <sample format>: u8 or s16
// -wavebufsize <buffer size>: waveIn buffer size, default 4096(64kb)

procedure register_gdicapture;
function GetWaveInDevices(ADevices: TStrings): Integer;

implementation

function GetWaveInDevices(ADevices: TStrings): Integer;
var
  wic: TWaveInCaps;
  I: Integer;
  LRet: MMRESULT;
begin
  Result := 0;
  for I := 0 to waveInGetNumDevs - 1 do
  begin
    LRet := waveInGetDevCaps(I, @wic, SizeOf(TWaveInCaps));
    if LRet = MMSYSERR_NOERROR then
    begin
      Inc(Result);
      ADevices.Add(Format('%d=%s', [I, wic.szPname]));
    end;
  end;
end;

