From: handbrake Date: Tue, 15 Jan 2013 07:35:19 +0000 (+0000) Subject: modified some display information errors X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85b4cc450b4fbbd54d6355b91665657523200b10;p=handbrake modified some display information errors modified GUI OpenCL/UVD checkbox enable errors modified compile without enable-opencl work errors git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5171 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs index 0340f6c44..f8bc5f762 100644 --- a/contrib/ffmpeg/module.defs +++ b/contrib/ffmpeg/module.defs @@ -18,8 +18,13 @@ FFMPEG.CONFIGURE.extra = \ --disable-avfilter \ --disable-muxers \ --disable-network \ - --disable-vaapi \ + --disable-hwaccels \ + --disable-encoders \ --enable-dxva2 \ + --enable-hwaccel=h264_dxva2 \ + --enable-hwaccel=mpeg2_dxva2 \ + --enable-hwaccel=vc1_dxva2 \ + --enable-hwaccel=wmv3_dxva2 \ --enable-encoder=aac \ --enable-encoder=ac3 \ --enable-encoder=flac \ diff --git a/libhb/cropscaleaccl.c b/libhb/cropscaleaccl.c index 775e71b5c..b254acde0 100644 --- a/libhb/cropscaleaccl.c +++ b/libhb/cropscaleaccl.c @@ -46,7 +46,7 @@ hb_filter_object_t hb_filter_crop_scale_accl = { .id = HB_FILTER_CROP_SCALE_ACCL, .enforce_order = 1, - .name = "Hardware Acceleration Crop and Scale", + .name = "Custom Crop and Scale", .settings = NULL, .init = hb_crop_scale_init, .work = hb_crop_scale_work, diff --git a/libhb/decavcodecaccl.c b/libhb/decavcodecaccl.c index 5b19ed688..bab7296f3 100644 --- a/libhb/decavcodecaccl.c +++ b/libhb/decavcodecaccl.c @@ -276,7 +276,7 @@ static hb_buffer_t *copy_frame( hb_work_private_t *pv, AVFrame *frame ) { hb_buffer_t *buf; int ww, hh; - if( (w > pv->job->width || h > pv->job->height) ) + if( (w > pv->job->width || h > pv->job->height) && (hb_get_gui_info(&hb_gui, 2) == 1) ) { buf = hb_video_buffer_init( pv->job->width, pv->job->height ); ww = pv->job->width; diff --git a/libhb/openclwrapper.c b/libhb/openclwrapper.c index 7e0195a63..3a0f12f3e 100644 --- a/libhb/openclwrapper.c +++ b/libhb/openclwrapper.c @@ -160,14 +160,14 @@ int hb_binary_generated( cl_context context, const char * cl_file_name, FILE ** NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: hb_binary_generated: Get context info failed\n" ); + hb_log( "Notice: Get context info failed\n" ); return 0; } devices = (cl_device_id*)malloc( sizeof(cl_device_id) * numDevices ); if( devices == NULL ) { - hb_log( "hb_binary_generated: No device found\n" ); + hb_log( "Notice: No device found\n" ); return 0; } @@ -243,13 +243,13 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: Get program info failed\n" ); + hb_log( "Notice: Get program info failed, when generate binary file from kernel source\n" ); return 0; } devices = (cl_device_id*)malloc( sizeof(cl_device_id) * numDevices ); if( devices == NULL ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: No device found\n" ); + hb_log( "Notice: No device found, when generate binary file from kernel source\n" ); return 0; } /* grab the handles to all of the devices in the program. */ @@ -260,7 +260,7 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: Get program info failed\n" ); + hb_log( "Notice: Get program info failed, when generate binary file from kernel source\n" ); return 0; } /* figure out the sizes of each of the binaries. */ @@ -272,14 +272,14 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ binarySizes, NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: Get program info failed\n" ); + hb_log( "Notice: Get program info failed, when generate binary file from kernel source\n" ); return 0; } /* copy over all of the generated binaries. */ binaries = (char**)malloc( sizeof(char *) * numDevices ); if( binaries == NULL ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: malloc for binaries failed\n" ); + hb_log( "Notice: malloc for binaries failed, when generate binary file from kernel source\n" ); return 0; } @@ -290,7 +290,7 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ binaries[i] = (char*)malloc( sizeof(char) * binarySizes[i] ); if( binaries[i] == NULL ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: malloc for binary[%d] failed\n", i ); + hb_log( "Notice: malloc for binary[%d] failed, when generate binary file from kernel source\n", i ); return 0; } } @@ -307,7 +307,7 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: Get program info failed\n" ); + hb_log( "Notice: Get program info failed, when generate binary file from kernel source\n" ); return 0; } /* dump out each binary into its own separate file. */ @@ -331,7 +331,7 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_ if( !hb_write_binary_to_file( fileName, binaries[i], binarySizes[i] )) { - hb_log( "ERROR: hb_generat_bin_from_kernel_source: write binary[%s] failed\n", fileName ); + hb_log( "Notice: Unable to write opencl kernel, writing to tempory directory instead." ); //printf( "opencl-wrapper: write binary[%s] failds\n", fileName); return 0; } //else @@ -422,7 +422,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) status = clGetPlatformIDs( 0, NULL, &numPlatforms ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: OpenCL device platform not found.\n" ); + hb_log( "Notice: OpenCL device platform not found.\n" ); return(1); } gpu_info->platform = NULL; @@ -438,7 +438,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) if( status != CL_SUCCESS ) { - hb_log( "ERROR: Specific opencl platform not found.\n" ); + hb_log( "Notice: Specific opencl platform not found.\n" ); return(1); } @@ -450,7 +450,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) if( status != CL_SUCCESS ) { - hb_log( "ERROR: No more platform vendor info.\n" ); + hb_log( "Notice: No more platform vendor info.\n" ); return(1); } gpu_info->platform = platforms[i]; @@ -470,7 +470,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) if( status != CL_SUCCESS ) { - hb_log( "ERROR: No available GPU device.\n" ); + hb_log( "Notice: No available GPU device.\n" ); return(1); } @@ -509,7 +509,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) } if((gpu_info->context == (cl_context)NULL) || (status != CL_SUCCESS)) { - hb_log( "ERROR: Create opencl context error.\n" ); + hb_log( "Notice: Unable to create opencl context.\n" ); return(1); } /* Detect OpenCL devices. */ @@ -518,7 +518,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) 0, NULL, &length ); if((status != CL_SUCCESS) || (length == 0)) { - hb_log( "ERROR: Get the list of devices in context error.\n" ); + hb_log( "Notice: Unable to get the list of devices in context.\n" ); return(1); } /* Now allocate memory for device list based on the size we got earlier */ @@ -532,7 +532,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) gpu_info->devices, NULL ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: Get the device list data in context error.\n" ); + hb_log( "Notice: Unable to get the device list data in context.\n" ); return(1); } @@ -542,7 +542,7 @@ int hb_init_opencl_env( GPUEnv *gpu_info ) 0, &status ); if( status != CL_SUCCESS ) { - hb_log( "ERROR: Create opencl command queue error.\n" ); + hb_log( "Notice: Unable to create opencl command queue.\n" ); return(1); } } @@ -679,7 +679,7 @@ int hb_compile_kernel_file( const char *filename, GPUEnv *gpu_info, &numDevices, NULL ); if( status != CL_SUCCESS ){ - hb_log( "ERROR: Get the number of devices in context error.\n" ); + hb_log( "Notice: Unable to get the number of devices in context.\n" ); return 0; } @@ -732,7 +732,7 @@ int hb_compile_kernel_file( const char *filename, GPUEnv *gpu_info, } if((gpu_info->programs[idx] == (cl_program)NULL) || (status != CL_SUCCESS)){ - hb_log( "ERROR: Get list of devices in context error.\n" ); + hb_log( "Notice: Unable to get list of devices in context.\n" ); return(0); } @@ -757,7 +757,7 @@ int hb_compile_kernel_file( const char *filename, GPUEnv *gpu_info, if( status != CL_SUCCESS ) { - hb_log( "ERROR: Get GPU build information error.\n" ); + hb_log( "Notice: Unable to get GPU build information.\n" ); return(0); } buildLog = (char*)malloc( length ); diff --git a/libhb/stream.c b/libhb/stream.c index 85d047ece..46b4cb71e 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -610,8 +610,10 @@ static int hb_stream_get_type(hb_stream_t *stream) if ( fread(buf, 1, sizeof(buf), stream->file_handle) == sizeof(buf) ) { +#ifdef USE_OPENCL if ( hb_get_gui_info(&hb_gui, 1) || (hb_get_gui_info(&hb_gui, 3) == 0) ) return 0; +#endif int psize; if ( ( psize = hb_stream_check_for_ts(buf) ) != 0 ) { @@ -1099,24 +1101,25 @@ hb_title_t * hb_stream_title_scan(hb_stream_t *stream, hb_title_t * title) { hb_log( "transport stream missing PCRs - using video DTS instead" ); } - if ( hb_get_gui_info(&hb_gui, 3) == 0 ) - { - hb_va_dxva2_t * dxva2 = NULL; - dxva2 = hb_va_create_dxva2( dxva2, title->video_codec_param ); - if (dxva2) - { - title->uvd_support = 1; - hb_va_close(dxva2); - dxva2 = NULL; - } - else - title->uvd_support = 0; #ifdef USE_OPENCL - title->opencl_support = TestGPU(); + hb_va_dxva2_t * dxva2 = NULL; + dxva2 = hb_va_create_dxva2( dxva2, title->video_codec_param ); + if (dxva2) + { + title->uvd_support = 1; + hb_va_close(dxva2); + dxva2 = NULL; + } + else + title->uvd_support = 0; + if (TestGPU() == 0) + title->opencl_support = 1; + else + title->opencl_support = 0; #else - title->opencl_support = 1; + title->uvd_support = 0; + title->opencl_support = 0; #endif - } // Height, width, rate and aspect ratio information is filled in // when the previews are built return title; @@ -5669,24 +5672,26 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream, hb_title_t *title ) hb_list_add( title->list_chapter, chapter ); } - if ( hb_get_gui_info(&hb_gui, 3) == 0 ) - { - hb_va_dxva2_t * dxva2 = NULL; - dxva2 = hb_va_create_dxva2( dxva2, title->video_codec_param ); - if (dxva2) - { - title->uvd_support = 1; - hb_va_close(dxva2); - dxva2 = NULL; - } - else - title->uvd_support = 0; #ifdef USE_OPENCL - title->opencl_support = TestGPU(); + hb_va_dxva2_t * dxva2 = NULL; + dxva2 = hb_va_create_dxva2( dxva2, title->video_codec_param ); + if (dxva2) + { + title->uvd_support = 1; + hb_va_close(dxva2); + dxva2 = NULL; + } + else + title->uvd_support = 0; + if (TestGPU() == 0) + title->opencl_support = 1; + else + title->opencl_support = 0; #else - title->opencl_support = 1; + title->uvd_support = 0; + title->opencl_support = 0; #endif - } + return title; } diff --git a/libhb/vadxva2.c b/libhb/vadxva2.c index e31105f7f..a810cc5af 100644 --- a/libhb/vadxva2.c +++ b/libhb/vadxva2.c @@ -372,7 +372,7 @@ static int hb_d3d_create_device_manager( hb_va_dxva2_t *dxva2 ) hb_log( "dxva2:cannot load function\n" ); return HB_WORK_ERROR; } - hb_log( "dxva2:OurDirect3DCreateDeviceManager9 Success!\n" ); + //hb_log( "dxva2:OurDirect3DCreateDeviceManager9 Success!\n" ); UINT token; IDirect3DDeviceManager9 *devmng; @@ -383,7 +383,7 @@ static int hb_d3d_create_device_manager( hb_va_dxva2_t *dxva2 ) } dxva2->token = token; dxva2->devmng = devmng; - hb_log( "dxva2:obtained IDirect3DDeviceManager9\n" ); + //hb_log( "dxva2:obtained IDirect3DDeviceManager9\n" ); long hr = IDirect3DDeviceManager9_ResetDevice( devmng, dxva2->d3ddev, token ); if( FAILED( hr )) @@ -406,7 +406,7 @@ static int hb_dx_create_video_service( hb_va_dxva2_t *dxva2 ) hb_log( "dxva2:cannot load function\n" ); return HB_WORK_ERROR; } - hb_log( "dxva2:DXVA2CreateVideoService Success!\n" ); + //hb_log( "dxva2:DXVA2CreateVideoService Success!\n" ); HRESULT hr; @@ -449,7 +449,7 @@ static int hb_dx_find_video_service_conversion( hb_va_dxva2_t *dxva2, GUID *inpu const hb_dx_mode_t *mode = hb_dx_find_mode( g ); if( mode ) { - hb_log( "dxva2:'%s' is supported by hardware\n", mode->name ); + //hb_log( "dxva2:'%s' is supported by hardware\n", mode->name ); } else { @@ -472,7 +472,7 @@ static int hb_dx_find_video_service_conversion( hb_va_dxva2_t *dxva2, GUID *inpu if( !is_suported ) continue; - hb_log( "dxva2: Trying to use '%s' as input\n", mode->name ); + //hb_log( "dxva2: Trying to use '%s' as input\n", mode->name ); unsigned int output_count = 0; D3DFORMAT *output_list = NULL; if( FAILED( IDirectXVideoDecoderService_GetDecoderRenderTargets( dxva2->vs, mode->guid, &output_count, &output_list ))) @@ -486,7 +486,7 @@ static int hb_dx_find_video_service_conversion( hb_va_dxva2_t *dxva2, GUID *inpu const hb_d3d_format_t *format = hb_d3d_find_format( f ); if( format ) { - hb_log( "dxva2:%s is supported for output\n", format->name ); + //hb_log( "dxva2:%s is supported for output\n", format->name ); } else { @@ -505,7 +505,7 @@ static int hb_dx_find_video_service_conversion( hb_va_dxva2_t *dxva2, GUID *inpu } if( !is_suported ) continue; - hb_log( "dxva2:Using '%s' to decode to '%s'\n", mode->name, format->name ); + //hb_log( "dxva2:Using '%s' to decode to '%s'\n", mode->name, format->name ); *input = *mode->guid; *output = format->format; return HB_WORK_OK; @@ -669,7 +669,7 @@ int hb_va_extract( hb_va_dxva2_t *dxva2, uint8_t *dst, AVFrame *frame, int job_w lock.Pitch, }; #ifdef USE_OPENCL - if( ( dxva2->width > job_w || dxva2->height > job_h ) && (TestGPU() == 0) ) + if( ( dxva2->width > job_w || dxva2->height > job_h ) && (TestGPU() == 0) && (hb_get_gui_info(&hb_gui, 2) == 1)) { /* int i; uint8_t *tmp = (uint8_t*)malloc( dxva2->width*dxva2->height*3/2 ); @@ -731,7 +731,7 @@ hb_va_dxva2_t * hb_va_create_dxva2( hb_va_dxva2_t *dxva2, int codec_id ) goto error; } - hb_log( "dxva2:hb_d3d_create_device succeed" ); + //hb_log( "dxva2:hb_d3d_create_device succeed" ); if( hb_d3d_create_device_manager( dxva )== HB_WORK_ERROR ) { hb_log( "dxva2:D3dCreateDeviceManager failed" ); diff --git a/libhb/work.c b/libhb/work.c index db7dfe788..c8057f0e4 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -555,7 +555,7 @@ static void do_job( hb_job_t * job ) hb_log( "starting job" ); #ifdef USE_OPENCL - if ( job->use_opencl ) + if ( job->use_opencl || job->use_uvd) { /* init opencl environment */ hb_log( "Using GPU : Yes.\n" ); @@ -1022,7 +1022,7 @@ static void do_job( hb_job_t * job ) } #endif #ifdef USE_OPENCL - if ( job->use_opencl && hb_use_dxva( title ) && (TestGPU() == 0) && job->use_uvd ) + if ( /*job->use_opencl &&*/ hb_use_dxva( title ) && (TestGPU() == 0) && job->use_uvd ) { vcodec = WORK_DECAVCODECVACCL; } diff --git a/test/test.c b/test/test.c index f54122918..8bca6bd66 100644 --- a/test/test.c +++ b/test/test.c @@ -424,10 +424,14 @@ static void PrintTitleInfo( hb_title_t * title, int feature ) (float) title->rate / title->rate_base ); fprintf( stderr, " + autocrop: %d/%d/%d/%d\n", title->crop[0], title->crop[1], title->crop[2], title->crop[3] ); - - fprintf( stderr, " + support opencl: %d \n", title->opencl_support); - fprintf( stderr, " + support uvd: %d\n", title->uvd_support); - + if (title->opencl_support) + fprintf( stderr, " + support opencl: yes\n"); + else + fprintf( stderr, " + support opencl: no\n"); + if (title->uvd_support) + fprintf( stderr, " + support uvd: yes\n"); + else + fprintf( stderr, " + support uvd: no\n"); fprintf( stderr, " + chapters:\n" ); for( i = 0; i < hb_list_count( title->list_chapter ); i++ ) { diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs index d6e6e57aa..466a33aa1 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs @@ -142,6 +142,7 @@ namespace HandBrake.ApplicationServices.Parsing { var thisTitle = new Title(); string nextLine = output.ReadLine(); + string temp; // Get the Title Number Match m = Regex.Match(nextLine, @"^\+ title ([0-9]*):"); @@ -223,12 +224,27 @@ namespace HandBrake.ApplicationServices.Parsing }; } - m = Regex.Match(output.ReadLine(), @"^ \+ support opencl: ([0-9]*)"); + nextLine = output.ReadLine(); + m = Regex.Match(nextLine, @"^ \+ support opencl:"); if (m.Success) - thisTitle.OpenCLSupport = int.Parse(m.Groups[1].Value.Trim()); - m = Regex.Match(output.ReadLine(), @" \+ support uvd: ([0-9]*)"); + { + temp = nextLine.Replace("+ support opencl:", string.Empty).Trim(); + if (string.Compare(temp, "yes") == 0) + thisTitle.OpenCLSupport = 1; + else + thisTitle.OpenCLSupport = 0; + } + + nextLine = output.ReadLine(); + m = Regex.Match(nextLine, @"^ \+ support uvd:"); if (m.Success) - thisTitle.UVDSupport = int.Parse(m.Groups[1].Value.Trim()); + { + temp = nextLine.Replace("+ support uvd:", string.Empty).Trim(); + if (string.Compare(temp, "yes") == 0) + thisTitle.UVDSupport = 1; + else + thisTitle.UVDSupport = 0; + } thisTitle.Chapters.AddRange(Chapter.ParseList(output)); thisTitle.AudioTracks.AddRange(AudioHelper.ParseList(output)); diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs index ca23b3c66..69cbfc258 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs @@ -245,10 +245,10 @@ namespace HandBrake.ApplicationServices.Utilities if (task.OpenCLSupport) query += " -P "; - if (task.UVDSupport && task.OpenCLSupport) + + if (task.UVDSupport) query += " -U "; - else if (task.UVDSupport && !task.OpenCLSupport) - query += " -P -U"; + return query; } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 0a0cfe02d..6d2e736a3 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1721,11 +1721,11 @@ namespace HandBrakeWPF.ViewModels { if (this.selectedTitle.OpenCLSupport == 0) { - this.SupportOpenCL = false; + this.SupportOpenCL = true; } else { - this.SupportOpenCL = true; + this.SupportOpenCL = false; } if (this.selectedTitle.UVDSupport == 0) {