Hi,
I'm looking at using clink to communicate with and control a media rendering device.
One of the things I am trying to do is to track the state of the AV Transport. This is available in various state variables.
When I subscribe to the AVTransport service, my eventNotifyReceived gets called when the AVTransport stet changes, which is what I want.
However, rather than giving details of the state variables individually, it returns a "LastChange" variable which contains an XML document containing all of the state variables.
e.g.
<InstanceID val="0"><TransportState val="PAUSED_PLAYBACK"/><CurrentPlayMode val="NORMAL"/><NumberOfTracks val="1"/><CurrentTrack val="1"/><CurrentSection val="0"/>
etc.
I've done the same with the old Intel Device Spy and get the same thing, so this appears to be by design.
Is there any straightforward way I can parse these into the state variables or is there some other way I should be addressing them?
Cheers,
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Satoshi,
Thanks for this. Actually I solved it yesterday!
I used an CyberXML Parser object to parse out the attributes and values I needed.
Some of these values are complete XML sub-documents in their own right, which I also need to parse.
Thanks for your help on this one anyway.
Which leads me to another question: I'm getting random segfaults when I run my code. I'm using the xerces-c library ( libxerces-c0-devel-2.7.0 ). Do you know if there is a problem using this library with Cyberlink C++ as I saw another post where someone seemed to be having similar problems.
Cheers,
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Recently, I don't use Xerces as the XML parser because the library is very huge.
The CyberLink supports other two XML parsers, expat and libxml2, and I use expat mainly on my applications. To change the other XML parsers, use USE_XMLPARSER_LIBXML2 or USE_XMLPARSER_EXPAT.
Please check it :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried using expat by passing --enable-expat as a ./configure option and this seemed to work in as far as it compiles.
Where should I put these flags you mention?
However, with expat I found I was getting more errors. With debug on it seemed that the XML responses were getting corrupted by characters missing. I will give it another try and maybe capture some f the debug XML and post it here.
Cheers,
Keith
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm looking at using clink to communicate with and control a media rendering device.
One of the things I am trying to do is to track the state of the AV Transport. This is available in various state variables.
When I subscribe to the AVTransport service, my eventNotifyReceived gets called when the AVTransport stet changes, which is what I want.
However, rather than giving details of the state variables individually, it returns a "LastChange" variable which contains an XML document containing all of the state variables.
e.g.
<InstanceID val="0"><TransportState val="PAUSED_PLAYBACK"/><CurrentPlayMode val="NORMAL"/><NumberOfTracks val="1"/><CurrentTrack val="1"/><CurrentSection val="0"/>
etc.
I've done the same with the old Intel Device Spy and get the same thing, so this appears to be by design.
Is there any straightforward way I can parse these into the state variables or is there some other way I should be addressing them?
Cheers,
Keith
Here's a full example of the "LastChange" state variable:
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="1">
<TransportState val="NO_MEDIA_PRESENT"></TransportState>
<TransportStatus val="OK"></TransportStatus>
<TransportPlaySpeed val="1"></TransportPlaySpeed>
<CurrentPlayMode val="NORMAL"></CurrentPlayMode>
<CurrentRecordQualityMode val="NOT_IMPLEMENTED"></CurrentRecordQualityMode>
<PossiblePlaybackStorageMedia val="NETWORK"></PossiblePlaybackStorageMedia>
<PossibleRecordStorageMedia val="NOT_IMPLEMENTED"></PossibleRecordStorageMedia>
<PossibleRecordQualityModes val="NOT_IMPLEMENTED"></PossibleRecordQualityModes>
<NumberOfTracks val="0"></NumberOfTracks>
<CurrentMediaDuration val="0:00:00"></CurrentMediaDuration>
<AVTransportURI></AVTransportURI>
<AVTransportURIMetaData></AVTransportURIMetaData>
<NextAVTransportURI></NextAVTransportURI>
<NextAVTransportURIMetaData></NextAVTransportURIMetaData>
<PlaybackStorageMedium val="NETWORK"></PlaybackStorageMedium>
<RecordStorageMedium val="NOT_IMPLEMENTED"></RecordStorageMedium>
<RecordMediumWri
teStatus val="NOT_IMPLEMENTED"></RecordMediumWriteStatus>
<CurrentTrack val="0"></CurrentTrack>
<CurrentTrackDuration val="0:00:00"></CurrentTrackDuration>
<CurrentTrackMetaData val="NOT_IMPLEMENTED"></CurrentTrackMetaData>
<CurrentTrackURI></CurrentTrackURI>
<CurrentTransportActions val="Play,Stop,Pause,Seek,Next,Previous"></CurrentTransportActions>
</InstanceID>
</Event>
I checked the UPnP specification, but it seems that the implementation of the device isn't specified explicitly in the specification.
In CyberLink for C++, the device sends the single event each when the value is changed.
About the renderer, Sony have released some televisions which are supported UPnP renderer from this spring in Japan.
DLNA Renderers (Japanese)
http://www.sony.jp/event/DLNA/association/photo_p_bravia.html?sssid=60
I will check the behavior if I can.
Satoshi,
Thanks for this. Actually I solved it yesterday!
I used an CyberXML Parser object to parse out the attributes and values I needed.
Some of these values are complete XML sub-documents in their own right, which I also need to parse.
Thanks for your help on this one anyway.
Which leads me to another question: I'm getting random segfaults when I run my code. I'm using the xerces-c library ( libxerces-c0-devel-2.7.0 ). Do you know if there is a problem using this library with Cyberlink C++ as I saw another post where someone seemed to be having similar problems.
Cheers,
Keith
Recently, I don't use Xerces as the XML parser because the library is very huge.
The CyberLink supports other two XML parsers, expat and libxml2, and I use expat mainly on my applications. To change the other XML parsers, use USE_XMLPARSER_LIBXML2 or USE_XMLPARSER_EXPAT.
Please check it :-)
Thanks for this.
I tried using expat by passing --enable-expat as a ./configure option and this seemed to work in as far as it compiles.
Where should I put these flags you mention?
However, with expat I found I was getting more errors. With debug on it seemed that the XML responses were getting corrupted by characters missing. I will give it another try and maybe capture some f the debug XML and post it here.
Cheers,
Keith