本文整理汇总了C++中PLT_Service::GetStateVariableValue方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_Service::GetStateVariableValue方法的具体用法?C++ PLT_Service::GetStateVariableValue怎么用?C++ PLT_Service::GetStateVariableValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_Service
的用法示例。
在下文中一共展示了PLT_Service::GetStateVariableValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
/*----------------------------------------------------------------------
| CUPnPRenderer::OnPlay
+---------------------------------------------------------------------*/
NPT_Result
CUPnPRenderer::OnPlay(PLT_ActionReference& action)
{
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW) {
return NPT_SUCCESS;
} else if (g_application.m_pPlayer->IsPausedPlayback()) {
CApplicationMessenger::GetInstance().SendMsg(TMSG_MEDIA_PAUSE);
} else if (!g_application.m_pPlayer->IsPlaying()) {
NPT_String uri, meta;
PLT_Service* service;
// look for value set previously by SetAVTransportURI
NPT_CHECK_SEVERE(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service));
NPT_CHECK_SEVERE(service->GetStateVariableValue("AVTransportURI", uri));
NPT_CHECK_SEVERE(service->GetStateVariableValue("AVTransportURIMetaData", meta));
// if not set, use the current file being played
PlayMedia(uri, meta);
}
return NPT_SUCCESS;
}
示例2:
/*----------------------------------------------------------------------
| PLT_MediaController::GetProtocolInfoSink
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaController::GetProtocolInfoSink(PLT_DeviceDataReference& device,
NPT_List<NPT_String>& sinks)
{
PLT_DeviceDataReference renderer;
NPT_CHECK_WARNING(FindRenderer(device->GetUUID(), renderer));
// look for ConnectionManager service
PLT_Service* serviceCMR;
NPT_CHECK_SEVERE(device->FindServiceByType(
"urn:schemas-upnp-org:service:ConnectionManager:*",
serviceCMR));
NPT_String value;
NPT_CHECK_SEVERE(serviceCMR->GetStateVariableValue(
"SinkProtocolInfo",
value));
sinks = value.Split(",");
return NPT_SUCCESS;
}
示例3: lock
/*----------------------------------------------------------------------
| CUPnPRenderer::UpdateState
+---------------------------------------------------------------------*/
void
CUPnPRenderer::UpdateState()
{
NPT_AutoLock lock(m_state);
PLT_Service *avt;
if (NPT_FAILED(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", avt)))
return;
/* don't update state while transitioning */
NPT_String state;
avt->GetStateVariableValue("TransportState", state);
if(state == "TRANSITIONING")
return;
avt->SetStateVariable("TransportStatus", "OK");
if (g_application.m_pPlayer->IsPlaying() || g_application.m_pPlayer->IsPausedPlayback()) {
avt->SetStateVariable("NumberOfTracks", "1");
avt->SetStateVariable("CurrentTrack", "1");
std::string buffer = g_infoManager.GetCurrentPlayTime(TIME_FORMAT_HH_MM_SS);
avt->SetStateVariable("RelativeTimePosition", buffer.c_str());
avt->SetStateVariable("AbsoluteTimePosition", buffer.c_str());
buffer = g_infoManager.GetDuration(TIME_FORMAT_HH_MM_SS);
if (buffer.length() > 0) {
avt->SetStateVariable("CurrentTrackDuration", buffer.c_str());
avt->SetStateVariable("CurrentMediaDuration", buffer.c_str());
} else {
avt->SetStateVariable("CurrentTrackDuration", "00:00:00");
avt->SetStateVariable("CurrentMediaDuration", "00:00:00");
}
} else if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW) {
avt->SetStateVariable("TransportState", "PLAYING");
avt->SetStateVariable("AVTransportURI" , g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str());
avt->SetStateVariable("CurrentTrackURI", g_infoManager.GetPictureLabel(SLIDE_FILE_PATH).c_str());
avt->SetStateVariable("TransportPlaySpeed", "1");
CGUIWindowSlideShow *slideshow = g_windowManager.GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (slideshow)
{
std::string index;
index = StringUtils::Format("%d", slideshow->NumSlides());
avt->SetStateVariable("NumberOfTracks", index.c_str());
index = StringUtils::Format("%d", slideshow->CurrentSlide());
avt->SetStateVariable("CurrentTrack", index.c_str());
}
avt->SetStateVariable("CurrentTrackMetadata", "");
avt->SetStateVariable("AVTransportURIMetaData", "");
} else {
avt->SetStateVariable("TransportState", "STOPPED");
avt->SetStateVariable("TransportPlaySpeed", "1");
avt->SetStateVariable("NumberOfTracks", "0");
avt->SetStateVariable("CurrentTrack", "0");
avt->SetStateVariable("RelativeTimePosition", "00:00:00");
avt->SetStateVariable("AbsoluteTimePosition", "00:00:00");
avt->SetStateVariable("CurrentTrackDuration", "00:00:00");
avt->SetStateVariable("CurrentMediaDuration", "00:00:00");
avt->SetStateVariable("NextAVTransportURI", "");
avt->SetStateVariable("NextAVTransportURIMetaData", "");
}
}
示例4: lock
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnPlay
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnPlay(PLT_ActionReference& action)
{
if (m_Delegate) {
return m_Delegate->OnPlay(action);
}
NPT_String uri, meta;
PLT_Service* service;
//NPT_Cardinal max_items = 4;
//PLT_ThreadTask *task;
// look for value set previously by SetAVTransportURI
NPT_CHECK_SEVERE(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service));
NPT_CHECK_SEVERE(service->GetStateVariableValue("AVTransportURI", uri));
NPT_CHECK_SEVERE(service->GetStateVariableValue("AVTransportURIMetaData", meta));
{
NPT_AutoLock lock(m_state);
service->SetStateVariable("TransportState", "TRANSITIONING");
service->SetStateVariable("TransportStatus", "OK");
}
// transcoder process takes over here. it shall put the output to the media server's
// media folder which can then be served by the media server when the media renderer
// requests it via a media controller that is instantiated here to connect(control)
// the transport of av between the renderer and the transcoder.
//PLT_TaskManager manager(max_items);
//manager.StartTask(task,0,true) ;
int child_pid;
char cmd[200];
char vcodec[] = "copy";
char acodec[] = "copy";
char fext[] = "flv"; //asf
char fname[] = "/home/ted/Music/transcoded.flv";
//ffmpeg -i bbb.m4v -vf "movie=aa-logo.png [wm];[in][wm] overlay=10:H-h-10 [out]" -f m4v output.m4v
//char* arg_list[] = {"ffmpeg",//"-v",//"0","-i",uri,"-vcodec",vcodec,"-acodec",acodec,//"-b",//"600k",//"-s",//"hd720","-f",fext,"-y",fname,NULL};
char* arg_list[] = {
"ffmpeg",
//"-v",
//"0",
"-i",
uri,
"-vcodec",
"libx264",
//"-coder",
//"0",
//"-bf",
//"0",
//"-flags2",
//"fast",
//"-wpredp",
//"0",
"-vpre",
"lossless_ultrafast",
"-vpre",
"baseline",
"-crf",
"25",
"-acodec",
"libmp3lame",
"-ar",
"44100",
"-deblockalpha",
"0",
"-deblockbeta",
"0",
"-r",
"25",
"-vb",
"2000000",
"-vf",
"movie=/home/ted/Logo/aa-logo.png[wm];[in][wm]overlay=10:H-h-10[out]",
"-f",
fext,
"-y",
fname,
NULL
};
printf("\n\n****%s****\n\n",arg_list);
//int n=sprintf (cmd, "ffmpeg.exe -i %s -vcodec %s -acodec %s -f %s -y %s", uri,vcodec,acodec,fext,fname);
//int n=sprintf (cmd, "ffmpeg.exe -i %s -i aa.png -i pv.png -filter_complex 'overlay=10:H-h-10,overlay=W-w-10:H-h-10' -vcodec %s -b:v 200k -acodec %s -f %s -y %s", uri,vcodec,acodec,fext,fname);
/* Spawn a child process running the “ls” command. Ignore the
returned child process ID. */
/* Duplicate this process. */
child_pid = fork ();
if (child_pid != 0){
/* This is the parent process. */
// setup Neptune logging
//.........这里部分代码省略.........