Skip to content

Commit

Permalink
Remove libmpeg2 decoder from playback options.
Browse files Browse the repository at this point in the history
Only remaining use of libmpeg2 is in mythtranscode.
  • Loading branch information
sphery committed Dec 9, 2010
1 parent 9bfe562 commit ebf9778
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 270 deletions.
5 changes: 0 additions & 5 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -54,11 +54,6 @@ extern const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, u
extern void ff_read_frame_flush(AVFormatContext *s);
#include "libavformat/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
9 changes: 2 additions & 7 deletions mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -64,11 +64,6 @@ 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 += ../../external/FFmpeg/libavutil/$$avLibName(avutil)
Expand Down Expand Up @@ -280,10 +275,10 @@ using_frontend {
# A/V decoders
HEADERS += decoderbase.h
HEADERS += nuppeldecoder.h avformatdecoder.h
HEADERS += privatedecoder.h privatedecoder_mpeg2.h
HEADERS += privatedecoder.h
SOURCES += decoderbase.cpp
SOURCES += nuppeldecoder.cpp avformatdecoder.cpp
SOURCES += privatedecoder.cpp privatedecoder_mpeg2.cpp
SOURCES += privatedecoder.cpp

using_crystalhd {
DEFINES += USING_CRYSTALHD
Expand Down
8 changes: 0 additions & 8 deletions mythtv/libs/libmythtv/privatedecoder.cpp
@@ -1,5 +1,4 @@
#include "privatedecoder.h"
#include "privatedecoder_mpeg2.h"

#if defined(Q_OS_MACX)
#include "privatedecoder_vda.h"
Expand All @@ -11,8 +10,6 @@

void PrivateDecoder::GetDecoders(render_opts &opts)
{
PrivateDecoderMPEG2::GetDecoders(opts);

#if defined(Q_OS_MACX)
PrivateDecoderVDA::GetDecoders(opts);
#endif
Expand All @@ -26,11 +23,6 @@ PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
bool no_hardware_decode,
AVCodecContext *avctx)
{
PrivateDecoderMPEG2 *mpeg2 = new PrivateDecoderMPEG2();
if (mpeg2 && mpeg2->Init(decoder, no_hardware_decode, avctx))
return mpeg2;
delete mpeg2;

#if defined(Q_OS_MACX)
PrivateDecoderVDA *vda = new PrivateDecoderVDA();
if (vda && vda->Init(decoder, no_hardware_decode, avctx))
Expand Down
182 changes: 0 additions & 182 deletions mythtv/libs/libmythtv/privatedecoder_mpeg2.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions mythtv/libs/libmythtv/privatedecoder_mpeg2.h

This file was deleted.

6 changes: 0 additions & 6 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Expand Up @@ -637,7 +637,6 @@ QString VideoDisplayProfile::GetDecoderName(const QString &decoder)
if (dec_name.empty())
{
dec_name["ffmpeg"] = QObject::tr("Standard");
dec_name["libmpeg2"] = QObject::tr("libmpeg2");
dec_name["macaccel"] = QObject::tr("Mac hardware acceleration");
dec_name["vdpau"] = QObject::tr("NVidia VDPAU acceleration");
}
Expand All @@ -664,11 +663,6 @@ QString VideoDisplayProfile::GetDecoderHelp(QString decoder)
if (decoder == "ffmpeg")
msg += QObject::tr("Standard will use ffmpeg library.");

if (decoder == "libmpeg2")
msg += QObject::tr(
"libmpeg2 is slower on almost all processors than ffmpeg "
"and breaks caption decoding. Use at your own risk!");

if (decoder == "macaccel")
msg += QObject::tr(
"Mac hardware will try to use the graphics "
Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/videoout_d3d.cpp
Expand Up @@ -45,8 +45,6 @@ void VideoOutputD3D::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["nuppel"].append("direct3d");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("direct3d");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("direct3d");
if (opts.decoders->contains("crystalhd"))
(*opts.safe_renderers)["crystalhd"].append("direct3d");
opts.priorities->insert("direct3d", 55);
Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/videoout_directfb.cpp
Expand Up @@ -270,8 +270,6 @@ void VideoOutputDirectfb::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["nuppel"].append("directfb");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("directfb");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("directfb");
if (opts.decoders->contains("crystalhd"))
(*opts.safe_renderers)["crystalhd"].append("directfb");
opts.priorities->insert("directfb", 60);
Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/videoout_null.cpp
Expand Up @@ -22,8 +22,6 @@ void VideoOutputNull::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["nuppel"].append("null");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("null");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("null");
if (opts.decoders->contains("crystalhd"))
(*opts.safe_renderers)["crystalhd"].append("null");

Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/videoout_opengl.cpp
Expand Up @@ -30,8 +30,6 @@ void VideoOutputOpenGL::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["nuppel"].append("opengl");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("opengl");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("opengl");
if (opts.decoders->contains("vda"))
(*opts.safe_renderers)["vda"].append("opengl");
if (opts.decoders->contains("crystalhd"))
Expand Down
4 changes: 1 addition & 3 deletions mythtv/libs/libmythtv/videoout_quartz.cpp
Expand Up @@ -1092,8 +1092,6 @@ void VideoOutputQuartz::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["nuppel"].append("quartz-blit");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("quartz-blit");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("quartz-blit");
if (opts.decoders->contains("vda"))
(*opts.safe_renderers)["vda"].append("quartz-blit");
if (opts.decoders->contains("crystalhd"))
Expand Down Expand Up @@ -1764,7 +1762,7 @@ MythCodecID VideoOutputQuartz::GetBestSupportedCodec(
VideoDisplayProfile vdp;
vdp.SetInput(QSize(width, height));
QString dec = vdp.GetDecoder();
if ((dec == "libmpeg2") || (dec == "ffmpeg"))
if (dec == "ffmpeg")
return (MythCodecID)(kCodec_MPEG1 + (stream_type-1));
return (MythCodecID)(kCodec_MPEG1 + (stream_type-1));
}
2 changes: 0 additions & 2 deletions mythtv/libs/libmythtv/videoout_vdpau.cpp
Expand Up @@ -30,8 +30,6 @@ void VideoOutputVDPAU::GetRenderOptions(render_opts &opts)
(*opts.safe_renderers)["vdpau"].append("vdpau");
if (opts.decoders->contains("ffmpeg"))
(*opts.safe_renderers)["ffmpeg"].append("vdpau");
if (opts.decoders->contains("libmpeg2"))
(*opts.safe_renderers)["libmpeg2"].append("vdpau");
if (opts.decoders->contains("crystalhd"))
(*opts.safe_renderers)["crystalhd"].append("vdpau");
(*opts.safe_renderers)["dummy"].append("vdpau");
Expand Down
6 changes: 0 additions & 6 deletions mythtv/libs/libmythtv/videoout_xv.cpp
Expand Up @@ -117,12 +117,6 @@ void VideoOutputXv::GetRenderOptions(render_opts &opts,
(*opts.safe_renderers)["ffmpeg"].append("xshm");
(*opts.safe_renderers)["ffmpeg"].append("xv-blit");
}
if (opts.decoders->contains("libmpeg2"))
{
(*opts.safe_renderers)["libmpeg2"].append("xlib");
(*opts.safe_renderers)["libmpeg2"].append("xshm");
(*opts.safe_renderers)["libmpeg2"].append("xv-blit");
}

if (opts.decoders->contains("crystalhd"))
{
Expand Down
3 changes: 3 additions & 0 deletions mythtv/programs/mythtranscode/mythtranscode.pro
Expand Up @@ -25,5 +25,8 @@ INCLUDEPATH += ../../libs/libavutil
INCLUDEPATH += ../../libs/

!contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
DEPENDPATH += ../../libs/libmythmpeg2
INCLUDEPATH += ../../libs/libmythmpeg2
LIBS += -L../../libs/libmythmpeg2 -lmythmpeg2-$$LIBVERSION
TARGETDEPS += ../../libs/libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT}
}

6 comments on commit ebf9778

@SoNick
Copy link

@SoNick SoNick commented on ebf9778 Jul 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What?!
WHY would you do this?
How does it benefit the project AT ALL?

@rmcnamara
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we don't need it to decode MPEG-2, and it's use has caused bugs for years. If you thought this would prevent the recording, viewing or parsing of MPEG-2 content, please take more time to learn what you're talking about before leaving a permanent record online.

@kormoc
Copy link
Contributor

@kormoc kormoc commented on ebf9778 Jul 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't remove mpeg2 support, only libmpeg2, a mpeg2 decoder/encoder optimized for 500 mhz amd processors. It's a large burden to keep it maintained for very very little used hardware. Just use the standard mpeg2 decoder and you won't notice any difference.

@wagnerrp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carrying around support for multiple decoder libraries means we need to support both decoder libraries, including maintenance of code to use those libraries, and any bugs that arise from use of those libraries.

On the contrary, the libmpeg2 decoder only carried specific optimizations from some old architectures, and bring in all sorts of issues on modern systems. How does removal of libmpeg2 in favor of libav, vdpau, and vaapi harm you AT ALL?

@Beirdo
Copy link
Member

@Beirdo Beirdo commented on ebf9778 Jul 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only remaining use is in the mpeg2-mpeg2 "lossless" transcoder, and that only remains as we haven't had time to replace it with the appropriate code using libavcodec yet.

As a project, we are trying to limit the number of library dependencies, and this one has no practical purpose to be remaining in the build when we have viable alternatives that we already need anyways.

@SoNick
Copy link

@SoNick SoNick commented on ebf9778 Jul 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you for the explanation; I do realize that I went in a little harsh with my comment that started this chain.
I hadn't kept up with Linux MPEG-2 decoders as the only Linux computer I have is my MythTV box and I (falsely) assumed that libmpeg2 is the main decoder used for those files in that context.
The standoffish comment in Mr. Robert McNamara's response is kind of :rolleyes:, but then I -did- start it by coming in confrontational so it's whatever.

In any case, I do wish you all the best of luck in removing the libmpeg2 dependencies! I'd love to join the project, but with 50-hour work-weeks and my last programming projects being -years- ago I simply don't have the time to get up to speed!

Please sign in to comment.