Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CaptureSource Class

Silverlight

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

System.Object
  System.Windows.DependencyObject
    System.Windows.Media.CaptureSource

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

public sealed class CaptureSource : DependencyObject

The CaptureSource type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneCaptureSourceInitializes a new instance of the CaptureSource class.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneAudioCaptureDeviceGets or sets the associated audio capture device that is relevant to this capture.
Public propertySupported by Silverlight for Windows PhoneDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertySupported by Silverlight for Windows PhoneStateGets the CaptureState of this capture. State might indicate that the capture is still ongoing or has failed.
Public propertySupported by Silverlight for Windows PhoneVideoCaptureDeviceGets or sets the associated video capture device that is relevant to this capture.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneCaptureImageAsyncInitiates an asynchronous image capture request. Retrieve the returned image by handling the CaptureImageCompleted event on this CaptureSource.
Public methodSupported by Silverlight for Windows PhoneCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetAnimationBaseValueReturns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodSupported by Silverlight for Windows PhoneStartInitiates capture from all capture devices that are relevant to this CaptureSource.
Public methodSupported by Silverlight for Windows PhoneStopStops capture from all capture devices that are relevant to this CaptureSource.
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventSupported by Silverlight for Windows PhoneCaptureFailedOccurs when a requested capture operation does not generate a captured sample.
Public eventSupported by Silverlight for Windows PhoneCaptureImageCompletedOccurs when an asynchronous image capture request has returned a captured image.
Top

  NameDescription
Public fieldStatic memberSupported by Silverlight for Windows PhoneAudioCaptureDevicePropertyIdentifies the AudioCaptureDevice dependency property.
Public fieldStatic memberSupported by Silverlight for Windows PhoneVideoCaptureDevicePropertyIdentifies the VideoCaptureDevice dependency property.
Top

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

  • Grab a video frame and convert it to a static image by calling CaptureImageAsync, and handling CaptureImageCompleted to obtain the result.

  • Capture a complete video into this CaptureSource by calling Start and Stop. Then use this CaptureSource as the value for SetSource to play back the video.

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.

Version Notes

Silverlight for Windows Phone Silverlight for Windows Phone

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

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.

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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

Community Additions

Show:
© 2014 Microsoft