Wrong font rendering in EPG eventlist

Entwicklung
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Wrong font rendering in EPG eventlist

Beitrag von Benny »

Greetings,

small bug in eventlist.cpp:
https://gitorious.org/neutrino-mp/marti ... ee35b58e78

Code: Alles auswählen

snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute);
			int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt) + 10;
			g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color);
String (at line 765 in eventlist.cpp) should be rendered as UTF8:

Code: Alles auswählen

g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color, 0, true);
martii, can you explain to me - why some string rendered as UTF8, others - is not? Ie, why not render all of them in UTF8 by default?

Screenshots:
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

Some styling for EPG view/eventlist (not really necessary, just for better "look & feel"):
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Benny hat geschrieben:Some styling for EPG view/eventlist (not really necessary, just for better "look & feel"):
Applied, thanks!
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Hi Benny,
Benny hat geschrieben: martii, can you explain to me - why some string rendered as UTF8, others - is not? Ie, why not render all of them in UTF8 by default?
usually these are just oversights. Nowadays pretty much everything should conform to UTF8 (and changing the default to UTF8 could be a good idea).

Cheers,

martii
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii hat geschrieben:usually these are just oversights ...and changing the default to UTF8 could be a good idea.
So there no any hidden traps with it, in Neutrino code?

Ok, thanks for explanation.
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Benny hat geschrieben:So there no any hidden traps with it, in Neutrino code?
Well, I wouldn't vouch for that.

Anyway ... the font renderer now defaults to UTF-8: https://gitorious.org/neutrino-mp/marti ... af51de8909

Cheers,

martii
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii hat geschrieben: Anyway ... the font renderer now defaults to UTF-8
Oh, this was really quick decision, thank you. If there any pitfalls still exist, soon we will know about it =)

Update: quick test after repo update - at first glance, everything looks OK, but:

1) unrelated to, seems old small "defect", in streaminfo2.cpp line 479 should look like:

Code: Alles auswählen

 spaceoffset = array[i]+10; //add 10 pix to x_offset
2) related to, in eventlist.cpp line 768 should look like:

Code: Alles auswählen

g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, w, beginnt, color);
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii, if you going to fix streaminfo2.cpp anyway, please, look at audiotype output code - it's broken, or full-feature audio-attributes list not supported on SPARK hardware?
It's always outputs "MPEG stereo ()", regardless of selected audio track.

Code: Alles auswählen

//AUDIOTYPE
	int type, layer, freq, mode, lbitrate;
	audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode);

	snprintf (buf, sizeof(buf), "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE));
	g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT);

	if(type == 0) {
		const char *mpegmodes[4] = { "stereo", "joint_st", "dual_ch", "single_ch" };
		snprintf (buf, sizeof(buf), "MPEG %s (%d)", mpegmodes[mode], freq);
	} else {
		const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" };
		snprintf (buf, sizeof(buf), "DD %s (%d)", ddmodes[mode], freq);
	}
I tried to debug it myself, but stuck at source/libstb-hal/libspark/audio.cpp - due to lack of knowledge in c++ and SPARK hardware.

Code: Alles auswählen

void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode)
{
	lt_debug("%s\n", __FUNCTION__);
	type = 0;
	layer = 0;
	freq = 0;
	bitrate = 0;
	mode = 0;
.......
}
As far i understand, getAudioInfo() not working as expected, so someone just "zeroed" its output, and this is why in Stream Info we always get "MPEG stereo ()".
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Hi Benny,

getAudioInfo() is just a dummy method (and the parts that are commented out are (IMHO) from the TripleDragon variant which I assume *does* work). Player2 doesn't provide most the data that method should return, so seife was absolutely right in just zeroing the values.

I'm currently short on time. I may have a closer look at the other issues later this week.

Cheers,

martii
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii hat geschrieben: I'm currently short on time. I may have a closer look at the other issues later this week.
No problem.
I just wanted verify that
a) you know about this issue,
b) maybe, "AudioType" should be removed from StreamInfo, until (if ever) fix is ready?

Post update: attached patches for minor changes, mentioned above.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Hi Benny,

I've applied two of your patches but skipped the streaminfo2.cpp one (incrementing the offset inside the loop looks wrong to me). Plus, streaminfo2 now shows the stock audio channel description instead of the previous MPEG... default. (I see no way to get any sensible information from the hardware, and probing the stream with ffmpeg introduces a delay that's plainly unacceptable).

Cheers,

martii
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii hat geschrieben: I've applied two of your patches
Thank you.
martii hat geschrieben: Plus, streaminfo2 now shows the stock audio channel description instead of the previous MPEG... default.
Thanks a lot, this is better then nothing, and much better then previous misinform output.

Of course, getting Dbox2-like audio stream info would be more useful, but i personally will not ask for impossible =)
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii, great work on extended audio info - thanks.

After i tried it myself, i understand, what do you mean under "a delay that's plainly unacceptable" - i personally don't mind, but someone less patient may throw RC into the wall or TV =)
Can "audio PIDs extended info" be painted in separate place, ie not in main paint loop - in this case, delay not affect paint time for bitrate graph/average bitrate info, and overall visually noticeable paint delay should be less annoying?

Sorry, if you didn't finished with StreamInfo, and work still in progress, but anyway, some comments on current implementation:
1) In MP+WebTV mode long URL looks really ugly. Should it be cropped/truncated?
2) In MP+file mode "URL" value is blank. Can we use filename path there, something like "URL: file://some_file.avi" or "URL: file://mnt/nfs/some_file.avi" ?
I tried, but can't invent something smarter then

Code: Alles auswählen

	if (mp) {
		// url
		r.key = g_Locale->getText (LOCALE_STREAMINFO_URL);
		r.key += ": ";
		r.val =channel->getUrl();
		if (strlen(r.val.c_str()) == 0) {   // if value is empty - hide URL label. Should we add path/filename here instead?
		r.key = "";
		}
		if (strlen(r.val.c_str()) > 40) {  // if string too long, crop it. Should it be cropped at render time via "width" option?
		r.val = r.val.substr(0,37);
		r.val += "...";
		}
		r.col = COL_INFOBAR_TEXT;
		v.push_back(r);
		scaling = 8000;
	} else {
If someone prefer old-style StreamInfo, patch also provided, see attached files.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
martii
Einsteiger
Einsteiger
Beiträge: 217
Registriert: Donnerstag 14. Juni 2012, 09:39

Re: Wrong font rendering in EPG eventlist

Beitrag von martii »

Hi Benny,

stream probing is now in parallel to determining the bitrate. The other issues should be resolved, too.

Cheers,

martii
Benny
Interessierter
Interessierter
Beiträge: 57
Registriert: Samstag 17. Mai 2014, 18:28
Sonstiges: GM990

Re: Wrong font rendering in EPG eventlist

Beitrag von Benny »

martii hat geschrieben:stream probing is now in parallel to determining the bitrate. The other issues should be resolved, too.
Great, thank you.