I've changed my image to a super small one, like 100x20 px. it's showing up with the code bellow but I'm getting this annoying, inconsistent flicker on mostly the lower half of my screen. The further down, the more persistent it is. It does not affect the video or the image, only text, lines, and squares being drawn (of which there are about 35 total)
Does dfDrawImage recreate a bitmap? because that's what I'm using in my draw loop. Here's an overview of my code. I've taken out some parts of the code, xml fetches and such. I promise the important stuff is there.
Library "v30/bslDefender.brs"
Function showVideoStream(url as object)
'...declare about 6 xml elements, 6 timespans, 3 arrays, and about 20 variables. I hope that isn't causing a memory issue.
if displaymode = "720p" then
fontsmall = reg.GetDefaultFont(12, false, false)
font = reg.GetDefaultFont(18, false, false)
fontlarge = reg.GetDefaultFont(24, false, false)
else
fontsmall = reg.GetDefaultFont(8, false, false)
font = reg.GetDefaultFont(12, false, false)
fontlarge = reg.GetDefaultFont(22, false, false)
end if
screen = CreateObject("roScreen", true)
screen.SetMessagePort(port)
preroll = {
stream: { url: url.preroll}
streamFormat : url.prerollFormat
}
player = CreateObject("roVideoPlayer")
player.SetMaxVideoDecodeResolution(1280, 720)
player.SetMessagePort(port)
player.SetPositionNotificationPeriod(url.PositionNotificationPeriod)
player.SetDestinationRect({x:0, y:0, w:0, h:0})
player.setloop(false)
player.SetContentList([{
streamFormat: url.streamformat
stream: { url: url.streamurls[0] }
}])
if ShowPreroll(preroll)
player.Play()
end if
viewpost = "www"
print viewpost
xfer.seturl(viewpost)
RawXMLData=xfer.gettostring()
if xml.parse(RawXMLData) then
'fill "Device" array
end if
screen.Clear(&h00000000)
screen.finish()
m.buffercount = 0
while true
msg=port.getmessage()
'*******************************
'Viewpost Timer
'*******************************
if (viewposttimer.TotalMilliseconds() / 1000) >= m.PositionNotificationPeriod
viewposttimer.mark()
nowpos = nowpos + url.PositionNotificationPeriod
print "Playback position: " + nowpos.toStr()
device.clear()
overlays.clear()
nextoverlays.clear()
xml.clear()
viewpost = "www"
xfer.seturl(viewpost)
RawXMLData=xfer.gettostring()
if xml.parse(RawXMLData) then
'fill "device" array
end if
'***************************************
'Print Items
'***************************************
else if (msg = invalid)
if (screenmode = 0)
'nothin
'*******************************************HD Drawing *********************************
'*********** PROBLEM AREA
else if (screenmode = 1) and ( displaymode = "720p")
screen.Clear(&h00000000)
dfDrawImage(screen, "tmp:/overlay.png",200,200)
for idx = 0 to ( catcount.count() - 1)
if idx = newsindex then
if (newslength > 0) and (newstimer.totalseconds() > 6) and (Xcrawl < newslength +200 )
screen.DrawRect(strtoi(interfacexml.cat[idx].x1.gettext()),strtoi(interfacexml.cat[idx].y1.gettext()), strtoi(interfacexml.cat[idx].w1.gettext()) - Ccrawl, strtoi(interfacexml.cat[idx].h1.gettext()), HexToInteger3(interfacexml.cat[idx].color.gettext()))
Ccrawl = Ccrawl + (( strtoi(interfacexml.cat[idx].w0.gettext()) /(newslength +200)) * device.newscrawlspeed)
else
screen.DrawRect(strtoi(interfacexml.cat[idx].x1.gettext()),strtoi(interfacexml.cat[idx].y1.gettext()), strtoi(interfacexml.cat[idx].w1.gettext()), strtoi(interfacexml.cat[idx].h1.gettext()), HexToInteger3(interfacexml.cat[idx].color.gettext()))
end if
else
screen.DrawRect(strtoi(interfacexml.cat[idx].x0.gettext()),strtoi(interfacexml.cat[idx].y0.gettext()), strtoi(interfacexml.cat[idx].w0.gettext()), strtoi(interfacexml.cat[idx].h0.gettext()), HexToInteger3(interfacexml.cat[idx].color.gettext()))
end if
screen.DrawText(interfacexml.cat[idx].subcat[subcatindex[idx]].label.gettext(), strtoi(interfacexml.cat[idx].x.gettext()), strtoi(interfacexml.cat[idx].y.gettext()), &hFFFFFFFF, font)
next idx
if (newstimer.totalseconds() >= 4) and (newstimer.totalseconds() <= 6)
for each obj in newsxml.overlay
screen.DrawText(obj.text.gettext(), strtoi(obj.X.gettext()), strtoi(obj.Y.gettext()), &hFFFFFFFF, font)
next
else if (newstimer.totalseconds() >= 6) and (Xcrawl < newslength +200 )
xcrawl = xcrawl + device.newscrawlspeed
for each obj in newsxml.overlay
screen.DrawText(obj.text.gettext() , strtoi(obj.X.gettext()) - xcrawl , strtoi(obj.Y.gettext()), &hFFFFFFFF, font)
next
end if
if (weathertimer.TotalSeconds() <= m.WeatherNotificationPeriod)
for each obj in weatherxml.overlay
screen.DrawRect(strtoi(obj.X.gettext()), strtoi(obj.Y.gettext()), strtoi(obj.W.gettext()), strtoi(obj.H.gettext()), HexToInteger3(obj.color.gettext()))
next
screen.DrawRect(1030,20, 200 - ((weathertimer.totalmilliseconds() / 1000) * (200 / m.WeatherNotificationPeriod ) ),5, HexToInteger3("40404040"))
else if (weathertimer.totalseconds() > m.WeatherNotificationPeriod)
for each obj in weatherxml.overlay
screen.DrawRect(strtoi(obj.X.gettext()), strtoi(obj.Y.gettext()), strtoi(obj.W.gettext()), strtoi(obj.H.gettext()), HexToInteger3(obj.color.gettext()))
next
weatherxml.clear()
weathermark = 0
weathertimer.mark()
end if
screen.SwapBuffers()
end if
End Function