| 1 | /* | 
| 2 | Copyright 2018 Google Inc. All Rights Reserved. | 
| 3 |  | 
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); | 
| 5 | you may not use this file except in compliance with the License. | 
| 6 | You may obtain a copy of the License at | 
| 7 |  | 
| 8 |     http://www.apache.org/licenses/LICENSE-2.0 | 
| 9 |  | 
| 10 | Unless required by applicable law or agreed to in writing, software | 
| 11 | distributed under the License is distributed on an "AS-IS" BASIS, | 
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
| 13 | See the License for the specific language governing permissions and | 
| 14 | limitations under the License. | 
| 15 | */ | 
| 16 |  | 
| 17 | #ifndef RESONANCE_AUDIO_NODE_PUBLISHER_NODE_H_ | 
| 18 | #define RESONANCE_AUDIO_NODE_PUBLISHER_NODE_H_ | 
| 19 |  | 
| 20 | #include <memory> | 
| 21 |  | 
| 22 | #include "base/logging.h" | 
| 23 | #include "node/node.h" | 
| 24 |  | 
| 25 | namespace vraudio { | 
| 26 |  | 
| 27 | // Interface for publisher nodes that declares helper methods required to | 
| 28 | // connect to a publisher node. All publishing nodes need to implement this | 
| 29 | // interface. | 
| 30 | // | 
| 31 | // @tparam OutputType Type of the output container being streamed. | 
| 32 | // @interface | 
| 33 | template <typename OutputType> | 
| 34 | class PublisherNode { | 
| 35 |  public: | 
| 36 |   virtual ~PublisherNode() {} | 
| 37 |  | 
| 38 |   // Creates a shared pointer of the Node instance. | 
| 39 |   // | 
| 40 |   // @return Returns a shared pointer the of Node instance. | 
| 41 |   virtual std::shared_ptr<Node> GetSharedNodePtr() = 0; | 
| 42 |  | 
| 43 |   // Get internal Node::Output instance. | 
| 44 |   // | 
| 45 |   // @return Returns a pointer to the internal Node::Output instance. | 
| 46 |   virtual Node::Output<OutputType>* GetOutput() = 0; | 
| 47 | }; | 
| 48 |  | 
| 49 | }  // namespace vraudio | 
| 50 |  | 
| 51 | #endif  // RESONANCE_AUDIO_NODE_PUBLISHER_NODE_H_ | 
| 52 |  |