From c3247cea37ea7702703826df6b68a9754f9b8984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 2 Mar 2008 20:24:27 +0100 Subject: Provide safe and convenient implementations of xine_get_current_frame(). xine_get_current_frame() relies on the caller to provide a sufficiently sized buffer. To calculate the required size of the buffer, one has to call xine_get_current_frame() to retrieve the necessary parameters. But as the image can change between two successive calls one has to pause the stream for consistency. To improve the situation, xine_get_current_frame_s() has been introduced which requires to specify the buffer size when an image is going to be retrieved. Furthermore, it will return the required/used buffer size. In that way, it can prevent copying data into a too small buffer and therefore can be considered safe. For convenience, xine_get_current_frame_alloc() is provided which takes care to allocate a sufficiently sized buffer. This function avoids pausing the stream as the image will be returned in a single call. --- include/xine.h.in | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/xine.h.in b/include/xine.h.in index ceb87780a..979094779 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -418,14 +418,38 @@ int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED; * image format can be YUV 4:2:0 or 4:2:2 * will copy the image data into memory that points to * (interleaved for yuv 4:2:2 or planary for 4:2:0) + * + * xine_get_current_frame() requires that must be able + * to hold the image data. Use a NULL pointer to retrieve the + * necessary parameters for calculating the buffer size. Be + * aware that the image can change between two successive calls + * so you better pause the stream. + * + * xine_get_current_frame_s() requires to specify the buffer + * size and it returns the needed / used size. It won't copy + * image data into a too small buffer. + * + * xine_get_current_frame_alloc() takes care of allocating + * a buffer on it's own, so image data can be retrieved by + * a single call without the need to pause the stream. * - * returns 1 on success, 0 failure. + * all functions return 1 on success, 0 failure. */ int xine_get_current_frame (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, uint8_t *img) XINE_PROTECTED; +int xine_get_current_frame_s (xine_stream_t *stream, + int *width, int *height, + int *ratio_code, int *format, + uint8_t *img, int *size) XINE_PROTECTED; + +int xine_get_current_frame_alloc (xine_stream_t *stream, + int *width, int *height, + int *ratio_code, int *format, + uint8_t **img, int *size) XINE_PROTECTED; + /* xine image formats */ #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') #define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') -- cgit v1.2.3 From a33991c82965b1cf40c175b7bc9d13488e14cae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 2 Mar 2008 21:12:01 +0100 Subject: Fix "clear" implementation by introducing sync points in data stream. vdr-xine used a padding packet to push out any remaining data before input_vdr executed "clear" to drop that data. But depending on the way how input_vdr is connected to vdr-xine it could happen that the padding packet reached input_vdr after executing "clear" and therefore "clear" didn't work as expected. To fix this issue, sync points are introduced by making the padding packets "unique" in the stream. input_vdr will now drop all data up to the sync point packet. So even if the padding packet arrives later than the "clear" command, only data following the sync point will be fed to the demuxer. --HG-- extra : transplant_source : %A1%5E%8C%E1vmW%98D%1EW%A7%AF%B4V%5D%84%26%D0%DA --- include/xine/vdr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/xine/vdr.h b/include/xine/vdr.h index 5102d7f77..a2a3e800f 100644 --- a/include/xine/vdr.h +++ b/include/xine/vdr.h @@ -22,7 +22,7 @@ #define __VDR_H -#define XINE_VDR_VERSION 801 +#define XINE_VDR_VERSION 802 enum funcs @@ -270,6 +270,7 @@ typedef struct __attribute__((packed)) data_clear_s int32_t n; int8_t s; + uint8_t i; } data_clear_t; -- cgit v1.2.3 From e6f87e34ee65c805bde5805f89ac362095e9df4c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 6 Mar 2008 21:59:28 +0000 Subject: Fix compilation for installed libintl.h in include paths Compilation of xine-lib-1.2 hg failed for me as libintl.h does this: #define textdomain libintl_textdomain This causes trouble accessing fields in structures which are accidentally named "textdomain". The patch renames textdomain to text_domain in xine headers and xine- engine/xine.c and xine/load_plugins.c --- include/xine/audio_decoder.h | 2 +- include/xine/audio_out.h | 2 +- include/xine/demux.h | 2 +- include/xine/input_plugin.h | 2 +- include/xine/post.h | 2 +- include/xine/spu_decoder.h | 2 +- include/xine/video_decoder.h | 2 +- include/xine/video_out.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/xine/audio_decoder.h b/include/xine/audio_decoder.h index 49194e290..05d29823d 100644 --- a/include/xine/audio_decoder.h +++ b/include/xine/audio_decoder.h @@ -61,7 +61,7 @@ struct audio_decoder_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources diff --git a/include/xine/audio_out.h b/include/xine/audio_out.h index b720110bf..25e5deb68 100644 --- a/include/xine/audio_out.h +++ b/include/xine/audio_out.h @@ -258,7 +258,7 @@ struct audio_driver_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources diff --git a/include/xine/demux.h b/include/xine/demux.h index 35a5c9a82..72808f76d 100644 --- a/include/xine/demux.h +++ b/include/xine/demux.h @@ -66,7 +66,7 @@ struct demux_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /** * @brief MIME types supported for this plugin diff --git a/include/xine/input_plugin.h b/include/xine/input_plugin.h index e434dc5a8..95fc65c4e 100644 --- a/include/xine/input_plugin.h +++ b/include/xine/input_plugin.h @@ -60,7 +60,7 @@ struct input_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * ls function, optional: may be NULL diff --git a/include/xine/post.h b/include/xine/post.h index 10844d03a..a8f721a9a 100644 --- a/include/xine/post.h +++ b/include/xine/post.h @@ -65,7 +65,7 @@ struct post_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources diff --git a/include/xine/spu_decoder.h b/include/xine/spu_decoder.h index d36b5b691..1833a22b4 100644 --- a/include/xine/spu_decoder.h +++ b/include/xine/spu_decoder.h @@ -62,7 +62,7 @@ struct spu_decoder_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources diff --git a/include/xine/video_decoder.h b/include/xine/video_decoder.h index 916cfe68b..022c2af33 100644 --- a/include/xine/video_decoder.h +++ b/include/xine/video_decoder.h @@ -62,7 +62,7 @@ struct video_decoder_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources diff --git a/include/xine/video_out.h b/include/xine/video_out.h index 02eff3cac..0bdd0f557 100644 --- a/include/xine/video_out.h +++ b/include/xine/video_out.h @@ -403,7 +403,7 @@ struct video_driver_class_s { /** * @brief Optional non-standard catalog to use with dgettext() for description. */ - const char *textdomain; + const char *text_domain; /* * free all class-related resources -- cgit v1.2.3 From 6661592edbb9b587dadb10b891eab0d9b6bb68bc Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Mon, 7 Apr 2008 23:28:06 +0100 Subject: Don't distribute configure.h. --- include/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 46a9e2478..09d432536 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,7 +6,8 @@ endif include_HEADERS = xine.h -noinst_HEADERS = config.h configure.h +noinst_HEADERS = config.h +nodist_noinst_HEADERS = configure.h CONFIG_CLEAN_FILES = xine.h $(inttypes_h) -- cgit v1.2.3