Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
V4L2 Codecs: Add a temporary workaround to allow v4l2request decoders
  • Loading branch information
mark-kendall committed Dec 11, 2019
1 parent 0c0d33d commit 234f34b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythtv/decoders/mythdrmprimecontext.cpp
Expand Up @@ -230,8 +230,9 @@ bool MythDRMPRIMEContext::HavePrimeDecoders(AVCodecID Codec)

if (debugcodecs.isEmpty())
debugcodecs.append("None");
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("DRM PRIME codecs supported: %1 using: %2")
.arg(debugcodecs.join(",")).arg(s_drmPrimeDecoders.join(",")));
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("DRM PRIME codecs supported: %1 %2")
.arg(debugcodecs.join(","))
.arg(s_drmPrimeDecoders.isEmpty() ? "" : QString("using: %1").arg(s_drmPrimeDecoders.join(","))));
}

if (!Codec)
Expand Down
13 changes: 13 additions & 0 deletions mythtv/libs/libmythtv/decoders/mythv4l2m2mcontext.cpp
Expand Up @@ -76,6 +76,13 @@ MythCodecID MythV4L2M2MContext::GetSupportedCodec(AVCodecContext **Context,
if (!HaveV4L2Codecs((*Codec)->id))
return failure;

if (!qgetenv("MYTHTV_V4L2_REQUEST").isEmpty() && !decodeonly)
{
return MythDRMPRIMEContext::GetPrimeCodec(Context, Codec, Stream,
success, failure, "v4l2request",
AV_PIX_FMT_DRM_PRIME);
}

return MythDRMPRIMEContext::GetPrimeCodec(Context, Codec, Stream,
success, failure, "v4l2m2m",
decodeonly ? (*Context)->pix_fmt : AV_PIX_FMT_DRM_PRIME);
Expand Down Expand Up @@ -184,6 +191,12 @@ bool MythV4L2M2MContext::HaveV4L2Codecs(AVCodecID Codec /* = AV_CODEC_ID_NONE */

QMutexLocker locker(&s_drmPrimeLock);

if (!qgetenv("MYTHTV_V4L2_REQUEST").isEmpty())
{
s_needscheck = false;
s_supportedV4L2Codecs = s_avcodecs;
}

if (s_needscheck)
{
s_needscheck = false;
Expand Down

0 comments on commit 234f34b

Please sign in to comment.