Statistics
| Branch: | Revision:

peerstreamer-src / src / pstreamer.h @ 58fb2cdc

History | View | Annotate | Download (2.85 KB)

1 8f5b2a1b Luca Baldesi
/*******************************************************************
2
* PeerStreamer-ng is a P2P video streaming application exposing a ReST
3
* interface.
4
* Copyright (C) 2017 Luca Baldesi <luca.baldesi@unitn.it>
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Affero General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU Affero General Public License for more details.
15
*
16
* You should have received a copy of the GNU Affero General Public License
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
*******************************************************************/
19
20
#ifndef __PSTREAMER_H__
21
#define __PSTREAMER_H__ 
22
23
#include<ord_set.h>
24
#include<stdint.h>
25
#include<name_lengths.h>
26 b87dc7a2 Luca Baldesi
#include<task_manager.h>
27 c81c126e Luca Baldesi
#include<janus_instance.h>
28
#include<streamer_creation_callback.h>
29 8f5b2a1b Luca Baldesi
30
struct pstreamer;
31
struct pstreamer_manager;
32 c81c126e Luca Baldesi
struct janus_instance;
33
struct streamer_creation_callback;
34 8f5b2a1b Luca Baldesi
35 c81c126e Luca Baldesi
struct pstreamer_manager * pstreamer_manager_new(uint16_t starting_port, const struct janus_instance *janus);
36 8f5b2a1b Luca Baldesi
37
void pstreamer_manager_destroy(struct pstreamer_manager ** psm);
38
39 c81c126e Luca Baldesi
const struct pstreamer * pstreamer_manager_create_streamer(struct pstreamer_manager * psm, const char * source_ip, const char * source_port, const char * id, const char * rtp_dst_ip, struct streamer_creation_callback * scc);
40 8f5b2a1b Luca Baldesi
41
char * pstreamer_to_json(const struct pstreamer * ps);
42
43
uint8_t pstreamer_manager_destroy_streamer(struct pstreamer_manager *psm, const struct pstreamer *ps);
44
45 c039490c Luca Baldesi
const char * pstreamer_id(const struct pstreamer * ps);
46
47
uint16_t pstreamer_base_port(const struct pstreamer * ps);
48
49 b87dc7a2 Luca Baldesi
int8_t pstreamer_schedule_tasks(struct pstreamer *ps, struct task_manager * tm);
50
51 4d6f8fd5 Luca Baldesi
const struct pstreamer * pstreamer_manager_get_streamer(const struct pstreamer_manager *psm, const char * id);
52
53
void pstreamer_manager_remove_orphans(struct pstreamer_manager * psm, time_t interval);
54
55
void pstreamer_touch(struct pstreamer *ps);
56
57 92a361ca Luca Baldesi
const char * pstreamer_source_ipaddr(const struct pstreamer *ps);
58
59
const char * pstreamer_source_port(const struct pstreamer *ps);
60
61 1ae420f6 Luca Baldesi
int8_t pstreamer_manager_set_streamer_options(struct pstreamer_manager *psm, const char * opts);
62
63 3af4c8d7 Luca Baldesi
uint8_t pstreamer_is_source(const struct pstreamer * ps);
64
65
char * pstreamer_manager_sources_to_json(const struct pstreamer_manager *psm);
66
67
const struct pstreamer * pstreamer_manager_create_source_streamer(struct pstreamer_manager * psm, const char * id, const char * rtp_src_ip, struct streamer_creation_callback * scc);
68
69
void pstreamer_source_touch(const struct pstreamer_manager *psm, struct pstreamer *ps, uint64_t janus_id);
70
71 8f5b2a1b Luca Baldesi
#endif