• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

hardware/intel/common/libva


コミットメタ情報

リビジョン3115508fb01b0d74949d9d84c6a9490a4a08df91 (tree)
日時2017-09-27 13:48:16
作者Mark Thompson <sw@jkqx...>
コミッターXiang, Haihao

ログメッセージ

Add namespace prefix to globals

Add "va_" prefix to trace_flag, fool_codec and fool_postp to avoid
polluting the global namespace.

Signed-off-by: Mark Thompson <sw@jkqxz.net>

変更サマリ

差分

--- a/va/android/va_android.cpp
+++ b/va/android/va_android.cpp
@@ -166,8 +166,8 @@ VADisplay vaGetDisplay (
166166
167167
168168 extern "C" {
169- extern int fool_postp; /* do nothing for vaPutSurface if set */
170- extern int trace_flag; /* trace vaPutSurface parameters */
169+ extern int va_fool_postp; /* do nothing for vaPutSurface if set */
170+ extern int va_trace_flag; /* trace vaPutSurface parameters */
171171
172172 void va_TracePutSurface (
173173 VADisplay dpy,
--- a/va/va_fool.c
+++ b/va/va_fool.c
@@ -62,14 +62,14 @@
6262
6363
6464 /* global settings */
65-int fool_codec = 0;
66-int fool_postp = 0;
65+int va_fool_codec = 0;
66+int va_fool_postp = 0;
6767
6868 #define FOOL_BUFID_MAGIC 0x12345600
6969 #define FOOL_BUFID_MASK 0xffffff00
7070
7171 struct fool_context {
72- int enabled; /* fool_codec is global, and it is for concurent encode/decode */
72+ int enabled; /* va_fool_codec is global, and it is for concurent encode/decode */
7373 char *fn_enc;/* file pattern with codedbuf content for encode */
7474 char *segbuf_enc; /* the segment buffer of coded buffer, load frome fn_enc */
7575 int file_count;
@@ -114,22 +114,22 @@ void va_FoolInit(VADisplay dpy)
114114 return;
115115
116116 if (va_parseConfig("LIBVA_FOOL_POSTP", NULL) == 0) {
117- fool_postp = 1;
117+ va_fool_postp = 1;
118118 va_infoMessage(dpy, "LIBVA_FOOL_POSTP is on, dummy vaPutSurface\n");
119119 }
120120
121121 if (va_parseConfig("LIBVA_FOOL_DECODE", NULL) == 0) {
122- fool_codec |= VA_FOOL_FLAG_DECODE;
122+ va_fool_codec |= VA_FOOL_FLAG_DECODE;
123123 va_infoMessage(dpy, "LIBVA_FOOL_DECODE is on, dummy decode\n");
124124 }
125125 if (va_parseConfig("LIBVA_FOOL_ENCODE", &env_value[0]) == 0) {
126- fool_codec |= VA_FOOL_FLAG_ENCODE;
126+ va_fool_codec |= VA_FOOL_FLAG_ENCODE;
127127 fool_ctx->fn_enc = strdup(env_value);
128128 va_infoMessage(dpy, "LIBVA_FOOL_ENCODE is on, load encode data from file with patten %s\n",
129129 fool_ctx->fn_enc);
130130 }
131131 if (va_parseConfig("LIBVA_FOOL_JPEG", &env_value[0]) == 0) {
132- fool_codec |= VA_FOOL_FLAG_JPEG;
132+ va_fool_codec |= VA_FOOL_FLAG_JPEG;
133133 fool_ctx->fn_jpg = strdup(env_value);
134134 va_infoMessage(dpy, "LIBVA_FOOL_JPEG is on, load encode data from file with patten %s\n",
135135 fool_ctx->fn_jpg);
@@ -177,15 +177,15 @@ int va_FoolCreateConfig(
177177 fool_ctx->entrypoint = entrypoint;
178178
179179 /*
180- * check fool_codec to align with current context
181- * e.g. fool_codec = decode then for encode, the
180+ * check va_fool_codec to align with current context
181+ * e.g. va_fool_codec = decode then for encode, the
182182 * vaBegin/vaRender/vaEnd also run into fool path
183183 * which is not desired
184184 */
185- if (((fool_codec & VA_FOOL_FLAG_DECODE) && (entrypoint == VAEntrypointVLD)) ||
186- ((fool_codec & VA_FOOL_FLAG_JPEG) && (entrypoint == VAEntrypointEncPicture)))
185+ if (((va_fool_codec & VA_FOOL_FLAG_DECODE) && (entrypoint == VAEntrypointVLD)) ||
186+ ((va_fool_codec & VA_FOOL_FLAG_JPEG) && (entrypoint == VAEntrypointEncPicture)))
187187 fool_ctx->enabled = 1;
188- else if ((fool_codec & VA_FOOL_FLAG_ENCODE) && (entrypoint == VAEntrypointEncSlice)) {
188+ else if ((va_fool_codec & VA_FOOL_FLAG_ENCODE) && (entrypoint == VAEntrypointEncSlice)) {
189189 /* H264 is desired */
190190 if (((profile == VAProfileH264Baseline ||
191191 profile == VAProfileH264Main ||
--- a/va/va_fool.h
+++ b/va/va_fool.h
@@ -32,15 +32,15 @@
3232 extern "C" {
3333 #endif
3434
35-extern int fool_codec;
36-extern int fool_postp;
35+extern int va_fool_codec;
36+extern int va_fool_postp;
3737
3838 #define VA_FOOL_FLAG_DECODE 0x1
3939 #define VA_FOOL_FLAG_ENCODE 0x2
4040 #define VA_FOOL_FLAG_JPEG 0x4
4141
4242 #define VA_FOOL_FUNC(fool_func,...) \
43- if (fool_codec) { \
43+ if (va_fool_codec) { \
4444 if (fool_func(__VA_ARGS__)) \
4545 return VA_STATUS_SUCCESS; \
4646 }
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -67,7 +67,7 @@
6767 /* global settings */
6868
6969 /* LIBVA_TRACE */
70-int trace_flag = 0;
70+int va_trace_flag = 0;
7171
7272 #define MAX_TRACE_CTX_NUM 64
7373 #define TRACE_CTX_ID_MASK (MAX_TRACE_CTX_NUM - 1)
@@ -745,7 +745,7 @@ void va_TraceInit(VADisplay dpy)
745745 trace_ctx->plog_file = start_tracing2log_file(pva_trace);
746746 if(trace_ctx->plog_file) {
747747 trace_ctx->plog_file_list[0] = trace_ctx->plog_file;
748- trace_flag = VA_TRACE_FLAG_LOG;
748+ va_trace_flag = VA_TRACE_FLAG_LOG;
749749
750750 va_infoMessage("LIBVA_TRACE is on, save log into %s\n",
751751 trace_ctx->plog_file->fn_log);
@@ -755,8 +755,8 @@ void va_TraceInit(VADisplay dpy)
755755 }
756756
757757 /* may re-get the global settings for multiple context */
758- if ((trace_flag & VA_TRACE_FLAG_LOG) && (va_parseConfig("LIBVA_TRACE_BUFDATA", NULL) == 0)) {
759- trace_flag |= VA_TRACE_FLAG_BUFDATA;
758+ if ((va_trace_flag & VA_TRACE_FLAG_LOG) && (va_parseConfig("LIBVA_TRACE_BUFDATA", NULL) == 0)) {
759+ va_trace_flag |= VA_TRACE_FLAG_BUFDATA;
760760
761761 va_infoMessage(dpy, "LIBVA_TRACE_BUFDATA is on, dump buffer into log file\n");
762762 }
@@ -764,7 +764,7 @@ void va_TraceInit(VADisplay dpy)
764764 /* per-context setting */
765765 if (va_parseConfig("LIBVA_TRACE_CODEDBUF", &env_value[0]) == 0) {
766766 pva_trace->fn_codedbuf_env = strdup(env_value);
767- trace_flag |= VA_TRACE_FLAG_CODEDBUF;
767+ va_trace_flag |= VA_TRACE_FLAG_CODEDBUF;
768768 }
769769
770770 if (va_parseConfig("LIBVA_TRACE_SURFACE", &env_value[0]) == 0) {
@@ -777,11 +777,11 @@ void va_TraceInit(VADisplay dpy)
777777 * if no dec/enc in file name, set both
778778 */
779779 if (strstr(env_value, "dec"))
780- trace_flag |= VA_TRACE_FLAG_SURFACE_DECODE;
780+ va_trace_flag |= VA_TRACE_FLAG_SURFACE_DECODE;
781781 if (strstr(env_value, "enc"))
782- trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE;
782+ va_trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE;
783783 if (strstr(env_value, "jpeg") || strstr(env_value, "jpg"))
784- trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG;
784+ va_trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG;
785785
786786 if (va_parseConfig("LIBVA_TRACE_SURFACE_GEOMETRY", &env_value[0]) == 0) {
787787 char *p = env_value, *q;
@@ -811,7 +811,7 @@ void va_TraceInit(VADisplay dpy)
811811 ((VADisplayContextP)dpy)->vatrace = (void *)pva_trace;
812812 pva_trace->dpy = dpy;
813813
814- if(!trace_flag)
814+ if(!va_trace_flag)
815815 va_TraceEnd(dpy);
816816 }
817817
@@ -889,7 +889,7 @@ static void va_TraceVPrint(struct trace_context *trace_ctx, const char *msg, va_
889889 {
890890 FILE *fp = NULL;
891891
892- if (!(trace_flag & VA_TRACE_FLAG_LOG)
892+ if (!(va_trace_flag & VA_TRACE_FLAG_LOG)
893893 || !trace_ctx->plog_file)
894894 return;
895895
@@ -1326,7 +1326,7 @@ void va_TraceCreateContext(
13261326 trace_ctx->trace_profile = pva_trace->config_info[i].trace_profile;
13271327 trace_ctx->trace_entrypoint = pva_trace->config_info[i].trace_entrypoint;
13281328
1329- if(trace_flag & VA_TRACE_FLAG_LOG) {
1329+ if(va_trace_flag & VA_TRACE_FLAG_LOG) {
13301330 trace_ctx->plog_file = start_tracing2log_file(pva_trace);
13311331 if(!trace_ctx->plog_file) {
13321332 va_errorMessage(dpy, "Can't get trace log file for ctx 0x%08x\n",
@@ -1343,7 +1343,7 @@ void va_TraceCreateContext(
13431343
13441344 trace_ctx->trace_context = *context;
13451345 TRACE_FUNCNAME(idx);
1346- va_TraceMsg(trace_ctx, "\tcontext = 0x%08x trace_flag 0x%x\n", *context, trace_flag);
1346+ va_TraceMsg(trace_ctx, "\tcontext = 0x%08x va_trace_flag 0x%x\n", *context, va_trace_flag);
13471347 va_TraceMsg(trace_ctx, "\tprofile = %d entrypoint = %d\n", trace_ctx->trace_profile,
13481348 trace_ctx->trace_entrypoint);
13491349 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config_id);
@@ -1371,21 +1371,21 @@ void va_TraceCreateContext(
13711371 encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
13721372 decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
13731373 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
1374- if ((encode && (trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
1375- (decode && (trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
1376- (jpeg && (trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) {
1374+ if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
1375+ (decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
1376+ (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) {
13771377 if(open_tracing_specil_file(pva_trace, trace_ctx, 1) < 0) {
13781378 va_errorMessage(dpy, "Open surface fail failed for ctx 0x%08x\n", *context);
13791379
1380- trace_flag &= ~(VA_TRACE_FLAG_SURFACE);
1380+ va_trace_flag &= ~(VA_TRACE_FLAG_SURFACE);
13811381 }
13821382 }
13831383
1384- if (encode && (trace_flag & VA_TRACE_FLAG_CODEDBUF)) {
1384+ if (encode && (va_trace_flag & VA_TRACE_FLAG_CODEDBUF)) {
13851385 if(open_tracing_specil_file(pva_trace, trace_ctx, 0) < 0) {
13861386 va_errorMessage(dpy, "Open codedbuf fail failed for ctx 0x%08x\n", *context);
13871387
1388- trace_flag &= ~(VA_TRACE_FLAG_CODEDBUF);
1388+ va_trace_flag &= ~(VA_TRACE_FLAG_CODEDBUF);
13891389 }
13901390 }
13911391
@@ -1658,7 +1658,7 @@ static void va_TraceVABuffers(
16581658 if(trace_ctx->plog_file)
16591659 fp = trace_ctx->plog_file->fp_log;
16601660
1661- if ((trace_flag & VA_TRACE_FLAG_BUFDATA) && fp) {
1661+ if ((va_trace_flag & VA_TRACE_FLAG_BUFDATA) && fp) {
16621662 for (i=0; i<size; i++) {
16631663 unsigned char value = p[i];
16641664
@@ -4886,12 +4886,12 @@ void va_TraceEndPicture(
48864886 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
48874887
48884888 /* trace encode source surface, can do it before HW completes rendering */
4889- if ((encode && (trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE))||
4890- (jpeg && (trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)))
4889+ if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE))||
4890+ (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)))
48914891 va_TraceSurface(dpy, context);
48924892
48934893 /* trace decoded surface, do it after HW completes rendering */
4894- if (decode && ((trace_flag & VA_TRACE_FLAG_SURFACE_DECODE))) {
4894+ if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE))) {
48954895 vaSyncSurface(dpy, trace_ctx->trace_rendertarget);
48964896 va_TraceSurface(dpy, context);
48974897 }
--- a/va/va_trace.h
+++ b/va/va_trace.h
@@ -29,7 +29,7 @@
2929 extern "C" {
3030 #endif
3131
32-extern int trace_flag;
32+extern int va_trace_flag;
3333
3434 #define VA_TRACE_FLAG_LOG 0x1
3535 #define VA_TRACE_FLAG_BUFDATA 0x2
@@ -42,11 +42,11 @@ extern int trace_flag;
4242 VA_TRACE_FLAG_SURFACE_JPEG)
4343
4444 #define VA_TRACE_LOG(trace_func,...) \
45- if (trace_flag & VA_TRACE_FLAG_LOG) { \
45+ if (va_trace_flag & VA_TRACE_FLAG_LOG) { \
4646 trace_func(__VA_ARGS__); \
4747 }
4848 #define VA_TRACE_ALL(trace_func,...) \
49- if (trace_flag) { \
49+ if (va_trace_flag) { \
5050 trace_func(__VA_ARGS__); \
5151 }
5252
--- a/va/x11/va_x11.c
+++ b/va/x11/va_x11.c
@@ -232,7 +232,7 @@ VAStatus vaPutSurface (
232232 {
233233 VADriverContextP ctx;
234234
235- if (fool_postp)
235+ if (va_fool_postp)
236236 return VA_STATUS_SUCCESS;
237237
238238 CHECK_DISPLAY(dpy);