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
|
|
11 | 11 | |
12 | 12 | ConsumerNode::ConsumerNode() |
13 | 13 | : |
| 14 | BMediaNode("ConsumerNode"), |
14 | 15 | BBufferConsumer(B_MEDIA_RAW_AUDIO), |
15 | | BMediaEventLooper(), |
16 | | BMediaNode("ConsumerNode") |
| 16 | BMediaEventLooper() |
17 | 17 | { |
18 | 18 | out("ConsumerNode::ConsumerNode\n"); |
19 | 19 | } |
diff --git a/src/tests/kits/media/nodetest/Jamfile b/src/tests/kits/media/nodetest/Jamfile
index ad9f633..f477909 100644
a
|
b
|
SimpleTest NodeTest
|
7 | 7 | ConsumerNode.cpp |
8 | 8 | ProducerNode.cpp |
9 | 9 | |
10 | | : be media |
| 10 | : be media [ TargetLibsupc++ ] |
11 | 11 | ; |
12 | 12 | |
diff --git a/src/tests/kits/media/nodetest/ProducerNode.cpp b/src/tests/kits/media/nodetest/ProducerNode.cpp
index 9465e8b..13e47b4 100644
a
|
b
|
|
14 | 14 | |
15 | 15 | ProducerNode::ProducerNode() |
16 | 16 | : |
| 17 | BMediaNode("ProducerNode"), |
17 | 18 | BBufferProducer(B_MEDIA_RAW_AUDIO), |
18 | 19 | BMediaEventLooper(), |
19 | | BMediaNode("ProducerNode"), |
20 | 20 | mBufferGroup(0), |
21 | 21 | mBufferProducerSem(-1), |
22 | 22 | mBufferProducer(-1), |
… |
… |
ProducerNode::BufferProducer()
|
443 | 443 | buffer->Header()->start_time = TimeSource()->Now() + DELAY / 2; |
444 | 444 | out("ProducerNode: SendBuffer, sheduled time = %5.4f\n", |
445 | 445 | buffer->Header()->start_time / 1E6); |
446 | | rv = SendBuffer(buffer, mOutput.destination); |
| 446 | rv = SendBuffer(buffer, mOutput.source, mOutput.destination); |
447 | 447 | if (rv != B_OK) { |
448 | 448 | } |
449 | 449 | } |
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()
|
210 | 210 | rv = roster->StartNode(sourceNode, start); |
211 | 211 | val(rv); |
212 | 212 | |
| 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 | |
213 | 219 | out("########################## PRESS ENTER TO QUIT ##########################\n"); |
214 | 220 | getchar(); |
215 | 221 | |