A few quick updates here. In my old code repository I made (and pushed) some updates to impack, using GIFLib instead of the bits from stb seen in the source, since the latter were falling down on a few GIFs. I do intend to bring that in, but I think I’ll do so as a new dedicated GIF plugin, probably including the writer as well.
I spent yesterday afternoon setting up some new plugins (now building with VS2019 right from the outset), bringing in the libraries they’ll be binding and ensuring they compiled on Windows. All were listed as ideas on the plugins page, three of them being: Blend2D, OAML, and Polylidar.
This afternoon was spent binding the last in the batch, TheoraPlay. I now have some decent Theora video playback working. This is provided via external textures, and so can be assigned to display objects and be well-behaved within the hierarchy, have effects applied on top, and so on. (I am in fact trying to deliver the output in a rawer form, not as RGBA–as an option, anyway–so that a shader could be called upon for the decoding itself. At the moment I’m stumped, though.)
My testing sample:
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, sublicense, and/or sell copies of the Software, and to
-- permit persons to whom the Software is furnished to do so, subject to
-- the following conditions:
--
-- The above copyright notice and this permission notice shall be
-- included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
-- [ MIT license: http://www.opensource.org/licenses/mit-license.php ]
local tp = require("plugin.TheoraPlay")
local video, err = tp.decodeFromFile("360.ogv")
print("?", video, err)
local image = display.newImageRect(video.filename, video.baseDir, 640, 360)
image.x, image.y = display.contentCenterX, display.contentCenterY
local prev
timer.performWithDelay(20, function()
local now, diff = system.getTimer()
if prev then
diff = now - prev
end
video:Step(diff or 0)
video:invalidate()
prev = now
end, 0)
Tested with videos from here.
There are some audio needs that arise in this and presumably OAML, as well as other projects I’ve dabbled in or have in mind. I have an open source enhancement in mind here, ideally something akin to what you see in the above sample with the video
object and its use by display.newImageRect()
.