forked from i-rinat/libvdpau-va-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdpau-trace.c
1350 lines (1275 loc) · 56.6 KB
/
vdpau-trace.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2013 Rinat Ibragimov
*
* This file is part of libvdpau-va-gl
*
* libvdpau-va-gl is distributed under the terms of the LGPLv3. See COPYING for details.
*/
#include <inttypes.h>
#include <stdio.h>
#include <stdarg.h>
#include "vdpau-soft.h"
#include "vdpau-trace.h"
#include "reverse-constant.h"
static FILE *tlog = NULL; ///< trace target
static const char *trace_header = "[VS] ";
static const char *trace_header_blank = " ";
static int trace_enabled = 1;
static void (*trace_hook)(void *, void *, int, int);
static void *trace_hook_longterm_param = NULL;
void
traceEnableTracing(int flag)
{
trace_enabled = !!flag;
}
void
traceSetTarget(FILE *target)
{
tlog = target;
}
void
traceResetTarget(void)
{
tlog = stdout;
}
void
traceSetHook(void (*hook)(void *param1, void *param2, int origin, int after), void *param)
{
trace_hook = hook;
trace_hook_longterm_param = param;
}
void
traceCallHook(int origin, int after, void *shortterm_param)
{
if (!trace_enabled)
return;
if (trace_hook)
trace_hook(trace_hook_longterm_param, shortterm_param, origin, after);
}
void
traceSetHeader(const char *header, const char *header_blank)
{
trace_header = header;
trace_header_blank = header_blank;
}
void
traceInfo(const char *fmt, ...)
{
if (!trace_enabled)
return;
va_list args;
traceCallHook(-2, 0, NULL);
fprintf(tlog, "%s", trace_header);
va_start(args, fmt);
vfprintf(tlog, fmt, args);
va_end(args);
}
void
traceError(const char *fmt, ...)
{
va_list args;
fprintf(stderr, "%s", trace_header);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
}
static
const char *
rect2string(VdpRect const *rect)
{
// use buffer pool to enable printing many rects in one printf expression
static char bufs[8][100];
static int i_ptr = 0;
i_ptr = (i_ptr + 1) % 8;
char *buf = &bufs[i_ptr][0];
if (NULL == rect) {
snprintf(buf, 100, "NULL");
} else {
snprintf(buf, 100, "(%d,%d,%d,%d)", rect->x0, rect->y0, rect->x1, rect->y1);
}
return buf;
}
VdpStatus
traceVdpGetApiVersion(uint32_t *api_version)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_GET_API_VERSION, 0, NULL);
fprintf(tlog, "%s%s VdpGetApiVersion\n", trace_header, impl_state);
skip:;
VdpStatus ret = softVdpGetApiVersion(api_version);
traceCallHook(VDP_FUNC_ID_GET_API_VERSION, 1, (void *)ret);
return ret;
}
VdpStatus
traceVdpDecoderQueryCapabilities(VdpDevice device,
VdpDecoderProfile profile, VdpBool *is_supported,
uint32_t *max_level, uint32_t *max_macroblocks,
uint32_t *max_width, uint32_t *max_height)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpDecoderQueryCapabilities device=%d, profile=%s\n",
trace_header, impl_state, device, reverse_decoder_profile(profile));
skip:;
VdpStatus ret = softVdpDecoderQueryCapabilities(device, profile, is_supported, max_level,
max_macroblocks, max_width, max_height);
traceCallHook(VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpDecoderCreate(VdpDevice device, VdpDecoderProfile profile,
uint32_t width, uint32_t height, uint32_t max_references, VdpDecoder *decoder)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_DECODER_CREATE, 0, NULL);
fprintf(tlog, "%s%s VdpDecoderCreate device=%d, profile=%s, width=%d, height=%d, "
"max_references=%d\n", trace_header, impl_state, device, reverse_decoder_profile(profile),
width, height, max_references);
skip:;
VdpStatus ret = softVdpDecoderCreate(device, profile, width, height, max_references, decoder);
traceCallHook(VDP_FUNC_ID_DECODER_CREATE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpDecoderDestroy(VdpDecoder decoder)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_DECODER_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpDecoderDestroy decoder=%d\n", trace_header, impl_state, decoder);
skip:;
VdpStatus ret = softVdpDecoderDestroy(decoder);
traceCallHook(VDP_FUNC_ID_DECODER_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpDecoderGetParameters(VdpDecoder decoder,
VdpDecoderProfile *profile, uint32_t *width, uint32_t *height)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_DECODER_GET_PARAMETERS, 0, NULL);
fprintf(tlog, "%s%s VdpDecoderGetParameters decoder=%d\n", trace_header, impl_state, decoder);
skip:;
VdpStatus ret = softVdpDecoderGetParameters(decoder, profile, width, height);
traceCallHook(VDP_FUNC_ID_DECODER_GET_PARAMETERS, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpDecoderRender(VdpDecoder decoder, VdpVideoSurface target,
VdpPictureInfo const *picture_info, uint32_t bitstream_buffer_count,
VdpBitstreamBuffer const *bitstream_buffers)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_DECODER_RENDER, 0, NULL);
fprintf(tlog, "%s%s VdpDecoderRender decoder=%d, target=%d, picture_info=%p, "
"bitstream_buffer_count=%d\n", trace_header, impl_state, decoder, target, picture_info,
bitstream_buffer_count);
skip:;
VdpStatus ret = softVdpDecoderRender(decoder, target, picture_info, bitstream_buffer_count,
bitstream_buffers);
traceCallHook(VDP_FUNC_ID_DECODER_RENDER, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceQueryCapabilities(VdpDevice device,
VdpRGBAFormat surface_rgba_format, VdpBool *is_supported,
uint32_t *max_width, uint32_t *max_height)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceQueryCapabilities device=%d, surface_rgba_format=%s\n",
trace_header, impl_state, device, reverse_rgba_format(surface_rgba_format));
skip:;
VdpStatus ret = softVdpOutputSurfaceQueryCapabilities(device, surface_rgba_format, is_supported,
max_width, max_height);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceQueryGetPutBitsNativeCapabilities(VdpDevice device,
VdpRGBAFormat surface_rgba_format,
VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceQueryGetPutBitsNativeCapabilities device=%d, "
"surface_rgba_format=%s\n", trace_header, impl_state, device,
reverse_rgba_format(surface_rgba_format));
skip:;
VdpStatus ret =
softVdpOutputSurfaceQueryGetPutBitsNativeCapabilities(device, surface_rgba_format,
is_supported);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceQueryPutBitsIndexedCapabilities(VdpDevice device,
VdpRGBAFormat surface_rgba_format,
VdpIndexedFormat bits_indexed_format,
VdpColorTableFormat color_table_format,
VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceQueryPutBitsIndexedCapabilities device=%d, "
"surface_rgba_format=%s, bits_indexed_format=%s, color_table_format=%s\n",
trace_header, impl_state, device, reverse_rgba_format(surface_rgba_format),
reverse_indexed_format(bits_indexed_format),
reverse_color_table_format(color_table_format));
skip:;
VdpStatus ret = softVdpOutputSurfaceQueryPutBitsIndexedCapabilities(device, surface_rgba_format,
bits_indexed_format, color_table_format, is_supported);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device,
VdpRGBAFormat surface_rgba_format,
VdpYCbCrFormat bits_ycbcr_format,
VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceQueryPutBitsYCbCrCapabilities device=%d, "
"surface_rgba_format=%s, bits_ycbcr_format=%s\n", trace_header, impl_state,
device, reverse_rgba_format(surface_rgba_format), reverse_ycbcr_format(bits_ycbcr_format));
skip:;
VdpStatus ret = softVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(device, surface_rgba_format,
bits_ycbcr_format, is_supported);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceCreate(VdpDevice device, VdpRGBAFormat rgba_format,
uint32_t width, uint32_t height, VdpOutputSurface *surface)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_CREATE, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceCreate device=%d, rgba_format=%s, width=%d, height=%d\n",
trace_header, impl_state, device, reverse_rgba_format(rgba_format), width, height);
skip:;
VdpStatus ret = softVdpOutputSurfaceCreate(device, rgba_format, width, height, surface);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_CREATE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceDestroy(VdpOutputSurface surface)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceDestroy surface=%d\n", trace_header, impl_state, surface);
skip:;
VdpStatus ret = softVdpOutputSurfaceDestroy(surface);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
VdpRGBAFormat *rgba_format, uint32_t *width, uint32_t *height)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceGetParameters surface=%d\n", trace_header, impl_state,
surface);
skip:;
VdpStatus ret = softVdpOutputSurfaceGetParameters(surface, rgba_format, width, height);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
VdpRect const *source_rect, void *const *destination_data,
uint32_t const *destination_pitches)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfaceGetBitsNative surface=%d, source_rect=%s\n",
trace_header, impl_state, surface, rect2string(source_rect));
skip:;
VdpStatus ret = softVdpOutputSurfaceGetBitsNative(surface, source_rect, destination_data,
destination_pitches);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
void const *const *source_data, uint32_t const *source_pitches,
VdpRect const *destination_rect)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfacePutBitsNative surface=%d, destination_rect=%s\n",
trace_header, impl_state, surface, rect2string(destination_rect));
skip:;
VdpStatus ret = softVdpOutputSurfacePutBitsNative(surface, source_data, source_pitches,
destination_rect);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
VdpIndexedFormat source_indexed_format,
void const *const *source_data, uint32_t const *source_pitch,
VdpRect const *destination_rect,
VdpColorTableFormat color_table_format, void const *color_table)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfacePutBitsIndexed surface=%d, source_indexed_format=%s, "
"destination_rect=%s, color_table_format=%s\n", trace_header, impl_state, surface,
reverse_indexed_format(source_indexed_format), rect2string(destination_rect),
reverse_color_table_format(color_table_format));
skip:;
VdpStatus ret = softVdpOutputSurfacePutBitsIndexed(surface, source_indexed_format, source_data,
source_pitch, destination_rect, color_table_format, color_table);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpOutputSurfacePutBitsYCbCr(VdpOutputSurface surface,
VdpYCbCrFormat source_ycbcr_format,
void const *const *source_data, uint32_t const *source_pitches,
VdpRect const *destination_rect, VdpCSCMatrix const *csc_matrix)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR, 0, NULL);
fprintf(tlog, "%s%s VdpOutputSurfacePutBitsYCbCr surface=%d, source_ycbcr_format=%s, "
"destination_rect=%s, csc_matrix=%p\n", trace_header, impl_state, surface,
reverse_ycbcr_format(source_ycbcr_format), rect2string(destination_rect), csc_matrix);
skip:;
VdpStatus ret = softVdpOutputSurfacePutBitsYCbCr(surface, source_ycbcr_format, source_data,
source_pitches, destination_rect, csc_matrix);
traceCallHook(VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerQueryFeatureSupport(VdpDevice device,
VdpVideoMixerFeature feature, VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerQueryFeatureSupport device=%d, feature=%s\n",
trace_header, impl_state, device, reverse_video_mixer_feature(feature));
skip:;
VdpStatus ret = softVdpVideoMixerQueryFeatureSupport(device, feature, is_supported);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerQueryParameterSupport(VdpDevice device,
VdpVideoMixerParameter parameter,
VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerQueryParameterSupport device=%d, parameter=%s\n",
trace_header, impl_state, device, reverse_video_mixer_parameter(parameter));
skip:;
VdpStatus ret = softVdpVideoMixerQueryParameterSupport(device, parameter, is_supported);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerQueryAttributeSupport(VdpDevice device,
VdpVideoMixerAttribute attribute, VdpBool *is_supported)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerQueryAttributeSupport device=%d, attribute=%s\n",
trace_header, impl_state, device, reverse_video_mixer_attribute(attribute));
skip:;
VdpStatus ret = softVdpVideoMixerQueryAttributeSupport(device, attribute, is_supported);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerQueryParameterValueRange(VdpDevice device,
VdpVideoMixerParameter parameter,
void *min_value, void *max_value)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerQueryParameterValueRange device=%d, parameter=%s\n",
trace_header, impl_state, device, reverse_video_mixer_parameter(parameter));
skip:;
VdpStatus ret = softVdpVideoMixerQueryParameterValueRange(device, parameter, min_value,
max_value);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerQueryAttributeValueRange(VdpDevice device,
VdpVideoMixerAttribute attribute,
void *min_value, void *max_value)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerQueryAttributeValueRange device=%d, attribute=%s\n",
trace_header, impl_state, device, reverse_video_mixer_attribute(attribute));
skip:;
VdpStatus ret = softVdpVideoMixerQueryAttributeValueRange(device, attribute, min_value,
max_value);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerCreate(VdpDevice device, uint32_t feature_count,
VdpVideoMixerFeature const *features, uint32_t parameter_count,
VdpVideoMixerParameter const *parameters,
void const *const *parameter_values, VdpVideoMixer *mixer)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_CREATE, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerCreate device=%d, feature_count=%d, parameter_count=%d\n",
trace_header, impl_state, device, feature_count, parameter_count);
for (uint32_t k = 0; k < feature_count; k ++)
fprintf(tlog, "%s feature %s\n", trace_header_blank,
reverse_video_mixer_feature(features[k]));
for (uint32_t k = 0; k < parameter_count; k ++) {
fprintf(tlog, "%s parameter ", trace_header_blank);
switch (parameters[k]) {
case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH:
fprintf(tlog, "video surface width = %d\n", *(uint32_t*)parameter_values[k]);
break;
case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT:
fprintf(tlog, "video surface height = %d\n", *(uint32_t*)parameter_values[k]);
break;
case VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE:
fprintf(tlog, "chroma type = %s\n",
reverse_chroma_type(*(uint32_t*)parameter_values[k]));
break;
case VDP_VIDEO_MIXER_PARAMETER_LAYERS:
fprintf(tlog, "layers = %d\n", *(uint32_t*)parameter_values[k]);
break;
default:
fprintf(tlog, "invalid\n");
break;
}
}
skip:;
VdpStatus ret = softVdpVideoMixerCreate(device, feature_count, features, parameter_count,
parameters, parameter_values, mixer);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_CREATE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerSetFeatureEnables(VdpVideoMixer mixer,
uint32_t feature_count, VdpVideoMixerFeature const *features,
VdpBool const *feature_enables)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerSetFeatureEnables mixer=%d, feature_count=%d\n",
trace_header, impl_state, mixer, feature_count);
for (uint32_t k = 0; k < feature_count; k ++) {
fprintf(tlog, "%s feature %d (%s) %s\n", trace_header_blank,
features[k], reverse_video_mixer_feature(features[k]),
feature_enables[k] ? "enabled" : "disabled");
}
skip:;
VdpStatus ret = softVdpVideoMixerSetFeatureEnables(mixer, feature_count, features,
feature_enables);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer,
uint32_t attribute_count,
VdpVideoMixerAttribute const *attributes,
void const *const *attribute_values)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerSetAttributeValues mixer=%d, attribute_count=%d\n",
trace_header, impl_state, mixer, attribute_count);
for (uint32_t k = 0; k < attribute_count; k ++) {
fprintf(tlog, "%s attribute %d (%s)\n", trace_header_blank, attributes[k],
reverse_video_mixer_attribute(attributes[k]));
if (VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX == attributes[k]) {
VdpCSCMatrix *matrix = (VdpCSCMatrix *)(attribute_values[k]);
for (uint32_t j1 = 0; j1 < 3; j1 ++) {
fprintf(tlog, "%s ", trace_header_blank);
for (uint32_t j2 = 0; j2 < 4; j2 ++) {
fprintf(tlog, "%11f", (double)((*matrix)[j1][j2]));
}
fprintf(tlog, "\n");
}
}
}
skip:;
VdpStatus ret = softVdpVideoMixerSetAttributeValues(mixer, attribute_count, attributes,
attribute_values);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerGetFeatureSupport(VdpVideoMixer mixer,
uint32_t feature_count, VdpVideoMixerFeature const *features,
VdpBool *feature_supports)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerGetFeatureSupport mixer=%d, feature_count=%d\n",
trace_header, impl_state, mixer, feature_count);
for (unsigned int k = 0; k < feature_count; k ++)
fprintf(tlog, "%s feature %s\n", trace_header_blank,
reverse_video_mixer_feature(features[k]));
skip:;
VdpStatus ret = softVdpVideoMixerGetFeatureSupport(mixer, feature_count, features,
feature_supports);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerGetFeatureEnables(VdpVideoMixer mixer,
uint32_t feature_count, VdpVideoMixerFeature const *features,
VdpBool *feature_enables)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerGetFeatureEnables mixer=%d, feature_count=%d\n",
trace_header, impl_state, mixer, feature_count);
for (unsigned int k = 0; k < feature_count; k ++)
fprintf(tlog, "%s feature %s\n", trace_header_blank,
reverse_video_mixer_feature(features[k]));
skip:;
VdpStatus ret = softVdpVideoMixerGetFeatureEnables(mixer, feature_count, features,
feature_enables);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerGetParameterValues(VdpVideoMixer mixer,
uint32_t parameter_count,
VdpVideoMixerParameter const *parameters,
void *const *parameter_values)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerGetParameterValues mixer=%d, parameter_count=%d\n",
trace_header, impl_state, mixer, parameter_count);
for (unsigned int k = 0; k < parameter_count; k ++)
fprintf(tlog, "%s parameter %s\n", trace_header_blank,
reverse_video_mixer_parameter(parameters[k]));
skip:;
VdpStatus ret = softVdpVideoMixerGetParameterValues(mixer, parameter_count, parameters,
parameter_values);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerGetAttributeValues(VdpVideoMixer mixer,
uint32_t attribute_count,
VdpVideoMixerAttribute const *attributes,
void *const *attribute_values)
{
const char *impl_state = "{zilch}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerGetAttributeValues mixer=%d, attribute_count=%d\n",
trace_header, impl_state, mixer, attribute_count);
for (unsigned int k = 0; k < attribute_count; k ++)
fprintf(tlog, "%s attribute %s\n", trace_header_blank,
reverse_video_mixer_attribute(attributes[k]));
skip:;
VdpStatus ret = softVdpVideoMixerGetAttributeValues(mixer, attribute_count, attributes,
attribute_values);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerDestroy(VdpVideoMixer mixer)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerDestroy mixer=%d\n", trace_header, impl_state, mixer);
skip:;
VdpStatus ret = softVdpVideoMixerDestroy(mixer);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoMixerRender(VdpVideoMixer mixer,
VdpOutputSurface background_surface, VdpRect const *background_source_rect,
VdpVideoMixerPictureStructure current_picture_structure,
uint32_t video_surface_past_count,
VdpVideoSurface const *video_surface_past,
VdpVideoSurface video_surface_current, uint32_t video_surface_future_count,
VdpVideoSurface const *video_surface_future,
VdpRect const *video_source_rect, VdpOutputSurface destination_surface,
VdpRect const *destination_rect, VdpRect const *destination_video_rect,
uint32_t layer_count, VdpLayer const *layers)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_RENDER, 0, NULL);
fprintf(tlog, "%s%s VdpVideoMixerRender mixer=%d, background_surface=%d, "
"background_source_rect=%s,\n", trace_header, impl_state,
mixer, background_surface, rect2string(background_source_rect));
fprintf(tlog, "%s current_picture_structure=%s, video_surface_past=[",
trace_header_blank, reverser_video_mixer_picture_structure(current_picture_structure));
for (uint32_t k = 0; k < video_surface_past_count; k ++) {
if (0 != k) fprintf(tlog, ",");
fprintf(tlog, "%d", video_surface_past[k]);
}
fprintf(tlog, "],\n%s video_surface_current=%d, video_surface_future=[",
trace_header_blank, video_surface_current);
for (uint32_t k = 0; k < video_surface_future_count; k ++) {
if (0 != k) fprintf(tlog, ",");
fprintf(tlog, "%d", video_surface_future[k]);
}
fprintf(tlog, "],\n%s video_source_rect=%s, destination_surface=%d, destination_rect=%s, "
"destination_video_rect=%s, layers=[", trace_header_blank, rect2string(video_source_rect),
destination_surface, rect2string(destination_rect), rect2string(destination_video_rect));
for (uint32_t k = 0; k < layer_count; k ++) {
if (0 != k) fprintf(tlog, ",");
fprintf(tlog, "{%d,src:%s,dst:%s}", layers[k].source_surface,
rect2string(layers[k].source_rect), rect2string(layers[k].destination_rect));
}
fprintf(tlog, "]\n");
skip:;
VdpStatus ret = softVdpVideoMixerRender(mixer, background_surface, background_source_rect,
current_picture_structure, video_surface_past_count, video_surface_past,
video_surface_current, video_surface_future_count, video_surface_future, video_source_rect,
destination_surface, destination_rect, destination_video_rect, layer_count, layers);
traceCallHook(VDP_FUNC_ID_VIDEO_MIXER_RENDER, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueTargetDestroy presentation_queue_target=%d\n",
trace_header, impl_state, presentation_queue_target);
skip:;
VdpStatus ret = softVdpPresentationQueueTargetDestroy(presentation_queue_target);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueCreate(VdpDevice device,
VdpPresentationQueueTarget presentation_queue_target,
VdpPresentationQueue *presentation_queue)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueCreate device=%d, presentation_queue_target=%d\n",
trace_header, impl_state, device, presentation_queue_target);
skip:;
VdpStatus ret = softVdpPresentationQueueCreate(device, presentation_queue_target,
presentation_queue);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueDestroy presentation_queue=%d\n",
trace_header, impl_state, presentation_queue);
skip:;
VdpStatus ret = softVdpPresentationQueueDestroy(presentation_queue);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueSetBackgroundColor(VdpPresentationQueue presentation_queue,
VdpColor *const background_color)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueSetBackgroundColor presentation_queue=%d, "
"background_color=", trace_header, impl_state, presentation_queue);
if (background_color) {
fprintf(tlog, "(%.2f,%.2f,%.2f,%.2f)\n", background_color->red,
background_color->green, background_color->blue, background_color->alpha);
} else {
fprintf(tlog, "NULL\n");
}
skip:;
VdpStatus ret = softVdpPresentationQueueSetBackgroundColor(presentation_queue,
background_color);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueGetBackgroundColor(VdpPresentationQueue presentation_queue,
VdpColor *background_color)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueGetBackgroundColor presentation_queue=%d\n",
trace_header, impl_state, presentation_queue);
skip:;
VdpStatus ret = softVdpPresentationQueueGetBackgroundColor(presentation_queue,
background_color);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue,
VdpTime *current_time)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueGetTime presentation_queue=%d\n",
trace_header, impl_state, presentation_queue);
skip:;
VdpStatus ret = softVdpPresentationQueueGetTime(presentation_queue, current_time);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface, uint32_t clip_width,
uint32_t clip_height, VdpTime earliest_presentation_time)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueDisplay presentation_queue=%d, surface=%d, "
"clip_width=%d, clip_height=%d,\n", trace_header, impl_state, presentation_queue, surface,
clip_width, clip_height);
fprintf(tlog, "%s earliest_presentation_time=%"PRIu64"\n", trace_header_blank,
earliest_presentation_time);
skip:;
VdpStatus ret = softVdpPresentationQueueDisplay(presentation_queue, surface, clip_width,
clip_height, earliest_presentation_time);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface,
VdpTime *first_presentation_time)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueBlockUntilSurfaceIdle presentation_queue=%d, "
"surface=%d\n", trace_header, impl_state, presentation_queue, surface);
skip:;
VdpStatus ret = softVdpPresentationQueueBlockUntilSurfaceIdle(presentation_queue, surface,
first_presentation_time);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface,
VdpPresentationQueueStatus *status,
VdpTime *first_presentation_time)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS, 0, NULL);
fprintf(tlog, "%s%s VdpPresentationQueueQuerySurfaceStatus presentation_queue=%d, "
"surface=%d\n", trace_header, impl_state, presentation_queue, surface);
skip:;
VdpStatus ret = softVdpPresentationQueueQuerySurfaceStatus(presentation_queue, surface,
status, first_presentation_time);
traceCallHook(VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceQueryCapabilities(VdpDevice device,
VdpChromaType surface_chroma_type, VdpBool *is_supported,
uint32_t *max_width, uint32_t *max_height)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceQueryCapabilities device=%d, surface_chroma_type=%s\n",
trace_header, impl_state, device, reverse_chroma_type(surface_chroma_type));
skip:;
VdpStatus ret = softVdpVideoSurfaceQueryCapabilities(device, surface_chroma_type, is_supported,
max_width, max_height);
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(VdpDevice device,
VdpChromaType surface_chroma_type,
VdpYCbCrFormat bits_ycbcr_format,
VdpBool *is_supported)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities device=%d, "
"surface_chroma_type=%s, bits_ycbcr_format=%s\n", trace_header, impl_state,
device, reverse_chroma_type(surface_chroma_type), reverse_ycbcr_format(bits_ycbcr_format));
skip:;
VdpStatus ret = softVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(device, surface_chroma_type,
bits_ycbcr_format, is_supported);
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
uint32_t width, uint32_t height, VdpVideoSurface *surface)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceCreate, device=%d, chroma_type=%s, width=%d, height=%d\n",
trace_header, impl_state, device, reverse_chroma_type(chroma_type), width, height);
skip:;
VdpStatus ret = softVdpVideoSurfaceCreate(device, chroma_type, width, height, surface);
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceDestroy(VdpVideoSurface surface)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceDestroy surface=%d\n", trace_header, impl_state, surface);
skip:;
VdpStatus ret = softVdpVideoSurfaceDestroy(surface);
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceGetParameters(VdpVideoSurface surface,
VdpChromaType *chroma_type, uint32_t *width, uint32_t *height)
{
const char *impl_state = "{full}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceGetParameters surface=%d\n", trace_header, impl_state,
surface);
skip:;
VdpStatus ret = softVdpVideoSurfaceGetParameters(surface, chroma_type, width, height);
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS, 1, (void*)ret);
return ret;
}
VdpStatus
traceVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface,
VdpYCbCrFormat destination_ycbcr_format,
void *const *destination_data, uint32_t const *destination_pitches)
{
const char *impl_state = "{part}";
if (!trace_enabled)
goto skip;
traceCallHook(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, 0, NULL);
fprintf(tlog, "%s%s VdpVideoSurfaceGetBitsYCbCr surface=%d, destination_ycbcr_format=%s\n",
trace_header, impl_state, surface, reverse_ycbcr_format(destination_ycbcr_format));
skip:;
VdpStatus ret = softVdpVideoSurfaceGetBitsYCbCr(surface, destination_ycbcr_format,
destination_data, destination_pitches);