On this page:
8.1 Video Convert
video-convertible?
video-convert
prop:  video-convertible
prop:  video-convertible?
8.2 Conversion Database
convert-database%
register-conversion
convert
maybe-convert
convertible?
8.3 Core Forms
define-producer
->producer
defproducer
define-filter
->filter
deffilter
define-transition
->transition
deftransition
define-merge
->merge
defmerge
7.8

8 Extending Video

 (require video/convert) package: video

Video offers several extension points. Both for adding new syntactic forms into the language, as well as new video primitives. There is some overlap in what the extensions are capable of, but each are useful in different circumstances.

The documentation in this section needs a lot of work.

8.1 Video Convert

procedure

(video-convertible? obj)  boolean?

  obj : any/c

procedure

(video-convert obj)  video?

  obj : any/c

value

prop:video-convertible : struct-type-property?

value

prop:video-convertible? : struct-type-property?

8.2 Conversion Database

class

convert-database% : class?

  superclass: object%

method

(send a-convert-database register-conversion predicate 
  converter) 
  video?
  predicate : (-> any/c boolean?)
  converter : (-> any/c video?)

method

(send a-convert-database convert object)  video?

  object : any/c

method

(send a-convert-database maybe-convert object)

  (or/c video? #f)
  object : any/c

method

(send a-convert-database convertible? object)  boolean?

  object : any/c

8.3 Core Forms

 (require video/surface) package: video

Video also has basic syntax for creating new types of producers, transitions, merges, and filters. This API is still experimental and may change with little notice. Proceed with caution.

These forms are for defining producers, filters, transitions, and merges. Also the forms for building their contracts and writing their documentation.

syntax

(define-producer function-header
  maybe-subgraph
  maybe-properties
  maybe-user-properties
  body ...)
 
maybe-subgraph = 
  | #:subgraph subgraph
     
maybe-properties = 
  | #:properties properties
     
maybe-user-properties = 
  | #:user-properties user-properties
 
  subgraph : (or/c procedure? #f)
  properties : procedure?

syntax

(->producer [extra-args ...] [optional-args ...] maybe-ret)

 
maybe-ret = 
  | return

syntax

(defproducer prototype maybe-return content ...)

 
prototype = (id arg-spec ...)
  | (prototype arg-spec ...)
     
maybe-ret = 
  | #:return
  | ret

syntax

(define-filter function-header
  maybe-subgraph
  maybe-properties
  maybe-source-properties
  maybe-user-properties
  body ...)
 
maybe-subgraph = 
  | #:subgraph subgraph
     
maybe-properties = 
  | #:properties properties
     
maybe-user-properties = 
  | #:user-properties user-properties
     
maybe-source-properties = 
  | #:source-props source-properties
 
  subgraph : (or/c procedure? #f)
  properties : procedure?
  source-props : procedure?

syntax

(->filter [extra-args ...] [optional-args ...] maybe-ret)

 
maybe-ret = 
  | return

syntax

(deffilter prototype maybe-return content ...)

 
prototype = (id arg-spec ...)
  | (prototype arg-spec ...)
     
maybe-ret = 
  | #:return
  | ret

syntax

(define-transition function-header
  maybe-track1-subgraph
  maybe-track2-subgraph
  maybe-combined-subgraph
  maybe-properties
  maybe-source-properties
  maybe-user-properties
  maybe-producer-1
  maybe-producer-2
  body ...)
 
maybe-track1-subgraph = 
  | #:track1-subgraph subgraph
     
maybe-track2-subgraph = 
  | #:track2-subgraph subgraph
     
maybe-combined-subgraph = 
  | #:combined-subgraph subgraph
     
maybe-properties = 
  | #:properties properties
     
maybe-user-properties = 
  | #:user-properties user-properties
     
maybe-source-properties = 
  | #:source-props source-properties
     
maybe-prod1 = 
  | #:prod-1 prod1-id
     
maybe-prod2 = 
  | #:prod-2 prod2-id
 
  subgraph : (or/c procedure? #f)
  properties : procedure?
  source-props : procedure?

syntax

(->transition [extra-args ...] [optional-args ...] maybe-ret)

 
maybe-ret = 
  | return

syntax

(deftransition prototype maybe-return content ...)

 
prototype = (id arg-spec ...)
  | (prototype arg-spec ...)
     
maybe-ret = 
  | #:return
  | ret

syntax

(define-merge function-header
  maybe-track1-subgraph
  maybe-track2-subgraph
  maybe-combined-subgraph
  maybe-properties
  maybe-source-properties
  maybe-user-properties
  maybe-producer-1
  maybe-producer-2
  body ...)
 
maybe-track1-subgraph = 
  | #:track1-subgraph subgraph
     
maybe-track2-subgraph = 
  | #:track2-subgraph subgraph
     
maybe-combined-subgraph = 
  | #:combined-subgraph subgraph
     
maybe-properties = 
  | #:properties properties
     
maybe-user-properties = 
  | #:user-properties user-properties
     
maybe-source-properties = 
  | #:source-props source-properties
     
maybe-prod1 = 
  | #:prod-1 prod1-id
     
maybe-prod2 = 
  | #:prod-2 prod2-id
 
  subgraph : (or/c procedure? #f)
  properties : procedure?
  source-props : procedure?

syntax

(->merge [extra-args ...] [optional-args ...] maybe-ret)

 
maybe-ret = 
  | return

syntax

(defmerge prototype maybe-return content ...)

 
prototype = (id arg-spec ...)
  | (prototype arg-spec ...)
     
maybe-ret = 
  | #:return
  | ret