FORUMS

Hauwei’s Rapid Rise to Third Place in the Smartphone Race

Huawei has quickly grown to become one of the world’s biggest … more

OnePlus 2 Bares All in New Tear Down Gallery

Last year, the launch of the OnePlus One, dubbed ‘the flagship killer’, visibly … more

Focus – An Attractive But Raw Gallery Replacement

Focus is an attractive new app built by XDA members Liam Spradlin … more

How to Root the LG G4 and Install TWRP Recovery – XDA TV

A rooting method has finally been found for the flagship LG G4. In this … more

[XAP / BETA] WP7 Screen recorder (Based on "The DllImport Project")

569 posts
Thanks Meter: 226
 
By fiinix, Retired Recognized Developer on 22nd June 2011, 12:41 AM
Post Reply Subscribe to Thread Email Thread
WP7 Screen recorder program


>Zomg, the Chinese could not program good fps...
>So i super optimized the **** code of theirs.

Application features

* Full-screen mode "F11"
* Presentation-mode background color chooser. (Useful in F11 mode)
* Great features on UI (The cn version suck'ed with UI)
* Chose what IP port WP7<>Server talk over
* See frames count' received
* Start/Stop server at any time to continue later -button
* More than 2.3 (old) 4 fps (stable fps)! Yay.


BETA Preview (Watch via Youtube for 720p; damn 4:3 ratio):


Cable free demo (works kind of well) (depends on wifi latency for FPS)


Randoms:
>My rage post about how they cant code: http://forum.xda-developers.com/show...6&postcount=75
>This is the result, many extra fps (more to come), yay.


- Server is always backwards compatibility -

Fixed-list

- (v0.2) WP-Client: More frames, less lagg.
- (v0.3) WP-Client: -^- and now a idle fps @ 5.1~ YEAH (my phone, inside app)
> Added more cross-device compatibility for dehydration hack (forgot native dll's, remembered today, so i fixed them too)
> CSharp___DllImport.Dehydrator.AllowMultitasking = true; (threw exception's, gone now ^)
Last edited by fiinix; 11th July 2011 at 10:51 PM.
The Following 15 Users Say Thank You to fiinix For This Useful Post: [ View ]
 
 
22nd June 2011, 03:19 AM |#2  
Dwight2001's Avatar
Senior Member
Flag Richmond, VA
Thanks Meter: 1
 
More
This is huge can't wait!!
22nd June 2011, 08:14 AM |#3  
ninjy's Avatar
Senior Member
Flag Lyon
Thanks Meter: 41
 
More
This will work with games ?
22nd June 2011, 11:08 AM |#4  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 226
 
Donate to Me
More
Quote:
Originally Posted by ninjy

This will work with games ?

It captures frames globally on the phone, wherever you are; games, yes, but the wifi limitations etc holds the fps down. Later i will take milliseconds benchmark to see where all the functions are un-optimized.
The Following User Says Thank You to fiinix For This Useful Post: [ View ]
22nd June 2011, 11:47 AM |#5  
the0ne's Avatar
Senior Member
Flag Melbourne
Thanks Meter: 52
 
More
nice work mate
22nd June 2011, 12:31 PM |#6  
ninjy's Avatar
Senior Member
Flag Lyon
Thanks Meter: 41
 
More
I ask this because the Screen capture program based on "The DllImport Project" too can't capture games, probably due to DirectX.
22nd June 2011, 12:39 PM |#7  
Junior Member
Thanks Meter: 5
 
More
Nice work...
22nd June 2011, 01:58 PM |#8  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 226
 
Donate to Me
More
Duration taken for 1 thread render: 21.295 sec
Duration taken for 2 thread render: 20.232 sec

Saves 1 sec total per 100 frames (according to yesterdays benchmark compared with today's new code)
>Going for the better =D

1 frame = 0,2023 sec (200 ms) (fully rendered)

>Stack where the most time is wasted
>Sending it back to server, need multi-thread there toooo

Eh, not the server transmit
>4.586 sec for 100 frames (static frame) (way to fast)
>0,04586 sec for 1 frame (45,86 milliseconds)


105,4 ms goes to "Phone.Screen.GetCaptureBytes(out buffer);"

+ So thats:
* 202 ms (get & render pixels)
* 45 ms (send pixels)
- Total of: 246 ms
> Average of 4,065 fps

Code:
var t = new Phone.Timers.HiPerfTimer();
t.Start();
for (int i = 0; i < 100; i++)
{
    first = CaptureData();
}
t.Stop();
More soon; and a release very soon.
Last edited by fiinix; 22nd June 2011 at 03:35 PM.
22nd June 2011, 02:29 PM |#9  
Ddriver's Avatar
Senior Member
Thanks Meter: 23
 
More
Cool, waiting for it.

Sent from my WP7 HTC Mozart using XDA Windows Phone 7 App
22nd June 2011, 03:21 PM |#10  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by fiinix

Duration taken for 1 thread render: 21.295 sec
Duration taken for 2 thread render: 20.232 sec

What exactly are you rendering? cant you send the data as defalte stream to the server and render there?

Also why 2 threads for this slow operation any way?

Quote:
Originally Posted by fiinix

105,4 ms goes to "Phone.Screen.GetCaptureBytes(out buffer);"

+ So thats:
* 202 ms (get & render pixels)
* 45 ms (send pixels)
- Total of: 246 ms
> Average of 4,065 ms

Your goal should be 105,4 ms since thats the upper bound.

Call Phone.Screen.GetCaptureBytes(out buffer); in 1 thread and fill a ring buffer with the info 3 to X elements.

Use antother thread to get them from this buffer, and send them. should be 120 ms then.

If i get something really wrong, please let me know, if you need help with multi threading stuff let me know.

regards.
22nd June 2011, 03:33 PM |#11  
fiinix's Avatar
OP Retired Recognized Developer
Flag Stockholm
Thanks Meter: 226
 
Donate to Me
More
Quote:
Originally Posted by Flow WP7

What exactly are you rendering? cant you send the data as defalte stream to the server and render there?

Also why 2 threads for this slow operation any way?



Your goal should be 105,4 ms since thats the upper bound.

Call Phone.Screen.GetCaptureBytes(out buffer); in 1 thread and fill a ring buffer with the info 3 to X elements.

Use antother thread to get them from this buffer, and send them. should be 120 ms then.

If i get something really wrong, please let me know, if you need help with multi threading stuff let me know.

regards.

New demo video up. (Works perfect without cable!)
__
Getting fps is very hard :P
Fun Fun Fun!

"Also why 2 threads for this slow operation any way?"
> More threads = faster done.
__

This is the multi-threaded render'er, that converts the "argb" so it can be compressed to "jpeg" (8kb img out):
Code:
Phone.Screen.GetCaptureBytes(out buffer);

captureWorker1T.RunWorkerAsync();

int bufferPos = 576000;
int i = 191999;

while (i < 383998) // thread 2 on "main loop thread"
{
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
    arr[++i] = (buffer[bufferPos++] | (buffer[bufferPos++] << 8)) | (buffer[bufferPos++] << 16);
}

captureWorker1E.WaitOne();

return bmp;

Read More
Post Reply Subscribe to Thread

Tags
wp7 screen recorder recx
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes