Add hardware acceleration force option

This commit is contained in:
Iwan Timmer
2016-01-16 14:04:05 +01:00
parent d582e2fa07
commit 72e649a66d
6 changed files with 17 additions and 4 deletions

View File

@@ -51,9 +51,11 @@ int ffmpeg_init(int width, int height, int perf_lvl, int thread_count) {
av_init_packet(&pkt);
#ifdef HAVE_VDPAU
decoder = avcodec_find_decoder_by_name("h264_vdpau");
if (decoder != NULL)
decoder_system = VDPAU;
if (perf_lvl & HARDWARE_ACCELERATION) {
decoder = avcodec_find_decoder_by_name("h264_vdpau");
if (decoder != NULL)
decoder_system = VDPAU;
}
#endif
if (decoder == NULL) {

View File

@@ -31,6 +31,8 @@
#define BILINEAR_FILTERING 0x10
// Uses a faster bilinear filtering with lower image quality
#define FAST_BILINEAR_FILTERING 0x20
// Uses hardware acceleration
#define HARDWARE_ACCELERATION 0x40
int ffmpeg_init(int width, int height, int perf_lvl, int thread_count);
void ffmpeg_destroy(void);