Skip to content

Commit 28cd7a1

Browse files
committed
first step to build against an external libmpeg2
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
1 parent 4056fb1 commit 28cd7a1

File tree

7 files changed

+47
-13
lines changed

7 files changed

+47
-13
lines changed

mythtv/configure

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ MYTHTV_CONFIG_LIST='
12901290
ivtv
12911291
joystick_menu
12921292
libfftw3
1293+
libmpeg2external
12931294
lirc
12941295
mheg
12951296
opengl_video
@@ -1338,6 +1339,7 @@ USING_LIST='
13381339
bindings_python
13391340
darwin_da
13401341
dvdv
1342+
mythtranscode
13411343
opengl
13421344
vdpau
13431345
'
@@ -1673,6 +1675,7 @@ ivtv_deps="backend v4l"
16731675
hdpvr_deps="backend v4l"
16741676
hdhomerun_deps="backend"
16751677
mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
1678+
mythtranscode="backend frontend"
16761679
opengl_deps_any="agl_h GL_gl_h darwin windows x11"
16771680
opengl_video_deps="opengl"
16781681
opengl_vsync_deps="opengl"
@@ -2903,6 +2906,7 @@ EOF
29032906
disable dv1394
29042907
disable dvb
29052908
enable memalign_hack
2909+
disable mythtranscode
29062910
disable network
29072911
enable opengl
29082912
if enabled wince; then
@@ -3487,6 +3491,14 @@ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm &&
34873491
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
34883492
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
34893493

3494+
if enabled libmpeg2external; then
3495+
check_lib mpeg2dec/mpeg2.h mpeg2_init -lmpeg2 || disable libmpeg2external
3496+
if disabled libmpeg2external; then
3497+
die "Warning! No suiteable external libmpeg2 found, use internal copy."
3498+
fi
3499+
disable mythtranscode
3500+
fi
3501+
34903502
# libdc1394 check
34913503
if enabled libdc1394; then
34923504
{ check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&

mythtv/libs/libmythtv/avformatdecoder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ extern "C" {
5656
extern const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
5757
#include "avio.h"
5858
#include "libswscale/swscale.h"
59+
#if CONFIG_LIBMPEG2EXTERNAL
60+
#include <mpeg2dec/mpeg2.h>
61+
#else
5962
#include "../libmythmpeg2/mpeg2.h"
63+
#endif
6064
#include "ivtv_myth.h"
6165
}
6266

@@ -392,7 +396,11 @@ int AvFormatDecoderPrivate::DecodeMPEG2Video(AVCodecContext *avctx,
392396
PIC_FLAG_PROGRESSIVE_FRAME);
393397
frm->repeat_pict =
394398
!!(info->display_picture->flags &
399+
#if CONFIG_LIBMPEG2EXTERNAL
400+
PIC_FLAG_REPEAT_FIRST_FIELD);
401+
#else
395402
PIC_FLAG_REPEAT_FIELD);
403+
#endif
396404
partialFrames.enqueue(frm);
397405

398406
}

mythtv/libs/libmythtv/libmythtv.pro

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contains(INCLUDEPATH, /usr/local/include) {
2121

2222
DEPENDPATH += .
2323
DEPENDPATH += ../libmyth ../libavcodec ../libavformat ../libavutil ../libswscale
24-
DEPENDPATH += ../libmythmpeg2 ../libmythdb ../libmythhdhomerun
24+
DEPENDPATH += ../libmythdb ../libmythhdhomerun
2525
DEPENDPATH += ../libmythdvdnav/
2626
DEPENDPATH += ../libmythbluray/
2727
DEPENDPATH += ./dvbdev ./mpeg ./iptv ./channelscan
@@ -42,25 +42,30 @@ INCLUDEPATH += $$POSTINC
4242
LIBS += -L../libmyth -L../libavutil -L../libavcodec -L../libavformat
4343
LIBS += -L../libswscale
4444
LIBS += -L../libmythui -L../libmythupnp
45-
LIBS += -L../libmythmpeg2 -L../libmythdvdnav -L../libmythbluray
45+
LIBS += -L../libmythdvdnav
46+
LIBS += -L../libmythbluray
4647
LIBS += -L../libmythdb
4748
LIBS += -lmyth-$$LIBVERSION -lmythavutil-$$LIBVERSION
4849
LIBS += -lmythavcodec-$$LIBVERSION -lmythavformat-$$LIBVERSION
4950
LIBS += -lmythswscale-$$LIBVERSION
5051
LIBS += -lmythui-$$LIBVERSION -lmythupnp-$$LIBVERSION
51-
LIBS += -lmythmpeg2-$$LIBVERSION -lmythdvdnav-$$LIBVERSION
52+
LIBS += -lmythdvdnav-$$LIBVERSION
5253
LIBS += -lmythbluray-$$LIBVERSION -lmythdb-$$LIBVERSION
5354
using_mheg: LIBS += -L../libmythfreemheg -lmythfreemheg-$$LIBVERSION
5455
using_live: LIBS += -L../libmythlivemedia -lmythlivemedia-$$LIBVERSION
5556
using_hdhomerun: LIBS += -L../libmythhdhomerun -lmythhdhomerun-$$LIBVERSION
5657
using_backend: LIBS += -lmp3lame
5758
LIBS += $$EXTRA_LIBS $$QMAKE_LIBS_DYNLOAD
59+
!contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
60+
DEPENDPATH += ../libmythmpeg2
61+
LIBS += -L../libmythmpeg2 -lmythmpeg2-$$LIBVERSION
62+
TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT}
63+
}
5864

