2.3k views
in GUI Development by

Hello,

 

We are developing a camera preview screen for our application over a Custom Desing STM32F769 board. We are using ExternBitmap to capture frames from camera and a timer to call ExternBitmap.reload() to achieve a smooth display of captured image. But this method is fine but seems very CPU intesive. 

So we are investigating a more efficient way to update our Image object. 

For example, if somebody suggest a method to update of ram area belongs to bitmap of Image without generating a new bitmap each time and trigger a redraw for Image object, I would be vary glad...

 

Any suggestions?

 

Rgrs.

 

Aykut

2 Answers

0 votes
by

Hello Aykut,

using Extern Bitmap in this case is in fact not very efficient. Better would be to based on the Applet view implement your own view intended to deal with extern bitmap contents. In such case you can update and redraw only small areas of the bitmap. The usage of this Applet view is demonstrated in the example Applet.

Best regards

Paul Banach

by

Thank you for information. I have added a Applet object into an empty project and added following code for tne OnGetBitmap(). Object can retrieve the camera image but the fram rate is poor. am I doing something wrong?

 

native
{
  XRect lockArea;
    XBitmapLock* lock;
  /* Lock the entire bitmap for write operation */
    lockArea.Point1.X = 0;
    lockArea.Point1.Y = 0;
    lockArea.Point2.X = cameraGetHeight();
    lockArea.Point2.Y = cameraGetWidth();
    lock = EwLockBitmap((XBitmap*) aArg1, 0, lockArea, 0, 1);
  cameraChangeDisplayFrameBufferAddress(lock->Pixel1);
    cameraGetImage();
  EwUnlockBitmap(lock);
}
by

Hello Aykut,

Is it correct if I assume that the function cameraChangeDisplayFrameBufferAddress() just remembers the passed pointer lock->Pixel1 as destination for the next camera image? Then the following invocation cameraGetImage() performs a kind of copy operation to this memory?

If yes, such copy operation (if it affects a large memory area and especially on an embedded system) is CPU intensive. Have you tried to comment out the invocation to the function cameraGetImage()? The idea here is to isolate the code part causing the CPU load. Maybe you can optimize the cameraGetImage() function?

Best regards

Paul Banach

by

Your assumptions were correct. cameraChangeDisplayFrameBufferAddress()  only sets dcmiDisplayFrameBufferAddress pointer. 

 

void cameraGetImage(void) {
    if (DCMI_flag > DCMI_flag_prev) {
        DCMI_flag_prev = DCMI_flag;
        EwBspGraphicsConcurrentOperation(0);
        EwBspGraphicsCopy((uint32_t) dcmiDisplayFrameBufferAddress,
                (uint32_t) dcmiCaptureFrameBufferAddress, 2, 0,
                dcmiCaptureResolutionX, dcmiCaptureResolutionY,
                DMA2D_ARGB8888, DMA2D_INPUT_RGB565);
    }
}

I have modified the given example for Applet. But, now I am going to write own Applet example at this point. I guess, the game logic and within the example and my code were confilicted some how. 

But, at this point, I could not triger the CameraUpdate() function. I thing I am missing some point about the philisophy of the Applet object. I wrote the following function and Called them from OnCreate  Method in  EW. But I do not have any image...
 

#include "ew_bsp_camera.h"

XHandle *CameraInit(XPoint aSize) {
	/* Reserve memory for the new camera instance */
	ew_bsp_camera_t* camera = EwAlloc(sizeof(ew_bsp_camera_t));
	//camera->lockArea = EwAlloc(sizeof(XRect));
	XBitmap* bitmap = EwCreateBitmap( EW_PIXEL_FORMAT_NATIVE, aSize, 0, 1);

	if (!camera || !bitmap) {
		if (camera)
			EwFree(camera);
		if (bitmap)
			EwFreeBitmap(bitmap);
		return 0;
	}

	/* ... and initialize it */
	camera->Bitmap = bitmap;
	camera->Size = aSize;
	camera->LastTime = 0;
	camera->NeedUpdate = 1;
	camera->lockArea.Point1.X = 0;
	camera->lockArea.Point1.Y = 0;
	camera->lockArea.Point2.X = cameraGetHeight();
	camera->lockArea.Point2.Y = cameraGetWidth();

	cameraInit(CAMERA_FRAME_BUFFER, 384, 480, FRAME_BUFFER_ADDR,
	FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT, 208, 0);
	cameraContinuousStart(CAMERA_FRAME_BUFFER);
	return camera;
}

