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