Last active
December 24, 2016 01:05
-
-
Save pliablepixels/ae7de9f52bf82b59835e9b0775ba0139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a dummy frame provider with the same dimensions as the original feed | |
Options options; | |
options.add( "width", IMG_W ); | |
options.add( "height", IMG_H ); | |
options.add( "pixelFormat", (PixelFormat)AV_PIX_FMT_RGB24 ); | |
DummyInput dummyInput( "dummy", options ); | |
app.addThread( &dummyInput ); | |
// Instantiate a fallback class that looks for frames from "detector" | |
// and if none are received in 2 seconds, switches to dummy frames | |
InputFallback fallbackInput( "fallback", 2.0 ); | |
fallbackInput.registerProvider( *detector ); | |
fallbackInput.registerProvider( dummyInput ); | |
app.addThread( &fallbackInput ); | |
// connect HTTP renderer to fallbackInput | |
HttpController httpController( "http", 9292 ); | |
httpController.addStream( "live",*input ); | |
httpController.addStream( "detect", *detector ); | |
httpController.addStream( "fallback", fallbackInput ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment