From 3a2bebdffbf30ec38faf94b6e78aecf0de70c5dc Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 10 Oct 2019 22:02:39 +0100 Subject: [PATCH] jpegload_stream registers --- libvips/foreign/jpegload.c | 4 ++-- libvips/include/vips/object.h | 7 +++++-- libvips/iofuncs/init.c | 4 ++++ libvips/iofuncs/stream.c | 14 ++++++++++---- test/test_descriptors | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/libvips/foreign/jpegload.c b/libvips/foreign/jpegload.c index ad74f3c0..b55ba73d 100644 --- a/libvips/foreign/jpegload.c +++ b/libvips/foreign/jpegload.c @@ -380,9 +380,9 @@ vips_foreign_load_jpeg_stream_class_init( load_class->header = vips_foreign_load_jpeg_stream_header; load_class->load = vips_foreign_load_jpeg_stream_load; - VIPS_ARG_BOXED( class, "input", 1, + VIPS_ARG_OBJECT( class, "input", 1, _( "Input" ), - _( "Input stream to load from" ), + _( "Stream to load from" ), VIPS_ARGUMENT_REQUIRED_INPUT, G_STRUCT_OFFSET( VipsForeignLoadJpegStream, input ), VIPS_TYPE_STREAM_INPUT ); diff --git a/libvips/include/vips/object.h b/libvips/include/vips/object.h index 82fdfd43..ff500a61 100644 --- a/libvips/include/vips/object.h +++ b/libvips/include/vips/object.h @@ -112,11 +112,11 @@ VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the x pos of the image minimum pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ } -#define VIPS_ARG_INTERPOLATE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) { \ +#define VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, TYPE ) { \ GParamSpec *pspec; \ \ pspec = g_param_spec_object( (NAME), (LONG), (DESC), \ - VIPS_TYPE_INTERPOLATE, \ + TYPE, \ (GParamFlags) (G_PARAM_READWRITE) ); \ g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ vips_argument_get_id(), pspec ); \ @@ -124,6 +124,9 @@ VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the x pos of the image minimum pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ } +#define VIPS_ARG_INTERPOLATE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) \ + VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, VIPS_TYPE_INTERPOLATE ) + #define VIPS_ARG_BOOL( CLASS, NAME, PRIORITY, LONG, DESC, \ FLAGS, OFFSET, VALUE ) { \ GParamSpec *pspec; \ diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index 57dd8aee..27939b0f 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -330,6 +330,8 @@ vips_init( const char *argv0 ) extern GType write_thread_state_get_type( void ); extern GType sink_memory_thread_state_get_type( void ); extern GType render_thread_state_get_type( void ); + extern GType vips_stream_input_get_type( void ); + extern GType vips_stream_output_get_type( void ); static gboolean started = FALSE; static gboolean done = FALSE; @@ -444,6 +446,8 @@ vips_init( const char *argv0 ) (void) write_thread_state_get_type(); (void) sink_memory_thread_state_get_type(); (void) render_thread_state_get_type(); + (void) vips_stream_input_get_type(); + (void) vips_stream_output_get_type(); vips__meta_init_types(); vips__interpolate_init(); im__format_init(); diff --git a/libvips/iofuncs/stream.c b/libvips/iofuncs/stream.c index 32192651..1716956f 100644 --- a/libvips/iofuncs/stream.c +++ b/libvips/iofuncs/stream.c @@ -297,13 +297,16 @@ static void vips_stream_input_class_init( VipsStreamInputClass *class ) { GObjectClass *gobject_class = G_OBJECT_CLASS( class ); - VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); + VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); gobject_class->finalize = vips_stream_input_finalize; gobject_class->set_property = vips_object_set_property; gobject_class->get_property = vips_object_get_property; - vobject_class->build = vips_stream_input_build; + object_class->nickname = "input"; + object_class->description = _( "input stream" ); + + object_class->build = vips_stream_input_build; class->read = vips_stream_input_read_real; class->rewind = vips_stream_input_rewind_real; @@ -609,13 +612,16 @@ static void vips_stream_output_class_init( VipsStreamOutputClass *class ) { GObjectClass *gobject_class = G_OBJECT_CLASS( class ); - VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); + VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); gobject_class->finalize = vips_stream_input_finalize; gobject_class->set_property = vips_object_set_property; gobject_class->get_property = vips_object_get_property; - vobject_class->build = vips_stream_output_build; + object_class->nickname = "output"; + object_class->description = _( "output stream" ); + + object_class->build = vips_stream_output_build; VIPS_ARG_BOXED( class, "blob", 1, _( "Blob" ), diff --git a/test/test_descriptors b/test/test_descriptors index b23aa906..0e0b2c0c 100755 --- a/test/test_descriptors +++ b/test/test_descriptors @@ -188,7 +188,7 @@ func_exec_program () if test -f "$progdir/$program"; then # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/john/GIT/libvips/libvips/.libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH="/home/john/GIT/libvips/libvips/.libs:/home/john/vips/lib:$LD_LIBRARY_PATH" # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH # The second colon is a workaround for a bug in BeOS R4 sed