XRect* CameraUpdate(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	/* Lock the entire bitmap for write operation */
	camera->lock = EwLockBitmap((XBitmap*) camera->Bitmap, 0, camera->lockArea,
			0, 1);
	cameraChangeDisplayFrameBufferAddress(camera->lock->Pixel1);
	cameraGetImage();
	EwUnlockBitmap(camera->lock);
	return &(camera->lockArea); // Always update
}

XBitmap* CameraGetBitmap(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	return camera->Bitmap;
}

void CameraDone(XHandle * aCamera) {
	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	if (camera) {
		EwFreeBitmap(camera->Bitmap);
		EwFree(camera);
	}
	cameraSuspend();
	cameraStop();

}

 

// Application::CameraAppletClass.OnCreate()
//
var handle p=null;
native
{
  p = CameraInit(aSize);
};

return p;


Would you explain the design workflow for Applet object?

by

Hello,

call the function CameraUpdate() from the method OnProgress. For example:

native ( aHandle )
{
  CameraUpdate((ew_bsp_camera_t*)aHandle  );
}

The method OnProgress is executed periodically by the timer object. You can configure the timer's property Period to determine the desired speed for the update. Per default the timer expires every 100 ms.

Change the implementation of your CameraUpdate() function. It is not necessary to return the rect value here. Instead implement a new function e.g. CameraGetUpdateRect() to return the area of the bitmap affected by the preceding CameraUpdate() invocation. As far as I see, CameraUpdate() always reloads the entire bitmap, the new function CameraGetUpdateRect() should return the complete area. For example:

XRect CameraGetUpdateRect(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	return camera->lockArea;
}

Now modify the implementation of the OnUpdate method. It should return the area of the bitmap affected by the preceding update:

var rect area = <0,0,0,0>;

native ( aHandle, area )
{
  area = CameraGetUpdateRect( (ew_bsp_camera_t*)aHandle );
}

return area;

Finally adapt the method OnGetBitmap. It should return the bitmap used internally by your camera:

var handle bitmap = null;

native ( aHandle, bitmap )
{
  bitmap = (XHandle)CameraGetBitmap( (ew_bsp_camera_t*)aHandle );
}

return bitmap;

Does it work?

Additional hints:

- in the function CameraInit() you work with three different sizes: aSize parameter, values returned from cameraGetWidth(), cameraGetHeight() and the constant values 384, 480. Are all three equal?

- Dont forget to call CameraDone() from OnDestroy method. Otherwise the bitmap memory is never released.

- Maybe you can ommit the invocation of cameraGetImage() and permit the camera to access (write) directly into the bitmap memory. For this purpose remember the address returned by EwLockBitmap(). In fact, in your target system, the bitmap address does not change at the runtime so you can work with the returned address even after you have called EwUnlockBitmap.

Best regards

Paul Banach

 

by

First of all answer to previous questions:

  1. cameraGetWidth(), cameraGetHeight() and the constant values 384, 480, all three are equal.
  2. I have done OnDestroy(). Actually, I had not understand the function of OnProgress() in the beginning. I had implemented all functions but OnProgress(). Now I added it. 
  3. My Camera color space is RGB565 and EW is RGB8888. That is because I use a additional intermediate buffer for color conversion. Is it possible to define a RGB565 bitmap and let EW implement the colorspace conversion ? 

Current Stiuation:

I implemented the function as you suggested. But, Project newer invokes the OnCreate() method. To solve this problem, I have added a Init() and Done() methods in to Applet class. In the method, I called Create() method of Applet. Then the application hangs with black screen. When, I have checked with the debugger, I found that OnUpdate() function is continuously called and the returned value s <0,0,480,384>, which is correct. But, the OnProgress() function is called onley once  at all.

Please see the Applet Class and C code below;
 
class CameraAppletClass : Views::Applet
{
  $rect <10,160,160,200>
  inherited method OnGetBitmap()
  {
    // TO DO: Write your code here ... 
    var handle ret=null;
    native
    {
      ret = (XHandle *) CameraGetBitmap(aHandle); // Function returns XBitmap
    }
    return ret;
  }

  $rect <10,110,160,150>
  inherited method OnUpdate()
  {
    native
    {
      CameraUpdate(aHandle);
    }
    return this.Bounds.orect;
  }

  $rect <10,220,150,260>
  inherited method OnProgress()
  {
    native ( aHandle )
    {
      CameraProgress( aHandle  );
    }
    /*
     The return value of this method determines, 
     whether the progress operation is finished or 
     whether the external application requires more OnProgress() invocations. 
     If the returned value is 'true', the OnProgress() method is invoked as soon as possible again. 
     If this value is 'false' the method is called after the next ProgressTimer expiration or 
     after the next user interaction. 
     The handle to the affected instance of the external application is passed in the parameter aHandle.
     */
    return false;
  }

  $rect <10,60,160,100>
  inherited method OnDestroy()
  {
    // TO DO: Write your code here ... 
    native {
      CameraDone(aHandle);
    }
  }

  $rect <10,10,160,50>
  inherited method OnCreate()
  {
    var handle p=null;
    native (aSize)
    {
      p = CameraInit(aSize);
    };

    this.ProgressTimer.Period=20;
    this.ProgressTimer.Enabled=true;
    return p;
  }

  // The Done() destructor forces the deinitialization of the infrastructure inherited \
  // from the base class Views::Applet.
  $rect <240,110,460,150>
  method void Done()
  {
    // When the object is disposed - destroy the embedded application
    //
    // Destroy() will then call the OnDestroy() method.
    Destroy();
  }

  // The Init() constructor forces the initialization of the infrastructure inherited \
  // from the Views::Applet class.
  $rect <240,70,460,110>
  method void Init( arg uint32 aArg )
  {
    // After the object has been created - initialize the external 'C' application.
    //
    // Create() will then call the OnCreate() method.
    Create();
  }
}

C Code

/* Include necessary header files */
#include "ew_bsp_camera.h"

XHandle *CameraInit(XPoint aSize) {
	/* Reserve memory for the new camera instance */
	ew_bsp_camera_t* camera = EwAlloc(sizeof(ew_bsp_camera_t));
	//camera->lockArea = EwAlloc(sizeof(XRect));
	XBitmap* bitmap = EwCreateBitmap( EW_PIXEL_FORMAT_NATIVE, aSize, 0, 1);

	if (!camera || !bitmap) {
		if (camera)
			EwFree(camera);
		if (bitmap)
			EwFreeBitmap(bitmap);
		return 0;
	}

	/* ... and initialize it */
	camera->Bitmap = bitmap;
	camera->Size = aSize;
	camera->LastTime = 0;
	camera->NeedUpdate = 1;
	camera->lockArea.Point1.X = 0;
	camera->lockArea.Point1.Y = 0;
	cameraInit(CAMERA_FRAME_BUFFER, 384, 480, FRAME_BUFFER_ADDR,
	FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT, 208, 0);
	camera->lockArea.Point2.X = cameraGetHeight();
	camera->lockArea.Point2.Y = cameraGetWidth();
	cameraContinuousStart(CAMERA_FRAME_BUFFER);
	return camera;
}

XRect* CameraUpdate(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	return &(camera->lockArea); // Always update
}

XHandle *CameraProgress( XHandle *aCamera )
{
	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	/* Lock the entire bitmap for write operation */
	camera->lock = EwLockBitmap((XBitmap*) camera->Bitmap, 0, camera->lockArea,
			0, 1);
	cameraChangeDisplayFrameBufferAddress(camera->lock->Pixel1);
	cameraGetImage();
	EwUnlockBitmap(camera->lock);
	return (XHandle *)camera;
}
XBitmap* CameraGetBitmap(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	return camera->Bitmap;
}

void CameraDone(XHandle * aCamera) {
	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	if (camera) {
		EwFreeBitmap(camera->Bitmap);
		EwFree(camera);
	}
	cameraSuspend();
	cameraStop();

}

Thank you in advance...

Aykut

by

My mistake. The method OnUpdate has to return an empty area <0,0,0,0> if all update areas are reported. Internally, the Applet view calls OnUpdate to query which part of the extern application (of the applet) has changed its appearance and needs to be redrawn. This has not necesarily to be a single rectangular area. You can imagine the situation of an applet showing blinking icons in the top-left and bottom-right corners. In such case it can be more efficient to report two separate update areas: for the icon in the top-left and the second for the icon in the bottom-right corner.

As long as OnUpdate returns a non empty area, the framework invokes and processes the areas. To stop this the OnUpdate has to return <0,0,0,0>.

Try following:

1. Enhance the structure ew_bsp_camera_t by an additional field:

XRect updateArea;

2. In the function CameraInit() initialize the new field updateArea with 0.

