GStreamer serial plugin

From RidgeRun Developer Wiki

Introduction

Gstreamer serial plugin (gst-serial) provides the tools to interact with a serial port using gstreamer. It includes the serialsrc element which allows the user to capture from a given serial port. It allows the control of the transfer baudrate but it can easily be extended to expose any additional configuration.

Build instructions

$ cd gst-serial
$ ./autogen.sh
$ ./configure 
$ make all install

gst-inspect output

Factory Details:
  Rank                     none (0)
  Long-name                Serial port source
  Klass                    Source/serial
  Description              Reads data from serial port 
  Author                   Edison Fernandez <edison.fernandez@ridgerun.com>

Plugin Details:
  Name                     serial
  Description              Elements used to interact with serial port data
  Filename                 /home/efernandez/work/Gstreamer/gst_1.8.1/out/lib/gstreamer-1.0/libgstserial.so
  Version                  0.1.0
  License                  Proprietary
  Source module            gst-serial
  Binary package           RidgeRun elements
  Origin URL               http://www.ridgerun.com

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseSrc
                         +----GstPushSrc
                               +----GstSerialSrc

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      ANY


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_base_src_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "serialsrc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  blocksize           : Size in bytes to read per buffer (-1 = default)
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 
  num-buffers         : Number of buffers to output before sending EOS (-1 = unlimited)
                        flags: readable, writable
                        Integer. Range: -1 - 2147483647 Default: -1 
  typefind            : Run typefind before negotiating
                        flags: readable, writable
                        Boolean. Default: false
  do-timestamp        : Apply current stream time to buffers
                        flags: readable, writable
                        Boolean. Default: true
  port                : The serial port that will be read.
                        flags: readable, writable
                        String. Default: "/dev/tty0"
  baudrate            : The baudrate to be used for the serial port. See termios.h for a list of valid values.
                        flags: readable, writable
                        Unsigned Integer. Range: 50 - 4000000 Default: 115200 
  stop-bits           : Number of stop bits to use
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 2 Default: 1 
  parity              : Parity to be used
                        flags: readable, writable
                        Enum "GstSerialSrcParity" Default: 0, "none"
                           (0): none             - No parity
                           (1): even             - Even parity
                           (2): odd              - Odd parity
  data-bits           : Number of data bits to be used
                        flags: readable, writable
                        Enum "GstSerialSrcDataBits" Default: 3, "CS8"
                           (0): CS5              - 5 data bits
                           (1): CS6              - 6 data bits
                           (2): CS7              - 7 data bits
                           (3): CS8              - 8 data bits
  flow-control        : Use hardware flow control
                        flags: readable, writable
                        Boolean. Default: false
  canonical           : Enable canonical mode
                        flags: readable, writable
                        Boolean. Default: true

Test pipelines

gst-launch-1.0 -v serialsrc port=/dev/ttyUSB0 baudrate=115200 ! meta/x-klv ! metasink


For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.


Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.