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(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
|
||||
have_avcodec=yes
|
||||
AC_DEFINE(HAVE_AVCODEC, 1, [AVCODEC support available])
|
||||
have_ffmpeg=yes
|
||||
AC_DEFINE(HAVE_FFMPEG, 1, [FMPEG support available])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_AVCODEC, test "$have_avcodec" == "yes" )
|
||||
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" == "yes" )
|
||||
|
||||
#if test "x$have_mad" = "xno"; then
|
||||
# echo
|
||||
|
||||
@@ -101,8 +101,8 @@ InputHandler = arch/InputHandler/InputHandler.cpp arch/InputHandler/InputHandler
|
||||
MovieTexture = arch/MovieTexture/MovieTexture.cpp arch/MovieTexture/MovieTexture.h \
|
||||
arch/MovieTexture/MovieTexture_Null.cpp arch/MovieTexture/MovieTexture_Null.h
|
||||
|
||||
if HAVE_AVCODEC
|
||||
MovieTexture += arch/MovieTexture/MovieTexture_AVCodec.cpp arch/MovieTexture/MovieTexture_AVCodec.h
|
||||
if HAVE_FFMPEG
|
||||
MovieTexture += arch/MovieTexture/MovieTexture_FFMpeg.cpp arch/MovieTexture/MovieTexture_FFMpeg.h
|
||||
endif
|
||||
|
||||
LowLevelWindow = arch/LowLevelWindow/LowLevelWindow.h \
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
* --steve */
|
||||
#if defined(_WINDOWS)
|
||||
#include "MovieTexture_DShow.h"
|
||||
#define DEFAULT_MOVIE_DRIVER_LIST "AVCodec,DShow,Null"
|
||||
#define DEFAULT_MOVIE_DRIVER_LIST "FFMpeg,DShow,Null"
|
||||
#else
|
||||
#define DEFAULT_MOVIE_DRIVER_LIST "AVCodec,Null"
|
||||
#define DEFAULT_MOVIE_DRIVER_LIST "FFMpeg,Null"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AVCODEC
|
||||
#include "MovieTexture_AVCodec.h"
|
||||
#ifdef HAVE_FFMPEG
|
||||
#include "MovieTexture_FFMpeg.h"
|
||||
#endif
|
||||
|
||||
#include "RageFile.h"
|
||||
@@ -88,7 +88,7 @@ RageMovieTexture *MakeRageMovieTexture(RageTextureID ID)
|
||||
if (!Driver.CompareNoCase("DShow")) ret = new MovieTexture_DShow(ID);
|
||||
#endif
|
||||
#ifdef HAVE_AVCODEC
|
||||
if (!Driver.CompareNoCase("AVCodec")) ret = new MovieTexture_AVCodec(ID);
|
||||
if (!Driver.CompareNoCase("FFMpeg")) ret = new MovieTexture_FFMpeg(ID);
|
||||
#endif
|
||||
if (!Driver.CompareNoCase("Null")) ret = new MovieTexture_Null(ID);
|
||||
if (!ret)
|
||||
|
||||
+22
-17
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "MovieTexture_AVCodec.h"
|
||||
#include "MovieTexture_FFMpeg.h"
|
||||
|
||||
#include "RageLog.h"
|
||||
#include "RageTextureManager.h"
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
/* 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
|
||||
{
|
||||
int bpp;
|
||||
@@ -113,7 +118,7 @@ static avcodec::AVStream *FindVideoStream( avcodec::AVFormatContext *m_fctx )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MovieTexture_AVCodec::MovieTexture_AVCodec( RageTextureID ID ):
|
||||
MovieTexture_FFMpeg::MovieTexture_FFMpeg( RageTextureID ID ):
|
||||
RageMovieTexture( ID )
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -237,7 +242,7 @@ void MovieTexture_AVCodec::Create()
|
||||
Play();
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::Destroy()
|
||||
void MovieTexture_FFMpeg::Destroy()
|
||||
{
|
||||
StopThread();
|
||||
|
||||
@@ -256,7 +261,7 @@ void MovieTexture_AVCodec::Destroy()
|
||||
}
|
||||
|
||||
|
||||
void MovieTexture_AVCodec::CreateTexture()
|
||||
void MovieTexture_FFMpeg::CreateTexture()
|
||||
{
|
||||
if( m_uTexHandle )
|
||||
return;
|
||||
@@ -332,7 +337,7 @@ void MovieTexture_AVCodec::CreateTexture()
|
||||
|
||||
|
||||
|
||||
void MovieTexture_AVCodec::DecoderThread()
|
||||
void MovieTexture_FFMpeg::DecoderThread()
|
||||
{
|
||||
bool GetNextTimestamp = true;
|
||||
float CurrentTimestamp = 0, LastGoodTimestamp = 0, Last_IP_Timestamp=0;
|
||||
@@ -521,7 +526,7 @@ void MovieTexture_AVCodec::DecoderThread()
|
||||
CHECKPOINT;
|
||||
}
|
||||
|
||||
MovieTexture_AVCodec::~MovieTexture_AVCodec()
|
||||
MovieTexture_FFMpeg::~MovieTexture_FFMpeg()
|
||||
{
|
||||
Destroy();
|
||||
|
||||
@@ -529,7 +534,7 @@ MovieTexture_AVCodec::~MovieTexture_AVCodec()
|
||||
SDL_DestroySemaphore( m_OneFrameDecoded );
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::Update(float fDeltaTime)
|
||||
void MovieTexture_FFMpeg::Update(float fDeltaTime)
|
||||
{
|
||||
CHECKPOINT;
|
||||
|
||||
@@ -537,7 +542,7 @@ void MovieTexture_AVCodec::Update(float fDeltaTime)
|
||||
CheckFrame();
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::CheckFrame()
|
||||
void MovieTexture_FFMpeg::CheckFrame()
|
||||
{
|
||||
if( !m_ImageWaiting )
|
||||
return;
|
||||
@@ -557,19 +562,19 @@ void MovieTexture_AVCodec::CheckFrame()
|
||||
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 );
|
||||
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 );
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::StopThread()
|
||||
void MovieTexture_FFMpeg::StopThread()
|
||||
{
|
||||
LOG->Trace("Shutting down decoder thread ...");
|
||||
|
||||
@@ -591,17 +596,17 @@ void MovieTexture_AVCodec::StopThread()
|
||||
LOG->Trace("Decoder thread shut down.");
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::Play()
|
||||
void MovieTexture_FFMpeg::Play()
|
||||
{
|
||||
m_State = PLAYING;
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::Pause()
|
||||
void MovieTexture_FFMpeg::Pause()
|
||||
{
|
||||
m_State = PAUSE_DECODER;
|
||||
}
|
||||
|
||||
void MovieTexture_AVCodec::SetPosition( float fSeconds )
|
||||
void MovieTexture_FFMpeg::SetPosition( float fSeconds )
|
||||
{
|
||||
ASSERT( m_State != DECODER_QUIT );
|
||||
|
||||
@@ -613,7 +618,7 @@ void MovieTexture_AVCodec::SetPosition( float fSeconds )
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
+10
-6
@@ -1,5 +1,5 @@
|
||||
#ifndef RAGEMOVIETEXTURE_AVCODEC_H
|
||||
#define RAGEMOVIETEXTURE_AVCODEC_H
|
||||
#ifndef RAGEMovieTexture_FFMPEG_H
|
||||
#define RAGEMovieTexture_FFMPEG_H
|
||||
|
||||
#include "MovieTexture.h"
|
||||
|
||||
@@ -12,15 +12,19 @@
|
||||
|
||||
namespace avcodec
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#include "ffmpeg/include/ffmpeg/avformat.h"
|
||||
#else
|
||||
#include <ffmpeg/avformat.h>
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
class MovieTexture_AVCodec : public RageMovieTexture
|
||||
class MovieTexture_FFMpeg: public RageMovieTexture
|
||||
{
|
||||
public:
|
||||
MovieTexture_AVCodec( RageTextureID ID );
|
||||
virtual ~MovieTexture_AVCodec();
|
||||
MovieTexture_FFMpeg( RageTextureID ID );
|
||||
virtual ~MovieTexture_FFMpeg();
|
||||
/* only called by RageTextureManager::InvalidateTextures */
|
||||
void Invalidate() { m_uTexHandle = 0; }
|
||||
void Update(float fDeltaTime);
|
||||
@@ -98,7 +102,7 @@ private:
|
||||
|
||||
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();
|
||||
RageThread m_DecoderThread;
|
||||
|
||||
Reference in New Issue
Block a user