monkey2_glue.cpp 932 B

123456789101112131415161718192021222324252627282930313233
  1. #include "monkey2_glue.h"
  2. #include "theoraplayer.h"
  3. #include "Manager.h"
  4. #include "MemoryDataSource.h"
  5. theoraplayer::Manager *bb_theoraplayer_getManager(){
  6. if( !theoraplayer::manager ) theoraplayer::init();
  7. return theoraplayer::manager;
  8. }
  9. theoraplayer::VideoClip *bb_theoraplayer_createVideoClip( theoraplayer::Manager *self,const char *filename ){
  10. return self->createVideoClip( filename );
  11. }
  12. //FIXME - leaks MemoryDataSource!
  13. //
  14. theoraplayer::VideoClip *bb_theoraplayer_createVideoClip( theoraplayer::Manager *self,const void *data,int length ){
  15. theoraplayer::MemoryDataSource *src=new theoraplayer::MemoryDataSource( (unsigned char*)data,length,"Theora" );
  16. return self->createVideoClip( src );
  17. }
  18. theoraplayer::MemoryDataSource *bb_theoraplayer_createMemoryDataSource( const void *data,int length,const char *formatName ){
  19. return new theoraplayer::MemoryDataSource( (unsigned char*)data,length,formatName );
  20. }