camera->updateArea.Point1.X = 0;
camera->updateArea.Point1.Y = 0;
camera->updateArea.Point2.X = 0;
camera->updateArea.Point2.Y = 0;

3. Modify the function CameraUpdate():

XRect CameraUpdate( XHandle aCamera )
{
  ew_bsp_camera_t* camera     = (ew_bsp_camera_t*)aCamera;
  XRect            updateArea = camera->updateArea;

  // Clear the updated area
  camera->updateArea.Point1.X = 0;
  camera->updateArea.Point1.Y = 0;
  camera->updateArea.Point2.X = 0;
  camera->updateArea.Point2.Y = 0;

  return updateArea;
}

4. In the method OnUpdate return the value returned from the method CameraUpdate():

var rect area = <0,0,0,0>;

native ( aHandle, area )
{
  area = CameraUpdate((ew_bsp_camera_t*)aHandle );
}

return area;

An additional hint: In your implementation you are working with pointers to XHandle and XRect. Adapt your implementation to use XHandle and XRect directly as shown in my code above.

Hope it helps you further.

Best regards

Paul Banach

by
Regarding your other question, till version 9.10 you would need a Platform Package optimized for RGB565 color format. RGBA8888 does not support RGB565 per default.

For our next version 9.20, the Graphics Engine has been enhanced to also support RGB565 as an alternative source format. This would work then even with the RGBA8888 Platform Package.

Best reagrds

Paul Banach
by

returning <0,0,0,0> did not work. But I modified OnUpdate() and return the extend of View if a new image captured from camera and return <0,0,0,0> if no new image. Then I can get the camera image. Bur still frame rate of the camera preview is very poor. I had much better fps with EwLoadExternBitmap() method.  It seems, although I set the progrss timer 10msec, EW thread can not call the progress on 10msec period. My project is empty project, there is nothing other then the AppletView. If OnProgress() call period is correct, then I need a method to force the redraw of the AppletView. Any suggestions?

Rgrds.

Aykut

by
Hello Aykut,

could you try to comment out the part of your code performing the copy operation between the camera frame buffer and the bitmap. Does it increase the performance? My intention is to identify the bottleneck of the system.

Best regards

Paul Banach
by

Hello Paul,

I'll try your suggestion. I have got some basic hardware task being done periodically. I will comment out them as well. But, Normally, with same setup of project, when I use EwLoadExternBitmap() method and call Resource:reload() with a timer I get better results.

 

I will let you know about the results.

 

Thanks.

 

Aykut

 

by

Hello Aykut,

just as an inspiration. The thread LTDC reading from double buffer also addresses the application case of camera and update. Have you seen it? In particular the option 2 in the answer may be interesting for you.

In such case instead of using an intermediate RGBA8888 bitmap and implementatig the Applet metod OnGetBitmap, you could override and implement the method OnDraw. Please see the explication to the three different modes of the Applet found at the beginning of the Applet article:

With the Applet approach do you stiill use the DMA2D hardware to copy the RGB565 camera framebuffer to the RGBA8888 bitmap? You can combine it even with the above described approach of directly accessing the GUI framebuffer. This should be the fastest solution.

Best regards

Paul Banach

by

Hello Paul,

 

Sorry for late response. It was a busy week.

 

OnDraw()/OnUpdate() approach is the best fit for my application. I can have full fps from camera stream. We already designed a new hardware with ARGB8888 camera stream. Hope it will give me more CPU time for other tasks. 

At this point, my question is answered perfectly. 

Only problem is syncing the video stream and EW copy operation. I am having some issues because of VSYNC problems. I beleive I can solve this problem with double buffering..

 

I add my code snippets as a reference for others. 

Thnx.

 

Aykut

 

C Code (ew_bsp_camera.h)

/*
 * ew_bsp_camera.h
 *
 */
#ifndef EW_BSP_CAMERA_H_
#define EW_BSP_CAMERA_H_
#include "ewrte.h"
#include "ewgfxdriver.h"
#include "ewgfx.h"
#include "ewextgfx.h"
#include "ewgfxdefs.h"
#include "ewextpxl_RGBA8888.h"
#include "ewlocale.h"
#include <string.h>
#include "Graphics.h"
#include "Application.h"
#include "ew_bsp_graphics.h"
#include "camera.h"

typedef struct {
	XPoint Size;
	XRect lockArea;
	XRect updateArea;
	XBitmapLock* lock;
	unsigned long LastTime;
	int NeedUpdate;
} ew_bsp_camera_t;

