Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
output-slot.cpp
Go to the documentation of this file.
1/*
2 OutputSlot - capability to transfer data to a physical output
3
4 Copyright (C)
5 2011, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
20#include "lib/error.hpp"
23
24#include <vector>
25
26
27namespace steam {
28namespace play {
29
30 using std::vector;
31
32 namespace error = lumiera::error;
33
34
35
36
37 OutputSlot::~OutputSlot() { } // emit VTables here....
38
40
42
43
44
45
46
51 bool
53 {
54 return not this->state_;
55 }
56
57
74 {
75 if (not isFree())
76 throw error::Logic ("Attempt to open/allocate an OutputSlot already in use.");
77
78 state_.reset (this->buildState());
79 return *state_;
80 }
81
82
83 void
85 {
86 if (not isFree())
87 state_.reset(0);
88 }
89
90
91
92 /* === DataSink frontend === */
93
96 {
97 return impl().claimBufferFor(frameNr);
98 }
99
100
101 void
102 DataSink::emit (FrameID frameNr, BuffHandle const& data2emit, TimeValue currentTime)
103 {
104 OutputSlot::Connection& connection = impl();
105 if (connection.isTimely(frameNr,currentTime))
106 connection.transfer(data2emit);
107 else
108 connection.discard(data2emit);
109 }
110
111
112
113
114}} // namespace steam::play
basic constant internal time value.
Handle for a buffer for processing data, abstracting away the actual implementation.
BuffHandle lockBufferFor(FrameID)
void emit(FrameID, BuffHandle const &, TimeValue currentTime=Time::ANYTIME)
~Allocation()
never to be managed by clients directly
virtual bool isTimely(FrameID, TimeValue)=0
virtual void discard(BuffHandle const &)=0
virtual void transfer(BuffHandle const &)=0
Allocation & allocate()
claim this slot for exclusive use
void disconnect()
disconnect from this OutputSlot
unique_ptr< ConnectionState > state_
virtual ConnectionState * buildState()=0
build the connected state, based on the existing configuration within this concrete OutputSlot
bool isFree() const
can this OutputSlot be allocated?
Lumiera error handling (C++ interface).
LumieraError< LERR_(LOGIC)> Logic
Definition error.hpp:207
FrameCnt FrameID
Steam-Layer implementation namespace root.
Interface for concrete output implementations to talk to the OutputSlot frontend.
An (abstract) capability to send media data to an external output.