]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/opencl.c
avformat/mpegtsenc: factorize determining pes stream id
[ffmpeg] / libavfilter / opencl.c
index 95f0bfc604c0d3714af396e564d49993436fe3c0..9c46cfdc09282ea2cd54179f48bb7c040febb7c9 100644 (file)
@@ -225,7 +225,7 @@ int ff_opencl_filter_load_program_from_file(AVFilterContext *avctx,
     const char *src_const;
     int err;
 
-    file = fopen(filename, "r");
+    file = av_fopen_utf8(filename, "r");
     if (!file) {
         av_log(avctx, AV_LOG_ERROR, "Unable to open program "
                "source file \"%s\".\n", filename);
@@ -350,3 +350,13 @@ void ff_opencl_print_const_matrix_3x3(AVBPrint *buf, const char *name_str,
     }
     av_bprintf(buf, "};\n");
 }
+
+cl_ulong ff_opencl_get_event_time(cl_event event) {
+    cl_ulong time_start;
+    cl_ulong time_end;
+
+    clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_START, sizeof(time_start), &time_start, NULL);
+    clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_END, sizeof(time_end), &time_end, NULL);
+
+    return time_end - time_start;
+}