• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/common/libva


Commit MetaInfo

Revision382acf177ce18c069e0293408afa34c5875296ff (tree)
Time2018-12-26 17:13:22
AuthorLinjie Fu <linjie.fu@inte...>
CommiterXiang, Haihao

Log Message

va/va_trace: add va_TraceSurface support for VA_FOURCC_P010

Add va_TraceSurface support for VA_FOURCC_P010.

Currently, va_TraceSurface could only support nv12.
Add pixel_byte to indicate the bytes per pixel according to FOURCC.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>

Change Summary

Incremental Difference

--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -955,6 +955,7 @@ static void va_TraceSurface(VADisplay dpy, VAContextID context)
955955 unsigned int buffer_name;
956956 void *buffer = NULL;
957957 unsigned char *Y_data, *UV_data, *tmp;
958+ unsigned int pixel_byte;
958959 VAStatus va_status;
959960 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
960961
@@ -1001,20 +1002,27 @@ static void va_TraceSurface(VADisplay dpy, VAContextID context)
10011002 Y_data = (unsigned char*)buffer;
10021003 UV_data = (unsigned char*)buffer + chroma_u_offset;
10031004
1005+ if (fourcc == VA_FOURCC_P010)
1006+ pixel_byte = 2;
1007+ else
1008+ pixel_byte = 1;
1009+
10041010 tmp = Y_data + luma_stride * trace_ctx->trace_surface_yoff;
1011+
10051012 for (i=0; i<trace_ctx->trace_surface_height; i++) {
10061013 fwrite(tmp + trace_ctx->trace_surface_xoff,
10071014 trace_ctx->trace_surface_width,
1008- 1, trace_ctx->trace_fp_surface);
1015+ pixel_byte, trace_ctx->trace_fp_surface);
10091016
10101017 tmp += luma_stride;
10111018 }
1019+
10121020 tmp = UV_data + chroma_u_stride * trace_ctx->trace_surface_yoff / 2;
1013- if (fourcc == VA_FOURCC_NV12) {
1021+ if (fourcc == VA_FOURCC_NV12 || fourcc == VA_FOURCC_P010) {
10141022 for (i=0; i<trace_ctx->trace_surface_height/2; i++) {
10151023 fwrite(tmp + trace_ctx->trace_surface_xoff,
10161024 trace_ctx->trace_surface_width,
1017- 1, trace_ctx->trace_fp_surface);
1025+ pixel_byte, trace_ctx->trace_fp_surface);
10181026
10191027 tmp += chroma_u_stride;
10201028 }