Skip to content

Commit 3e641b4

Browse files
committed
Merge commit '7671dd7cd7d51bbd637cc46d8f104a141bc355ea'
* commit '7671dd7cd7d51bbd637cc46d8f104a141bc355ea': avconv: add support for VDPAU decoding Conflicts: Changelog Makefile configure ffmpeg.h Merged-by: Michael Niedermayer <[email protected]>
2 parents 62e10c3 + 7671dd7 commit 3e641b4

7 files changed

+364
-3
lines changed

Changelog

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ version <next>
88
- setsar/setdar filters now support variables in ratio expressions
99
- elbg filter
1010
- string validation in ffprobe
11+
- support for decoding through VDPAU in ffmpeg (the -hwaccel option)
1112

1213

1314
version 2.1:

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ PROGS-$(CONFIG_FFSERVER) += ffserver
1818
PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
1919
INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
2020

21+
2122
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
23+
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
2224
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
2325
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
2426
TOOLS = qt-faststart trasher
@@ -90,7 +92,7 @@ endef
9092
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
9193

9294
define DOPROG
93-
OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS)
95+
OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS) $(OBJS-$(1)-yes)
9496
$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
9597
$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1))
9698
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))

configure

+10-2
Original file line numberDiff line numberDiff line change
@@ -1559,11 +1559,13 @@ HAVE_LIST="
15591559
threads
15601560
unistd_h
15611561
usleep
1562+
vdpau_x11
15621563
vfp_args
15631564
VirtualAlloc
15641565
windows_h
15651566
winsock2_h
15661567
xform_asm
1568+
xlib
15671569
xmm_clobbers
15681570
"
15691571

@@ -4426,10 +4428,12 @@ if enabled libcdio; then
44264428
die "ERROR: libcdio-paranoia not found"
44274429
fi
44284430

4431+
check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
4432+
44294433
enabled x11grab &&
4430-
require X11 X11/Xlib.h XOpenDisplay -lX11 &&
44314434
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
4432-
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
4435+
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
4436+
{ enabled xlib || die "ERROR: Xlib not found"; }
44334437

44344438
enabled vaapi &&
44354439
check_lib va/va.h vaInitialize -lva ||
@@ -4439,6 +4443,10 @@ enabled vdpau &&
44394443
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
44404444
disable vdpau
44414445

4446+
enabled vdpau && enabled xlib &&
4447+
check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
4448+
enable vdpau_x11
4449+
44424450
# Funny iconv installations are not unusual, so check it after all flags have been set
44434451
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
44444452

doc/ffmpeg.texi

+9
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ Do not use any hardware acceleration (the default).
631631

632632
@item auto
633633
Automatically select the hardware acceleration method.
634+
635+
@item vdpau
636+
Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
634637
@end table
635638

636639
This option has no effect if the selected hwaccel is not available or not
@@ -648,6 +651,12 @@ Select a device to use for hardware acceleration.
648651
This option only makes sense when the @option{-hwaccel} option is also
649652
specified. Its exact meaning depends on the specific hardware acceleration
650653
method chosen.
654+
655+
@table @option
656+
@item vdpau
657+
For VDPAU, this option specifies the X11 display/screen to use. If this option
658+
is not specified, the value of the @var{DISPLAY} environment variable is used
659+
@end table
651660
@end table
652661

653662
@section Audio Options

ffmpeg.h

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
enum HWAccelID {
6060
HWACCEL_NONE = 0,
6161
HWACCEL_AUTO,
62+
HWACCEL_VDPAU,
6263
};
6364

6465
typedef struct HWAccel {
@@ -485,4 +486,6 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
485486

486487
int ffmpeg_parse_options(int argc, char **argv);
487488

489+
int vdpau_init(AVCodecContext *s);
490+
488491
#endif /* FFMPEG_H */

ffmpeg_opt.c

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
}
6565

6666
const HWAccel hwaccels[] = {
67+
#if HAVE_VDPAU_X11
68+
{ "vdpau", vdpau_init, HWACCEL_VDPAU, AV_PIX_FMT_VDPAU },
69+
#endif
6770
{ 0 },
6871
};
6972

0 commit comments

Comments
 (0)