summaryrefslogtreecommitdiff
path: root/sys/v4l2/gstv4l2bufferpool.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-02update for meta api changeWim Taymans1-15/+15
2011-08-25port to new video flagsWim Taymans1-2/+2
2011-08-04v4l2: activate the pool in fallbackWim Taymans1-8/+42
When nobody is using our pool, activate it ourselves. Avoid leaking the buffer array. Set default pool configuration with caps. Don't keep current_caps, core does that for us now.
2011-07-29v4l: change for new APIWim Taymans1-1/+3
2011-07-27v4l2: remove unused variablesWim Taymans1-10/+10
Use the more specialized type for the bufferpool. Use the size from the driver as the size of the image to read. Don't configure the pool when created. This will be done in the setup_allocation method later or by upstream for sinks. Remove unused properties and variables. Bufferpool sizes are now configured in the bufferpool by the elements in the pipeline. We might want to influence the pool size later somehow.
2011-07-27bufferpool: check for metadataWim Taymans1-2/+27
Only add video metadata when it was configured in the pool. Fail if there was no video metadata configured and the strides are not the default ones.
2011-07-26v4l2: implement more bits of RW I/O modeWim Taymans1-14/+30
Implement the relaese of RW buffers in the pool. Warn for unsupported write() mode for sinks.
2011-07-25v4l2: remove unused methodWim Taymans1-17/+0
2011-07-25v4l2: fix flushing start and stopWim Taymans1-2/+6
Move the flushing calls to the right place in the bufferpool. Fix the min and max buffer sizes.
2011-07-25v4l2: dequeue buffers when all are queuedWim Taymans1-32/+27
Prefer to always use the default bufferpool queue for the _acquire function because it properly supports unblocking when setting inactive etc. As a result, we need to dequeue buffers and put them back in the bufferpool queue when we have queued all buffers in the sink. Rename some variables to more meaningfull names to avoid a problem with freeing the wrong amount of buffers.
2011-07-25v4l2: only to STREAMOFF when streamingWim Taymans1-16/+17
Only call STREAMOFF when we previously called STREAMON
2011-07-19v4l2: Fix sink bufferpool handlingWim Taymans1-57/+90
Remove old method, use neww _process method for the sink. Inform the parent bufferpool class about the settings too. This is needed to let it know about the max-buffers. Allocate the negotiated max-buffers and initially mmap min-buffers. The idea is that the bufferpool will allocate more when needed. Improve debugging. Only poll in capture mode, it does not seem to work in playback mode on this beagleboard.
2011-07-18v4l2: More work on bufferpoolsWim Taymans1-134/+536
Add different transport methods to the bufferpool (MMAP and READ/WRITE) Do more parsing of the bufferpool config. Start and stop streaming based on the bufferpool state. Make separate methods for getting a buffer from the pool and filling it with data. This allows us to fill buffers from other pools too. Either use copy or read to fill up the target buffers. Add property to force a transfer mode in v4l2src. Increase default number of buffers to 4. Negotiate bufferpool and its properties in v4l2src.
2011-07-18bufferpool: improve _new functionWim Taymans1-7/+6
2011-07-15v4l2: handle dequeueing correclyWim Taymans1-7/+9
First clean up the buffers in the queue, then the remaining ones in the device.
2011-07-15v4l2: dequeue buffers for the sinkWim Taymans1-18/+28
When we have all buffers queued for playback and we need a new empty buffer, dequeue one and return it. Set the right size for sink buffers. Improve counting of queued buffers.
2011-07-15v4l2: use the parent queue for the sinkWim Taymans1-12/+37
We want to maintain a queue of free buffers for the sink, use the parent methods to do that.
2011-07-15v4l2: fix error messagesWim Taymans1-19/+14
2011-07-15v4l2: convert to GstBufferPoolWim Taymans1-318/+290
Extend from GstBufferPool. Handle the lifetime of the pool buffers correctly with the start/stop vmethods. Map acquire and release directly to QBUF and DQBUF. We still expose an explicit qbuf for the v4l2sink for now.
2011-07-13v4l2: don't store stride in the videoinfoWim Taymans1-1/+7
We want to keep the default strides in the videoinfo. Keep the stride of the video frames separate so that we can use both to copy a video frame and do correct stride conversion.
2011-07-13v4l2: add video metadata to raw video buffersWim Taymans1-5/+11
2011-07-12v4l2: Let the bufferpool own the V4l2ObjectWim Taymans1-80/+70
Keep track of the currently configured format and setting in the v4l2object. Pass the v4l2object to the bufferpool constructor so that the bufferpool can know everything about the currently configured settings. This also allows us to remove some awkward code.
2011-07-12v4l: remove caps argument, it's not neededWim Taymans1-5/+3
Remove the caps parameter, we don't need it anymore because we don't set caps on buffers anymore.
2011-07-12pool: make buffer writableWim Taymans1-1/+1
We need writable buffers when we need to do a slow memcpy.
2011-07-11v4l2: various cleanupsWim Taymans1-123/+98
Various cleanups, avoids useless casts, move error handling outside of the main code flow. Negotiate to a resonable resolution instead of the max resolution.
2011-07-08v4l2: port to 0.11Wim Taymans1-17/+11
2011-03-08meta: update for new APIWim Taymans1-3/+2
2011-02-28v4l2: register metadataWim Taymans1-0/+15
2011-02-28meta: fix for new APIWim Taymans1-4/+4
2011-02-28metadata: use metadata for private buffer dataWim Taymans1-35/+36
Use buffer metadata to store element private data.
2011-02-28miniobject: port to 0.11Wim Taymans1-97/+69
Use buffer private data instead of subclassing.
2011-01-12v4l2: define V4L2_FIELD_INTERLACED_{TB,BT} if not available in headerTim-Philipp Müller1-0/+8
Older kernels don't have these, and there's no easy way to check for the existance of enums that doesn't involve a configure check, so just define these if the V4L2_CAP_VIDEO_OUTPUT_OVERLAY define is not there, which was added in the same commit as the TB/BT enum. Fixes compilation on CentOS 5. https://bugzilla.gnome.org/show_bug.cgi?id=639339
2011-01-02v4l2: mark v4l2sink as experimental and build only if --enable-experimental ↵Tim-Philipp Müller1-0/+4
is passed It's not really of 'good' quality yet, but there's a lot of code shared with v4l2src, so not so easy to move it elswhere. https://bugzilla.gnome.org/show_bug.cgi?id=612244
2010-12-29v4l2: fix race conditionRob Clark1-2/+4
The size of the buffer would be zero'd out in gst_v4l2_buffer_finalize() after the buffer is qbuf'd or pushed onto the queue of available buffers.. leaving a race condition where the thread waiting for the buffer could awake and set back a valid size before the finalizing thread zeros out the length. This would result that the newly allocated buffer has length of zero.
2010-12-29v4l2sink: Add support for blocking dequeue.Rob Clark1-3/+11
We'd prefer to throttle the decoder if we run out of buffers, to keep a bound on memory usage. Also, for OMAP4 it is a requirement of the decoder to not alternate between memory alloced by the display driver and malloc'd userspace memory.
2010-12-29v4l2: clear flags before reusing buffer from buffer poolRob Clark1-1/+3
note: this really only affects v4l2sink since gst_v4l2_buffer_pool_get() is only called once per buffer in the v4l2src case (in gst_v4l2src_buffer_pool_activate())
2010-12-23v4l2: fix typoRob Clark1-1/+1
2010-12-04v4l2src: set top field first for interlaced buffers if v4l2 exports itJanne Grunau1-0/+8
https://bugzilla.gnome.org/show_bug.cgi?id=634393
2010-02-16v4l2: log more details in buffer pool finalizeStefan Kost1-2/+3
Helps to align with the loggin from libv4l.
2010-01-18v4l2: fix bufferpool file names in header commentStefan Kost1-1/+1
2009-09-10docs: fix gtk-doc warningsStefan Kost1-17/+35
2009-08-04v4l2sink: change where buffers get dequeuedRob Clark1-39/+9
It seems to cause strange occasional high latencies (almost 200ms) when dequeuing buffers from _buffer_alloc(). It is simpler and seems to work much better to dqbuf from the same thread that is queuing the next buffer.
2009-08-04v4l2: Add v4l2sink elementRob Clark1-0/+630
This also does the following changes: (1) pull the bufferpool code out into gstv4l2bufferpool.c, and make a bit more generic so it can be used both for v4l2src and v4l2sink (2) move some of the device probing/configuration/caps stuff into gstv4l2object.c so it does not have to be duplicated between v4l2src and v4l2sink Fixes bug #590280.