diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2008-12-16 17:02:57 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2008-12-16 17:02:57 +0100 |
| commit | 91e9098bb54966e20ed240d127a9c946065cd5ab (patch) | |
| tree | a60b2c7dbd5bb05f707afa71f94bfcc65aaef890 /lib/service/servicemp3.cpp | |
| parent | 00cc3e8df7fec482a953416c1bb76d7be7f7a8ba (diff) | |
| download | enigma2-91e9098bb54966e20ed240d127a9c946065cd5ab.tar.gz enigma2-91e9098bb54966e20ed240d127a9c946065cd5ab.zip | |
support to query videoheight, width, aspect, framerate and progressive state also for servicemp3 (i.e. divx/h264 a.o.)
this needs also a current dvb videosink
Diffstat (limited to 'lib/service/servicemp3.cpp')
| -rw-r--r-- | lib/service/servicemp3.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index 86b7696f..7a8fcbd7 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -188,7 +188,8 @@ eServiceMP3::eServiceMP3(const char *filename): m_filename(filename), m_pump(eAp GstElement *source = 0; GstElement *decoder = 0, *conv = 0, *flt = 0, *parser = 0, *sink = 0; /* for audio */ GstElement *audio = 0, *switch_audio = 0, *queue_audio = 0, *video = 0, *queue_video = 0, *videodemux = 0, *audiodemux = 0, *id3demux; - + m_aspect = m_width = m_height = m_framerate = m_progressive = -1; + m_state = stIdle; eDebug("SERVICEMP3 construct!"); @@ -819,6 +820,11 @@ int eServiceMP3::getInfo(int w) switch (w) { + case sVideoHeight: return m_height; + case sVideoWidth: return m_width; + case sFrameRate: return m_framerate; + case sProgressive: return m_progressive; + case sAspect: return m_aspect; case sTitle: case sArtist: case sAlbum: @@ -1147,28 +1153,28 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) } else if (const GstStructure *msgstruct = gst_message_get_structure(msg)) { - const gchar *eventname; - if ( eventname = gst_structure_get_name(msgstruct) ) + const gchar *eventname = gst_structure_get_name(msgstruct); + if ( eventname ) { - if (!strcmp(eventname, "eventSizeChanged")) + if (!strcmp(eventname, "eventSizeChanged") || !strcmp(eventname, "eventSizeAvail")) { - gint aspect_ratio, width, height = 0; - gst_structure_get_int (msgstruct, "aspect_ratio", &aspect_ratio); - gst_structure_get_int (msgstruct, "width", &width); - gst_structure_get_int (msgstruct, "height", &height); - eDebug("****** decoder threw eventSizeChanged! aspect_ratio=%i, width=%i, height=%i", aspect_ratio, width, height); + gst_structure_get_int (msgstruct, "aspect_ratio", &m_aspect); + gst_structure_get_int (msgstruct, "width", &m_width); + gst_structure_get_int (msgstruct, "height", &m_height); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoSizeChanged); } - if (!strcmp(eventname, "eventFrameRateChanged")) + else if (!strcmp(eventname, "eventFrameRateChanged") || !strcmp(eventname, "eventFrameRateAvail")) { - gint frame_rate = 0; - gst_structure_get_int (msgstruct, "frame_rate", &frame_rate); - eDebug("****** decoder threw eventFrameRateChanged! frame_rate=%i", frame_rate); + gst_structure_get_int (msgstruct, "frame_rate", &m_framerate); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoFramerateChanged); } - if (!strcmp(eventname, "eventProgressiveChanged")) + else if (!strcmp(eventname, "eventProgressiveChanged") || !strcmp(eventname, "eventProgressiveAvail")) { - gint progressive = 0; - gst_structure_get_int (msgstruct, "progressive", &progressive); - eDebug("****** decoder threw eventProgressiveChanged! progressive=%i", progressive); + gst_structure_get_int (msgstruct, "progressive", &m_progressive); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoProgressiveChanged); } } } |
