Skip to content

Commit

Permalink
- added dlna header fields
Browse files Browse the repository at this point in the history
- some presentation changes
- new object type for unidentified broadcasts
  • Loading branch information
u-voelkel committed Jun 28, 2010
1 parent 79477d1 commit 289454e
Show file tree
Hide file tree
Showing 53 changed files with 1,386 additions and 1,121 deletions.
6 changes: 2 additions & 4 deletions config/devices/default-transcoding-enabled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
<dlna>WMAFULL</dlna>
</file>
<!--image files-->
<file ext="jpg">
<ext>jpeg</ext>
<file ext="jpg,jpeg">
<type>IMAGE_ITEM</type>
<mime_type>image/jpeg</mime_type>
<convert enabled="false">
Expand Down Expand Up @@ -91,8 +90,7 @@
<mime_type>image/gif</mime_type>
</file>
<!--video files-->
<file ext="mpg">
<ext>mpeg</ext>
<file ext="mpg,mpeg">
<type>VIDEO_ITEM</type>
<mime_type>video/mpeg</mime_type>
</file>
Expand Down
6 changes: 5 additions & 1 deletion config/devices/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<enable_xms_media_receiver_registrar>false</enable_xms_media_receiver_registrar>
<show_device_icon>true</show_device_icon>

<!--
<!-- %v = version, %h = hostname, %i = ip address
<description_values>
<friendly_name>My Media Server (%v) (%h) (%i)</friendly_name>
<manufacturer />
Expand Down Expand Up @@ -132,6 +132,10 @@
<type>VIDEO_ITEM</type>
<mime_type>application/vnd.rn-realmedia</mime_type>
</file>
<file ext="mov">
<type>VIDEO_ITEM</type>
<mime_type>video/quicktime</mime_type>
</file>

<!--playlists-->
<file ext="pls">
Expand Down
24 changes: 12 additions & 12 deletions include/fuppes_db_connection_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,24 @@ enum fuppes_sql_no {
SQL_GET_CHILD_OBJECTS = 2,
SQL_GET_OBJECT_TYPE = 3,
SQL_GET_OBJECT_DETAILS = 4,
SQL_GET_ALBUM_ART_DETAILS = 5,
//SQL_GET_ALBUM_ART_DETAILS = 5,

// search
SQL_SEARCH_PART_SELECT_FIELDS = 6,
SQL_SEARCH_PART_SELECT_COUNT = 7,
SQL_SEARCH_PART_FROM = 8,
SQL_SEARCH_GET_CHILDREN_OBJECT_IDS = 9,
SQL_SEARCH_PART_SELECT_FIELDS = 5,
SQL_SEARCH_PART_SELECT_COUNT = 6,
SQL_SEARCH_PART_FROM = 7,
SQL_SEARCH_GET_CHILDREN_OBJECT_IDS = 8,

// create
SQL_TABLES_EXIST = 10,
SQL_CREATE_TABLE_DB_INFO = 11,
SQL_SET_DB_INFO = 12,
SQL_CREATE_TABLE_OBJECTS = 13,
SQL_CREATE_TABLE_OBJECT_DETAILS = 14,
SQL_CREATE_INDICES = 15,
SQL_TABLES_EXIST = 9,
SQL_CREATE_TABLE_DB_INFO = 10,
SQL_SET_DB_INFO = 11,
SQL_CREATE_TABLE_OBJECTS = 12,
SQL_CREATE_TABLE_OBJECT_DETAILS = 13,
SQL_CREATE_INDICES = 14,

// status
SQL_GET_OBJECT_TYPE_COUNT = 16
SQL_GET_OBJECT_TYPE_COUNT = 15
};

struct fuppes_sql
Expand Down
4 changes: 4 additions & 0 deletions include/fuppes_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ static inline void init_metadata(struct metadata_t* metadata)

//metadata->image_mime_type = (char*)malloc(sizeof(char));
set_value(metadata->image_mime_type, "");

metadata->image_width = 0;

metadata->image_height = 0;
}

static inline void free_metadata(struct metadata_t* metadata)
Expand Down
8 changes: 4 additions & 4 deletions include/fuppes_plugin_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ typedef enum PLUGIN_TYPE {
PT_AUDIO_ENCODER,
PT_TRANSCODER,
PT_THREADED_TRANSCODER,
PT_PRESENTATION,
PT_DATABASE_CONNECTION
} PLUGIN_TYPE;

