add support for "frame rate changed" and "progressive changed" video event
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 5 Aug 2008 13:04:15 +0000 (13:04 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 5 Aug 2008 13:04:15 +0000 (13:04 +0000)
(the last needs new drivers)

lib/dvb/decoder.cpp
lib/dvb/idvb.h
lib/service/iservice.h
lib/service/servicedvb.cpp

index 7ad1a25..71b3f39 100644 (file)
@@ -563,6 +563,20 @@ void eDVBVideo::video_event(int)
                        event.width = evt.u.size.w;
                        /* emit */ m_event(event);
                }
+               else if (evt.type == VIDEO_EVENT_FRAME_RATE_CHANGED)
+               {
+                       struct iTSMPEGDecoder::videoEvent event;
+                       event.type = iTSMPEGDecoder::videoEvent::eventFrameRateChanged;
+                       event.framerate = evt.u.frame_rate;
+                       /* emit */ m_event(event);
+               }
+               else if (evt.type == 16 /*VIDEO_EVENT_PROGRESSIVE_CHANGED*/)
+               {
+                       struct iTSMPEGDecoder::videoEvent event;
+                       event.type = iTSMPEGDecoder::videoEvent::eventProgressiveChanged;
+                       event.progressive = evt.u.frame_rate;
+                       /* emit */ m_event(event);
+               }
                else
                        eDebug("unhandled DVBAPI Video Event %d", evt.type);
        }
index 2aee67e..1030b53 100644 (file)
@@ -697,10 +697,16 @@ public:
 
        struct videoEvent
        {
-               enum { eventUnknown = 0, eventSizeChanged = VIDEO_EVENT_SIZE_CHANGED } type;
+               enum { eventUnknown = 0,
+                       eventSizeChanged = VIDEO_EVENT_SIZE_CHANGED,
+                       eventFrameRateChanged = VIDEO_EVENT_FRAME_RATE_CHANGED,
+                       eventProgressiveChanged = 16
+               } type;
                unsigned char aspect;
                unsigned short height;
                unsigned short width;
+               bool progressive;
+               unsigned short framerate;
        };
 
        virtual RESULT connectVideoEvent(const Slot1<void, struct videoEvent> &event, ePtr<eConnection> &connection) = 0;
index f06938a..7448a5e 100644 (file)
@@ -760,6 +760,8 @@ public:
                evUpdatedRassInteractivePicMask,
 
                evVideoSizeChanged,
+               evVideoFramerateChanged,
+               evVideoProgressiveChanged,
 
                evStopped,
 
index 307c317..e036307 100644 (file)
@@ -2954,7 +2954,17 @@ void eDVBServicePlay::setPCMDelay(int delay)
 void eDVBServicePlay::video_event(struct iTSMPEGDecoder::videoEvent event)
 {
        memcpy(&m_videoEventData, &event, sizeof(iTSMPEGDecoder::videoEvent));
-       m_event((iPlayableService*)this, evVideoSizeChanged);
+       switch(event.type) {
+               case iTSMPEGDecoder::videoEvent::eventSizeChanged:
+                       m_event((iPlayableService*)this, evVideoSizeChanged);
+                       break;
+               case iTSMPEGDecoder::videoEvent::eventFrameRateChanged:
+                       m_event((iPlayableService*)this, evVideoFramerateChanged);
+                       break;
+               case iTSMPEGDecoder::videoEvent::eventProgressiveChanged:
+                       m_event((iPlayableService*)this, evVideoProgressiveChanged);
+                       break;
+       }
 }
 
 RESULT eDVBServicePlay::stream(ePtr<iStreamableService> &ptr)