XHandle *CameraInit(XPoint aSize);
XRect* CameraUpdate(XHandle * aCamera);
XHandle *CameraProgress(XHandle *aCamera);
XBitmap* CameraGetBitmap(XHandle * aCamera);
void CameraDraw(XHandle aCamera, GraphicsCanvas aCanvas, XRect aClip,
		XRect aDstRect, XColor aColorTL, XColor aColorTR, XColor aColorBR,
		XColor aColorBL, XBool aBlend);
void CameraDone(XHandle * aCamera);

uint32_t guiGetFramePeriod(void);

#endif /* EW_BSP_CAMERA_H_ */


C Code (ew_bsp_camera.c)

/* Include necessary header files */
#include "ew_bsp_camera.h"

volatile uint32_t gui_frame_time = 0;
volatile uint32_t gui_frame_period = 0;

XHandle *CameraInit(XPoint aSize) {
	/* Reserve memory for the new camera instance */
	ew_bsp_camera_t* camera = EwAlloc(sizeof(ew_bsp_camera_t));
	if (!camera) {
		if (camera)
			EwFree(camera);
		return 0;
	}

	/* ... and initialize it */
	camera->Size = aSize;
	camera->LastTime = 0;
	camera->NeedUpdate = 1;

	camera->updateArea.Point1.X = 0;
	camera->updateArea.Point1.Y = 0;
	camera->updateArea.Point2.X = 0;
	camera->updateArea.Point2.Y = 0;

	camera->lockArea.Point1.X = 0;
	camera->lockArea.Point1.Y = 0;
	cameraInit(CAMERA_FRAME_BUFFER, 384, 480, FRAME_BUFFER_ADDR,
	FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT, 208, 0);
	camera->lockArea.Point2.X = cameraGetHeight();
	camera->lockArea.Point2.Y = cameraGetWidth();

	cameraContinuousStart(CAMERA_FRAME_BUFFER);
	return (XHandle *) camera;
}

XRect* CameraUpdate(XHandle * aCamera) {

	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;

	if (cameraIsNewFrame() && !camera->NeedUpdate) {
		camera->NeedUpdate = true;
		return &(camera->lockArea); //update
	}
	return &(camera->updateArea); // Do not update
}

void CameraDone(XHandle * aCamera) {
	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;
	if (camera) {
		EwFree(camera);
	}
	cameraSuspend();
	cameraStop();

}

void CameraDraw(XHandle aCamera, GraphicsCanvas aCanvas, XRect aClip,
		XRect aDstRect, XColor aColorTL, XColor aColorTR, XColor aColorBR,
		XColor aColorBL, XBool aBlend) {
	ew_bsp_camera_t* camera = (ew_bsp_camera_t*) aCamera;

	/* Lock the entire bitmap for write operation */

	gui_frame_period = HAL_GetTick() - gui_frame_time;
	gui_frame_time += gui_frame_period;
	{
		cameraWaitVsync();
		camera->lock = EwLockBitmap((XBitmap*) (aCanvas->Super1.bitmap), 0,
				camera->lockArea, 0, 1);
		cameraChangeDisplayFrameBufferAddress(camera->lock->Pixel1);
		void *buf = (void *) camera->lock->Pixel1;
		uint32_t line_offset = FRAME_BUFFER_WIDTH - aDstRect.Point2.Y
				+ aDstRect.Point1.Y;
		EwBspGraphicsCopy((uint32_t) buf, cameraGetFrameBuffer(), line_offset,
				0, 384, 480, DMA2D_ARGB8888, DMA2D_INPUT_RGB565);
		EwUnlockBitmap(camera->lock);
	}
	camera->NeedUpdate = false;

}

uint32_t guiGetFramePeriod(void) {
	return gui_frame_period;
}

 

Chora Code

 

