Commit f58f4ce1 authored by Guillaume Poirier's avatar Guillaume Poirier

Original X11 device demuxer patch from Clemens Fruhwirth

- Build system integration is equivalent to RFC #6 patch
- Same rule applies to ffmpeg.c/allformats.[c|h]
- x11grab.c is from Clemens Fruhwirth except the x11 grab
  structure for libavformat registration is renamed to
    match build system integration.

Originally committed as revision 7302 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 83c547a4
......@@ -1659,6 +1659,16 @@ int dummy = V4L2_PIX_FMT_YUV420;
struct v4l2_buffer dummy1;
EOF
# Deal with the x11 frame grabber
enabled gpl &&
enabled x11_grab_device_demuxer &&
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
check_func XOpenDisplay -lX11 &&
check_func XShmCreateImage -lX11 -lXext &&
add_extralibs -lX11 -lXext ||
disable x11_grab_device_demuxer
enabled debug && add_cflags -g
# add some useful compiler flags if supported
......
......@@ -3234,6 +3234,10 @@ static void prepare_grab(void)
if (has_video) {
AVInputFormat *fmt1;
#warning FIXME: find a better interface
if(!strncmp(video_device,"x11:",4)) {
video_grab_format="x11grab";
}
fmt1 = av_find_input_format(video_grab_format);
vp->device = video_device;
vp->channel = video_channel;
......
......@@ -123,6 +123,7 @@ OBJS-$(CONFIG_WC3_DEMUXER) += wc3movie.o
OBJS-$(CONFIG_WSAUD_DEMUXER) += westwood.o
OBJS-$(CONFIG_WSVQA_DEMUXER) += westwood.o
OBJS-$(CONFIG_WV_DEMUXER) += wv.o
OBJS-$(CONFIG_X11_GRAB_DEVICE_DEMUXER) += x11grab.o
OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER) += yuv4mpeg.o
OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER) += yuv4mpeg.o
......
......@@ -166,6 +166,7 @@ void av_register_all(void)
REGISTER_DEMUXER (WSAUD, wsaud);
REGISTER_DEMUXER (WSVQA, wsvqa);
REGISTER_DEMUXER (WV, wv);
REGISTER_DEMUXER (X11_GRAB_DEVICE, x11_grab_device);
REGISTER_MUXDEMUX(YUV4MPEGPIPE, yuv4mpegpipe);
#ifdef CONFIG_PROTOCOLS
......
......@@ -163,6 +163,7 @@ extern AVInputFormat wv_demuxer;
extern AVOutputFormat yuv4mpegpipe_muxer;
extern AVInputFormat yuv4mpegpipe_demuxer;
extern AVInputFormat tiertexseq_demuxer;
extern AVInputFormat x11_grab_device_demuxer;
/* raw.c */
int pcm_read_seek(AVFormatContext *s,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment