George Kiagiadakis [Tue, 16 Nov 2010 10:50:40 +0000 (12:50 +0200)]
Fix compilation.
Mauricio Piacentini [Mon, 1 Nov 2010 11:07:11 +0000 (09:07 -0200)]
Initial implementation of QGst::Event
George Kiagiadakis [Mon, 1 Nov 2010 20:05:19 +0000 (22:05 +0200)]
Merge remote branch 'piacentinis-qtgstreamer/QGstBuffer'
Reviewed-by: George Kiagiadakis <kiagiadakis.george@gmail.com>
Mauricio Piacentini [Mon, 1 Nov 2010 11:14:59 +0000 (09:14 -0200)]
Buffer reviewed
Mauricio Piacentini [Thu, 28 Oct 2010 16:56:11 +0000 (14:56 -0200)]
Implementation of QGst::Buffer
George Kiagiadakis [Fri, 22 Oct 2010 14:02:26 +0000 (17:02 +0300)]
Fix typo.
George Kiagiadakis [Fri, 22 Oct 2010 14:00:32 +0000 (17:00 +0300)]
Merge remote branch 'piacentinis-qtgstreamer/QGstClock'
Reviewed-by: George Kiagiadakis <kiagiadakis.george@gmail.com>
Mauricio Piacentini [Fri, 22 Oct 2010 13:23:17 +0000 (11:23 -0200)]
QGstClock reviewed
Mauricio Piacentini [Fri, 22 Oct 2010 12:04:53 +0000 (10:04 -0200)]
QGstClock test
Mauricio Piacentini [Fri, 22 Oct 2010 12:01:42 +0000 (10:01 -0200)]
QGstClock implementation and tests
George Kiagiadakis [Tue, 19 Oct 2010 20:53:29 +0000 (23:53 +0300)]
Fix compilation.
George Kiagiadakis [Tue, 19 Oct 2010 20:50:54 +0000 (23:50 +0300)]
Merge remote branch 'piacentinis-qtgstreamer/QGstQuery2'
Reviewed-by: George Kiagiadakis <kiagiadakis.george@gmail.com>
Mauricio Piacentini [Tue, 19 Oct 2010 11:01:44 +0000 (09:01 -0200)]
Rename query setXX methods to setValues/setValue
Mauricio Piacentini [Tue, 19 Oct 2010 10:58:16 +0000 (08:58 -0200)]
Cleaning up for merge after initial review
Mauricio Piacentini [Wed, 13 Oct 2010 19:49:28 +0000 (16:49 -0300)]
GstQuery implementation and tests
George Kiagiadakis [Thu, 14 Oct 2010 18:13:56 +0000 (21:13 +0300)]
Check gcc's version and enable c++0x only with gcc >= 4.5.
This is because the latest changes with rvalue references make
code compiled with g++ 4.4 behave improperly and cause crashes.
This commit also introduces a QTGSTREAMER_DISABLE_CXX0X variable
that can be set to TRUE from the cmake command line to disable
c++0x support, for testing/debugging purposes.
Mauricio Piacentini [Mon, 11 Oct 2010 17:03:20 +0000 (20:03 +0300)]
Manual Video Orientation test.
Note that this interface is functional only on a very small set of drivers.
Signed-off-by: George Kiagiadakis <kiagiadakis.george@gmail.com>
Mauricio Piacentini [Mon, 11 Oct 2010 15:59:14 +0000 (12:59 -0300)]
fix copyright messages
George Kiagiadakis [Sun, 10 Oct 2010 14:09:08 +0000 (17:09 +0300)]
Use std::forward where appropriate to forward rvalue references.
This fixes compilation with gcc 4.5, which complies better with the
upcoming c++0x standard. My previous code was obviously non-compliant.
George Kiagiadakis [Sun, 10 Oct 2010 13:16:15 +0000 (16:16 +0300)]
Fix crash in the case where a bus signal watch is removed before the bus is destroyed.
George Kiagiadakis [Sun, 10 Oct 2010 12:46:32 +0000 (15:46 +0300)]
Change the bus watch timer to fire every 10 ms instead of 0, to idle the cpu.
George Kiagiadakis [Fri, 8 Oct 2010 13:57:11 +0000 (16:57 +0300)]
Add wrapper for GstPropertyProbe.
Mauricio Piacentini [Fri, 8 Oct 2010 14:04:56 +0000 (17:04 +0300)]
Implement VideoOrientation interface wrapper.
Signed-off-by: George Kiagiadakis <kiagiadakis.george@gmail.com>
George Kiagiadakis [Fri, 20 Aug 2010 13:11:03 +0000 (16:11 +0300)]
Add macros for registering arbitrary boxed types in user code.
This is helpful if you want to mix the bindings with some native
C code and you need to use a boxed type with either a property
or a signal. Every other type can be mapped to something else
and used through the existing bindings, but there is nothing for
boxed types.
George Kiagiadakis [Sun, 8 Aug 2010 10:57:31 +0000 (13:57 +0300)]
Add wrapper class for the GstColorBalance interface.
George Kiagiadakis [Sun, 8 Aug 2010 10:30:56 +0000 (13:30 +0300)]
Actually GST_TYPE_STREAM_VOLUME_FORMAT exists in another header.
George Kiagiadakis [Sun, 8 Aug 2010 10:04:55 +0000 (13:04 +0300)]
Add wrapper for the GstStreamVolume interface.
George Kiagiadakis [Sat, 24 Jul 2010 14:11:15 +0000 (17:11 +0300)]
Add a new QtGstreamerUi library that contains a VideoWidget class, a widget that can embed video sinks.
George Kiagiadakis [Sat, 24 Jul 2010 13:37:39 +0000 (16:37 +0300)]
Add a GStreamer element that provides a video sink that draws directly on QWidget.
Note that this element is built as an external GStreamer plugin and it is independent from the bindings.
George Kiagiadakis [Fri, 23 Jul 2010 13:29:23 +0000 (16:29 +0300)]
Move tests/* to tests/auto/*
George Kiagiadakis [Tue, 20 Jul 2010 10:43:50 +0000 (13:43 +0300)]
Add a version check for GStreamer.
George Kiagiadakis [Tue, 20 Jul 2010 10:36:30 +0000 (13:36 +0300)]
Sync the FindG* cmake modules from phonon.
George Kiagiadakis [Sat, 17 Jul 2010 21:00:54 +0000 (00:00 +0300)]
Rearrange the signal/closure code to make it a bit more readable.
George Kiagiadakis [Sat, 17 Jul 2010 19:42:29 +0000 (22:42 +0300)]
Add option (enabled by default) to omit the sender from a slot's arguments. In most cases, it is unneeded.
George Kiagiadakis [Sat, 17 Jul 2010 18:01:18 +0000 (21:01 +0300)]
Header "Closure" was removed in a previous commit (because Closure is not meant to be public API). Fix CMakeLists.txt.
George Kiagiadakis [Sat, 17 Jul 2010 14:37:47 +0000 (17:37 +0300)]
Add wrapper for GstXOverlay and fix codegen to be able to use more gstreamer includes, other than <gst/gst.h> (required for including gst/interfaces/*)
George Kiagiadakis [Sat, 17 Jul 2010 13:32:11 +0000 (16:32 +0300)]
Fix outdated docs.
George Kiagiadakis [Sat, 17 Jul 2010 13:17:12 +0000 (16:17 +0300)]
Define GST_DISABLE_DEPRECATED to get rid of the stupid libxml2 dependency and raise GStreamer version requirement to 0.10.30.
George Kiagiadakis [Sat, 17 Jul 2010 13:16:34 +0000 (16:16 +0300)]
Remove methods that are deprecated as of GStreamer 0.10.30.
George Kiagiadakis [Sat, 17 Jul 2010 12:43:51 +0000 (15:43 +0300)]
Obey the API docs and throw a QGlib::Error from QGst::init() when it fails.
George Kiagiadakis [Sat, 17 Jul 2010 12:38:15 +0000 (15:38 +0300)]
Add cmake target to generate API docs and write some basic API docs where needed.
George Kiagiadakis [Wed, 14 Jul 2010 09:15:01 +0000 (12:15 +0300)]
Add an asynchronous bus message dispatcher that emits the "message" signal,
like the one provided by the gst_bus_add_signal_watch() method, but which works
purely with the Qt event loop and doesn't require a Glib one.
George Kiagiadakis [Tue, 13 Jul 2010 19:19:03 +0000 (22:19 +0300)]
Add subclasses to QGst::Message so that it is possible to create and parse the various types of messages.
This commit also adds two helper template structures:
QGlib::Private::CanConvertTo and QGlib::Private::CanConvertFrom.
These are used to abstract away the conversion check from RefPointer::dynamicCast()
and the conversion sanity checks from ValueBase::set() and ValueBase::get().
This is required to make the Message subclasses work properly with these
functions, since they are not real Gst classes and do not have registered GTypes.
Each Message subclass gets a specialization for these structures which lets
RefPointer::dynamicCast() check the message type to determine whether to allow
the cast and ValueBase::set() to treat the subclass as if it was a Message.
ValueBase::get() will fail to compile if used with one of those subclasses
and this is done in purpose, since a Value can never contain one of these
(it will contain a Message, which has a GType!) and get() is not supposed to
allow upcasts, like dynamicCast() does.
So, to sum up, this trick allows you to do:
QGst::MessagePtr msg = getSomeMessage();
QGst::EosMessagePtr eosMsg = msg.dynamicCast<QGst::EosMessage>(); //checks if msg->type() == QGst::MessageEos
and
QGlib::Value v;
v.init<QGst::Message>();
QGst::EosMessagePtr eosMsg = getSomeEosMessage();
value.set(eosMsg); //will not fail, it will treat EosMessage as a Message
but not
QGlib::Value v = getSomeValue();
QGst::EosMessagePtr eosMsg = v.get<QGst::EosMessagePtr>(); //compilation error
George Kiagiadakis [Sun, 11 Jul 2010 15:28:17 +0000 (18:28 +0300)]
Update README with information on:
* Building static QtGstreamer.
* CMake and qmake integration for using QtGstreamer from external projects.
* Correct header #include style.
George Kiagiadakis [Sun, 11 Jul 2010 14:44:09 +0000 (17:44 +0300)]
Improve the build system; add new features and examples:
* Add ability to build QtGstreamer as a static library by passing -DSTATIC_QTGSTREAMER=1 to cmake.
* Add a FindQtGstreamer.cmake script, which is installed as QtGstreamerConfig.cmake
together with a generated QtGstreamerTargets.cmake script, that can be used to
find QtGstreamer from external cmake-based projects. Both shared and static versions
of QtGstreamer are supported.
* Add an uninstall target, copied from the KDE4 scripts.
* Rewrite the CMakeLists.txt of the examples so that they can also be built standalone
and serve as examples of how to use QtGstreamer from external projects.
* Add qmake project files for the examples, to act as examples for people using qmake.
George Kiagiadakis [Sat, 10 Jul 2010 11:03:51 +0000 (14:03 +0300)]
Fix RefPointer::staticCast() to behave like static_cast(), not like reinterpret_cast().
George Kiagiadakis [Sat, 10 Jul 2010 10:49:07 +0000 (13:49 +0300)]
Rename QGst::deinit() to QGst::cleanup(). deinit is not a good name.
George Kiagiadakis [Thu, 8 Jul 2010 19:22:24 +0000 (22:22 +0300)]
Add wrapper for the GstURIHandler interface.
George Kiagiadakis [Thu, 8 Jul 2010 16:32:21 +0000 (19:32 +0300)]
Add a const SharedStructure Caps::structure(uint index) const method.
George Kiagiadakis [Thu, 8 Jul 2010 16:30:45 +0000 (19:30 +0300)]
Add a Structure(const GstStructure*) constructor and make the equivalent Value constructor take a pointer too instead of a reference,
to make the API more uniform between those two classes. Also make some of their constructors explicit, to avoid nasty bugs.
George Kiagiadakis [Thu, 8 Jul 2010 15:00:01 +0000 (18:00 +0300)]
Improve the CMakeLists.txt files.
* Cleanup the g++ flags and enable -std=c++0x only if g++ is recent enough to support it.
* Enable testing with ctest.
* Make the qgst_test() macro syntax easier.
George Kiagiadakis [Thu, 8 Jul 2010 14:57:33 +0000 (17:57 +0300)]
Update the README.
* Declare the project ready for simple uses.
* Add some information regarding compilers and C++0x usage.
* Document the makeWritable() method for refcounted wrappers.
George Kiagiadakis [Thu, 8 Jul 2010 10:49:56 +0000 (13:49 +0300)]
Add wrappers for the simple gst_parse_* methods.
George Kiagiadakis [Wed, 7 Jul 2010 14:31:30 +0000 (17:31 +0300)]
Add wrapper for GError.
George Kiagiadakis [Tue, 6 Jul 2010 16:17:51 +0000 (19:17 +0300)]
Add a new "player" example: a simple command-line audio player.
In the future it will probably be expanded to handle video as well.
Although it is technically possible to do that now, I would like to
use the VideoWidget class that I plan to write for QtGstreamer.
George Kiagiadakis [Tue, 6 Jul 2010 15:43:17 +0000 (18:43 +0300)]
Add ValueImpl specialization for Caps, Message and MiniObject.
George Kiagiadakis [Tue, 6 Jul 2010 14:55:38 +0000 (17:55 +0300)]
Add Pipeline::bus() method.
George Kiagiadakis [Sun, 4 Jul 2010 18:36:55 +0000 (21:36 +0300)]
s/runtime_error/logic_error/ in the exceptions that ValueBase throws and all the exceptions used in the signals & closures system.
These errors are really programmer errors, not something that can happen unexpectedly at runtime, so logic_error fits better.
George Kiagiadakis [Sun, 4 Jul 2010 18:26:13 +0000 (21:26 +0300)]
Fix stupid mistakes. Signal::d should have been a QSharedDataPointer, not a QSharedPointer,
and Signal::Private::query() should actually cache its results.
George Kiagiadakis [Sun, 4 Jul 2010 17:52:09 +0000 (20:52 +0300)]
Remove QGlib::String again. It sucks.
From now on the following policy will apply:
- Any methods that need to take a string argument will take a const char*.
This is because native gstreamer functions also take a const char* and in most
cases the programmer just passes an ascii string literal, so there is no need
to copy it in some string class and then let gstreamer copy it again. QString
is out of the question in this case, since it copies and converts to utf16, only
to let the wrapper function copy it again and convert it back to ascii. In case
the programmer needs to pass a QString to such a function, he should first convert
it to utf8 with QString::toUtf8(). This will be documented later.
- Any methods that need to return a string should return a QString.
This is because: 1) we need to make sure that the programmer won't do anything stupid
with the string, such as not free it or hold a reference to a free()-ed string, so
we can't return char* like the C functions do. 2) Usually these strings are used
for display or comparison, so the programmer needs to have an encoding-safe way
to do that and this is what QString offers. Returning a QByteArray and forcing the
programmer to convert it to unicode is not a good option.
George Kiagiadakis [Sat, 3 Jul 2010 18:16:02 +0000 (21:16 +0300)]
Change PluginFeature::load() to return void and internally change m_object if needed.
It makes no sense to return a new object.
George Kiagiadakis [Sat, 3 Jul 2010 18:04:55 +0000 (21:04 +0300)]
Add missing gst_object_ref_sink() in Pad::create().
George Kiagiadakis [Sat, 3 Jul 2010 17:40:25 +0000 (20:40 +0300)]
Change RefCountedObject::object() to be a template that automatically casts to the requested pointer type.
This is to avoid the overhead of using gstreamer's GST_FOO() macros that internally make a type check too.
George Kiagiadakis [Wed, 30 Jun 2010 14:52:49 +0000 (17:52 +0300)]
Rename all the "newClass" pseudo-constructors to "create".
Since these are static methods, you need to type the class name anyway,
so there is no need to type it again after "new". Plain "new" would have
been ideal, but unfortunately it is a keyword.
For consistency, the Caps constructors have been renamed too, although
they did not follow the "newClass" pattern.
George Kiagiadakis [Wed, 30 Jun 2010 14:30:30 +0000 (17:30 +0300)]
Add wrapper for GstBus.
George Kiagiadakis [Tue, 29 Jun 2010 11:47:14 +0000 (14:47 +0300)]
Add typedefs for GstClockTime and GstClockTimeDiff.
George Kiagiadakis [Mon, 28 Jun 2010 19:09:08 +0000 (22:09 +0300)]
Add structs Fourcc, Fraction, IntRange, DoubleRange and FractionRange.
George Kiagiadakis [Mon, 28 Jun 2010 12:42:22 +0000 (15:42 +0300)]
Initial implementation of the GObject signal wrapper system.
* Implement classes Signal and SignalHandler that wrap the basic functionality of
the g_signal* methods, including signal connection and emission and using both
variadic and non-variadic template versions for the connect() and emit() methods.
* Refactor the Closure system and add non-variadic versions of the templates for
compilers that do not support C++0x variadic templates.
* Make the ValueBase::get / ValueBase::set methods throw exceptions instead of
asserting. This helps showing nicer error messages from the signal system when
these methods are called from there and allows in some non-fatal cases to
continue execution.
George Kiagiadakis [Mon, 21 Jun 2010 11:41:52 +0000 (14:41 +0300)]
Implement a QSharedDataPointer-like method for ensuring that caps and miniobjects are writable when needed.
The trick is to get the pointer to the underlying object using an object() method that has a const and
a non-const version. The non-const one calls makeWritable() internally, which makes a copy of the
object if needed, so any non-const method trying to access the underlying object is guaranteed that
it is writable. This is very similar to Qt's implicit sharing mechanism and what QSharedDataPointer does.
George Kiagiadakis [Sun, 20 Jun 2010 14:09:36 +0000 (17:09 +0300)]
Make RefPointer::operator->() return an object pointer with the same const-ness as the RefPointer, so that it actually makes sense to use const RefPointers.
George Kiagiadakis [Sun, 20 Jun 2010 13:21:54 +0000 (16:21 +0300)]
QGst::StructureBase: Replace the peekGstStructure() methods with operator GstStructure* to keep consistency with QGlib::ValueBase
George Kiagiadakis [Sun, 20 Jun 2010 13:00:28 +0000 (16:00 +0300)]
valuetest: Add a Value <-> GValue cast test and use GetType() for all the type checks.
George Kiagiadakis [Sat, 19 Jun 2010 17:21:36 +0000 (20:21 +0300)]
Refactor the Type and Value systems, cleanup code, add useful macros, documentation, etc..
* Add struct GetTypeImpl and its specializations in type.h.
* Make GetType() an inline function that uses GetTypeImpl internally.
* Add basic documentation for Type, GetType and their associated macros.
* Add QGLIB_STATIC_ASSERT() macro to allow specifying a nice assertion message when using C++0x.
* Add macros for defining ValueImpl specializations.
* Remove the ValueBase::getFoo / ValueBase::setFoo methods.
* Place all basic ValueImpl specializations in value.h, remove the valueimpl headers.
* Remove VALUE_ASSERT and use a type check inside ValueBase::get/set.
* Remove ValueImpl specialization for pointers. Allow only void* (Type::Pointer) and const char* (Type::String).
* Register Type, ValueBase, Value, SharedValue, StructureBase and SharedStructure with the type system.
* Attempt to fix the mess with the included headers. Try to include all used headers instead of relying on indirect inclusion from global.h.
* Remove the peekGValue() methods from ValueBase and replace them with operator GValue*().
* Minor fixes here and there...
(Long commit, sorry...)
George Kiagiadakis [Mon, 14 Jun 2010 15:39:42 +0000 (18:39 +0300)]
Add methods in RefPointer to allow casting RefPointers of derived classes to RefPointers of their base classes.
This allows for example to implicitly cast a QGst::ElementPtr to a QGst::ObjectPtr without using staticCast()
or dynamicCast(). The use of a static assertion and boost's type traits ensures that you cannot cast
in the opposite direction (i.e. ObjectPtr to ElementPtr).
George Kiagiadakis [Mon, 14 Jun 2010 11:45:42 +0000 (14:45 +0300)]
Add overloaded String::operator==() methods to fix a build failure in some tests.
George Kiagiadakis [Mon, 14 Jun 2010 09:50:36 +0000 (12:50 +0300)]
Introduce a new String class, based on QByteArray, to avoid the overhead
of converting to/from UTF-16 when not necessary by using QString.
This class also introduces replacements for the gcharPtrToQString()
and qstringToGCharPtr() helper methods, so that it's easier to wrap
strings in the bindings.
George Kiagiadakis [Wed, 2 Jun 2010 11:42:30 +0000 (14:42 +0300)]
Add wrapper for GstMessage.
George Kiagiadakis [Sun, 23 May 2010 08:34:51 +0000 (11:34 +0300)]
Properly fix the reference counting bug I had with adding elements to bins.
Apparently GstBin adds a new reference to the elements that are added in it,
except if they are floating, in which case it takes the floating reference.
George Kiagiadakis [Fri, 7 May 2010 10:33:41 +0000 (13:33 +0300)]
Add wrapper for GstGhostPad.
George Kiagiadakis [Mon, 19 Apr 2010 21:05:43 +0000 (00:05 +0300)]
Port the 'echo' example to the new bindings to make it work again.
George Kiagiadakis [Mon, 19 Apr 2010 21:05:07 +0000 (00:05 +0300)]
Add global init/deinit functions.
George Kiagiadakis [Mon, 19 Apr 2010 20:36:51 +0000 (23:36 +0300)]
Add basic wrapper for GstPipeline (just the method to create a new pipeline for now).
George Kiagiadakis [Sat, 17 Apr 2010 11:18:41 +0000 (14:18 +0300)]
Add wrapper for the GstChildProxy interface and use it in Bin.
George Kiagiadakis [Sat, 17 Apr 2010 09:23:38 +0000 (12:23 +0300)]
Improve the Object properties api. Use QString and export the methods that get/return a Value object.
George Kiagiadakis [Wed, 14 Apr 2010 15:44:24 +0000 (18:44 +0300)]
Add wrapper class for GstBin.
Still missing the iterator methods, though.
George Kiagiadakis [Wed, 14 Apr 2010 14:05:35 +0000 (17:05 +0300)]
Add wrapper class for GstElementFactory.
George Kiagiadakis [Wed, 14 Apr 2010 12:54:52 +0000 (15:54 +0300)]
Add a new qstringToGcharPtr() macro that converts a QString to a const gchar * and use it where appropriate.
This macro makes sure that empty strings become NULL instead of "" (i.e. empty string),
as most (if not all) gstreamer methods use NULL to represent an empty string.
George Kiagiadakis [Wed, 14 Apr 2010 10:51:54 +0000 (13:51 +0300)]
Add wrapper class for GstPluginFeature.
George Kiagiadakis [Wed, 14 Apr 2010 09:17:46 +0000 (12:17 +0300)]
Add a README file with various information, mostly targeted to people that want to contribute.
George Kiagiadakis [Tue, 13 Apr 2010 17:45:09 +0000 (20:45 +0300)]
Add initial wrappers for GstPad and GstElement. Not all methods are yet there.
George Kiagiadakis [Tue, 13 Apr 2010 08:45:09 +0000 (11:45 +0300)]
Support mixed type registrations and enum definitions in codegen, needed for enums.h.
George Kiagiadakis [Thu, 1 Apr 2010 14:09:07 +0000 (17:09 +0300)]
Remove the headers from the tests and put the class declarations in the cpp files.
George Kiagiadakis [Thu, 1 Apr 2010 14:02:13 +0000 (17:02 +0300)]
Add wrapper class for GstCaps.
George Kiagiadakis [Wed, 31 Mar 2010 15:53:48 +0000 (18:53 +0300)]
Add wrapper class for GstMiniObject.
George Kiagiadakis [Wed, 31 Mar 2010 15:47:04 +0000 (18:47 +0300)]
Improve enum assertions generation.
Make it possible to use enums that are not part of some class and make use
of the class name in the gst-style output if the enum belongs to a class.
George Kiagiadakis [Fri, 26 Mar 2010 19:55:21 +0000 (21:55 +0200)]
Add wrapper class for GstStructure.
George Kiagiadakis [Fri, 26 Mar 2010 19:50:48 +0000 (21:50 +0200)]
Add forward declarations for the gstreamer wrapper classes that will be implemented next.
George Kiagiadakis [Thu, 25 Mar 2010 17:11:05 +0000 (19:11 +0200)]
Improve the Value API:
* Add constructor and assignment operator to allow copying a SharedValue to a Value.
* Add QDebug stream operator and remove the dumpContents() method.
* Rename peekNativeObject() to peekGValue().
* Add template init() method.
* Other minor fixes.
George Kiagiadakis [Thu, 25 Mar 2010 14:05:15 +0000 (16:05 +0200)]
Add the most useful methods to the GstObject wrapper class.
George Kiagiadakis [Mon, 22 Mar 2010 14:13:50 +0000 (16:13 +0200)]
Add protected constructors/destructor to all wrapper classes, so that they can only be used with RefPointer.