Log in or register to post comments

Same video plays evertime Video Playback samp

July 16, 2013 - 2:57am #1

i used Video Playback sample every thing works fine.

Problem is that i created new 

StonesAndChips.xml and StonesAndChips.dat using target manager and built ndk and started app but what i see is that same vidoe plays for both images ( created by me on target manager)

What else have i to do to make it work properly ??

Same video plays evertime Video Playback samp

May 22, 2016 - 3:45am #9

Hi,

 

I have a same problem but

my code run fine with 2 target

if i add more target work worst

I follow this but not work

can anybody help me ?!

 

tnk.

Same video plays evertime Video Playback samp

November 25, 2015 - 11:01pm #8

Even I am Getting The Same Problem . What do We have to do For overcoming this issue?? plz suggest 

It is playing same video for target 2 and 3.But i have to play different video for different image target.

Same video plays evertime Video Playback samp

July 17, 2013 - 7:19am #7

Oh, yes, you need to pay attention to the tricky strcmp() function (which must be == 0) ...;-)

Glad that it is solved.

Same video plays evertime Video Playback samp

July 17, 2013 - 7:00am #6

solved

https://developer.vuforia.com/forum/faq/android-how-do-i-add-another-target-video-playback-sample 

had error at one place and need correction

  • In the renderFrame function, update the code to determine the currentTarget as follows:
1
2
3
4
5
6
if (strcmp(imageTarget.getName(), "stones") == 0)
            currentTarget=STONES;
else if (strcmp(imageTarget.getName(), "chips") == 1)
            currentTarget=CHIPS;
else
        currentTarget=MY_TARGET;
 
change it to
 
 
  • In the renderFrame function, update the code to determine the currentTarget as follows:
1
2
3
4
5
6
if (strcmp(imageTarget.getName(), "stones") == 0)
            currentTarget=STONES;
else if (strcmp(imageTarget.getName(), "chips") == 0)
            currentTarget=CHIPS;
else
        currentTarget=MY_TARGET;

 

Same video plays evertime Video Playback samp

July 17, 2013 - 6:51am #5

yeah i am doing that i have 3 target

with different vidoes for each

vidoe for 1st target is working fine but i get same video for target 2 and 3

Same video plays evertime Video Playback samp

July 17, 2013 - 6:37am #4

The article in the link you are referencing (https://developer.vuforia.com/forum/faq/android-how-do-i-add-another-target-video-playback-sample) explains how to add an extra target (and associate an additiona video to it), so that you end up with 3 targets (and 3 videos) instead of 2.

What you are trying to achieve, instead, if I understand correctly, is to replace the 2 sample targets with your own targets, which is a bit different from that article.

Same video plays evertime Video Playback samp

July 17, 2013 - 4:25am #3

still having problem same video plays for MY_TARGET.jpg and chips.jpg

i have attached following code , i have done according to steps in 

https://developer.vuforia.com/forum/faq/android-how-do-i-add-another-target-video-playback-sample

 

check if missing something ??

AttachmentSize
Package icon attach.zip19.83 KB

Same video plays evertime Video Playback samp

July 16, 2013 - 3:44am #2

Hi,

if you look at the VideoPlayback.cpp file, inside the _renderFrame() function, you will find these code snippet:

if (strcmp(imageTarget.getName(), "stones") == 0)
            currentTarget=STONES;
        else
            currentTarget=CHIPS;

 

and this one too:
if (strcmp(imageTarget.getName(), "stones") == 0)
                glVertexAttribPointer(videoPlaybackTexCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                                  (const GLvoid*) &videoQuadTextureCoordsTransformedStones[0]);
            else
                glVertexAttribPointer(videoPlaybackTexCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                                  (const GLvoid*) &videoQuadTextureCoordsTransformedChips[0]);

 

 
These code snippets, as you can see, compare the target name with "stones", which is one of the two targets included in the sample dataset;
 
you simply need to replace that with the name of one of your targets, then rebuilt with ndk-build and it should work.
 
 
 
Log in or register to post comments