Skip to content

Commit 9c3564a

Browse files
author
Mark Kendall
committed
Add CrystalHD hardware video decoder support.
- H.264, MPEG-2 and MPEG-4 support is enabled. - VC1 support is currently disabled. - Tested using the BCM70015 model. There will need to be some adjustments for earlier models - notably in buffer alignment. - the occasional H.264 file will fail initial tests but this should be pretty rare. In these cases we fall back to software decoding. - CC608/708 caption data is not passed through by the decoder though the code is there if this is enabled at a later point. - some MPEG-2 streams have a nasty timestamp/picture ordering issue and certain files still have a/v sync problems. - bluray playback has the occasional strange chroma/ghosting problem which appears to be driver and/or hardware related. av sync is also problematic with bluray streams. The configure script changes will also need some tweaking. They currently only test for the correct header and library but will also need to do some version checking. If I can fix the MPEG-2 issue I will look at enabling hardware accelerated support for commflagging and/or transcoding. git-svn-id: http://svn.mythtv.org/svn/trunk@25857 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent f2da5cd commit 9c3564a

12 files changed

+874
-1
lines changed

mythtv/configure

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Advanced options (experts only):
128128
--enable-xvmc-vld enable XvMC VLD accel. for the Unichrome (Pro) chipset
129129
--xvmc-lib=LIB XvMC library override (for crosscompiling)
130130
--enable-vdpau enable NVidia VDPAU hardware acceleration.
131+
--enable-crystalhd enable Broadcom CrystalHD hardware decoder support
131132
--disable-opengl-video disable OpenGL based video display
132133
--disable-quartz-video disable Mac OS X CoreVideo based video display
133134
--disable-opengl-vsync disable OpenGL vsync method
@@ -1280,6 +1281,7 @@ CONFIG_EXTRA="
12801281

12811282
MYTHTV_CONFIG_LIST='
12821283
backend
1284+
crystalhd
12831285
cygwin
12841286
darwin
12851287
directfb
@@ -3812,6 +3814,11 @@ check_cpp_condition \
38123814
disable vdpau; }
38133815
fi
38143816

3817+
if enabled crystalhd; then
3818+
check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd ||
3819+
disable crystalhd;
3820+
fi
3821+
38153822
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
38163823
enabled debug && add_cxxflags -g"$debuglevel"
38173824

@@ -4369,6 +4376,7 @@ if test "$VENDOR_XVMC_LIBS" != "" ; then
43694376
echo "XvMC libs $VENDOR_XVMC_LIBS"
43704377
fi
43714378
echo "VDPAU support ${vdpau-no}"
4379+
echo "CrystalHD support ${crystalhd-no}"
43724380
fi
43734381
echo "OpenGL video ${opengl_video-no}"
43744382
if test x"$target_os" = x"darwin" ; then

mythtv/libs/libmythtv/libmythtv.pro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ using_frontend {
272272
SOURCES += nuppeldecoder.cpp avformatdecoder.cpp
273273
SOURCES += privatedecoder.cpp privatedecoder_mpeg2.cpp
274274

275+
using_crystalhd {
276+
DEFINES += USING_CRYSTALHD
277+
HEADERS += privatedecoder_crystalhd.h
278+
SOURCES += privatedecoder_crystalhd.cpp
279+
LIBS += -lcrystalhd
280+
}
281+
275282
macx {
276283
HEADERS += privatedecoder_vda.h privatedecoder_vda_defs.h
277284
SOURCES += privatedecoder_vda.cpp

mythtv/libs/libmythtv/privatedecoder.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55
#include "privatedecoder_vda.h"
66
#endif
77

8+
#ifdef USING_CRYSTALHD
9+
#include "privatedecoder_crystalhd.h"
10+
#endif
11+
812
void PrivateDecoder::GetDecoders(render_opts &opts)
913
{
1014
PrivateDecoderMPEG2::GetDecoders(opts);
1115

1216
#if defined(Q_OS_MACX)
1317
PrivateDecoderVDA::GetDecoders(opts);
1418
#endif
19+
20+
#ifdef USING_CRYSTALHD
21+
PrivateDecoderCrystalHD::GetDecoders(opts);
22+
#endif
1523
}
1624

1725
PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
@@ -30,5 +38,12 @@ PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
3038
delete vda;
3139
#endif
3240

41+
#ifdef USING_CRYSTALHD
42+
PrivateDecoderCrystalHD *chd = new PrivateDecoderCrystalHD();
43+
if (chd && chd->Init(decoder, no_hardware_decode, avctx))
44+
return chd;
45+
delete chd;
46+
#endif
47+
3348
return NULL;
3449
}

0 commit comments

Comments
 (0)