diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-12-13 13:26:48 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-12-13 13:26:48 +0000 |
| commit | b5b839edc91a6902966079ec0b0bb5026df9df57 (patch) | |
| tree | aa7ab629412e0c52041ba39425f299531274d386 /lib/service | |
| parent | 1394bbf36f7e0cc591f1a31b7d5db4e8f0f2c0c6 (diff) | |
| download | enigma2-b5b839edc91a6902966079ec0b0bb5026df9df57.tar.gz enigma2-b5b839edc91a6902966079ec0b0bb5026df9df57.zip | |
use aspect ratio information from mpeg sequence header instead of eit (needs
new drivers)
Diffstat (limited to 'lib/service')
| -rw-r--r-- | lib/service/iservice.h | 7 | ||||
| -rw-r--r-- | lib/service/servicedvb.cpp | 36 | ||||
| -rw-r--r-- | lib/service/servicedvb.h | 4 |
3 files changed, 44 insertions, 3 deletions
diff --git a/lib/service/iservice.h b/lib/service/iservice.h index 2ada9095..85ac6fd3 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -301,6 +301,9 @@ public: sTags, /* space seperated list of tags */ sDVBState, /* states as defined in pmt handler (as events there) */ + + sVideoHeight, + sVideoWidth }; enum { resNA = -1, resIsString = -2, resIsPyObject = -3 }; @@ -529,7 +532,9 @@ public: /* only when cueSheet is implemented */ evCuesheetChanged, - evUpdatedRadioText + evUpdatedRadioText, + + evVideoSizeChanged }; #ifndef SWIG virtual RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)=0; diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 85961550..24a91966 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -714,6 +714,7 @@ RESULT eServiceFactoryDVB::lookupService(ePtr<eDVBService> &service, const eServ eDVBServicePlay::eDVBServicePlay(const eServiceReference &ref, eDVBService *service): m_reference(ref), m_dvb_service(service), m_have_video_pid(0), m_is_paused(0) { + memset(&m_videoEventData, 0, sizeof(struct iTSMPEGDecoder::videoEvent)); m_is_primary = 1; m_is_pvr = !m_reference.path.empty(); @@ -1230,9 +1231,29 @@ int eDVBServicePlay::getInfo(int w) switch (w) { +#if HAVE_DVB_API_VERSION >= 3 + case sVideoHeight: + if (m_videoEventData.type != iTSMPEGDecoder::videoEvent::eventUnknown) + return m_videoEventData.height; + return -1; + case sVideoWidth: + if (m_videoEventData.type != iTSMPEGDecoder::videoEvent::eventUnknown) + return m_videoEventData.width; + return -1; +#else +#warning "FIXMEE implement sVideoHeight, sVideoWidth for old DVB API" +#endif case sAspect: - if (no_program_info) return -1; - if (!program.videoStreams.empty() && program.videoStreams[0].component_tag != -1) +#if HAVE_DVB_API_VERSION >= 3 + if (m_videoEventData.type != iTSMPEGDecoder::videoEvent::eventUnknown) + return m_videoEventData.aspect == VIDEO_FORMAT_4_3 ? 1 : 3; + else +#else +#warning "FIXMEE implement sAspect for old DVB API" +#endif + if (no_program_info) + return -1; + else if (!program.videoStreams.empty() && program.videoStreams[0].component_tag != -1) { ePtr<eServiceEvent> evt; if (!m_event_handler.getEvent(evt, 0)) @@ -1828,7 +1849,11 @@ void eDVBServicePlay::updateDecoder() { h.getDecodeDemux(m_decode_demux); if (m_decode_demux) + { m_decode_demux->getMPEGDecoder(m_decoder, m_is_primary); + if (m_decoder) + m_decoder->connectVideoEvent(slot(*this, &eDVBServicePlay::video_event), m_video_event_connection); + } if (m_cue) m_cue->setDecodingDemux(m_decode_demux, m_decoder); m_teletext_parser = new eDVBTeletextParser(m_decode_demux); @@ -2408,6 +2433,13 @@ void eDVBServicePlay::setPCMDelay(int delay) m_decoder->setPCMDelay(delay); } +void eDVBServicePlay::video_event(struct iTSMPEGDecoder::videoEvent event) +{ + eDebug("!!!!!!!!!! Video Event type %d, aspect %d, %dx%d", event.type, event.aspect, event.width, event.height); + memcpy(&m_videoEventData, &event, sizeof(iTSMPEGDecoder::videoEvent)); + m_event((iPlayableService*)this, evVideoSizeChanged); +} + DEFINE_REF(eDVBServicePlay) eAutoInitPtr<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB"); diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index b40341f7..c765e0e3 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -267,6 +267,10 @@ private: ePtr<eDVBRadioTextParser> m_radiotext_parser; ePtr<eConnection> m_radiotext_updated_connection; void radioTextUpdated(); + + ePtr<eConnection> m_video_event_connection; + void video_event(struct iTSMPEGDecoder::videoEvent); + struct iTSMPEGDecoder::videoEvent m_videoEventData; }; class eStaticServiceDVBBouquetInformation: public iStaticServiceInformation |
