Hi Koduri,
You can create a Quad and then add the image stream, something like that:
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(
"/sdcard/videodemo256256.avi.ffmpeg" );
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(
image.get() );
if ( imageStream )
{
imageStream->play();
}
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
texture->setImage( image.get() );
osg::ref_ptr<osg::Geometry> quad = osg::createTexturedQuadGeometry(
osg::Vec3(), osg::Vec3(1.0f, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f,
1.0f),0,1,1,0 );
quad->getOrCreateStateSet()->setTextureAttributeAndModes( 0,
texture.get() );
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable( quad.get() );
Cheers.
2013/2/1 Koduri Lakshmi <[email protected]>
> Hi Jordi Torres and Jan Ciger,
>
> Thank you very much for the reply.
>
> I downloaded ffmpeg1.0 from FFmpeg site. Now compiled statically to
> generate ".a" files. I generated
>
> /armeabi-v7a/libavformat.a
> /armeabi-v7a/libavcodec.a
> /armeabi-v7a/libavdevice.a
> /armeabi-v7a/libswscale.a
> l/armeabi-v7a/libavutil.a
> /armeabi-v7a/libswresample.a
> /armeabi-v7a/libswresample.a.
>
> After this I downloaded the latest submission for ffmpeg plugin (by David
> Longest dated Oct 09, 2012). Replaced all files of this to
> "$OSG/src/plugins/ffmpeg" folder. Now I gave the following cmake command
>
>
> Code:
> cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
> -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF
> -DOSG_GL_MATRICES_AVAILABLE=ON -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON
> -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON
> -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
> -DOSG_GL1_AVAILABLE=OFF
>
> -DFFMPEG_LIBAVCODEC_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg
> -DFFMPEG_LIBAVCODEC_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavcodec.a
> -DFFMPEG_LIBAVDEVICE_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg
> -DFFMPEG_LIBAVDEVICE_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavdevice.a
> -DFFMPEG_LIBAVFORMAT_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg
> -DFFMPEG_LIBAVFORMAT_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavformat.a
> -DFFMPEG_LIBAVUTIL_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg
> -DFFMPEG_LIBAVUTIL_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libavutil.a
> -DFFMPEG_LIBSWSCALE_INCLUDE_DIRS=/home/ttpl/Android/OSGSupport/ffmpeg
> -DFFMPEG_LIBSWSCALE_LIBRARIES=/home/ttpl/Android/OSGSupport/ffmpeg/libswscale.a
> -DFFMPEG_ROOT=/home/ttpl/Android/OSGSupport/ffmpeg
>
> -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON
> -DOSG_GLES2_AVAILABLE=OFF -DCMAKE_CXX_FLAGS=__STDC_CONSTANT_MACROS -DJ=4
> -DCMAKE_INSTALL_PREFIX=/home/ttpl/Android/OpenSceneGraph-3.0.1_GL1/osginstall
>
>
>
> Faced some error and solved them.
>
> "make install" installed all include and lib files to
> "/home/ttpl/Android/OpenSceneGraph-3.0.1_GL1/osginstall" folder.
>
> I gave "/home/ttpl/Android/OpenSceneGraph-3.0.1_GL1/osginstall" path as
> "OSG_ANDROID_DIR" in Android.mk files.
>
> As of my knowledge to use ffmpeg plugin I should use "USE_OSGPLUGIN()"
> macro. Here I am facing problem. I dont have much idea how to use this
> plugin.
>
> Can you please help me how to link ffmpeg plugin for Android.
>
> ...
>
>
> Thank you!
>
> Cheers,
> Koduri
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52322#52322
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
Jordi Torres Fabra
gvSIG 3D blog
http://gvsig3d.blogspot.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org