switch: explicit route support eel master 4.99.3 4.99.4 4.99.5 5.0.0 5.0.1 5.0.2 5.0.3 5.99.1 eel/4.99.3 eel/4.99.4 eel/4.99.5 eel/5.0.0 eel/5.0.1 eel/5.0.2 eel/5.0.3 eel_4.99.3 eel_4.99.4 eel_4.99.5 eel_5.0.0 eel_5.0.1 eel_5.0.2 eel_5.0.3 flounder/5.99.1 flounder_5.99.1
authorYannick Gicquel <yannick.gicquel@iot.bzh>
Wed, 28 Sep 2016 08:24:48 +0000 (10:24 +0200)
committerYannick Gicquel <yannick.gicquel@iot.bzh>
Tue, 11 Oct 2016 15:09:07 +0000 (17:09 +0200)
- stream to device

Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh>
router.c
switch.c
switch.h

index 16abd7c..ead298f 100644 (file)
--- a/router.c
+++ b/router.c
@@ -500,9 +500,9 @@ void implement_default_route (struct userdata *u,
                               uint32_t stamp)
 {
        if (start->direction == agl_input)
-               agl_switch_setup_link (u, start, end, false);
+               agl_switch_setup_link (u, start, end);
        else
-               agl_switch_setup_link (u, end, start, false);
+               agl_switch_setup_link (u, end, start);
 }
 
 agl_node *find_default_route (struct userdata *u, agl_node *start, uint32_t stamp)
index e3b5451..e7bf83a 100644 (file)
--- a/switch.c
+++ b/switch.c
@@ -27,7 +27,7 @@
 #include "switch.h"
 #include "node.h"
 
-bool agl_switch_setup_link (struct userdata *u, agl_node *from, agl_node *to, bool explicit)
+bool agl_switch_setup_link (struct userdata *u, agl_node *from, agl_node *to)
 {
        pa_core *core;
        pa_sink *sink;
@@ -39,7 +39,7 @@ bool agl_switch_setup_link (struct userdata *u, agl_node *from, agl_node *to, bo
        /* EXPLICIT ROUTES/DEFAULT ROUTES */
 
        /* 1) EXPLICIT ROUTES : "FROM" AND "TO" ARE DEFINED */
-       if (explicit) {
+       if (from && to) {
                pa_assert (from);
                pa_assert (to);
 
@@ -55,6 +55,14 @@ bool agl_switch_setup_link (struct userdata *u, agl_node *from, agl_node *to, bo
                                case agl_device:
                                        //if (!setup_explicit_stream2dev_link (u, from, to))
                                        //      return false;
+                                       sink = agl_utils_get_alsa_sink (u, to->paname);
+                                       if (!sink) {
+                                               pa_log("sink output not found!!!!");
+                                               sink = agl_utils_get_primary_alsa_sink (u);
+                                               //break;
+                                       }
+                                       source = agl_utils_get_null_source (u, from->nullsink);
+                                       from->loopnode = agl_loopnode_create (u, AGL_LOOPNODE_SINK, from->index, source->index, sink->index);
                                        break;
                                /* DEFAULT */
                                default:
index c454f1a..ad27ffe 100644 (file)
--- a/switch.h
+++ b/switch.h
@@ -24,7 +24,7 @@
 
 #include "userdata.h"
 
-bool agl_switch_setup_link (struct userdata *, agl_node *, agl_node *, bool);
+bool agl_switch_setup_link (struct userdata *, agl_node *, agl_node *);
 bool agl_switch_teardown_link (struct userdata *, agl_node *, agl_node *);
 
 /*pa_source *setup_device_input(struct userdata *, agl_node *);*/