CameraSource

namespace VideoKit.Sources {
    /// <summary>
    /// Media source for generating pixel buffers from one or more scene cameras.
    /// </summary>
    class CameraSource : IDisposable { ... }   
}

INCOMPLETE


Creating a Camera Source

INCOMPLETE

With a Media Recorder

/// <summary>
/// Create a pixel buffer source from one or more game cameras.
/// </summary>
/// <param name="recorder">Media recorder to receive images.</param>
/// <param name="cameras">Game cameras to capture images from.</param>
CameraSource (
    MediaRecorder recorder,
    params Camera[] cameras
);

INCOMPLETE

/// <summary>
/// Create a pixel buffer source from one or more game cameras.
/// </summary>
/// <param name="recorder">Media recorder to receive images.</param>
/// <param name="clock">Clock for generating image timestamps.</param>
/// <param name="cameras">Game cameras to capture images from.</param>
CameraSource (
    MediaRecorder recorder,
    IClock? clock,
    params Camera[] cameras
);

With a Pixel Buffer Handler

/// <summary>
/// Create a pixel buffer source from one or more game cameras.
/// </summary>
/// <param name="width">Image width.</param>
/// <param name="height">Image height.</param>
/// <param name="handler">Handler to receive images.</param>
/// <param name="cameras">Game cameras to capture images from.</param>
CameraSource (
    int width,
    int height,
    Action<PixelBuffer> handler,
    params Camera[] cameras
);

INCOMPLETE

/// <summary>
/// Create a pixel buffer source from one or more game cameras.
/// </summary>
/// <param name="width">Image width.</param>
/// <param name="height">Image height.</param>
/// <param name="handler">Handler to receive images.</param>
/// <param name="clock">Clock for generating image timestamps.</param>
/// <param name="cameras">Game cameras to capture images from.</param>
CameraSource (
    int width,
    int height,
    Action<PixelBuffer> handler,
    IClock? clock,
    params Camera[] cameras
)

Inspecting the Source Cameras

/// <summary>
/// Cameras being recorded from.
/// </summary>
Camera[] cameras { get; }

INCOMPLETE


Inspecting the Texture Source

/// <summary>
/// Texture source used to create pixel buffers from the camera texture.
/// </summary>
TextureSource textureSource { get; }

INCOMPLETE


Specifying the Clear Color

/// <summary>
/// Clear color to use before rendering cameras to a texture.
/// </summary>
Color clearColor { get; set; } = Color.black;

INCOMPLETE


Skipping Successive Frames

/// <summary>
/// Control number of successive camera frames to skip while recording.
/// This is very useful for GIF recording, which typically has a lower framerate appearance.
/// </summary>
int frameSkip { get; set; } = 0;

INCOMPLETE


Disposing the Source

/// <summary>
/// Stop the camera source and release resources.
/// </summary>
void Dispose ();

INCOMPLETE


Was this page helpful?