1 /*
2  *  Tvheadend - TS file private data
3  *
4  *  Copyright (C) 2013 Adam Sutton
5  *
6  *  This program is free software: you can redistribute it and/or modify
7  *  it under the terms of the GNU 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 General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __TVH_TSFILE_PRIVATE_H__
21 #define __TVH_TSFILE_PRIVATE_H__
22 
23 #include "input.h"
24 
25 /*
26  * Typedefs
27  */
28 typedef struct tsfile_input        tsfile_input_t;
29 typedef struct tsfile_mux_instance tsfile_mux_instance_t;
30 typedef LIST_HEAD(,tsfile_input)   tsfile_input_list_t;
31 
32 /*
33  * Globals
34  */
35 extern mpegts_network_t    *tsfile_network;
36 extern tsfile_input_list_t tsfile_inputs;
37 extern pthread_mutex_t     tsfile_lock;
38 
39 
40 /*
41  * Mux instance
42  */
43 struct tsfile_mux_instance
44 {
45   mpegts_mux_instance_t; ///< Parent obj
46 
47   /*
48    * Timing
49    */
50 
51 
52   /*
53    * File input
54    */
55 
56   char     *mmi_tsfile_path;    ///< Source file path
57   uint16_t  mmi_tsfile_pcr_pid; ///< Timing control
58 };
59 
60 /*
61  * TS file input
62  */
63 struct tsfile_input
64 {
65   mpegts_input_t;
66 
67   LIST_ENTRY(tsfile_input) tsi_link;
68   th_pipe_t  ti_thread_pipe;
69   pthread_t  ti_thread_id;
70 };
71 
72 /*
73  * Prototypes
74  */
75 tsfile_input_t        *tsfile_input_create ( int idx );
76 
77 tsfile_mux_instance_t *tsfile_mux_instance_create
78   ( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm );
79 
80 mpegts_mux_t *
81 tsfile_mux_create ( const char *uuid, mpegts_network_t *mn );
82 
83 #endif /* __TVH_TSFILE_PRIVATE_H__ */
84 
85 /******************************************************************************
86  * Editor Configuration
87  *
88  * vim:sts=2:ts=2:sw=2:et
89  *****************************************************************************/
90