Page 1 of 1

Request for Video Playback

PostPosted: Fri Jun 24, 2011 5:27 pm
by Hblade
It'd be nice if we could have video playback, easiest supported files to integrate are .MPG with the MPEG layer codecs.

This should help with the programming, you might be able to edit this code to get the results needed.
http://www.gamedev.net/index.php?app=co ... mMainBar=1

Codes from the website:
Get current resolution:
Code: Select all
void GetDesktopResolution( int & width, int & height, int & bpp)
{
#ifdef __CARBON__
  CFDictionaryRef desktopVideoMode = CGDisplayCurrentMode( kCGDirectMainDisplay );
  if( !CFNumberGetValue( (CFNumberRef)CFDictionaryGetValue( desktopVideoMode, kCGDisplayWidth ),
                         kCFNumberIntType,
                         &width ) ||
      !CFNumberGetValue( (CFNumberRef)CFDictionaryGetValue( desktopVideoMode, kCGDisplayHeight ),
                         kCFNumberIntType,
                         &height ) ||
      !CFNumberGetValue( (CFNumberRef)CFDictionaryGetValue( desktopVideoMode, kCGDisplayBitsPerPixel ),
                         kCFNumberIntType,
                         &bpp ) )
  {
    // error, return default values
    // ...
  }
#elif WIN32
  DEVMODE desktopVideoMode;
  ZeroMemory( reinterpret_cast( &desktopVideoMode ), sizeof( desktopVideoMode ) );

  if( EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &desktopVideoMode ) )
  {
    m_desktopWidth = desktopVideoMode.dmPelsWidth;
    m_desktopHeight = desktopVideoMode.dmPelsHeight;
    m_desktopBpp = desktopVideoMode.dmBitsPerPel;
  }
  else
  {
    // error, return default values
    // ...
  }
#else
#error unsupported platform
#endif
}


Get ammount of Video ram installed:
Code: Select all
#ifdef WIN32
#include
#include  // Needs DirectX SDK(>=5), or at least ddraw.h in your path
typedef int (WINAPI *MYPROC)(GUID *,LPDIRECTDRAW *,IUnknown *);
#else
#include
#include
#endif

const int GetInstalledVRAM( void )
{
#ifdef __CARBON__
  AGLRendererInfo info;
  GLint           vram( 0 );
 
  info = aglQueryRendererInfo ( NULL, 0 );

  while ( info != NULL )
  {
    if( aglDescribeRenderer( info, AGL_VIDEO_MEMORY, &vram ) == GL_TRUE )
    {
      // Return megabytes
      return static_cast( vram / (1024 * 1024) );
    }
    info = aglNextRendererInfo( info );
  }

  return 0;

#elif WIN32

  HINSTANCE DDrawDLL;
  int vram ( 0 );

  DDrawDLL = LoadLibrary( "ddraw.dll" );

  if( DDrawDLL != NULL )
  {
    MYPROC DDrawCreate;
    LPDIRECTDRAW DDraw;
    HRESULT hres;

    DDrawCreate = ( MYPROC ) GetProcAddress( DDrawDLL, "DirectDrawCreate");

    if( ( DDrawCreate != NULL )
        && !FAILED( DDrawCreate( NULL, &DDraw, NULL ) ) )
    {
      DDCAPS caps;
      memset(&caps,0,sizeof(DDCAPS));
      caps.dwSize = sizeof(DDCAPS);

      hres = IDirectDraw2_GetCaps( DDraw, &caps, NULL );
      if( hres == S_OK )
      {
        // Return megabytes
        vram = caps.dwVidMemTotal / (1024 * 1024);
      }

      IDirectDraw_Release( DDraw );
    }
    FreeLibrary( DDrawDLL );
  }
  return vram;
#else
#error Unsupported platform
#endif
}



For more please read the website link

Re: Request for Video Playback

PostPosted: Fri Jun 24, 2011 5:37 pm
by MrJolteon
Yeah, video playback is a good idea

Re: Request for Video Playback

PostPosted: Fri Jun 24, 2011 6:01 pm
by Jagmaster
Absolutely! I almost thought of asking if that was possible, but then I saw this post. :lol:
This would allow an .exe to be smaller in size (maybe have vids in external file).

We also need to be able to have the functionality to load sounds from external files.

Re: Request for Video Playback

PostPosted: Fri Jun 24, 2011 10:29 pm
by rykein
agree

Re: Request for Video Playback

PostPosted: Wed Mar 28, 2012 4:50 am
by chicoscience
If this is going to happen, please use a free format. MPEG is not entirely free from royalties. vp8 and theora are the way to go.

Re: Request for Video Playback

PostPosted: Sat May 05, 2012 9:52 pm
by Fojam
Wait... Why would you have to pay a royalty for using a certain video format?

Re: Request for Video Playback

PostPosted: Sun May 06, 2012 12:32 pm
by makslane
In the first versions, Game Editor have support for mp3 format. I remove the support because you need to pay royalties to the Fraunhofer Institut (if your software got successful)

Re: Request for Video Playback

PostPosted: Sun May 06, 2012 5:07 pm
by Fojam
oh you dang rich people and your lawyers. well is there a video format thats royalty free and doesnt take up a lot of space that we can use? (one thats common hopefully)

Re: Request for Video Playback

PostPosted: Sun May 06, 2012 7:12 pm
by Hblade
I think mpg is royalty free, not sure. MPEG2 or MPEG4 codecs might very well be royalty free. Otherwise, you could probably use ogv formats. (Which is commonly used for HTML5 stuff, as is the .webm extention)