Ticket #11856: 0001-Add-SyncToNode-test-to-NodeTest-and-update-it-to-act.patch

File 0001-Add-SyncToNode-test-to-NodeTest-and-update-it-to-act.patch, 2.8 KB (added by Barrett, 10 years ago)

Fix NodeTest and add SyncToNode test.

  • src/tests/kits/media/nodetest/ConsumerNode.cpp

    From cf5b6d13a482a8394e98a0048f224858246f0494 Mon Sep 17 00:00:00 2001
    From: Dario Casalinuovo <b.vitruvio@gmail.com>
    Date: Sat, 28 Mar 2015 15:31:39 +0100
    Subject: [PATCH 1/2] Add SyncToNode test to NodeTest and update it to actual
     API to make it build without warnings.
    
    ---
     src/tests/kits/media/nodetest/ConsumerNode.cpp | 4 ++--
     src/tests/kits/media/nodetest/Jamfile          | 2 +-
     src/tests/kits/media/nodetest/ProducerNode.cpp | 4 ++--
     src/tests/kits/media/nodetest/main.cpp         | 6 ++++++
     4 files changed, 11 insertions(+), 5 deletions(-)
    
    diff --git a/src/tests/kits/media/nodetest/ConsumerNode.cpp b/src/tests/kits/media/nodetest/ConsumerNode.cpp
    index 6b39adc..e9fb7a9 100644
    a b  
    1111
    1212ConsumerNode::ConsumerNode()
    1313    :
     14    BMediaNode("ConsumerNode"),
    1415    BBufferConsumer(B_MEDIA_RAW_AUDIO),
    15     BMediaEventLooper(),
    16     BMediaNode("ConsumerNode")
     16    BMediaEventLooper()
    1717{
    1818    out("ConsumerNode::ConsumerNode\n");
    1919}
  • src/tests/kits/media/nodetest/Jamfile

    diff --git a/src/tests/kits/media/nodetest/Jamfile b/src/tests/kits/media/nodetest/Jamfile
    index ad9f633..f477909 100644
    a b SimpleTest NodeTest  
    77    ConsumerNode.cpp
    88    ProducerNode.cpp
    99
    10     : be media
     10    : be media [ TargetLibsupc++ ]
    1111;
    1212
  • src/tests/kits/media/nodetest/ProducerNode.cpp

    diff --git a/src/tests/kits/media/nodetest/ProducerNode.cpp b/src/tests/kits/media/nodetest/ProducerNode.cpp
    index 9465e8b..13e47b4 100644
    a b  
    1414
    1515ProducerNode::ProducerNode()
    1616    :
     17    BMediaNode("ProducerNode"),
    1718    BBufferProducer(B_MEDIA_RAW_AUDIO),
    1819    BMediaEventLooper(),
    19     BMediaNode("ProducerNode"),
    2020    mBufferGroup(0),
    2121    mBufferProducerSem(-1),
    2222    mBufferProducer(-1),
    ProducerNode::BufferProducer()  
    443443        buffer->Header()->start_time = TimeSource()->Now() + DELAY / 2;
    444444        out("ProducerNode: SendBuffer, sheduled time = %5.4f\n",
    445445            buffer->Header()->start_time / 1E6);
    446         rv = SendBuffer(buffer, mOutput.destination);
     446        rv = SendBuffer(buffer, mOutput.source, mOutput.destination);
    447447        if (rv != B_OK) {
    448448        }
    449449    }
  • src/tests/kits/media/nodetest/main.cpp

    diff --git a/src/tests/kits/media/nodetest/main.cpp b/src/tests/kits/media/nodetest/main.cpp
    index a6f686d..481277e 100644
    a b int main()  
    210210    rv = roster->StartNode(sourceNode, start);
    211211    val(rv);
    212212
     213    out("Testing SyncToNode performance time set is 5 sec\n");
     214    rv = roster->SyncToNode(sourceNode,
     215        producer->TimeSource()->PerformanceTimeFor(
     216            BTimeSource::RealTime() + 5000000), B_INFINITE_TIMEOUT);
     217    val(rv);
     218
    213219    out("########################## PRESS ENTER TO QUIT ##########################\n");
    214220    getchar();
    215221