View Single Post
joerg_rw's Avatar
Posts: 2,222 | Thanked: 12,651 times | Joined on Mar 2010 @ SOL 3
#1086
Originally Posted by marmistrz View Post
I have an idea how to improve camera-ui. A script could be run before and after recording (e.g. to automatically OC the device for HD recording)

I might code and make a merge request, but
1. When should be the system(...) call made
2. Where should the scripts be located?
I pretty much like the idea, it makes for a nice generic interface to provide a thing commonly known as "hooks" and not really all that new (see http://mfnboer.home.xs4all.nl/twinkl...l#call_scripts for a pretty convenient reference implementation that I co-designed and recommend. sorry for the URL not really working, click on "Manual" and then on "Call Scripts") and it is independant of platform specifics like d-bus etc while still allowing to interface to those specific mechanisms with simple shellscript oneliners like "dbus-send"

Obviously you want to configure the full path&name of hook scripts inside the app via a user interface or config file of known name (or even direct gconf meddling though that again is platform specific dependency to gconf available), and you want to call such script with a rich environment(!) on every moderately relevant event like focus engage, focus release, trigger, app start, app close, review/gallery-open, gallery-close with delete, gallery-close w/o delete, a.s.o. And you frequently want the camera app to base further behaviour on return codes of the script called (given there exists such script to call) to e.g. close the cam app when the photo taken is ok by any postprocessing done in the hook - again see twinklephone for reference implementation.


I can see a few more nice usecases than just "enable/stop OC". E.G. how about uploading (in case of video, even streaming?) any media capture into "the cloud" so it's safe form any attempt to delete the record on device - I bet you know what I'm talking about.
Same scenario: make the camera automatically start video capture when camdoor gets opened while lens NOT pointing down to the floor, while when lens points down to the floor then the flashlight gets started and cam-app closed.
All of the above can easily get achived with a few lines in shellscripts doing the right thing when called by camera app

cheers
jOERG
__________________
Maemo Community Council member [2012-10, 2013-05, 2013-11, 2014-06 terms]
Hildon Foundation Council inaugural member.
MCe.V. foundation member

EX Hildon Foundation approved
Maemo Administration Coordinator (stepped down due to bullying 2014-04-05)
aka "techstaff" - the guys who keep your infra running - Devotion to Duty http://xkcd.com/705/

IRC(freenode): DocScrutinizer*
First USB hostmode fanatic, father of H-E-N

Last edited by joerg_rw; 2013-12-27 at 13:06.
 

The Following 4 Users Say Thank You to joerg_rw For This Useful Post: