MythTV  master
mythv4l2m2mcontext.cpp
Go to the documentation of this file.
1 // Qt
2 #include <QDir>
3 
4 // MythTV
5 #include "mythlogging.h"
6 #include "v4l2util.h"
7 #include "fourcc.h"
8 #include "avformatdecoder.h"
9 #include "mythplayerui.h"
11 #ifdef USING_EGL
13 #endif
14 #include "mythv4l2m2mcontext.h"
15 
16 #ifdef USING_MMAL
17 #include "mythmmalcontext.h"
18 #endif
19 
20 // Sys
21 #include <sys/ioctl.h>
22 
23 // FFmpeg
24 extern "C" {
25 #include "libavutil/opt.h"
26 }
27 
28 #define LOC QString("V4L2_M2M: ")
29 
30 static bool s_useV4L2Request = !qEnvironmentVariableIsEmpty("MYTHTV_V4L2_REQUEST");
31 
40  : MythDRMPRIMEContext(Parent, CodecID)
41 {
42 }
43 
45 {
46  return codec_is_v4l2(m_codecID);
47 }
48 
50  AVCodec **Codec,
51  const QString &Decoder,
52  AVStream *Stream,
53  uint StreamType)
54 {
55  bool decodeonly = Decoder == "v4l2-dec";
56  auto success = static_cast<MythCodecID>((decodeonly ? kCodec_MPEG1_V4L2_DEC : kCodec_MPEG1_V4L2) + (StreamType - 1));
57  auto failure = static_cast<MythCodecID>(kCodec_MPEG1 + (StreamType - 1));
58 
59  // not us
60  if (!Decoder.startsWith("v4l2"))
61  return failure;
62 
63  if (!decodeonly)
64  {
65  // check for the correct player type and interop supprt
66  MythPlayerUI* player = GetPlayerUI(*Context);
68  return failure;
69  }
70 
71  // supported by device driver?
73  switch ((*Codec)->id)
74  {
75  case AV_CODEC_ID_MPEG1VIDEO: mythprofile = MythCodecContext::MPEG1; break;
76  case AV_CODEC_ID_MPEG2VIDEO: mythprofile = MythCodecContext::MPEG2; break;
77  case AV_CODEC_ID_MPEG4: mythprofile = MythCodecContext::MPEG4; break;
78  case AV_CODEC_ID_H263: mythprofile = MythCodecContext::H263; break;
79  case AV_CODEC_ID_H264: mythprofile = MythCodecContext::H264; break;
80  case AV_CODEC_ID_VC1: mythprofile = MythCodecContext::VC1; break;
81  case AV_CODEC_ID_VP8: mythprofile = MythCodecContext::VP8; break;
82  case AV_CODEC_ID_VP9: mythprofile = MythCodecContext::VP9; break;
83  case AV_CODEC_ID_HEVC: mythprofile = MythCodecContext::HEVC; break;
84  default: break;
85  }
86 
87  if (mythprofile == MythCodecContext::NoProfile)
88  return failure;
89 
91  if (!profiles.contains(mythprofile))
92  return failure;
93 
94 #ifdef USING_MMAL
95  // If MMAL is available, assume this is a Raspberry Pi and check the supported
96  // video sizes
97  if (!MythMMALContext::CheckCodecSize((*Context)->width, (*Context)->height, mythprofile))
98  return failure;
99  // As for MMAL, don't try and decode 10bit H264
100  if ((*Codec)->id == AV_CODEC_ID_H264)
101  {
102  if ((*Context)->profile == FF_PROFILE_H264_HIGH_10 ||
103  (*Context)->profile == FF_PROFILE_H264_HIGH_10_INTRA)
104  {
105  return failure;
106  }
107  }
108 #endif
109 
110  if (s_useV4L2Request && !decodeonly)
111  {
112  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Forcing support for %1 v42l_request")
113  .arg(ff_codec_id_string((*Context)->codec_id)));
114  (*Context)->pix_fmt = AV_PIX_FMT_DRM_PRIME;
115  return success;
116  }
117 
118  return MythDRMPRIMEContext::GetPrimeCodec(Context, Codec, Stream,
119  success, failure, "v4l2m2m",
120  decodeonly ? (*Context)->pix_fmt : AV_PIX_FMT_DRM_PRIME);
121 }
122 
124 {
125  if (!Context)
126  return -1;
128  return 0;
130  return 0;
132 }
133 
134 void MythV4L2M2MContext::InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering)
135 {
137  {
139  return;
140  }
141 
143  {
144  DirectRendering = false;
145  return;
146  }
147  return MythDRMPRIMEContext::InitVideoCodec(Context, SelectedStream, DirectRendering);
148 }
149 
151 {
153  return MythCodecContext::GetBuffer2(Context, Frame, AvFrame, 0);
154 
156  return GetBuffer(Context, Frame, AvFrame, 0);
158 }
159 
165 void MythV4L2M2MContext::SetDecoderOptions(AVCodecContext* Context, AVCodec* Codec)
166 {
168  return;
169 
170  if (!(Context && Codec))
171  return;
172  if (!(Codec->priv_class && Context->priv_data))
173  return;
174 
175  // best guess currently - this matches the number of capture buffers to the
176  // number of output buffers - and hence to the number of video buffers for
177  // direct rendering
178  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Setting number of capture buffers to 6");
179  av_opt_set_int(Context->priv_data, "num_capture_buffers", 6, 0);
180 }
181 
188 bool MythV4L2M2MContext::GetBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int /*Flags*/)
189 {
190  // Sanity checks
191  if (!Context || !AvFrame || !Frame)
192  return false;
193 
194  // Ensure we can render this format
195  auto *decoder = static_cast<AvFormatDecoder*>(Context->opaque);
196  VideoFrameType type = MythAVUtil::PixelFormatToFrameType(static_cast<AVPixelFormat>(AvFrame->format));
197  const VideoFrameTypes* supported = decoder->GetPlayer()->DirectRenderFormats();
198  auto foundIt = std::find(supported->cbegin(), supported->cend(), type);
199  // No fallback currently (unlikely)
200  if (foundIt == supported->end())
201  return false;
202 
203  // Re-allocate if necessary
204  if ((Frame->m_type != type) || (Frame->m_width != AvFrame->width) || (Frame->m_height != AvFrame->height))
205  if (!VideoBuffers::ReinitBuffer(Frame, type, decoder->GetVideoCodecID(), AvFrame->width, AvFrame->height))
206  return false;
207 
208  // Copy data
209  uint count = MythVideoFrame::GetNumPlanes(Frame->m_type);
210  for (uint plane = 0; plane < count; ++plane)
211  {
212  MythVideoFrame::CopyPlane(Frame->m_buffer + Frame->m_offsets[plane],Frame->m_pitches[plane],
213  AvFrame->data[plane], AvFrame->linesize[plane],
214  MythVideoFrame::GetPitchForPlane(Frame->m_type, AvFrame->width, plane),
215  MythVideoFrame::GetHeightForPlane(Frame->m_type, AvFrame->height, plane));
216  }
217 
218  return true;
219 }
220 
221 #ifndef V4L2_PIX_FMT_HEVC
222 #define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C')
223 #endif
224 
225 #ifndef V4L2_PIX_FMT_VP9
226 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0')
227 #endif
228 
230 {
231  using V4L2Mapping = QPair<const uint32_t, const MythCodecContext::CodecProfile>;
232  static const std::array<const V4L2Mapping,9> s_map
233  {{
234  { V4L2_PIX_FMT_MPEG1, MythCodecContext::MPEG1 },
235  { V4L2_PIX_FMT_MPEG2, MythCodecContext::MPEG2 },
236  { V4L2_PIX_FMT_MPEG4, MythCodecContext::MPEG4 },
237  { V4L2_PIX_FMT_H263, MythCodecContext::H263 },
238  { V4L2_PIX_FMT_H264, MythCodecContext::H264 },
239  { V4L2_PIX_FMT_VC1_ANNEX_G, MythCodecContext::VC1 },
240  { V4L2_PIX_FMT_VP8, MythCodecContext::VP8 },
243  }};
244 
245  static QMutex lock(QMutex::Recursive);
246  static bool s_initialised = false;
247  static V4L2Profiles s_profiles;
248 
249  QMutexLocker locker(&lock);
250  if (s_initialised)
251  return s_profiles;
252  s_initialised = true;
253 
254  if (s_useV4L2Request)
255  {
256  LOG(VB_GENERAL, LOG_INFO, LOC + "V4L2Request support endabled - assuming all available");
257  for (auto profile : s_map)
258  s_profiles.append(profile.second);
259  return s_profiles;
260  }
261 
262  const QString root("/dev/");
263  QDir dir(root);
264  QStringList namefilters;
265  namefilters.append("video*");
266  QStringList devices = dir.entryList(namefilters, QDir::Files |QDir::System);
267  for (const QString& device : qAsConst(devices))
268  {
269  V4L2util v4l2dev(root + device);
270  uint32_t caps = v4l2dev.GetCapabilities();
271  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Device: %1 Driver: '%2' Capabilities: 0x%3")
272  .arg(v4l2dev.GetDeviceName()).arg(v4l2dev.GetDriverName()).arg(caps, 0, 16));
273 
274  // check capture and output support
275  // these mimic the device checks in v4l2_m2m.c
276  bool mplanar = ((caps & (V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_OUTPUT_MPLANE)) != 0U) &&
277  ((caps & V4L2_CAP_STREAMING) != 0U);
278  bool mplanarm2m = (caps & V4L2_CAP_VIDEO_M2M_MPLANE) != 0U;
279  bool splanar = ((caps & (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT)) != 0U) &&
280  ((caps & V4L2_CAP_STREAMING) != 0U);
281  bool splanarm2m = (caps & V4L2_CAP_VIDEO_M2M) != 0U;
282 
283  if (!(mplanar || mplanarm2m || splanar || splanarm2m))
284  continue;
285 
286  v4l2_buf_type capturetype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
287  v4l2_buf_type outputtype = V4L2_BUF_TYPE_VIDEO_OUTPUT;
288 
289  if (mplanar || mplanarm2m)
290  {
291  capturetype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
292  outputtype = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
293  }
294 
295  // check codec support
296  QStringList debug;
297  QSize dummy{0, 0};
298  for (auto profile : s_map)
299  {
300  bool found = false;
301  uint32_t v4l2pixfmt = profile.first;
302  MythCodecContext::CodecProfile mythprofile = profile.second;
303  struct v4l2_fmtdesc fdesc {};
304  memset(&fdesc, 0, sizeof(fdesc));
305 
306  // check output first
307  fdesc.type = outputtype;
308  while (!found)
309  {
310  int res = ioctl(v4l2dev.FD(), VIDIOC_ENUM_FMT, &fdesc);
311  if (res)
312  break;
313  if (fdesc.pixelformat == v4l2pixfmt)
314  found = true;
315  fdesc.index++;
316  }
317 
318  if (found)
319  {
320  QStringList pixformats;
321  bool foundfmt = false;
322  // check capture
323  memset(&fdesc, 0, sizeof(fdesc));
324  fdesc.type = capturetype;
325  while (true)
326  {
327  int res = ioctl(v4l2dev.FD(), VIDIOC_ENUM_FMT, &fdesc);
328  if (res)
329  break;
330  pixformats.append(fourcc_str(static_cast<int>(fdesc.pixelformat)));
331 
332  // this is a bit of a shortcut
333  if (fdesc.pixelformat == V4L2_PIX_FMT_YUV420 ||
334  fdesc.pixelformat == V4L2_PIX_FMT_YVU420 ||
335  fdesc.pixelformat == V4L2_PIX_FMT_YUV420M ||
336  fdesc.pixelformat == V4L2_PIX_FMT_YVU420M ||
337  fdesc.pixelformat == V4L2_PIX_FMT_NV12 ||
338  fdesc.pixelformat == V4L2_PIX_FMT_NV12M ||
339  fdesc.pixelformat == V4L2_PIX_FMT_NV21 ||
340  fdesc.pixelformat == V4L2_PIX_FMT_NV21M)
341  {
342  if (!s_profiles.contains(mythprofile))
343  s_profiles.append(mythprofile);
344  foundfmt = true;
345  break;
346  }
347  fdesc.index++;
348  }
349 
350  if (!foundfmt)
351  {
352  if (pixformats.isEmpty())
353  pixformats.append("None");
354  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Codec '%1' has no supported formats (Supported: %2)")
355  .arg(MythCodecContext::GetProfileDescription(mythprofile, dummy)).arg(pixformats.join((","))));
356  }
357  }
358  }
359  }
360 
361  return s_profiles;
362 }
363 
364 void MythV4L2M2MContext::GetDecoderList(QStringList &Decoders)
365 {
366  const V4L2Profiles& profiles = MythV4L2M2MContext::GetProfiles();
367  if (profiles.isEmpty())
368  return;
369 
370  QSize size(0, 0);
371  Decoders.append("V4L2:");
372  for (MythCodecContext::CodecProfile profile : profiles)
373  Decoders.append(MythCodecContext::GetProfileDescription(profile, size));
374 }
375 
377 {
378  static QMutex lock(QMutex::Recursive);
379  QMutexLocker locker(&lock);
380  static bool s_checked = false;
381  static bool s_available = false;
382 
383  if (s_checked)
384  return s_available;
385  s_checked = true;
386 
387  const V4L2Profiles& profiles = MythV4L2M2MContext::GetProfiles();
388  if (profiles.isEmpty())
389  {
390  LOG(VB_GENERAL, LOG_INFO, LOC + "No V4L2 decoders found");
391  return s_available;
392  }
393 
394  LOG(VB_GENERAL, LOG_INFO, LOC + "Supported/available V4L2 decoders:");
395  s_available = true;
396  QSize size{0, 0};
397  for (auto profile : qAsConst(profiles))
398  LOG(VB_GENERAL, LOG_INFO, LOC + MythCodecContext::GetProfileDescription(profile, size));
399  return s_available;
400 }
401 
402 AVPixelFormat MythV4L2M2MContext::GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
403 {
404  while (*PixFmt != AV_PIX_FMT_NONE)
405  {
406  if (*PixFmt == AV_PIX_FMT_DRM_PRIME)
407  {
409  "V4L2 request context creation") >= 0)
410  return AV_PIX_FMT_DRM_PRIME;
411  }
412  PixFmt++;
413  }
414  return AV_PIX_FMT_NONE;
415 }
416 
418 {
419  if (!Context || !gCoreContext->IsUIThread())
420  return -1;
421 
422  // We need a render device
424  if (!render)
425  return -1;
426 
427  // The interop must have a reference to the ui player so it can be deleted
428  // from the main thread.
429  MythPlayerUI* player = GetPlayerUI(Context);
430  if (!player)
431  return -1;
432 
433  // Check interop support
436  return -1;
437 
438  // Create interop
439  MythOpenGLInterop *interop = nullptr;
440 #ifdef USING_EGL
441  interop = MythDRMPRIMEInterop::Create(render, type);
442 #endif
443  if (!interop)
444  return -1;
445 
446  // Set the player required to process interop release
447  interop->SetPlayer(player);
448 
449  // Allocate the device context
450  AVBufferRef* hwdeviceref = MythCodecContext::CreateDevice(AV_HWDEVICE_TYPE_DRM, interop);
451  if (!hwdeviceref)
452  {
453  interop->DecrRef();
454  return -1;
455  }
456 
457  auto* hwdevicecontext = reinterpret_cast<AVHWDeviceContext*>(hwdeviceref->data);
458  if (!hwdevicecontext || !hwdevicecontext->hwctx)
459  {
460  interop->DecrRef();
461  return -1;
462  }
463 
464  // Initialise device context
465  if (av_hwdevice_ctx_init(hwdeviceref) < 0)
466  {
467  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to initialise device context");
468  av_buffer_unref(&hwdeviceref);
469  interop->DecrRef();
470  return -1;
471  }
472 
473  Context->hw_device_ctx = hwdeviceref;
474  return 0;
475 }
MythMMALContext::CheckCodecSize
static bool CheckCodecSize(int Width, int Height, MythCodecContext::CodecProfile Profile)
Definition: mythmmalcontext.cpp:24
root
QDomElement root
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:656
MythCodecContext::m_codecID
MythCodecID m_codecID
Definition: mythcodeccontext.h:167
MythVideoFrame::GetPitchForPlane
static int GetPitchForPlane(VideoFrameType Type, int Width, uint Plane)
Definition: mythframe.h:287
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
mythplayerui.h
MythV4L2M2MContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythv4l2m2mcontext.cpp:123
MythDRMPRIMEContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythdrmprimecontext.cpp:119
FMT_DRMPRIME
@ FMT_DRMPRIME
Definition: mythframe.h:59
MythCodecContext::NoProfile
@ NoProfile
Definition: mythcodeccontext.h:56
MythCodecContext::CodecProfile
CodecProfile
Definition: mythcodeccontext.h:55
Frame
Definition: zmdefines.h:94
arg
arg(title).arg(filename).arg(doDelete))
MythV4L2M2MContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythv4l2m2mcontext.cpp:134
MythCoreContext::IsUIThread
bool IsUIThread(void)
Definition: mythcorecontext.cpp:1353
Context
QHash< QString, Action * > Context
Definition: action.h:77
MythDRMPRIMEInterop::Create
static MythDRMPRIMEInterop * Create(MythRenderOpenGL *Context, Type InteropType)
Definition: mythdrmprimeinterop.cpp:51
V4L2util::FD
int FD(void) const
Definition: v4l2util.h:26
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythV4L2M2MContext::GetDecoderList
static void GetDecoderList(QStringList &Decoders)
Definition: mythv4l2m2mcontext.cpp:364
V4L2_PIX_FMT_VP9
#define V4L2_PIX_FMT_VP9
Definition: mythv4l2m2mcontext.cpp:226
MythDRMPRIMEContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythdrmprimecontext.cpp:105
V4L2Profiles
QList< MythCodecContext::CodecProfile > V4L2Profiles
Definition: mythv4l2m2mcontext.h:7
MythCodecID
MythCodecID
Definition: mythcodecid.h:11
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
mythrenderopengl.h
MythV4L2M2MContext::SetDecoderOptions
void SetDecoderOptions(AVCodecContext *Context, AVCodec *Codec) override
Reduce the number of capture buffers.
Definition: mythv4l2m2mcontext.cpp:165
MythPlayerUI
Definition: mythplayerui.h:12
Decoder
Definition: decoder.h:66
MythOpenGLInterop::SetPlayer
void SetPlayer(MythPlayerUI *Player)
Definition: mythopenglinterop.cpp:278
MythV4L2M2MContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythv4l2m2mcontext.cpp:150
mythlogging.h
MythOpenGLInterop
Definition: mythopenglinterop.h:24
hardwareprofile.scan.profile
profile
Definition: scan.py:99
MythOpenGLInterop::Unsupported
@ Unsupported
Definition: mythopenglinterop.h:31
MythVideoFrame::CopyPlane
static void CopyPlane(uint8_t *To, int ToPitch, const uint8_t *From, int FromPitch, int PlaneWidth, int PlaneHeight)
Definition: mythframe.cpp:175
v4l2util.h
MythDRMPRIMEContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythdrmprimecontext.cpp:136
VideoFrameTypes
std::vector< VideoFrameType > VideoFrameTypes
Definition: mythframe.h:78
kCodec_MPEG1
@ kCodec_MPEG1
Definition: mythcodecid.h:21
LOC
#define LOC
Definition: mythv4l2m2mcontext.cpp:28
debug
VERBOSE_PREAMBLE Most debug(nodatabase, notimestamp, noextra)") VERBOSE_MAP(VB_GENERAL
MythCodecContext::VP9
@ VP9
Definition: mythcodeccontext.h:107
MythOpenGLInterop::GetInteropType
static Type GetInteropType(VideoFrameType Format, MythPlayerUI *Player)
Check whether we support direct rendering for the given VideoFrameType.
Definition: mythopenglinterop.cpp:74
MythCodecContext::MPEG4
@ MPEG4
Definition: mythcodeccontext.h:65
MythCodecContext::MPEG1
@ MPEG1
Definition: mythcodeccontext.h:57
MythCodecContext::HEVC
@ HEVC
Definition: mythcodeccontext.h:94
AvFormatDecoder
A decoder for media files.
Definition: avformatdecoder.h:87
MythCodecContext::H263
@ H263
Definition: mythcodeccontext.h:82
MythDRMPRIMEContext
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
Definition: mythdrmprimecontext.h:15
V4L2_PIX_FMT_HEVC
#define V4L2_PIX_FMT_HEVC
Definition: mythv4l2m2mcontext.cpp:222
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
V4L2util::GetDeviceName
QString GetDeviceName(void) const
Definition: v4l2util.cpp:682
MythV4L2M2MContext::GetSupportedCodec
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
Definition: mythv4l2m2mcontext.cpp:49
MythOpenGLInterop::Type
Type
Definition: mythopenglinterop.h:30
MythCodecContext::MPEG2
@ MPEG2
Definition: mythcodeccontext.h:58
MythAVUtil::PixelFormatToFrameType
static VideoFrameType PixelFormatToFrameType(AVPixelFormat Fmt)
Definition: mythavutil.cpp:73
kCodec_MPEG1_V4L2_DEC
@ kCodec_MPEG1_V4L2_DEC
Definition: mythcodecid.h:229
MythRenderOpenGL
Definition: mythrenderopengl.h:98
MythVideoFrame::GetHeightForPlane
static int GetHeightForPlane(VideoFrameType Type, int Height, uint Plane)
Definition: mythframe.h:241
V4L2util::GetDriverName
QString GetDriverName(void) const
Definition: v4l2util.cpp:687
MythV4L2M2MContext::GetProfiles
static const V4L2Profiles & GetProfiles(void)
Definition: mythv4l2m2mcontext.cpp:229
MythV4L2M2MContext::GetV4L2RequestFormat
static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
Definition: mythv4l2m2mcontext.cpp:402
MythCodecContext::CreateDevice
static AVBufferRef * CreateDevice(AVHWDeviceType Type, MythOpenGLInterop *Interop, const QString &Device=QString())
Definition: mythcodeccontext.cpp:536
MythV4L2M2MContext::HaveV4L2Codecs
static bool HaveV4L2Codecs(void)
Definition: mythv4l2m2mcontext.cpp:376
kCodec_MPEG1_V4L2
@ kCodec_MPEG1_V4L2
Definition: mythcodecid.h:213
V4L2util
Definition: v4l2util.h:17
MythCodecContext::VC1
@ VC1
Definition: mythcodeccontext.h:101
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
avformatdecoder.h
MythV4L2M2MContext::MythV4L2M2MContext
MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID)
Definition: mythv4l2m2mcontext.cpp:39
MythDRMPRIMEContext::GetPrimeCodec
static MythCodecID GetPrimeCodec(AVCodecContext **Context, AVCodec **Codec, AVStream *Stream, MythCodecID Successs, MythCodecID Failure, const QString &CodecName, AVPixelFormat Format)
Definition: mythdrmprimecontext.cpp:39
MythV4L2M2MContext::InitialiseV4L2RequestContext
static int InitialiseV4L2RequestContext(AVCodecContext *Context)
Definition: mythv4l2m2mcontext.cpp:417
mythmmalcontext.h
MythRenderOpenGL::GetOpenGLRender
static MythRenderOpenGL * GetOpenGLRender(void)
Definition: mythrenderopengl.cpp:66
fourcc_str
static const char * fourcc_str(int i)
Definition: fourcc.h:26
MythV4L2M2MContext::DecoderWillResetOnFlush
bool DecoderWillResetOnFlush(void) override
Definition: mythv4l2m2mcontext.cpp:44
MythVideoFrame::GetNumPlanes
static uint GetNumPlanes(VideoFrameType Type)
Definition: mythframe.h:197
codec_is_v4l2
#define codec_is_v4l2(id)
Definition: mythcodecid.h:338
mythdrmprimeinterop.h
VideoBuffers::ReinitBuffer
static bool ReinitBuffer(MythVideoFrame *Frame, VideoFrameType Type, MythCodecID CodecID, int Width, int Height)
Definition: videobuffers.cpp:1032
MythV4L2M2MContext::GetBuffer
static bool GetBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int)
Retrieve a frame from CPU memory.
Definition: mythv4l2m2mcontext.cpp:188
VideoFrameType
VideoFrameType
Definition: mythframe.h:16
MythCodecContext::GetProfileDescription
static QString GetProfileDescription(CodecProfile Profile, QSize Size, VideoFrameType Format=FMT_NONE, uint ColorDepth=0)
Definition: mythcodeccontext.cpp:763
s_useV4L2Request
static bool s_useV4L2Request
Definition: mythv4l2m2mcontext.cpp:30
MythVideoFrame
Definition: mythframe.h:83
V4L2util::GetCapabilities
uint32_t GetCapabilities(void) const
Definition: v4l2util.cpp:677
codec_is_v4l2_dec
#define codec_is_v4l2_dec(id)
Definition: mythcodecid.h:339
mythv4l2m2mcontext.h
MythCodecContext::InitialiseDecoder
static int InitialiseDecoder(AVCodecContext *Context, CreateHWDecoder Callback, const QString &Debug)
Initialise a hardware decoder that is expected to use AVHWFramesContext.
Definition: mythcodeccontext.cpp:503
DecoderBase
Definition: decoderbase.h:121
MythCodecContext::GetBuffer2
static bool GetBuffer2(struct AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int Flags)
A generic hardware buffer initialisation method when AVHWFramesContext is NOT used.
Definition: mythcodeccontext.cpp:363
MythCodecContext::GetPlayerUI
static MythPlayerUI * GetPlayerUI(AVCodecContext *Context)
Definition: mythcodeccontext.cpp:493
MythCodecContext::VP8
@ VP8
Definition: mythcodeccontext.h:106
find
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
Definition: dvbstreamhandler.cpp:356
fourcc.h
MythCodecContext::H264
@ H264
Definition: mythcodeccontext.h:83