"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Dynamically Set number of targets

Hi,

 

I can see that in VideoPlayback sample , In VideoPlayBack.Java  and VideoPlayBack.Cpp  number of ragets are given static.

 

Suppose i am loading tagets for server and after loading of content i come to know number of ImageTargets. I can modify it VideoPlayBack.java

but I am facing issues in VideoPlayBack.cpp.

 

Please suggest a solution.

Regards

Vineet Aggarwal

AlessandroB

Sat, 03/30/2013 - 09:46

Hi, 

you could pass the number of targets from Java to C++ via a native method,

then in C++ you could use an std::vector instead of a simple array to dynamically create and fill the list of targets.

 

Hi It's working now ,

The STL issues seems to be solved.

Do I have to dynamically allocate all these dynamically

 

MEDIA_STATE currentStatus[NUM_TARGETS];

QCAR::Vec2F targetPositiveDimensions[NUM_TARGETS];

Hi Alessendro,

Thanks

I have started using std:vector .  I changed the arrays to vectors . I got targets from my java code  in initTracking Method. But i 'm facing issue in initialization of targetPositiveDimensions.

1. Please let me know my approch is correct

Yes, I understand that, but I am wondering how many targets you have at most (max), for instance 5, or rather 10, or more like 20 ?

I ask that because laoding/playing videos can be resource consuming and can lead to crash your app if you have too many videos.

 

Hi , The maximum no. of videos can be 4.

We are planning to have 8-10 targets.

The no. of videos will be 4 and rest will be 2d Images.