Changeset 53255 in webkit
- Timestamp:
- Jan 14, 2010 3:40:18 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53252 r53255 1 2009-12-09 Philippe Normand <pnormand@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GStreamer] Check return values of gst_element_set_state() 6 https://bugs.webkit.org/show_bug.cgi?id=30000 7 8 Check for state change failure when going from READY/NULL to 9 PAUSED or PLAYING. Also refactored the common code of play() and 10 pause() to a new private method of the player. 11 12 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: 13 (WebCore::MediaPlayerPrivate::changePipelineState): 14 (WebCore::MediaPlayerPrivate::play): 15 (WebCore::MediaPlayerPrivate::pause): 16 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h: 17 1 18 2010-01-14 Eric Seidel <eric@webkit.org> 2 19 -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
r53244 r53255 143 143 } 144 144 145 145 146 void mediaPlayerPrivateRepaintCallback(WebKitVideoSink*, GstBuffer *buffer, MediaPlayerPrivate* playerPrivate) 146 147 { … … 260 261 } 261 262 263 bool MediaPlayerPrivate::changePipelineState(GstState newState) 264 { 265 ASSERT(newState == GST_STATE_PLAYING || newState == GST_STATE_PAUSED); 266 267 GstState currentState; 268 GstState pending; 269 270 gst_element_get_state(m_playBin, ¤tState, &pending, 0); 271 if (currentState != newState && pending != newState) { 272 GstStateChangeReturn ret = gst_element_set_state(m_playBin, newState); 273 GstState pausedOrPlaying = newState == GST_STATE_PLAYING ? GST_STATE_PAUSED : GST_STATE_PLAYING; 274 if (currentState != pausedOrPlaying && ret == GST_STATE_CHANGE_FAILURE) { 275 loadingFailed(MediaPlayer::Empty); 276 return false; 277 } 278 } 279 return true; 280 } 281 262 282 void MediaPlayerPrivate::play() 263 283 { 264 GstState state; 265 GstState pending; 266 267 gst_element_get_state(m_playBin, &state, &pending, 0); 268 if (state != GST_STATE_PLAYING && pending != GST_STATE_PLAYING) { 284 if (changePipelineState(GST_STATE_PLAYING)) 269 285 LOG_VERBOSE(Media, "Play"); 270 gst_element_set_state(m_playBin, GST_STATE_PLAYING);271 }272 286 } 273 287 274 288 void MediaPlayerPrivate::pause() 275 289 { 276 GstState state; 277 GstState pending; 278 279 gst_element_get_state(m_playBin, &state, &pending, 0); 280 if (state != GST_STATE_PAUSED && pending != GST_STATE_PAUSED) { 290 if (changePipelineState(GST_STATE_PAUSED)) 281 291 LOG_VERBOSE(Media, "Pause"); 282 gst_element_set_state(m_playBin, GST_STATE_PAUSED);283 }284 292 } 285 293 -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
r53244 r53255 121 121 122 122 void createGSTPlayBin(String url); 123 bool changePipelineState(GstState state); 123 124 124 125 private:
Note: See TracChangeset
for help on using the changeset viewer.