Skip to content

Commit

Permalink
first step to build against an external libmpeg2
Browse files Browse the repository at this point in the history
This at the moment fully unsupported. The lossless MPEG2 transcoder
depends on an internal libmpeg2 header to copy the quantizer matrix.

git-svn-id: http://svn.mythtv.org/svn/trunk@25461 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
jannau committed Jul 28, 2010
1 parent 4056fb1 commit 28cd7a1
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 13 deletions.
12 changes: 12 additions & 0 deletions mythtv/configure
Expand Up @@ -1290,6 +1290,7 @@ MYTHTV_CONFIG_LIST='
ivtv
joystick_menu
libfftw3
libmpeg2external
lirc
mheg
opengl_video
Expand Down Expand Up @@ -1338,6 +1339,7 @@ USING_LIST='
bindings_python
darwin_da
dvdv
mythtranscode
opengl
vdpau
'
Expand Down Expand Up @@ -1673,6 +1675,7 @@ ivtv_deps="backend v4l"
hdpvr_deps="backend v4l"
hdhomerun_deps="backend"
mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
mythtranscode="backend frontend"
opengl_deps_any="agl_h GL_gl_h darwin windows x11"
opengl_video_deps="opengl"
opengl_vsync_deps="opengl"
Expand Down Expand Up @@ -2903,6 +2906,7 @@ EOF
disable dv1394
disable dvb
enable memalign_hack
disable mythtranscode
disable network
enable opengl
if enabled wince; then
Expand Down Expand Up @@ -3487,6 +3491,14 @@ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib

if enabled libmpeg2external; then
check_lib mpeg2dec/mpeg2.h mpeg2_init -lmpeg2 || disable libmpeg2external
if disabled libmpeg2external; then
die "Warning! No suiteable external libmpeg2 found, use internal copy."
fi
disable mythtranscode
fi

# libdc1394 check
if enabled libdc1394; then
{ check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
Expand Down
8 changes: 8 additions & 0 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -56,7 +56,11 @@ extern "C" {
extern const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
#include "avio.h"
#include "libswscale/swscale.h"
#if CONFIG_LIBMPEG2EXTERNAL
#include <mpeg2dec/mpeg2.h>
#else
#include "../libmythmpeg2/mpeg2.h"
#endif
#include "ivtv_myth.h"
}

Expand Down Expand Up @@ -392,7 +396,11 @@ int AvFormatDecoderPrivate::DecodeMPEG2Video(AVCodecContext *avctx,
PIC_FLAG_PROGRESSIVE_FRAME);
frm->repeat_pict =
!!(info->display_picture->flags &
#if CONFIG_LIBMPEG2EXTERNAL
PIC_FLAG_REPEAT_FIRST_FIELD);
#else
PIC_FLAG_REPEAT_FIELD);
#endif
partialFrames.enqueue(frm);

}
Expand Down
13 changes: 9 additions & 4 deletions mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -21,7 +21,7 @@ contains(INCLUDEPATH, /usr/local/include) {

DEPENDPATH += .
DEPENDPATH += ../libmyth ../libavcodec ../libavformat ../libavutil ../libswscale
DEPENDPATH += ../libmythmpeg2 ../libmythdb ../libmythhdhomerun
DEPENDPATH += ../libmythdb ../libmythhdhomerun
DEPENDPATH += ../libmythdvdnav/
DEPENDPATH += ../libmythbluray/
DEPENDPATH += ./dvbdev ./mpeg ./iptv ./channelscan
Expand All @@ -42,25 +42,30 @@ INCLUDEPATH += $$POSTINC
LIBS += -L../libmyth -L../libavutil -L../libavcodec -L../libavformat
LIBS += -L../libswscale
LIBS += -L../libmythui -L../libmythupnp
LIBS += -L../libmythmpeg2 -L../libmythdvdnav -L../libmythbluray
LIBS += -L../libmythdvdnav
LIBS += -L../libmythbluray
LIBS += -L../libmythdb
LIBS += -lmyth-$$LIBVERSION -lmythavutil-$$LIBVERSION
LIBS += -lmythavcodec-$$LIBVERSION -lmythavformat-$$LIBVERSION
LIBS += -lmythswscale-$$LIBVERSION
LIBS += -lmythui-$$LIBVERSION -lmythupnp-$$LIBVERSION
LIBS += -lmythmpeg2-$$LIBVERSION -lmythdvdnav-$$LIBVERSION
LIBS += -lmythdvdnav-$$LIBVERSION
LIBS += -lmythbluray-$$LIBVERSION -lmythdb-$$LIBVERSION
using_mheg: LIBS += -L../libmythfreemheg -lmythfreemheg-$$LIBVERSION
using_live: LIBS += -L../libmythlivemedia -lmythlivemedia-$$LIBVERSION
using_hdhomerun: LIBS += -L../libmythhdhomerun -lmythhdhomerun-$$LIBVERSION
using_backend: LIBS += -lmp3lame
LIBS += $$EXTRA_LIBS $$QMAKE_LIBS_DYNLOAD
!contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
DEPENDPATH += ../libmythmpeg2
LIBS += -L../libmythmpeg2 -lmythmpeg2-$$LIBVERSION
TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT}
}

