Permalink
Browse files

Platinum: add SetNextAVTransportURI support to media renderer base

  • Loading branch information...
1 parent f55bfde commit 1f057a1f08bc2908e2ca8d5c6c412d3946a47c77 @elupus committed Nov 4, 2012

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -281,6 +281,26 @@
</argumentList>
</action>
<action>
+ <name>SetNextAVTransportURI</name>
+ <argumentList>
+ <argument>
+ <name>InstanceID</name>
+ <direction>in</direction>
+ <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>NextURI</name>
+ <direction>in</direction>
+ <relatedStateVariable>NextAVTransportURI</relatedStateVariable>
+ </argument>
+ <argument>
+ <name>NextURIMetaData</name>
+ <direction>in</direction>
+ <relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable>
+ </argument>
+ </argumentList>
+ </action>
+ <action>
<name>SetPlayMode</name>
<argumentList>
<argument>
@@ -562,10 +562,10 @@ PLT_MediaController::SetNextAVTransportURI(PLT_DeviceDataReference& device,
{
PLT_ActionReference action;
NPT_CHECK_SEVERE(m_CtrlPoint->CreateAction(
- device,
- "urn:schemas-upnp-org:service:AVTransport:1",
- "SetNextAVTransportURI",
- action));
+ device,
+ "urn:schemas-upnp-org:service:AVTransport:1",
+ "SetNextAVTransportURI",
+ action));
// set the uri
if (NPT_FAILED(action->SetArgumentValue("NextURI", next_uri))) {
@@ -867,6 +867,10 @@ PLT_MediaController::OnActionResponse(NPT_Result res,
if (NPT_FAILED(FindRenderer(uuid, device))) res = NPT_FAILURE;
m_Delegate->OnSetAVTransportURIResult(res, device, userdata);
}
+ else if (actionName.Compare("SetNextAVTransportURI", true) == 0) {
+ if (NPT_FAILED(FindRenderer(uuid, device))) res = NPT_FAILURE;
+ m_Delegate->OnSetNextAVTransportURIResult(res, device, userdata);
+ }
else if (actionName.Compare("SetPlayMode", true) == 0) {
if (NPT_FAILED(FindRenderer(uuid, device))) res = NPT_FAILURE;
m_Delegate->OnSetPlayModeResult(res, device, userdata);
@@ -176,6 +176,11 @@ class PLT_MediaControllerDelegate
PLT_DeviceDataReference& /* device */,
void* /* userdata */) {}
+ virtual void OnSetNextAVTransportURIResult(
+ NPT_Result /* res */,
+ PLT_DeviceDataReference& /* device */,
+ void* /* userdata */) {}
+
virtual void OnSetPlayModeResult(
NPT_Result /* res */,
PLT_DeviceDataReference& /* device */,
@@ -249,6 +249,9 @@ PLT_MediaRenderer::OnAction(PLT_ActionReference& action,
if (name.Compare("SetAVTransportURI", true) == 0) {
return OnSetAVTransportURI(action);
}
+ if (name.Compare("SetNextAVTransportURI", true) == 0) {
+ return OnSetNextAVTransportURI(action);
+ }
if (name.Compare("SetPlayMode", true) == 0) {
return OnSetPlayMode(action);
}
@@ -417,6 +420,33 @@ PLT_MediaRenderer::OnSetAVTransportURI(PLT_ActionReference& action)
}
/*----------------------------------------------------------------------
+ | PLT_MediaRenderer::OnSetAVTransportURI
+ +---------------------------------------------------------------------*/
+NPT_Result
+PLT_MediaRenderer::OnSetNextAVTransportURI(PLT_ActionReference& action)
+{
+ if (m_Delegate) {
+ return m_Delegate->OnSetNextAVTransportURI(action);
+ }
+
+ // default implementation is using state variable
+ NPT_String uri;
+ NPT_CHECK_WARNING(action->GetArgumentValue("NextURI", uri));
+
+ NPT_String metadata;
+ NPT_CHECK_WARNING(action->GetArgumentValue("NextURIMetaData", metadata));
+
+ PLT_Service* serviceAVT;
+ NPT_CHECK_WARNING(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", serviceAVT));
+
+ // update service state variables
+ serviceAVT->SetStateVariable("NextAVTransportURI", uri);
+ serviceAVT->SetStateVariable("NextAVTransportURIMetaData", metadata);
+
+ return NPT_SUCCESS;
+}
+
+/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnSetPlayMode
+---------------------------------------------------------------------*/
NPT_Result
@@ -59,6 +59,7 @@ class PLT_MediaRendererDelegate
virtual NPT_Result OnSeek(PLT_ActionReference& action) = 0;
virtual NPT_Result OnStop(PLT_ActionReference& action) = 0;
virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action) = 0;
+ virtual NPT_Result OnSetNextAVTransportURI(PLT_ActionReference& action) = 0;
virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action) = 0;
// RenderingControl
@@ -102,6 +103,7 @@ class PLT_MediaRenderer : public PLT_DeviceHost
virtual NPT_Result OnSeek(PLT_ActionReference& action);
virtual NPT_Result OnStop(PLT_ActionReference& action);
virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action);
+ virtual NPT_Result OnSetNextAVTransportURI(PLT_ActionReference& action);
virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action);
// RenderingControl

0 comments on commit 1f057a1

Please sign in to comment.