Git Product home page Git Product logo

platinum's Issues

Issues on build android x64

Hi,

I mod file platinum/Build/Targets/arm-android-linux/config.scons as follow:

set defaults

ANDROID_ARCH = 'arm64'
ANDROID_PLATFORM = 'android-24'
ANDROID_TOOLCHAIN = 'arm-linux-androideabi-4.9'
ANDROID_CROSS_PREFIX = 'arm-linux-androideabi'

and compile use these command:

env NPT_CONFIG_NO_CRYPTO=1 NPT_CONFIG_NO_SSL=1 scons target=arm-android-linux build_config=Release
ndk-build NDK_DEBUG=0 NPT_CONFIG_NO_SSL=1

build arm64-v8a fail:

czbill@ubuntu:~/Develop/WirelessScreen/Dlna/Platinum/Source/Platform/Android/module/platinum$ ndk-build NDK_DEBUG=0 NPT_CONFIG_NO_SSL=1
Android NDK: WARNING: APP_PLATFORM android-24 is larger than android:minSdkVersion 19 in ./AndroidManifest.xml
[arm64-v8a] Compile++ : platinum-jni <= platinum-jni.cpp
[arm64-v8a] SharedLibrary : libplatinum-jni.so
jni/../../../../../../Build/Targets/arm-android-linux/Release/libPlatinum.a: error adding symbols: File in wrong format
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/arm64-v8a/libplatinum-jni.so] Error 1

How to solve?

search devices of LAN

Hi i'd like to ask for your help.
I want to add a button to proactive refresh the device list of local area network due to an issue which power down device still in.
could u please teach me how to proactive a boardcast to get the devices list now
thanks for your help
:P

Incompatibility

Hi,
is it not possible to update the SDK to an actual VS Version?
It is very hard to compile the project with VS 2017 or VS 2019.
Maybe you could share the binaries of the Managed Library.
I would like to test this for a private application.

Thank You for your work
Jo A. Kim

buffer overflow issues caused by using gets

hi, great project!

I found that some places in the code are still using the dangerous function 'gets', which may cause buffer overflows. It seems to be a small problem, but it is better to replace it with a safe function.

https://github.com/plutinosoft/Platinum/blob/master/Source/Tools/SsdpProxy/SsdpProxy.cpp

    fprintf(stdout, "Listening for SSDP unicast packets on port %d\n", Options.port);
    fprintf(stdout, "Enter q to quit\n");

    char buf[256];
    while (gets(buf)) {
        if (*buf == 'q')
            break;
    }

deprecated gets used

many of the test programs use gets(), which is deprecated:

 http://www.cplusplus.com/reference/cstdio/gets/ :
 Compatibility
 The most recent revision of the C standard (2011) has definitively removed this function from its specification.
 The function is deprecated in C++ (as of 2011 standard, which follows C99+TC3).

better use gets_s, else, VS2015 and above won't compile.

affected files:
\Platinum\Source\Apps\FrameStreamer\main.cpp
\Platinum\Source\Apps\MediaConnect\main.cpp
\Platinum\Source\Apps\MediaCrawler\main.cpp
\Platinum\Source\Tests\FileMediaServer\FileMediaServerTest.cpp
\Platinum\Source\Tests\LightSample\LightSampleTest.cpp
\Platinum\Source\Tests\MediaRenderer\MediaRendererTest.cpp
\Platinum\Source\Tests\Simple\SimpleTest.cpp

