[FFmpeg-devel] [PATCH 1/2] libavutil/libavfilter: add opencl wrapper to ffmpeg

Michael Niedermayer michaelni at gmx.at
Sun Mar 24 20:00:46 CET 2013


On Sun, Mar 24, 2013 at 06:40:27PM +0100, Stefano Sabatini wrote:
> On date Sunday 2013-03-24 19:55:00 +0800, Wei Gao encoded:
> > 
> 
> > From ab91c74fa166f557eadb39ab399d7ba667b91340 Mon Sep 17 00:00:00 2001
> > From: highgod0401 <highgod0401 at gmail.com>
> > Date: Sun, 24 Mar 2013 19:20:16 +0800
> > Subject: [PATCH 1/2] add opencl wrapper to ffmpeg
[...]

> > +static int access_binaries(cl_device_id *device_ids, int numdevices, const char *cl_file_name, FILE **fhandle,
> > +                                size_t *binarysizes, char **binaries, int write)
> > +{
> > +    FILE *fd = NULL;
> > +    int status;
> > +    char filename[1024] = {0};
> > +    char cl_name[1024] = {0};
> > +    char devicename[1024] = {0};
> > +    int i;
> > +    for (i = 0; i < numdevices; i++) {
> > +        if (device_ids[i] != 0) {
> > +            status = clGetDeviceInfo(device_ids[i],
> > +                                     CL_DEVICE_NAME,
> > +                                     sizeof(devicename),
> > +                                     devicename,
> > +                                     NULL);
> > +            if (status == CL_SUCCESS) {
> > +                av_strlcpy(cl_name,cl_file_name,sizeof(cl_name));
> > +                snprintf(filename, sizeof(filename),"./%s-%s.bin", cl_name, devicename);

[...]

> > +                    if (binarysizes[i] != 0) {
> > +                        output = fopen(filename, "wb");

[...]

> > +                        }
> > +                        fwrite(binaries[i], sizeof(char), binarysizes[i], output);

theres no gurantee that you have write permission in the current
directory or in any directory.
Also its not nice from a library to drop files in the current
directory unrequested

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130324/ae57f8c4/attachment.asc>


More information about the ffmpeg-devel mailing list