2005年5月17日

Scale Gstreamer Video with GTK+

改变 Gstreamer 视频在 gtk drawingarea 的大小,比例。



Spent days on how to let a gstreamer video sink know that the video window size was changed. Finally, I realized that I missed a line of code in totem that just did this.



In order to have the video in gstreamer respect the aspect ratio of a video, you have to put the video window (normally a gtk drawingarea) inside a gtk aspectframe. However, after the aspectframe is resized to follow the video aspect ratio, you have to call video_sink.expose() in order for the video sink to resize itself. I am using gstreamer python binding, of course. So many 'have to's that are not documented!



The expose() method is an method of interface GstXOverlay. So any video sink that implements the interface should have a expose() method (gstream name is gst_x_overlay_expose(xid). Sucks, huh?)

没有评论: