RESOLVED FIXED 30000
[GStreamer] Check return values of gst_element_set_state()
https://bugs.webkit.org/show_bug.cgi?id=30000
Summary [GStreamer] Check return values of gst_element_set_state()
Sebastian Dröge (slomo)
Reported 2009-10-02 01:32:13 PDT
Hi, currently the media player doesn't check the return values of gst_element_set_state(). It should really do that. If it's SUCCESS, NO_PREROLL or ASYNC everything is fine (errors will be posted as bus message), if it's FAILURE things should fail immediately (there will be no error messages on the bus in the worst case). This is only for state changes from NULL or READY to PAUSED or PLAYING. Downwards state changes can fail but you're usually not interested in that.
Attachments
Check return values of gst_element_set_state() (2.72 KB, patch)
2009-12-07 03:29 PST, Philippe Normand
eric: review-
Check for state change failure when going from READY/NULL to PAUSED or PLAYING. (4.04 KB, patch)
2009-12-09 01:05 PST, Philippe Normand
no flags
Check for state change failure when going from READY/NULL to PAUSED or PLAYING. (4.18 KB, text/plain)
2009-12-15 08:55 PST, Philippe Normand
no flags
Check for state change failure when going from READY/NULL to PAUSED or PLAYING. (4.18 KB, patch)
2009-12-15 09:06 PST, Philippe Normand
xan.lopez: review+
Philippe Normand
Comment 1 2009-12-07 03:29:38 PST
Created attachment 44398 [details] Check return values of gst_element_set_state() when going from READY/NULL to PAUSED or PLAYING.
WebKit Review Bot
Comment 2 2009-12-07 03:31:55 PST
style-queue ran check-webkit-style on attachment 44398 [details] without any errors.
Eric Seidel (no email)
Comment 3 2009-12-08 11:26:29 PST
Comment on attachment 44398 [details] Check return values of gst_element_set_state() It seems play and pause could share all of their code here in a single method which took either GST_STATE_PAUSED or GST_STATE_PLAYING. I think that would be cleaner long-term.
Philippe Normand
Comment 4 2009-12-09 01:05:43 PST
Created attachment 44519 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING.
Eric Seidel (no email)
Comment 5 2009-12-14 13:01:37 PST
Comment on attachment 44519 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING. OK. There is one slight change in logging behavior here, it won't log Play if the switch to play fails. I don't think that matters though. Style violation: 121 bool changePipelineState(GstState state); we don't name arguments when the name doesn't add anything. Shouldn't changePipelineState be private? And why is it called "pipeline state"? It would appear that this function only works for either PLAY or PAUSE, but I don't see you asserting that anywhere. You might want to ASSERT the inputs.
Philippe Normand
Comment 6 2009-12-15 08:55:15 PST
Created attachment 44879 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING. Check for state change failure When going from READY/NULL to PAUSED or PLAYING.
Philippe Normand
Comment 7 2009-12-15 08:56:31 PST
Comment on attachment 44879 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING. Sorry that one is broken
Philippe Normand
Comment 8 2009-12-15 09:01:47 PST
(In reply to comment #5) > (From update of attachment 44519 [details]) > OK. There is one slight change in logging behavior here, it won't log Play if > the switch to play fails. I don't think that matters though. > > Style violation: > 121 bool changePipelineState(GstState state); > we don't name arguments when the name doesn't add anything. Well the variable is used in the code, I will name it newState, which adds "new" :) > > Shouldn't changePipelineState be private? > It is already a private method. Did I do something wrong? > And why is it called "pipeline state"? > This is the GStreamer vocabulary, the pipeline is composed of elements, linked etween themselves. To start playback you set the pipeline state to PLAYING, the state change propagates through the elements of the pipeline. > It would appear that this function only works for either PLAY or PAUSE, but I > don't see you asserting that anywhere. You might want to ASSERT the inputs. Will do ;) Thanks for the review, I will send a new patch.
Philippe Normand
Comment 9 2009-12-15 09:06:39 PST
Created attachment 44880 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING. When going from READY/NULL to PAUSED or PLAYING.
WebKit Review Bot
Comment 10 2009-12-16 02:02:44 PST
style-queue ran check-webkit-style on attachment 44880 [details] without any errors.
Xan Lopez
Comment 11 2010-01-14 03:14:38 PST
Comment on attachment 44880 [details] Check for state change failure when going from READY/NULL to PAUSED or PLAYING. Makes sense, although I guess it would be best to somehow inform the user instead of silently doing nothing? It can be done in a follow-up though.
Philippe Normand
Comment 12 2010-01-14 03:41:06 PST
Landed as r53255. Thanks!
Note You need to log in before you can comment on or make changes to this bug.