summaryrefslogtreecommitdiffstats
path: root/libvo/x11_common.c
diff options
context:
space:
mode:
authoral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-11-10 02:39:31 +0000
committeral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-11-10 02:39:31 +0000
commitfb8da06ed75c53a69a3a3f276c5e9631271d0249 (patch)
tree76f4b4e99612bff2cf6bc7ba4f09a13b90490c1d /libvo/x11_common.c
parent3ccd4245293941c68dd3d0e02a1106944031ca54 (diff)
downloadmpv-fb8da06ed75c53a69a3a3f276c5e9631271d0249.tar.bz2
mpv-fb8da06ed75c53a69a3a3f276c5e9631271d0249.tar.xz
Test if source image dimensions are too big.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16959 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r--libvo/x11_common.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index e1272a090d..ed84a69c40 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -2277,6 +2277,45 @@ int vo_xv_enable_vsync()
}
/**
+ * \brief Get maximum supported source image dimensions.
+ *
+ * This function does not set the variables pointed to by
+ * width and height if the information could not be retreived.
+ * So the caller is reponsible for initing them properly.
+ *
+ * \param width [out] The maximum width gets stored here.
+ * \param height [out] The maximum height gets stored here.
+ *
+ */
+void vo_xv_get_max_img_dim( uint32_t * width, uint32_t * height )
+{
+ XvEncodingInfo * encodings;
+ //unsigned long num_encodings, idx; to int or too long?!
+ unsigned int num_encodings, idx;
+
+ XvQueryEncodings( mDisplay, xv_port, &num_encodings, &encodings);
+
+ if ( encodings )
+ {
+ for ( idx = 0; idx < num_encodings; ++idx )
+ {
+ if ( strcmp( encodings[idx].name, "XV_IMAGE" ) == 0 )
+ {
+ *width = encodings[idx].width;
+ *height = encodings[idx].height;
+ break;
+ }
+ }
+ }
+
+ mp_msg( MSGT_VO, MSGL_V,
+ "[xv common] Maximum source image dimensions: %ux%u\n",
+ *width, *height );
+
+ XvFreeEncodingInfo( encodings );
+}
+
+/**
* \brief Print information about the colorkey method and source.
*
* \param ck_handling Integer value containing the information about