Log in or register to post comments

The VideoPlayback-2-5-5.zip sample code is not working

July 15, 2013 - 6:36am #1

Hi,

 

The VideoPlayback-2-5-5 sample code is not working with my android device. It shows an error icon on top of the texture when the camera is targeted target image.

But when I download sample APK from vuforia site.It is working properly without error icon. My device is supporting for video play on texture(vedio play on 3D space.)

 

The error log cat is showing

07-15 19:01:03.322: V/MediaPlayer(18679): setListener
07-15 19:01:03.322: V/MediaPlayer(18679): setDataSource(55, 10506567, 10511615)
07-15 19:01:03.392: E/BufferQueue(18679): [unnamed-18679-2] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
07-15 19:01:03.412: V/MediaPlayer(18679): setVideoSurfaceTexture
07-15 19:01:03.412: V/MediaPlayer(18679): prepareAsync
07-15 19:01:03.412: V/MediaPlayer(18679): MediaPlayer::setAudioStreamType
07-15 19:01:03.412: V/MediaPlayer(18679): message received msg=100, ext1=1, ext2=-12
07-15 19:01:03.412: E/MediaPlayer(18679): error (1, -12)
07-15 19:01:03.412: V/MediaPlayer(18679): callback application
07-15 19:01:03.412: V/MediaPlayer(18679): setVideoSurfaceTexture
07-15 19:01:03.412: V/MediaPlayer(18679): back from callback
07-15 19:01:03.422: E/MediaPlayer(18679): Error (1,-12)
07-15 19:01:03.422: E/QCAR(18679): Error while opening the file. Unloading the media player (Unspecified media player error, -12)
07-15 19:01:03.422: I/QCAR(18679): Java_com_qualcomm_QCARSamples_VideoPlayback_VideoPlaybackRenderer_updateRendering
07-15 19:01:03.422: I/QCAR(18679): Configure Video Background : Video (640,480), Screen (800,480), mSize (800,600)
07-15 19:01:03.422: V/MediaPlayer(18679): stop
07-15 19:01:03.422: E/MediaPlayer(18679): stop called in state 0
07-15 19:01:03.422: V/MediaPlayer(18679): message received msg=100, ext1=-38, ext2=0
07-15 19:01:03.422: E/MediaPlayer(18679): error (-38, 0)
07-15 19:01:03.422: V/MediaPlayer(18679): callback application
07-15 19:01:03.422: V/MediaPlayer(18679): back from callback
07-15 19:01:03.422: V/MediaPlayer(18679): setListener
07-15 19:01:03.422: V/MediaPlayer(18679): disconnect
07-15 19:01:03.432: V/MediaPlayer(18679): destructor
07-15 19:01:03.432: V/MediaPlayer(18679): disconnect
07-15 19:01:03.432: W/MediaPlayer(18679): mediaplayer went away with unhandled events
07-15 19:01:03.512: E/BufferQueue(18679): [unnamed-18679-3] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed

 

please provide me solution to fix this..

Thanks.

 

The VideoPlayback-2-5-5.zip sample code is not working

July 22, 2013 - 8:12am #8

Glad to hear it is solved.

The VideoPlayback-2-5-5.zip sample code is not working

July 22, 2013 - 1:48am #7

Hi AlessandroB,

Problem is solved, Thank you for your help.

 

Best regards,

Nishantha Priyathilaka

The VideoPlayback-2-5-5.zip sample code is not working

July 22, 2013 - 1:42am #6

Hi, if you get the error the second time, but not the first,, this probably means that the video has not being unloaded from memory.

You need to make sure the video is properly unloaded from the Media Player. See also the unload() method in VideoPlayerHelper

 

The VideoPlayback-2-5-5.zip sample code is not working

July 22, 2013 - 12:41am #5

Hi AlessandroB/DavidBeard,

Still i'm waiting for the answer.. i need fix the bug of the another application which i use this sample application as a sample for my app.

for my application i use URL for vedio path.. it is an http request. When i run vedio for the first time the application load, media palyer is running video well..but after i load the application next time when i try to run the video it showing texture ERROR icon.

 

Thanks

The VideoPlayback-2-5-5.zip sample code is not working

July 16, 2013 - 8:07am #4

Hi ,

Thanks for the replay...

Yes,The building setup is ok..just i did a modification to the  native source code and tested it.

I'm testing smaple application as it is...video files are sample videos..

The video files are in asset folder..I modifies VideoPlayerHelper.java to run it the application only on Fullscreen mode..Then the application is running only for full screen mode perfectly...After when i change it default source it showing same error.

 

The code i modified for full screen mode is..(VideoPlayerHelper.java) the red color indicate the modification

(Testing device is samsung galaxy s3 mini)

 

           if ((mCurrentState == MEDIA_STATE.READY) || (mMediaPlayer != null))
            {
                DebugLog.LOGD("Already loaded");
            }
            else
            {
                if (false && ((requestedType == MEDIA_TYPE.ON_TEXTURE) ||                        // If the client requests on texture only
                    (requestedType == MEDIA_TYPE.ON_TEXTURE_FULLSCREEN)) &&             // or on texture with full screen
                    (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH))  // and this is an ICS device
                {
                    if (mSurfaceTexture == null)
                    {
                        DebugLog.LOGD("Can't load file to ON_TEXTURE because the Surface Texture is not ready");
                    }
                    else
                    {
                        try
                        {
                            mMediaPlayer = new MediaPlayer();

                            // This example shows how to load the movie from the assets folder of the app
                            // However, if you would like to load the movie from the sdcard or from a network location
                            // simply comment the three lines below
                            AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
                            mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
                            afd.close();

                            // and uncomment this one
                            // mMediaPlayer.setDataSource("/sdcard/myMovie.m4v");

                            mMediaPlayer.prepareAsync();
                            mMediaPlayer.setOnPreparedListener(this);
                            mMediaPlayer.setOnBufferingUpdateListener(this);
                            mMediaPlayer.setOnCompletionListener(this);
                            mMediaPlayer.setOnErrorListener(this);
                            mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
                            mMediaPlayer.setSurface(new Surface(mSurfaceTexture));
                            canBeOnTexture = true;
                            mShouldPlayImmediately = playOnTextureImmediately;
                        }
                        catch (Exception e)
                        {
                            DebugLog.LOGE("Error while creating the MediaPlayer: " + e.toString());

                            mCurrentState = MEDIA_STATE.ERROR;
                            mMediaPlayerLock.unlock();
                            mSurfaceTextureLock.unlock();
                            return false;
                        }
                    }
                }
                else
                {
                    try
                    {
                        // We need to verify that the file exists
                        AssetFileDescriptor afd = mParentActivity.getAssets().openFd(filename);
                        afd.close();
                    }
                    catch (Exception e)
                    {
                        DebugLog.LOGD("File does not exist");
                        mCurrentState = MEDIA_STATE.ERROR;
                        mMediaPlayerLock.unlock();
                        mSurfaceTextureLock.unlock();
                        return false;
                    }
                }

 

Thanks ,

Nishantha
 

 

 

 

 

The VideoPlayback-2-5-5.zip sample code is not working

July 15, 2013 - 7:52am #3

It appears that the video file isn't being found. Are you testing the samples videos or your own? - check that they are where they should be in the project.

The VideoPlayback-2-5-5.zip sample code is not working

July 15, 2013 - 7:50am #2

Hi, have you rebuilt the sample in Eclipse ? did you also build the native code using ndk-build ?

 

Log in or register to post comments