Getting video width / height

Tim-Philipp Müller t.i.m at
Mon Apr 8 01:46:07 PDT 2013

On Sun, 2013-04-07 at 17:57 -0700, Kip Warner wrote:


> It works fine, but I'd like to understand better what the get_state call
> and its magic number parameter is doing? I'm guessing you are trying to
> buffer enough data for the video's metadata (e.g. width / height) to
> have been extracted from the stream? But as usual, when I check
> get_state's documentation, it leaves me wanting:
> <>
> It doesn't look like it takes a parameter, or maybe it's overridden at
> a higher level? Or am I just totally reading the API documentation
> wrong? The link is, after all, for the old Python 2 bindings.

I'd just use the C docs instead of the old python binding docs which
were considered lacking even when they were current.

It's used here to block/wait until the state change to paused/playing is
complete. In a proper application a better way would be to wait for an
ASYNC_DONE message on the bus and then do whatever you want to query
from there.


More information about the gstreamer-devel mailing list