On this page:
get-direction
get-parent-element
get-pad-template
link
link-maybe-ghosting
unlink
linked?
can-link?
get-allowed-caps
get-current-caps
get-pad-template-caps
get-peer
has-current-caps?
active?
blocked?
blocking?
3.5.1 ghost-pad%
ghost-pad%
get-target
set-target
ghost-pad%-new
ghost-pad%-new-no-target
3.5.2 Pad Templates
pad-template?
pad-template-caps
make-pad-template
pad%-new-from-template
Inherited methods:
from gst-object%
get-name
get-parent
get-path-string
has-as-parent?
7.7

class

pad% : class?

  superclass: gst-object%

A element% is linked to other elements via pads. Pads are the element’s interface to the outside world. Data streams from one element’s source pad to another element’s sink pad. The specific type of media that the element can handle will be exposed by the pad’s capabilities.

A pad is defined by two properties: its direction and its availability. A pad direction can be a source pad or a sink pad. Elements receive data on their sink pads and generate data on their source pads.

A pad can have three availabilities: always, sometimes, and on request.

method

(send a-pad get-direction)  (one-of/c 'unknown 'src 'sink)

Gets the direction of a-pad.

method

(send a-pad get-parent-element)  (is-a?/c element%)

Gets the parent element of a-pad.

method

(send a-pad get-pad-template)  (or/c pad-template? #f)

Gets the template for a-pad.

method

(send a-pad link sinkpad)

  (one-of/c 'ok 'wrong-hierarchy 'was-linked 'wrong-direction 'noformat 'nosched 'refused)
  sinkpad : (is-a?/c pad%)
Links a-pad and the sinkpad. Returns a result code indicating if the connection worked or what went wrong.

method

(send a-pad link-maybe-ghosting sink)  boolean?

  sink : (is-a?/c pad%)
Links a-pad to sink, creating any ghost pads in between as necessary. Returns #t if the link succeeded, #f otherwise.

method

(send a-pad unlink sinkpad)  boolean?

  sinkpad : (is-a?/c pad%)
Unlinks a-pad from the sinkpad. Returns #t if the pads were unlinked and #f if the pads were not linked together.

method

(send a-pad linked?)  boolean

Returns #t if a-pad is linked to another pad, #f otherwise.

method

(send a-pad can-link? sinkpad)  boolean?

  sinkpad : (is-a?/c pad%)
Checks if a-pad and sinkpad are compatible so they can be linked. Returns #t if they can be linked, #f otherwise.

method

(send a-pad get-allowed-caps)  (or/c caps? #f)

Gets the capabilities of the allowed media types that can flow through a-pad and its peer. Returns #f if a-pad has no peer.

method

(send a-pad get-current-caps)  caps?

Gets the capabilities currently configured on a-pad, or #f when a-pad has no caps.

method

(send a-pad get-pad-template-caps)  caps?

Gets the capabilities for a-pad’s template.

method

(send a-pad get-peer)  (or/c (is-a?/c pad%) #f)

Gets the peer of a-pad or #f if there is none.

method

(send a-pad has-current-caps?)  boolean?

Returns #t if a-pad has caps set on it, #f otherwise.

method

(send a-pad active?)  boolean?

Returns #t if a-pad is active, #f otherwise.

method

(send a-pad blocked?)  boolean?

Returns #t if a-pad is blocked, #f otherwise.

method

(send a-pad blocking?)  boolean?

Returns #t if a-pad is blocking downstream links, #f otherwise.

class

ghost-pad% : class?

  superclass: pad%

A ghost pad acts as a proxy for another pad, and are used when working with bins. They allow the bin to have sink and/or source pads that link to the sink/source pads of the child elements.

method

(send a-ghost-pad get-target)  (or/c (is-a?/c pad%) #f)

Get the target pad of a-ghost-pad or #f if no target is set.

method

(send a-ghost-pad set-target target)  boolean?

  target : (is-a?/c pad%)
Sets the new target of a-ghost-pad to target. Returns #t on success or #f if pads could not be linked.

procedure

(ghost-pad%-new name target)  (or/c (is-a?/c ghost-pad%) #f)

  name : (or/c string? #f)
  target : (is-a?/c pad%)
Create a new ghost pad with "target" as the target, or #f if there is an error.

procedure

(ghost-pad%-new-no-target name direction)

  (or/c (is-a?/c ghost-pad%) #f)
  name : (or/c string? #f)
  direction : (one-of/c 'unknown 'src 'sink)
Create a new ghost pad without a target with the given direction, or #f if there is an error.

3.5.2 Pad Templates

procedure

(pad-template? v)  boolean?

  v : any/c
A pad template describes the possible media types a pad can handle. Returns #t if v is a pad template, #f otherwise.

procedure

(pad-template-caps template)  caps?

  template : pad-template?
Gets the capabilities of template.

procedure

(make-pad-template name    
  direction    
  presence    
  caps)  pad-template?
  name : string?
  direction : (one-of/c 'unknown 'src 'sink)
  presence : (one-of/c 'always 'sometimes 'request)
  caps : caps?
Creates a new pad template with a name and with the given arguments.

procedure

(pad%-new-from-template template [name])

  (or/c (is-a?/c pad%) #f)
  template : pad-template?
  name : (or/c string? #f) = #f
Creates a new pad from template with the given name, generating a unique name if name is #f. Returns #f in case of error.