| 1 | /* |
|---|
| 2 | * tvheadend, transport functions |
|---|
| 3 | * Copyright (C) 2007 Andreas �an |
|---|
| 4 | * |
|---|
| 5 | * This program is free software: you can redistribute it and/or modify |
|---|
| 6 | * it under the terms of the GNU General Public License as published by |
|---|
| 7 | * the Free Software Foundation, either version 3 of the License, or |
|---|
| 8 | * (at your option) any later version. |
|---|
| 9 | * |
|---|
| 10 | * This program is distributed in the hope that it will be useful, |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | * GNU General Public License for more details. |
|---|
| 14 | * |
|---|
| 15 | * You should have received a copy of the GNU General Public License |
|---|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | */ |
|---|
| 18 | |
|---|
| 19 | #ifndef TRANSPORTS_H |
|---|
| 20 | #define TRANSPORTS_H |
|---|
| 21 | |
|---|
| 22 | #include "channels.h" |
|---|
| 23 | #include "htsmsg.h" |
|---|
| 24 | #include "subscriptions.h" |
|---|
| 25 | |
|---|
| 26 | unsigned int transport_compute_weight(struct th_transport_list *head); |
|---|
| 27 | |
|---|
| 28 | int transport_start(th_transport_t *t, unsigned int weight, int force_start); |
|---|
| 29 | |
|---|
| 30 | th_transport_t *transport_create(const char *identifier, int type, |
|---|
| 31 | int source_type); |
|---|
| 32 | |
|---|
| 33 | void transport_unref(th_transport_t *t); |
|---|
| 34 | |
|---|
| 35 | void transport_ref(th_transport_t *t); |
|---|
| 36 | |
|---|
| 37 | th_transport_t *transport_find_by_identifier(const char *identifier); |
|---|
| 38 | |
|---|
| 39 | void transport_map_channel(th_transport_t *t, channel_t *ch); |
|---|
| 40 | |
|---|
| 41 | void transport_unmap_channel(th_transport_t *t); |
|---|
| 42 | |
|---|
| 43 | th_transport_t *transport_find(channel_t *ch, unsigned int weight); |
|---|
| 44 | |
|---|
| 45 | th_stream_t *transport_add_stream(th_transport_t *t, int pid, |
|---|
| 46 | streaming_component_type_t type); |
|---|
| 47 | |
|---|
| 48 | void transport_set_priority(th_transport_t *t, int prio); |
|---|
| 49 | |
|---|
| 50 | void transport_settings_write(th_transport_t *t); |
|---|
| 51 | |
|---|
| 52 | const char *transport_servicetype_txt(th_transport_t *t); |
|---|
| 53 | |
|---|
| 54 | int transport_is_tv(th_transport_t *t); |
|---|
| 55 | |
|---|
| 56 | int transport_is_available(th_transport_t *t); |
|---|
| 57 | |
|---|
| 58 | void transport_destroy(th_transport_t *t); |
|---|
| 59 | |
|---|
| 60 | void transport_set_feed_status(th_transport_t *t, |
|---|
| 61 | transport_feed_status_t newstatus); |
|---|
| 62 | |
|---|
| 63 | const char *transport_feed_status_to_text(transport_feed_status_t status); |
|---|
| 64 | |
|---|
| 65 | void transport_remove_subscriber(th_transport_t *t, th_subscription_t *s); |
|---|
| 66 | |
|---|
| 67 | static inline th_stream_t * |
|---|
| 68 | transport_find_stream_by_pid(th_transport_t *t, int pid) |
|---|
| 69 | { |
|---|
| 70 | th_stream_t *st; |
|---|
| 71 | |
|---|
| 72 | LIST_FOREACH(st, &t->tht_components, st_link) { |
|---|
| 73 | if(st->st_pid == pid) |
|---|
| 74 | return st; |
|---|
| 75 | } |
|---|
| 76 | return NULL; |
|---|
| 77 | } |
|---|
| 78 | |
|---|
| 79 | htsmsg_t *transport_build_stream_start_msg(th_transport_t *t); |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | #endif /* TRANSPORTS_H */ |
|---|