work on (premiere) subservice selection
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 28 Nov 2005 17:10:42 +0000 (17:10 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 28 Nov 2005 17:10:42 +0000 (17:10 +0000)
sorry this needs another one libdvbsi++ update

lib/service/event.cpp
lib/service/event.h

index cfd2ac5..e76ea31 100644 (file)
@@ -5,6 +5,7 @@
 #include <dvbsi++/event_information_section.h>
 #include <dvbsi++/short_event_descriptor.h>
 #include <dvbsi++/extended_event_descriptor.h>
+#include <dvbsi++/linkage_descriptor.h>
 #include <dvbsi++/descriptor_tag.h>
 
 DEFINE_REF(eServiceEvent);
@@ -60,6 +61,9 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid)
        {
                switch ((*desc)->getTag())
                {
+                       case LINKAGE_DESCRIPTOR:
+                               m_linkage_services.clear();
+                               break;
                        case SHORT_EVENT_DESCRIPTOR:
                        {
                                const ShortEventDescriptor *sed = (ShortEventDescriptor*)*desc;
@@ -99,6 +103,31 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid)
                                break;
                }
        }
+       if ( retval == 1 )
+       {
+               for (DescriptorConstIterator desc = evt->getDescriptors()->begin(); desc != evt->getDescriptors()->end(); ++desc)
+               {
+                       switch ((*desc)->getTag())
+                       {
+                               case LINKAGE_DESCRIPTOR:
+                               {
+                                       const LinkageDescriptor  *ld = (LinkageDescriptor*)*desc;
+                                       if ( ld->getLinkageType() == 0xB0 )
+                                       {
+                                               linkage_service s;
+                                               s.onid = ld->getOriginalNetworkId();
+                                               s.tsid = ld->getTransportStreamId();
+                                               s.sid = ld->getServiceId();
+                                               const PrivateDataByteVector *privateData =
+                                                       ld->getPrivateDataBytes();
+                                               s.description.assign((const char*)&((*privateData)[0]), privateData->size());
+                                               m_linkage_services.push_back(s);
+                                       }
+                                       break;
+                               }
+                       }
+               }
+       }
        if ( m_extended_description.find(m_short_description) == 0 )
                m_short_description="";
        return retval;
index 07106e4..3bbb322 100644 (file)
@@ -4,6 +4,7 @@
 #ifndef SWIG
 #include <time.h>
 #include <lib/base/object.h>
+#include <list>
 #include <string>
 class Event;
 #endif
@@ -16,6 +17,14 @@ DECLARE_REF(eServiceEvent);
 #endif
 public:
 #ifndef SWIG
+       struct linkage_service
+       {
+               uint16_t sid;
+               uint16_t onid;
+               uint16_t tsid;
+               std::string description;
+       };
+       std::list<linkage_service> m_linkage_services;
        time_t m_begin;
        int m_duration;
        std::string m_event_name, m_short_description, m_extended_description;