Search Results for

    Show / Hide Table of Contents

    Class MediaRecorder<TBuffer, TFormat>

    A recorder.

    Inheritance
    System.Object
    MediaRecorder<TBuffer, TFormat>
    AudioRecorder
    VideoRecorder
    Namespace: FM.LiveSwitch
    Assembly: FM.LiveSwitch.dll
    Syntax
    public abstract class MediaRecorder<TBuffer, TFormat> : object where TBuffer : MediaBuffer<TFormat, TBuffer> where TFormat : MediaFormat<TFormat>
    Type Parameters
    Name Description
    TBuffer
    TFormat

    Constructors

    MediaRecorder(String)

    Initializes a new instance of the MediaRecorder<TBuffer, TFormat> class.

    Declaration
    public MediaRecorder(string path)
    Parameters
    Type Name Description
    System.String path

    The path.

    Properties

    File

    Gets or sets the file.

    Declaration
    protected FileStream File { get; set; }
    Property Value
    Type Description
    FileStream

    FileStream

    Gets or sets the recorder stream.

    Declaration
    protected FileAssistant FileStream { get; set; }
    Property Value
    Type Description
    FileAssistant

    Format

    Gets the format.

    Declaration
    public TFormat Format { get; }
    Property Value
    Type Description
    TFormat

    Opened

    Gets whether the recorder has been opened or not.

    Declaration
    public bool Opened { get; }
    Property Value
    Type Description
    System.Boolean

    OpenPath

    Gets the currently open path.

    Declaration
    public string OpenPath { get; }
    Property Value
    Type Description
    System.String

    Path

    Gets the path.

    Declaration
    public string Path { get; }
    Property Value
    Type Description
    System.String

    WasOpened

    Gets or sets a value indicating whether the file was opened.

    Declaration
    protected bool WasOpened { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Close()

    Updates the header and closes the file.

    Declaration
    public void Close()

    DoUpdateHeader()

    Updates the file header.

    Declaration
    protected abstract void DoUpdateHeader()

    DoWrite(TBuffer, Int64)

    Write an encoded video frame.

    Declaration
    protected abstract bool DoWrite(TBuffer buffer, long presentationTimestamp)
    Parameters
    Type Name Description
    TBuffer buffer

    The encoded buffer.

    System.Int64 presentationTimestamp

    The presentation timestamp.

    Returns
    Type Description
    System.Boolean

    true if the encoded frame was written successfully; otherwise, false

    DoWriteHeader()

    Writes the file header.

    Declaration
    protected abstract void DoWriteHeader()

    Open()

    Opens the file and writes the initial header.

    Declaration
    public void Open()

    Write(TBuffer, Int64)

    Write an encoded video frame using the width and height parameters from the first keyframe. This method will discard non-keyframes until the first keyframe arrives.

    Declaration
    public bool Write(TBuffer buffer, long presentationTimestamp)
    Parameters
    Type Name Description
    TBuffer buffer

    The encoded buffer.

    System.Int64 presentationTimestamp

    The presentation timestamp.

    Returns
    Type Description
    System.Boolean

    true if the encoded frame was written successfully; otherwise, false

    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.15.0