C# Класс ScreenToGif.Webcam.DirectX.CaptureWebcam

Gets the video output of a webcam or other video device.
Наследование: EditStreaming.ISampleGrabberCB, IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
ActualGraphState GraphState
CaptureGraphBuilder ExtendStreaming.ICaptureGraphBuilder2
GraphBuilder ExtendStreaming.IGraphBuilder
IsPreviewRendered bool
MediaControl ControlStreaming.IMediaControl
SampGrabber EditStreaming.ISampleGrabber
VideoCompressor Filter
VideoCompressorFilter CoreStreaming.IBaseFilter
VideoDeviceFilter CoreStreaming.IBaseFilter
VideoStreamConfig ExtendStreaming.IAMStreamConfig
VideoWindow ControlStreaming.IVideoWindow
WantPreviewRendered bool

Открытые методы

Метод Описание
BufferCB ( double SampleTime, IntPtr pBuffer, int BufferLen ) : int
CaptureWebcam ( Filter videoDevice ) : System

Default constructor of the Capture class.

Dispose ( ) : void

Closes and cleans the video previewing.

GetFrame ( ) : Bitmap

Gets the current frame from the buffer.

PrepareCapture ( ) : void

Prepares the capture of frames.

SampleCB ( double SampleTime, CoreStreaming pSample ) : int
StartPreview ( ) : void

Starts the video preview from the video source.

StopPreview ( ) : void

Stops the video previewing.

Защищенные методы

Метод Описание
CreateGraph ( ) : void

Create a new filter graph and add filters (devices, compressors, misc), but leave the filters unconnected. Call RenderGraph() to connect the filters.

DerenderGraph ( ) : void

Disconnect and remove all filters except the device and compressor filters. This is the opposite of renderGraph(). Soem properties such as FrameRate can only be set when the device output pins are not connected.

DestroyGraph ( ) : void

Completely tear down a filter graph and release all associated resources.

OnPreviewWindowResize ( object sender, EventArgs e ) : void

Resize the preview when the PreviewWindow is resized

RemoveDownstream ( CoreStreaming filter, bool removeFirstFilter ) : void

Removes all filters downstream from a filter from the graph. This is called only by DerenderGraph() to remove everything from the graph except the devices and compressors. The parameter "removeFirstFilter" is used to keep a compressor (that should be immediately downstream of the device) if one is begin used.

RenderGraph ( ) : void

Connects the filters of a previously created graph (created by CreateGraph()). Once rendered the graph is ready to be used. This method may also destroy streams if we have streams we no longer want.

StartPreviewIfNeeded ( ) : void

Setup and start the preview window if the user has requested it (by setting PreviewWindow).

Описание методов

BufferCB() публичный Метод

public BufferCB ( double SampleTime, IntPtr pBuffer, int BufferLen ) : int
SampleTime double
pBuffer System.IntPtr
BufferLen int
Результат int

CaptureWebcam() публичный Метод

Default constructor of the Capture class.
If no video device is provided.
public CaptureWebcam ( Filter videoDevice ) : System
videoDevice Filter The video device to be the source.
Результат System

CreateGraph() защищенный Метод

Create a new filter graph and add filters (devices, compressors, misc), but leave the filters unconnected. Call RenderGraph() to connect the filters.
protected CreateGraph ( ) : void
Результат void

DerenderGraph() защищенный Метод

Disconnect and remove all filters except the device and compressor filters. This is the opposite of renderGraph(). Soem properties such as FrameRate can only be set when the device output pins are not connected.
protected DerenderGraph ( ) : void
Результат void

DestroyGraph() защищенный Метод

Completely tear down a filter graph and release all associated resources.
protected DestroyGraph ( ) : void
Результат void

Dispose() публичный Метод

Closes and cleans the video previewing.
public Dispose ( ) : void
Результат void

GetFrame() публичный Метод

Gets the current frame from the buffer.
public GetFrame ( ) : Bitmap
Результат System.Drawing.Bitmap

OnPreviewWindowResize() защищенный Метод

Resize the preview when the PreviewWindow is resized
protected OnPreviewWindowResize ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

PrepareCapture() публичный Метод

Prepares the capture of frames.
public PrepareCapture ( ) : void
Результат void

RemoveDownstream() защищенный Метод

Removes all filters downstream from a filter from the graph. This is called only by DerenderGraph() to remove everything from the graph except the devices and compressors. The parameter "removeFirstFilter" is used to keep a compressor (that should be immediately downstream of the device) if one is begin used.
protected RemoveDownstream ( CoreStreaming filter, bool removeFirstFilter ) : void
filter CoreStreaming
removeFirstFilter bool
Результат void

RenderGraph() защищенный Метод

Connects the filters of a previously created graph (created by CreateGraph()). Once rendered the graph is ready to be used. This method may also destroy streams if we have streams we no longer want.
protected RenderGraph ( ) : void
Результат void

SampleCB() публичный Метод

public SampleCB ( double SampleTime, CoreStreaming pSample ) : int
SampleTime double
pSample CoreStreaming
Результат int

StartPreview() публичный Метод

Starts the video preview from the video source.
public StartPreview ( ) : void
Результат void

StartPreviewIfNeeded() защищенный Метод

Setup and start the preview window if the user has requested it (by setting PreviewWindow).
protected StartPreviewIfNeeded ( ) : void
Результат void

StopPreview() публичный Метод

Stops the video previewing.
public StopPreview ( ) : void
Результат void

Описание свойств

ActualGraphState защищенное свойство

State of the internal filter graph.
protected GraphState ActualGraphState
Результат GraphState

CaptureGraphBuilder защищенное свойство

DShow Filter: building graphs for capturing video.
protected ExtendStreaming.ICaptureGraphBuilder2 CaptureGraphBuilder
Результат ExtendStreaming.ICaptureGraphBuilder2

GraphBuilder защищенное свойство

DShow Filter: Graph builder.
protected ExtendStreaming.IGraphBuilder GraphBuilder
Результат ExtendStreaming.IGraphBuilder

IsPreviewRendered защищенное свойство

When graphState==Rendered, have we rendered the preview stream?
protected bool IsPreviewRendered
Результат bool

MediaControl защищенное свойство

DShow Filter: Start/Stop the filter graph -> copy of graphBuilder.
protected ControlStreaming.IMediaControl MediaControl
Результат ControlStreaming.IMediaControl

SampGrabber защищенное свойство

protected EditStreaming.ISampleGrabber SampGrabber
Результат EditStreaming.ISampleGrabber

VideoCompressor защищенное свойство

Property Backer: Video compression filter.
protected Filter,ScreenToGif.Webcam.DirectX VideoCompressor
Результат Filter

VideoCompressorFilter защищенное свойство

DShow Filter: selected video compressor.
protected CoreStreaming.IBaseFilter VideoCompressorFilter
Результат CoreStreaming.IBaseFilter

VideoDeviceFilter защищенное свойство

DShow Filter: selected video device.
protected CoreStreaming.IBaseFilter VideoDeviceFilter
Результат CoreStreaming.IBaseFilter

VideoStreamConfig защищенное свойство

DShow Filter: configure frame rate, size.
protected ExtendStreaming.IAMStreamConfig VideoStreamConfig
Результат ExtendStreaming.IAMStreamConfig

VideoWindow защищенное свойство

DShow Filter: Control preview window -> copy of graphBuilder.
protected ControlStreaming.IVideoWindow VideoWindow
Результат ControlStreaming.IVideoWindow

WantPreviewRendered защищенное свойство

Do we need the preview stream rendered (VideoDevice and PreviewWindow != null)
protected bool WantPreviewRendered
Результат bool