Opened 9 years ago

Closed 9 years ago

#5024 closed defect (fixed)

GSteamer 1.0 should be initialized only when required

Reported by: Boris Bobrov Owned by:
Priority: critical Milestone: 0.8.0
Component: programming Keywords: gstreamer
Cc: Parent Tickets:

Description

GStreamer 1.0 is sometimes initialized even when video or audio are not enabled. This leads to exceptions if it is not installed.

Change History (10)

comment:1 by Boris Bobrov, 9 years ago

Status: newin_progress

comment:3 by Boris Bobrov, 9 years ago

Owner: Boris Bobrov removed
Status: in_progressreview

comment:4 by berkerpeksag, 9 years ago

It would be good to add a user friendly message if gstreamer is not installed:

Something like

try:
    import gi
    # another imports
except ImportError:
    _log.error("gstreamer is not installed. Please run 'some package manager info here' first.")
else:
    gi.require_version('Gst', '1.0')
    Gst.init(None)

in reply to:  4 comment:5 by Boris Bobrov, 9 years ago

Replying to berkerpeksag:

It would be good to add a user friendly message if gstreamer is not installed:

Something like

try:
    import gi
    # another imports
except ImportError:
    _log.error("gstreamer is not installed. Please run 'some package manager info here' first.")
else:
    gi.require_version('Gst', '1.0')
    Gst.init(None)

It's not easy. Not installed gi is just one of reasons it can fail. In fact, every line there can fail due to various reasons.

I agree that user-friendly message should be added, but it should be done in a separate patchset. There is also a doc telling how to enable audio and video that require GStreamer 1.0.

comment:6 by Christopher Allan Webber, 9 years ago

I added a new ticket, #5055... please put suggestions on how to improve such warnings there!

comment:7 by Boris Bobrov, 9 years ago

cwebber, there is a fix in comment 2. I suggest to close the bug, because it is now fixed for those people who don't use video or audio.

comment:8 by Jessica Tallon, 9 years ago

I am getting an awful lot of unit test errors when gstreamer is not installed due to the "mediagoblin/media_types/video/transcoders.py" file.

comment:9 by berkerpeksag, 9 years ago

Boris' patch LGTM. I will apply it shortly if no one beats me to it.

comment:10 by berkerpeksag, 9 years ago

Resolution: fixed
Status: reviewclosed

Looks like it's already committed, so closing this as "fixed".

Note: See TracTickets for help on using tickets.