CaptureSource Class

July 28, 2014

Provides methods that work with specific audio or video captures from the associated capture device.


Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

public sealed class CaptureSource : DependencyObject

The CaptureSource type exposes the following members.

Public methodCaptureSourceInitializes a new instance of the CaptureSource class.

Public propertyAudioCaptureDeviceGets or sets the associated audio capture device that is relevant to this capture.
Public propertyDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertyStateGets the CaptureState of this capture. State might indicate that the capture is still ongoing or has failed.
Public propertyVideoCaptureDeviceGets or sets the associated video capture device that is relevant to this capture.

Public methodCaptureImageAsyncInitiates an asynchronous image capture request. Retrieve the returned image by handling the CaptureImageCompleted event on this CaptureSource.
Public methodCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAnimationBaseValueReturns any base value established for a Windows Phone dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodStartInitiates capture from all capture devices that are relevant to this CaptureSource.
Public methodStopStops capture from all capture devices that are relevant to this CaptureSource.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public eventCaptureFailedOccurs when a requested capture operation does not generate a captured sample.
Public eventCaptureImageCompletedOccurs when an asynchronous image capture request has returned a captured image.

Public fieldStatic memberAudioCaptureDevicePropertyIdentifies the AudioCaptureDevice dependency property.
Public fieldStatic memberVideoCaptureDevicePropertyIdentifies the VideoCaptureDevice dependency property.

By using CaptureSource APIs, you can enable the following scenarios:

CaptureSource does not enable access to raw audio or video. To access this data, you must provide overrides for AudioSink.OnSamples or VideoSink.OnSample. You use Start and Stop for raw-format scenarios to start and stop the captures so that the sinks can process the resulting streams.


To save video to a file, you can use the FileSink class.


If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.


Windows Phone 8, Windows Phone OS 7.1


Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Version Notes

Windows Phone OS 7.1 Windows Phone OS 7.1


In Windows Phone applications that use the CaptureSource class, you must also use the Microsoft.Devices.Camera, Microsoft.Devices.PhotoCamera, or Microsoft.Xna.Framework.Audio.Microphone class to enable audio capture and accurate capability detection in the application.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

© 2014 Microsoft