5965
TARGETDEPS += ../libmyth/libmyth-$${MYTH_SHLIB_EXT}
6066
TARGETDEPS += ../libavutil/libmythavutil-$${MYTH_SHLIB_EXT}
6167
TARGETDEPS += ../libavcodec/libmythavcodec-$${MYTH_SHLIB_EXT}
6268
TARGETDEPS += ../libavformat/libmythavformat-$${MYTH_SHLIB_EXT}
63-
TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT}
6469
TARGETDEPS += ../libmythdvdnav/libmythdvdnav-$${MYTH_LIB_EXT}
6570
TARGETDEPS += ../libmythbluray/libmythbluray-$${MYTH_LIB_EXT}
6671
using_mheg: TARGETDEPS += ../libmythfreemheg/libmythfreemheg-$${MYTH_SHLIB_EXT}

mythtv/libs/libs.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ TEMPLATE = subdirs
44

55
# Libraries without dependencies
66
SUBDIRS += libavutil libmythsamplerate
7-
SUBDIRS += libmythsoundtouch libmythmpeg2 libmythdvdnav
7+
SUBDIRS += libmythsoundtouch libmythdvdnav
88
SUBDIRS += libmythbluray libmythfreesurround libmythdb
99

1010
using_mheg:SUBDIRS += libmythfreemheg
1111
using_live:SUBDIRS += libmythlivemedia
1212
using_hdhomerun:SUBDIRS += libmythhdhomerun
1313
using_x11:SUBDIRS += libmythnvctrl
14+
!contains( CONFIG_LIBMPEG2EXTERNAL, yes):SUBDIRS += libmythmpeg2
1415

1516
# Libraries with dependencies
1617
SUBDIRS += libmythui libmyth libmythupnp libmythtv libavcodec libavformat libswscale

mythtv/programs/mythtranscode/mpeg2fix.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ extern "C"
1515
#include "replex/multiplex.h"
1616

1717
//libmpeg2
18+
#include "config.h"
19+
#if CONFIG_LIBMPEG2EXTERNAL
20+
#include <mpeg2dec/mpeg2.h>
21+
#else
1822
#include "mpeg2.h"
23+
#endif
1924
}
2025

2126
//Qt

mythtv/programs/mythtranscode/mythtranscode.pro

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,11 @@ HEADERS += replex/element.h replex/mpg_common.h replex/multiplex.h \
1919
replex/pes.h replex/ringbuffer.h replex/ts.h
2020

2121
INCLUDEPATH += replex
22-
INCLUDEPATH += ../../libs/libavcodec ../../libs/libavformat \
23-
../../libs/libavutil ../../libs/ ../../libs/libmythmpeg2
22+
INCLUDEPATH += ../../libs/libavcodec
23+
INCLUDEPATH += ../../libs/libavformat
24+
INCLUDEPATH += ../../libs/libavutil
25+
INCLUDEPATH += ../../libs/
26+
27+
!contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
28+
INCLUDEPATH += ../../libs/libmythmpeg2
29+
}

mythtv/programs/programs.pro

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ TEMPLATE = subdirs
66
using_frontend {
77
SUBDIRS += mythavtest mythfrontend mythcommflag
88
SUBDIRS += mythtvosd mythjobqueue mythlcdserver
9-
SUBDIRS += mythwelcome mythshutdown mythtranscode/replex
9+
SUBDIRS += mythwelcome mythshutdown
1010
SUBDIRS += mythpreviewgen
11+
!mingw: SUBDIRS += mythtranscode/replex
1112
}
1213

1314
using_backend {
1415
SUBDIRS += mythbackend mythfilldatabase mythtv-setup scripts
1516
}
1617

17-
using_frontend:using_backend {
18-
SUBDIRS += mythtranscode
19-
}
20-
21-
mingw: SUBDIRS -= mythtranscode mythtranscode/replex
18+
using_mythtranscode: SUBDIRS += mythtranscode

0 commit comments

Comments
 (0)