Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Binary file removed AndroidCameraServer/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,45 @@
public class CameraI extends jderobot._CameraDisp {

/**
* Get the description of the image that will be delivered
* <code>getImageDescription</code>.
*
* @see #getImageDescription()
*/
public static ImageDescription idDatos;
* Get the description of the image that will be delivered at
* <code>getImageDescription</code>
*
* @see #getImageDescription()
*/
public static ImageDescription idDatos;

/**
* Get the image content(including date and description)
* <code>getImageData</code>.
*
* @see #getImageData()
*/
public static ImageData idImagen;
* Get the image content (including date and description) that will
* delivered at <code>getImageData</code>
*
* @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 */
idDatos = new ImageDescription();
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;
idImagen.timeStamp = new Time();
idImagen.timeStamp.seconds = 0;
idImagen.timeStamp.useconds = 0;
}

@Override
public CameraDescription getCameraDescription(Current __current) {
return descripcion;
Expand All @@ -72,27 +72,27 @@ 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) {
return idDatos;
}

static public java.util.LinkedList<Job> _jobs = new java.util.LinkedList<Job>();

/**
* Gets image and its associated description
* Delivers image and its associated description
*/
@Override
public void getImageData_async(AMD_ImageProvider_getImageData __cb,
Expand All @@ -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;
}

}
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -18,33 +18,33 @@
public class ImageProviderI extends jderobot._ImageProviderDisp {

/**
* Get the description of the image that will be delivered
* <code>getImageDescription</code>.
*
* @see #getImageDescription()
*/
public static ImageDescription idDatos;
* Image description that will be delivered by
* <code>getImageDescription</code>
*
* @see #getImageDescription()
*/
public static ImageDescription idDatos;

/**
* Get the image content(including date and description)
* <code>getImageData</code>.
*
* @see #getImageData()
*/
public static ImageData idImagen;
* Image content (including date and description) that will be delivered by
* <code>getImageData</code>
*
* @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;
Expand All @@ -54,17 +54,19 @@ public ImageProviderI() {
}

/**
* Gets the image description
* @return Details image description
* Delivers image description
*
* @return Image description details
*/
@Override
public ImageDescription getImageDescription(Current __current) {
return idDatos;
}

static public java.util.LinkedList<Job> _jobs = new java.util.LinkedList<Job>();

/**
* Gets image and its associated description
* Delivers image and its associated description
*/
@Override
public void getImageData_async(AMD_ImageProvider_getImageData __cb,
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -25,15 +26,15 @@ 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;
/**
* Instance of camera to be used in 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;
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# AndroidCameraServer
Component JdeRobot "cameraserver" for Android"
JdeRobot component (cameraserver like) for Android devices