Commit graph

283 commits

Author SHA1 Message Date
Wim Taymans
6b876ebf82 basesrc: add default fixate function
Add a default fixate function which does gst_caps_fixate() because
gst_pad_fixate() does not do that anymore.
2011-08-17 17:16:21 +02:00
Josep Torra
178bdccb76 Fix and clarify debug statements
Fixes build on MacOSX

Signed-off-by: Edward Hervey <edward.hervey@collabora.co.uk>
2011-08-10 11:01:58 +02:00
Wim Taymans
10485ea803 basesrc: add alloc vmethod
Make an alloc vmethod so that subclasses can override or call the default
implementation when they want.
2011-08-04 18:00:02 +02:00
Wim Taymans
dc096f39d1 basesrc: cleanups and mark reconfigure
Don't abuse the result variable.
Mark the srcpad with a reconfigure so that negotiation happens.
2011-08-04 17:12:47 +02:00
Wim Taymans
6bae6b8253 basesrc: remove negotiation from the state change
Remove the negotiation from the state change function, it causes data transfer
and bufferpool negotiation, which is not supposed to be done. Since we have the
reconfigure state on the pad, the create function will do the negotiation as
soon as it gets in the streaming thread.
2011-08-04 16:56:42 +02:00
Wim Taymans
fd75c12631 basesrc: expose set_caps method
Expose a previously static method so that custom negotiate implementation can
call it and do the right thing.
2011-08-04 16:34:49 +02:00
Wim Taymans
21ea3fdd96 basesrc: PAUSED<->PLAY doesn't change pool state
Don't change the state of the bufferpool when going between PAUSED and PLAYING,
it will dealloc and realloc all buffers, which is clearly too invasive. We will
need to add some other way of unblocking the bufferpool.
2011-08-04 13:48:11 +02:00
Tim-Philipp Müller
913e5e310c base: update for query API changes 2011-07-28 11:24:19 +01:00
Wim Taymans
6b0a490740 basesrc: add some more debug info 2011-07-26 14:37:51 +02:00
Wim Taymans
c887dd41f8 basesrc: use DEBUG instead of ERROR for logging
Don't use the ERROR log category because the allocation failure migh only be
bacause of a state change.
2011-07-25 12:49:24 +02:00
Wim Taymans
d23fc81c43 basesrc: don't accidentally disable the pool
When we set a pool and it is the same as the old pool, don't disable the pool.
2011-07-15 16:04:11 +01:00
Wim Taymans
c87375a813 basesrc: fix after merge 2011-07-07 11:14:34 +02:00
Wim Taymans
b171259612 Merge branch 'master' into 0.11
Conflicts:
	libs/gst/base/gstbasesrc.c
2011-07-07 11:13:19 +02:00
Mark Nauwelaerts
0993102834 basesrc: do not sneakily mess with current offset when updating length 2011-06-30 17:59:27 +02:00
Mark Nauwelaerts
c79f8a52af basesrc: unref allocation query when no longer needed 2011-06-28 22:18:46 +02:00
Wim Taymans
3884badea6 memory: rename GstMemoryAllocator -> GstAllocator
simplify the name of the allocator object.
2011-06-22 11:42:46 +02:00
Wim Taymans
9c3bd65ba7 basesrc: improve debugging 2011-06-21 17:47:23 +02:00
Wim Taymans
fc5b0b09da basesrc: always activate the pool we get
Activate the pool when we get it from the allocation query.
2011-06-20 17:32:11 +02:00
Wim Taymans
9c67925fb7 basesrc: Improve logging
Log when things fail.
Fix a query leak.
2011-06-20 16:53:04 +02:00
Wim Taymans
c4f35cb2e0 basesrc: fix refcounting problem 2011-06-15 16:56:30 +02:00
Wim Taymans
1ea2722180 Merge branch 'master' into 0.11 2011-06-13 19:10:00 +02:00
Wim Taymans
844e8aefaa basesrc: Allocator buffers from negotiated allocator
Allocate buffers from the negotiated allocator or bufferpool.
Handle the state of the bufferpool when flushing.
Add fill method to pushsrc.
2011-06-13 12:07:03 +02:00
Wim Taymans
3977991c9d basesrc: negotiate allocation
Add vmethod to configure allocation methods.
Remove some unused variables
2011-06-13 10:21:53 +02:00
Wim Taymans
94ae04f098 basesrc: use new _check_reconfigure() method 2011-06-10 17:32:48 +02:00
Wim Taymans
b27ee30a35 buffer: make new _buffer_allocate method
Make a new method to allocate a buffer + memory that takes the allocator and the
alignment as parameters. Provide a macro for the old method but prefer to use
the new method to encourage plugins to negotiate the allocator properly.
2011-06-10 13:49:23 +02:00
Tim-Philipp Müller
954bcb09c7 docs: update for gst_base_src_set_dynamic_size
Add to sections file and add Since: marker. Also update
win32 .def file.

API: gst_base_src_set_dynamic_size()
2011-06-10 12:45:37 +01:00
Wim Taymans
c35e0de65e basesrc: add fill vmethod to basesrc
Add a new fill virtual method to basesrc. The purpose of this method is to fill
a provided buffer with data.
Add a default implementation of the create method that allocates a buffer and
calls the fill method on it. This would allow the base class to implement
bufferpool and allocator negotiation on behalf of the subclasses.
Fix the blocksize property.
Make filesrc use the new fill method.
2011-06-10 13:04:23 +02:00
Wim Taymans
bbfec45ecc event: add reset_time boolean to flush_stop event
Add a boolean to the flush_stop event to make it possible to implement flushes
that don't reset_time.
Make basesink post async_done with the reset_time property from the flush stop
event.
Fix some unit tests
2011-06-10 11:55:08 +02:00
Wim Taymans
4d6e4ea9e6 Merge branch 'master' into 0.11
Conflicts:
	libs/gst/base/gstbasesrc.c
