Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build: add --disable-ffmpeg flag.

Clearly this is just to show what needs to happen to remove ffmpeg from build.
It is not clean or pretty, and is only meant to start the discussion.
In order to do this cleanly, a few things should happen:

- We need an internal image scaling/resampling class with swscale as one of
  the implementations. That will avoid the ifdefs for swscale all over.

- We need our own representation of codec id's. These could map to ffmpeg's
  if it's available, but stand alone if not.
  • Loading branch information...
commit d3799e6611af1d2a5717c5bd42265cbb654d0f16 1 parent a2a5b69
theuni authored
Showing with 578 additions and 49 deletions.
  1. +3 −0  .gitignore
  2. +29 −2 configure.in
  3. +2 −2 lib/Makefile.in
  4. +6 −0 xbmc/ThumbLoader.cpp
  5. +2 −0  xbmc/cdrip/CDDARipper.cpp
  6. +4 −1 xbmc/cdrip/Makefile.in
  7. +23 −1 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
  8. +19 −2 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
  9. +5 −3 xbmc/cores/dvdplayer/DVDAudio.h
  10. +4 −0 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
  11. +10 −6 xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
  12. +7 −0 xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
  13. +3 −3 xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
  14. +16 −4 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
  15. +5 −1 xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
  16. +13 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
  17. +7 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
  18. +5 −0 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
  19. +3 −3 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
  20. +5 −0 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
  21. +5 −1 xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
  22. +6 −2 xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
  23. +11 −3 xbmc/cores/dvdplayer/DVDFileInfo.cpp
  24. +10 −2 xbmc/cores/dvdplayer/DVDPlayer.cpp
  25. +5 −1 xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
  26. +10 −2 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
  27. +5 −3 xbmc/cores/dvdplayer/DVDStreamInfo.h
  28. +342 −0 xbmc/cores/dvdplayer/FFMpegInternals.h
  29. 0  xbmc/music/tags/{Makefile → Makefile.in}
  30. +8 −1 xbmc/pictures/Picture.cpp
  31. +5 −0 xbmc/system.h
