summaryrefslogtreecommitdiff
path: root/multimedia/mediatomb/patches/patch-src_tools.cc
blob: 435c125d0bbf9dd22d485c6d0aec94e8bb384975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$NetBSD: patch-src_tools.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $

Add SONY Bravia support
http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt

--- src/tools.cc.orig	2010-03-25 14:58:11.000000000 +0000
+++ src/tools.cc
@@ -435,7 +435,41 @@ String mime_types_to_CSV(Ref<Array<Strin
         if (i > 0)
             *buf << ",";
         String mimeType = mimeTypes->get(i);
-        *buf << "http-get:*:" << mimeType << ":*";
+//        *buf << "http-get:*:" << mimeType << ":*";
+
+        *buf << "http-get:*:" << mimeType;
+
+        log_debug("mimeType: %s..\n", mimeType.c_str() );
+//        log_debug("mimeType: %d\n", strcmp(mimeType.c_str(),"video/mpeg"));
+
+        // Add ORG_PN for mimetype that are unnecessary to be trancodeed. // horipiri
+        // Insert video/mpeg if mimeType=video/avi for BRAVIA's server diagnose. // horipiri
+        if (strstr(mimeType.c_str(),"video/mpeg")){
+                *buf << ":DLNA.ORG_PN=MPEG_PS_NTSC";
+        } 
+        else if (       (strstr(mimeType.c_str(),"video/avi")) 
+                     || (strstr(mimeType.c_str(),"video/x-flv"))
+                ) {
+                *buf << ":*,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC";
+        } 
+        else if (strstr(mimeType.c_str(),"audio/L16")){
+                *buf << ":DLNA.ORG_PN=LPCM";
+        }
+        else if (strstr(mimeType.c_str(),"audio/mpeg")){
+                *buf << ":DLNA.ORG_PN=MP3";
+        }
+        else if (strstr(mimeType.c_str(),"application/ogg")){
+                *buf << ":*,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3";
+        } 
+        else if (strstr(mimeType.c_str(),"image/jpeg")){
+                *buf << ":DLNA.ORG_PN=JPEG_LRG";
+        }
+        else if (strstr(mimeType.c_str(),"video/vnd.dlna.mpeg-tts")){
+                *buf << ":DLNA.ORG_PN=MPEG_TS_SD_60_AC3_T";
+        }
+        else {
+                *buf << ":*";
+         }
     }
 
     return buf->toString();