| 1 |
// Copyright (c) 2009, Whispersoft s.r.l. |
|---|
| 2 |
// All rights reserved. |
|---|
| 3 |
// |
|---|
| 4 |
// Redistribution and use in source and binary forms, with or without |
|---|
| 5 |
// modification, are permitted provided that the following conditions are |
|---|
| 6 |
// met: |
|---|
| 7 |
// |
|---|
| 8 |
// * Redistributions of source code must retain the above copyright |
|---|
| 9 |
// notice, this list of conditions and the following disclaimer. |
|---|
| 10 |
// * Redistributions in binary form must reproduce the above |
|---|
| 11 |
// copyright notice, this list of conditions and the following disclaimer |
|---|
| 12 |
// in the documentation and/or other materials provided with the |
|---|
| 13 |
// distribution. |
|---|
| 14 |
// * Neither the name of Whispersoft s.r.l. nor the names of its |
|---|
| 15 |
// contributors may be used to endorse or promote products derived from |
|---|
| 16 |
// this software without specific prior written permission. |
|---|
| 17 |
// |
|---|
| 18 |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|---|
| 19 |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|---|
| 20 |
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|---|
| 21 |
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|---|
| 22 |
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|---|
| 23 |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|---|
| 24 |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|---|
| 25 |
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|---|
| 26 |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|---|
| 27 |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|---|
| 28 |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 29 |
// |
|---|
| 30 |
// Author: Mihai Ianculescu |
|---|
| 31 |
// |
|---|
| 32 |
// |
|---|
| 33 |
// Defines types used for defining/controlling stream providers |
|---|
| 34 |
// |
|---|
| 35 |
////////////////////////////////////////////////////////////////////// |
|---|
| 36 |
|
|---|
| 37 |
Type WhispererSpecAccessStruct { |
|---|
| 38 |
string remote_user_; |
|---|
| 39 |
string remote_password_; |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
Type ProviderSpec { |
|---|
| 43 |
string name_; |
|---|
| 44 |
string description_; |
|---|
| 45 |
// needed only if the provider is providing more than 1 audio port |
|---|
| 46 |
optional int audio_ports_; |
|---|
| 47 |
// needed only if the provider is providing more than 1 video port |
|---|
| 48 |
optional int video_ports_; |
|---|
| 49 |
// needed only if the provider is actually relaying unparsed data |
|---|
| 50 |
optional string mime_type_; |
|---|
| 51 |
// in miliseconds, defaults are set through command line |
|---|
| 52 |
optional int source_fireup_timeout_; |
|---|
| 53 |
optional int encoder_fireup_timeout_; |
|---|
| 54 |
optional int source_idle_timeout_; |
|---|
| 55 |
optional int encoder_idle_timeout_; |
|---|
| 56 |
// in bytes. default is set through command line |
|---|
| 57 |
optional int max_lag_; |
|---|
| 58 |
// an array of names of GStreamer elements that can be controlled through RPC |
|---|
| 59 |
optional array<string> controlled_elements_; |
|---|
| 60 |
// who has access to this provider (if empty => everyone) |
|---|
| 61 |
optional array<WhispererSpecAccessStruct> access_data_; |
|---|
| 62 |
} |
|---|
| 63 |
|
|---|
| 64 |
Type PublishSpec { |
|---|
| 65 |
string url_; |
|---|
| 66 |
// in miliseconds, default is set through command line |
|---|
| 67 |
optional int retry_timeout_; |
|---|
| 68 |
|
|---|
| 69 |
// How to connect to the remote server |
|---|
| 70 |
optional WhispererSpecAccessStruct user_; |
|---|
| 71 |
} |
|---|
| 72 |
|
|---|
| 73 |
////////////////////////////////////////////////////////////////////// |
|---|
| 74 |
|
|---|
| 75 |
Type MediaServerResult { |
|---|
| 76 |
int result_; // 0 -> OK |
|---|
| 77 |
optional string description_; |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|
| 80 |
////////////////////////////////////////////////////////////////////// |
|---|
| 81 |
|
|---|
| 82 |
Service MediaProviderService { |
|---|
| 83 |
MediaServerResult AddProvider(ProviderSpec spec); |
|---|
| 84 |
MediaServerResult RemoveProvider(string name); |
|---|
| 85 |
array<ProviderSpec> ListProviders(); |
|---|
| 86 |
|
|---|
| 87 |
MediaServerResult Publish(PublishSpec spec); |
|---|
| 88 |
MediaServerResult Unpublish(string url); |
|---|
| 89 |
array<PublishSpec> ListPublished(); |
|---|
| 90 |
|
|---|
| 91 |
bool SaveConfig(); |
|---|
| 92 |
} |
|---|
| 93 |
|
|---|
| 94 |
////////////////////////////////////////////////////////////////////// |
|---|