Permalink
Browse files

Add a property Port:buffers_allocated

  • Loading branch information...
1 parent 7b93e06 commit d7928cad9aad55f94fc658a920d742d4730e9df6 @tigrux committed Mar 10, 2010
Showing with 22 additions and 0 deletions.
  1. +14 −0 gomx.c
  2. +1 −0 gomx.h
  3. +6 −0 gomx.vala
  4. +1 −0 gomx.vapi
View
14 gomx.c
@@ -863,6 +863,7 @@ enum {
GOMX_PORT_DOMAIN,
GOMX_PORT_EOS,
GOMX_PORT_NO_ALLOCATE_BUFFERS,
+ GOMX_PORT_BUFFERS_ALLOCATED,
GOMX_PORT_QUEUE,
GOMX_PORT_N_BUFFERS,
GOMX_PORT_N_MIN_BUFFERS,
@@ -904,6 +905,7 @@ gboolean gomx_port_get_enabled (GOmxPort* self);
gboolean gomx_port_get_populated (GOmxPort* self);
OMX_PORTDOMAINTYPE gomx_port_get_domain (GOmxPort* self);
void gomx_port_set_no_allocate_buffers (GOmxPort* self, gboolean value);
+gboolean gomx_port_get_buffers_allocated (GOmxPort* self);
void gomx_port_set_n_buffers (GOmxPort* self, guint value);
guint gomx_port_get_n_min_buffers (GOmxPort* self);
static GObject * gomx_port_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
@@ -4365,6 +4367,14 @@ void gomx_port_set_no_allocate_buffers (GOmxPort* self, gboolean value) {
}
+gboolean gomx_port_get_buffers_allocated (GOmxPort* self) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = self->priv->_buffers != NULL;
+ return result;
+}
+
+
GAsyncQueue* gomx_port_get_queue (GOmxPort* self) {
GAsyncQueue* result;
g_return_val_if_fail (self != NULL, NULL);
@@ -4441,6 +4451,7 @@ static void gomx_port_class_init (GOmxPortClass * klass) {
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_DOMAIN, g_param_spec_int ("domain", "domain", "domain", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_EOS, g_param_spec_boolean ("eos", "eos", "eos", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_NO_ALLOCATE_BUFFERS, g_param_spec_boolean ("no-allocate-buffers", "no-allocate-buffers", "no-allocate-buffers", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_BUFFERS_ALLOCATED, g_param_spec_boolean ("buffers-allocated", "buffers-allocated", "buffers-allocated", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_QUEUE, g_param_spec_pointer ("queue", "queue", "queue", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_N_BUFFERS, g_param_spec_uint ("n-buffers", "n-buffers", "n-buffers", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), GOMX_PORT_N_MIN_BUFFERS, g_param_spec_uint ("n-min-buffers", "n-min-buffers", "n-min-buffers", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
@@ -4520,6 +4531,9 @@ static void gomx_port_get_property (GObject * object, guint property_id, GValue
case GOMX_PORT_NO_ALLOCATE_BUFFERS:
g_value_set_boolean (value, gomx_port_get_no_allocate_buffers (self));
break;
+ case GOMX_PORT_BUFFERS_ALLOCATED:
+ g_value_set_boolean (value, gomx_port_get_buffers_allocated (self));
+ break;
case GOMX_PORT_QUEUE:
g_value_set_pointer (value, gomx_port_get_queue (self));
break;
View
1 gomx.h
@@ -547,6 +547,7 @@ OMX_PORTDOMAINTYPE gomx_port_get_domain (GOmxPort* self);
gboolean gomx_port_get_eos (GOmxPort* self);
gboolean gomx_port_get_no_allocate_buffers (GOmxPort* self);
void gomx_port_set_no_allocate_buffers (GOmxPort* self, gboolean value);
+gboolean gomx_port_get_buffers_allocated (GOmxPort* self);
GAsyncQueue* gomx_port_get_queue (GOmxPort* self);
guint gomx_port_get_n_buffers (GOmxPort* self);
void gomx_port_set_n_buffers (GOmxPort* self, guint value);
View
@@ -1066,6 +1066,12 @@ namespace GOmx {
}
+ public bool buffers_allocated {
+ get {
+ return _buffers != null;
+ }
+ }
+
public weak AsyncQueue<Omx.BufferHeader> queue {
get {
return _buffers_queue;
View
@@ -136,6 +136,7 @@ namespace GOmx {
public void use_null_buffers () throws GOmx.Error;
public uint buffer_size { get; }
public GOmx.BufferArray buffers { get; }
+ public bool buffers_allocated { get; }
public GOmx.Component component { get; set; }
public Omx.PortDomain domain { get; }
public bool enabled { get; }

0 comments on commit d7928ca

Please sign in to comment.