MythTV  master
mythcodecid.cpp
Go to the documentation of this file.
1 #include "mythcodecid.h"
2 #include "mythlogging.h"
3 
4 extern "C"
5 {
6 #include "libavcodec/avcodec.h"
7 }
8 
9 QString toString(MythCodecID codecid)
10 {
11  switch (codecid)
12  {
13  case kCodec_NONE: return "None";
14 
15  case kCodec_NUV_RTjpeg: return "NUV RTjpeg";
16  case kCodec_NUV_MPEG4: return "NUV MPEG4";
17 
18  case kCodec_MPEG1: return "MPEG1";
19  case kCodec_MPEG2: return "MPEG2";
20  case kCodec_H263: return "H.263";
21  case kCodec_MPEG4: return "MPEG4";
22  case kCodec_H264: return "H.264";
23  case kCodec_VC1: return "VC-1";
24  case kCodec_WMV3: return "WMV3";
25  case kCodec_VP8: return "VP8";
26  case kCodec_VP9: return "VP9";
27  case kCodec_HEVC: return "HEVC";
28 
29  case kCodec_MPEG1_VDPAU: return "MPEG1 VDPAU";
30  case kCodec_MPEG2_VDPAU: return "MPEG2 VDPAU";
31  case kCodec_H263_VDPAU: return "H.263 VDPAU";
32  case kCodec_MPEG4_VDPAU: return "MPEG4 VDPAU";
33  case kCodec_H264_VDPAU: return "H.264 VDPAU";
34  case kCodec_VC1_VDPAU: return "VC1 VDPAU";
35  case kCodec_WMV3_VDPAU: return "WMV3 VDPAU";
36  case kCodec_VP8_VDPAU: return "VP8 VDPAU";
37  case kCodec_VP9_VDPAU: return "VP9 VDPAU";
38  case kCodec_HEVC_VDPAU: return "HEVC VDPAU";
39 
40  case kCodec_MPEG1_VDPAU_DEC: return "MPEG1 VDPAU DEC";
41  case kCodec_MPEG2_VDPAU_DEC: return "MPEG2 VDPAU DEC";
42  case kCodec_H263_VDPAU_DEC: return "H.263 VDPAU DEC";
43  case kCodec_MPEG4_VDPAU_DEC: return "MPEG4 VDPAU DEC";
44  case kCodec_H264_VDPAU_DEC: return "H.264 VDPAU DEC";
45  case kCodec_VC1_VDPAU_DEC: return "VC1 VDPAU DEC";
46  case kCodec_WMV3_VDPAU_DEC: return "WMV3 VDPAU DEC";
47  case kCodec_VP8_VDPAU_DEC: return "VP8 VDPAU DEC";
48  case kCodec_VP9_VDPAU_DEC: return "VP9 VDPAU DEC";
49  case kCodec_HEVC_VDPAU_DEC: return "HEVC VDPAU DEC";
50 
51  case kCodec_MPEG1_VAAPI: return "MPEG1 VAAPI";
52  case kCodec_MPEG2_VAAPI: return "MPEG2 VAAPI";
53  case kCodec_H263_VAAPI: return "H.263 VAAPI";
54  case kCodec_MPEG4_VAAPI: return "MPEG4 VAAPI";
55  case kCodec_H264_VAAPI: return "H.264 VAAPI";
56  case kCodec_VC1_VAAPI: return "VC1 VAAPI";
57  case kCodec_WMV3_VAAPI: return "WMV3 VAAPI";
58  case kCodec_VP8_VAAPI: return "VP8 VAAPI";
59  case kCodec_VP9_VAAPI: return "VP9 VAAPI";
60  case kCodec_HEVC_VAAPI: return "HEVC VAAPI";
61 
62  case kCodec_MPEG1_VAAPI_DEC: return "MPEG1 VAAPI DEC";
63  case kCodec_MPEG2_VAAPI_DEC: return "MPEG2 VAAPI DEC";
64  case kCodec_H263_VAAPI_DEC: return "H.263 VAAPI DEC";
65  case kCodec_MPEG4_VAAPI_DEC: return "MPEG4 VAAPI DEC";
66  case kCodec_H264_VAAPI_DEC: return "H.264 VAAPI DEC";
67  case kCodec_VC1_VAAPI_DEC: return "VC1 VAAPI DEC";
68  case kCodec_WMV3_VAAPI_DEC: return "WMV3 VAAPI DEC";
69  case kCodec_VP8_VAAPI_DEC: return "VP8 VAAPI DEC";
70  case kCodec_VP9_VAAPI_DEC: return "VP9 VAAPI DEC";
71  case kCodec_HEVC_VAAPI_DEC: return "HEVC VAAPI DEC";
72 
73  case kCodec_MPEG1_DXVA2: return "MPEG1 DXVA2";
74  case kCodec_MPEG2_DXVA2: return "MPEG2 DXVA2";
75  case kCodec_H263_DXVA2: return "H.263 DXVA2";
76  case kCodec_MPEG4_DXVA2: return "MPEG4 DXVA2";
77  case kCodec_H264_DXVA2: return "H.264 DXVA2";
78  case kCodec_VC1_DXVA2: return "VC1 DXVA2";
79  case kCodec_WMV3_DXVA2: return "WMV3 DXVA2";
80  case kCodec_VP8_DXVA2: return "VP8 DXVA2";
81  case kCodec_VP9_DXVA2: return "VP9 DXVA2";
82  case kCodec_HEVC_DXVA2: return "HEVC DXVA2";
83 
84  case kCodec_MPEG1_MEDIACODEC: return "MPEG1 MEDIACODEC";
85  case kCodec_MPEG2_MEDIACODEC: return "MPEG2 MEDIACODEC";
86  case kCodec_H263_MEDIACODEC: return "H.263 MEDIACODEC";
87  case kCodec_MPEG4_MEDIACODEC: return "MPEG4 MEDIACODEC";
88  case kCodec_H264_MEDIACODEC: return "H.264 MEDIACODEC";
89  case kCodec_VC1_MEDIACODEC: return "VC1 MEDIACODEC";
90  case kCodec_WMV3_MEDIACODEC: return "WMV3 MEDIACODEC";
91  case kCodec_VP8_MEDIACODEC: return "VP8 MEDIACODEC";
92  case kCodec_VP9_MEDIACODEC: return "VP9 MEDIACODEC";
93  case kCodec_HEVC_MEDIACODEC: return "HEVC MEDIACODEC";
94 
95  case kCodec_MPEG1_MEDIACODEC_DEC: return "MPEG1 MEDIACODEC DEC";
96  case kCodec_MPEG2_MEDIACODEC_DEC: return "MPEG2 MEDIACODEC DEC";
97  case kCodec_H263_MEDIACODEC_DEC: return "H.263 MEDIACODEC DEC";
98  case kCodec_MPEG4_MEDIACODEC_DEC: return "MPEG4 MEDIACODEC DEC";
99  case kCodec_H264_MEDIACODEC_DEC: return "H.264 MEDIACODEC DEC";
100  case kCodec_VC1_MEDIACODEC_DEC: return "VC1 MEDIACODEC DEC";
101  case kCodec_WMV3_MEDIACODEC_DEC: return "WMV3 MEDIACODEC DEC";
102  case kCodec_VP8_MEDIACODEC_DEC: return "VP8 MEDIACODEC DEC";
103  case kCodec_VP9_MEDIACODEC_DEC: return "VP9 MEDIACODEC DEC";
104  case kCodec_HEVC_MEDIACODEC_DEC: return "HEVC MEDIACODEC DEC";
105 
106  case kCodec_MPEG1_NVDEC: return "MPEG1 NVDEC";
107  case kCodec_MPEG2_NVDEC: return "MPEG2 NVDEC";
108  case kCodec_H263_NVDEC: return "H.263 NVDEC";
109  case kCodec_MPEG4_NVDEC: return "MPEG4 NVDEC";
110  case kCodec_H264_NVDEC: return "H.264 NVDEC";
111  case kCodec_VC1_NVDEC: return "VC1 NVDEC";
112  case kCodec_WMV3_NVDEC: return "WMV3 NVDEC";
113  case kCodec_VP8_NVDEC: return "VP8 NVDEC";
114  case kCodec_VP9_NVDEC: return "VP9 NVDEC";
115  case kCodec_HEVC_NVDEC: return "HEVC NVDEC";
116 
117  case kCodec_MPEG1_NVDEC_DEC: return "MPEG1 NVDEC DEC";
118  case kCodec_MPEG2_NVDEC_DEC: return "MPEG2 NVDEC DEC";
119  case kCodec_H263_NVDEC_DEC: return "H.263 NVDEC DEC";
120  case kCodec_MPEG4_NVDEC_DEC: return "MPEG4 NVDEC DEC";
121  case kCodec_H264_NVDEC_DEC: return "H.264 NVDEC DEC";
122  case kCodec_VC1_NVDEC_DEC: return "VC1 NVDEC DEC";
123  case kCodec_WMV3_NVDEC_DEC: return "WMV3 NVDEC DEC";
124  case kCodec_VP8_NVDEC_DEC: return "VP8 NVDEC DEC";
125  case kCodec_VP9_NVDEC_DEC: return "VP9 NVDEC DEC";
126  case kCodec_HEVC_NVDEC_DEC: return "HEVC NVDEC DEC";
127 
128  case kCodec_MPEG1_VTB: return "MPEG1 VTB";
129  case kCodec_MPEG2_VTB: return "MPEG2 VTB";
130  case kCodec_H263_VTB: return "H.263 VTB";
131  case kCodec_MPEG4_VTB: return "MPEG4 VTB";
132  case kCodec_H264_VTB: return "H.264 VTB";
133  case kCodec_VC1_VTB: return "VC1 VTB";
134  case kCodec_WMV3_VTB: return "WMV3 VTB";
135  case kCodec_VP8_VTB: return "VP8 VTB";
136  case kCodec_VP9_VTB: return "VP9 VTB";
137  case kCodec_HEVC_VTB: return "HEVC VTB";
138 
139  case kCodec_MPEG1_VTB_DEC: return "MPEG1 VTB DEC";
140  case kCodec_MPEG2_VTB_DEC: return "MPEG2 VTB DEC";
141  case kCodec_H263_VTB_DEC: return "H.263 VTB DEC";
142  case kCodec_MPEG4_VTB_DEC: return "MPEG4 VTB DEC";
143  case kCodec_H264_VTB_DEC: return "H.264 VTB DEC";
144  case kCodec_VC1_VTB_DEC: return "VC1 VTB DEC";
145  case kCodec_WMV3_VTB_DEC: return "WMV3 VTB DEC";
146  case kCodec_VP8_VTB_DEC: return "VP8 VTB DEC";
147  case kCodec_VP9_VTB_DEC: return "VP9 VTB DEC";
148  case kCodec_HEVC_VTB_DEC: return "HEVC VTB DEC";
149 
150  case kCodec_MPEG1_V4L2: return "MPEG1 V4L2";
151  case kCodec_MPEG2_V4L2: return "MPEG2 V4L2";
152  case kCodec_H263_V4L2: return "H.263 V4L2";
153  case kCodec_MPEG4_V4L2: return "MPEG4 V4L2";
154  case kCodec_H264_V4L2: return "H.264 V4L2";
155  case kCodec_VC1_V4L2: return "VC1 V4L2";
156  case kCodec_WMV3_V4L2: return "WMV3 V4L2";
157  case kCodec_VP8_V4L2: return "VP8 V4L2";
158  case kCodec_VP9_V4L2: return "VP9 V4L2";
159  case kCodec_HEVC_V4L2: return "HEVC V4L2";
160 
161  case kCodec_MPEG1_V4L2_DEC: return "MPEG1 V4L2 DEC";
162  case kCodec_MPEG2_V4L2_DEC: return "MPEG2 V4L2 DEC";
163  case kCodec_H263_V4L2_DEC: return "H.263 V4L2 DEC";
164  case kCodec_MPEG4_V4L2_DEC: return "MPEG4 V4L2 DEC";
165  case kCodec_H264_V4L2_DEC: return "H.264 V4L2 DEC";
166  case kCodec_VC1_V4L2_DEC: return "VC1 V4L2 DEC";
167  case kCodec_WMV3_V4L2_DEC: return "WMV3 V4L2 DEC";
168  case kCodec_VP8_V4L2_DEC: return "VP8 V4L2 DEC";
169  case kCodec_VP9_V4L2_DEC: return "VP9 V4L2 DEC";
170  case kCodec_HEVC_V4L2_DEC: return "HEVC V4L2 DEC";
171 
172  case kCodec_MPEG1_MMAL: return "MPEG1 MMAL";
173  case kCodec_MPEG2_MMAL: return "MPEG2 MMAL";
174  case kCodec_H263_MMAL: return "H.263 MMAL";
175  case kCodec_MPEG4_MMAL: return "MPEG4 MMAL";
176  case kCodec_H264_MMAL: return "H.264 MMAL";
177  case kCodec_VC1_MMAL: return "VC1 MMAL";
178  case kCodec_WMV3_MMAL: return "WMV3 MMAL";
179  case kCodec_VP8_MMAL: return "VP8 MMAL";
180  case kCodec_VP9_MMAL: return "VP9 MMAL";
181  case kCodec_HEVC_MMAL: return "HEVC MMAL";
182 
183  case kCodec_MPEG1_MMAL_DEC: return "MPEG1 MMAL DEC";
184  case kCodec_MPEG2_MMAL_DEC: return "MPEG2 MMAL DEC";
185  case kCodec_H263_MMAL_DEC: return "H.263 MMAL DEC";
186  case kCodec_MPEG4_MMAL_DEC: return "MPEG4 MMAL DEC";
187  case kCodec_H264_MMAL_DEC: return "H.264 MMAL DEC";
188  case kCodec_VC1_MMAL_DEC: return "VC1 MMAL DEC";
189  case kCodec_WMV3_MMAL_DEC: return "WMV3 MMAL DEC";
190  case kCodec_VP8_MMAL_DEC: return "VP8 MMAL DEC";
191  case kCodec_VP9_MMAL_DEC: return "VP9 MMAL DEC";
192  case kCodec_HEVC_MMAL_DEC: return "HEVC MMAL DEC";
193 
194  case kCodec_MPEG1_DRMPRIME: return "MPEG1 DRMPRIME";
195  case kCodec_MPEG2_DRMPRIME: return "MPEG2 DRMPRIME";
196  case kCodec_H263_DRMPRIME: return "H.263 DRMPRIME";
197  case kCodec_MPEG4_DRMPRIME: return "MPEG4 DRMPRIME";
198  case kCodec_H264_DRMPRIME: return "H.264 DRMPRIME";
199  case kCodec_VC1_DRMPRIME: return "VC1 DRMPRIME";
200  case kCodec_WMV3_DRMPRIME: return "WMV3 DRMPRIME";
201  case kCodec_VP8_DRMPRIME: return "VP8 DRMPRIME";
202  case kCodec_VP9_DRMPRIME: return "VP9 DRMPRIME";
203  case kCodec_HEVC_DRMPRIME: return "HEVC DRMPRIME";
204  default:
205  break;
206  }
207 
208  return QString("Unknown(%1)").arg(codecid);
209 }
210 
211 AVCodecID myth2av_codecid(MythCodecID codec_id)
212 {
213  switch (codec_id)
214  {
215  case kCodec_NONE:
216  case kCodec_NUV_MPEG4:
217  case kCodec_NUV_RTjpeg: return AV_CODEC_ID_NONE;
218 
219  case kCodec_MPEG1:
220  case kCodec_MPEG1_VDPAU:
222  case kCodec_MPEG1_VAAPI:
224  case kCodec_MPEG1_DXVA2:
227  case kCodec_MPEG1_NVDEC:
229  case kCodec_MPEG1_VTB:
231  case kCodec_MPEG1_MMAL:
233  case kCodec_MPEG1_V4L2:
235  case kCodec_MPEG1_V4L2_DEC: return AV_CODEC_ID_MPEG1VIDEO;
236 
237  case kCodec_MPEG2:
238  case kCodec_MPEG2_VDPAU:
240  case kCodec_MPEG2_VAAPI:
242  case kCodec_MPEG2_DXVA2:
245  case kCodec_MPEG2_NVDEC:
247  case kCodec_MPEG2_VTB:
249  case kCodec_MPEG2_MMAL:
251  case kCodec_MPEG2_V4L2:
253  case kCodec_MPEG2_V4L2_DEC: return AV_CODEC_ID_MPEG2VIDEO;
254 
255  case kCodec_H263:
256  case kCodec_H263_VDPAU:
258  case kCodec_H263_VAAPI:
260  case kCodec_H263_DXVA2:
263  case kCodec_H263_NVDEC:
265  case kCodec_H263_VTB:
266  case kCodec_H263_VTB_DEC:
267  case kCodec_H263_MMAL:
269  case kCodec_H263_V4L2:
271  case kCodec_H263_V4L2_DEC: return AV_CODEC_ID_H263;
272 
273  case kCodec_MPEG4:
274  case kCodec_MPEG4_VDPAU:
276  case kCodec_MPEG4_VAAPI:
278  case kCodec_MPEG4_DXVA2:
281  case kCodec_MPEG4_NVDEC:
283  case kCodec_MPEG4_VTB:
285  case kCodec_MPEG4_MMAL:
287  case kCodec_MPEG4_V4L2:
289  case kCodec_MPEG4_V4L2_DEC: return AV_CODEC_ID_MPEG4;
290 
291  case kCodec_H264:
292  case kCodec_H264_VDPAU:
294  case kCodec_H264_VAAPI:
296  case kCodec_H264_DXVA2:
299  case kCodec_H264_NVDEC:
301  case kCodec_H264_VTB:
302  case kCodec_H264_VTB_DEC:
303  case kCodec_H264_MMAL:
305  case kCodec_H264_V4L2:
307  case kCodec_H264_V4L2_DEC: return AV_CODEC_ID_H264;
308 
309  case kCodec_VC1:
310  case kCodec_VC1_VDPAU:
312  case kCodec_VC1_VAAPI:
314  case kCodec_VC1_DXVA2:
317  case kCodec_VC1_NVDEC:
319  case kCodec_VC1_VTB:
320  case kCodec_VC1_VTB_DEC:
321  case kCodec_VC1_MMAL:
322  case kCodec_VC1_MMAL_DEC:
323  case kCodec_VC1_V4L2:
324  case kCodec_VC1_DRMPRIME:
325  case kCodec_VC1_V4L2_DEC: return AV_CODEC_ID_VC1;
326 
327  case kCodec_WMV3:
328  case kCodec_WMV3_VDPAU:
330  case kCodec_WMV3_VAAPI:
332  case kCodec_WMV3_DXVA2:
335  case kCodec_WMV3_NVDEC:
337  case kCodec_WMV3_VTB:
338  case kCodec_WMV3_VTB_DEC:
339  case kCodec_WMV3_MMAL:
341  case kCodec_WMV3_V4L2:
343  case kCodec_WMV3_V4L2_DEC: return AV_CODEC_ID_WMV3;
344 
345  case kCodec_VP8:
346  case kCodec_VP8_VDPAU:
348  case kCodec_VP8_VAAPI:
350  case kCodec_VP8_DXVA2:
353  case kCodec_VP8_NVDEC:
355  case kCodec_VP8_VTB:
356  case kCodec_VP8_VTB_DEC:
357  case kCodec_VP8_MMAL:
358  case kCodec_VP8_MMAL_DEC:
359  case kCodec_VP8_V4L2:
360  case kCodec_VP8_DRMPRIME:
361  case kCodec_VP8_V4L2_DEC: return AV_CODEC_ID_VP8;
362 
363  case kCodec_VP9:
364  case kCodec_VP9_VDPAU:
366  case kCodec_VP9_VAAPI:
368  case kCodec_VP9_DXVA2:
371  case kCodec_VP9_NVDEC:
373  case kCodec_VP9_VTB:
374  case kCodec_VP9_VTB_DEC:
375  case kCodec_VP9_MMAL:
376  case kCodec_VP9_MMAL_DEC:
377  case kCodec_VP9_V4L2:
378  case kCodec_VP9_DRMPRIME:
379  case kCodec_VP9_V4L2_DEC: return AV_CODEC_ID_VP9;
380 
381  case kCodec_HEVC:
382  case kCodec_HEVC_VDPAU:
384  case kCodec_HEVC_VAAPI:
386  case kCodec_HEVC_DXVA2:
389  case kCodec_HEVC_NVDEC:
391  case kCodec_HEVC_VTB:
392  case kCodec_HEVC_VTB_DEC:
393  case kCodec_HEVC_MMAL:
395  case kCodec_HEVC_V4L2:
397  case kCodec_HEVC_V4L2_DEC: return AV_CODEC_ID_HEVC;
398 
399  case kCodec_NORMAL_END:
400  case kCodec_VDPAU_END:
402  case kCodec_VAAPI_END:
404  case kCodec_DXVA2_END:
407  case kCodec_NVDEC_END:
409  case kCodec_VTB_END:
410  case kCodec_VTB_DEC_END:
411  case kCodec_MMAL_END:
412  case kCodec_MMAL_DEC_END:
413  case kCodec_V4L2_END:
414  case kCodec_DRMPRIME_END:
415  case kCodec_V4L2_DEC_END: break;
416  }
417  return AV_CODEC_ID_NONE;
418 }
419 
420 uint mpeg_version(int codec_id)
421 {
422  switch (codec_id)
423  {
424  case AV_CODEC_ID_MPEG1VIDEO: return 1;
425  case AV_CODEC_ID_MPEG2VIDEO: return 2;
426  case AV_CODEC_ID_H263: return 3;
427  case AV_CODEC_ID_MPEG4: return 4;
428  case AV_CODEC_ID_H264: return 5;
429  case AV_CODEC_ID_VC1: return 6;
430  case AV_CODEC_ID_WMV3: return 7;
431  case AV_CODEC_ID_VP8: return 8;
432  case AV_CODEC_ID_VP9: return 9;
433  case AV_CODEC_ID_HEVC: return 10;
434  default: break;
435  }
436  return 0;
437 }
438 
440 {
441  switch (codecid)
442  {
443  case kCodec_NUV_RTjpeg:
444  return "RTjpeg";
445 
446  case kCodec_MPEG1:
447  case kCodec_MPEG1_VDPAU:
449  case kCodec_MPEG1_VAAPI:
451  case kCodec_MPEG1_DXVA2:
454  case kCodec_MPEG1_NVDEC:
456  case kCodec_MPEG1_VTB:
458  case kCodec_MPEG1_V4L2:
460  case kCodec_MPEG1_MMAL:
463  case kCodec_MPEG2:
464  case kCodec_MPEG2_VDPAU:
466  case kCodec_MPEG2_VAAPI:
468  case kCodec_MPEG2_DXVA2:
471  case kCodec_MPEG2_NVDEC:
473  case kCodec_MPEG2_VTB:
475  case kCodec_MPEG2_V4L2:
477  case kCodec_MPEG2_MMAL:
480  return "MPEG-2";
481 
482  case kCodec_H263:
483  case kCodec_H263_VDPAU:
485  case kCodec_H263_VAAPI:
487  case kCodec_H263_DXVA2:
490  case kCodec_H263_NVDEC:
492  case kCodec_H263_VTB:
493  case kCodec_H263_VTB_DEC:
494  case kCodec_H263_V4L2:
496  case kCodec_H263_MMAL:
499  return "H.263";
500 
501  case kCodec_NUV_MPEG4:
502  case kCodec_MPEG4:
503  case kCodec_MPEG4_VDPAU:
505  case kCodec_MPEG4_VAAPI:
507  case kCodec_MPEG4_DXVA2:
510  case kCodec_MPEG4_NVDEC:
512  case kCodec_MPEG4_VTB:
514  case kCodec_MPEG4_V4L2:
516  case kCodec_MPEG4_MMAL:
519  return "MPEG-4";
520 
521  case kCodec_H264:
522  case kCodec_H264_VDPAU:
524  case kCodec_H264_VAAPI:
526  case kCodec_H264_DXVA2:
529  case kCodec_H264_NVDEC:
531  case kCodec_H264_VTB:
532  case kCodec_H264_VTB_DEC:
533  case kCodec_H264_V4L2:
535  case kCodec_H264_MMAL:
538  return "H.264";
539 
540  case kCodec_VC1:
541  case kCodec_VC1_VDPAU:
543  case kCodec_VC1_VAAPI:
545  case kCodec_VC1_DXVA2:
548  case kCodec_VC1_NVDEC:
550  case kCodec_VC1_VTB:
551  case kCodec_VC1_VTB_DEC:
552  case kCodec_VC1_V4L2:
553  case kCodec_VC1_V4L2_DEC:
554  case kCodec_VC1_MMAL:
555  case kCodec_VC1_MMAL_DEC:
556  case kCodec_VC1_DRMPRIME:
557  return "VC-1";
558 
559  case kCodec_WMV3:
560  case kCodec_WMV3_VDPAU:
562  case kCodec_WMV3_VAAPI:
564  case kCodec_WMV3_DXVA2:
567  case kCodec_WMV3_NVDEC:
569  case kCodec_WMV3_VTB:
570  case kCodec_WMV3_VTB_DEC:
571  case kCodec_WMV3_V4L2:
573  case kCodec_WMV3_MMAL:
576  return "WMV3";
577 
578  case kCodec_VP8:
579  case kCodec_VP8_VDPAU:
581  case kCodec_VP8_VAAPI:
583  case kCodec_VP8_DXVA2:
586  case kCodec_VP8_NVDEC:
588  case kCodec_VP8_VTB:
589  case kCodec_VP8_VTB_DEC:
590  case kCodec_VP8_V4L2:
591  case kCodec_VP8_V4L2_DEC:
592  case kCodec_VP8_MMAL:
593  case kCodec_VP8_MMAL_DEC:
594  case kCodec_VP8_DRMPRIME:
595  return "VP8";
596 
597  case kCodec_VP9:
598  case kCodec_VP9_VDPAU:
600  case kCodec_VP9_VAAPI:
602  case kCodec_VP9_DXVA2:
605  case kCodec_VP9_NVDEC:
607  case kCodec_VP9_VTB:
608  case kCodec_VP9_VTB_DEC:
609  case kCodec_VP9_V4L2:
610  case kCodec_VP9_V4L2_DEC:
611  case kCodec_VP9_MMAL:
612  case kCodec_VP9_MMAL_DEC:
613  case kCodec_VP9_DRMPRIME:
614  return "VP9";
615 
616  case kCodec_HEVC:
617  case kCodec_HEVC_VDPAU:
619  case kCodec_HEVC_VAAPI:
621  case kCodec_HEVC_DXVA2:
624  case kCodec_HEVC_NVDEC:
626  case kCodec_HEVC_VTB:
627  case kCodec_HEVC_VTB_DEC:
628  case kCodec_HEVC_V4L2:
630  case kCodec_HEVC_MMAL:
633  return "HEVC";
634 
635  case kCodec_NONE:
636  case kCodec_NORMAL_END:
637  case kCodec_VDPAU_END:
639  case kCodec_VAAPI_END:
641  case kCodec_DXVA2_END:
644  case kCodec_NVDEC_END:
646  case kCodec_VTB_END:
647  case kCodec_VTB_DEC_END:
648  case kCodec_V4L2_END:
649  case kCodec_V4L2_DEC_END:
650  case kCodec_MMAL_END:
651  case kCodec_MMAL_DEC_END:
652  case kCodec_DRMPRIME_END:
653  return QString();
654  }
655 
656  return QString();
657 }
658 
659 QString get_decoder_name(MythCodecID codec_id)
660 {
661  if (codec_is_vdpau(codec_id))
662  return "vdpau";
663  if (codec_is_vdpau_dec(codec_id))
664  return "vdpau-dec";
665  if (codec_is_vaapi(codec_id))
666  return "vaapi";
667  if (codec_is_vaapi_dec(codec_id))
668  return "vaapi-dec";
669  if (codec_is_dxva2(codec_id))
670  return "dxva2";
671  if (codec_is_mediacodec(codec_id))
672  return "mediacodec";
673  if (codec_is_mediacodec_dec(codec_id))
674  return "mediacodec-dec";
675  if (codec_is_nvdec(codec_id))
676  return "nvdec";
677  if (codec_is_nvdec_dec(codec_id))
678  return "nvdec-dec";
679  if (codec_is_vtb(codec_id))
680  return "vtb";
681  if (codec_is_vtb_dec(codec_id))
682  return "vtb-dec";
683  if (codec_is_v4l2(codec_id))
684  return "v4l2";
685  if (codec_is_v4l2_dec(codec_id))
686  return "v4l2-dec";
687  if (codec_is_mmal(codec_id))
688  return "mmal";
689  if (codec_is_mmal_dec(codec_id))
690  return "mmal-dec";
691  if (codec_is_drmprime(codec_id))
692  return "drmprime";
693  return "ffmpeg";
694 }
AVCodecID myth2av_codecid(MythCodecID codec_id)
#define codec_is_mmal(id)
Definition: mythcodecid.h:324
QString get_decoder_name(MythCodecID codec_id)
MythCodecID
Definition: mythcodecid.h:10
#define codec_is_vtb_dec(id)
Definition: mythcodecid.h:318
#define codec_is_mmal_dec(id)
Definition: mythcodecid.h:325
#define codec_is_vdpau(id)
Definition: mythcodecid.h:281
#define codec_is_v4l2_dec(id)
Definition: mythcodecid.h:322
#define codec_is_nvdec_dec(id)
Definition: mythcodecid.h:313
#define codec_is_vaapi(id)
Definition: mythcodecid.h:294
#define codec_is_dxva2(id)
Definition: mythcodecid.h:299
#define codec_is_vaapi_dec(id)
Definition: mythcodecid.h:296
unsigned int uint
Definition: compat.h:140
#define codec_is_mediacodec(id)
Definition: mythcodecid.h:306
#define codec_is_vdpau_dec(id)
Definition: mythcodecid.h:287
uint mpeg_version(int codec_id)
#define codec_is_vtb(id)
Definition: mythcodecid.h:316
#define codec_is_nvdec(id)
Definition: mythcodecid.h:311
#define codec_is_drmprime(id)
Definition: mythcodecid.h:279
#define codec_is_v4l2(id)
Definition: mythcodecid.h:321
QString get_encoding_type(MythCodecID codecid)
#define codec_is_mediacodec_dec(id)
Definition: mythcodecid.h:308
QString toString(MythCodecID codecid)
Definition: mythcodecid.cpp:9