Gjsify LogoGjsify Logo

Index

Functions

  • Get one buffer from pad. Implemented via buffer probes. This function will block until the pipeline passes a buffer over pad, so for robust behavior in unit tests, you need to use check's timeout to fail out in the case that a buffer never arrives.

    You must have previously called gst_buffer_straw_start_pipeline() on pipeline and pad.

    Parameters

    • bin: Gst.Element

      the pipeline previously started via gst_buffer_straw_start_pipeline()

    • pad: Gst.Pad

      the pad previously passed to gst_buffer_straw_start_pipeline()

    Returns Gst.Buffer

  • Sets up a pipeline for buffer sucking. This will allow you to call gst_buffer_straw_get_buffer() to access buffers as they pass over pad.

    This function is normally used in unit tests that want to verify that a particular element is outputting correct buffers. For example, you would make a pipeline via gst_parse_launch(), pull out the pad you want to monitor, then call gst_buffer_straw_get_buffer() to get the buffers that pass through pad. The pipeline will block until you have sucked off the buffers.

    This function will set the state of bin to PLAYING; to clean up, be sure to call gst_buffer_straw_stop_pipeline().

    Note that you may not start two buffer straws at the same time. This function is intended for unit tests, not general API use. In fact it calls fail_if from libcheck, so you cannot use it outside unit tests.

    Parameters

    Returns void

  • Set bin to #GST_STATE_NULL and release resource allocated in gst_buffer_straw_start_pipeline().

    You must have previously called gst_buffer_straw_start_pipeline() on pipeline and pad.

    Parameters

    • bin: Gst.Element

      the pipeline previously started via gst_buffer_straw_start_pipeline()

    • pad: Gst.Pad

      the pad previously passed to gst_buffer_straw_start_pipeline()

    Returns void

  • Verifies that reference values and current values are equals in list.

    Parameters

    • list: CheckABIStruct

      A list of GstCheckABIStruct to be verified

    • have_abi_sizes: boolean

      Whether there is a reference ABI size already specified, if it is %FALSE and the GST_ABI environment variable is set, usable code for list will be printed.

    Returns void

  • check_buffer_data(buffer: Gst.Buffer, data: object, size: number): void
  • Compare the buffer contents with data and size.

    Parameters

    • buffer: Gst.Buffer

      buffer to compare

    • data: object

      data to compare to

    • size: number

      size of data to compare

    Returns void

  • check_clear_log_filter(): void
  • check_drop_buffers(): void
  • Create an element using the factory providing the element_name and push the buffer_in to this element. The element should create one buffer and this will be compared with buffer_out. We only check the caps and the data of the buffers. This function unrefs the buffers.

    Parameters

    • element_name: string

      name of the element that needs to be created

    • buffer_in: Gst.Buffer

      push this buffer to the element

    • caps_in: Gst.Caps

      the #GstCaps expected of the sinkpad of the element

    • buffer_out: Gst.Buffer

      compare the result with this buffer

    • caps_out: Gst.Caps

      the #GstCaps expected of the srcpad of the element

    Returns void

  • Create an element using the factory providing the element_name and push the buffers in buffer_in to this element. The element should create the buffers equal to the buffers in buffer_out. We only check the size and the data of the buffers. This function unrefs the buffers in the two lists. The last_flow_return parameter indicates the expected flow return value from pushing the final buffer in the list. This can be used to set up a test which pushes some buffers and then an invalid buffer, when the final buffer is expected to fail, for example.

    Parameters

    • element_name: string

      name of the element that needs to be created

    • buffer_in: Gst.Buffer[]

      a list of buffers that needs to be pushed to the element

    • caps_in: Gst.Caps

      the #GstCaps expected of the sinkpad of the element

    • buffer_out: Gst.Buffer[]

      a list of buffers that we expect from the element

    • caps_out: Gst.Caps

      the #GstCaps expected of the srcpad of the element

    • last_flow_return: Gst.FlowReturn

      the last buffer push needs to give this GstFlowReturn

    Returns void

  • check_init(argc: number, argv: string): void
  • check_object_destroyed_on_unref(object_to_unref: object): void
  • Unrefs object_to_unref and checks that is has properly been destroyed.

    Parameters

    • object_to_unref: object

      The #GObject to unref

    Returns void

  • Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing. If element has more than one src or sink pad, use gst_check_setup_events_with_stream_id() instead.

    Parameters

    • srcpad: Gst.Pad

      The src #GstPad to push on

    • element: Gst.Element

      The #GstElement use to create the stream id

    • caps: Gst.Caps

      #GstCaps in case caps event must be sent

    • format: Gst.Format

      The #GstFormat of the default segment to send

    Returns void

  • Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing.

    Parameters

    • srcpad: Gst.Pad

      The src #GstPad to push on

    • element: Gst.Element

      The #GstElement use to create the stream id

    • caps: Gst.Caps

      #GstCaps in case caps event must be sent

    • format: Gst.Format

      The #GstFormat of the default segment to send

    • stream_id: string

      A unique identifier for the stream

    Returns void

  • Creates a new sink pad (based on the given tmpl) and links it to the given element src pad (the pad that matches the given name). You can set event/chain/query functions on this pad to check the output of the element.

    Parameters

    • element: Gst.Element

      element to setup pad on

    • tmpl: Gst.StaticPadTemplate

      pad template

    • name: string

      Name of the element src pad that will be linked to the sink pad that will be setup

    Returns Gst.Pad

  • Creates a new src pad (based on the given tmpl) and links it to the given element sink pad (the pad that matches the given name). Before using the src pad to push data on element you need to call #gst_check_setup_events on the created src pad.

    Example of how to push a buffer on element:

    static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
    GST_PAD_SINK,
    GST_PAD_ALWAYS,
    GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
    );
    static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
    GST_PAD_SRC,
    GST_PAD_ALWAYS,
    GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
    );

    GstElement * element = gst_check_setup_element ("element");
    GstPad * mysrcpad = gst_check_setup_src_pad (element, &srctemplate);
    GstPad * mysinkpad = gst_check_setup_sink_pad (element, &sinktemplate);

    gst_pad_set_active (mysrcpad, TRUE);
    gst_pad_set_active (mysinkpad, TRUE);
    fail_unless (gst_element_set_state (element, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing");

    GstCaps * caps = gst_caps_from_string (YOUR_DESIRED_SINK_CAPS);
    gst_check_setup_events (mysrcpad, element, caps, GST_FORMAT_TIME);
    gst_caps_unref (caps);

    fail_unless (gst_pad_push (mysrcpad, gst_buffer_new_and_alloc(2)) == GST_FLOW_OK);

    For very simple input/output test scenarios checkout #gst_check_element_push_buffer_list and #gst_check_element_push_buffer.

    Parameters

    • element: Gst.Element

      element to setup src pad on

    • tmpl: Gst.StaticPadTemplate

      pad template

    • name: string

      Name of the element sink pad that will be linked to the src pad that will be setup

    Returns Gst.Pad

  • check_teardown_element(element: Gst.Element): void
  • check_teardown_pad_by_name(element: Gst.Element, name: string): void
  • check_teardown_sink_pad(element: Gst.Element): void
  • check_teardown_src_pad(element: Gst.Element): void
  • Sets up a data probe on the given pad which will raise assertions if the data flow is inconsistent.

    Parameters

    • consist: StreamConsistency

      The #GstStreamConsistency handle

    • pad: Gst.Pad

      The #GstPad on which the dataflow will be checked.

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method