Mercurial > pt1.oyama
annotate src/ushare.h @ 176:2ae60285f383
Change DLNA display name.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Mon, 05 Nov 2012 23:11:32 +0900 |
parents | 4f3640bf350d |
children |
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 | |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
51 #define UPNP_DMS_DESCRIPTION \ |
125 | 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>" \ | |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
60 " <friendlyName>%s</friendlyName>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
61 " <manufacturer>%s</manufacturer>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
62 " <manufacturerURL>%s</manufacturerURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
63 " <modelDescription>%s</modelDescription>" \ |
125 | 64 " <modelName>%s</modelName>" \ |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
65 " <modelNumber>%s</modelNumber>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
66 " <modelURL>%s</modelURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
67 " <serialNumber>%s</serialNumber>" \ |
125 | 68 " <UDN>uuid:%s</UDN>" \ |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
69 " <presentationURL>%s</presentationURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
70 " <dlna:X_DLNADOC>DMS-1.00</dlna:X_DLNADOC>" \ |
125 | 71 " <serviceList>" \ |
72 " <service>" \ | |
73 " <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>" \ | |
74 " <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>" \ | |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
75 " <SCPDURL>%s</SCPDURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
76 " <controlURL>%s</controlURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
77 " <eventSubURL>%s</eventSubURL>" \ |
125 | 78 " </service>" \ |
79 " <service>" \ | |
80 " <serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>" \ | |
81 " <serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>" \ | |
170
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
82 " <SCPDURL>%s</SCPDURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
83 " <controlURL>%s</controlURL>" \ |
4f3640bf350d
Change display name of DLNA.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
166
diff
changeset
|
84 " <eventSubURL>%s</eventSubURL>" \ |
125 | 85 " </service>" \ |
86 " </serviceList>" \ | |
87 " </device>" \ | |
88 "</root>" | |
89 | |
90 struct ushare_t { | |
91 char *name; | |
92 char *interface; | |
93 char *model_name; | |
94 content_list *contentlist; | |
95 struct rbtree *rb; | |
96 struct upnp_entry_t *root_entry; | |
97 int nr_entries; | |
98 int starting_id; | |
99 int init; | |
100 UpnpDevice_Handle dev; | |
101 char *udn; | |
102 char *ip; | |
103 unsigned short port; | |
104 unsigned short telnet_port; | |
105 struct buffer_t *presentation; | |
106 bool use_presentation; | |
107 bool use_telnet; | |
108 #ifdef HAVE_DLNA | |
109 bool dlna_enabled; | |
110 dlna_t *dlna; | |
111 dlna_org_flags_t dlna_flags; | |
112 #endif /* HAVE_DLNA */ | |
113 bool xbox360; | |
114 bool verbose; | |
115 bool daemon; | |
116 bool override_iconv_err; | |
117 char *cfg_file; | |
118 pthread_mutex_t termination_mutex; | |
119 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
|
120 struct channel_info_list *channel_list; |
125 | 121 }; |
122 | |
123 struct action_event_t { | |
124 struct Upnp_Action_Request *request; | |
125 bool status; | |
126 struct service_t *service; | |
127 }; | |
128 | |
129 inline void display_headers (void); | |
130 void * dlna_startup(void *p); | |
126
5dcaf3785ebe
fix process terminate problem.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
125
diff
changeset
|
131 void UPnPBreak (int s __attribute__ ((unused))); |
5dcaf3785ebe
fix process terminate problem.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
125
diff
changeset
|
132 |
125 | 133 |
134 #endif /* _USHARE_H_ */ |