By vinny82
on Fri, 03/29/2013 - 20:55
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
Dynamically Set number of targets
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.
Dynamically Set number of targets
Hi,
I tried to use std: vector but nd build gives me following error : fatal:error: vector: No such file or directory
Included
#include <vector> in VideoPlayback.cpp
Application.mk
Dynamically Set number of targets
Hi,
have you tried using APP_STL:=stlport_shared
instead of stlport_static
?
Dynamically Set number 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];
Dynamically Set number of targets
Hi, glad that it is solved.
Concerning your question:
Dynamically Set number of 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
Dynamically Set number of targets
Hi,
it seems this code is causing that error:
Replace 0.0 with 0.0f and it should be OK.
Dynamically Set number of targets
Hi Alessandro
Thanks
The error now changes to
incompatible types in assignment of 'float' to 'float [2]'
Dynamically Set number of targets
Hi, sorry, there is also another error in your code, which I only saw now, so this is the correct code:
Dynamically Set number of targets
Hi Alessandro,
Love You. Thanks now issue solved.
Dynamically Set number of targets
Dynamically Set number of targets
I see. If you declare the targetPositiveDimensions that way:
Dynamically Set number of targets
Thanks Alessandro
It works.
Dynamically Set number of targets
Great! Glad to help.
Dynamically Set number of targets
Hi Alessandro.
I think i am close in achieving my objective of getting dynamic targets.
1. Please check my initTacker method
Dynamically Set number of targets
Hi, how many targets are you trying to use ?
Dynamically Set number of targets
Hi ,
I am getting targets xml from resource and targets can increase or decrease at run time. Therefore i need to have dynamic targets. I am passing the no. of targets getting from server in initTracker method via java code.
Dynamically Set number of targets
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.
Dynamically Set number of targets
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.
Dynamically Set number of targets
Hi, if you plan to have 8 - 10 videos, you will probably need to load and unload videos (for example, unload a video when you don't need to play it), because otherwise you have good chances to ru out of resources and get a crash;