Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-04 Thread Tomeu Vizoso
On Thu, Nov 3, 2011 at 19:55, Angel Guzman Maeso  wrote:
> But apparently, the first problem comes, I need compile gir files for create
> the typelib files.

Both .gir and .typelib files should be generated during the build
process. Check config.log for reasons why this didn't happened (if
that's the case).

> This is fun because I am learning a lot, but it's time-consuming, because
> nobody before write some article, wiki or doc for make easy and painful the
> process.
> Only maintainers have the knowledge enough for make this quickly, but they
> don't like make docs. it seems a general problem.

In some projects maintainers have more time than in others. In
PyGObject we have right now a big lack of contributors with
consequences far worse than lack of documentation.

That said, your problem is with GStreamer, you should ask there. And
probably you aren't finding documentation because 0.11 is a
development release.

> I will send more info if I get compile the 0.11.1 version successfully,
> because some people with the same problem is writing me emails about the
> current status of this.

The most efficient way to make all this less painful is to contribute
documentation upstream, because that's where people expect to find it.

Regards,

Tomeu

> Regards.
>
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-03 Thread Angel Guzman Maeso
2011/11/2 Tomeu Vizoso 

> OYou don't need gst-python any more, that's the point of the move to
> introspection: https://live.gnome.org/GObjectIntrospection/Architecture
>
> For building gstreamer master from git: http://gstreamer.freedesktop.org/
>
> Good luck,
>
> Tomeu
>

Hi again,

This is my current progress at the moment.

I try to compile gstreamer 0.11.1 on Ubuntu Oneiric 11.10 with this:

sudo apt-get install bison flex
wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.11.1.tar.gz
tar -xvzf gstreamer-*.tar.gz
cd gstreamer-*
./configure
sudo make
sudo make install

All succesfully. This install the binaries under /usr/local/

But apparently, the first problem comes, I need compile gir files for
create the typelib files.

I see on the package gir1.2-gstreamer-0.10 for Ubuntu, that I need at least
all this typelib files:

/usr/lib/girepository-1.0/Gst-0.10.typelib
/usr/lib/girepository-1.0/GstBase-0.10.typelib
/usr/lib/girepository-1.0/GstCheck-0.10.typelib
/usr/lib/girepository-1.0/GstController-0.10.typelib
/usr/lib/girepository-1.0/GstNet-0.10.typelib

http://packages.ubuntu.com/es/precise/gir1.2-gstreamer-0.10
http://packages.ubuntu.com/es/precise/i386/gir1.2-gstreamer-0.10/filelist

So I don't know until now where get that .gir files or how to generate the
gir files for 0.11.

Apparently gir files is like an XML format with the migration spec.

Then I should compile the files with something like for generate the
typelib files:

/opt/pygi/bin/g-ir-compiler --includedir=. --includedir=.
 /usr/share/gir-1.0/Gst-0.10.gir -o
/usr/lib/girepository-1.0/Gst-0.10.typelib

http://manpages.ubuntu.com/manpages/natty/man1/g-ir-compiler.1.html

I don't know where find documentation for this process, just I google for
known words and found things like this for extract knowledge:
http://pastebin.com/jUP0aLEH

The info is very spread and nobody writes a documented procedure for this.

I found on http://live.gnome.org/GnomeGoals/AddGObjectIntrospectionSupportthat
Gstreamer have support done for instrospection, but no reference
that how to do it.

So I keep google for hours and I found this, that it show me a little how
to generate the .gir files with g-ir-scanner:

http://wksprivate.appspot.com/pastebin/detail-js/9060/

/usr/local/bin/g-ir-scanner -v --namespace Gst --nsversion=0.10 \
283.
--add-include-path=. --add-include-path=. \
284.
--include=GObject-2.0 \
285.
--include=GModule-2.0 \
286.
--include=libxml2-2.0 \
287.
--library=gstbase-0.10 \
288.
--libtool="/bin/sh ../libtool" \
289.
--pkg gobject-2.0 \
290.
--pkg gstreamer-0.10 \
291.
--pkg gstreamer-base-0.10 \
292.
--output Gst-0.10.gir \
293.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstbin.h \
294.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstbuffer.h \
295.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstbus.h \
296.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstcaps.h \
297.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstchildproxy.h \
298.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstclock.h \
299.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstcompat.h \
300.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstconfig.h \
301.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstdebugutils.h \
302.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstelementfactory.h \
303.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstelement.h \
304.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstenumtypes.h \
305.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gsterror.h \
306.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstevent.h \
307.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstfilter.h \
308.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstformat.h \
309.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstghostpad.h \
310.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gst.h \
311.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstindexfactory.h \
312.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstindex.h \
313.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstinfo.h \
314.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstinterface.h \
315.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstiterator.h \
316.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstmacros.h \
317.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstmarshal.h \
318.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstmessage.h \
319.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstminiobject.h \
320.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstobject.h \
321.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstpad.h \
322.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstpadtemplate.h \
323.
`pkg-config --variable=includedir gstreamer-0.10`/gst/gstparamspecs.h \
324.
`pkg-config --variable=includedir gstreamer-0.10`/gst/

Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-02 Thread Tomeu Vizoso
On Tue, Nov 1, 2011 at 20:04, Angel Guzman Maeso  wrote:
> 2011/11/1 Tomeu Vizoso 
>>
>> On Tue, Nov 1, 2011 at 19:37, Angel Guzman Maeso 
>> wrote:
>> > Where I can find 0.11 (1.0) for download and compile on Ubuntu? I need
>> > to
>> > fix this ASAP (I am doing a app for my dissertation).
>>
>> If you are in such a hurry, may be better to stay with the old static
>> bindings.
>>
>> Regards,
>>
>> Tomeu
>
> But all my app already works with Gtk3 (it took me a week) and I want use
> GTK3, so if it is needed compile new sources no problem for me, just I need
> the info.
> Could you provide me more info about 0.11?
> I clone this repo:
> git clone git://anongit.freedesktop.org/gstreamer/gst-python

You don't need gst-python any more, that's the point of the move to
introspection: https://live.gnome.org/GObjectIntrospection/Architecture

For building gstreamer master from git: http://gstreamer.freedesktop.org/

Good luck,

Tomeu
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-01 Thread Angel Guzman Maeso
2011/11/1 Tomeu Vizoso 

> On Tue, Nov 1, 2011 at 19:37, Angel Guzman Maeso 
> wrote:
> > Where I can find 0.11 (1.0) for download and compile on Ubuntu? I need to
> > fix this ASAP (I am doing a app for my dissertation).
>
> If you are in such a hurry, may be better to stay with the old static
> bindings.
>
> Regards,
>
> Tomeu
>

But all my app already works with Gtk3 (it took me a week) and I want use
GTK3, so if it is needed compile new sources no problem for me, just I need
the info.

Could you provide me more info about 0.11?

I clone this repo:

git clone git://anongit.freedesktop.org/gstreamer/gst-python
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-01 Thread Tomeu Vizoso
On Tue, Nov 1, 2011 at 19:37, Angel Guzman Maeso  wrote:
> Where I can find 0.11 (1.0) for download and compile on Ubuntu? I need to
> fix this ASAP (I am doing a app for my dissertation).

If you are in such a hurry, may be better to stay with the old static bindings.

Regards,

Tomeu
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-01 Thread Angel Guzman Maeso
2011/11/1 Tomeu Vizoso 

> Hi,
>
> what version of GStreamer are you using? I think only 0.11 (future
> 1.0) can be used through introspection. There are other programs that
> are being ported to introspection and that use GStreamer, such as
> Pitivi, I would look at them for ideas.
>
> Regards,
>
> Tomeu


Hi, I am using Ubuntu 10.10 Oneiric. The default version of GStreamer seems
to be 0.10

$ ls /usr/share/gir-1.0/ | grep Gst
Gst-0.10.gir
GstApp-0.10.gir
GstAudio-0.10.gir
GstBase-0.10.gir
GstCheck-0.10.gir
GstController-0.10.gir
GstFft-0.10.gir
GstInterfaces-0.10.gir
GstNet-0.10.gir
GstNetbuffer-0.10.gir
GstPbutils-0.10.gir
GstRiff-0.10.gir
GstRtp-0.10.gir
GstRtsp-0.10.gir
GstSdp-0.10.gir
GstTag-0.10.gir
GstVideo-0.10.gir

Where I can find 0.11 (1.0) for download and compile on Ubuntu? I need to
fix this ASAP (I am doing a app for my dissertation).
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-01 Thread Tomeu Vizoso
Hi,

what version of GStreamer are you using? I think only 0.11 (future
1.0) can be used through introspection. There are other programs that
are being ported to introspection and that use GStreamer, such as
Pitivi, I would look at them for ideas.

Regards,

Tomeu

On Tue, Nov 1, 2011 at 12:05, Angel Guzman Maeso  wrote:
> 2011/10/29 Pietro Battiston 
>>
>> Il giorno sab, 29/10/2011 alle 10.57 +0200, Angel Guzman Maeso ha
>> scritto:
>> > Please, anybody can help me? I search on pygstreamer and GIR files
>> > code and changelog and there is not reference for changes related with
>> > syn-message::element.
>>
>> Nothing to do with the "This signal will not be emitted by default, you
>> have to set up gst_bus_sync_signal_handler() as a sync handler if you
>> want this signal to be emitted when a message is posted on the bus, like
>> this:" I read in the documentation?
>> (just a guess, I'm not an expert about gstreamer)
>>
>> Pietro
>>
>
> Hi Pietro,
>
> Thanks for your response.
>
> Your response seems to be right, but it doesn't work on GTK3 with PyGi
>
> This line should enable the signal for the emission.
>
> bus.enable_sync_message_emission()
>
> The Gnome Bug #631901 shows that there is a problem with the signals
> emitted:
>
> https://bugzilla.gnome.org/show_bug.cgi?id=631901
>
> message::eos, message::error and sync-message::element are not emitted, just
> "message" and "sync-message" without members.
>
> Maybe it is a problem with MiniObject support through GI.
>
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMiniObject.html#GstMiniObject
>
> Using bus.connect('message', self.on_message)
>
> and
> def on_message(self, bus, message):
>     print('message: {!r}'.format(message))
>
> it show this traceback on close:
>
> Traceback (most recent call last):
>   File "test.py", line 62, in on_message
>     print('message: {!r}'.format(message))
> TypeError: unknown type GstMessage
>
> Also I found:
>
> "gst_bus_create_watch, since GSource aren't wrapped in pygtk
> gst_bus_sync_signal_handler and gst_bus_async_signal_func since
> these functions are used by the default bus handler anyway."
>
> http://ftp.tuwien.ac.at/hci/freedesktop.org/gstreamer/gst-python/gst/gstbus.override,v
>
>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-11-01 Thread Angel Guzman Maeso
2011/10/29 Pietro Battiston 

> Il giorno sab, 29/10/2011 alle 10.57 +0200, Angel Guzman Maeso ha
> scritto:
> > Please, anybody can help me? I search on pygstreamer and GIR files
> > code and changelog and there is not reference for changes related with
> > syn-message::element.
>
> Nothing to do with the "This signal will not be emitted by default, you
> have to set up gst_bus_sync_signal_handler() as a sync handler if you
> want this signal to be emitted when a message is posted on the bus, like
> this:" I read in the documentation?
> (just a guess, I'm not an expert about gstreamer)
>
> Pietro
>
>
Hi Pietro,

Thanks for your response.

Your response seems to be right, but it doesn't work on GTK3 with PyGi

This line should enable the signal for the emission.

bus.enable_sync_message_emission()

The Gnome Bug #631901 shows that there is a problem with the signals
emitted:

https://bugzilla.gnome.org/show_bug.cgi?id=631901

message::eos, message::error and sync-message::element are not emitted,
just "message" and "sync-message" without members.

Maybe it is a problem with MiniObject support through GI.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMessage.html
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMiniObject.html#GstMiniObject

Using bus.connect('message', self.on_message)

and
def on_message(self, bus, message):
print('message: {!r}'.format(message))

it show this traceback on close:

Traceback (most recent call last):
  File "test.py", line 62, in on_message
print('message: {!r}'.format(message))
TypeError: unknown type GstMessage

Also I found:

"gst_bus_create_watch, since GSource aren't wrapped in pygtk
gst_bus_sync_signal_handler and gst_bus_async_signal_func since
these functions are used by the default bus handler anyway."

http://ftp.tuwien.ac.at/hci/freedesktop.org/gstreamer/gst-python/gst/gstbus.override,v
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-10-29 Thread Pietro Battiston
Il giorno sab, 29/10/2011 alle 10.57 +0200, Angel Guzman Maeso ha
scritto:
> Please, anybody can help me? I search on pygstreamer and GIR files
> code and changelog and there is not reference for changes related with
> syn-message::element.

Nothing to do with the "This signal will not be emitted by default, you
have to set up gst_bus_sync_signal_handler() as a sync handler if you
want this signal to be emitted when a message is posted on the bus, like
this:" I read in the documentation?
(just a guess, I'm not an expert about gstreamer)

Pietro

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] PyObject fails with Gst on signal sync-message::element

2011-10-29 Thread Angel Guzman Maeso
Please, anybody can help me? I search on pygstreamer and GIR files code and
changelog and there is not reference for changes related with
syn-message::element.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] PyObject fails with Gst on signal sync-message::element

2011-10-27 Thread Angel Guzman Maeso
Hi everyone,

I am migrating a old code written with GTK+ 2.X to GTK 3+ for play a .ogv
video with gstreamer.

The problem seems that the signal "sync-message::element" is never launched
(but if it is launched sync-message).
So, as result we cannot attach a Gtk.DrawingArea() inside of another window
because I dont get never the window.xid

This is the old code for GTK+ 2.x working perfectly:


import pygtk
pygtk.require('2.0')
import gtk
import pygst
pygst.require('0.10')
import gst
import os, sys

class Video:

def __init__(self):

def on_message(bus, message):
if message.type == gst.MESSAGE_EOS:
# End of Stream
player.set_state(gst.STATE_NULL)
elif message.type == gst.MESSAGE_ERROR:
player.set_state(gst.STATE_NULL)
(err, debug) = message.parse_error()
print "Error: %s" % err, debug

def on_sync_message(bus, message):
if message.structure is None:
return False
if message.structure.get_name() == "prepare-xwindow-id":
if sys.platform == "win32":
win_id = videowidget.window.handle
else:
win_id = videowidget.window.xid
assert win_id

gtk.gdk.threads_enter()
gtk.gdk.display_get_default().sync()
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)
imagesink.set_xwindow_id(win_id)
gtk.gdk.threads_leave()