View
3  .gitignore
@@ -992,6 +992,9 @@ lib/cmyth/Makefile
# /xbmc/music/karaoke/
/xbmc/music/karaoke/Makefile
+# /xbmc/music/tags/
+/xbmc/music/tags/Makefile
+
# /lib/libapetag/
/lib/libapetag/Makefile
/lib/libapetag/libtool
View
31 configure.in
@@ -127,6 +127,7 @@ libusb_disabled_udev_found="== libusb disabled. =="
libcec_enabled="== libcec enabled. =="
libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
libcec_disabled_missing_libs="== libcec disabled because both libudev and libusb are not available. CEC adapter support will not be available. =="
+ffmpeg_disabled="== FFmpeg support manually disabled. =="
# External library message strings
external_libraries_enabled="== Use of all supported external libraries enabled. =="
@@ -319,6 +320,12 @@ AC_ARG_ENABLE([airtunes],
[use_airtunes=$enableval],
[use_airtunes=auto])
+AC_ARG_ENABLE([ffmpeg],
+ [AS_HELP_STRING([--enable-ffmpeg],
+ [enable internal FFmpeg libraries (default is yes)])],
+ [use_ffmpeg=$enableval],
+ [use_ffmpeg=yes])
+
AC_ARG_ENABLE([ffmpeg_libvorbis],
[AS_HELP_STRING([--enable-ffmpeg-libvorbis],
[enable FFmpeg vorbis encoding (default is no)])],
@@ -1218,6 +1225,7 @@ if test "$use_external_ffmpeg" = "yes"; then
[[#include <libavfilter/avfilter.h>]])
AC_MSG_NOTICE($external_ffmpeg_enabled)
+ SKIP_CONFIG_FFMPEG=1
USE_EXTERNAL_FFMPEG=1
AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
@@ -1244,6 +1252,7 @@ if test "$use_external_ffmpeg" = "yes"; then
else
AC_MSG_NOTICE($external_ffmpeg_disabled)
USE_EXTERNAL_FFMPEG=0
+ SKIP_CONFIG_FFMPEG=0
AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1], [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])
fi
@@ -1259,6 +1268,17 @@ else
AC_MSG_NOTICE([Using Python $PYTHON_VERSION])
fi
+if test "x$use_ffmpeg" != "xno"; then
+ USE_FFMPEG=1
+ SKIP_CONFIG_FFMPEG=0
+ AC_DEFINE([HAVE_FFMPEG], [1], [Whether to use FFmpeg libraries.])
+else
+ use_vdpau=no
+ USE_FFMPEG=0
+ SKIP_CONFIG_FFMPEG=1
+ AC_MSG_NOTICE($ffmpeg_disabled)
+fi
+
# VDPAU
if test "x$use_vdpau" != "xno"; then
if test "$host_vendor" = "apple" ; then
@@ -1534,6 +1554,12 @@ else
final_message="$final_message\n DBUS:\t\tNo"
fi
+if test "x$use_ffmpeg" != "xno"; then
+ final_message="$final_message\n FFmpeg:\tYes"
+else
+ final_message="$final_message\n FFmpeg:\tNo"
+fi
+
if test "x$use_vdpau" != "xno"; then
final_message="$final_message\n VDPAU:\tYes"
else
@@ -1844,6 +1870,7 @@ OUTPUT_FILES="Makefile \
lib/snesapu/SNES/SNESAPU/Makefile \
lib/stsound/StSoundLibrary/Makefile \
xbmc/cores/playercorefactory/Makefile \
+ xbmc/music/tags/Makefile \
xbmc/music/karaoke/Makefile \
xbmc/osx/Makefile \
xbmc/guilib/Makefile \
@@ -1936,7 +1963,7 @@ AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
AC_SUBST(USE_WEB_SERVER)
-
+AC_SUBST(USE_FFMPEG)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
@@ -2072,7 +2099,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [
sed -i -e "s#define HAVE_SYMVER 1#define HAVE_SYMVER 0#" config.h &&
sed -i -e "s#define HAVE_SYMVER_GNU_ASM 1#define HAVE_SYMVER_GNU_ASM 0#" config.h
fi
-], [$USE_EXTERNAL_FFMPEG])
+], [$SKIP_CONFIG_FFMPEG])
XB_CONFIG_MODULE([lib/libdvd/libdvdcss], [
./configure \
View
4 lib/Makefile.in
@@ -15,12 +15,12 @@ POSTPROC_SO=postproc-52-$(ARCH).so
SWRESAMPLE_SO=swresample-0-$(ARCH).so
DIRS=
-ifneq (@USE_EXTERNAL_FFMPEG@,1)
+ifeq ($(or $(findstring 1,@USE_EXTERNAL_FFMPEG@),$(findstring 0,@USE_FFMPEG@)),)
DIRS+=ffmpeg
endif
LIBS=
-ifneq (@USE_EXTERNAL_FFMPEG@,1)
+ifeq ($(or $(findstring 1,@USE_EXTERNAL_FFMPEG@),$(findstring 0,@USE_FFMPEG@)),)
LIBS+=$(AVUTIL_SO) \
$(AVCODEC_SO) \
$(AVFORMAT_SO) \
View
6 xbmc/ThumbLoader.cpp
@@ -36,7 +36,9 @@
#include "programs/Shortcut.h"
#include "video/VideoInfoTag.h"
#include "video/VideoDatabase.h"
+#if defined (HAS_FFMPEG)
#include "cores/dvdplayer/DVDFileInfo.h"
+#endif
using namespace XFILE;
using namespace std;
@@ -135,7 +137,9 @@ bool CThumbExtractor::DoWork()
if (m_thumb)
{
CLog::Log(LOGDEBUG,"%s - trying to extract thumb from video file %s", __FUNCTION__, m_path.c_str());
+#if defined (HAS_FFMPEG)
result = CDVDFileInfo::ExtractThumb(m_path, m_target, &m_item.GetVideoInfoTag()->m_streamDetails);
+#endif
if(result)
{
m_item.SetProperty("HasAutoThumb", true);
@@ -146,7 +150,9 @@ bool CThumbExtractor::DoWork()
else if (m_item.HasVideoInfoTag() && !m_item.GetVideoInfoTag()->HasStreamDetails())
{
CLog::Log(LOGDEBUG,"%s - trying to extract filestream details from video file %s", __FUNCTION__, m_path.c_str());
+#if defined (HAS_FFMPEG)
result = CDVDFileInfo::GetFileStreamDetails(&m_item);
+#endif
}
return result;
View
2  xbmc/cdrip/CDDARipper.cpp
@@ -31,7 +31,9 @@
#include "EncoderLame.h"
#include "EncoderWav.h"
#include "EncoderVorbis.h"
+#if defined(HAS_FFMPEG)
#include "EncoderFFmpeg.h"
+#endif
#include "EncoderFlac.h"
#include "filesystem/CDDADirectory.h"
#include "music/tags/MusicInfoTagLoaderFactory.h"
View
5 xbmc/cdrip/Makefile.in
@@ -1,12 +1,15 @@
SRCS=CDDARipper.cpp \
CDDAReader.cpp \
Encoder.cpp \
- EncoderFFmpeg.cpp \
EncoderFlac.cpp \
EncoderLame.cpp \
EncoderVorbis.cpp \
EncoderWav.cpp \
+ifeq (@USE_FFMPEG@,1)
+SRCS += EncoderFFmpeg.cpp
+endif
+
LIB=cdrip.a
include @abs_top_srcdir@/Makefile.include
View
24 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
@@ -39,10 +39,12 @@
#include "guilib/Texture.h"
#include "guilib/LocalizeStrings.h"
#include "threads/SingleLock.h"
-#include "DllSwScale.h"
#include "utils/log.h"
#include "utils/GLUtils.h"
#include "RenderCapture.h"
+#if defined(USE_FFMPEG)
+#include "lib/DllSwScale.h"
+#endif
#ifdef HAVE_LIBVDPAU
#include "cores/dvdplayer/DVDCodecs/Video/VDPAU.h"
@@ -159,7 +161,9 @@ CLinuxRendererGL::CLinuxRendererGL()
m_context = NULL;
m_rgbPbo = 0;
+#if defined(USE_FFMPEG)
m_dllSwScale = new DllSwScale;
+#endif
}
CLinuxRendererGL::~CLinuxRendererGL()
@@ -182,7 +186,9 @@ CLinuxRendererGL::~CLinuxRendererGL()
if (m_context)
{
+#if defined(USE_FFMPEG)
m_dllSwScale->sws_freeContext(m_context);
+#endif
m_context = NULL;
}
@@ -193,7 +199,9 @@ CLinuxRendererGL::~CLinuxRendererGL()
m_pYUVShader = NULL;
}
+#if defined(USE_FFMPEG)
delete m_dllSwScale;
+#endif
}
bool CLinuxRendererGL::ValidateRenderer()
@@ -744,7 +752,9 @@ unsigned int CLinuxRendererGL::PreInit()
// setup the background colour
m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
+#if defined(USE_FFMPEG)
if (!m_dllSwScale->Load())
+#endif
CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
return true;
@@ -1069,7 +1079,9 @@ void CLinuxRendererGL::UnInit()
if (m_context)
{
+#if defined(USE_FFMPEG)
m_dllSwScale->sws_freeContext(m_context);
+#endif
m_context = NULL;
}
@@ -2600,6 +2612,7 @@ bool CLinuxRendererGL::CreateYUV422PackedTexture(int index)
void CLinuxRendererGL::ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf)
{
+#if defined(USE_FFMPEG)
if(m_rgbBufferSize != m_sourceWidth * m_sourceHeight * 4)
SetupRGBBuffer();
else if(flipIndexPlane == flipIndexBuf)
@@ -2665,10 +2678,15 @@ void CLinuxRendererGL::ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsign
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
m_rgbBuffer = (BYTE*)PBO_OFFSET;
}
+#else
+ CLog::Log(LOGERROR, "CLinuxRendererGL::ToRGBFrame: called without libswscale available");
+ return;
+#endif
}
void CLinuxRendererGL::ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf)
{
+#if defined(USE_FFMPEG)
if(m_rgbBufferSize != m_sourceWidth * m_sourceHeight * 4)
SetupRGBBuffer();
else if(flipIndexPlaneTop == flipIndexBuf && flipIndexPlaneBot == flipIndexBuf)
@@ -2749,6 +2767,10 @@ void CLinuxRendererGL::ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, un
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
m_rgbBuffer = (BYTE*)PBO_OFFSET;
}
+#else
+ CLog::Log(LOGERROR, "CLinuxRendererGL::ToRGBFields: called without libswscale available");
+ return;
+#endif
}
void CLinuxRendererGL::SetupRGBBuffer()
View
21 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -40,10 +40,10 @@
#include "windowing/WindowingFactory.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "guilib/Texture.h"
-#include "lib/DllSwScale.h"
#include "../dvdplayer/DVDCodecs/Video/OpenMaxVideo.h"
#include "threads/SingleLock.h"
#include "RenderCapture.h"
+#include "utils/log.h"
#if defined(__ARM_NEON__)
#include "yuv2rgb.neon.h"
#endif
@@ -54,6 +54,9 @@
#ifdef TARGET_DARWIN_IOS
#include "osx/DarwinUtils.h"
#endif
+#if defined(USE_FFMPEG)
+#include "lib/DllSwScale.h"
+#endif
using namespace Shaders;
@@ -103,7 +106,9 @@ CLinuxRendererGLES::CLinuxRendererGLES()
m_rgbBuffer = NULL;
m_rgbBufferSize = 0;
+#if defined(HAS_FFMPEG)
m_dllSwScale = new DllSwScale;
+#endif
m_sw_context = NULL;
}
@@ -125,7 +130,9 @@ CLinuxRendererGLES::~CLinuxRendererGLES()
m_pYUVShader = NULL;
}
+#if defined(HAS_FFMPEG)
delete m_dllSwScale;
+#endif
}
void CLinuxRendererGLES::ManageTextures()
@@ -503,8 +510,10 @@ unsigned int CLinuxRendererGLES::PreInit()
// setup the background colour
m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
+#if defined(HAS_FFMPEG)
if (!m_dllSwScale->Load())
CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
+#endif
return true;
}
@@ -697,11 +706,13 @@ void CLinuxRendererGLES::UnInit()
for (int i = 0; i < NUM_BUFFERS; ++i)
(this->*m_textureDelete)(i);
+#if defined(HAS_FFMPEG)
if (m_dllSwScale && m_sw_context)
{
m_dllSwScale->sws_freeContext(m_sw_context);
m_sw_context = NULL;
}
+#endif
// cleanup framebuffer object if it was in use
m_fbo.Cleanup();
m_bValidated = false;
@@ -761,8 +772,10 @@ void CLinuxRendererGLES::Render(DWORD flags, int index)
}
else
{
+#if defined(HAS_FFMPEG) || defined(__ARM_NEON__)
RenderSoftware(index, m_currentField);
VerifyGLState();
+#endif
}
}
@@ -1329,7 +1342,7 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
#if defined(__ARM_NEON__)
yuv420_2_rgb8888_neon(m_rgbBuffer, im->plane[0], im->plane[2], im->plane[1],
m_sourceWidth, m_sourceHeight, im->stride[0], im->stride[1], m_sourceWidth * 4);
-#else
+#elif defined(HAS_FFMPEG)
m_sw_context = m_dllSwScale->sws_getCachedContext(m_sw_context,
im->width, im->height, PIX_FMT_YUV420P,
im->width, im->height, PIX_FMT_RGBA,
@@ -1339,7 +1352,11 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
int srcStride[] = { im->stride[0], im->stride[1], im->stride[2], 0 };
uint8_t *dst[] = { m_rgbBuffer, 0, 0, 0 };
int dstStride[] = { m_sourceWidth*4, 0, 0, 0 };
+
m_dllSwScale->sws_scale(m_sw_context, src, srcStride, 0, im->height, dst, dstStride);
+#else
+ //We should add our own sw implementation here.
+ CLog::Log(LOGDEBUG, "No YUV->RGB implementation available.");
#endif
}
View
8 xbmc/cores/dvdplayer/DVDAudio.h
@@ -21,9 +21,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#include "cores/AudioRenderers/IAudioRenderer.h"
#include "cores/IAudioCallback.h"
#include "threads/CriticalSection.h"
@@ -32,6 +30,7 @@
#ifndef _LINUX
enum CodecID;
#else
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -43,6 +42,9 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif //HAS_FFMPEG
#endif
typedef struct stDVDAudioFrame DVDAudioFrame;
View
4 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
@@ -28,7 +28,11 @@
#include "config.h"
#endif
#include <vector>
+#if defined(HAS_FFMPEG)
#include "DllAvCodec.h"
+#else
+#include "FFMpegInternals.h"
+#endif
struct AVStream;
View
16 xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
@@ -2,12 +2,16 @@ INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer
CXXFLAGS+=-DHAVE_MMX
-SRCS= DVDAudioCodecFFmpeg.cpp \
- DVDAudioCodecLibMad.cpp \
- DVDAudioCodecLPcm.cpp \
- DVDAudioCodecPassthroughFFmpeg.cpp \
- DVDAudioCodecPcm.cpp \
- Encoders/DVDAudioEncoderFFmpeg.cpp
+SRCS= DVDAudioCodecLibMad.cpp \
+ DVDAudioCodecLPcm.cpp \
+ DVDAudioCodecPcm.cpp \
+
+ifeq (@USE_FFMPEG@,1)
+SRCS+= DVDAudioCodecFFmpeg.cpp \
+ DVDAudioCodecPassthroughFFmpeg.cpp \
+ Encoders/DVDAudioEncoderFFmpeg.cpp \
+
+endif
LIB=Audio.a
View
7 xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
@@ -19,12 +19,15 @@
*
*/
+#include "system.h"
#include "DVDCodecUtils.h"
#include "DVDClock.h"
#include "cores/VideoRenderers/RenderManager.h"
#include "utils/log.h"
#include "utils/fastmemcpy.h"
+#if defined(HAS_FFMPEG)
#include "DllSwScale.h"
+#endif
// allocate a new picture (PIX_FMT_YUV420P)
DVDVideoPicture* CDVDCodecUtils::AllocatePicture(int iWidth, int iHeight)
@@ -220,6 +223,7 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToNV12Picture(DVDVideoPicture *pSrc)
DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *pSrc, DVDVideoPicture::EFormat format)
{
+#if defined(HAS_FFMPEG)
// Clone a YV12 picture to new YUY2 or UYVY picture.
DVDVideoPicture* pPicture = new DVDVideoPicture;
if (pPicture)
@@ -277,6 +281,9 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *p
}
}
return pPicture;
+#else
+ return NULL;
+#endif
}
bool CDVDCodecUtils::CopyNV12Picture(YV12Image* pImage, DVDVideoPicture *pSrc)
View
6 xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
@@ -21,9 +21,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
// enum CodecID
#include <string>
@@ -42,6 +40,7 @@ extern "C" {
#ifndef __GNUC__
#pragma warning(disable:4244)
#endif
+#if defined(HAS_FFMPEG)
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
#include <libavcodec/avcodec.h>
@@ -51,6 +50,7 @@ extern "C" {
#else
#include "libavcodec/avcodec.h"
#endif
+#endif
}
// 0x100000 is the video starting range
View
20 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -31,21 +31,25 @@
#if defined(HAVE_VIDEOTOOLBOXDECODER)
#include "Video/DVDVideoCodecVideoToolBox.h"
#endif
+#if defined(HAS_FFMPEG)
#include "Video/DVDVideoCodecFFmpeg.h"
+#include "Audio/DVDAudioCodecFFmpeg.h"
+#include "Overlay/DVDOverlayCodecFFmpeg.h"
+#include "Audio/DVDAudioCodecPassthroughFFmpeg.h"
+#else
+#include "FFMpegInternals.h"
+#endif
#include "Video/DVDVideoCodecOpenMax.h"
#include "Video/DVDVideoCodecLibMpeg2.h"
#if defined(HAVE_LIBCRYSTALHD)
#include "Video/DVDVideoCodecCrystalHD.h"
#endif
-#include "Audio/DVDAudioCodecFFmpeg.h"
#include "Audio/DVDAudioCodecLibMad.h"
#include "Audio/DVDAudioCodecPcm.h"
#include "Audio/DVDAudioCodecLPcm.h"
-#include "Audio/DVDAudioCodecPassthroughFFmpeg.h"
#include "Overlay/DVDOverlayCodecSSA.h"
#include "Overlay/DVDOverlayCodecText.h"
#include "Overlay/DVDOverlayCodecTX3G.h"
-#include "Overlay/DVDOverlayCodecFFmpeg.h"
#include "DVDStreamInfo.h"
@@ -250,10 +254,12 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
}
#endif
+#if defined(HAS_FFMPEG)
CStdString value;
value.Format("%d", surfaces);
options.push_back(CDVDCodecOption("surfaces", value));
if( (pCodec = OpenCodec(new CDVDVideoCodecFFmpeg(), hint, options)) ) return pCodec;
+#endif
return NULL;
}
@@ -265,8 +271,10 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
if (passthrough)
{
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec( new CDVDAudioCodecPassthroughFFmpeg(), hint, options);
if ( pCodec ) return pCodec;
+#endif
}
switch (hint.codec)
@@ -316,9 +324,10 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
break;
}
}
-
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec( new CDVDAudioCodecFFmpeg(), hint, options );
if( pCodec ) return pCodec;
+#endif
return NULL;
}
@@ -346,8 +355,11 @@ CDVDOverlayCodec* CDVDFactoryCodec::CreateOverlayCodec( CDVDStreamInfo &hint )
if( pCodec ) return pCodec;
default:
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec(new CDVDOverlayCodecFFmpeg(), hint, options);
if( pCodec ) return pCodec;
+#endif
+ return NULL;
}
return NULL;
View
6 xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
@@ -1,12 +1,16 @@
INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer \
SRCS= DVDOverlayCodecCC.cpp \
- DVDOverlayCodecFFmpeg.cpp \
DVDOverlayCodecSSA.cpp \
DVDOverlayCodecText.cpp \
DVDOverlayCodecTX3G.cpp \
libspucc/cc_decoder.c \
+ifeq (@USE_FFMPEG@,1)
+SRCS+= DVDOverlayCodecFFmpeg.cpp
+
+endif
+
LIB= Overlay.a
include @abs_top_srcdir@/Makefile.include
View
16 xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
@@ -37,9 +37,11 @@
#include "threads/Thread.h"
#include "utils/log.h"
#include "utils/fastmemcpy.h"
-#include "DllSwScale.h"
#include "utils/TimeUtils.h"
#include "windowing/WindowingFactory.h"
+#if defined(USE_FFMPEG)
+#include "lib/DllSwScale.h"
+#endif
namespace BCM
{
@@ -249,7 +251,9 @@ class CMPCOutputThread : public CThread
int m_aspectratio_x;
int m_aspectratio_y;
CEvent m_ready_event;
+#if defined(USE_FFMPEG)
DllSwScale *m_dllSwScale;
+#endif
struct SwsContext *m_sw_scale_ctx;
};
@@ -337,9 +341,11 @@ CMPCOutputThread::CMPCOutputThread(void *device, DllLibCrystalHD *dll, bool has_
m_framerate_timestamp(0.0),
m_framerate(0.0)
{
+#if defined(USE_FFMPEG)
m_sw_scale_ctx = NULL;
m_dllSwScale = new DllSwScale;
m_dllSwScale->Load();
+#endif
if (g_Windowing.GetRenderQuirks() & RENDER_QUIRKS_YV12_PREFERED)
@@ -354,10 +360,11 @@ CMPCOutputThread::~CMPCOutputThread()
delete m_ReadyList.Pop();
while(m_FreeList.Count())
delete m_FreeList.Pop();
-
+#if defined(USE_FFMPEG)
if (m_sw_scale_ctx)
m_dllSwScale->sws_freeContext(m_sw_scale_ctx);
delete m_dllSwScale;
+#endif
}
unsigned int CMPCOutputThread::GetReadyCount(void)
@@ -940,12 +947,15 @@ bool CMPCOutputThread::GetDecoderOutput(void)
int srcStride[] = { stride*2, 0, 0, 0 };
uint8_t* dst[] = { pBuffer->m_y_buffer_ptr, pBuffer->m_u_buffer_ptr, pBuffer->m_v_buffer_ptr, NULL };
int dstStride[] = { pBuffer->m_width, pBuffer->m_width/2, pBuffer->m_width/2, 0 };
-
+#if defined(USE_FFMPEG)
m_sw_scale_ctx = m_dllSwScale->sws_getCachedContext(m_sw_scale_ctx,
pBuffer->m_width, pBuffer->m_height, PIX_FMT_YUYV422,
pBuffer->m_width, pBuffer->m_height, PIX_FMT_YUV420P,
SWS_FAST_BILINEAR | SwScaleCPUFlags(), NULL, NULL, NULL);
m_dllSwScale->sws_scale(m_sw_scale_ctx, src, srcStride, 0, pBuffer->m_height, dst, dstStride);
+#else
+ return false;
+#endif
}
break;
default:
View
10 xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
@@ -1,8 +1,12 @@
INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer \
-SRCS= DVDVideoCodecFFmpeg.cpp \
- DVDVideoCodecLibMpeg2.cpp \
- DVDVideoPPFFmpeg.cpp \
+SRCS= DVDVideoCodecLibMpeg2.cpp \
+
+ifeq (@USE_FFMPEG@,1)
+SRCS+= DVDVideoCodecFFmpeg.cpp \
+ DVDVideoPPFFmpeg.cpp \
+
+endif
ifeq (@USE_VDPAU@,1)
SRCS+= VDPAU.cpp \
View
5 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
@@ -38,6 +38,7 @@ class CDVDInputStream;
enum CodecID;
#include <libavcodec/avcodec.h>
#else
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -49,8 +50,12 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif
#endif
+
#ifndef __GNUC__
#pragma warning(pop)
#endif
View
6 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
@@ -19,12 +19,11 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#include "DVDDemuxUtils.h"
#include "DVDClock.h"
#include "utils/log.h"
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -36,6 +35,7 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#endif
void CDVDDemuxUtils::FreeDemuxPacket(DemuxPacket* pPacket)
{
View
5 xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDDemuxVobsub.h"
#include "DVDInputStreams/DVDFactoryInputStream.h"
#include "DVDInputStreams/DVDInputStream.h"
@@ -48,6 +49,7 @@ CDVDDemuxVobsub::~CDVDDemuxVobsub()
bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename)
{
+#if defined(HAS_FFMPEG)
m_Filename = filename;
auto_ptr<CDVDSubtitleStream> pStream(new CDVDSubtitleStream());
@@ -143,6 +145,9 @@ bool CDVDDemuxVobsub::SeekTime(int time, bool backwords, double* startpts)
m_Timestamp--;
}
return true;
+#else
+ return false;
+#endif
}
DemuxPacket* CDVDDemuxVobsub::Read()
View
6 xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
@@ -25,7 +25,9 @@
#include "DVDInputStreams/DVDInputStream.h"
#include "DVDInputStreams/DVDInputStreamHttp.h"
+#if defined(HAS_FFMPEG)
#include "DVDDemuxFFmpeg.h"
+#endif
#include "DVDDemuxShoutcast.h"
#ifdef HAS_FILESYSTEM_HTSP
#include "DVDDemuxHTSP.h"
@@ -61,11 +63,13 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream)
return NULL;
}
#endif
-
+#if defined(HAS_FFMPEG)
auto_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg());
if(demuxer->Open(pInputStream))
return demuxer.release();
else
return NULL;
+#endif
+ return NULL;
}
View
8 xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
@@ -1,13 +1,17 @@
INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/dvdplayer
SRCS= DVDDemux.cpp \
- DVDDemuxFFmpeg.cpp \
DVDDemuxHTSP.cpp \
DVDDemuxShoutcast.cpp \
DVDDemuxUtils.cpp \
- DVDDemuxVobsub.cpp \
DVDFactoryDemuxer.cpp \
+ifeq (@USE_FFMPEG@,1)
+SRCS+= DVDDemuxFFmpeg.cpp \
+ DVDDemuxVobsub.cpp \
+
+endif
+
LIB= DVDDemuxers.a
include @abs_top_srcdir@/Makefile.include
View
14 xbmc/cores/dvdplayer/DVDFileInfo.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "threads/SystemClock.h"
#include "DVDFileInfo.h"
#include "FileItem.h"
@@ -40,14 +41,18 @@
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
+#if defined(HAS_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
+#include "DllAvCodec.h"
+#include "DllSwScale.h"
+#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
+#else
+#include "FFMpegInternals.h"
+#endif
#include "DVDCodecs/DVDCodecs.h"
#include "DVDCodecs/DVDFactoryCodec.h"
#include "DVDCodecs/Video/DVDVideoCodec.h"
-#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
-#include "DllAvCodec.h"
-#include "DllSwScale.h"
#include "filesystem/File.h"
@@ -76,6 +81,7 @@ bool CDVDFileInfo::GetFileDuration(const CStdString &path, int& duration)
bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails)
{
+#if defined(HAS_FFMPEG)
unsigned int nTime = XbmcThreads::SystemClockMillis();
CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, strPath, "");
if (!pInputStream)
@@ -257,6 +263,8 @@ bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
unsigned int nTotalTime = XbmcThreads::SystemClockMillis() - nTime;
CLog::Log(LOGDEBUG,"%s - measured %u ms to extract thumb from file <%s> ", __FUNCTION__, nTotalTime, strPath.c_str());
return bOk;
+#endif
+ return false;
}
/**
View
12 xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -33,7 +33,10 @@
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDDemuxVobsub.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
+#if defined(HAS_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
+#include "DllSwScale.h"
+#endif
#include "DVDCodecs/DVDCodecs.h"
#include "DVDCodecs/DVDFactoryCodec.h"
@@ -50,7 +53,6 @@
#include "DVDPerformanceCounter.h"
#include "filesystem/File.h"
#include "pictures/Picture.h"
-#include "DllSwScale.h"
#ifdef HAS_VIDEO_PLAYBACK
#include "cores/VideoRenderers/RenderManager.h"
#endif
@@ -2805,6 +2807,7 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source)
bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
{
+#if defined(HAS_FFMPEG)
CLog::Log(LOGNOTICE, "Opening Subtitle stream: %i source: %i", iStream, source);
CDemuxStream* pStream = NULL;
@@ -2897,6 +2900,8 @@ bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
m_CurrentSubtitle.started = false;
return true;
+#endif
+ return false;
}
bool CDVDPlayer::OpenTeletextStream(int iStream, int source)
@@ -3623,9 +3628,10 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
std::string vobsubfile = subfilename;
if(ext == ".idx")
{
+#if defined(HAS_FFMPEG)
if (vobsubfile.empty())
vobsubfile = URIUtils::ReplaceExtension(filename, ".sub");
-
+
CDVDDemuxVobsub v;
if(!v.Open(filename, vobsubfile))
return -1;
@@ -3640,6 +3646,8 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
CStdString strReplace(URIUtils::ReplaceExtension(filename,".idx"));
if (XFILE::CFile::Exists(strReplace))
return -1;
+#endif
+ return -1;
}
SelectionStream s;
s.source = m_SelectionStreams.Source(STREAM_SOURCE_TEXT, filename);
View
6 xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDPlayerTeletext.h"
#include "settings/Settings.h"
#include "DVDPlayer.h"
@@ -116,10 +117,12 @@ CDVDTeletextData::~CDVDTeletextData()
bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
{
+#if defined(HAS_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
return true;
#endif
+#endif
return false;
}
@@ -127,7 +130,7 @@ bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
bool CDVDTeletextData::OpenStream(CDVDStreamInfo &hints)
{
m_messageQueue.Init();
-
+#if defined(HAS_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
{
@@ -136,6 +139,7 @@ bool CDVDTeletextData::OpenStream(CDVDStreamInfo &hints)
return true;
}
#endif
+#endif
return false;
}
View
12 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -30,8 +30,10 @@
#include "DVDPlayerVideo.h"
#include "DVDCodecs/DVDFactoryCodec.h"
#include "DVDCodecs/DVDCodecUtils.h"
+#if defined(HAS_FFMPEG)
#include "DVDCodecs/Video/DVDVideoPPFFmpeg.h"
#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
+#endif
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "../../Util.h"
@@ -300,9 +302,11 @@ void CDVDPlayerVideo::Process()
DVDVideoPicture picture;
CPulldownCorrection pulldown;
+#if defined(HAS_FFMPEG)
CDVDVideoPPFFmpeg mPostProcess("");
CStdString sPostProcessType;
bool bPostProcessDeint = false;
+#endif
memset(&picture, 0, sizeof(DVDVideoPicture));
@@ -581,7 +585,9 @@ void CDVDPlayerVideo::Process()
m_pVideoCodec->ClearPicture(&picture);
if (m_pVideoCodec->GetPicture(&picture))
{
+#if defined(HAS_FFMPEG)
sPostProcessType.clear();
+#endif
picture.iGroupId = pPacket->iGroupId;
@@ -615,13 +621,15 @@ void CDVDPlayerVideo::Process()
{
if(mInt == VS_INTERLACEMETHOD_SW_BLEND)
{
+#if defined(HAS_FFMPEG)
if (!sPostProcessType.empty())
sPostProcessType += ",";
sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint;
bPostProcessDeint = true;
+#endif
}
}
-
+#if defined(HAS_FFMPEG)
if (g_settings.m_currentVideoSettings.m_PostProcess)
{
if (!sPostProcessType.empty())
@@ -636,7 +644,7 @@ void CDVDPlayerVideo::Process()
if (mPostProcess.Process(&picture))
mPostProcess.GetPicture(&picture);
}
-
+#endif
/* if frame has a pts (usually originiating from demux packet), use that */
if(picture.pts != DVD_NOPTS_VALUE)
{
View
8 xbmc/cores/dvdplayer/DVDStreamInfo.h
@@ -21,14 +21,13 @@
#pragma once
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#ifndef _LINUX
enum StreamType;
enum CodecID;
#else
#include "DVDDemuxers/DVDDemux.h"
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -40,6 +39,9 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif
#endif
class CDemuxStream;
View
342 xbmc/cores/dvdplayer/FFMpegInternals.h
@@ -0,0 +1,342 @@
+#pragma once
+/*
+
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+/*This file is one big hack. It was added because we use FFMpeg codec IDs
+ internally, so we cannot compile dvdplayer without ffmpeg includes. */
+
+enum CodecID {
+ CODEC_ID_NONE,
+
+ /* video codecs */
+ CODEC_ID_MPEG1VIDEO,
+ CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+ CODEC_ID_MPEG2VIDEO_XVMC,
+ CODEC_ID_H261,
+ CODEC_ID_H263,
+ CODEC_ID_RV10,
+ CODEC_ID_RV20,
+ CODEC_ID_MJPEG,
+ CODEC_ID_MJPEGB,
+ CODEC_ID_LJPEG,
+ CODEC_ID_SP5X,
+ CODEC_ID_JPEGLS,
+ CODEC_ID_MPEG4,
+ CODEC_ID_RAWVIDEO,
+ CODEC_ID_MSMPEG4V1,
+ CODEC_ID_MSMPEG4V2,
+ CODEC_ID_MSMPEG4V3,
+ CODEC_ID_WMV1,
+ CODEC_ID_WMV2,
+ CODEC_ID_H263P,
+ CODEC_ID_H263I,
+ CODEC_ID_FLV1,
+ CODEC_ID_SVQ1,
+ CODEC_ID_SVQ3,
+ CODEC_ID_DVVIDEO,
+ CODEC_ID_HUFFYUV,
+ CODEC_ID_CYUV,
+ CODEC_ID_H264,
+ CODEC_ID_INDEO3,
+ CODEC_ID_VP3,
+ CODEC_ID_THEORA,
+ CODEC_ID_ASV1,
+ CODEC_ID_ASV2,
+ CODEC_ID_FFV1,
+ CODEC_ID_4XM,
+ CODEC_ID_VCR1,
+ CODEC_ID_CLJR,
+ CODEC_ID_MDEC,
+ CODEC_ID_ROQ,
+ CODEC_ID_INTERPLAY_VIDEO,
+ CODEC_ID_XAN_WC3,
+ CODEC_ID_XAN_WC4,
+ CODEC_ID_RPZA,
+ CODEC_ID_CINEPAK,
+ CODEC_ID_WS_VQA,
+ CODEC_ID_MSRLE,
+ CODEC_ID_MSVIDEO1,
+ CODEC_ID_IDCIN,
+ CODEC_ID_8BPS,
+ CODEC_ID_SMC,
+ CODEC_ID_FLIC,
+ CODEC_ID_TRUEMOTION1,
+ CODEC_ID_VMDVIDEO,
+ CODEC_ID_MSZH,
+ CODEC_ID_ZLIB,
+ CODEC_ID_QTRLE,
+ CODEC_ID_SNOW,
+ CODEC_ID_TSCC,
+ CODEC_ID_ULTI,
+ CODEC_ID_QDRAW,
+ CODEC_ID_VIXL,
+ CODEC_ID_QPEG,
+#if LIBAVCODEC_VERSION_MAJOR < 53
+ CODEC_ID_XVID,
+#endif
+ CODEC_ID_PNG,
+ CODEC_ID_PPM,
+ CODEC_ID_PBM,
+ CODEC_ID_PGM,
+ CODEC_ID_PGMYUV,
+ CODEC_ID_PAM,
+ CODEC_ID_FFVHUFF,
+ CODEC_ID_RV30,
+ CODEC_ID_RV40,
+ CODEC_ID_VC1,
+ CODEC_ID_WMV3,
+ CODEC_ID_LOCO,
+ CODEC_ID_WNV1,
+ CODEC_ID_AASC,
+ CODEC_ID_INDEO2,
+ CODEC_ID_FRAPS,
+ CODEC_ID_TRUEMOTION2,
+ CODEC_ID_BMP,
+ CODEC_ID_CSCD,
+ CODEC_ID_MMVIDEO,
+ CODEC_ID_ZMBV,
+ CODEC_ID_AVS,
+ CODEC_ID_SMACKVIDEO,
+ CODEC_ID_NUV,
+ CODEC_ID_KMVC,
+ CODEC_ID_FLASHSV,
+ CODEC_ID_CAVS,
+ CODEC_ID_JPEG2000,
+ CODEC_ID_VMNC,
+ CODEC_ID_VP5,
+ CODEC_ID_VP6,
+ CODEC_ID_VP6F,
+ CODEC_ID_TARGA,
+ CODEC_ID_DSICINVIDEO,
+ CODEC_ID_TIERTEXSEQVIDEO,
+ CODEC_ID_TIFF,
+ CODEC_ID_GIF,
+ CODEC_ID_FFH264,
+ CODEC_ID_DXA,
+ CODEC_ID_DNXHD,
+ CODEC_ID_THP,
+ CODEC_ID_SGI,
+ CODEC_ID_C93,
+ CODEC_ID_BETHSOFTVID,
+ CODEC_ID_PTX,
+ CODEC_ID_TXD,
+ CODEC_ID_VP6A,
+ CODEC_ID_AMV,
+ CODEC_ID_VB,
+ CODEC_ID_PCX,
+ CODEC_ID_SUNRAST,
+ CODEC_ID_INDEO4,
+ CODEC_ID_INDEO5,
+ CODEC_ID_MIMIC,
+ CODEC_ID_RL2,
+ CODEC_ID_8SVX_EXP,
+ CODEC_ID_8SVX_FIB,
+ CODEC_ID_ESCAPE124,
+ CODEC_ID_DIRAC,
+ CODEC_ID_BFI,
+ CODEC_ID_CMV,
+ CODEC_ID_MOTIONPIXELS,
+ CODEC_ID_TGV,
+ CODEC_ID_TGQ,
+ CODEC_ID_TQI,
+ CODEC_ID_AURA,
+ CODEC_ID_AURA2,
+ CODEC_ID_V210X,
+ CODEC_ID_TMV,
+ CODEC_ID_V210,
+ CODEC_ID_DPX,
+ CODEC_ID_MAD,
+ CODEC_ID_FRWU,
+ CODEC_ID_FLASHSV2,
+ CODEC_ID_CDGRAPHICS,
+ CODEC_ID_R210,
+ CODEC_ID_ANM,
+ CODEC_ID_BINKVIDEO,
+ CODEC_ID_IFF_ILBM,
+ CODEC_ID_IFF_BYTERUN1,
+ CODEC_ID_KGV1,
+ CODEC_ID_YOP,
+ CODEC_ID_VP8,
+ CODEC_ID_PICTOR,
+ CODEC_ID_ANSI,
+ CODEC_ID_A64_MULTI,
+ CODEC_ID_A64_MULTI5,
+ CODEC_ID_R10K,
+ CODEC_ID_MXPEG,
+ CODEC_ID_LAGARITH,
+
+ /* various PCM "codecs" */
+ CODEC_ID_PCM_S16LE= 0x10000,
+ CODEC_ID_PCM_S16BE,
+ CODEC_ID_PCM_U16LE,
+ CODEC_ID_PCM_U16BE,
+ CODEC_ID_PCM_S8,
+ CODEC_ID_PCM_U8,
+ CODEC_ID_PCM_MULAW,
+ CODEC_ID_PCM_ALAW,
+ CODEC_ID_PCM_S32LE,
+ CODEC_ID_PCM_S32BE,
+ CODEC_ID_PCM_U32LE,
+ CODEC_ID_PCM_U32BE,
+ CODEC_ID_PCM_S24LE,
+ CODEC_ID_PCM_S24BE,
+ CODEC_ID_PCM_U24LE,
+ CODEC_ID_PCM_U24BE,
+ CODEC_ID_PCM_S24DAUD,
+ CODEC_ID_PCM_ZORK,
+ CODEC_ID_PCM_S16LE_PLANAR,
+ CODEC_ID_PCM_DVD,
+ CODEC_ID_PCM_F32BE,
+ CODEC_ID_PCM_F32LE,
+ CODEC_ID_PCM_F64BE,
+ CODEC_ID_PCM_F64LE,
+ CODEC_ID_PCM_BLURAY,
+ CODEC_ID_PCM_LXF,
+
+ /* various ADPCM codecs */
+ CODEC_ID_ADPCM_IMA_QT= 0x11000,
+ CODEC_ID_ADPCM_IMA_WAV,
+ CODEC_ID_ADPCM_IMA_DK3,
+ CODEC_ID_ADPCM_IMA_DK4,
+ CODEC_ID_ADPCM_IMA_WS,
+ CODEC_ID_ADPCM_IMA_SMJPEG,
+ CODEC_ID_ADPCM_MS,
+ CODEC_ID_ADPCM_4XM,
+ CODEC_ID_ADPCM_XA,
+ CODEC_ID_ADPCM_ADX,
+ CODEC_ID_ADPCM_EA,
+ CODEC_ID_ADPCM_G726,
+ CODEC_ID_ADPCM_CT,
+ CODEC_ID_ADPCM_SWF,
+ CODEC_ID_ADPCM_YAMAHA,
+ CODEC_ID_ADPCM_SBPRO_4,
+ CODEC_ID_ADPCM_SBPRO_3,
+ CODEC_ID_ADPCM_SBPRO_2,
+ CODEC_ID_ADPCM_THP,
+ CODEC_ID_ADPCM_IMA_AMV,
+ CODEC_ID_ADPCM_EA_R1,
+ CODEC_ID_ADPCM_EA_R3,
+ CODEC_ID_ADPCM_EA_R2,
+ CODEC_ID_ADPCM_IMA_EA_SEAD,
+ CODEC_ID_ADPCM_IMA_EA_EACS,
+ CODEC_ID_ADPCM_EA_XAS,
+ CODEC_ID_ADPCM_EA_MAXIS_XA,
+ CODEC_ID_ADPCM_IMA_ISS,
+ CODEC_ID_ADPCM_G722,
+
+ /* AMR */
+ CODEC_ID_AMR_NB= 0x12000,
+ CODEC_ID_AMR_WB,
+
+ /* RealAudio codecs*/
+ CODEC_ID_RA_144= 0x13000,
+ CODEC_ID_RA_288,
+
+ /* various DPCM codecs */
+ CODEC_ID_ROQ_DPCM= 0x14000,
+ CODEC_ID_INTERPLAY_DPCM,
+ CODEC_ID_XAN_DPCM,
+ CODEC_ID_SOL_DPCM,
+
+ /* audio codecs */
+ CODEC_ID_MP2= 0x15000,
+ CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+ CODEC_ID_AAC,
+ CODEC_ID_AC3,
+ CODEC_ID_DTS,
+ CODEC_ID_VORBIS,
+ CODEC_ID_DVAUDIO,
+ CODEC_ID_WMAV1,
+ CODEC_ID_WMAV2,
+ CODEC_ID_MACE3,
+ CODEC_ID_MACE6,
+ CODEC_ID_VMDAUDIO,
+ CODEC_ID_SONIC,
+ CODEC_ID_SONIC_LS,
+ CODEC_ID_FLAC,
+ CODEC_ID_MP3ADU,
+ CODEC_ID_MP3ON4,
+ CODEC_ID_SHORTEN,
+ CODEC_ID_ALAC,
+ CODEC_ID_WESTWOOD_SND1,
+ CODEC_ID_GSM, ///< as in Berlin toast format
+ CODEC_ID_QDM2,
+ CODEC_ID_COOK,
+ CODEC_ID_TRUESPEECH,
+ CODEC_ID_TTA,
+ CODEC_ID_SMACKAUDIO,
+ CODEC_ID_QCELP,
+ CODEC_ID_WAVPACK,
+ CODEC_ID_DSICINAUDIO,
+ CODEC_ID_IMC,
+ CODEC_ID_MUSEPACK7,
+ CODEC_ID_MLP,
+ CODEC_ID_GSM_MS, /* as found in WAV */
+ CODEC_ID_ATRAC3,
+ CODEC_ID_VOXWARE,
+ CODEC_ID_APE,
+ CODEC_ID_NELLYMOSER,
+ CODEC_ID_MUSEPACK8,
+ CODEC_ID_SPEEX,
+ CODEC_ID_WMAVOICE,
+ CODEC_ID_WMAPRO,
+ CODEC_ID_WMALOSSLESS,
+ CODEC_ID_ATRAC3P,
+ CODEC_ID_EAC3,
+ CODEC_ID_SIPR,
+ CODEC_ID_MP1,
+ CODEC_ID_TWINVQ,
+ CODEC_ID_TRUEHD,
+ CODEC_ID_MP4ALS,
+ CODEC_ID_ATRAC1,
+ CODEC_ID_BINKAUDIO_RDFT,
+ CODEC_ID_BINKAUDIO_DCT,
+ CODEC_ID_AAC_LATM,
+
+ /* subtitle codecs */
+ CODEC_ID_DVD_SUBTITLE= 0x17000,
+ CODEC_ID_DVB_SUBTITLE,
+ CODEC_ID_TEXT, ///< raw UTF-8 text
+ CODEC_ID_XSUB,
+ CODEC_ID_SSA,
+ CODEC_ID_MOV_TEXT,
+ CODEC_ID_HDMV_PGS_SUBTITLE,
+ CODEC_ID_DVB_TELETEXT,
+ CODEC_ID_SRT,
+
+ /* data codecs */
+ CODEC_ID_VBI_DATA= 0x17500,
+ CODEC_ID_VBI_TELETEXT,
+
+ /* other specific kind of codecs (generally used for attachments) */
+ CODEC_ID_TTF= 0x18000,
+
+ CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+
+ CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+ * stream (only used by libavformat) */
+ CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information.
+};
+enum AVDiscard{AVDISCARD_NONE=-16,AVDISCARD_ALL=48};
+#define FF_PROFILE_UNKNOWN -99
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
View
0  xbmc/music/tags/Makefile → xbmc/music/tags/Makefile.in
File renamed without changes
View
9 xbmc/pictures/Picture.cpp
@@ -19,6 +19,7 @@
*
*/
+#include <math.h>
#include "Picture.h"
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
@@ -28,8 +29,10 @@
#include "DllImageLib.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
-#include "DllSwScale.h"
#include "guilib/Texture.h"
+#if defined(USE_FFMPEG)
+#include "lib/DllSwScale.h"
+#endif
using namespace XFILE;
@@ -271,6 +274,7 @@ void CPicture::GetScale(unsigned int width, unsigned int height, unsigned int &o
bool CPicture::ScaleImage(uint8_t *in_pixels, unsigned int in_width, unsigned int in_height, unsigned int in_pitch,
uint8_t *out_pixels, unsigned int out_width, unsigned int out_height, unsigned int out_pitch)
{
+#if defined(USE_FFMPEG)
DllSwScale dllSwScale;
dllSwScale.Load();
struct SwsContext *context = dllSwScale.sws_getContext(in_width, in_height, PIX_FMT_BGRA,
@@ -289,6 +293,9 @@ bool CPicture::ScaleImage(uint8_t *in_pixels, unsigned int in_width, unsigned in
return true;
}
return false;
+#else
+ return false;
+#endif
}
bool CPicture::OrientateImage(uint32_t *&pixels, unsigned int &width, unsigned int &height, int orientation)
View
5 xbmc/system.h
@@ -80,6 +80,11 @@
#define HAS_AIRTUNES
#endif
+#ifdef HAVE_FFMPEG
+ #define HAS_FFMPEG
+#endif
+
+
/**********************
* Non-free Components
**********************/
Please sign in to comment.
Something went wrong with that request. Please try again.