diff -Nurdp src/buffered_io_handler.cc src.new/buffered_io_handler.cc --- src/buffered_io_handler.cc 2010-03-25 23:58:11.000000000 +0900 +++ src.new/buffered_io_handler.cc 2010-08-28 22:38:53.203196195 +0900 @@ -40,6 +40,7 @@ using namespace zmm; BufferedIOHandler::BufferedIOHandler(Ref underlyingHandler, size_t bufSize, size_t maxChunkSize, size_t initialFillSize) : IOHandlerBufferHelper(bufSize, initialFillSize) { + log_debug("###1\n"); if (underlyingHandler == nil) throw _Exception(_("underlyingHandler must not be nil")); if (maxChunkSize <= 0) @@ -53,6 +54,7 @@ BufferedIOHandler::BufferedIOHandler(Ref void BufferedIOHandler::open(IN enum UpnpOpenFileMode mode) { + log_debug("###2\n"); // do the open here instead of threadProc() because it may throw an exception underlyingHandler->open(mode); IOHandlerBufferHelper::open(mode); @@ -60,6 +62,7 @@ void BufferedIOHandler::open(IN enum Upn void BufferedIOHandler::close() { + log_debug("###3\n"); IOHandlerBufferHelper::close(); // do the close here instead of threadProc() because it may throw an exception underlyingHandler->close(); @@ -200,6 +203,7 @@ void BufferedIOHandler::threadProc() } } while((maxWrite == 0 || readBytes > 0 || readBytes == CHECK_SOCKET) && ! threadShutdown); + log_debug("buffer: maxWrite=%d, readBytes=%d, readBytes=%d, CHECK_SOCKET=%d, threadShutdown=%d\n",maxWrite, readBytes, readBytes, CHECK_SOCKET, threadShutdown); if (! threadShutdown) { if (readBytes == 0) diff -Nurdp src/cds_resource_manager.cc src.new/cds_resource_manager.cc --- src/cds_resource_manager.cc 2010-03-25 23:58:11.000000000 +0900 +++ src.new/cds_resource_manager.cc 2010-08-28 22:38:53.219184009 +0900 @@ -459,7 +459,29 @@ void CdsResourceManager::addResources(Re extend = _(D_PROFILE) + "=" + D_JPEG_LRG+";"; } } - + // Add extended protocol information on filse + // need to be transcoded // horipiri + else if (strstr(mimeType.c_str(),"video/mpeg")) + { + extend = _(D_PROFILE) + "=" + D_MPEG_PS_NTSC + ";"; + } + //else if (strstr(mimeType.c_str(),"audio/mp3")) + else if (strstr(mimeType.c_str(),"audio/mpeg")) + { + extend = _(D_PROFILE) + "=" + "MP3" + ";"; + } + else if (strstr(mimeType.c_str(),"audio/L16")) + { + extend = _(D_PROFILE) + "=" + "LPCM" + ";"; + } + /* + else if (strstr(mimeType.c_str(),"video/vnd.dlna.mpeg-tts")) + { + extend = _(D_PROFILE) + "=" + "MPEG_TS_SD_60_AC3_T" + ";"; + log_debug("ts HIT!!\n"); + } + log_debug("###mimeType: %s\n", mimeType.c_str()); + */ #ifdef EXTERNAL_TRANSCODING // we do not support seeking at all, so 00 // and the media is converted, so set CI to 1 @@ -474,6 +496,7 @@ void CdsResourceManager::addResources(Re } else #endif + extend = extend + D_OP + "=01;" + D_CONVERSION_INDICATOR + "=" + D_NO_CONVERSION; diff -Nurdp src/common.h src.new/common.h --- src/common.h 2010-03-25 23:58:11.000000000 +0900 +++ src.new/common.h 2010-08-28 22:38:53.039185425 +0900 @@ -83,6 +83,7 @@ #define D_JPEG_TN "JPEG_TN" #define D_JPEG_SM_ICO "JPEG_SM_ICO" #define D_JPEG_LRG_ICO "JPEG_LRG_ICO" + #define D_MPEG_PS_NTSC "MPEG_PS_NTSC" #endif // fixed CdsObjectIDs #define CDS_ID_BLACKHOLE -1 diff -Nurdp src/io_handler_buffer_helper.cc src.new/io_handler_buffer_helper.cc --- src/io_handler_buffer_helper.cc 2010-03-25 23:58:11.000000000 +0900 +++ src.new/io_handler_buffer_helper.cc 2010-08-28 22:38:53.162382764 +0900 @@ -222,6 +222,7 @@ void IOHandlerBufferHelper::stopBufferTh void *IOHandlerBufferHelper::staticThreadProc(void *arg) { log_debug("starting buffer thread... thread: %d\n", pthread_self()); + log_debug("arg for staticThreadProc: %s\n", arg); IOHandlerBufferHelper *inst = (IOHandlerBufferHelper *)arg; inst->threadProc(); log_debug("buffer thread shut down. thread: %d\n", pthread_self()); diff -Nurdp src/tools.cc src.new/tools.cc --- src/tools.cc 2010-03-25 23:58:11.000000000 +0900 +++ src.new/tools.cc 2010-08-28 22:38:53.191186713 +0900 @@ -435,7 +435,41 @@ String mime_types_to_CSV(Ref 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(); diff -Nurdp src/transcoding/transcode_ext_handler.cc src.new/transcoding/transcode_ext_handler.cc --- src/transcoding/transcode_ext_handler.cc 2010-03-25 23:58:07.000000000 +0900 +++ src.new/transcoding/transcode_ext_handler.cc 2010-08-28 22:38:52.879357861 +0900 @@ -326,7 +326,7 @@ Ref TranscodeExternalHandler: throw _Exception(_("Could not create fifo!\n")); } - chmod(fifo_name.c_str(), S_IWUSR | S_IRUSR); + chmod(fifo_name.c_str(), S_IWUSR | S_IRUSR | S_IROTH); arglist = parseCommandLine(profile->getArguments(), location, fifo_name); diff -Nurdp src/upnp_xml.cc src.new/upnp_xml.cc --- src/upnp_xml.cc 2010-03-25 23:58:11.000000000 +0900 +++ src.new/upnp_xml.cc 2010-08-28 22:38:53.107173996 +0900 @@ -210,6 +210,21 @@ Ref UpnpXML_RenderDeviceDescrip root->appendElementChild(specVersion); Ref device(new Element(_("device"))); + + Ref dlnaspec(new Element(_("dlna:X_DLNADOC"))); + dlnaspec->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0")); + dlnaspec->setText(_("DMS-1.50")); + device->appendElementChild(dlnaspec); + + Ref dlnaspec2(new Element(_("dlna:X_DLNADOC"))); + dlnaspec2->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0")); + dlnaspec2->setText(_("M-DMS-1.50")); + device->appendElementChild(dlnaspec2); + + Ref dlnaspec3(new Element(_("dlna:X_DLNACAP"))); + dlnaspec3->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0")); + dlnaspec3->setText(_("av-upload,image-upload,audio-upload")); + device->appendElementChild(dlnaspec3); #ifdef EXTEND_PROTOCOLINFO if (config->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO))