diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2002-01-15 23:01:32 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2002-01-15 23:01:32 +0000 |
commit | da78b46b0518dd51264ddf4de8e0f6e5b42b7a63 (patch) | |
tree | dbccdfdac05fb94a36ec3951e6fb14368829c4ae /ext/sdl/sdlvideosink.c | |
parent | bf770df312016dc203cdf4c2609a61eff7479501 (diff) |
It works
Original commit message from CVS:
It works
Diffstat (limited to 'ext/sdl/sdlvideosink.c')
-rw-r--r-- | ext/sdl/sdlvideosink.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c index 6d9410c9b..672e63b45 100644 --- a/ext/sdl/sdlvideosink.c +++ b/ext/sdl/sdlvideosink.c @@ -241,7 +241,9 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink) if ( sdlvideosink->yuv_overlay == NULL ) { gst_element_error(GST_ELEMENT(sdlvideosink), - "SDL: Couldn't create SDL_yuv_overlay: %s", SDL_GetError()); + "SDL: Couldn't create SDL_yuv_overlay (%dx%d \'%4.4s\'): %s", + sdlvideosink->image_width, sdlvideosink->image_height, + (char*)&print_format, SDL_GetError()); return FALSE; } else @@ -281,6 +283,10 @@ gst_sdlvideosink_sinkconnect (GstPad *pad, sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad)); + /* we are not going to act on variable caps */ + if (!GST_CAPS_IS_FIXED (vscapslist)) + return GST_PAD_CONNECT_DELAYED; + for (caps = vscapslist; caps != NULL; caps = vscapslist = vscapslist->next) { /* check whether it's in any way compatible */ @@ -296,6 +302,11 @@ gst_sdlvideosink_sinkconnect (GstPad *pad, gst_caps_get_fourcc_int(caps, "format")); sdlvideosink->image_width = gst_caps_get_int(caps, "width"); sdlvideosink->image_height = gst_caps_get_int(caps, "height"); + + /* try it out */ + if (!gst_sdlvideosink_create(sdlvideosink)) + return GST_PAD_CONNECT_REFUSED; + return GST_PAD_CONNECT_OK; } } @@ -464,17 +475,10 @@ gst_sdlvideosink_change_state (GstElement *element) } GST_FLAG_SET (sdlvideosink, GST_SDLVIDEOSINK_OPEN); break; - case GST_STATE_READY_TO_PAUSED: - /* create a YUV overlay */ - if (!gst_sdlvideosink_create(sdlvideosink)) - return GST_STATE_FAILURE; - break; - case GST_STATE_PAUSED_TO_READY: + case GST_STATE_READY_TO_NULL: if (sdlvideosink->yuv_overlay) SDL_FreeYUVOverlay(sdlvideosink->yuv_overlay); sdlvideosink->yuv_overlay = NULL; - break; - case GST_STATE_READY_TO_NULL: SDL_Quit(); GST_FLAG_UNSET (sdlvideosink, GST_SDLVIDEOSINK_OPEN); break; |