summaryrefslogtreecommitdiff
path: root/libavdevice/x11grab.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-09 02:06:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-09 02:06:40 +0200
commit58257ea29e0716a50dc742959de876606ed22416 (patch)
treea4949244816d4eb7a4231b1798b54bea4a79d4e5 /libavdevice/x11grab.c
parent971c04066c601bdd38ed5e8eb585d2f5ba211fe2 (diff)
parentbda168d2b0210dda84f1a9d32c8aa4653d1674d5 (diff)
downloadffmpeg-58257ea29e0716a50dc742959de876606ed22416.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits) mp3enc: write a xing frame containing number of frames in the file lavf: update AVStream.nb_frames when muxing. ffmpeg: remove unused variables from InputStream. doc: update ffmpeg -ar and -ac documentation to reflect reality. ffmpeg: remove pointless if (nb_input_files) ffmpeg: merge input_files_ts_offset into input_files. ffmpeg: merge input_codecs into input_streams. ffmpeg: drop AV prefixes from struct names. ffmpeg: deprecate loop_input and loop_output options gif: add loop private option. img2: add loop private option. AVOptions: in av_opt_find() don't return named constants unless unit is specified. x11grab: replace undocumented nomouse hackery with a private option. dict: extend documentation. lls: whitespace cosmetics docs: Use proper markup for a literal command line option docs: Remove a remark that isn't relevant any longer docs: Explain how to regenerate import libraries with MSVC tools docs: Mention that libraries for MSVC can be built with a cross compiler docs: Remove old docs that mention setting up a build environment with lib.exe ... Conflicts: doc/ffmpeg.texi doc/general.texi ffmpeg.c libavcodec/Makefile libavcodec/dnxhddata.c libavformat/mp3enc.c libavformat/utils.c libavutil/Makefile tests/copycooker.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/x11grab.c')
-rw-r--r--libavdevice/x11grab.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 09c121ee7a..e204872d06 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -70,7 +70,7 @@ struct x11_grab
XImage *image; /**< X11 image holding the grab */
int use_shm; /**< !0 when using XShm extension */
XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
- int nomouse;
+ int draw_mouse; /**< Set by a private option. */
char *framerate; /**< Set by a private option. */
};
@@ -104,7 +104,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
offset = strchr(dpyname, '+');
if (offset) {
sscanf(offset, "%d,%d", &x_off, &y_off);
- x11grab->nomouse= strstr(offset, "nomouse");
+ x11grab->draw_mouse = !strstr(offset, "nomouse");
*offset= 0;
}
@@ -218,21 +218,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
}
break;
case 32:
-#if 0
- GetColorInfo (image, &c_info);
- if ( c_info.alpha_mask == 0xff000000 && image->green_mask == 0x0000ff00) {
- /* byte order is relevant here, not endianness
- * endianness is handled by avcodec, but atm no such thing
- * as having ABGR, instead of ARGB in a word. Since we
- * need this for Solaris/SPARC, but need to do the conversion
- * for every frame we do it outside of this loop, cf. below
- * this matches both ARGB32 and ABGR32 */
- input_pixfmt = PIX_FMT_ARGB32;
- } else {
- av_log(s1, AV_LOG_ERROR,"image depth %i not supported ... aborting\n", image->bits_per_pixel);
- return AVERROR(EIO);
- }
-#endif
input_pixfmt = PIX_FMT_RGB32;
break;
default:
@@ -426,7 +411,7 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
}
}
- if(!s->nomouse){
+ if (s->draw_mouse) {
paint_mouse_pointer(image, s);
}
@@ -467,6 +452,7 @@ x11grab_read_close(AVFormatContext *s1)
static const AVOption options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
+ { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), FF_OPT_TYPE_INT, { 1 }, 0, 1, DEC },
{ NULL },
};