You Are Here:

Community: Developer Discussion Boards

#1 Old Using CameraWrapper on 5th edition - 2009-10-30, 19:00

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
Hi!

I'm trying to use the camerawrapper to do a app that works like a camera. I'm starting, and I'm using the example code of the package Camera wrapper example. When I use it... I get the next compilation error:


1256946905812 illegal implicit conversion from 'CviewfinderactivoView *' 'MCameraEngineObserver *' ViewfinderactivoView.cpp

I have created a project, and i want to show the viewfinder (for the moment) in the viewfinderactivo. For that, in the construct method I call to the initViewFinder() function.

Here it is:

Code:
int CviewfinderactivoView::initViewFinder(){

TInt camErr(KErrNotSupported);
//Si no hemos definido la cámara anteriormente
 if(iCameraWrapper==NULL){
 //Si hay cámaras disponibles
	 if(CCameraEngine::CamerasAvailable() > 0)
     {
     //Intentamos activar la cámara.
		 TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(0,0,this));
     }
	 //Preguntar por camErr...
	 
	 //Establecemos tamaño de captura y de ViewFinder (Por ahora, modo portrait)
	 iViewFinderSize = TSize(Rect().Size().iWidth,Rect().Size().iWidth);
	 iCaptureSize = TSize(1280,960);
	 
	 if (iCameraWrapper->State() == CCameraEngine::EEngineIdle)
	 {
	        // Prepare camera
	   TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));
	   if (err){
	            //SetError(_L("Camera prepare error %d"), err);
	            return;
	   }
	        
	   // Start viewfinder. Viewfinder pictures starts coming into MceoViewFinderFrameReady();
	   TRAPD(err2,iCameraWrapper->StartViewFinderL(iViewFinderSize));
	   if (err2)
	            {
	   //         SetError(_L("Camera start viewfinder error %d"), err2);
	            return;
	            }

	        //SetTitle(_L("Camera viewfinder"));
	  }
  }
}
Then, I have in the private zone of the .h this:

Code:
	CCameraEngine* iCameraWrapper;
	TSize iViewFinderSize;
	TSize iCaptureSize;
The includes in the .h put by me are:

#include <cameraengine.h>
#include <cameraengineobserver.h>

I have added the libs:

camerawrapper.lib
ecam.lib

To the .mmp file.

Thank!
Reply With Quote

#2 Old Re: Using CameraWrapper on 5th edition - 2009-10-30, 19:06

Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
Offline
Forum Nokia Champion
Quote:
Originally Posted by Legendus View Post
1256946905812 illegal implicit conversion from 'CviewfinderactivoView *' 'MCameraEngineObserver *' ViewfinderactivoView.cpp
Make sure that your class CviewfinderactivoView inherits from (and implements) MCameraEngineObserver.
Reply With Quote

#3 Old Re: Using CameraWrapper on 5th edition - 2009-10-30, 19:23

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
Ok, thanks!
Now I have added it and I have:

class CviewfinderactivoView :
public CAknView, public MCameraEngineObserver, public CCoeControl (This one for the TRect)

I have added too to the private part:

void MceoCameraReady();

But I have errors too, it must be derived by the inherits..I think

here:

Code:
CviewfinderactivoView* CviewfinderactivoView::NewLC()
	{
1	CviewfinderactivoView* self = new ( ELeave ) CviewfinderactivoView();
2	CleanupStack::PushL( self );
Creation Time Description Resource Path Location Type

1 illegal use of abstract class ('MCameraEngineObserver::MceoFocusComplete()')
2 ambiguous access from 'CviewfinderactivoView' to 'CBase'

Comparing with the example, I have it equal.

Another error here:

Code:
void CviewfinderactivoView::DoActivateL( 
		const TVwsViewId& /*aPrevViewId*/,
		TUid /*aCustomMessageId*/,
		const TDesC8& /*aCustomMessage*/ )
	{
	// [[[ begin generated region: do not modify [Generated Contents]
	SetupStatusPaneL();
	
				
				
	
	if ( iViewfinderactivo == NULL )
		{
		iViewfinderactivo = CreateContainerL();
->		iViewfinderactivo->SetMopParent( this );
		AppUi()->AddToStackL( *this, iViewfinderactivo );
		} 
	// ]]] end generated region [Generated Contents]
	
	}
ambiguous access from 'CviewfinderactivoView' to 'MObjectProvider'


And here

Code:
void CviewfinderactivoView::SetupStatusPaneL()
	{
	// reset the context pane
	TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
	CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
		StatusPane()->PaneCapabilities( contextPaneUid );
	if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
		{
		CAknContextPane* context = static_cast< CAknContextPane* > ( 
			StatusPane()->ControlL( contextPaneUid ) );
		context->SetPictureToDefaultL();
		}
	
	// setup the title pane
	TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
	CEikStatusPaneBase::TPaneCapabilities subPaneTitle = 
		StatusPane()->PaneCapabilities( titlePaneUid );
	if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
		{
		CAknTitlePane* title = static_cast< CAknTitlePane* >( 
			StatusPane()->ControlL( titlePaneUid ) );
		TResourceReader reader;
->		iEikonEnv->CreateResourceReaderLC( reader, R_VIEWFINDERACTIVO_TITLE_RESOURCE );
		title->SetFromResourceL( reader );
		CleanupStack::PopAndDestroy(); // reader internal state
		}
				
	}

1256948692187 ambiguous access to name found 'CAknView::iCoeEnv' and 'CCoeControl::iCoeEnv'

Thanks!
Reply With Quote

#4 Old Re: Using CameraWrapper on 5th edition - 2009-10-30, 20:09

Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
Offline
Forum Nokia Champion
Quote:
Originally Posted by Legendus View Post
class CviewfinderactivoView :
public CAknView, public MCameraEngineObserver, public CCoeControl (This one for the TRect)
He? The view and the container has to be two separate class.
Quote:
I have added too to the private part:

void MceoCameraReady();

1 illegal use of abstract class ('MCameraEngineObserver::MceoFocusComplete()')
Implementing methods you 'like' is not enough, you have to implement all abstract methods (virtual Something()=0;) from MCameraEngineObserver.
Quote:
2 ambiguous access from 'CviewfinderactivoView' to 'CBase'
This is because you need two separate classes for CAknView and CCoeControl. http://en.wikipedia.org/wiki/Diamond_inheritance
Reply With Quote

#5 Old Re: Using CameraWrapper on 5th edition - 2009-11-03, 19:24

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
Ah, ok, thanks!

That's what I have done:

Copy the contents of the file camerawrapperexample.h and .c to my project files called cameradecodercontain.h and .c

Changing all ccamerawapperexample for the ccameradecodercontain. I have added all the libraries said in the mmp of the example. And finally I get those errors:

1257269181968 illegal use of incomplete struct/union/class 'CCamaradecoderContainerAppUi' (4 times)

In those lines:

iAppUi = static_cast<CCamaradecoderContainerAppUi*>(iEikonEnv->EikAppUi());
iAppUi->UseOptionsExitCbaL();
TRAP_IGNORE(iAppUi->UseOptionsBackCbaL());
iAppUi->UseOptionsExitCbaL();

iAppUi declaration:

private:
// Data

CCamaradecoderContainerAppUi* iAppUi;

Thanks!
Reply With Quote

#6 Old Re: Using CameraWrapper on 5th edition - 2009-11-03, 20:01

Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
Offline
Forum Nokia Champion
You probably have a "class CCamaradecoderContainerAppUi;" line somewhere in the beginning of cameradecodercontain.h. That is called a forward declaration, enabling to refer CCamaradecoderContainerAppUi as a pointer variable for example.
However it is not enough for 'real' usage in the .cpp file, there you have to #include the real .h file containing the declaration of it. (perhaps #include "CamaradecoderContainerAppUi.h")
Reply With Quote

#7 Old Re: Using CameraWrapper on 5th edition - 2009-11-03, 20:30

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
Thanks!

yes, I have already put it in the camaradecodercontainer.cpp. So, it mustn't be... :S

Thank you so much!
Reply With Quote

#8 Old Re: Using CameraWrapper on 5th edition - 2009-11-03, 22:39

Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
Offline
Forum Nokia Champion
Check your guard macros then, make sure that they are unique for each .h file.
Reply With Quote

#9 Old Re: Using CameraWrapper on 5th edition - 2009-11-04, 09:39

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
I have fixed the problem. It was that the class contained on the cameradecoderAppUi was called CCameradecoderAppUi, not CCameradecoderContainerAppUi. So I use the CCameradecoderAppUi in the CCcameradecodercontainer.h and .c

Now I get:

undefined indentifier "UseOptionsExitCbaL"
undefined indentifier "UseOptionBackCbaL"

On

iAppUi->UseOptionsExitCbaL
iAppUi->UseOptionsBackCbaL

Thanks!
Reply With Quote

#10 Old Re: Using CameraWrapper on 5th edition - 2009-11-04, 13:55

Join Date: Feb 2006
Posts: 16,386
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
Offline
Forum Nokia Champion
Undefined identifier means that you either do not have such methods at all, or they use some slightly different spelling, arguments, etc. than what you have tried.
Reply With Quote

#11 Old Re: Using CameraWrapper on 5th edition - 2009-11-06, 18:48

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
Hello!

Thanks, now it's compile. But now..I have a problem in the executing... :S I have been debugging and I know where it stops, but I don't know why. I'm going to explain you a bit the classes:

CCamera1View -> Class view of the camera wrapper. It's made in a 99% by carbide.
CCamera1 -> Class container. It's the example of the camera wrapper, only changing the names.

At debugging I do a change of view from Initial one to the CCamera1View, where it's done to show the viewfinder.

CCamera1View create a CCamera1:

Code:
CCamara1* Ccamara1View::CreateContainerL()
	{
	return CCamara1::NewL( ClientRect());
	}
In CCamera1:

Code:
CCamara1* CCamara1::NewL (const TRect& aRect )
    {
    CCamara1* self = CCamara1::NewLC (aRect ); (goes to newLC)
    CleanupStack::Pop (self );
    return self;
    }

CCamara1* CCamara1::NewLC (const TRect& aRect )
    {
    CCamara1* self = new (ELeave) CCamara1;
    CleanupStack::PushL (self );
    self->ConstructL (aRect ); (goes to constructL)
    return self;
    }

void CCamara1::ConstructL (const TRect& aRect )
    {
    // Create a window for this application view
    CreateWindowL ();

    iTitleFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
    
    iAppUi = static_cast<CcamaradecoderAppUi*>(iEikonEnv->EikAppUi());
    
    // Set the windows size
    SetRect (aRect ); (here comes the error!)
    
    // Activate the window, which makes it ready to be drawn
    ActivateL ();
    }
The errors remember me like a infinite loop, because I click on play and it never stops.

The error says:

Thread [Thread id: 1939] (Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..)
2 Unknown (0x78D7C378)() 0x78d7c378
1 Unknown (0x78D7C3AA)() 0x78d7c3aa

What is it happening?

Thanks!
Reply With Quote

#12 Old Re: Using CameraWrapper on 5th edition - 2009-11-08, 01:27

Join Date: Oct 2009
Posts: 72
Legendus
Offline
Regular Contributor
this message is for getting up the post. thanks
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Series 40 5th Edition SDK Includes JSR-211 Nokia Ron Mobile Java Tools & SDKs 9 2009-10-03 16:42
Icons in s60 drizzt6 Mobile Java General 5 2009-03-06 10:32
Small change required in S60 5th Edition SDK Help and C++ Developer Library kiran10182 Developer Resources Feedback (Documentation, Examples, Training) 3 2008-12-15 20:12
stray signal panic in 5th edition on T9 default Fep as well as 3rd party fep. himsymbian Symbian User Interface 1 2008-11-21 13:12
Who to start UI development in Series 60 5th edition?? rohanwaugh Symbian User Interface 3 2008-11-03 07:14

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia