Is there a way for a Live Wallpaper to restart itself?
Asked
Active
Viewed 1,651 times
3
-
1Why would you want/need to do this? – Josh Jul 13 '11 at 18:19
-
1The reason is because I'm writing a wallpaper that uses FFmpeg via NDK. I think the NDK version of FFmpeg may be buggy---I can't seem to free the video frame on orientation changes. It seems easier to just restart the wallpaper (and therefore, reset the memory) than hunt down the library memory leak... Yeah, it's a hack – U Avalos Jul 13 '11 at 19:28
-
1Yup just confirmed it, there seems to be something wrong with av_freep(). Any how, restarting the wallpaper seems like a quick hack that'll get the job done – U Avalos Jul 13 '11 at 19:46
-
1What do you mean by "the NDK version of FFmpeg"? I thought there were many ports, or you could compile your own. Either way, you might be able to get around this by using a different implementation. – Josh Jul 15 '11 at 13:12
3 Answers
2
In a reference to a google post by one of the android devs that I can't find now, while you can stop a live wallpaper, you can't start it yourself---it's a security issue. So the answer is that this can't be done.

U Avalos
- 6,538
- 7
- 48
- 81
1
Being a Service, have you tried using stopService()? Not sure how to start it up again, though.

Josh
- 10,618
- 2
- 32
- 36
-
no that doesn't work (although that's probably the approach). Still how to restart? – U Avalos Jul 14 '11 at 16:32
1
Maybe try a different ffmpeg implementation to avoid the bug? This guy used bambuser's version.

Josh
- 10,618
- 2
- 32
- 36
-
That's actually me :-) Rotating the video doesn't work. Well, at least on the client's phone. Either it's OpenGL, FFmpeg, the client's phone, or a combination of all three. Either way, the best solution (although a hack) is starting to look like restarting the wallpaper. – U Avalos Jul 20 '11 at 19:51
-
Haha, that's great. I was just shooting in the dark, no idea where to go from there. Good luck! – Josh Jul 21 '11 at 13:04