Skip to content

Commit

Permalink
PrivateDecoders: Use the PlayerFlags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Kendall committed Dec 7, 2011
1 parent c66767d commit 2427bc2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -1896,11 +1896,10 @@ int AvFormatDecoder::ScanStreams(bool novideo)
if (selectedTrack[kTrackTypeVideo].av_stream_index < 0)
selectedTrack[kTrackTypeVideo] = si;

if (!FlagIsSet(kVideoIsNull) && FlagIsSet(kDecodeAllowEXT) &&
if (!FlagIsSet(kVideoIsNull) &&
(selectedTrack[kTrackTypeVideo].av_stream_index == (int) i))
{
private_dec = PrivateDecoder::Create(
dec, !FlagIsSet(kDecodeAllowGPU), enc);
private_dec = PrivateDecoder::Create(dec, playerFlags, enc);
if (private_dec)
thread_count = 1;
}
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/privatedecoder.cpp
Expand Up @@ -20,19 +20,19 @@ void PrivateDecoder::GetDecoders(render_opts &opts)
}

PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx)
{
#if defined(Q_OS_MACX)
PrivateDecoderVDA *vda = new PrivateDecoderVDA();
if (vda && vda->Init(decoder, no_hardware_decode, avctx))
if (vda && vda->Init(decoder, flags, avctx))
return vda;
delete vda;
#endif

#ifdef USING_CRYSTALHD
PrivateDecoderCrystalHD *chd = new PrivateDecoderCrystalHD();
if (chd && chd->Init(decoder, no_hardware_decode, avctx))
if (chd && chd->Init(decoder, flags, avctx))
return chd;
delete chd;
#endif
Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/privatedecoder.h
Expand Up @@ -9,19 +9,20 @@ extern "C" {

#include "videodisplayprofile.h"
#include "mythcodecid.h"
#include "mythplayer.h"

class PrivateDecoder
{
public:
static void GetDecoders(render_opts &opts);
static PrivateDecoder* Create(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx);
PrivateDecoder() { }
virtual ~PrivateDecoder() { }
virtual QString GetName(void) = 0;
virtual bool Init(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx) = 0;
virtual bool Reset(void) = 0;
virtual int GetFrame(AVStream *stream,
Expand Down
7 changes: 3 additions & 4 deletions mythtv/libs/libmythtv/privatedecoder_crystalhd.cpp
Expand Up @@ -87,12 +87,11 @@ PrivateDecoderCrystalHD::~PrivateDecoderCrystalHD()
}

bool PrivateDecoderCrystalHD::Init(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx)
{
if ((decoder != "crystalhd") || no_hardware_decode || !avctx)
return false;
if (getenv("NO_CRYSTALHD"))
if ((decoder != "crystalhd") || !(flags & kDecodeAllowEXT) ||
!avctx || getenv("NO_CRYSTALHD"))
return false;

static bool debugged = false;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/privatedecoder_crystalhd.h
Expand Up @@ -54,7 +54,7 @@ class PrivateDecoderCrystalHD : public PrivateDecoder
virtual ~PrivateDecoderCrystalHD();
virtual QString GetName(void) { return QString("crystalhd"); }
virtual bool Init(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx);
virtual bool Reset(void);
virtual int GetFrame(AVStream *stream,
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/privatedecoder_vda.cpp
Expand Up @@ -134,11 +134,11 @@ PrivateDecoderVDA::~PrivateDecoderVDA()
}

bool PrivateDecoderVDA::Init(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx)
{
if ((decoder != "vda") || (avctx->codec_id != CODEC_ID_H264) ||
no_hardware_decode || !avctx)
!(flags & kDecodeAllowEXT) || !avctx)
return false;

m_lib = VDALibrary::GetVDALibrary();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/privatedecoder_vda.h
Expand Up @@ -58,7 +58,7 @@ class PrivateDecoderVDA : public PrivateDecoder
virtual ~PrivateDecoderVDA();
virtual QString GetName(void) { return "vda"; }
virtual bool Init(const QString &decoder,
bool no_hardware_decode,
PlayerFlags flags,
AVCodecContext *avctx);
virtual bool Reset(void);
virtual int GetFrame(AVStream *stream,
Expand Down

0 comments on commit 2427bc2

Please sign in to comment.