change like this:

  • while (gets(buf)) {
  • while (gets_s(buf,256)) {

setVolume timeout

SetVolume function fast, about one second one time, Timeout occurred
LOG info below:
2019-11-06 16:57:36.256 32213-32213/com.cdel.acc.dlna I/EasyMediaController: setVolume into. vol=12
2019-11-06 16:57:36.258 32213-32560/com.cdel.acc.dlna D/Neptune: [SendRequestOnce] FINE: requesting URL http://192.168.98.42:37198/RenderingControl/BF-TV-DMR-3F0EED7C/control.xml
2019-11-06 16:57:36.258 32213-32560/com.cdel.acc.dlna D/Neptune: [SendRequestOnce] FINE: calling connector (proxy:no) (http 1.1:yes) (url:http://192.168.98.42:37198/RenderingControl/BF-TV-DMR-3F0EED7C/control.xml)
2019-11-06 16:57:36.258 32213-32560/com.cdel.acc.dlna D/Neptune: [Connect] FINE: looking for a connection to reuse
2019-11-06 16:57:36.258 32213-32560/com.cdel.acc.dlna D/Neptune: [Connect] FINE: reusing connection
2019-11-06 16:57:36.258 32213-32560/com.cdel.acc.dlna D/Neptune: [SendRequestOnce] FINE: got connection (reused: true)
2019-11-06 16:57:36.262 32213-32560/com.cdel.acc.dlna D/Neptune: [WriteRequest] FINE: sending body stream, 363 bytes
2019-11-06 16:57:36.472 32213-32560/com.cdel.acc.dlna D/Neptune: [FindServer] FINE: Device (BF-TV-DMR-3F0EED7C) not found in our list of servers
2019-11-06 16:57:36.472 32213-32560/com.cdel.acc.dlna I/EasyMediaController: OnSetVolumeResult into.
2019-11-06 16:57:47.686 32213-32448/com.cdel.acc.dlna D/Neptune: [Parse] WARNING: NPT_CHECK failed, result=-20014 (NPT_ERROR_TIMEOUT) [(stream.ReadLine(line, NPT_HTTP_PROTOCOL_MAX_LINE_LENGTH))]
2019-11-06 16:57:47.686 32213-32448/com.cdel.acc.dlna D/Neptune: [ReadResponse] FINE: NPT_CHECK failed, result=-20014 (NPT_ERROR_TIMEOUT) [(result)]
2019-11-06 16:58:11.339 32213-32428/com.cdel.acc.dlna D/Neptune: [Cleanup] FINE: cleaning up connection (1 remain)

It's not stable when I used it in my iOS app..

Hi. I have some trouble when I used Platinum in my iOS app.
I feel it's not stable.
In my app, I have a list to present all devices which have 'AVTransport' service. These devices seem as DMR. But,the list of devices will be refreshed in several seconds because of receive list change notification. Some methods are called frequently, such as "PLT_::OnMRRemoved","PLT_::OnMRAdded"..I don't know what happend.
After that,i suspected network environment.So, I changed network . But it's no help...
Can you replay me when you see this issue?
Thanks for your contribution.

windows media player play error

hello,why use windows media player connect mediarendertest show anomalies。The contact surface following chart shows,how to recover the error?
1

scons install with msys2

Hi,

I'm trying to run the install with msys2 64 bits, using scons .

When running the install, the version of the python scripts are incompatible with scons python.
From my install I have:
-in msys2 64 bits -

scons --version
SCons by Steven Knight et al.:
        script: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
        engine: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
        engine path: ['/usr/lib/python3.8/site-packages/SCons']
Copyright (c) 2001 - 2019 The SCons Foundation

Then when checking for version of python which scons uses I get: nano /usr/bin/scons and line1 : #!/usr/bin/python .
I have tried to symlink to my python2 install:
(powershell)

cmd /c 'mklink C:\dev\msys64\usr\bin\python2.exe C:\dev\msys64\mingw64\bin\python2.exe'
symbolic link created for C:\dev\msys64\usr\bin\python2.exe <<===>> C:\dev\msys64\mingw64\bin\python2.exe

In msys2: /usr/bin/python2.exe starts python2 that's fine, but changing the first line of scons to #!/usr/bin/python2.exe , or to python2 - with respect to changing the symlink - doesn't work.
The problem seem to come from the fact that the rest of the scons install depends on the directories near the python install - if i get it correctly -.

Can you provide an install for a python vesion > 3.0?

Best,

P

iPhone os 14.6 can't find the Tv device

Hi Sylvain Rebaud

I get a issue while test the library. If DMR start first, DMC cant find the device. you can find it the other way around. and it only happend in my iphone 12, OS 14.6. but Iphone 7 plus with OS 15.1 is ok. so i wonder if Whether the order of joining the network matters.

Thank you for help.

PltHttpServer.cpp have “PathTraversal” Vulnerability

I audit the code and found a problem,the problem code is in:Platinum/blob/master/Source/Core/PltHttpServer.cpp,line 193
if ((file_path.Find("/..") >= 0) || (file_path.Find("\\..") >= 0) || NPT_FAILED(NPT_File::GetInfo(file_path, &file_info))) { return NPT_ERROR_NO_SUCH_ITEM; }
the function to prevent pathtraversal is not enough:(file_path.Find("/..") >= 0)
in the PltFileMediaServer.cpp line 364 the function ExtractResourcePath:
NPT_Ordinal skip = 0; if (uri_path.StartsWith(m_UrlRoot)) { skip = m_UrlRoot.GetLength(); } else if (uri_path.StartsWith(url_root_encode)) { skip = url_root_encode.GetLength(); } else { return NPT_FAILURE; } /* account for extra slash */ skip += ((m_UrlRoot=="/")?0:1); file_path = uri_path.SubString(skip);

we know if victim's root directory is:
/home/sanpangzi/mediaserver/
if an attacker post a GET request as:
http://localhost:40009/home/sanpangzi/mediaserver/../test.mp3
the variable "file_path" is "../test.mp3"
and the filter function Find("/..") could not match "../" so cause PathTraversal Vulnerability

we suggest the code as fallows:

if ((file_path.Find("../") >= 0) || (file_path.Find("..\") >= 0) `

FileMediaServerTest couldn'r run

Mac OS: 10.15
while excute FileMediaServerTest, message
$ ./FileMediaServerTest
-bash: ./FileMediaServerTest: cannot execute binary file"

False URL created by Device.getAbsolutePath(String path)

I tried to get an action by using these:
Service service = device.getService("urn:schemas-upnp-org:device:MediaRenderer:1"); Action action = service.getAction("SetAVTransportURI");
Then I found "service" is created but "action" is null. I checked the source code and confirmed it caused by these:

`
// Service.java
private Node getSCPDNode() {
try {

    URL scpdUrl = new URL(rootDev.getAbsoluteURL(scpdURLStr));
		
    scpdNode = getSCPDNode(scpdUrl);		
		
    if (scpdNode != null) {
			
       data.setSCPDNode(scpdNode);
			
       return scpdNode;
		
   }
	
}
...

}
`
it got a false URL by using rootDev.getAbsoluteURL(scpdURLStr), this is what I got:
image
Is is a bug?

Could not find some rendering devices

I found some devices, even though it has responded to the "search" signal and returned the device description, but the process goes to "PLT_CtrlPoint::InspectDevice", but it cannot continue.

Only commented "if (NPT_SUCCEEDED(NPT_ContainerFind(m_PendingInspections,
NPT_StringFinder(uuid),
pending_uuid))) ",
The device description can be parsed correctly, otherwise there will always be some devices in the list sometimes missing.

This problem is prone to occur if some devices send out device description multiple times.

The reason is that after some devices have issued descriptions multiple times, the corresponding number of tasks cannot respond to the descriptions of all devices, resulting in the UUID in the m_PendingInspections table cannot be deleted. In the future, the device whose UUID is not deleted in m_PendingInspections, even if it is not in the mRootDevice table, can no longer process its description and add it to the table, resulting in some devices that cannot be searched until it is restarted.

Now on AUR!

Packaged as best I could. Any reason you don't build .so's on GNU/Linux?

Metapackage: https://aur.archlinux.org/pkgbase/neptune «Platinum UPnP SDK + Neptune C++ Runtime by Axiomatic Software»
Providing:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.