[gst-devel] Suggestion needed while Metadata Reading & Writing to a large files via Gstreamer
suman kolaganti
suman.subj at gmail.com
Wed Mar 10 17:26:55 CET 2010
Dear Team,
I am involved in development of UI program that reads & writes metadata to
a video MP4 files.
Reading & writing is done by lower level library, apart from UI program,
which also implemented by me.
This is the design implementation from lower-library is to read
metadata from a video:
1.
using a g_main_loop_new (NULL, FALSE);
--> with default context
2.
getting a bus from a pipeline & adding a bus watch for the
gst_messages and upon EOS / in-case any error /Paused state , iam
quitting the mainloop.
bus = gst_pipeline_get_bus (GST_PIPELINE (self->pipeline));
gst_bus_add_watch (bus, bus_call, (gpointer)self);
3. The UI program is inturn having a g_main_loop and invoking this
lower-library api for reading & writing the metadata .
There are asyncrounous things happening .Reasons:
i) since in case of large video files the lower-library is taking long
time while reading or witing metadata .
ii) mean while if we do any UI operations ..let us say suppose the
same file is deleted . In this case .. before the control commes out
of that lower-level api , the file is subjected to delete .
this resulting in improper behavior .
Is there any possibility of the 2 gmainloops mixing with each other ..?
Is there any alternative ..so that we can remove the g_main_loop
from lower-libray and use some other approach ?
How to avoid g_main_loop in lower level Library ?can i replace with any..?
How can i make this syncronous ?
i tried with few :
1.
creating new context in lowwer-library :
I tried with context = g_main_context_new() and creating the loop =
g_main_loop_new(context,FALSE) with that context .
resulting in freezing upon g_main_loop_run(loop).
2.
Instead of gst_bus_add_watch() , i used gst_bus_add_signal_watch ()
as shown below :
here i removed g_main_loop & used g_main_iteration() Api until EOS/Error
Stability of the reading/writing tags is undefined, some times this
works & some it wont .
3)link:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-bus.html
last 2 lines states that :
If you aren't using GLib mainloop, the asynchronous message signals won't
be available by default. You can however install a custom sync handler
that wakes up the custom mainloop and that uses
gst_bus_async_signal_func () to emit the signals.
(see also documentation
<http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstBus.html>
for details)
didnt get the idea ,how to implement this async handler ..
Please suggest ...
4)
Please suggest if any more ideas ...
Thanks & Regards,
suman.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100310/ed105f79/attachment.htm>
More information about the gstreamer-devel
mailing list