filesrc

filesrc — Read from arbitrary point in a file

Properties

gint fd Read
gchar * location Read / Write
gulong mmapsize Read / Write
gboolean touch Read / Write
gboolean use-mmap Read / Write
gboolean sequential Read / Write

Types and Values

struct GstFileSrc

Object Hierarchy

    GObject
    ╰── GstObject
        ╰── GstElement
            ╰── GstBaseSrc
                ╰── GstFileSrc

Implemented Interfaces

GstFileSrc implements GstURIHandler.

Description

Read data from a file in the local file system.

Example launch line

gst-launch filesrc location=song.ogg ! decodebin2 ! autoaudiosink
Play a song.ogg from local dir.

Synopsis

Element Information

plugin

coreelements

author

Erik Walthinsen <omega@cse.ogi.edu>

class

Source/File

Element Pads

name

src

direction

source

presence

always

details

ANY

Functions

Types and Values

struct GstFileSrc

struct GstFileSrc;

Opaque GstFileSrc structure.

Property Details

The “fd” property

  “fd”                       gint

File-descriptor for the file being mmap()d.

Flags: Read

Allowed values: >= 0

Default value: 0


The “location” property

  “location”                 gchar *

Location of the file to read.

Flags: Read / Write

Default value: NULL


The “mmapsize” property

  “mmapsize”                 gulong

Size in bytes of mmap()d regions.

Flags: Read / Write


The “touch” property

  “touch”                    gboolean

Touch mmapped data regions to force them to be read from disk.

Flags: Read / Write

Default value: TRUE


The “use-mmap” property

  “use-mmap”                 gboolean

Whether to use mmap(). Set to TRUE to force use of mmap() instead of read() for reading data.

Use of mmap() is disabled by default since with mmap() there are a number of occasions where the process/application will be notified of read errors via a SIGBUS signal from the kernel, which will lead to the application being killed if not handled by the application. This is something that is difficult to work around for a library like GStreamer, hence use of mmap() is disabled by default. Said errors can occur for example when an external device (e.g. an external hard drive or a portable music player) are unplugged while in use, or when a CD/DVD medium cannot be be read because the medium is scratched or otherwise damaged.

Flags: Read / Write

Default value: FALSE


The “sequential” property

  “sequential”               gboolean

Whether to use madvise to hint to the kernel that access to mmap pages will be sequential.

Flags: Read / Write

Default value: FALSE

See Also

GstFileSrc