1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.

Wednesday, February 20, 2013

Camera features added, by Android version


Camera features added, by Android version

As Android has matured, new camera features have been added. However, that means that some features don't apply to all versions of Android. Here's a look at what was added when, for still photography. This list doesn't cover video. Also, not all apps will use all of the available features on any given release.

I'm going to assume that nobody much cares about versions prior to 2.2 (Froyo). The Android camera facilities in those early releases are pretty limited, and any phone built back then is probably going to have a camera with low resolution.

Android 2.3 (Gingerbread — API level 9)
  •   Multiple camera support — typically front and back cameras
  •   Some control over the preview's Frames Per Second rate
  •   App can read out the approximate focus distance



Android 3.0 (Honeycomb — tablets only — API level 11)
  • Textured preview — I don't think I've ever seen this used
Android 4.0 (Ice Cream Sandwich — API level 14)
  • Selectable focus area or areas
  • Continuous focus
  • Selectable metering area or areas
  • Auto-exposure lock
  • Auto-white-balance lock
  • Face detection
  • Snapshot during video recording
  • A broadcast notification is sent to other apps when a picture is taken
Android 4.1 (Jellybean — API level 16)
  • App can tell when focus motion starts and stops
  • Features added in Jelly bean 4.2. Please update the OP.
  • Photo Sphere
  • With Android 4.0, Google introduced the Panorama capturing mode, and now with Android 4.2 Jelly Bean users will get a cool feature dubbed Photo Sphere. It's a panorama mode on steroids and allows you to capture photos in multiple directions (up, down, left, right).
  • After they've been captured and saved as JPEG files you can view them and navigate around the whole image. You can share the image on Google+ or, if you feel like it, contribute the Photo Sphere to Google Maps.
  • The feature itself was inspired by Street View, as the Product Management Director for Android Hugo Barra points out. He adds that the photos pack embedded XML metadata in them allowing you to easily share them on Google+ and put them in Google+ photo albums, where your friends can view them as well.






What's new in Android 4.2, Jelly Bean for Camera and Gallery

What's new in Android 4.2, Jelly Bean for Camera and Gallery


  1. New Android 4.2 features a completely redesigned camera app with new tools for taking photos.
  2. New High Dynamic Range or HDR mode (on supported devices) lets you see more detail in your shots by widening the exposure range.
  3. New A brand new photo editor features new filters, borders, and other tools to easily customize your photos.
  4. New With Photo Sphere you can take immersive 360ยบ images and wide angle shots that you can view and share on your phone, tablet or desktop computer.
  5. New Access camera straight from your phone’s lock screen.
  6. To quickly review photos you’ve taken without leaving the camera app, you can swipe from the camera viewfinder. To start snapping photos again, just swipe back to the camera viewfinder.
  7. When viewing photos in Gallery, pinch to zoom out to enter 'filmstrip mode' for rapidly reviewing many pictures. In filmstrip mode you can swipe up or down to delete a photo. You can undo a deletion with a tap.
  8. When you tap to focus on an object there’s a new animation to show the focus state.

Sunday, February 17, 2013

Andriod Audio flow part - 2



2. Do the system audio capture
Comes to the main part of this article. first of all let’s see the android audio system in the above graph.


I am not a expert on android system, but we can see here that the lowest level of audio system goes to /dev/eac device file, and there is an AudioHardwareInterface, which is possibly hardware related, to access this file directly. And here AudioFlinger seems to be the best part for us to hack, since it is not depending on hardware, and it should has the final mixer output, which is what we want (we don’t want any single sound track, we need the overall system output, isn’t it?). Actually, here AudioFlinger did not only the mixer work, and also resampling stuff.
AudioFlinger is implemented under dir frameworks/base/services/audioflinger/ (Here I assume that we are currently under the root of android source tree). What we are going to do is to find the mixer output. In the file AudioFlinger.cpp, we can seeAudioFlinger::MixerThread::threadLoop(), which is the working thread of the mixer, and thisMixerThread is inherited from AudioFlinger::BaseThread. Then, just search the keywordmOutput->write with your best editor (vim, emacs, gedit, whatever), and we will find something like this under the threadLoop() function:


mLastWriteTime = systemTime();
mInWrite = true;
 
...
mLastWriteTime = systemTime();
mInWrite = true;
mBytesWritten += mixBufferSize;

int bytesWritten = (int)mOutput->write(mMixBuffer, mixBufferSize);
if (bytesWritten < 0) mBytesWritten -= mixBufferSize;
mNumWrites++;
mInWrite = false;
...
That is the very point that mixer output buffer is transferred to hardware related codes I think, and the audio clip is in mMixbuffer, with size mixBufferSize. In this buffer, there are PCM raw audio data with 44100Hz sampling rate, 2 channels and 16 bits little endian as its param.
If you write this buffer out to a file, like /data/wav.raw, you can just use adb pull to retrieve the data file to your host machine and play it with aplay:
$ aplay -t raw -c 2 -f S16_LE -r 44100 wav.raw
 


 

 
# #