MythTV  master
mythavutil.cpp
Go to the documentation of this file.
1 //
2 // mythavutil.cpp
3 // MythTV
4 //
5 // Created by Jean-Yves Avenard on 28/06/2014.
6 // Copyright (c) 2014 Bubblestuff Pty Ltd. All rights reserved.
7 //
8 
9 // Qt
10 #include <QtGlobal>
11 #include <QMutexLocker>
12 #include <QFile>
13 
14 // MythTV
15 #include "libmyth/mythaverror.h"
16 #include "libmythbase/mythconfig.h"
18 #include "mythdeinterlacer.h"
19 #include "mythavutil.h"
20 
21 // FFmpeg
22 extern "C" {
23 #include "libavcodec/avcodec.h"
24 #include "libavutil/imgutils.h"
25 #include "libavformat/avformat.h"
26 }
27 
29 {
30  switch (Type)
31  {
32  case FMT_YV12: return AV_PIX_FMT_YUV420P;
33  case FMT_YUV420P9: return AV_PIX_FMT_YUV420P9;
34  case FMT_YUV420P10: return AV_PIX_FMT_YUV420P10;
35  case FMT_YUV420P12: return AV_PIX_FMT_YUV420P12;
36  case FMT_YUV420P14: return AV_PIX_FMT_YUV420P14;
37  case FMT_YUV420P16: return AV_PIX_FMT_YUV420P16;
38  case FMT_NV12: return AV_PIX_FMT_NV12;
39  case FMT_P010: return AV_PIX_FMT_P010;
40  case FMT_P016: return AV_PIX_FMT_P016;
41  case FMT_YUV422P: return AV_PIX_FMT_YUV422P;
42  case FMT_YUV422P9: return AV_PIX_FMT_YUV422P9;
43  case FMT_YUV422P10: return AV_PIX_FMT_YUV422P10;
44  case FMT_YUV422P12: return AV_PIX_FMT_YUV422P12;
45  case FMT_YUV422P14: return AV_PIX_FMT_YUV422P14;
46  case FMT_YUV422P16: return AV_PIX_FMT_YUV422P16;
47  case FMT_YUV444P: return AV_PIX_FMT_YUV444P;
48  case FMT_YUV444P9: return AV_PIX_FMT_YUV444P9;
49  case FMT_YUV444P10: return AV_PIX_FMT_YUV444P10;
50  case FMT_YUV444P12: return AV_PIX_FMT_YUV444P12;
51  case FMT_YUV444P14: return AV_PIX_FMT_YUV444P14;
52  case FMT_YUV444P16: return AV_PIX_FMT_YUV444P16;
53  case FMT_RGB24: return AV_PIX_FMT_RGB24;
54  case FMT_BGRA: return AV_PIX_FMT_BGRA; // NOLINT(bugprone-branch-clone)
55  case FMT_RGB32: return AV_PIX_FMT_RGB32;
56  case FMT_ARGB32: return AV_PIX_FMT_ARGB;
57  case FMT_RGBA32: return AV_PIX_FMT_RGBA;
58  case FMT_YUY2: return AV_PIX_FMT_UYVY422;
59  case FMT_VDPAU: return AV_PIX_FMT_VDPAU;
60  case FMT_VTB: return AV_PIX_FMT_VIDEOTOOLBOX;
61  case FMT_VAAPI: return AV_PIX_FMT_VAAPI;
62  case FMT_MEDIACODEC: return AV_PIX_FMT_MEDIACODEC;
63  case FMT_NVDEC: return AV_PIX_FMT_CUDA;
64  case FMT_DXVA2: return AV_PIX_FMT_DXVA2_VLD;
65  case FMT_MMAL: return AV_PIX_FMT_MMAL;
66  case FMT_DRMPRIME: return AV_PIX_FMT_DRM_PRIME;
67  case FMT_NONE: break;
68  }
69  return AV_PIX_FMT_NONE;
70 }
71 
73 {
74  switch (Fmt)
75  {
76  case AV_PIX_FMT_YUVJ420P:
77  case AV_PIX_FMT_YUV420P: return FMT_YV12;
78  case AV_PIX_FMT_YUV420P9: return FMT_YUV420P9;
79  case AV_PIX_FMT_YUV420P10: return FMT_YUV420P10;
80  case AV_PIX_FMT_YUV420P12: return FMT_YUV420P12;
81  case AV_PIX_FMT_YUV420P14: return FMT_YUV420P14;
82  case AV_PIX_FMT_YUV420P16: return FMT_YUV420P16;
83  case AV_PIX_FMT_NV12: return FMT_NV12;
84  case AV_PIX_FMT_P010: return FMT_P010;
85  case AV_PIX_FMT_P016: return FMT_P016;
86  case AV_PIX_FMT_YUVJ422P:
87  case AV_PIX_FMT_YUV422P: return FMT_YUV422P;
88  case AV_PIX_FMT_YUV422P9: return FMT_YUV422P9;
89  case AV_PIX_FMT_YUV422P10: return FMT_YUV422P10;
90  case AV_PIX_FMT_YUV422P12: return FMT_YUV422P12;
91  case AV_PIX_FMT_YUV422P14: return FMT_YUV422P14;
92  case AV_PIX_FMT_YUV422P16: return FMT_YUV422P16;
93  case AV_PIX_FMT_YUVJ444P:
94  case AV_PIX_FMT_YUV444P: return FMT_YUV444P;
95  case AV_PIX_FMT_YUV444P9: return FMT_YUV444P9;
96  case AV_PIX_FMT_YUV444P10: return FMT_YUV444P10;
97  case AV_PIX_FMT_YUV444P12: return FMT_YUV444P12;
98  case AV_PIX_FMT_YUV444P14: return FMT_YUV444P14;
99  case AV_PIX_FMT_YUV444P16: return FMT_YUV444P16;
100  case AV_PIX_FMT_UYVY422: return FMT_YUY2;
101  case AV_PIX_FMT_RGB24: return FMT_RGB24;
102  case AV_PIX_FMT_ARGB: return FMT_ARGB32;
103  case AV_PIX_FMT_RGBA: return FMT_RGBA32;
104  case AV_PIX_FMT_BGRA: return FMT_BGRA;
105  case AV_PIX_FMT_CUDA: return FMT_NVDEC;
106  case AV_PIX_FMT_MMAL: return FMT_MMAL;
107  case AV_PIX_FMT_VDPAU: return FMT_VDPAU;
108  case AV_PIX_FMT_VIDEOTOOLBOX: return FMT_VTB;
109  case AV_PIX_FMT_VAAPI: return FMT_VAAPI;
110  case AV_PIX_FMT_DXVA2_VLD: return FMT_DXVA2;
111  case AV_PIX_FMT_MEDIACODEC: return FMT_MEDIACODEC;
112  case AV_PIX_FMT_DRM_PRIME: return FMT_DRMPRIME;
113  default: break;
114  }
115  return FMT_NONE;
116 }
117 
119 {
120  switch (Transfer)
121  {
122  case AVCOL_TRC_SMPTE2084: return MythHDR::HDR10;
123  case AVCOL_TRC_BT2020_10:
124  case AVCOL_TRC_ARIB_STD_B67: return MythHDR::HLG;
125  default: break;
126  }
127  return MythHDR::SDR;
128 }
129 
136 {
137  if (!Frame)
138  return;
139 
140  // Create a wrapper frame and set it up
141  // (yes - this will end up being a wrapper around a wrapper!)
142  if (VideoFrameType type = PixelFormatToFrameType(static_cast<AVPixelFormat>(Frame->format));
144  {
145  // AVFrame video data consists of 3 independent buffers.
146  // MythVideoFrame requires video data to be in one memory block.
147  // Create a copy of the frame with all video data in one memory block.
148  AVFrame tempFrame = *Frame;
149  AVFrame *tf = &tempFrame;
150 
151  size_t b0 = tf->buf[0]->size;
152  size_t b1 = tf->buf[1]->size;
153  size_t b2 = tf->buf[2]->size;
154 
155  // Extend size to a multiple of 16 bytes for MythVideoFrame alignment constraints
156  size_t b0a = ((b0 + 15) / 16) * 16;
157  size_t b1a = ((b1 + 15) / 16) * 16;
158  size_t b2a = ((b2 + 15) / 16) * 16;
159 
160  // Allocate contiguous buffer with enough space for the three segments
161  uint8_t *tbuf{ new uint8_t[b0a + b1a + b2a]{} };
162 
163  tf->data[0] = tbuf;
164  tf->data[1] = tbuf + b0a;
165  tf->data[2] = tbuf + b0a + b1a;
166  memcpy(tf->data[0], tf->buf[0]->data, b0);
167  memcpy(tf->data[1], tf->buf[1]->data, b1);
168  memcpy(tf->data[2], tf->buf[2]->data, b2);
169 
170  // Create a MythVideoFrame from the temporary AVFrame
171  MythVideoFrame mythframe(type, tf->data[0],
172  MythVideoFrame::GetBufferSize(type, tf->width, tf->height),
173  tf->width, tf->height);
174  mythframe.m_offsets[0] = 0;
175  mythframe.m_offsets[1] = tf->data[1] - tf->data[0];
176  mythframe.m_offsets[2] = tf->data[2] - tf->data[0];
177  mythframe.m_pitches[0] = tf->linesize[0];
178  mythframe.m_pitches[1] = tf->linesize[1];
179  mythframe.m_pitches[2] = tf->linesize[2];
180 
181  // Deinterlacing
183  mythframe.m_deinterlaceAllowed = DEINT_ALL;
184  MythDeinterlacer deinterlacer;
185  deinterlacer.Filter(&mythframe, kScan_Interlaced, nullptr, true);
186 
187  // Copy back our deinterlaced frame and free the video buffer of the temporary AVFrame
188  memcpy(Frame->data[0], tf->data[0], b0);
189  memcpy(Frame->data[1], tf->data[1], b1);
190  memcpy(Frame->data[2], tf->data[2], b2);
191  delete[] tbuf;
192 
193  // Must remove buffer before mythframe is deleted
194  mythframe.m_buffer = nullptr;
195  }
196 }
197 
199 int MythAVUtil::FillAVFrame(AVFrame *Frame, const MythVideoFrame *From, AVPixelFormat Fmt)
200 {
201  if (Fmt == AV_PIX_FMT_NONE)
202  Fmt = FrameTypeToPixelFormat(From->m_type);
203 
204  av_image_fill_arrays(Frame->data, Frame->linesize, From->m_buffer,
205  Fmt, From->m_width, From->m_height, IMAGE_ALIGN);
206  Frame->data[1] = From->m_buffer + From->m_offsets[1];
207  Frame->data[2] = From->m_buffer + From->m_offsets[2];
208  Frame->linesize[0] = From->m_pitches[0];
209  Frame->linesize[1] = From->m_pitches[1];
210  Frame->linesize[2] = From->m_pitches[2];
211  return static_cast<int>(MythVideoFrame::GetBufferSize(From->m_type, From->m_width, From->m_height));
212 }
213 
218 {
219  sws_freeContext(m_swsctx);
220 }
221 
222 int MythAVCopy::SizeData(int Width, int Height, AVPixelFormat Fmt)
223 {
224  if (Width == m_width && Height == m_height && Fmt == m_format)
225  return m_size;
226 
227  m_size = av_image_get_buffer_size(Fmt, Width, Height, IMAGE_ALIGN);
228  m_width = Width;
229  m_height = Height;
230  m_format = Fmt;
231  return m_size;
232 }
233 
234 int MythAVCopy::Copy(AVFrame* To, AVPixelFormat ToFmt, const AVFrame* From, AVPixelFormat FromFmt,
235  int Width, int Height)
236 {
237  int newwidth = Width;
238 #ifdef Q_PROCESSOR_ARM
239  // references https://code.mythtv.org/trac/ticket/12888 and
240  // https://trac.ffmpeg.org/ticket/6192
241  // TODO: This is from 2017-02-17 and probably needs to be tested again.
242 
243  // The ARM build of FFMPEG has a bug that if sws_scale is
244  // called with source and dest sizes the same, and
245  // formats as shown below, it causes a bus error and the
246  // application core dumps. To avoid this I make a -1
247  // difference in the new width, causing it to bypass
248  // the code optimization which is failing.
249  if (FromFmt == AV_PIX_FMT_YUV420P && ToFmt == AV_PIX_FMT_BGRA)
250  newwidth = Width - 1;
251 #endif
252  m_swsctx = sws_getCachedContext(m_swsctx, Width, Height, FromFmt,
253  newwidth, Height, ToFmt, SWS_FAST_BILINEAR,
254  nullptr, nullptr, nullptr);
255  if (m_swsctx == nullptr)
256  return -1;
257  sws_scale(m_swsctx, From->data, From->linesize, 0, Height, To->data, To->linesize);
258  return SizeData(Width, Height, ToFmt);
259 }
260 
268  unsigned char* Buffer, AVPixelFormat Fmt)
269 {
270  if (!Buffer)
271  return 0;
272  AVFrame frame;
273  AVPixelFormat fromfmt = MythAVUtil::FrameTypeToPixelFormat(From->m_type);
274  MythAVUtil::FillAVFrame(&frame, From, fromfmt);
275  av_image_fill_arrays(To->data, To->linesize, Buffer, Fmt, From->m_width, From->m_height, IMAGE_ALIGN);
276  return Copy(To, Fmt, &frame, fromfmt, From->m_width, From->m_height);
277 }
278 
284 {
285  FreeAllContexts();
286 }
287 
288 AVCodecContext *MythCodecMap::GetCodecContext(const AVStream* Stream,
289  const AVCodec* Codec,
290  bool NullCodec)
291 {
292  if (Stream == nullptr || Stream->codecpar == nullptr)
293  return nullptr;
294  QMutexLocker lock(&m_mapLock);
295  AVCodecContext* avctx = m_streamMap.value(Stream, nullptr);
296  if (avctx == nullptr)
297  {
298  if (NullCodec)
299  {
300  Codec = nullptr;
301  }
302  else if (Codec == nullptr)
303  {
304  Codec = avcodec_find_decoder(Stream->codecpar->codec_id);
305  if (Codec == nullptr)
306  {
307  LOG(VB_GENERAL, LOG_WARNING, QString("avcodec_find_decoder fail for %1")
308  .arg(Stream->codecpar->codec_id));
309  return nullptr;
310  }
311  }
312  avctx = avcodec_alloc_context3(Codec);
313  if (avctx != nullptr && avcodec_parameters_to_context(avctx, Stream->codecpar) < 0)
314  avcodec_free_context(&avctx);
315 
316  if (avctx != nullptr)
317  {
318  avctx->pkt_timebase = Stream->time_base;
319  m_streamMap.insert(Stream, avctx);
320  }
321  }
322  return avctx;
323 }
324 
325 AVCodecContext *MythCodecMap::FindCodecContext(const AVStream* Stream)
326 {
327  return m_streamMap.value(Stream, nullptr);
328 }
329 
333 void MythCodecMap::FreeCodecContext(const AVStream* Stream)
334 {
335  QMutexLocker lock(&m_mapLock);
336  AVCodecContext* avctx = m_streamMap.take(Stream);
337  if (avctx)
338  {
339  if (avctx->internal)
340  avcodec_flush_buffers(avctx);
341  avcodec_free_context(&avctx);
342  }
343 }
344 
346 {
347  QMutexLocker lock(&m_mapLock);
348  QMap<const AVStream*, AVCodecContext*>::iterator i = m_streamMap.begin();
349  while (i != m_streamMap.end())
350  {
351  const AVStream *stream = i.key();
352  ++i;
353  FreeCodecContext(stream);
354  }
355 }
356 
358 {
359  const int probeBufferSize = 8 * 1024;
360  const AVInputFormat *fmt = nullptr;
361  AVProbeData probe;
362  memset(&probe, 0, sizeof(AVProbeData));
363  probe.filename = "";
364  probe.buf = new unsigned char[probeBufferSize + AVPROBE_PADDING_SIZE];
365  probe.buf_size = probeBufferSize;
366  memset(probe.buf, 0, probeBufferSize + AVPROBE_PADDING_SIZE);
367  av_log_set_level(AV_LOG_FATAL);
368  if (filename == "")
369  m_errorCode = 97;
370  QFile infile(filename);
371  if (m_errorCode == 0 && !infile.open(QIODevice::ReadOnly))
372  m_errorCode = 99;
373  if (m_errorCode==0) {
374  int64_t leng = infile.read(reinterpret_cast<char*>(probe.buf), probeBufferSize);
375  probe.buf_size = static_cast<int>(leng);
376  infile.close();
377  fmt = av_probe_input_format(&probe, static_cast<int>(true));
378  if (fmt == nullptr)
379  m_errorCode = 98;
380  }
381  AVFormatContext *ctx = nullptr;
382  if (m_errorCode==0)
383  {
384  ctx = avformat_alloc_context();
385  m_errorCode = avformat_open_input(&ctx, filename.toUtf8(), fmt, nullptr);
386  }
387  if (m_errorCode==0)
388  m_errorCode = avformat_find_stream_info(ctx, nullptr);
389 
390  if (m_errorCode==0)
391  {
392  for (uint ix = 0; ix < ctx->nb_streams; ix++)
393  {
394  AVStream *stream = ctx->streams[ix];
395  if (stream == nullptr)
396  continue;
397  AVCodecParameters *codecpar = stream->codecpar;
398  const AVCodecDescriptor* desc = nullptr;
400  info.m_codecType = ' ';
401  if (codecpar != nullptr)
402  {
403  desc = avcodec_descriptor_get(codecpar->codec_id);
404  switch (codecpar->codec_type)
405  {
406  case AVMEDIA_TYPE_VIDEO:
407  info.m_codecType = 'V';
408  break;
409  case AVMEDIA_TYPE_AUDIO:
410  info.m_codecType = 'A';
411  break;
412  case AVMEDIA_TYPE_SUBTITLE:
413  info.m_codecType = 'S';
414  break;
415  default:
416  continue;
417  }
418  }
419  if (desc != nullptr)
420  info.m_codecName = desc->name;
421  info.m_duration = stream->duration * stream->time_base.num / stream->time_base.den;
422  if (info.m_codecType == 'V')
423  {
424  if (codecpar != nullptr)
425  {
426  info.m_width = codecpar->width;
427  info.m_height = codecpar->height;
428  info.m_SampleAspectRatio = static_cast<float>(codecpar->sample_aspect_ratio.num)
429  / static_cast<float>(codecpar->sample_aspect_ratio.den);
430  switch (codecpar->field_order)
431  {
432  case AV_FIELD_PROGRESSIVE:
433  info.m_fieldOrder = "PR";
434  break;
435  case AV_FIELD_TT:
436  info.m_fieldOrder = "TT";
437  break;
438  case AV_FIELD_BB:
439  info.m_fieldOrder = "BB";
440  break;
441  case AV_FIELD_TB:
442  info.m_fieldOrder = "TB";
443  break;
444  case AV_FIELD_BT:
445  info.m_fieldOrder = "BT";
446  break;
447  default:
448  break;
449  }
450  }
451  info.m_frameRate = static_cast<float>(stream->r_frame_rate.num)
452  / static_cast<float>(stream->r_frame_rate.den);
453  info.m_avgFrameRate = static_cast<float>(stream->avg_frame_rate.num)
454  / static_cast<float>(stream->avg_frame_rate.den);
455  }
456  if (info.m_codecType == 'A')
457  info.m_channels = codecpar->ch_layout.nb_channels;
458  m_streamInfoList.append(info);
459  }
460  }
461  if (m_errorCode != 0)
462  {
463  switch(m_errorCode) {
464  case 97:
465  m_errorMsg = "File Not Found";
466  break;
467  case 98:
468  m_errorMsg = "av_probe_input_format returned no result";
469  break;
470  case 99:
471  m_errorMsg = "File could not be opened";
472  break;
473  default:
474  m_errorMsg = QString::fromStdString(av_make_error_stdstring_unknown(m_errorCode));
475  }
476  LOG(VB_GENERAL, LOG_ERR,
477  QString("MythStreamInfoList failed for %1. Error code:%2 Message:%3")
478  .arg(filename).arg(m_errorCode).arg(m_errorMsg));
479 
480  }
481 
482  if (ctx != nullptr)
483  {
484  avformat_close_input(&ctx);
485  avformat_free_context(ctx);
486  }
487  delete [] probe.buf;
488 }
FMT_VTB
@ FMT_VTB
Definition: mythframe.h:61
MythStreamInfoList::m_errorMsg
QString m_errorMsg
Definition: mythavutil.h:104
FMT_YUV444P16
@ FMT_YUV444P16
Definition: mythframe.h:48
FMT_ARGB32
@ FMT_ARGB32
Definition: mythframe.h:33
FMT_VDPAU
@ FMT_VDPAU
Definition: mythframe.h:56
MythAVCopy::m_size
int m_size
Definition: mythavutil.h:62
MythAVCopy::m_format
AVPixelFormat m_format
Definition: mythavutil.h:58
FMT_YUV420P14
@ FMT_YUV420P14
Definition: mythframe.h:27
MythCodecMap::GetCodecContext
AVCodecContext * GetCodecContext(const AVStream *Stream, const AVCodec *Codec=nullptr, bool NullCodec=false)
Definition: mythavutil.cpp:288
FMT_YUV444P10
@ FMT_YUV444P10
Definition: mythframe.h:45
MythVideoFrame::m_deinterlaceAllowed
MythDeintType m_deinterlaceAllowed
Definition: mythframe.h:159
Frame
Definition: zmdefines.h:102
MythStreamInfo
Definition: mythavutil.h:75
MythAVUtil::DeinterlaceAVFrame
static void DeinterlaceAVFrame(AVFrame *Frame)
Deinterlace an AVFrame.
Definition: mythavutil.cpp:135
FMT_NVDEC
@ FMT_NVDEC
Definition: mythframe.h:62
FMT_YUV420P16
@ FMT_YUV420P16
Definition: mythframe.h:28
MythCodecMap::FreeAllContexts
void FreeAllContexts()
Definition: mythavutil.cpp:345
av_make_error_stdstring_unknown
MPUBLIC std::string av_make_error_stdstring_unknown(int errnum)
Definition: mythaverror.h:47
MythVideoFrame::m_width
int m_width
Definition: mythframe.h:120
FMT_P016
@ FMT_P016
Definition: mythframe.h:54
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:21
MythAVCopy::m_height
int m_height
Definition: mythavutil.h:61
MythVideoFrame::m_offsets
FrameOffsets m_offsets
Definition: mythframe.h:142
MythHDR::HDRType
HDRType
Definition: mythhdr.h:36
mythdeinterlacer.h
FMT_RGB24
@ FMT_RGB24
Definition: mythframe.h:30
MythCodecMap::FindCodecContext
AVCodecContext * FindCodecContext(const AVStream *Stream)
Definition: mythavutil.cpp:325
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
MythStreamInfoList::m_errorCode
int m_errorCode
Definition: mythavutil.h:103
MythVideoFrame::YUVFormat
static bool YUVFormat(VideoFrameType Type)
Definition: mythframe.h:465
MythAVCopy::m_swsctx
SwsContext * m_swsctx
Definition: mythavutil.h:59
FMT_VAAPI
@ FMT_VAAPI
Definition: mythframe.h:57
MythVideoFrame::GetBufferSize
static size_t GetBufferSize(VideoFrameType Type, int Width, int Height, int Aligned=MYTH_WIDTH_ALIGNMENT)
Definition: mythframe.cpp:412
mythlogging.h
FMT_P010
@ FMT_P010
Definition: mythframe.h:53
FMT_YUY2
@ FMT_YUY2
Definition: mythframe.h:50
FMT_YUV422P12
@ FMT_YUV422P12
Definition: mythframe.h:39
FMT_YUV422P
@ FMT_YUV422P
Definition: mythframe.h:36
FMT_YUV444P12
@ FMT_YUV444P12
Definition: mythframe.h:46
DEINT_ALL
@ DEINT_ALL
Definition: mythframe.h:75
FMT_NV12
@ FMT_NV12
Definition: mythframe.h:52
MythHDR::HDR10
@ HDR10
Definition: mythhdr.h:39
FMT_YUV420P9
@ FMT_YUV420P9
Definition: mythframe.h:24
MythDeinterlacer::Filter
void Filter(MythVideoFrame *Frame, FrameScanType Scan, MythVideoProfile *Profile, bool Force=false)
Deinterlace Frame if needed.
Definition: mythdeinterlacer.cpp:69
VideoFrameType
VideoFrameType
Definition: mythframe.h:19
MythDeinterlacer
Handles software based deinterlacing of video frames.
Definition: mythdeinterlacer.h:17
MythCodecMap::FreeCodecContext
void FreeCodecContext(const AVStream *Stream)
Definition: mythavutil.cpp:333
FMT_YUV444P14
@ FMT_YUV444P14
Definition: mythframe.h:47
FMT_YV12
@ FMT_YV12
Definition: mythframe.h:23
FMT_DRMPRIME
@ FMT_DRMPRIME
Definition: mythframe.h:63
FMT_RGBA32
@ FMT_RGBA32
Definition: mythframe.h:34
FMT_YUV422P9
@ FMT_YUV422P9
Definition: mythframe.h:37
MythAVCopy::m_width
int m_width
Definition: mythavutil.h:60
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:72
FMT_YUV422P16
@ FMT_YUV422P16
Definition: mythframe.h:41
FMT_YUV420P10
@ FMT_YUV420P10
Definition: mythframe.h:25
MythAVUtil::PixelFormatToFrameType
static VideoFrameType PixelFormatToFrameType(AVPixelFormat Fmt)
Definition: mythavutil.cpp:72
MythVideoFrame::m_pitches
FramePitches m_pitches
Definition: mythframe.h:141
MythHDR::HLG
@ HLG
Definition: mythhdr.h:40
FMT_YUV444P
@ FMT_YUV444P
Definition: mythframe.h:43
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
FMT_YUV444P9
@ FMT_YUV444P9
Definition: mythframe.h:44
DEINT_MEDIUM
@ DEINT_MEDIUM
Definition: mythframe.h:70
Buffer
Definition: MythExternControl.h:36
FMT_MMAL
@ FMT_MMAL
Definition: mythframe.h:59
MythVideoFrame::m_type
VideoFrameType m_type
Definition: mythframe.h:118
FMT_BGRA
@ FMT_BGRA
Definition: mythframe.h:31
MythAVUtil::FrameTypeToPixelFormat
static AVPixelFormat FrameTypeToPixelFormat(VideoFrameType Type)
Definition: mythavutil.cpp:28
mythavutil.h
MythAVUtil::FFmpegTransferToHDRType
static MythHDR::HDRType FFmpegTransferToHDRType(int Transfer)
Definition: mythavutil.cpp:118
MythStreamInfoList::MythStreamInfoList
MythStreamInfoList(const QString &filename)
Definition: mythavutil.cpp:357
MythCodecMap::~MythCodecMap
~MythCodecMap()
Definition: mythavutil.cpp:283
MythVideoFrame::m_height
int m_height
Definition: mythframe.h:121
FMT_DXVA2
@ FMT_DXVA2
Definition: mythframe.h:58
MythHDR::SDR
@ SDR
Definition: mythhdr.h:38
azlyrics.info
dictionary info
Definition: azlyrics.py:7
FMT_RGB32
@ FMT_RGB32
endian dependent format, ARGB or BGRA
Definition: mythframe.h:32
MythCodecMap::m_streamMap
QMap< const AVStream *, AVCodecContext * > m_streamMap
Definition: mythavutil.h:40
MythAVCopy::~MythAVCopy
~MythAVCopy()
Definition: mythavutil.cpp:217
MythVideoFrame
Definition: mythframe.h:87
FMT_YUV422P14
@ FMT_YUV422P14
Definition: mythframe.h:40
MythAVCopy::Copy
int Copy(AVFrame *To, const MythVideoFrame *From, unsigned char *Buffer, AVPixelFormat Fmt=AV_PIX_FMT_YUV420P)
Initialise AVFrame and copy contents of VideoFrame frame into it, performing any required conversion.
Definition: mythavutil.cpp:267
FMT_MEDIACODEC
@ FMT_MEDIACODEC
Definition: mythframe.h:60
MythAVCopy::SizeData
int SizeData(int Width, int Height, AVPixelFormat Fmt)
Definition: mythavutil.cpp:222
build_compdb.filename
filename
Definition: build_compdb.py:21
mythaverror.h
MythAVUtil::FillAVFrame
static int FillAVFrame(AVFrame *Frame, const MythVideoFrame *From, AVPixelFormat Fmt=AV_PIX_FMT_NONE)
Initialise AVFrame with content from MythVideoFrame.
Definition: mythavutil.cpp:199
MythVideoFrame::m_deinterlaceSingle
MythDeintType m_deinterlaceSingle
Definition: mythframe.h:157
FMT_YUV422P10
@ FMT_YUV422P10
Definition: mythframe.h:38
FMT_YUV420P12
@ FMT_YUV420P12
Definition: mythframe.h:26
uint
unsigned int uint
Definition: freesurround.h:24
MythVideoFrame::m_buffer
uint8_t * m_buffer
Definition: mythframe.h:119
MythCodecMap::m_mapLock
QRecursiveMutex m_mapLock
Definition: mythavutil.h:41
MythStreamInfoList::m_streamInfoList
QVector< MythStreamInfo > m_streamInfoList
Definition: mythavutil.h:105