JavaScript API - RSATom/wcjs-gs GitHub Wiki
const wcjs = require("wcjs-gs"); const player = new wcjs.JsPlayer(eosCallback); player.parseLaunch("videotestsrc ! appsink name=sink"); player.addAppSinkCallback("sink", function(type, ...args) { switch(type) { case player.AppSinkSetup: { const [mediaType, properties] = args; break; } case player.AppSinkNewPreroll: { const [sample] = args; break; } case player.AppSinkNewSample: { const [sample] = args; break; } case player.AppSinkEos: break; } }); player.setState(player.GST_STATE_PLAYING);
States:
GST_STATE_VOID_PENDING
GST_STATE_NULL
GST_STATE_READY
GST_STATE_PAUSED
GST_STATE_PLAYING
AppSinkSetup
AppSinkNewPreroll
AppSinkNewSample
AppSinkEos
- for
AppSinkSetup
=function(AppSinkSetup, mediaType, properties)
- for
AppSinkNewPreroll
,AppSinkNewSample
=function(eventType, sample)
- for
AppSinkEos
=function(AppSinkEos)
parseLaunch(pipelineDescription)
addCapsProbe(elementName, padName, function(mediaType, properties))
addAppSinkCallback(appSinkName, appSinkCallback)
setState(state)
Read only properties:
pixelFormat
width
height
-
planes
: returnsArray
of planes offsets.