StreamChunk s = streamChunks.front();
streamChunks.pop();
//logger->debug(TAG, "About to call demuxer with {} {}", (void*)s.data, s.len);
- /*int a =*/ demuxer->put(static_cast<u1*>(s.data), s.len);
+ /*int a =*/ demuxer->put(static_cast<u1*>(s.data), toi4(s.len));
//logger->debug(TAG, "put {} to demuxer", a);
free(s.data);
}
u4 j = 0;
while (j < chan->numAPids && !found)
{
- if (Audio::getInstance()->streamTypeSupported(chan->apids[j].type))
+ if (Audio::getInstance()->streamTypeSupported(toi4(chan->apids[j].type)))
{
- demuxer->setAID(chan->apids[j].pid, 0, chan->apids[j].type, true);
+ demuxer->setAID(toi4(chan->apids[j].pid), 0, toi4(chan->apids[j].type), true);
audio->setStreamType(Audio::MPEG2_PES);
logger->debug(TAG, "Demuxer pids: {} {} {}", chan->vpid, chan->apids[j].pid, chan->apids[j].type);
found = true;
u4 j = 0;
while (j < chan->numDPids && !found)
{
- if (Audio::getInstance()->streamTypeSupported(chan->dpids[j].type))
+ if (Audio::getInstance()->streamTypeSupported(toi4(chan->dpids[j].type)))
{
- demuxer->setAID(chan->dpids[j].pid, 1, chan->dpids[j].type, true);
+ demuxer->setAID(toi4(chan->dpids[j].pid), 1, toi4(chan->dpids[j].type), true);
audio->setStreamType(Audio::MPEG2_PES);
logger->debug(TAG, "Demuxer pids: {} {} (ac3) {}", chan->vpid, chan->dpids[j].pid, chan->dpids[j].type);
found=true;
if (state == S_PREBUFFERING)
{
++preBufferCount;
- u4 percentDone = (preBufferCount * 100) / preBufferAmount;
+ u4 percentDone = tou4((preBufferCount * 100) / preBufferAmount);
logger->debug(TAG, "Prebuffering {}%", percentDone);
}
else
{
- startMargin = atoi(cstartMargin) * 60;
+ startMargin = tou4(atoi(cstartMargin)) * 60;
delete[] cstartMargin;
}
}
else
{
- endMargin = atoi(cendMargin) * 60;
+ endMargin = tou4(atoi(cendMargin)) * 60;
delete[] cendMargin;
}
clocksRegion.x = barRegion.x + 140;
clocksRegion.y = barRegion.y + 12;
clocksRegion.w = 170;
- clocksRegion.h = getFontHeight();
+ clocksRegion.h = tou4(getFontHeight());
// barBlue.set(0, 0, 150, 150);
barBlue.set(0, 0, 0, 128);
{
// skip to previous mark
LogNT* logger = LogNT::getInstance();
- int currentFrame = (player->getCurrentFrameNum()); // get current Frame
+ i4 currentFrame = toi4(player->getCurrentFrameNum()); // get current Frame
currentFrame -= toi4(5 * myRec->recInfo->fps); // subtrack 5 seconds, else you cannot skip more than once back ..
int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
{
// skip to next mark
LogNT* logger = LogNT::getInstance();
- int currentFrame = (player->getCurrentFrameNum());
+ i4 currentFrame = toi4(player->getCurrentFrameNum());
- int nextMark = myRec->getNextMark(currentFrame);
+ i4 nextMark = myRec->getNextMark(currentFrame);
if (nextMark)
{
if (m->message == Message::MOUSE_LBDOWN)
{
- u4 x = m->parameter - getScreenX();
- u4 y = m->tag - getScreenY();
+ u4 x = m->parameter - tou4(getScreenX());
+ u4 y = m->tag - tou4(getScreenY());
if (!barShowing)
{
}
else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y)
{
- int progBarXbase = barRegion.x + 300;
+ int progBarXbase = toi4(barRegion.x) + 300;
if (myRec->hasMarks())
{
MarkList* markList = myRec->getMarkList();
loopMark = *i;
if (loopMark->pos)
{
- posPix = 302 * loopMark->pos / lengthFrames;
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
- if (x>=barRegion.x + progBarXbase + 2 + posPix
- && x<=barRegion.x + progBarXbase + 2 + posPix+3
+ posPix = 302 * loopMark->pos / toi4(lengthFrames);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
+ if (x>=barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix)
+ && x<=barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix)+3
&& y>=barRegion.y + 12 - 2
&& y<=barRegion.y + 12 - 2+28)
{
}
}
- if (x>=barRegion.x + progBarXbase + 24
- && x<=barRegion.x + progBarXbase + 4 + 302
+ if (x >= barRegion.x + tou4(progBarXbase) + 24
+ && x<=barRegion.x + tou4(progBarXbase) + 4 + 302
&& y>=barRegion.y + 12 - 2
&& y<=barRegion.y + 12 - 2+28)
{
- int cx=x-(barRegion.x + progBarXbase + 4);
+ int cx = toi4(x) - (toi4(barRegion.x) + progBarXbase + 4);
double percent = cx / 302. * 100.;
player->jumpToPercent(percent);
doBar(3);
{
char text[5];
SNPRINTF(text, 5, "%ux", scanrate);
- drawText(text, barRegion.x + 102, barRegion.y + 12, DrawStyle::LIGHTTEXT);
+ drawText(text, toi4(barRegion.x) + 102, toi4(barRegion.y) + 12, DrawStyle::LIGHTTEXT);
}
}
struct tm tms;
LOCALTIME_R(&t, &tms);
strftime(timeString, 19, "%H:%M", &tms);
- drawText(timeString, barRegion.x + 624, barRegion.y + 12, DrawStyle::LIGHTTEXT);
+ drawText(timeString, toi4(barRegion.x) + 624, toi4(barRegion.y) + 12, DrawStyle::LIGHTTEXT);
// Draw clocks
#ifndef GRADIENT_DRAWING
logger->debug(TAG, buffer);
}
- drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT);
+ drawText(buffer, toi4(clocksRegion.x), toi4(clocksRegion.y), DrawStyle::LIGHTTEXT);
// Draw progress bar
- int progBarXbase = barRegion.x + 300;
+ int progBarXbase = toi4(barRegion.x) + 300;
- rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, DrawStyle::LIGHTTEXT);
- rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue);
+ rectangle(barRegion.x + tou4(progBarXbase), barRegion.y + 12, 310, 24, DrawStyle::LIGHTTEXT);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2, barRegion.y + 14, 306, 20, barBlue);
if (currentFrameNum > lengthFrames) return;
if (lengthFrames == 0) return;
// Draw yellow portion
- int progressWidth = 302 * currentFrameNum / lengthFrames;
- rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT);
+ int progressWidth = toi4(302 * currentFrameNum / lengthFrames);
+ rectangle(barRegion.x + tou4(progBarXbase) + 4, barRegion.y + 16, tou4(progressWidth), 16, DrawStyle::SELECTHIGHLIGHT);
if (myRec->recInfo->timerEnd > time(NULL)) // if chasing
{
- int nrWidth = 302 * (lengthFrames - player->getLengthFrames()) / lengthFrames;
+ int nrWidth = toi4(302 * (lengthFrames - player->getLengthFrames()) / lengthFrames);
LogNT::getInstance()->debug("GVASDF", "Length Frames: {}", lengthFrames);
LogNT::getInstance()->debug("GVASDF", "Player lf: {}", player->getLengthFrames());
LogNT::getInstance()->debug("GVASDF", "NR WDITH: {}", nrWidth);
- rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, DrawStyle::RED);
+ rectangle(barRegion.x + tou4(progBarXbase) + 4 + 302 - tou4(nrWidth), barRegion.y + 16, tou4(nrWidth), 16, DrawStyle::RED);
}
int posPix;
if (loopMark->pos)
{
logger->debug(TAG, "Drawing mark at frame {}", loopMark->pos);
- posPix = 302 * loopMark->pos / lengthFrames;
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
+ posPix = 302 * loopMark->pos / toi4(lengthFrames);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER);
}
}
}
posPix = toi4(302 * startMargin * myRec->recInfo->fps / lengthFrames);
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT);
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT);
posPix = toi4(302 * (lengthFrames - endMargin * myRec->recInfo->fps) / lengthFrames);
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT);
- rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT);
+ rectangle(barRegion.x + tou4(progBarXbase) + 2 + tou4(posPix), barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT);
}
}