diff --git a/.gitignore b/.gitignore index ec0bf8a..8ae9246 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,15 @@ proguard/ *.log .svn/ + +# Apple and windows thumbnails +.DS_Store +.DS_Store? +Thumbs.db + +# Many other OS generated files +._* +.Spotlight-V100 +.Trashes +ehthumbs.db + diff --git a/AndroidCameraServer/.DS_Store b/AndroidCameraServer/.DS_Store deleted file mode 100644 index 1371bce..0000000 Binary files a/AndroidCameraServer/.DS_Store and /dev/null differ diff --git a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/CameraI.java b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/CameraI.java index 8bc3842..d07520e 100644 --- a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/CameraI.java +++ b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/CameraI.java @@ -12,29 +12,29 @@ public class CameraI extends jderobot._CameraDisp { /** - * Get the description of the image that will be delivered - * getImageDescription. - * - * @see #getImageDescription() - */ - public static ImageDescription idDatos; + * Get the description of the image that will be delivered at + * getImageDescription + * + * @see #getImageDescription() + */ + public static ImageDescription idDatos; /** - * Get the image content(including date and description) - * getImageData. - * - * @see #getImageData() - */ - public static ImageData idImagen; - + * Get the image content (including date and description) that will + * delivered at getImageData + * + * @see #getImageData() + */ + public static ImageData idImagen; + /** * Serial number generated */ private static final long serialVersionUID = 1L; - CameraDescription descripcion; - - CameraI() { + CameraDescription descripcion; + + CameraI() { descripcion = new CameraDescription(); descripcion.name = "Android"; /* Initialize image description */ @@ -42,7 +42,7 @@ public class CameraI extends jderobot._CameraDisp { idDatos.height = 0; idDatos.width = 0; idDatos.format = "NONE"; - /* Initialize the image data */ + /* Initialize image data */ idImagen = new ImageData(); idImagen.pixelData = new byte[0]; idImagen.description = idDatos; @@ -50,7 +50,7 @@ public class CameraI extends jderobot._CameraDisp { idImagen.timeStamp.seconds = 0; idImagen.timeStamp.useconds = 0; } - + @Override public CameraDescription getCameraDescription(Current __current) { return descripcion; @@ -72,18 +72,17 @@ public String startCameraStreaming(Current __current) { @Override public void stopCameraStreaming(Current __current) { // TODO Auto-generated method stub - } @Override public void reset(Current __current) { // TODO Auto-generated method stub - } /** - * Will get the description of the image - * @return Gives the detail of image description + * Delivers image description + * + * @return Image description data */ @Override public ImageDescription getImageDescription(Current __current) { @@ -91,8 +90,9 @@ public ImageDescription getImageDescription(Current __current) { } static public java.util.LinkedList _jobs = new java.util.LinkedList(); + /** - * Gets image and its associated description + * Delivers image and its associated description */ @Override public void getImageData_async(AMD_ImageProvider_getImageData __cb, @@ -102,18 +102,15 @@ public void getImageData_async(AMD_ImageProvider_getImageData __cb, } class Job { - Job(AMD_ImageProvider_getImageData __cb) - { - cb = __cb; - } - - void execute() - { - cb.ice_response(idImagen); - } + Job(AMD_ImageProvider_getImageData __cb) { + cb = __cb; + } + void execute() { + cb.ice_response(idImagen); + } - private AMD_ImageProvider_getImageData cb; + private AMD_ImageProvider_getImageData cb; } } diff --git a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/ImageProviderI.java b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/ImageProviderI.java index 9f8797b..536ea7e 100644 --- a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/ImageProviderI.java +++ b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/ImageProviderI.java @@ -1,6 +1,6 @@ /** - * Implementation of image provider. Almacena los fotogramas capturados así - * como todos los datos asociados al mismo. + * Implementation of ImageProvider. + * Stores captured frames and all associated data. * @author Óscar Javier García Baudet * @version 1.0, 2012-12-08 */ @@ -18,33 +18,33 @@ public class ImageProviderI extends jderobot._ImageProviderDisp { /** - * Get the description of the image that will be delivered - * getImageDescription. - * - * @see #getImageDescription() - */ - public static ImageDescription idDatos; + * Image description that will be delivered by + * getImageDescription + * + * @see #getImageDescription() + */ + public static ImageDescription idDatos; /** - * Get the image content(including date and description) - * getImageData. - * - * @see #getImageData() - */ - public static ImageData idImagen; - + * Image content (including date and description) that will be delivered by + * getImageData + * + * @see #getImageData() + */ + public static ImageData idImagen; + /** * Serial number generated. */ private static final long serialVersionUID = 1L; - + public ImageProviderI() { - /* Initialize imagedescription */ + /* Initialize image description */ idDatos = new ImageDescription(); idDatos.height = 0; idDatos.width = 0; idDatos.format = "NONE"; - /* Initialize the imagedata */ + /* Initialize image data */ idImagen = new ImageData(); idImagen.pixelData = new byte[0]; idImagen.description = idDatos; @@ -54,8 +54,9 @@ public ImageProviderI() { } /** - * Gets the image description - * @return Details image description + * Delivers image description + * + * @return Image description details */ @Override public ImageDescription getImageDescription(Current __current) { @@ -63,8 +64,9 @@ public ImageDescription getImageDescription(Current __current) { } static public java.util.LinkedList _jobs = new java.util.LinkedList(); + /** - * Gets image and its associated description + * Delivers image and its associated description */ @Override public void getImageData_async(AMD_ImageProvider_getImageData __cb, @@ -73,18 +75,18 @@ public void getImageData_async(AMD_ImageProvider_getImageData __cb, _jobs.add(new Job(__cb)); } + /** + * Implementation of a job queue for batch data delivery + */ class Job { - Job(AMD_ImageProvider_getImageData __cb) - { - cb = __cb; - } - - void execute() - { - cb.ice_response(idImagen); - } + Job(AMD_ImageProvider_getImageData __cb) { + cb = __cb; + } + void execute() { + cb.ice_response(idImagen); + } - private AMD_ImageProvider_getImageData cb; + private AMD_ImageProvider_getImageData cb; } } diff --git a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/MainActivity.java b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/MainActivity.java index cb4cd8b..bc2e690 100644 --- a/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/MainActivity.java +++ b/AndroidCameraServer/src/com/linaresdigital/android/androidcameraserver/MainActivity.java @@ -1,6 +1,7 @@ /** - * Actividad de prueba que enmarca y controla tanto la vista preliminar de la cámara - * como la interfaz ICE publicada. + * Actividad de prueba que enmarca y controla tanto la vista preliminar de la + * cámara como la interfaz ICE publicada. + * * @author Óscar Javier García Baudet * @version 1.0, 2013-01-08 */ @@ -25,7 +26,7 @@ public class MainActivity extends Activity { private static final String TAG = MainActivity.class.getClass().getName(); /** - * Instance of imageprovider to be published + * Instance of ImageProvider implementation to be published */ private CameraI cameraA; /** @@ -33,7 +34,7 @@ public class MainActivity extends Activity { */ static private Camera mCamera; /** - * Instance of implementation of the preview that we use + * Instance of implementation of the camera preview that we'll use */ private CameraPreview mPreview; private Handler autoFocusHandler; @@ -45,20 +46,19 @@ public class MainActivity extends Activity { */ @Override protected void onCreate(Bundle savedInstanceState) { - /* General habitual top */ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - /* We require orientation in potrait mode */ + /* We require landscape orientation */ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - /* Provide autofocus if camera does not support one */ + /* Provide continuous autofocus if camera does not support it */ autoFocusHandler = new Handler(); - /* Get the instance of the camera */ + /* Get an instance of the default camera */ mCamera = getCameraInstance(); - /* We create an instance of camera preview to manage the camera */ + /* We create an instance of CameraPreview to manage the camera */ mPreview = new CameraPreview(this, mCamera, previewCb, autoFocusCB); - /* Search the camera preview in frame layout */ + /* Find the frame that will contain the camera preview */ preview = (FrameLayout) findViewById(R.id.frameLayout); - /* Add view */ + /* Add view to frame */ preview.addView(mPreview); /* Initialize ICE, copied from an example */ @@ -87,7 +87,7 @@ public void run() { } /** - * One sure way to get the instance of camera + * Safe way to get the instance of camera */ public static Camera getCameraInstance() { Camera camara = null; @@ -187,11 +187,11 @@ public void onPause() { @Override protected void onResume() { super.onResume(); - /* Create an instance of camerapreview to manage the camera */ + /* Create a fresh instance of CameraPreview to manage the camera */ mPreview = new CameraPreview(this, mCamera, previewCb, autoFocusCB); - /* Search the framelayout for the camera preview */ + /* Find the frame that will contain the camera preview */ preview = (FrameLayout) findViewById(R.id.frameLayout); - /* Add view */ + /* Add new view to frame */ preview.addView(mPreview); } diff --git a/README.md b/README.md index 8d0e8f0..6039d07 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # AndroidCameraServer -Component JdeRobot "cameraserver" for Android" +JdeRobot component (cameraserver like) for Android devices