[App] ScreenCap (OSDcap) - Screen capture

Here are software that related with Samsung B series TVs. Like hex editors, new version of BusyBox or internal software, app programs that will run in your TV hardware.:!:This forum is NOT FOR USER QUESTIONS or Problems.

nostromo1983
Posts: 72
Joined: Sat Nov 07, 2009 4:39 pm

Re: OSDcap - Screen (OSD) capture application

Post by nostromo1983 »

Seems very interesting application, it will be helpful to make proper screenshot and not with cameras. It could be used to make a "Still image" function as i had with my old cathodic Panasonic TV. It's function to "stop" to an image when we want using a button of the remote controller, when watching TV.
Good work Geo650
Samsung LE32B554 T-CH5DEUC 2006.0 with patched u-boot for usb boot with OpenEmbedded custom kernel with network supported and usb rootfs
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: OSDcap - Screen (OSD) capture application

Post by geo650 »

nostromo1983 wrote:... It could be used to make a "Still image" function ... when watching TV.
I wish it could freeze live video in the future. Nowadays, it can only make OSD snapshots.

One more question from my friend, and me: how to make injection chain ? For example, when other application with injection function that catches remote buttons was loaded first, and then my OSDcap is loaded, then remote buttons presses are reported to OSDcap only, not other application. In other words, how to do this:

Code: Select all

.................................................
in loader.so:
...
   void *prev_injection = NULL;

	// Injecting!
 	int page = ((unsigned) KeyCommon_SendKeyPressInput) & ~0x0FFF;
	mprotect((void *) page, 8192, PROT_READ | PROT_WRITE | PROT_EXEC);

	if (KeyCommon_SendKeyPressInput[4] == 0xE51FF004)	// remapped already ?
	{
	   prev_injection = (void *)KeyCommon_SendKeyPressInput[5];
	   KeyCommon_SendKeyPressInput[4] = 0xE51FF004;         // <----------- BTW, what instructions are there
	   KeyCommon_SendKeyPressInput[5] = (unsigned)ex_nextinjection;
	}
	else	// first remapping?
	{
	   KeyCommon_SendKeyPressInput[4] = 0xE51FF004;         // <----------- BTW, what instructions are there? call or jump???
	   KeyCommon_SendKeyPressInput[5] = (unsigned)ex_injection;
	}
	mprotect((void *) page, 8192, PROT_READ | PROT_EXEC);

..................................................................................
in main library (assume, prev_injection was received from loader):

void nextinjection(int a, int key, int arg_r2)
{
	// gcc should put "STMFD SP!, {R4,LR}" on top, if everything goes as planned (LDMFD...? - I don't think so)
	asm volatile(
		"STMFD   SP!, {R0,R2,R3,R12}\n"		// store some registers
	);

	if (prev_injection) execute_previous_injection_function_here();   // <------- HOW ?????

	button_pressed(key);				// our function returning integer (in R0?)
	
	asm volatile(
		"MOV     R1, R0\n"			// remapped keycode
		"MOV     R6, R0\n"			// remapped keycode
		"LDMFD   SP!, {R0,R2,R3,R12}\n"		// restore registers stored before
		"LDMFD   SP!, {R4,LR}\n"		// restore ...
		"MOV     R7, R2\n"			//This is original command that we overwrite
		"LDR     R3, [R8]\n"			//This is original command that we overwrite
		"LDR     PC, =(_ZN9KeyCommon17SendKeyPressInputEii + 0x18 )\n"	//return after injection
	);
}
Without this, we cannot make any snapshot from our applications working with injection mechanism. For example, you cannot start recording with PVR app, and then make snapshot of REC icon, because after loading OSDcap, your REC button will be ignored. I think, it must be done something like interrupt vectors in PC.
nbd
Posts: 160
Joined: Wed Jan 13, 2010 12:02 pm

Re: OSDcap - Screen (OSD) capture application

Post by nbd »

One solution is to have one common keycode injection code shared across all applications we develop. I think I wrote some ideas already to some other thread, but the basic idea was to have the keycode injection loaded once, and it would then dynamically load other libraries according to config file (and if it is not yet loaded). For example, pressing REC for the first time would load the PVR (and start recording if possible).

I don't really know if this solves your issue, but I hope it gives more ideas how to tackle this problem.
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: OSDcap - Screen (OSD) capture application

Post by geo650 »

nbd wrote:One solution is to have one common keycode injection code shared across all applications we develop...
I think that's good idea. In the other hand, you'll have to load that common "dispatcher" first and it will be not very useful for non-patched systems.

UPDATE:
I did it! Chain is working. A few moments with ARM instruction set PDF and my experience with assembler (not ARM) made it possible. Stay tuned for details.
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: OSDcap - Screen (OSD) capture application

Post by geo650 »

Hello again!

And here we go. You can test OSDcap 0.4.
To build remote control button catching chain I made an additional function (next_injection) which is used in case any old injection has been detected. Old injection address is injected to the end of that next_injection() function. After processing new function, old one is processed, where at the very end of chain it reaches exeDSP. Quite simple, isn't it?

Source code included.

Thanks to moras86 for a very nice icon.
~Geo650

EDIT: Attachment removed due to forum quota limits and new version launched.
Last edited by geo650 on Thu Oct 28, 2010 7:27 pm, edited 1 time in total.
nbd
Posts: 160
Joined: Wed Jan 13, 2010 12:02 pm

Re: OSDcap - Screen (OSD) capture application

Post by nbd »

\o/

Speechless. Just awesome! This, and the C series news.. wow, this is a great day for SamyGO :)
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: OSDcap - Screen (OSD) capture application

Post by geo650 »

New version available.
Changes:
- temporary debug log in loader (created in mtd_ram and removed if OK)
- injectso compatibility (fixed minor bug in loader).
- buttons action: now please hit PRE_CH, then 1, 2, 3, 4 or 5 numeric button to capture selected memory area.
Enjoy.
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: OSDcap - Screen (OSD) capture application

Post by juusso »

Thank You!
I missed an config file to set where to place captured pictures. What if i want run "game: from TV memory (not from USB) and store captured content to NFS or samba directory? Now it stores pictures within OSDcap directory.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
geo650
Official SamyGO Developer
Posts: 303
Joined: Wed Oct 07, 2009 12:03 pm

Re: OSDcap - Screen (OSD) capture application

Post by geo650 »

juuso wrote:Thank You!
I missed an config file to set where to place captured pictures....
...and you say...
New version (I hope the last one, because I have no much time) is available for downloading.
Last changes:
- INI file with DESTINATION path
- simpler injection function
- auto-select mode (press PRE_CH, then numeric 0)
Enjoy!
You do not have the required permissions to view the files attached to this post.
gchirtoaca
Posts: 36
Joined: Wed May 05, 2010 9:31 pm
Location: Bucharest, Romania
Contact:

Re: OSDcap - Screen (OSD) capture application

Post by gchirtoaca »

Nice utility, geo650!
Can this method be used in PVR application to record live video from other sources than internal tuner, like HDMI STB?
This way, any encryption can be bypassed.
Samsung LE37B653T5PXZG, T-CHLCIPDEUC 2008.2 firmware, Advanced Mode Patch

Post Reply

Return to “[B] Software”