Update r25 issues (ServiceInfo.py)

    • Update r25 issues (ServiceInfo.py)

      Hi,

      In our image we have shown framrate of TV picture in our InfoBar. After latest update it dissapeared. Tried to go back to old code i ServiceInfo.py, but still missing fps in InfoBar. Is it possible to get back the posibillity to show framrate of TV signal?

      Framerate in MoviePlayer works OK.
      - FoxyRabbit - Peter Pan Team -

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von FoxyRabbit ()

    • Thanks @dhwz
      We figured we had to use <convert type="ServiceInfo">VideoParams</convert>

      But our "MoviePlayer" infobar have the same converter as for the main InfoBar
      <convert type="ServiceInfo">Framerate</convert>
      On r24 we get an output in both MoviePlayer and InfoBar
      On r25 we get an output in MoviePlayer. But no output in InfoBar

      It seems like there is an inconsistency in coding for these screens on r25.

      Framerate Converter shows framerate in MoviePlayer, but not in InfoBar
      - oddvarr - Peter Pan Team -
    • This converter has the option "Framerate". Then it should work to return the framerate wherever or whenever you want.

      So either should the "Framerate" option be removed from the converter, or fixed back to previous state that worked perfect, or the new VideoParams could be splitted to separate framerate from it, to be used for the "Framerate" option.

      My suggestion is to fix back previos code for framerate.
      - FoxyRabbit - Peter Pan Team -
    • Fiddled around a bit and just copied som code of the new VideoParams for Framerate wich does not work in the moment.

      This works like a charm.

      Python-Quellcode: ServiceInfo.py

      1. from Components.Converter.Converter import Converter
      2. from enigma import iServiceInformation, iPlayableService, iAudioType_ENUMS as iAt
      3. from Components.Element import cached
      4. class ServiceInfo(Converter, object):
      5. HAS_TELETEXT = 0
      6. IS_MULTICHANNEL = 1
      7. IS_CRYPTED = 2
      8. IS_WIDESCREEN = 3
      9. SUBSERVICES_AVAILABLE = 4
      10. XRES = 5
      11. YRES = 6
      12. APID = 7
      13. VPID = 8
      14. PCRPID = 9
      15. PMTPID = 10
      16. TXTPID = 11
      17. TSID = 12
      18. ONID = 13
      19. SID = 14
      20. FRAMERATE = 15
      21. TRANSFERBPS = 16
      22. HAS_SUBTITLES = 17
      23. IS_HDR = 18
      24. VIDEO_PARAMS = 19
      25. def __init__(self, type):
      26. Converter.__init__(self, type)
      27. self.type, self.interesting_events = {
      28. "HasTelext": (self.HAS_TELETEXT, (iPlayableService.evUpdatedInfo,)),
      29. "IsMultichannel": (self.IS_MULTICHANNEL, (iPlayableService.evUpdatedInfo,)),
      30. "IsCrypted": (self.IS_CRYPTED, (iPlayableService.evUpdatedInfo,)),
      31. "IsWidescreen": (self.IS_WIDESCREEN, (iPlayableService.evVideoSizeChanged,)),
      32. "IsHdr": (self.IS_HDR, (iPlayableService.evVideoSizeChanged,)),
      33. "SubservicesAvailable": (self.SUBSERVICES_AVAILABLE, (iPlayableService.evUpdatedEventInfo,)),
      34. "VideoWidth": (self.XRES, (iPlayableService.evVideoSizeChanged,)),
      35. "VideoHeight": (self.YRES, (iPlayableService.evVideoSizeChanged,)),
      36. "VideoParams": (self.VIDEO_PARAMS, (iPlayableService.evVideoSizeChanged, iPlayableService.evVideoProgressiveChanged, iPlayableService.evVideoFramerateChanged)),
      37. "AudioPid": (self.APID, (iPlayableService.evUpdatedInfo,)),
      38. "VideoPid": (self.VPID, (iPlayableService.evUpdatedInfo,)),
      39. "PcrPid": (self.PCRPID, (iPlayableService.evUpdatedInfo,)),
      40. "PmtPid": (self.PMTPID, (iPlayableService.evUpdatedInfo,)),
      41. "TxtPid": (self.TXTPID, (iPlayableService.evUpdatedInfo,)),
      42. "TsId": (self.TSID, (iPlayableService.evUpdatedInfo,)),
      43. "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)),
      44. "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)),
      45. "Framerate": (self.FRAMERATE, (iPlayableService.evVideoProgressiveChanged, iPlayableService.evVideoFramerateChanged,)),
      46. "TransferBPS": (self.TRANSFERBPS, (iPlayableService.evUpdatedInfo,)),
      47. "HasSubtitles": (self.HAS_SUBTITLES, (iPlayableService.evUpdatedInfo,)),
      48. }[type]
      49. self.need_wa = iPlayableService.evVideoSizeChanged in self.interesting_events
      50. def reuse(self):
      51. self.need_wa = iPlayableService.evVideoSizeChanged in self.interesting_events
      52. def getServiceInfoString(self, info, what, convert = lambda x: "%d" % x):
      53. v = info.getInfo(what)
      54. if v == -1:
      55. return "N/A"
      56. if v == -2:
      57. return info.getInfoString(what)
      58. return convert(v)
      59. @cached
      60. def getBoolean(self):
      61. service = self.source.service
      62. if self.type == self.HAS_SUBTITLES:
      63. subtitle = service and service.subtitleTracks()
      64. return subtitle and subtitle.getNumberOfSubtitleTracks() > 0
      65. info = service and service.info()
      66. if not info:
      67. return False
      68. if self.type == self.HAS_TELETEXT:
      69. tpid = info.getInfo(iServiceInformation.sTXTPID)
      70. return tpid != -1
      71. elif self.type == self.IS_MULTICHANNEL:
      72. # FIXME. but currently iAudioTrackInfo doesn't provide more information.
      73. audio = service.audioTracks()
      74. if audio:
      75. n = audio.getNumberOfTracks()
      76. idx = 0
      77. while idx < n:
      78. i = audio.getTrackInfo(idx)
      79. if i.getType() in (iAt.atAC3, iAt.atDDP, iAt.atDTS, iAt.atDTSHD):
      80. return True
      81. idx += 1
      82. return False
      83. elif self.type == self.IS_CRYPTED:
      84. return info.getInfo(iServiceInformation.sIsCrypted) == 1
      85. elif self.type == self.IS_HDR:
      86. return info.getInfoString(iServiceInformation.sEotf) in ('SMPTE ST 2084 (HDR10)', 'ARIB STD-B67 (HLG)')
      87. elif self.type == self.IS_WIDESCREEN:
      88. return info.getInfo(iServiceInformation.sAspect) in (3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10)
      89. elif self.type == self.SUBSERVICES_AVAILABLE:
      90. subservices = service.subServices()
      91. return subservices and subservices.getNumberOfSubservices() > 0
      92. boolean = property(getBoolean)
      93. @cached
      94. def getText(self):
      95. service = self.source.service
      96. info = service and service.info()
      97. if not info:
      98. return ""
      99. if self.type == self.XRES:
      100. return self.getServiceInfoString(info, iServiceInformation.sVideoWidth)
      101. elif self.type == self.YRES:
      102. return self.getServiceInfoString(info, iServiceInformation.sVideoHeight)
      103. elif self.type == self.APID:
      104. return self.getServiceInfoString(info, iServiceInformation.sAudioPID)
      105. elif self.type == self.VPID:
      106. return self.getServiceInfoString(info, iServiceInformation.sVideoPID)
      107. elif self.type == self.PCRPID:
      108. return self.getServiceInfoString(info, iServiceInformation.sPCRPID)
      109. elif self.type == self.PMTPID:
      110. return self.getServiceInfoString(info, iServiceInformation.sPMTPID)
      111. elif self.type == self.TXTPID:
      112. return self.getServiceInfoString(info, iServiceInformation.sTXTPID)
      113. elif self.type == self.TSID:
      114. return self.getServiceInfoString(info, iServiceInformation.sTSID)
      115. elif self.type == self.ONID:
      116. return self.getServiceInfoString(info, iServiceInformation.sONID)
      117. elif self.type == self.SID:
      118. return self.getServiceInfoString(info, iServiceInformation.sSID)
      119. elif self.type == self.FRAMERATE:
      120. frame_rate = info.getInfo(iServiceInformation.sFrameRate)
      121. progressive = info.getInfo(iServiceInformation.sProgressive)
      122. if not progressive:
      123. frame_rate *= 2
      124. frame_rate = ((frame_rate+500)/1000)
      125. return "%d fps" % frame_rate
      126. elif self.type == self.TRANSFERBPS:
      127. return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024))
      128. elif self.type == self.VIDEO_PARAMS:
      129. yres = info.getInfo(iServiceInformation.sVideoHeight)
      130. frame_rate = info.getInfo(iServiceInformation.sFrameRate)
      131. progressive = info.getInfo(iServiceInformation.sProgressive)
      132. print "yres", yres, "frame_rate", frame_rate, "progressive", progressive
      133. if not progressive:
      134. frame_rate *= 2
      135. frame_rate = (frame_rate+500)/1000
      136. return "%d%s%d" % (yres, 'p' if progressive else 'i', frame_rate)
      137. return ""
      138. text = property(getText)
      139. @cached
      140. def getValue(self):
      141. service = self.source.service
      142. info = service and service.info()
      143. if not info:
      144. return -1
      145. if self.type == self.XRES:
      146. return info.getInfo(iServiceInformation.sVideoWidth)
      147. elif self.type == self.YRES:
      148. return info.getInfo(iServiceInformation.sVideoHeight)
      149. elif self.type == self.FRAMERATE:
      150. return -1 if info.getInfo(iServiceInformation.sFrameRate) < 0 else -2
      151. elif self.type == self.IS_WIDESCREEN:
      152. return info.getInfo(iServiceInformation.sAspect)
      153. elif self.type == self.VIDEO_PARAMS:
      154. return -1 if info.getInfo(iServiceInformation.sVideoHeight) < 0 \
      155. or info.getInfo(iServiceInformation.sFrameRate) < 0 \
      156. or info.getInfo(iServiceInformation.sProgressive) < 0 \
      157. else -2
      158. return -1
      159. value = property(getValue)
      160. def changed(self, what):
      161. if what[0] != self.CHANGED_SPECIFIC or what[1] in self.interesting_events:
      162. Converter.changed(self, what)
      163. elif self.need_wa:
      164. if self.getValue() != -1:
      165. Converter.changed(self, (self.CHANGED_SPECIFIC, iPlayableService.evVideoSizeChanged))
      166. self.need_wa = False
      Alles anzeigen

      This will also fix returned value for "Framerate" option for interlaced videos as discussed earlier.
      - FoxyRabbit - Peter Pan Team -
    • Neu

      Dont understand why video size and framrate should be merged together in the new VideoParams option ("1080i50"). It does not look good, and I am pretty sure that someone does not understand the last part of it as long as it does not mention "fps". In my opinion those two data should be separated options since we already have the "Framerate" option. The best way would be to return it like this:

      VideoSize= "1080i"
      Framerate= "50 fps"

      and we could discuss if there should be a merged option that looks something like this:

      VideoParams= "1080i 50 fps"

      someone else with some thoughts?
      - FoxyRabbit - Peter Pan Team -
    • Neu

      Ah, so the videoformat is e.g. 1080i50, and the framerate for it is 25 frames pr. second? 50 fields and 25 fps...

      If thats the case I finally understand! Got mislead by the calculation that used framerates to calculate fields. But thats natural if you know the science behind it!

      Then my code above is uncorrect. Will correct that!

      But there is still a problem with latest code from DP wich does not show framerate when using "Framerate" option, after latest changes. Did notice though that if we hard restartet E2, the fps shows up again. Changing a skin (e2 restart), and the fps is gone. Hard restart, its back, and so on.
      - FoxyRabbit - Peter Pan Team -
    • Neu

      Changing

      "Framerate": (self.FRAMERATE, (iPlayableService.evVideoFramerateChanged,)),

      with

      "Framerate": (self.FRAMERATE, (iPlayableService.evVideoProgressiveChanged, iPlayableService.evVideoFramerateChanged)),

      in the latest ServiceInfo.py from DP will fix the problem with framerate not beeing updatet until hard e2 restart.

      Is there a issue that prevent iPlayableService.evVideoFramerateChanged not to update framerate alone?
      - FoxyRabbit - Peter Pan Team -

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von FoxyRabbit ()

    • Neu

      hmmm my local fix is the following:

      Unterschiede-Datei

      1. diff --git a/lib/python/Components/Converter/ServiceInfo.py b/lib/python/Components/Converter/ServiceInfo.py
      2. index 369da77..a3ab5e0 100644
      3. --- a/lib/python/Components/Converter/ServiceInfo.py
      4. +++ b/lib/python/Components/Converter/ServiceInfo.py
      5. @@ -44,7 +44,7 @@ class ServiceInfo(Converter, object):
      6. "TsId": (self.TSID, (iPlayableService.evUpdatedInfo,)),
      7. "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)),
      8. "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)),
      9. - "Framerate": (self.FRAMERATE, (iPlayableService.evVideoFramerateChanged,)),
      10. + "Framerate": (self.FRAMERATE, (iPlayableService.evVideoSizeChanged, iPlayableService.evVideoFramerateChanged)),
      11. "TransferBPS": (self.TRANSFERBPS, (iPlayableService.evUpdatedInfo,)),
      12. "HasSubtitles": (self.HAS_SUBTITLES, (iPlayableService.evUpdatedInfo,)),
      13. }[type]
      Alles anzeigen

      here this works okay.

      Can you confirm this?

      cu