2011-06-09 12:01:02 +02:00
Mark Nauwelaerts
f8168cd75f basesrc: add dynamic size handling
This allows subclass to indicate that size reported by src may not be static
and should as such be updated regularly, rather than only when really
needed.

Particular examples are filesrc or fdsrc reading from a file that is still
growing (e.g. being downloaded).

Fixes #652037.
2011-06-08 20:16:25 +02:00
Mark Nauwelaerts
c040305b8c Revert "basesrc: Send an update NEWSEGMENT event downstream if the duration changes"
This reverts commit 934faf163c.

Original commit leads to possibly sending newsegment event downstream
in pull mode.  In push mode, quite some downstream elements
are likely to only expect newsegment event following a seek they performed
and as such may have their state messed up.
2011-06-08 20:14:16 +02:00
Tim-Philipp Müller
4b920eb5d2 docs: update for API changes
Also remove GST_PAD_CHECKGETRANGEFUNC macro
2011-06-05 18:57:56 +01:00
Wim Taymans
690c81b95d basesrc: remove deprecated clean shutdown method 2011-05-27 17:28:34 +02:00
Sebastian Dröge
26a5a877ff basesrc: Fix for SEGMENT event API changes 2011-05-27 14:02:37 +02:00
Sebastian Dröge
30a7fd7b4d Merge branch 'master' into 0.11 2011-05-27 13:58:26 +02:00
Sebastian Dröge
934faf163c basesrc: Send an update NEWSEGMENT event downstream if the duration changes
This allows streaming the complete file for files that have grown since
streaming started.

Fixes bug #647940.
2011-05-27 09:05:46 +02:00
Wim Taymans
7e6d579301 scheduling: port to new scheduling query 2011-05-24 17:39:56 +02:00
Wim Taymans
4e13568d27 basesrc: avoid calling _set_caps() on the srcpad
Avoid installing a setcaps function on the srcpad and calling the setcaps
function, we can do more efficiently with sending the event ourself and calling
our vmethod.
2011-05-21 19:06:08 +02:00
Sebastian Dröge
5f2cd2b0a3 base: Update for caps/pad template related API changes 2011-05-17 13:14:12 +02:00
Sebastian Dröge
3d2127f865 Revert "query: allow _make_writable on query handlers"
This reverts commit cf4fbc005c.

This change did not improve the situation for bindings because
queries are usually created, then directly passed to a function
and not stored elsewhere, and the writability problem with
miniobjects usually happens with buffers or caps instead.
2011-05-17 11:21:41 +02:00
Sebastian Dröge
b935a814d9 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	docs/gst/gstreamer-sections.txt
	gst/gstbin.c
	gst/gstelement.c
	gst/gstelement.h
	gst/gstghostpad.c
	gst/gstminiobject.c
	gst/gstminiobject.h
	libs/gst/base/gstbasesrc.c
	libs/gst/base/gstbasetransform.c
	plugins/elements/gstinputselector.c
	tests/check/gst/gstminiobject.c
2011-05-16 16:53:04 +02:00
Sebastian Dröge
bdf9022861 base: Improve negotiation with new getcaps() filter 2011-05-16 15:33:10 +02:00
Wim Taymans
bdbc069348 Rework GstSegment handling
Improve GstSegment, rename some fields. The idea is to have the GstSegment
structure represent the timing structure of the buffers as they are generated by
the source or demuxer element.
gst_segment_set_seek() -> gst_segment_do_seek()
Rename the NEWSEGMENT event to SEGMENT.
Make parsing of the SEGMENT event into a GstSegment structure.
Pass a GstSegment structure when making a new SEGMENT event. This allows us to
pass the timing info directly to the next element. No accumulation is needed in
the receiving element, all the info is inside the element.
Remove gst_segment_set_newsegment(): This function as used to accumulate
segments received from upstream, which is now not needed anymore because the
segment event contains the complete timing information.
2011-05-16 11:37:52 +02:00
Vincent Penquerc'h
03050fd71d basesrc: do not set first buffer timestamp to 0 for live sources
Doing so avoids a large timestamp gap between first and second buffer
for live sources which take time to start up.
The first buffer now has a "live" timestamp based on the running time,
as other buffers do.

https://bugzilla.gnome.org/show_bug.cgi?id=649369
2011-05-12 18:10:14 +01:00
Wim Taymans
cf4fbc005c query: allow _make_writable on query handlers
Pass a GstQuery ** to the query handlers so that they can make the query
writable before using a setter on it.
Port code to new API.
2011-05-10 18:36:33 +02:00
Wim Taymans
7f24a48387 event: _qos_full -> _qos 2011-05-09 18:48:55 +02:00
Wim Taymans
c07b57fc05 segment: remove _full version
Rename the _full versions of the functions to the normal function names.
2011-05-09 17:51:07 +02:00
Wim Taymans
02e5feb2bf pad: avoid using the old GST_PAD_CAPS
Don't use GST_PAD_CAPS but instead use the new gst_pad_get_current_caps()
method.
Avoid setting caps on buffers.
2011-05-06 19:04:54 +02:00
Sebastian Dröge
07f59f5404 basesrc: Use the reconfigure flag on the pad instead of the event 2011-05-05 15:20:02 +02:00
Sebastian Dröge
0179530bf1 basesrc: Only renegotiate once after receiving a renegotiate event
Also make this threadsafe.
2011-05-05 15:04:16 +02:00