s/AVCodec/FFMpeg/
This commit is contained in:
@@ -47,12 +47,12 @@ AC_SEARCH_LIBS(mad_synth_init, [mad], have_mad=yes, have_mad=no)
|
|||||||
AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)
|
AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)
|
||||||
AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)
|
AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)
|
||||||
|
|
||||||
have_avcodec=no
|
have_ffmpeg=no
|
||||||
if test "$have_libavformat" = "yes" -a "$have_libavcodec" = "yes"; then
|
if test "$have_libavformat" = "yes" -a "$have_libavcodec" = "yes"; then
|
||||||
have_avcodec=yes
|
have_ffmpeg=yes
|
||||||
AC_DEFINE(HAVE_AVCODEC, 1, [AVCODEC support available])
|
AC_DEFINE(HAVE_FFMPEG, 1, [FMPEG support available])
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(HAVE_AVCODEC, test "$have_avcodec" == "yes" )
|
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" == "yes" )
|
||||||
|
|
||||||
#if test "x$have_mad" = "xno"; then
|
#if test "x$have_mad" = "xno"; then
|
||||||
# echo
|
# echo
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ InputHandler = arch/InputHandler/InputHandler.cpp arch/InputHandler/InputHandler
|
|||||||
MovieTexture = arch/MovieTexture/MovieTexture.cpp arch/MovieTexture/MovieTexture.h \
|
MovieTexture = arch/MovieTexture/MovieTexture.cpp arch/MovieTexture/MovieTexture.h \
|
||||||
arch/MovieTexture/MovieTexture_Null.cpp arch/MovieTexture/MovieTexture_Null.h
|
arch/MovieTexture/MovieTexture_Null.cpp arch/MovieTexture/MovieTexture_Null.h
|
||||||
|
|
||||||
if HAVE_AVCODEC
|
if HAVE_FFMPEG
|
||||||
MovieTexture += arch/MovieTexture/MovieTexture_AVCodec.cpp arch/MovieTexture/MovieTexture_AVCodec.h
|
MovieTexture += arch/MovieTexture/MovieTexture_FFMpeg.cpp arch/MovieTexture/MovieTexture_FFMpeg.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LowLevelWindow = arch/LowLevelWindow/LowLevelWindow.h \
|
LowLevelWindow = arch/LowLevelWindow/LowLevelWindow.h \
|
||||||
|
|||||||
@@ -8,13 +8,13 @@
|
|||||||
* --steve */
|
* --steve */
|
||||||
#if defined(_WINDOWS)
|
#if defined(_WINDOWS)
|
||||||
#include "MovieTexture_DShow.h"
|
#include "MovieTexture_DShow.h"
|
||||||
#define DEFAULT_MOVIE_DRIVER_LIST "AVCodec,DShow,Null"
|
#define DEFAULT_MOVIE_DRIVER_LIST "FFMpeg,DShow,Null"
|
||||||
#else
|
#else
|
||||||
#define DEFAULT_MOVIE_DRIVER_LIST "AVCodec,Null"
|
#define DEFAULT_MOVIE_DRIVER_LIST "FFMpeg,Null"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_AVCODEC
|
#ifdef HAVE_FFMPEG
|
||||||
#include "MovieTexture_AVCodec.h"
|
#include "MovieTexture_FFMpeg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "RageFile.h"
|
#include "RageFile.h"
|
||||||
@@ -88,7 +88,7 @@ RageMovieTexture *MakeRageMovieTexture(RageTextureID ID)
|
|||||||
if (!Driver.CompareNoCase("DShow")) ret = new MovieTexture_DShow(ID);
|
if (!Driver.CompareNoCase("DShow")) ret = new MovieTexture_DShow(ID);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_AVCODEC
|
#ifdef HAVE_AVCODEC
|
||||||
if (!Driver.CompareNoCase("AVCodec")) ret = new MovieTexture_AVCodec(ID);
|
if (!Driver.CompareNoCase("FFMpeg")) ret = new MovieTexture_FFMpeg(ID);
|
||||||
#endif
|
#endif
|
||||||
if (!Driver.CompareNoCase("Null")) ret = new MovieTexture_Null(ID);
|
if (!Driver.CompareNoCase("Null")) ret = new MovieTexture_Null(ID);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
|||||||
+22
-17
@@ -1,5 +1,5 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "MovieTexture_AVCodec.h"
|
#include "MovieTexture_FFMpeg.h"
|
||||||
|
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageTextureManager.h"
|
#include "RageTextureManager.h"
|
||||||
@@ -9,6 +9,11 @@
|
|||||||
|
|
||||||
/* TODO: implement m_bLoop */
|
/* TODO: implement m_bLoop */
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#pragma comment(lib, "ffmpeg/lib/avcodec.lib")
|
||||||
|
#pragma comment(lib, "ffmpeg/lib/avformat.lib")
|
||||||
|
#endif
|
||||||
|
|
||||||
struct AVPixelFormat_t
|
struct AVPixelFormat_t
|
||||||
{
|
{
|
||||||
int bpp;
|
int bpp;
|
||||||
@@ -113,7 +118,7 @@ static avcodec::AVStream *FindVideoStream( avcodec::AVFormatContext *m_fctx )
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovieTexture_AVCodec::MovieTexture_AVCodec( RageTextureID ID ):
|
MovieTexture_FFMpeg::MovieTexture_FFMpeg( RageTextureID ID ):
|
||||||
RageMovieTexture( ID )
|
RageMovieTexture( ID )
|
||||||
{
|
{
|
||||||
FixLilEndian();
|
FixLilEndian();
|
||||||
@@ -160,7 +165,7 @@ static CString averr_ssprintf( int err, const char *fmt, ... )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Create()
|
void MovieTexture_FFMpeg::Create()
|
||||||
{
|
{
|
||||||
m_Timer = 0;
|
m_Timer = 0;
|
||||||
|
|
||||||
@@ -237,7 +242,7 @@ void MovieTexture_AVCodec::Create()
|
|||||||
Play();
|
Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Destroy()
|
void MovieTexture_FFMpeg::Destroy()
|
||||||
{
|
{
|
||||||
StopThread();
|
StopThread();
|
||||||
|
|
||||||
@@ -256,7 +261,7 @@ void MovieTexture_AVCodec::Destroy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MovieTexture_AVCodec::CreateTexture()
|
void MovieTexture_FFMpeg::CreateTexture()
|
||||||
{
|
{
|
||||||
if( m_uTexHandle )
|
if( m_uTexHandle )
|
||||||
return;
|
return;
|
||||||
@@ -332,7 +337,7 @@ void MovieTexture_AVCodec::CreateTexture()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MovieTexture_AVCodec::DecoderThread()
|
void MovieTexture_FFMpeg::DecoderThread()
|
||||||
{
|
{
|
||||||
bool GetNextTimestamp = true;
|
bool GetNextTimestamp = true;
|
||||||
float CurrentTimestamp = 0, LastGoodTimestamp = 0, Last_IP_Timestamp=0;
|
float CurrentTimestamp = 0, LastGoodTimestamp = 0, Last_IP_Timestamp=0;
|
||||||
@@ -521,7 +526,7 @@ void MovieTexture_AVCodec::DecoderThread()
|
|||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovieTexture_AVCodec::~MovieTexture_AVCodec()
|
MovieTexture_FFMpeg::~MovieTexture_FFMpeg()
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
@@ -529,7 +534,7 @@ MovieTexture_AVCodec::~MovieTexture_AVCodec()
|
|||||||
SDL_DestroySemaphore( m_OneFrameDecoded );
|
SDL_DestroySemaphore( m_OneFrameDecoded );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Update(float fDeltaTime)
|
void MovieTexture_FFMpeg::Update(float fDeltaTime)
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -537,7 +542,7 @@ void MovieTexture_AVCodec::Update(float fDeltaTime)
|
|||||||
CheckFrame();
|
CheckFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::CheckFrame()
|
void MovieTexture_FFMpeg::CheckFrame()
|
||||||
{
|
{
|
||||||
if( !m_ImageWaiting )
|
if( !m_ImageWaiting )
|
||||||
return;
|
return;
|
||||||
@@ -557,19 +562,19 @@ void MovieTexture_AVCodec::CheckFrame()
|
|||||||
SDL_SemPost(m_BufferFinished);
|
SDL_SemPost(m_BufferFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Reload()
|
void MovieTexture_FFMpeg::Reload()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::StartThread()
|
void MovieTexture_FFMpeg::StartThread()
|
||||||
{
|
{
|
||||||
ASSERT( m_State == DECODER_QUIT );
|
ASSERT( m_State == DECODER_QUIT );
|
||||||
m_State = PAUSE_DECODER;
|
m_State = PAUSE_DECODER;
|
||||||
m_DecoderThread.SetName( ssprintf("MovieTexture_AVCodec(%s)", GetID().filename.c_str()) );
|
m_DecoderThread.SetName( ssprintf("MovieTexture_FFMpeg(%s)", GetID().filename.c_str()) );
|
||||||
m_DecoderThread.Create( DecoderThread_start, this );
|
m_DecoderThread.Create( DecoderThread_start, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::StopThread()
|
void MovieTexture_FFMpeg::StopThread()
|
||||||
{
|
{
|
||||||
LOG->Trace("Shutting down decoder thread ...");
|
LOG->Trace("Shutting down decoder thread ...");
|
||||||
|
|
||||||
@@ -591,17 +596,17 @@ void MovieTexture_AVCodec::StopThread()
|
|||||||
LOG->Trace("Decoder thread shut down.");
|
LOG->Trace("Decoder thread shut down.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Play()
|
void MovieTexture_FFMpeg::Play()
|
||||||
{
|
{
|
||||||
m_State = PLAYING;
|
m_State = PLAYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::Pause()
|
void MovieTexture_FFMpeg::Pause()
|
||||||
{
|
{
|
||||||
m_State = PAUSE_DECODER;
|
m_State = PAUSE_DECODER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovieTexture_AVCodec::SetPosition( float fSeconds )
|
void MovieTexture_FFMpeg::SetPosition( float fSeconds )
|
||||||
{
|
{
|
||||||
ASSERT( m_State != DECODER_QUIT );
|
ASSERT( m_State != DECODER_QUIT );
|
||||||
|
|
||||||
@@ -613,7 +618,7 @@ void MovieTexture_AVCodec::SetPosition( float fSeconds )
|
|||||||
|
|
||||||
if( fSeconds != 0 )
|
if( fSeconds != 0 )
|
||||||
{
|
{
|
||||||
LOG->Warn( "MovieTexture_AVCodec::SetPosition(%f): non-0 seeking unsupported; ignored", fSeconds );
|
LOG->Warn( "MovieTexture_FFMpeg::SetPosition(%f): non-0 seeking unsupported; ignored", fSeconds );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
+10
-6
@@ -1,5 +1,5 @@
|
|||||||
#ifndef RAGEMOVIETEXTURE_AVCODEC_H
|
#ifndef RAGEMovieTexture_FFMPEG_H
|
||||||
#define RAGEMOVIETEXTURE_AVCODEC_H
|
#define RAGEMovieTexture_FFMPEG_H
|
||||||
|
|
||||||
#include "MovieTexture.h"
|
#include "MovieTexture.h"
|
||||||
|
|
||||||
@@ -12,15 +12,19 @@
|
|||||||
|
|
||||||
namespace avcodec
|
namespace avcodec
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include "ffmpeg/include/ffmpeg/avformat.h"
|
||||||
|
#else
|
||||||
#include <ffmpeg/avformat.h>
|
#include <ffmpeg/avformat.h>
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class MovieTexture_AVCodec : public RageMovieTexture
|
class MovieTexture_FFMpeg: public RageMovieTexture
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MovieTexture_AVCodec( RageTextureID ID );
|
MovieTexture_FFMpeg( RageTextureID ID );
|
||||||
virtual ~MovieTexture_AVCodec();
|
virtual ~MovieTexture_FFMpeg();
|
||||||
/* only called by RageTextureManager::InvalidateTextures */
|
/* only called by RageTextureManager::InvalidateTextures */
|
||||||
void Invalidate() { m_uTexHandle = 0; }
|
void Invalidate() { m_uTexHandle = 0; }
|
||||||
void Update(float fDeltaTime);
|
void Update(float fDeltaTime);
|
||||||
@@ -98,7 +102,7 @@ private:
|
|||||||
|
|
||||||
SDL_sem *m_BufferFinished, *m_OneFrameDecoded;
|
SDL_sem *m_BufferFinished, *m_OneFrameDecoded;
|
||||||
|
|
||||||
static int DecoderThread_start(void *p) { ((MovieTexture_AVCodec *)(p))->DecoderThread(); return 0; }
|
static int DecoderThread_start(void *p) { ((MovieTexture_FFMpeg *)(p))->DecoderThread(); return 0; }
|
||||||
void DecoderThread();
|
void DecoderThread();
|
||||||
RageThread m_DecoderThread;
|
RageThread m_DecoderThread;
|
||||||
|
|
||||||
Reference in New Issue
Block a user