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  case kCodec_AV1: return "AV1";
29 
30  case kCodec_MPEG1_VDPAU: return "MPEG1 VDPAU";
31  case kCodec_MPEG2_VDPAU: return "MPEG2 VDPAU";
32  case kCodec_H263_VDPAU: return "H.263 VDPAU";
33  case kCodec_MPEG4_VDPAU: return "MPEG4 VDPAU";
34  case kCodec_H264_VDPAU: return "H.264 VDPAU";
35  case kCodec_VC1_VDPAU: return "VC1 VDPAU";
36  case kCodec_WMV3_VDPAU: return "WMV3 VDPAU";
37  case kCodec_VP8_VDPAU: return "VP8 VDPAU";
38  case kCodec_VP9_VDPAU: return "VP9 VDPAU";
39  case kCodec_HEVC_VDPAU: return "HEVC VDPAU";
40  case kCodec_AV1_VDPAU: return "AV1 VDPAU";
41 
42  case kCodec_MPEG1_VDPAU_DEC: return "MPEG1 VDPAU DEC";
43  case kCodec_MPEG2_VDPAU_DEC: return "MPEG2 VDPAU DEC";
44  case kCodec_H263_VDPAU_DEC: return "H.263 VDPAU DEC";
45  case kCodec_MPEG4_VDPAU_DEC: return "MPEG4 VDPAU DEC";
46  case kCodec_H264_VDPAU_DEC: return "H.264 VDPAU DEC";
47  case kCodec_VC1_VDPAU_DEC: return "VC1 VDPAU DEC";
48  case kCodec_WMV3_VDPAU_DEC: return "WMV3 VDPAU DEC";
49  case kCodec_VP8_VDPAU_DEC: return "VP8 VDPAU DEC";
50  case kCodec_VP9_VDPAU_DEC: return "VP9 VDPAU DEC";
51  case kCodec_HEVC_VDPAU_DEC: return "HEVC VDPAU DEC";
52  case kCodec_AV1_VDPAU_DEC: return "AV1 VDPAU DEC";
53 
54  case kCodec_MPEG1_VAAPI: return "MPEG1 VAAPI";
55  case kCodec_MPEG2_VAAPI: return "MPEG2 VAAPI";
56  case kCodec_H263_VAAPI: return "H.263 VAAPI";
57  case kCodec_MPEG4_VAAPI: return "MPEG4 VAAPI";
58  case kCodec_H264_VAAPI: return "H.264 VAAPI";
59  case kCodec_VC1_VAAPI: return "VC1 VAAPI";
60  case kCodec_WMV3_VAAPI: return "WMV3 VAAPI";
61  case kCodec_VP8_VAAPI: return "VP8 VAAPI";
62  case kCodec_VP9_VAAPI: return "VP9 VAAPI";
63  case kCodec_HEVC_VAAPI: return "HEVC VAAPI";
64  case kCodec_AV1_VAAPI: return "AV1 VAAPI";
65 
66  case kCodec_MPEG1_VAAPI_DEC: return "MPEG1 VAAPI DEC";
67  case kCodec_MPEG2_VAAPI_DEC: return "MPEG2 VAAPI DEC";
68  case kCodec_H263_VAAPI_DEC: return "H.263 VAAPI DEC";
69  case kCodec_MPEG4_VAAPI_DEC: return "MPEG4 VAAPI DEC";
70  case kCodec_H264_VAAPI_DEC: return "H.264 VAAPI DEC";
71  case kCodec_VC1_VAAPI_DEC: return "VC1 VAAPI DEC";
72  case kCodec_WMV3_VAAPI_DEC: return "WMV3 VAAPI DEC";
73  case kCodec_VP8_VAAPI_DEC: return "VP8 VAAPI DEC";
74  case kCodec_VP9_VAAPI_DEC: return "VP9 VAAPI DEC";
75  case kCodec_HEVC_VAAPI_DEC: return "HEVC VAAPI DEC";
76  case kCodec_AV1_VAAPI_DEC: return "AV1 VAAPI DEC";
77 
78  case kCodec_MPEG1_DXVA2: return "MPEG1 DXVA2";
79  case kCodec_MPEG2_DXVA2: return "MPEG2 DXVA2";
80  case kCodec_H263_DXVA2: return "H.263 DXVA2";
81  case kCodec_MPEG4_DXVA2: return "MPEG4 DXVA2";
82  case kCodec_H264_DXVA2: return "H.264 DXVA2";
83  case kCodec_VC1_DXVA2: return "VC1 DXVA2";
84  case kCodec_WMV3_DXVA2: return "WMV3 DXVA2";
85  case kCodec_VP8_DXVA2: return "VP8 DXVA2";
86  case kCodec_VP9_DXVA2: return "VP9 DXVA2";
87  case kCodec_HEVC_DXVA2: return "HEVC DXVA2";
88  case kCodec_AV1_DXVA2: return "AV1 DXVA2";
89 
90  case kCodec_MPEG1_MEDIACODEC: return "MPEG1 MEDIACODEC";
91  case kCodec_MPEG2_MEDIACODEC: return "MPEG2 MEDIACODEC";
92  case kCodec_H263_MEDIACODEC: return "H.263 MEDIACODEC";
93  case kCodec_MPEG4_MEDIACODEC: return "MPEG4 MEDIACODEC";
94  case kCodec_H264_MEDIACODEC: return "H.264 MEDIACODEC";
95  case kCodec_VC1_MEDIACODEC: return "VC1 MEDIACODEC";
96  case kCodec_WMV3_MEDIACODEC: return "WMV3 MEDIACODEC";
97  case kCodec_VP8_MEDIACODEC: return "VP8 MEDIACODEC";
98  case kCodec_VP9_MEDIACODEC: return "VP9 MEDIACODEC";
99  case kCodec_HEVC_MEDIACODEC: return "HEVC MEDIACODEC";
100  case kCodec_AV1_MEDIACODEC: return "AV1 MEDIACODEC";
101 
102  case kCodec_MPEG1_MEDIACODEC_DEC: return "MPEG1 MEDIACODEC DEC";
103  case kCodec_MPEG2_MEDIACODEC_DEC: return "MPEG2 MEDIACODEC DEC";
104  case kCodec_H263_MEDIACODEC_DEC: return "H.263 MEDIACODEC DEC";
105  case kCodec_MPEG4_MEDIACODEC_DEC: return "MPEG4 MEDIACODEC DEC";
106  case kCodec_H264_MEDIACODEC_DEC: return "H.264 MEDIACODEC DEC";
107  case kCodec_VC1_MEDIACODEC_DEC: return "VC1 MEDIACODEC DEC";
108  case kCodec_WMV3_MEDIACODEC_DEC: return "WMV3 MEDIACODEC DEC";
109  case kCodec_VP8_MEDIACODEC_DEC: return "VP8 MEDIACODEC DEC";
110  case kCodec_VP9_MEDIACODEC_DEC: return "VP9 MEDIACODEC DEC";
111  case kCodec_HEVC_MEDIACODEC_DEC: return "HEVC MEDIACODEC DEC";
112  case kCodec_AV1_MEDIACODEC_DEC: return "AV1 MEDIACODEC DEC";
113 
114  case kCodec_MPEG1_NVDEC: return "MPEG1 NVDEC";
115  case kCodec_MPEG2_NVDEC: return "MPEG2 NVDEC";
116  case kCodec_H263_NVDEC: return "H.263 NVDEC";
117  case kCodec_MPEG4_NVDEC: return "MPEG4 NVDEC";
118  case kCodec_H264_NVDEC: return "H.264 NVDEC";
119  case kCodec_VC1_NVDEC: return "VC1 NVDEC";
120  case kCodec_WMV3_NVDEC: return "WMV3 NVDEC";
121  case kCodec_VP8_NVDEC: return "VP8 NVDEC";
122  case kCodec_VP9_NVDEC: return "VP9 NVDEC";
123  case kCodec_HEVC_NVDEC: return "HEVC NVDEC";
124  case kCodec_AV1_NVDEC: return "AV1 NVDEC";
125 
126  case kCodec_MPEG1_NVDEC_DEC: return "MPEG1 NVDEC DEC";
127  case kCodec_MPEG2_NVDEC_DEC: return "MPEG2 NVDEC DEC";
128  case kCodec_H263_NVDEC_DEC: return "H.263 NVDEC DEC";
129  case kCodec_MPEG4_NVDEC_DEC: return "MPEG4 NVDEC DEC";
130  case kCodec_H264_NVDEC_DEC: return "H.264 NVDEC DEC";
131  case kCodec_VC1_NVDEC_DEC: return "VC1 NVDEC DEC";
132  case kCodec_WMV3_NVDEC_DEC: return "WMV3 NVDEC DEC";
133  case kCodec_VP8_NVDEC_DEC: return "VP8 NVDEC DEC";
134  case kCodec_VP9_NVDEC_DEC: return "VP9 NVDEC DEC";
135  case kCodec_HEVC_NVDEC_DEC: return "HEVC NVDEC DEC";
136  case kCodec_AV1_NVDEC_DEC: return "AV1 NVDEC DEC";
137 
138  case kCodec_MPEG1_VTB: return "MPEG1 VTB";
139  case kCodec_MPEG2_VTB: return "MPEG2 VTB";
140  case kCodec_H263_VTB: return "H.263 VTB";
141  case kCodec_MPEG4_VTB: return "MPEG4 VTB";
142  case kCodec_H264_VTB: return "H.264 VTB";
143  case kCodec_VC1_VTB: return "VC1 VTB";
144  case kCodec_WMV3_VTB: return "WMV3 VTB";
145  case kCodec_VP8_VTB: return "VP8 VTB";
146  case kCodec_VP9_VTB: return "VP9 VTB";
147  case kCodec_HEVC_VTB: return "HEVC VTB";
148  case kCodec_AV1_VTB: return "AV1 VTB";
149 
150  case kCodec_MPEG1_VTB_DEC: return "MPEG1 VTB DEC";
151  case kCodec_MPEG2_VTB_DEC: return "MPEG2 VTB DEC";
152  case kCodec_H263_VTB_DEC: return "H.263 VTB DEC";
153  case kCodec_MPEG4_VTB_DEC: return "MPEG4 VTB DEC";
154  case kCodec_H264_VTB_DEC: return "H.264 VTB DEC";
155  case kCodec_VC1_VTB_DEC: return "VC1 VTB DEC";
156  case kCodec_WMV3_VTB_DEC: return "WMV3 VTB DEC";
157  case kCodec_VP8_VTB_DEC: return "VP8 VTB DEC";
158  case kCodec_VP9_VTB_DEC: return "VP9 VTB DEC";
159  case kCodec_HEVC_VTB_DEC: return "HEVC VTB DEC";
160  case kCodec_AV1_VTB_DEC: return "AV1 VTB DEC";
161 
162  case kCodec_MPEG1_V4L2: return "MPEG1 V4L2";
163  case kCodec_MPEG2_V4L2: return "MPEG2 V4L2";
164  case kCodec_H263_V4L2: return "H.263 V4L2";
165  case kCodec_MPEG4_V4L2: return "MPEG4 V4L2";
166  case kCodec_H264_V4L2: return "H.264 V4L2";
167  case kCodec_VC1_V4L2: return "VC1 V4L2";
168  case kCodec_WMV3_V4L2: return "WMV3 V4L2";
169  case kCodec_VP8_V4L2: return "VP8 V4L2";
170  case kCodec_VP9_V4L2: return "VP9 V4L2";
171  case kCodec_HEVC_V4L2: return "HEVC V4L2";
172  case kCodec_AV1_V4L2: return "AV1 V4L2";
173 
174  case kCodec_MPEG1_V4L2_DEC: return "MPEG1 V4L2 DEC";
175  case kCodec_MPEG2_V4L2_DEC: return "MPEG2 V4L2 DEC";
176  case kCodec_H263_V4L2_DEC: return "H.263 V4L2 DEC";
177  case kCodec_MPEG4_V4L2_DEC: return "MPEG4 V4L2 DEC";
178  case kCodec_H264_V4L2_DEC: return "H.264 V4L2 DEC";
179  case kCodec_VC1_V4L2_DEC: return "VC1 V4L2 DEC";
180  case kCodec_WMV3_V4L2_DEC: return "WMV3 V4L2 DEC";
181  case kCodec_VP8_V4L2_DEC: return "VP8 V4L2 DEC";
182  case kCodec_VP9_V4L2_DEC: return "VP9 V4L2 DEC";
183  case kCodec_HEVC_V4L2_DEC: return "HEVC V4L2 DEC";
184  case kCodec_AV1_V4L2_DEC: return "AV1 V4L2 DEC";
185 
186  case kCodec_MPEG1_MMAL: return "MPEG1 MMAL";
187  case kCodec_MPEG2_MMAL: return "MPEG2 MMAL";
188  case kCodec_H263_MMAL: return "H.263 MMAL";
189  case kCodec_MPEG4_MMAL: return "MPEG4 MMAL";
190  case kCodec_H264_MMAL: return "H.264 MMAL";
191  case kCodec_VC1_MMAL: return "VC1 MMAL";
192  case kCodec_WMV3_MMAL: return "WMV3 MMAL";
193  case kCodec_VP8_MMAL: return "VP8 MMAL";
194  case kCodec_VP9_MMAL: return "VP9 MMAL";
195  case kCodec_HEVC_MMAL: return "HEVC MMAL";
196  case kCodec_AV1_MMAL: return "AV1 MMAL";
197 
198  case kCodec_MPEG1_MMAL_DEC: return "MPEG1 MMAL DEC";
199  case kCodec_MPEG2_MMAL_DEC: return "MPEG2 MMAL DEC";
200  case kCodec_H263_MMAL_DEC: return "H.263 MMAL DEC";
201  case kCodec_MPEG4_MMAL_DEC: return "MPEG4 MMAL DEC";
202  case kCodec_H264_MMAL_DEC: return "H.264 MMAL DEC";
203  case kCodec_VC1_MMAL_DEC: return "VC1 MMAL DEC";
204  case kCodec_WMV3_MMAL_DEC: return "WMV3 MMAL DEC";
205  case kCodec_VP8_MMAL_DEC: return "VP8 MMAL DEC";
206  case kCodec_VP9_MMAL_DEC: return "VP9 MMAL DEC";
207  case kCodec_HEVC_MMAL_DEC: return "HEVC MMAL DEC";
208  case kCodec_AV1_MMAL_DEC: return "AV1 MMAL DEC";
209 
210  case kCodec_MPEG1_DRMPRIME: return "MPEG1 DRMPRIME";
211  case kCodec_MPEG2_DRMPRIME: return "MPEG2 DRMPRIME";
212  case kCodec_H263_DRMPRIME: return "H.263 DRMPRIME";
213  case kCodec_MPEG4_DRMPRIME: return "MPEG4 DRMPRIME";
214  case kCodec_H264_DRMPRIME: return "H.264 DRMPRIME";
215  case kCodec_VC1_DRMPRIME: return "VC1 DRMPRIME";
216  case kCodec_WMV3_DRMPRIME: return "WMV3 DRMPRIME";
217  case kCodec_VP8_DRMPRIME: return "VP8 DRMPRIME";
218  case kCodec_VP9_DRMPRIME: return "VP9 DRMPRIME";
219  case kCodec_HEVC_DRMPRIME: return "HEVC DRMPRIME";
220  case kCodec_AV1_DRMPRIME: return "AV1 DRMPRIME";
221  default:
222  break;
223  }
224 
225  return QString("Unknown(%1)").arg(codecid);
226 }
227 
228 AVCodecID myth2av_codecid(MythCodecID codec_id)
229 {
230  switch (codec_id)
231  {
232  case kCodec_NONE:
233  case kCodec_NUV_MPEG4:
234  case kCodec_NUV_RTjpeg: return AV_CODEC_ID_NONE;
235 
236  case kCodec_MPEG1:
237  case kCodec_MPEG1_VDPAU:
239  case kCodec_MPEG1_VAAPI:
241  case kCodec_MPEG1_DXVA2:
244  case kCodec_MPEG1_NVDEC:
246  case kCodec_MPEG1_VTB:
248  case kCodec_MPEG1_MMAL:
250  case kCodec_MPEG1_V4L2:
252  case kCodec_MPEG1_V4L2_DEC: return AV_CODEC_ID_MPEG1VIDEO;
253 
254  case kCodec_MPEG2:
255  case kCodec_MPEG2_VDPAU:
257  case kCodec_MPEG2_VAAPI:
259  case kCodec_MPEG2_DXVA2:
262  case kCodec_MPEG2_NVDEC:
264  case kCodec_MPEG2_VTB:
266  case kCodec_MPEG2_MMAL:
268  case kCodec_MPEG2_V4L2:
270  case kCodec_MPEG2_V4L2_DEC: return AV_CODEC_ID_MPEG2VIDEO;
271 
272  case kCodec_H263:
273  case kCodec_H263_VDPAU:
275  case kCodec_H263_VAAPI:
277  case kCodec_H263_DXVA2:
280  case kCodec_H263_NVDEC:
282  case kCodec_H263_VTB:
283  case kCodec_H263_VTB_DEC:
284  case kCodec_H263_MMAL:
286  case kCodec_H263_V4L2:
288  case kCodec_H263_V4L2_DEC: return AV_CODEC_ID_H263;
289 
290  case kCodec_MPEG4:
291  case kCodec_MPEG4_VDPAU:
293  case kCodec_MPEG4_VAAPI:
295  case kCodec_MPEG4_DXVA2:
298  case kCodec_MPEG4_NVDEC:
300  case kCodec_MPEG4_VTB:
302  case kCodec_MPEG4_MMAL:
304  case kCodec_MPEG4_V4L2:
306  case kCodec_MPEG4_V4L2_DEC: return AV_CODEC_ID_MPEG4;
307 
308  case kCodec_H264:
309  case kCodec_H264_VDPAU:
311  case kCodec_H264_VAAPI:
313  case kCodec_H264_DXVA2:
316  case kCodec_H264_NVDEC:
318  case kCodec_H264_VTB:
319  case kCodec_H264_VTB_DEC:
320  case kCodec_H264_MMAL:
322  case kCodec_H264_V4L2:
324  case kCodec_H264_V4L2_DEC: return AV_CODEC_ID_H264;
325 
326  case kCodec_VC1:
327  case kCodec_VC1_VDPAU:
329  case kCodec_VC1_VAAPI:
331  case kCodec_VC1_DXVA2:
334  case kCodec_VC1_NVDEC:
336  case kCodec_VC1_VTB:
337  case kCodec_VC1_VTB_DEC:
338  case kCodec_VC1_MMAL:
339  case kCodec_VC1_MMAL_DEC:
340  case kCodec_VC1_V4L2:
341  case kCodec_VC1_DRMPRIME:
342  case kCodec_VC1_V4L2_DEC: return AV_CODEC_ID_VC1;
343 
344  case kCodec_WMV3:
345  case kCodec_WMV3_VDPAU:
347  case kCodec_WMV3_VAAPI:
349  case kCodec_WMV3_DXVA2:
352  case kCodec_WMV3_NVDEC:
354  case kCodec_WMV3_VTB:
355  case kCodec_WMV3_VTB_DEC:
356  case kCodec_WMV3_MMAL:
358  case kCodec_WMV3_V4L2:
360  case kCodec_WMV3_V4L2_DEC: return AV_CODEC_ID_WMV3;
361 
362  case kCodec_VP8:
363  case kCodec_VP8_VDPAU:
365  case kCodec_VP8_VAAPI:
367  case kCodec_VP8_DXVA2:
370  case kCodec_VP8_NVDEC:
372  case kCodec_VP8_VTB:
373  case kCodec_VP8_VTB_DEC:
374  case kCodec_VP8_MMAL:
375  case kCodec_VP8_MMAL_DEC:
376  case kCodec_VP8_V4L2:
377  case kCodec_VP8_DRMPRIME:
378  case kCodec_VP8_V4L2_DEC: return AV_CODEC_ID_VP8;
379 
380  case kCodec_VP9:
381  case kCodec_VP9_VDPAU:
383  case kCodec_VP9_VAAPI:
385  case kCodec_VP9_DXVA2:
388  case kCodec_VP9_NVDEC:
390  case kCodec_VP9_VTB:
391  case kCodec_VP9_VTB_DEC:
392  case kCodec_VP9_MMAL:
393  case kCodec_VP9_MMAL_DEC:
394  case kCodec_VP9_V4L2:
395  case kCodec_VP9_DRMPRIME:
396  case kCodec_VP9_V4L2_DEC: return AV_CODEC_ID_VP9;
397 
398  case kCodec_HEVC:
399  case kCodec_HEVC_VDPAU:
401  case kCodec_HEVC_VAAPI:
403  case kCodec_HEVC_DXVA2:
406  case kCodec_HEVC_NVDEC:
408  case kCodec_HEVC_VTB:
409  case kCodec_HEVC_VTB_DEC:
410  case kCodec_HEVC_MMAL:
412  case kCodec_HEVC_V4L2:
414  case kCodec_HEVC_V4L2_DEC: return AV_CODEC_ID_HEVC;
415 
416  case kCodec_AV1:
417  case kCodec_AV1_VDPAU:
419  case kCodec_AV1_VAAPI:
421  case kCodec_AV1_DXVA2:
424  case kCodec_AV1_NVDEC:
426  case kCodec_AV1_VTB:
427  case kCodec_AV1_VTB_DEC:
428  case kCodec_AV1_MMAL:
429  case kCodec_AV1_MMAL_DEC:
430  case kCodec_AV1_V4L2:
431  case kCodec_AV1_DRMPRIME:
432  case kCodec_AV1_V4L2_DEC: return AV_CODEC_ID_AV1;
433 
434  case kCodec_NORMAL_END:
435  case kCodec_VDPAU_END:
437  case kCodec_VAAPI_END:
439  case kCodec_DXVA2_END:
442  case kCodec_NVDEC_END:
444  case kCodec_VTB_END:
445  case kCodec_VTB_DEC_END:
446  case kCodec_MMAL_END:
447  case kCodec_MMAL_DEC_END:
448  case kCodec_V4L2_END:
449  case kCodec_DRMPRIME_END:
450  case kCodec_V4L2_DEC_END: break;
451  }
452  return AV_CODEC_ID_NONE;
453 }
454 
455 uint mpeg_version(int codec_id)
456 {
457  switch (codec_id)
458  {
459  case AV_CODEC_ID_MPEG1VIDEO: return 1;
460  case AV_CODEC_ID_MPEG2VIDEO: return 2;
461  case AV_CODEC_ID_H263: return 3;
462  case AV_CODEC_ID_MPEG4: return 4;
463  case AV_CODEC_ID_H264: return 5;
464  case AV_CODEC_ID_VC1: return 6;
465  case AV_CODEC_ID_WMV3: return 7;
466  case AV_CODEC_ID_VP8: return 8;
467  case AV_CODEC_ID_VP9: return 9;
468  case AV_CODEC_ID_HEVC: return 10;
469  case AV_CODEC_ID_AV1: return 11;
470  default: break;
471  }
472  return 0;
473 }
474 
476 {
477  switch (codecid)
478  {
479  case kCodec_NUV_RTjpeg:
480  return "RTjpeg";
481 
482  case kCodec_MPEG1:
483  case kCodec_MPEG1_VDPAU:
485  case kCodec_MPEG1_VAAPI:
487  case kCodec_MPEG1_DXVA2:
490  case kCodec_MPEG1_NVDEC:
492  case kCodec_MPEG1_VTB:
494  case kCodec_MPEG1_V4L2:
496  case kCodec_MPEG1_MMAL:
499  case kCodec_MPEG2:
500  case kCodec_MPEG2_VDPAU:
502  case kCodec_MPEG2_VAAPI:
504  case kCodec_MPEG2_DXVA2:
507  case kCodec_MPEG2_NVDEC:
509  case kCodec_MPEG2_VTB:
511  case kCodec_MPEG2_V4L2:
513  case kCodec_MPEG2_MMAL:
516  return "MPEG-2";
517 
518  case kCodec_H263:
519  case kCodec_H263_VDPAU:
521  case kCodec_H263_VAAPI:
523  case kCodec_H263_DXVA2:
526  case kCodec_H263_NVDEC:
528  case kCodec_H263_VTB:
529  case kCodec_H263_VTB_DEC:
530  case kCodec_H263_V4L2:
532  case kCodec_H263_MMAL:
535  return "H.263";
536 
537  case kCodec_NUV_MPEG4:
538  case kCodec_MPEG4:
539  case kCodec_MPEG4_VDPAU:
541  case kCodec_MPEG4_VAAPI:
543  case kCodec_MPEG4_DXVA2:
546  case kCodec_MPEG4_NVDEC:
548  case kCodec_MPEG4_VTB:
550  case kCodec_MPEG4_V4L2:
552  case kCodec_MPEG4_MMAL:
555  return "MPEG-4";
556 
557  case kCodec_H264:
558  case kCodec_H264_VDPAU:
560  case kCodec_H264_VAAPI:
562  case kCodec_H264_DXVA2:
565  case kCodec_H264_NVDEC:
567  case kCodec_H264_VTB:
568  case kCodec_H264_VTB_DEC:
569  case kCodec_H264_V4L2:
571  case kCodec_H264_MMAL:
574  return "H.264";
575 
576  case kCodec_VC1:
577  case kCodec_VC1_VDPAU:
579  case kCodec_VC1_VAAPI:
581  case kCodec_VC1_DXVA2:
584  case kCodec_VC1_NVDEC:
586  case kCodec_VC1_VTB:
587  case kCodec_VC1_VTB_DEC:
588  case kCodec_VC1_V4L2:
589  case kCodec_VC1_V4L2_DEC:
590  case kCodec_VC1_MMAL:
591  case kCodec_VC1_MMAL_DEC:
592  case kCodec_VC1_DRMPRIME:
593  return "VC-1";
594 
595  case kCodec_WMV3:
596  case kCodec_WMV3_VDPAU:
598  case kCodec_WMV3_VAAPI:
600  case kCodec_WMV3_DXVA2:
603  case kCodec_WMV3_NVDEC:
605  case kCodec_WMV3_VTB:
606  case kCodec_WMV3_VTB_DEC:
607  case kCodec_WMV3_V4L2:
609  case kCodec_WMV3_MMAL:
612  return "WMV3";
613 
614  case kCodec_VP8:
615  case kCodec_VP8_VDPAU:
617  case kCodec_VP8_VAAPI:
619  case kCodec_VP8_DXVA2:
622  case kCodec_VP8_NVDEC:
624  case kCodec_VP8_VTB:
625  case kCodec_VP8_VTB_DEC:
626  case kCodec_VP8_V4L2:
627  case kCodec_VP8_V4L2_DEC:
628  case kCodec_VP8_MMAL:
629  case kCodec_VP8_MMAL_DEC:
630  case kCodec_VP8_DRMPRIME:
631  return "VP8";
632 
633  case kCodec_VP9:
634  case kCodec_VP9_VDPAU:
636  case kCodec_VP9_VAAPI:
638  case kCodec_VP9_DXVA2:
641  case kCodec_VP9_NVDEC:
643  case kCodec_VP9_VTB:
644  case kCodec_VP9_VTB_DEC:
645  case kCodec_VP9_V4L2:
646  case kCodec_VP9_V4L2_DEC:
647  case kCodec_VP9_MMAL:
648  case kCodec_VP9_MMAL_DEC:
649  case kCodec_VP9_DRMPRIME:
650  return "VP9";
651 
652  case kCodec_HEVC:
653  case kCodec_HEVC_VDPAU:
655  case kCodec_HEVC_VAAPI:
657  case kCodec_HEVC_DXVA2:
660  case kCodec_HEVC_NVDEC:
662  case kCodec_HEVC_VTB:
663  case kCodec_HEVC_VTB_DEC:
664  case kCodec_HEVC_V4L2:
666  case kCodec_HEVC_MMAL:
669  return "HEVC";
670 
671  case kCodec_AV1:
672  case kCodec_AV1_VDPAU:
674  case kCodec_AV1_VAAPI:
676  case kCodec_AV1_DXVA2:
679  case kCodec_AV1_NVDEC:
681  case kCodec_AV1_VTB:
682  case kCodec_AV1_VTB_DEC:
683  case kCodec_AV1_V4L2:
684  case kCodec_AV1_V4L2_DEC:
685  case kCodec_AV1_MMAL:
686  case kCodec_AV1_MMAL_DEC:
687  case kCodec_AV1_DRMPRIME:
688  return "AV1";
689 
690  case kCodec_NONE:
691  case kCodec_NORMAL_END:
692  case kCodec_VDPAU_END:
694  case kCodec_VAAPI_END:
696  case kCodec_DXVA2_END:
699  case kCodec_NVDEC_END:
701  case kCodec_VTB_END:
702  case kCodec_VTB_DEC_END:
703  case kCodec_V4L2_END:
704  case kCodec_V4L2_DEC_END:
705  case kCodec_MMAL_END:
706  case kCodec_MMAL_DEC_END:
707  case kCodec_DRMPRIME_END:
708  return QString();
709  }
710 
711  return QString();
712 }
713 
714 QString get_decoder_name(MythCodecID codec_id)
715 {
716  if (codec_is_vdpau(codec_id))
717  return "vdpau";
718  if (codec_is_vdpau_dec(codec_id))
719  return "vdpau-dec";
720  if (codec_is_vaapi(codec_id))
721  return "vaapi";
722  if (codec_is_vaapi_dec(codec_id))
723  return "vaapi-dec";
724  if (codec_is_dxva2(codec_id))
725  return "dxva2";
726  if (codec_is_mediacodec(codec_id))
727  return "mediacodec";
728  if (codec_is_mediacodec_dec(codec_id))
729  return "mediacodec-dec";
730  if (codec_is_nvdec(codec_id))
731  return "nvdec";
732  if (codec_is_nvdec_dec(codec_id))
733  return "nvdec-dec";
734  if (codec_is_vtb(codec_id))
735  return "vtb";
736  if (codec_is_vtb_dec(codec_id))
737  return "vtb-dec";
738  if (codec_is_v4l2(codec_id))
739  return "v4l2";
740  if (codec_is_v4l2_dec(codec_id))
741  return "v4l2-dec";
742  if (codec_is_mmal(codec_id))
743  return "mmal";
744  if (codec_is_mmal_dec(codec_id))
745  return "mmal-dec";
746  if (codec_is_drmprime(codec_id))
747  return "drmprime";
748  return "ffmpeg";
749 }
AVCodecID myth2av_codecid(MythCodecID codec_id)
#define codec_is_mmal(id)
Definition: mythcodecid.h:341
QString get_decoder_name(MythCodecID codec_id)
MythCodecID
Definition: mythcodecid.h:10
#define codec_is_vtb_dec(id)
Definition: mythcodecid.h:335
#define codec_is_mmal_dec(id)
Definition: mythcodecid.h:342
#define codec_is_vdpau(id)
Definition: mythcodecid.h:298
#define codec_is_v4l2_dec(id)
Definition: mythcodecid.h:339
#define codec_is_nvdec_dec(id)
Definition: mythcodecid.h:330
#define codec_is_vaapi(id)
Definition: mythcodecid.h:311
#define codec_is_dxva2(id)
Definition: mythcodecid.h:316
#define codec_is_vaapi_dec(id)
Definition: mythcodecid.h:313
unsigned int uint
Definition: compat.h:140
#define codec_is_mediacodec(id)
Definition: mythcodecid.h:323
#define codec_is_vdpau_dec(id)
Definition: mythcodecid.h:304
uint mpeg_version(int codec_id)
#define codec_is_vtb(id)
Definition: mythcodecid.h:333
#define codec_is_nvdec(id)
Definition: mythcodecid.h:328
#define codec_is_drmprime(id)
Definition: mythcodecid.h:296
#define codec_is_v4l2(id)
Definition: mythcodecid.h:338
QString get_encoding_type(MythCodecID codecid)
#define codec_is_mediacodec_dec(id)
Definition: mythcodecid.h:325
QString toString(MythCodecID codecid)
Definition: mythcodecid.cpp:9