Browse Source

image: add the skeleton for a Movie class.

undefined
Sam Hocevar 10 years ago
parent
commit
7bd5a94ca0
7 changed files with 137 additions and 3 deletions
  1. +13
    -0
      configure.ac
  2. +4
    -3
      src/Makefile.am
  3. +69
    -0
      src/image/movie.cpp
  4. +1
    -0
      src/lol/image/all.h
  5. +42
    -0
      src/lol/image/movie.h
  6. +2
    -0
      src/lolcore.vcxproj
  7. +6
    -0
      src/lolcore.vcxproj.filters

+ 13
- 0
configure.ac View File

@@ -443,6 +443,19 @@ fi
AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")


# Use libavcodec? (required for movie encoding)
ac_cv_my_have_ffmpeg=yes
PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no])
PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no])
PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no])
if test "${ac_cv_my_have_ffmpeg}" != "no"; then
AC_DEFINE(USE_FFMPEG, 1, Define to 1 to use FFmpeg)
LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${CFLAGSWSCALE_LIBS}"
LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}"
fi
AM_CONDITIONAL(USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no")


dnl Use GTK+? (required for the deushax editor)
ac_cv_my_have_gtkgl="no"
PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])


+ 4
- 3
src/Makefile.am View File

@@ -37,8 +37,8 @@ liblolcore_headers = \
\
lol/base/all.h \
lol/base/avl_tree.h lol/base/features.h lol/base/tuple.h lol/base/types.h \
lol/base/array.h lol/base/assert.h lol/base/string.h lol/base/hash.h lol/base/map.h \
lol/base/enum.h lol/base/log.h \
lol/base/array.h lol/base/assert.h lol/base/string.h lol/base/hash.h \
lol/base/map.h lol/base/enum.h lol/base/log.h \
\
lol/math/all.h \
lol/math/functions.h lol/math/vector.h lol/math/half.h lol/math/real.h \
@@ -53,7 +53,7 @@ liblolcore_headers = \
lol/sys/init.h lol/sys/file.h lol/sys/thread.h lol/sys/timer.h \
\
lol/image/all.h \
lol/image/pixel.h lol/image/color.h lol/image/image.h \
lol/image/pixel.h lol/image/color.h lol/image/image.h lol/image/movie.h \
\
lol/gpu/all.h \
lol/gpu/shader.h lol/gpu/indexbuffer.h lol/gpu/vertexbuffer.h \
@@ -122,6 +122,7 @@ liblolcore_sources = \
image/dither/ostromoukhov.cpp image/dither/ordered.cpp \
image/filter/convolution.cpp image/filter/color.cpp \
image/filter/dilate.cpp image/filter/median.cpp image/filter/yuv.cpp \
image/movie.cpp \
\
loldebug.h \
debug/fps.cpp debug/fps.h debug/lines.cpp \


+ 69
- 0
src/image/movie.cpp View File

@@ -0,0 +1,69 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

#include <lol/engine-internal.h>

#if USE_FFMPEG
extern "C"
{
# include <libavformat/avformat.h>
}
#endif

namespace lol
{

#if USE_FFMPEG
static bool g_ready = false;
#endif

class MovieData
{
#if USE_FFMPEG

#endif

friend class Movie;
};

/*
* Public Movie class
*/

Movie::Movie(String const &name, ivec2 size, float fps)
: m_data(new MovieData())
{
#if USE_FFMPEG
if (!g_ready)
{
g_ready = true;
av_register_all();
}
#endif
}

Movie::~Movie()
{
#if USE_FFMPEG

#endif

delete m_data;
}

void Movie::Feed(Image const &image)
{
#if USE_FFMPEG

#endif
}

} /* namespace lol */


+ 1
- 0
src/lol/image/all.h View File

@@ -13,4 +13,5 @@
#include <lol/image/pixel.h>
#include <lol/image/color.h>
#include <lol/image/image.h>
#include <lol/image/movie.h>


+ 42
- 0
src/lol/image/movie.h View File

@@ -0,0 +1,42 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2014 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
//

#pragma once

//
// The Movie class
// ---------------
//

#include <lol/image/movie.h>

namespace lol
{

class Movie
{
public:
Movie(String const &name, ivec2 size, float fps);

/* TODO: Rule of three */
#if 0
Movie(Movie const &other);
Movie & operator =(Movie other);
#endif
~Movie();

void Feed(Image const &image);

private:
class MovieData *m_data;
};

} /* namespace lol */


+ 2
- 0
src/lolcore.vcxproj View File

@@ -164,6 +164,7 @@
<ClCompile Include="image\combine.cpp" />
<ClCompile Include="image\image.cpp" />
<ClCompile Include="image\kernel.cpp" />
<ClCompile Include="image\movie.cpp" />
<ClCompile Include="image\noise.cpp" />
<ClCompile Include="image\pixel.cpp" />
<ClCompile Include="image\resample.cpp" />
@@ -320,6 +321,7 @@
<ClInclude Include="lol\image\all.h" />
<ClInclude Include="lol\image\color.h" />
<ClInclude Include="lol\image\image.h" />
<ClInclude Include="lol\image\movie.h" />
<ClInclude Include="lol\image\pixel.h" />
<ClInclude Include="lol\math\all.h" />
<ClInclude Include="lol\math\array2d.h" />


+ 6
- 0
src/lolcore.vcxproj.filters View File

@@ -105,6 +105,9 @@
<ClCompile Include="debug\fps.cpp">
<Filter>debug</Filter>
</ClCompile>
<ClCompile Include="image\movie.cpp">
<Filter>image</Filter>
</ClCompile>
<ClCompile Include="debug\record.cpp">
<Filter>debug</Filter>
</ClCompile>
@@ -735,6 +738,9 @@
<ClInclude Include="lol\image\pixel.h">
<Filter>lol\image</Filter>
</ClInclude>
<ClInclude Include="lol\image\movie.h">
<Filter>lol\image</Filter>
</ClInclude>
<ClInclude Include="input\keys.h">
<Filter>input</Filter>
</ClInclude>


Loading…
Cancel
Save