Find images in audio files

Handle Gst.Sample as image in audio file tags (scaned with Gst1.0).
This commit is contained in:
Jens Luetjen 2016-02-27 11:24:04 +01:00 committed by Thomas Adamcik
parent 1e8bef25d3
commit f0788515cd

View File

@ -53,6 +53,12 @@ gstreamer-GstTagList.html
result[tag].append(value.decode('utf-8', 'replace'))
elif isinstance(value, (compat.text_type, bool, numbers.Number)):
result[tag].append(value)
elif isinstance(value, Gst.Sample):
buf = value.get_buffer()
(found, mapinfo) = buf.map(Gst.MapFlags.READ)
if found:
result[tag].append(bytes(mapinfo.data))
buf.unmap(mapinfo)
else:
logger.log(
log.TRACE_LOG_LEVEL,