Re: Testing Gstmm Element seeking
- From: José Alburquerque <jaalburquerque cox net>
- To: Murray Cumming <murrayc murrayc com>
- Cc: Gtkmm Mailing List <gtkmm-list gnome org>
- Subject: Re: Testing Gstmm Element seeking
- Date: Fri, 21 Dec 2007 12:43:35 -0500
José Alburquerque wrote:
Murray Cumming wrote:
I think we'll need to have an extra PKG_CONFIG check for examples cflags
and libs, and maybe add a --disable-examples configure option. gtkmm has
a --disable-examples option already.
The const references seem odd here:
+ _WRAP_METHOD(bool seek(Format format, SeekFlags flags, const gint64&
position), gst_element_seek_simple)
_WRAP_METHOD(bool seek(const double& rate, Format format, SeekFlags
flags, SeekType current_type, const gint64& current_position, SeekType
stop_type, const gint64& stop_position), gst_element_seek)
I don't see the point of passing a const refererence when it could just
be passed by value. Could you change that, please?
Sure. I'll also look into the PKG_CONFIG and "--disable-examples" options.
-Jose
I've fixed the references. I also added initial "GstEvent" wrapping
(that I had started yesterday). I'm still not sure how to include
PKG_CONFIG options for the new example and where to enable the
--disable-examples options. Would you help me out a little. Thanks.
-Jose
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Index: ChangeLog
===================================================================
--- ChangeLog (revision 109)
+++ ChangeLog (working copy)
@@ -1,3 +1,22 @@
+2007-12-20 José Alburquerque <jaalburquerque cox com>
+
+ * examples/ogg_player/main.cc: fixed time output formatting
+ * gst/gstmm.h: added <gstmm/query.h> and <gstmm/event.h>
+ * gst/src/Makefile_list_of_hg.am_fragment: added query.hg and event.hg
+ to general hg files
+ * gst/src/caps.hg: made some hidden methods public
+ * gst/src/clock.ccg: renamed get_millesconds() to more appropriate
+ name get_fractional_seconds(); added get_milliseconds(),
+ get_microseconds() and get_nanoseconds()
+ * gst/src/clock.hg: added declarations for get_microseconds(),
+ get_nanoseconds() and get_fractional_seconds()
+ * gst/src/element.hg: renamed seek_simple() method to (overloaded)
+ seek() and fixed their unneeded constant references
+ * gst/src/event.ccg: added new file
+ * gst/src/event.hg: added initial declaration for Gst::Event class
+ * gst/src/query.ccg: added new file
+ * gst/src/query.hg: added initial declaration for Gst::Query class
+
2007-12-13 José Alburquerque <jaalburquerque cox com>
* examples/ogg_player/main.cc: Changed pos and len to type gint64
Index: gst/src/element.hg
===================================================================
--- gst/src/element.hg (revision 109)
+++ gst/src/element.hg (working copy)
@@ -89,8 +89,8 @@
bool query_duration(Format& format) const;
_WRAP_METHOD(bool query_duration(Format& format, gint64& duration) const, gst_element_query_duration)
- _WRAP_METHOD(bool seek_simple(Format format, SeekFlags flags, const gint64& position), gst_element_seek_simple)
- _WRAP_METHOD(bool seek(const double& rate, Format format, SeekFlags flags, SeekType current_type, const gint64& current_position, SeekType stop_type, const gint64& stop_position), gst_element_seek)
+ _WRAP_METHOD(bool seek(Format format, SeekFlags flags, gint64 position), gst_element_seek_simple)
+ _WRAP_METHOD(bool seek(double rate, Format format, SeekFlags flags, SeekType current_type, gint64 current_position, SeekType stop_type, gint64 stop_position), gst_element_seek)
_IGNORE(gst_element_link, gst_element_get_compatible_pad, gst_element_link_many)
Index: gst/src/query.ccg
===================================================================
--- gst/src/query.ccg (revision 0)
+++ gst/src/query.ccg (revision 0)
@@ -0,0 +1,6 @@
+#include <gst/gstquery.h>
+
+namespace Gst
+{
+
+} //namesapce Gst
Index: gst/src/query.hg
===================================================================
--- gst/src/query.hg (revision 0)
+++ gst/src/query.hg (revision 0)
@@ -0,0 +1,15 @@
+#include <gstmm/miniobject.h>
+#include <gstmm/structure.h>
+#include <gstmm/wrap.h>
+_PINCLUDE(gstmm/private/miniobject_p.h)
+_DEFS(gstmm,gst)
+
+namespace Gst
+{
+class Query : public MiniObject
+{
+protected:
+ _CLASS_GSTMINIOBJECT(Query, GstQuery, GST_QUERY, Gst::MiniObject, GstMiniObject)
+};
+
+}//namespace Gst
Index: gst/src/event.ccg
===================================================================
--- gst/src/event.ccg (revision 0)
+++ gst/src/event.ccg (revision 0)
@@ -0,0 +1,6 @@
+#include <gst/gstevent.h>
+
+namespace Gst
+{
+
+} //namesapce Gst
Index: gst/src/event.hg
===================================================================
--- gst/src/event.hg (revision 0)
+++ gst/src/event.hg (revision 0)
@@ -0,0 +1,15 @@
+#include <gstmm/miniobject.h>
+#include <gstmm/structure.h>
+#include <gstmm/wrap.h>
+_PINCLUDE(gstmm/private/miniobject_p.h)
+_DEFS(gstmm,gst)
+
+namespace Gst
+{
+class Event : public MiniObject
+{
+protected:
+ _CLASS_GSTMINIOBJECT(Event, GstEvent, GST_EVENT, Gst::MiniObject, GstMiniObject)
+};
+
+}//namespace Gst
Index: gst/src/caps.hg
===================================================================
--- gst/src/caps.hg (revision 109)
+++ gst/src/caps.hg (working copy)
@@ -8,12 +8,12 @@
class Caps
{
-public:
-
_CLASS_OPAQUE_REFCOUNTED(Caps, GstCaps, NONE, gst_caps_ref, gst_caps_unref)
_IGNORE(gst_caps_ref, gst_caps_unref)
+public:
//TODO: Why doesn't this use _WRAP_CREATE()?
+ //ANS: Could it be because there are two void methods that create a Caps? -Jose
static Glib::RefPtr<Caps> create_empty();
static Glib::RefPtr<Caps> create_any();
static Glib::RefPtr<Caps> create_full(Structure&);
Index: gst/src/clock.ccg
===================================================================
--- gst/src/clock.ccg (revision 109)
+++ gst/src/clock.ccg (working copy)
@@ -25,6 +25,24 @@
guint get_milliseconds(ClockTime time)
{
return GST_CLOCK_TIME_IS_VALID (time) ? \
+ (guint) ((((GstClockTime)(time)) / GST_MSECOND) % 1000) : 999;
+}
+
+guint get_microseconds(ClockTime time)
+{
+ return GST_CLOCK_TIME_IS_VALID (time) ? \
+ (guint) ((((GstClockTime)(time)) / GST_USECOND) % 1000) : 999;
+}
+
+guint get_nanoseconds(ClockTime time)
+{
+ return GST_CLOCK_TIME_IS_VALID (time) ? \
+ (guint) ((((GstClockTime)(time)) / GST_NSECOND) % 1000) : 999;
+}
+
+guint get_fractional_seconds(ClockTime time)
+{
+ return GST_CLOCK_TIME_IS_VALID (time) ? \
(guint) (((GstClockTime)(time)) % GST_SECOND) : 999999999;
}
Index: gst/src/clock.hg
===================================================================
--- gst/src/clock.hg (revision 109)
+++ gst/src/clock.hg (working copy)
@@ -26,6 +26,9 @@
guint get_minutes(ClockTime time);
guint get_seconds(ClockTime time);
guint get_milliseconds(ClockTime time);
+guint get_microseconds(ClockTime time);
+guint get_nanoseconds(ClockTime time);
+guint get_fractional_seconds(ClockTime time);
class Clock : public Object
{
Index: gst/src/Makefile_list_of_hg.am_fragment
===================================================================
--- gst/src/Makefile_list_of_hg.am_fragment (revision 109)
+++ gst/src/Makefile_list_of_hg.am_fragment (working copy)
@@ -4,8 +4,9 @@
files_posix_hg =
files_win32_hg =
-files_general_hg = enums.hg caps.hg clock.hg element.hg error.hg iterator.hg format.hg pad.hg \
- padtemplate.hg structure.hg systemclock.hg xml.hg bin.hg pipeline.hg bus.hg message.hg
+files_general_hg = enums.hg caps.hg clock.hg element.hg error.hg event.hg \
+ iterator.hg format.hg pad.hg padtemplate.hg query.hg structure.hg \
+ systemclock.hg xml.hg bin.hg pipeline.hg bus.hg message.hg
files_general_deprecated_hg =
Index: gst/gstmm.h
===================================================================
--- gst/gstmm.h (revision 109)
+++ gst/gstmm.h (working copy)
@@ -4,11 +4,13 @@
#include <gstmm/clock.h>
#include <gstmm/element.h>
#include <gstmm/error.h>
+#include <gstmm/event.h>
#include <gstmm/format.h>
#include <gstmm/iterator.h>
#include <gstmm/object.h>
#include <gstmm/pad.h>
#include <gstmm/pipeline.h>
+#include <gstmm/query.h>
#include <gstmm/structure.h>
#include <gstmm/systemclock.h>
Index: examples/ogg_player/main.cc
===================================================================
--- examples/ogg_player/main.cc (revision 109)
+++ examples/ogg_player/main.cc (working copy)
@@ -16,16 +16,18 @@
if (pipeline->query_position(fmt, pos)
&& pipeline->query_duration(fmt, len)) {
- std::cout << "Time: " << std::setfill('0') <<
+ std::cout << std::right << "Time: " << std::setfill('0') <<
std::setw(3) << Gst::get_hours(pos) << ":" <<
std::setw(2) << Gst::get_minutes(pos) << ":" <<
std::setw(2) << Gst::get_seconds(pos) << "." <<
- std::setw(9) << Gst::get_milliseconds(pos);
+ std::setw(9) << std::left << Gst::get_fractional_seconds(pos);
- std::cout << "/" << std::setw(3) << Gst::get_hours(len) << ":" <<
+ std::cout << std::right << "/" <<
+ std::setw(3) << Gst::get_hours(len) << ":" <<
std::setw(2) << Gst::get_minutes(len) << ":" <<
std::setw(2) << Gst::get_seconds(len) << "." <<
- std::setw(9) << Gst::get_milliseconds(len) << std::endl << std::flush;
+ std::setw(9) << std::left << Gst::get_fractional_seconds(len) <<
+ std::endl << std::flush;
}
return true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]