TARGETDEPS += ../libmyth/libmyth-$${MYTH_SHLIB_EXT}
TARGETDEPS += ../libavutil/libmythavutil-$${MYTH_SHLIB_EXT}
TARGETDEPS += ../libavcodec/libmythavcodec-$${MYTH_SHLIB_EXT}
TARGETDEPS += ../libavformat/libmythavformat-$${MYTH_SHLIB_EXT}
TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT}
TARGETDEPS += ../libmythdvdnav/libmythdvdnav-$${MYTH_LIB_EXT}
TARGETDEPS += ../libmythbluray/libmythbluray-$${MYTH_LIB_EXT}
using_mheg: TARGETDEPS += ../libmythfreemheg/libmythfreemheg-$${MYTH_SHLIB_EXT}
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libs.pro
Expand Up @@ -4,13 +4,14 @@ TEMPLATE = subdirs

# Libraries without dependencies
SUBDIRS += libavutil libmythsamplerate
SUBDIRS += libmythsoundtouch libmythmpeg2 libmythdvdnav
SUBDIRS += libmythsoundtouch libmythdvdnav
SUBDIRS += libmythbluray libmythfreesurround libmythdb

using_mheg:SUBDIRS += libmythfreemheg
using_live:SUBDIRS += libmythlivemedia
using_hdhomerun:SUBDIRS += libmythhdhomerun
using_x11:SUBDIRS += libmythnvctrl
!contains( CONFIG_LIBMPEG2EXTERNAL, yes):SUBDIRS += libmythmpeg2

# Libraries with dependencies
SUBDIRS += libmythui libmyth libmythupnp libmythtv libavcodec libavformat libswscale
Expand Down
5 changes: 5 additions & 0 deletions mythtv/programs/mythtranscode/mpeg2fix.h
Expand Up @@ -15,7 +15,12 @@ extern "C"
#include "replex/multiplex.h"

//libmpeg2
#include "config.h"
#if CONFIG_LIBMPEG2EXTERNAL
#include <mpeg2dec/mpeg2.h>
#else
#include "mpeg2.h"
#endif
}

//Qt
Expand Down
10 changes: 8 additions & 2 deletions mythtv/programs/mythtranscode/mythtranscode.pro
Expand Up @@ -19,5 +19,11 @@ HEADERS += replex/element.h replex/mpg_common.h replex/multiplex.h \
replex/pes.h replex/ringbuffer.h replex/ts.h

INCLUDEPATH += replex
INCLUDEPATH += ../../libs/libavcodec ../../libs/libavformat \
../../libs/libavutil ../../libs/ ../../libs/libmythmpeg2
INCLUDEPATH += ../../libs/libavcodec
INCLUDEPATH += ../../libs/libavformat
INCLUDEPATH += ../../libs/libavutil
INCLUDEPATH += ../../libs/

!contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
INCLUDEPATH += ../../libs/libmythmpeg2
}
9 changes: 3 additions & 6 deletions mythtv/programs/programs.pro
Expand Up @@ -6,16 +6,13 @@ TEMPLATE = subdirs
using_frontend {
SUBDIRS += mythavtest mythfrontend mythcommflag
SUBDIRS += mythtvosd mythjobqueue mythlcdserver
SUBDIRS += mythwelcome mythshutdown mythtranscode/replex
SUBDIRS += mythwelcome mythshutdown
SUBDIRS += mythpreviewgen
!mingw: SUBDIRS += mythtranscode/replex
}

using_backend {
SUBDIRS += mythbackend mythfilldatabase mythtv-setup scripts
}

using_frontend:using_backend {
SUBDIRS += mythtranscode
}

mingw: SUBDIRS -= mythtranscode mythtranscode/replex
using_mythtranscode: SUBDIRS += mythtranscode

0 comments on commit 28cd7a1

Please sign in to comment.