Mercurial > pt1.oyama
annotate src/ushare.h @ 166:726fe10d9e4a
Code refactoring.
Change channel shuld be done in http_open().
Delete unnecessary code, variables.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Tue, 02 Oct 2012 21:57:40 +0900 |
parents | 30e91361506a |
children | 4f3640bf350d |
rev | line source |
---|---|
125 | 1 /* |
2 * ushare.h : GeeXboX uShare UPnP Media Server header. | |
3 * Originally developped for the GeeXboX project. | |
4 * Parts of the code are originated from GMediaServer from Oskar Liljeblad. | |
5 * Copyright (C) 2005-2007 Benjamin Zores <ben@geexbox.org> | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU Library General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License along | |
18 * with this program; if not, write to the Free Software Foundation, | |
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 */ | |
21 | |
22 #ifndef _USHARE_H_ | |
23 #define _USHARE_H_ | |
24 | |
136
2a9ac5ce2c7e
Remove internal libdlna and libupnp.(using OS package by default)
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
131
diff
changeset
|
25 #include <upnp.h> |
2a9ac5ce2c7e
Remove internal libdlna and libupnp.(using OS package by default)
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
131
diff
changeset
|
26 #include <upnptools.h> |
125 | 27 #include <stdbool.h> |
28 #include <pthread.h> | |
29 | |
30 #ifdef HAVE_DLNA | |
31 #include <dlna.h> | |
32 #endif /* HAVE_DLNA */ | |
33 | |
34 #include "content.h" | |
35 #include "buffer.h" | |
36 #include "redblack.h" | |
37 | |
38 #define VIRTUAL_DIR "/web" | |
39 #define XBOX_MODEL_NAME "Windows Media Connect Compatible" | |
131
20442921bff5
change display name. modify PES buf size.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
126
diff
changeset
|
40 //#define DEFAULT_UUID "898f9738-d930-4db4-a3cf" |
20442921bff5
change display name. modify PES buf size.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
126
diff
changeset
|
41 #define DEFAULT_UUID "898f9738-d930-4db4" |
125 | 42 |
43 #define STREAM_FILE_NAME "stream.ts" | |
44 #define STREAM_LOCATION VIRTUAL_DIR "/" STREAM_FILE_NAME | |
45 | |
46 #define UPNP_MAX_CONTENT_LENGTH 4096 | |
47 | |
48 #define STARTING_ENTRY_ID_DEFAULT 0 | |
49 #define STARTING_ENTRY_ID_XBOX360 100000 | |
50 | |
51 #define UPNP_DESCRIPTION \ | |
52 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ | |
53 "<root xmlns=\"urn:schemas-upnp-org:device-1-0\">" \ | |
54 " <specVersion>" \ | |
55 " <major>1</major>" \ | |
56 " <minor>0</minor>" \ | |
57 " </specVersion>" \ | |
58 " <device>" \ | |
59 " <deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>" \ | |
60 " <friendlyName>%s: 1</friendlyName>" \ | |
61 " <manufacturer>GeeXboX Team</manufacturer>" \ | |
62 " <manufacturerURL>http://ushare.geexbox.org/</manufacturerURL>" \ | |
63 " <modelDescription>GeeXboX uShare : UPnP Media Server</modelDescription>" \ | |
64 " <modelName>%s</modelName>" \ | |
65 " <modelNumber>001</modelNumber>" \ | |
66 " <modelURL>http://ushare.geexbox.org/</modelURL>" \ | |
67 " <serialNumber>GEEXBOX-USHARE-01</serialNumber>" \ | |
68 " <UDN>uuid:%s</UDN>" \ | |
69 " <serviceList>" \ | |
70 " <service>" \ | |
71 " <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>" \ | |
72 " <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>" \ | |
73 " <SCPDURL>/web/cms.xml</SCPDURL>" \ | |
74 " <controlURL>/web/cms_control</controlURL>" \ | |
75 " <eventSubURL>/web/cms_event</eventSubURL>" \ | |
76 " </service>" \ | |
77 " <service>" \ | |
78 " <serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>" \ | |
79 " <serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>" \ | |
80 " <SCPDURL>/web/cds.xml</SCPDURL>" \ | |
81 " <controlURL>/web/cds_control</controlURL>" \ | |
82 " <eventSubURL>/web/cds_event</eventSubURL>" \ | |
83 " </service>" \ | |
84 " <service>" \ | |
85 " <serviceType>urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1</serviceType>\n" \ | |
86 " <serviceId>urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar</serviceId>\n" \ | |
87 " <SCPDURL>/web/msr.xml</SCPDURL>" \ | |
88 " <controlURL>/web/msr_control</controlURL>" \ | |
89 " <eventSubURL>/web/msr_event</eventSubURL>" \ | |
90 " </service>\n" \ | |
91 " </serviceList>" \ | |
92 " <presentationURL>/web/ushare.html</presentationURL>" \ | |
93 " </device>" \ | |
94 "</root>" | |
95 | |
96 struct ushare_t { | |
97 char *name; | |
98 char *interface; | |
99 char *model_name; | |
100 content_list *contentlist; | |
101 struct rbtree *rb; | |
102 struct upnp_entry_t *root_entry; | |
103 int nr_entries; | |
104 int starting_id; | |
105 int init; | |
106 UpnpDevice_Handle dev; | |
107 char *udn; | |
108 char *ip; | |
109 unsigned short port; | |
110 unsigned short telnet_port; | |
111 struct buffer_t *presentation; | |
112 bool use_presentation; | |
113 bool use_telnet; | |
114 #ifdef HAVE_DLNA | |
115 bool dlna_enabled; | |
116 dlna_t *dlna; | |
117 dlna_org_flags_t dlna_flags; | |
118 #endif /* HAVE_DLNA */ | |
119 bool xbox360; | |
120 bool verbose; | |
121 bool daemon; | |
122 bool override_iconv_err; | |
123 char *cfg_file; | |
124 pthread_mutex_t termination_mutex; | |
125 pthread_cond_t termination_cond; | |
152
30e91361506a
EXPERIMENTAL: Enable change phisical channel by DLNA.(ISDB-T only)
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
146
diff
changeset
|
126 struct channel_info_list *channel_list; |
125 | 127 }; |
128 | |
129 struct action_event_t { | |
130 struct Upnp_Action_Request *request; | |
131 bool status; | |
132 struct service_t *service; | |
133 }; | |
134 | |
135 inline void display_headers (void); | |
136 void * dlna_startup(void *p); | |
126
5dcaf3785ebe
fix process terminate problem.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
125
diff
changeset
|
137 void UPnPBreak (int s __attribute__ ((unused))); |
5dcaf3785ebe
fix process terminate problem.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
125
diff
changeset
|
138 |
125 | 139 |
140 #endif /* _USHARE_H_ */ |