if ( bouquet && bouquet->m_bouquet_name.length() )
{
- name = "[Bouquet] " + bouquet->m_bouquet_name;
+ name = bouquet->m_bouquet_name;
return 0;
}
else
eStaticServiceDVBPVRInformation(const eServiceReference &ref);
RESULT getName(const eServiceReference &ref, std::string &name);
int getLength(const eServiceReference &ref);
+
+ int getInfo(const eServiceReference &ref, int w);
+ std::string getInfoString(const eServiceReference &ref,int w);
};
DEFINE_REF(eStaticServiceDVBPVRInformation);
return len / 90000;
}
+int eStaticServiceDVBPVRInformation::getInfo(const eServiceReference &ref, int w)
+{
+ switch (w)
+ {
+ case iServiceInformation::sDescription:
+ return iServiceInformation::resIsString;
+ case iServiceInformation::sTimeCreate:
+ if (m_parser.m_time_create)
+ return m_parser.m_time_create;
+ else
+ return iServiceInformation::resNA;
+ default:
+ return iServiceInformation::resNA;
+ }
+}
+std::string eStaticServiceDVBPVRInformation::getInfoString(const eServiceReference &ref,int w)
+{
+ switch (w)
+ {
+ case iServiceInformation::sDescription:
+ return m_parser.m_description;
+ default:
+ return "";
+ }
+}
class eDVBPVRServiceOfflineOperations: public iServiceOfflineOperations
{
m_reference(ref), m_dvb_service(service), m_service_handler(0), m_is_paused(0)
{
m_is_pvr = !ref.path.empty();
+ m_timeshift_enabled = 0;
CONNECT(m_service_handler.serviceEvent, eDVBServicePlay::serviceEvent);
CONNECT(m_event_handler.m_eit_changed, eDVBServicePlay::gotNewEvent);
m_dvb_service->setCachePID(eDVBService::cPCRPID, pcrpid);
}
}
-
+
+ m_event((iPlayableService*)this, evUpdatedInfo);
break;
}
}
RESULT eDVBServicePlay::pause(ePtr<iPauseableService> &ptr)
{
- if (m_is_pvr)
+ if (!m_is_pvr)
{
- ptr = this;
- return 0;
+ ptr = 0;
+ return -1;
}
- ptr = 0;
- return -1;
+ ptr = this;
+ return 0;
}
RESULT eDVBServicePlay::setSlowMotion(int ratio)
RESULT eDVBServicePlay::setFastForward(int ratio)
{
if (m_decoder)
- m_decoder->setFastForward(ratio);
+ return m_decoder->setFastForward(ratio);
else
return -1;
}
RESULT eDVBServicePlay::seekTo(pts_t to)
{
- return -1;
+ eDebug("eDVBServicePlay::seekTo: jump %lld", to);
+
+ ePtr<iDVBPVRChannel> pvr_channel;
+
+ if (m_service_handler.getPVRChannel(pvr_channel))
+ return -1;
+
+ ePtr<iDVBDemux> demux;
+ m_service_handler.getDemux(demux);
+ if (!demux)
+ return -1;
+
+ return pvr_channel->seekTo(demux, 0, to);
}
RESULT eDVBServicePlay::seekRelative(int direction, pts_t to)
if (!demux)
return -1;
- return pvr_channel->getCurrentPosition(demux, pos);
+ return pvr_channel->getCurrentPosition(demux, pos, 1);
+}
+
+RESULT eDVBServicePlay::setTrickmode(int trick)
+{
+ if (m_decoder)
+ m_decoder->setTrickmode(trick);
+ return 0;
}
RESULT eDVBServicePlay::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr)
return 0;
}
+RESULT eDVBServicePlay::timeshift(ePtr<iTimeshiftService> &ptr)
+{
+ if (m_timeshift_enabled || !m_is_pvr)
+ {
+ ptr = this;
+ return 0;
+ }
+ ptr = 0;
+ return -1;
+}
+
RESULT eDVBServicePlay::getName(std::string &name)
{
if (m_dvb_service)
switch (w)
{
+ case sAspect:
+ if (!program.videoStreams.empty() && program.videoStreams[0].component_tag != -1)
+ {
+ ePtr<eServiceEvent> evt;
+ if (!m_event_handler.getEvent(evt, 0))
+ {
+ ePtr<eComponentData> data;
+ if (!evt->getComponentData(data, program.videoStreams[0].component_tag))
+ {
+ if ( data->getStreamContent() == 1 )
+ {
+ switch(data->getComponentType())
+ {
+ // SD
+ case 1: // 4:3 SD PAL
+ case 2:
+ case 3: // 16:9 SD PAL
+ case 4: // > 16:9 PAL
+ case 5: // 4:3 SD NTSC
+ case 6:
+ case 7: // 16:9 SD NTSC
+ case 8: // > 16:9 NTSC
+
+ // HD
+ case 9: // 4:3 HD PAL
+ case 0xA:
+ case 0xB: // 16:9 HD PAL
+ case 0xC: // > 16:9 HD PAL
+ case 0xD: // 4:3 HD NTSC
+ case 0xE:
+ case 0xF: // 16:9 HD NTSC
+ case 0x10: // > 16:9 HD PAL
+ return data->getComponentType();
+ }
+ }
+ }
+ }
+ }
+ return -1;
+ case sIsCrypted: return program.isCrypted;
case sVideoPID: if (program.videoStreams.empty()) return -1; return program.videoStreams[0].pid;
case sAudioPID: if (program.audioStreams.empty()) return -1; return program.audioStreams[m_current_audio_stream].pid;
case sPCRPID: return program.pcrPid;
case sPMTPID: return program.pmtPid;
case sTXTPID: return -1;
-
case sSID: return ((const eServiceReferenceDVB&)m_reference).getServiceID().get();
case sONID: return ((const eServiceReferenceDVB&)m_reference).getOriginalNetworkID().get();
case sTSID: return ((const eServiceReferenceDVB&)m_reference).getTransportStreamID().get();
return -1;
}
+RESULT eDVBServicePlay::startTimeshift()
+{
+ if (m_timeshift_enabled)
+ return -1;
+ eDebug("TIMESHIFT - start!");
+ return 0;
+}
+
+RESULT eDVBServicePlay::stopTimeshift()
+{
+ if (!m_timeshift_enabled)
+ return -1;
+ m_timeshift_enabled = 0;
+ eDebug("timeshift disabled");
+ return 0;
+}
+
DEFINE_REF(eDVBServicePlay)
eAutoInitPtr<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB");