AVCapture

Supported Hardware Devices: Pro Capture cards

Contents Demonstrated in the Sample:

  1. Preview captured video and monitor captured audio
  2. Freely select video capture devices and their corresponding audio devices
  3. Freely switch capture parameters: resolution, frame rate, color space
  4. Support multi-channel capture: simultaneously capture one or two audio/video streams and render them separately.
  5. Record captured audio and video data as FLV files.

Call Logic:

  1. Obtain version information, initialize and enumerate devices: MWGetVersion, MWCaptureInitInstance, MWRefreshDevice, MWGetChannelCount
  2. Filter supported devices based on device information and interface information: MWGetChannelInfoByIndex
  3. Create a video rendering layer and overlay it on the current window: createPreviewLayer
  4. Open channel: MWGetDevicePath, MWOpenChannelByPath
  5. Create audio renderer: MWAudioRenderCreate, MWAudioRenderStart
  6. Start video capture and rendering thread
  7. Start audio capture and rendering thread
  8. Enter main thread loop
  9. Click menu to switch audio/video channels or capture parameters:
    1. Stop audio capture and rendering thread
    2. Stop video capture and rendering thread
    3. Destroy audio renderer: MWAudioRenderStop, MWAudioRenderDestroy
    4. Close channel: MWCloseChannel
    5. Open channel and capture/render according to set channel and capture parameters: steps 4, 5, 6, 7
  10. After clicking the close button, exit capture and release resources:
    1. Stop audio capture and rendering thread
    2. Stop video capture and rendering thread
    3. Destroy audio renderer: MWAudioRenderStop, MWAudioRenderDestroy
    4. Close channel: MWCloseChannel
    5. Destroy instance: MWCaptureExitInstance.

Video Capture and Rendering Thread:

  1. Start video capture: MMWStartVideoCapture
  2. Create Event: MWCreateEvent
  3. Register timer: MWRegisterTimer
  4. Set time schedule: MWScheduleTimer
  5. Wait for Event: MWTryWaitEvent, MWWaitEvent, MWMultiWaitEvent
  6. Capture video data: MWCaptureVideoFrameToVirtualAddressEx
  7. Get current capture status and release capture card resources: MWGetVideoCaptureStatus
  8. Repeat steps 4, 5, 6, 7 until thread exits
  9. Unregister timer: MWUnregisterTimer
  10. Close Event: MWCloseEvent
  11. Stop capture: MWStopVideoCapture

Audio Capture and Rendering Thread:

  1. Start audio capture: MWStartAudioCapture
  2. Create Event: MWCreateEvent
  3. Register message notification: MWRegisterNotify
  4. Wait for Event: MWTryWaitEvent, MWWaitEvent, MWMultiWaitEvent
  5. Capture audio data: MWCaptureAudioFrame
  6. Render audio data
  7. Repeat steps 4, 5, 6 until thread exits
  8. Unregister message notification: MWUnregisterNotify
  9. Close Event: MWCloseEvent
  10. Stop capture: MWStopAudioCapture

Result:

Result Display 1

Result Display 2

Result Display 3

Result Display 4

Flowchart:

AVCapture Flowchart

results matching ""

    No results matching ""

    results matching ""

      No results matching ""