class CameraAppletClass : Views::Applet
{
  $rect <460,200,600,240>
  inherited method OnDraw()
  {
    $if (!$prototyper)
    native
    {
      CameraDraw(aHandle,aCanvas,aClip,aDstRect,aColorTL,aColorTR,aColorBR,aColorBL,aBlend);
    }
    $else
    aHandle;
    aColorTL;
    aColorTR;
    aColorBR;
    aColorBL;
    aBlend;

    // If the applet appears in a separate layer - a transparent gap in the UI layer
    // is needed in order to make the separate layer visible
    aCanvas.FillRectangle( aClip, aDstRect, #00000000, #00000000, #00000000,
      #00000000, false );
    $endif

  }

  $rect <460,150,610,190>
  inherited method OnUpdate()
  {
    $if (!$prototyper)
      var rect area = <0,0,0,0>;
      native ( aHandle, area )
      {
        XRect *t = (XRect *)CameraUpdate(aHandle );
        area.Point1.X = t->Point1.X;
        area.Point1.Y = t->Point1.Y;
        area.Point2.X = t->Point2.X;
        area.Point2.Y = t->Point2.Y;
      }
      return area;
    $else
      return this.Bounds.area;
    $endif

  }

  $rect <10,60,160,100>
  inherited method OnDestroy()
  {
    // TO DO: Write your code here ... 
    native {
      CameraDone(aHandle);
    }
  }

  $rect <10,10,160,50>
  inherited method OnCreate()
  {
    var handle p=null;
    native (aSize)
    {
      p = CameraInit(aSize);
    };

    this.ProgressTimer.Period=10;
    this.ProgressTimer.Enabled=true;
    return p;
  }

  // The Done() destructor forces the deinitialization of the infrastructure inherited \
  // from the base class Views::Applet.
  $rect <160,140,380,180>
  method void Done()
  {
    // When the object is disposed - destroy the embedded application
    //
    // Destroy() will then call the OnDestroy() method.
    Destroy();
  }

  // The Init() constructor forces the initialization of the infrastructure inherited \
  // from the Views::Applet class.
  $rect <160,100,380,140>
  method void Init( arg uint32 aArg )
  {
    // After the object has been created - initialize the external 'C' application.
    //
    // Create() will then call the OnCreate() method.
    Create();
  }
}

$rect <730,20,930,60>
inline Inline
{
  #include "ew_bsp_camera_ext.h"

}

 

by
Thank you Aykut for sharing your findings and the code snippets.

I hope we can provide one day a camera example for STM32 boards...
by

Would this example work on a Raspberry Pi / Raspberry Pi camera? I'm trying to build a basic camera/video app with preview screen.

FYI I've got a good feel for EW Studio, but am relatively new to programming. Any help is much appreciated!!

 

I tried to add this to my project and compiling returned this error:

Compiling ../GeneratedCode/Application.c
../GeneratedCode/Application.c: In function ‘ApplicationCameraAppletClass_OnDraw’:
../GeneratedCode/Application.c:2854:3: warning: implicit declaration of function ‘CameraDraw’ [-Wimplicit-function-declaration]
   CameraDraw(aHandle,aCanvas,aClip,aDstRect,aColorTL,aColorTR,aColorBR,aColorBL,aBlend);
   ^~~~~~~~~~
../GeneratedCode/Application.c: In function ‘ApplicationCameraAppletClass_OnUpdate’:
../GeneratedCode/Application.c:2881:25: warning: implicit declaration of function ‘CameraUpdate’ [-Wimplicit-function-declaration]
     XRect *t = (XRect *)CameraUpdate(aHandle );
                         ^~~~~~~~~~~~
../GeneratedCode/Application.c: In function ‘ApplicationCameraAppletClass_OnDestroy’:
../GeneratedCode/Application.c:2901:3: warning: implicit declaration of function ‘CameraDone’ [-Wimplicit-function-declaration]
   CameraDone(aHandle);
   ^~~~~~~~~~
../GeneratedCode/Application.c: In function ‘ApplicationCameraAppletClass_OnCreate’:
../GeneratedCode/Application.c:2926:7: warning: implicit declaration of function ‘CameraInit’ [-Wimplicit-function-declaration]
   p = CameraInit(aSize);
       ^~~~~~~~~~
../GeneratedCode/Application.c: At top level:
../GeneratedCode/Application.c:2975:31: fatal error: ew_bsp_camera_ext.h: No such file or directory

 

by
Hello,

in principle you can use the Views::Applet infrastucture on all targets. It is an interface to an external application, but the implementation is always hardware specific.

This means, the above source code is dependent to the underlying hardware (in this case STM32Fx) - so this cannot be ported to an Raspberry Pi.

In case of Raspberry Pi, the integration of a camera has to be done by using a suitable Linux camera driver.

Best regards,

Manfred
0 votes
by

Hello Aykut,

an other user did almost the same as you had asked a few months ago.

Here you can find the thread how this user implemented the camera view pretty well in Embedded Wizard.

Kind regards

Tim

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...