win = gtk.Window()
win.set_resizable(False)
win.set_has_frame(False)
win.set_position(gtk.WIN_POS_CENTER)

fixed = gtk.Fixed()
win.add(fixed)
fixed.show()

videowidget = gtk.DrawingArea()
fixed.put(videowidget, 0, 0)
videowidget.set_size_request(640, 480)
videowidget.show()

# Setup GStreamer
player = gst.element_factory_make("playbin", "MultimediaPlayer")
bus = player.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()
#used to get messages that GStreamer emits
bus.connect("message", on_message)
#used for connecting video to your application
bus.connect("sync-message::element", on_sync_message)
player.set_property("uri", "file://" + "/SOME/PATH/SOMEFILE.ogv")
player.set_state(gst.STATE_PLAYING)

win.show()

def main():
gtk.gdk.threads_init()
gtk.main()
return 0

if __name__ == "__main__":
Video()
main()


And this is the new code for GTK+ 3 not working properly because xid it is
not attached creating another window:

import gi
gi.require_version('Gtk', '3.0')

from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import Gdk

import os, sys

class Video:

def __init__(self):

win = Gtk.Window()
win.set_resizable(False)
#win.set_has_frame(False) I dont know the name of method on gtk3 so
comment this
#win.set_position(Gtk.WIN_POS_CENTER) same but with the constant

fixed = Gtk.Fixed()
win.add(fixed)
fixed.show()

videowidget = Gtk.DrawingArea()
fixed.put(videowidget, 0, 0)
videowidget.set_size_request(640, 480)
videowidget.show()

# Setup GStreamer
Gst.init_check(None)
self.player = Gst.ElementFactory.make("playbin", "MultimediaPlayer")
self.player.set_state(Gst.State.NULL)
bus = self.player.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()
#used to get messages that GStreamer emits
bus.connect('message::eos', self.on_message_eos)
bus.connect('message::error', self.on_message_error)
#used for connecting video to your application
bus.connect("sync-message::element", self.on_sync_message)
self.player.set_property("uri", "file://" +
"/SOME/PATH/SOMEFILE.ogv")
self.player.set_state(Gst.State.PLAYING)

win.show()
def on_message_eos(self, bus, message):
# End of Stream
self.player.set_state(Gst.State.NULL)

def on_message_error(self, bus, message):
# End of Stream
self.player.set_state(Gst.State.NULL)
print 'Error'

def on_sync_message(self, bus, message):
print "hola"
"""if message.structure is None:
return False
if message.structure.get_name() == "prepare-xwindow-id":
if sys.platform == "win32":
   win_id = videowidget.window.handle
else:
win_id = videowidget.window.xid
assert win_id

Gdk.threads_enter()
Gdk.display_get_default().sync()
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)
imagesink.set_xwindow_id(win_id)
Gd