Adapt code to changes in libqosm
authorMikko Rasa <mikko.rasa@movial.fi>
Wed, 5 Nov 2008 12:59:45 +0000 (14:59 +0200)
committerMikko Rasa <mikko.rasa@movial.fi>
Wed, 5 Nov 2008 12:59:45 +0000 (14:59 +0200)
configure.ac
modules/Makefile.am
modules/gstomx-qos-bridge.c

index 9dfa3e2..1c97336 100644 (file)
@@ -47,6 +47,10 @@ AC_SUBST(COMPONENTDIR)
 AC_ARG_ENABLE(qosm, AS_HELP_STRING([--enable-qosm], [Include support for QoS manager]), qosm=$enableval, qosm=no)
 AM_CONDITIONAL(QOSM, test "$qosm" = yes)
 if test "$qosm" = yes; then
+       PKG_CHECK_MODULES(openmax, [libomxil-bellagio], , AC_MSG_ERROR(libomxil-bellagio is required))
+       AC_SUBST(openmax_CFLAGS)
+       AC_SUBST(openmax_LIBS)
+
        PKG_CHECK_MODULES(libqosm, [libqosm], , AC_MSG_ERROR(libqosm is required))
        AC_SUBST(libqosm_CFLAGS)
        AC_SUBST(libqosm_LIBS)
index a05125c..774901e 100644 (file)
@@ -7,6 +7,6 @@ pkglib_LTLIBRARIES = $(QOS_BRIDGE_LA)
 gst_CFLAGS = $(glib_CFLAGS) $(gstreamer_CFLAGS)
 
 gstomx_qos_bridge_la_SOURCES = gstomx-qos-bridge.c
-gstomx_qos_bridge_la_CFLAGS = $(gst_CFLAGS) $(libqosm_CFLAGS)
+gstomx_qos_bridge_la_CFLAGS = $(gst_CFLAGS) $(libqosm_CFLAGS) $(openmax_CFLAGS)
 gstomx_qos_bridge_la_LDFLAGS = -module
-gstomx_qos_bridge_la_LIBADD = $(libqosm_LIBS)
+gstomx_qos_bridge_la_LIBADD = $(libqosm_LIBS) $(openmax_LIBS)
index f2d6af8..fc9ea5f 100644 (file)
@@ -114,7 +114,7 @@ destroy_hook(OctopusBackendGst *backend,
   qosdata = (RouteDataQos *)g_object_get_data(G_OBJECT(route), "qosdata");
 
   if(qosdata->qos_graph_id)
-    deleteQoSGraph(qosdata->qos_graph_id);
+    IQoSManager_deleteQoSGraph(qosdata->qos_graph_id);
   g_free(qosdata);
 }
 
@@ -144,7 +144,7 @@ stop_hook(OctopusBackendGst *backend,
   qosdata = (RouteDataQos *)g_object_get_data(G_OBJECT(route), "qosdata");
 
   if(qosdata->qos_graph_id) {
-    deleteQoSGraph(qosdata->qos_graph_id);
+    IQoSManager_deleteQoSGraph(qosdata->qos_graph_id);
     qosdata->qos_graph_id = 0;
   }
 
@@ -176,22 +176,22 @@ bus_watch(GstBus     *bus,
     elem = GST_ELEMENT(GST_MESSAGE_SRC(msg));
     gst_message_parse_state_changed(msg, &previous, &state, &pending);
     if(previous == GST_STATE_NULL && state == GST_STATE_READY) {
-      int status = 1;
+      OMX_ERRORTYPE err = OMX_ErrorNone;
       if(g_object_class_find_property(G_OBJECT_GET_CLASS(elem), "omx-handle")) {
         struct qos_component comp;
 
         g_object_get(G_OBJECT(elem), "omx-handle", &comp.handle, "component-name", &comp.name, NULL);
         g_debug("Reserving resources for OpenMAX component %s (%p)", comp.name, comp.handle);
         if(qosdata->qos_graph_id)
-          status = addComponentGraph(&comp, 1, qosdata->qos_graph_id);
+          err = IQoSManager_addComponentGraph(&comp, 1, qosdata->qos_graph_id);
         else {
-          status = checkGraph(&comp, 1, &qosdata->qos_graph_id);
-          if(status)
-            status = createQoSGraph(qosdata->qos_graph_id);
+          err = IQoSManager_checkGraph(&comp, 1, &qosdata->qos_graph_id);
+          if(err == OMX_ErrorNone)
+            err = IQoSManager_createQoSGraph(qosdata->qos_graph_id);
         }
         g_free(comp.name);
       }
-      if(!status) {
+      if(err != OMX_ErrorNone) {
         g_debug("QoS manager says no resources available, stopping the route");
         qosdata->resources_ok = FALSE;
         octopus_route_stop(route);