As of version 0.4.4 of Snowmix, the following applies.
The feeds.slib library defines basic functions used to for creating feeds and setting some parameters. The library should be included in the ini file after the system.slib library and not before. The library will add the FrameType feed to the Scene librarys internal settings, if the scenes.slib has been included.
You include this library and initialize the library by adding the following line to you ini file:
include ../slib/feeds.slib
The library, when included, offers the following global variables in the Tcl interpreter:
It is not recommended that these variables are changed once the library has been loaded/included.
The library, when included, offers the following functions in the Tcl Interpreter:
Name
FeedCreate - Create a feed with the specified arguments.
Synopsis
FeedCreate name id width height socket
Description
The function will create the feed with the id id and the name name. The feed will be specified to have the geometry width x height and specified to use the socket socket for communicating with a connecting shmsink from GStreamer or a program equivalent to the shmsink.
Example
FeedCreate "Feed #1" 1 1280 720 /tmp/feed1-control-pipe
This creates the feed with Id 1 and the name Feed #1 with the geometry being 1280x720 and sets the feed to use socket /tmp/feed1-control-pipe.
The example is assumed to be part of a tcl script excuted using the Snowmix command tcl exec. It can also be executed as a single command using the Snowmix command tcl eval like this:
tcl eval FeedCreate "Feed #1" 1 1280 720 /tmp/feed1-control-pipe
See Also
FeedList, FeedPAR, FeedDeadImage
Name
FeedInfo - Returns various information for feeds.
Synopsis
FeedInfo ( overlay_proc | exist id | geometry id | list | shape id | buttons id )
Description
The function will return various information related to feeds depending on arguments given.
If the function is given the argument overlay_proc it will return the function that can be called to overlay/ mix the feed within a specific window. Currently the function returns the empty string. This may change later, but the functionality is present to keep in line with other functions for other elements used by the Scenes Library.
If the function is given the argument exist and an ID number it will return 0, if the feed with the id id does not exist, otherwise it will return 1.
If the function is given the argument geometry and an id number and the feed with the id id exists, it will return the geometry as width and height in a list, otherwise it will return the empty string.
If the function is given the argument list, it will return a list with the ids of the feeds that exists.
If the function is given the argument shape and an id number, it will always return an empty string. The functionality is present to keep in line with other functions for other elements used by the Scenes Library.
If the function is given the argument buttons and an id number, it will always return an empty string. The functionality is present to keep in line with other functions for other elements used by the Scenes Library.
Example
if {[FeedInfo exist 2]} { snowmix message "Feed 2 exists" }
If feed 2 exists, it will print the message specified.
The example is assumed to be part of a tcl script excuted using the Snowmix command tcl exec. It can also be executed as a single command using the Snowmix command tcl eval like this:
tcl eval if {[FeedInfo exist 2]} { snowmix message "Feed 2 exists" }
See Also
FeedCreate
Name
FeedPAR - Set the Pixel Aspect Ratio for a specific feed.
Synopsis
FeedPAR id parx pary
Description
This functions sets the pixel aspect ratio PAR for a given feed. If a feed has the geometry of lets say 704x576 and PAR being 12/11, then the correct display geometry for that feed is 768x576 since 12x704/11 = 768. Setting the PAR information for a given feed does not automatically makes the feed being overlayed or mixed, but it does help other libraries like the Scenes library know about how to overlay the feed correctly. If you are using the commands stack, virtual feed overlay or shape overlay, then it is your responsibility to scale the feed accordingly to the PAR information for the feed to get the right aspect ratio.
Example
FeedPAR 1 12 11
This sets the PAR information for the feed to 12 respectively 11 for feed id 1. The example is assumed to be part of a tcl script excuted using the Snowmix command tcl exec. It can also be executed as a single command using the Snowmix command tcl eval like this:
tcl eval FeedPAR 1 12 11
See Also
FeedCreate, FeedList, FeedDeadImage
Name
FeedList - Prints a single line with numbers of defined feeds created with FeedCreate.
Synopsis
FeedList
Description
This function prints a single line of feed ids of the feeds created with the command FeedCreate. Please note that the function prints as opposed to returns. This mean that if you connect to Snowmix with a TCP connection, this commands returns a line on the connection when given the command. If you need the list of feeds created for another script, you can use the global tcl variable feed(feeds)
Example
FeedList
The example prints a list of ids. The example is assumed to be part of a tcl script excuted using the Snowmix command tcl exec. If can also be executed as a single command using the Snowmix command tcl eval like this:
tcl eval FeedList
See Also
FeedCreate, FeedPAR, FeedDeadImage
Name
FeedDeadImage - Set the dead image for a feed.
Synopsis
FeedDeadImage id timeout filename
Description
This functions sets the dead image for a given feed. The argument timeout specify the amount of frames the feed must wait before changing state from RUNNING to STALLED before the feed will return the dead image instead of the last received frame.
The filename must be a file with a dead image file in the BGRA format and with the geometry identical to the feed.
Example
FeedDeadImage 1 100 ../frames/dead-1280x720.bgra
The example seets the dead image for feed 1 to ../frames/dead-1280x720.bgra and the timeout to 100 frames. The operation will make Snowmix read a file on the hard drive. As such, the command should e used as part of an ini file and not while mixing to ensure Snowmix will not suspend its operation while waiting for a hard disk to spin up.
The example is assumed to be part of a tcl script excuted using the Snowmix command tcl exec. If can also be executed as a single command using the Snowmix command tcl eval like this:
tcl eval FeedDeadImage 1 100 ../frames/dead-1280x720.bgra
See Also
FeedCreate, FeedList, FeedPAR