Expand Down Expand Up @@ -75,14 +74,14 @@ typedef struct {



typedef int (*ctrl_action_t)(const char* action, arg_list_t* args, arg_list_t* result);
//typedef int (*ctrl_action_t)(const char* action, arg_list_t* args, arg_list_t* result);


typedef void (*log_t)(void* plugin, int level, const char* file, int line, const char* format, ...);

typedef struct {
log_t log;
ctrl_action_t ctrl;
//ctrl_action_t ctrl;
} plugin_callbacks;

typedef struct {
Expand Down Expand Up @@ -190,7 +189,8 @@ struct metadata_t {
char video_codec[100];
int has_image;
char image_mime_type[100];

int image_width;
int image_height;
};


Expand Down
146 changes: 114 additions & 32 deletions resources/fuppes-browse.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/***************************************************************************
* fuppes-browse.js
*
* FUPPES - Free UPnP Entertainment Service
*
* Copyright (C) 2010 Ulrich Völkel <u-voelkel@users.sourceforge.net>
****************************************************************************/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*/

function loadResult(result)
{
Expand Down Expand Up @@ -34,7 +49,12 @@ function browseDirectChildren(objectId, startIdx, requestCnt, vfolder)
'<th width="60">count</th>' +
'</tr>';

table += '<tr>' +
table +=
'<tr>' +
'<td id="self-id"></td>' +
'<td colspan="3" id="self-label">&nbsp;</td>' +
'</tr>' +
'<tr>' +
'<td id="parent-id"></td>' +
'<td colspan="3" id="parent-browse">&nbsp;</td>' +
'</tr>';
Expand Down Expand Up @@ -90,25 +110,9 @@ function browseDirectChildren(objectId, startIdx, requestCnt, vfolder)

table += '</tr>';


table += '<tr>';
table += '<td colspan="4" class="detail-td" style="display: none;" id="detail-td-' + item.get('id') + '">load details</td>';
table += '<td colspan="4" class="td-detail" style="display: none;" id="detail-td-' + item.get('id') + '">load details</td>';
table += '</tr>';


/*
<container id="0000000001" searchable="0" parentID="0" restricted="0" childCount="48">
<dc:title>title</dc:title>
<upnp:class>object.container.storageFolder</upnp:class>
</container>
<item id="000000963D" parentID="6FF6" restricted="0">
<dc:title>title</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<upnp:albumArtURI xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" dlna:profileID="JPEG_TN">http://192.168.0.8:5080/MediaServer/ImageItems/000000963D.jpg</upnp:albumArtURI>
<res protocolInfo="http-get:*:video/x-msvideo:DLNA.ORG_PS=1;DLNA.ORG_CI=0;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=21700000000000000000000000000000" duration="00:14:30.05" resolution="320x240" bitrate="13563" size="11806720">http://192.168.0.8:5080/MediaServer/VideoItems/000000963D.avi</res>
</item>
*/
});


Expand Down Expand Up @@ -166,6 +170,10 @@ function browseMetadata(objectId, vfolder, details)
$('parent-browse').innerHTML = '<a href="javascript:browseDirectChildren(\'' + item.get('parentID') + '\', 0, 0, \'' + vfolder + '\');">up</a>';
else
$('parent-browse').innerHTML = '';


$('self-id').innerHTML = item.get('id');
$('self-label').innerHTML = item.get('id');
}
else {
setObjectDetails(item);
Expand Down Expand Up @@ -225,19 +233,99 @@ function showObjectDetails(objectId, vfolder)

function setObjectDetails(object)
{
result = '<div><a href="javascript:closeObjectDetails(\'' + object.get('id') + '\');">close</a></div>';

result += '<div>';
var values = new Object();
values['title'] = undefined;
values['class'] = undefined;
values['albumart'] = undefined;
values['res'] = new Object();
values['res']['url'] = undefined;

debug = "";
var nodes = object.getChildren();
nodes.each(function(node, node_index) {

if(node.get('tag') == 'dc:title') {
values['title'] = node.get('text');
}
else if(node.get('tag') == 'upnp:class') {
values['class'] = node.get('text');
}

else if(node.get('tag') == 'upnp:artist') {
}
else if(node.get('tag') == 'upnp:album') {
}
else if(node.get('tag') == 'upnp:genre') {
}
else if(node.get('tag') == 'upnp:originaltracknumber') {
}

else if(node.get('tag') == 'upnp:albumarturi') {
values['albumart'] = node.get('text');
}
else if(node.get('tag') == 'res') {
values['res']['url'] = node.get('text');

values['res']['protocolInfo'] = node.get('protocolInfo');
values['res']['duration'] = node.get('duration');
values['res']['resolution'] = node.get('resolution');
values['res']['bitrate'] = node.get('bitrate');
values['res']['size'] = node.get('size');

if(values['class'].indexOf('object.item.imageItem') == 0)
values['albumart'] = values['res']['url'];
}
else {
debug += "*" + node.get('tag') + ": " + node.get('text') + "*<br />";
}

result += 'object id: ' + object.get('id') + '<br />';
result += 'parent id: ' + object.get('parentID') + '<br />';
});

var nodes = object.getChildren();
nodes.each(function(node, node_index) {
result += node.get('tag') + ": " + node.get('text') + "<br />";
});
result = '<div class="object-details">';
result += '<div class="object-details-close"><a href="javascript:closeObjectDetails(\'' + object.get('id') + '\');">close</a></div>';
result += '<div>';

result += '<div class="album-art-image">';
if(values['albumart'] != undefined)
result += '<img src="' + values['albumart'] + '" height="100" alt=""/>';
else
result += 'no image available';
result += '</div>';

result += '<div class="object-values">';
result += '<table>';
result += '<tr>';
result += '<th colspan="4">' + values['title'] + '</th>';
result += '</tr>';

result += '<tr>';
result += '<td>class</td><td colspan="3">' + values['class'] + '</td>';
result += '</tr>';

result += '<tr>';
result += '<td>object id</td><td>' + object.get('id') + '</td><td>parent id</td><td>' + object.get('parentID') + '</td>';
result += '</tr>';

result += '<tr>';
result += '<td>res</td><td colspan="3">' +
values['res']['url'] +
/*'<ul>' +
'<li>protocolInfo: ' + values['res']['protocolInfo'] + '</li>' +
'<li>duration: ' + values['res']['duration'] + '</li>' +
'<li>resolution: ' + values['res']['resolution'] + '</li>' +
'<li>bitrate: ' + values['res']['bitrate'] + '</li>' +
'<li>size: ' + values['res']['size'] + '</li>' +
'</ul>' +*/
'</td>';
result += '</tr>';

result += '</table>';
result += debug;
result += '</div>';


result += '</div>';
result += '</div>';

var details = $('detail-td-' + object.get('id'));
Expand All @@ -254,12 +342,6 @@ function closeObjectDetails(objectId)
if(!visible) {
return;
}

details.setStyle('display', 'none');
/*details.get('tween', {property: 'opacity', duration: 'short'}).start(0).chain (
function() {
this.element.setStyle('display', 'none')
}
);*/
}

51 changes: 46 additions & 5 deletions resources/fuppes-control.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,63 @@
function fuppesCtrl()
/***************************************************************************
* fuppes-control.js
*
* FUPPES - Free UPnP Entertainment Service
*
* Copyright (C) 2010 Ulrich Völkel <u-voelkel@users.sourceforge.net>
****************************************************************************/

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*/

function fuppesCtrl(action)
{

var request = new Request({
url: '/',
onSuccess: function(responseText, responseXML) {

$('ctrl-result').innerHTML = responseXML.getElement('Result').get('text');
result = "";

body = responseXML.documentElement.getFirst();
body.getChildren().each(function(item) {

// action response
if(item.get('tag') == ('c:' + action.toLowerCase() + 'response')) {
result = "SOAP RESPONSE";
}

// error
else if(item.get('tag') == 'c:error') {
code = item.getFirst();
msg = code.getNext();
result = "SOAP ERROR: " + msg.get('text') + " :: code: " + code.get('text');
}

// something else
else {
result = "unknown result";
}

});

$('ctrl-result').innerHTML = result;

}});

request.setHeader('SOAPAction','"fuppesctrl#Test"');
request.setHeader('SOAPAction','"fuppesctrl#' + action + '"');
request.setHeader('Content-Type','text/xml; charset=utf-8');
request.setHeader('User-Agent','fuppes webinterface');

var body = '<?xml version="1.0"?>' +
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<s:Body>' +
'<c:Test xmlns:c="urn:fuppesControl">' +
'</c:Test>' +
'<c:' + action + ' xmlns:c="urn:fuppesControl">' +
'</c:' + action + '>' +
'</s:Body>' +
'</s:Envelope>';

Expand All @@ -27,3 +67,4 @@ function fuppesCtrl()
});

}

Loading

0 comments on commit 289454e

Please sign in to comment.