Commit graph

12955 commits

Author SHA1 Message Date
Michael Olbrich
496995a7d5 v4l2: rework sink buffer refcounting
This is a followup patch for #700781, which is not quite correct.
The buffer handling is quite complicated here.
The original code intended to the the following:

- gst_v4l2_buffer_pool_process() calls QBUF and adds the buffer to the
  local list.
- The sink calls gst_buffer_unref() which returns the buffer to the pool
  but not the 'free list'.
- Some time later DQBUF returns the buffer and
  gst_v4l2_buffer_pool_release_buffer() puts in on the 'free list'.

If the buffer must be copied then (parent_class)->acquire_buffer() is
called directly to keep the buffer in the pool.

This has two problems:
1. If gst_v4l2_buffer_pool_release_buffer() is called before the buffer is
   returned to the pool, then the buffer is put on the 'free list' twice.
   This can happen if a reference to the buffer is kept outside the sink,
   of if DQBUF returns the buffer, that was just queued with QBUF.
2. If buffers are copied, then all buffers are in the pool at all times. As
   a result gst_v4l2_buffer_pool_stop() and gst_v4l2_buffer_pool_dqbuf()
   can access pool->buffers at the same time, which can lead to memory
   corruption.

The patch for #700781 fixes those problems, but with the side effect that
there are always buffers outside the pool (because they are queued) and
the pool is never stopped.
This patch fixes this by releasing the reference to the buffer after
handling it (to avoid problem 2.) so it can be returned to the pool.
gst_v4l2_buffer_pool_release_buffer() is only called if the buffer is
already in the pool (to avoid problem 1.).

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701375
2013-06-03 11:55:48 +02:00
Thiago Santos
7c12435f9b qtdemux: make sure taglist is writable before adding tags
Avoids assertions
2013-06-02 15:37:06 -03:00
Thiago Santos
78dfdee2aa qtdemux: effectively skip tracks that weren't listed on the 1st moov
Without this, stream is NULL and the code will try to access it, leading
to segfaults.
2013-06-02 13:06:15 -03:00
Thiago Santos
70fca21c28 qtdemux: skip redundant check
!got_moov is already checked the line above
2013-06-02 13:06:15 -03:00
Stefan Sauer
bf250a90dc tests: cleanup level tests
Split out a few more tests to avoid checking the same stuff over and over again.
2013-06-02 13:05:09 +02:00
Stefan Sauer
bcf1bba689 level: remove unused variables in instance struct 2013-06-01 21:34:37 +02:00
Stefan Sauer
19b23d3b90 level: add a test for continous timestamps
A test that checks that msg[n].ts + msg[n].dur == msg[n+1].ts.
2013-06-01 21:34:37 +02:00
Anton Belka
db29522a43 wavenc: add tags & toc support
Write tags as LIST INFO chunk. Format the toc as cue + LIST adtl chunk. Remove
old #ifdef'ed code.
2013-06-01 21:34:37 +02:00
Wim Taymans
1f0600ee6f Revert "rtph264pay: Restructuring to allow for adding optional caps"
This reverts commit 61666898cf.

This commit changes what the set_sps_pps() function does, not it doesn't
set caps anymore (and should have been renamed). The main problem is that
not all call sites are updated and thus leak the string.
2013-05-31 15:18:48 +02:00
Wim Taymans
1516c14881 Revert "rtph264pay/depay: Add frame dimensions a payloaded caps"
This reverts commit 3dca756a5d.

The H264 RTP spec has no attributes for width and height.
2013-05-31 15:11:12 +02:00
Wim Taymans
b79d217396 Revert "rtph264pay/depay: Add optional framerate caps for use in SDP"
This reverts commit d8825e2a5c.

There is no framerate attribute in the h264 RTP spec.
2013-05-31 15:09:51 +02:00
Wim Taymans
190b3d6688 Revert "rtpjpegpay/depay: Replace framesize caps with width/height"
This reverts commit 0075d111b4.

Extra application/x-rtp are SDP fields, which are strings.
2013-05-31 15:08:16 +02:00
Wim Taymans
f870cef8bc Revert "rtpjpegpay/depay: Replace framerate caps field with fraction"
This reverts commit 9fd25a810b.

We deal with sdp attributes in application/sdp, which are always strings.
2013-05-31 15:05:51 +02:00
Wim Taymans
25082a50b9 rtspsrc: add extra TLS url protocols
We also support TLS protocols now.
2013-05-31 12:34:22 +02:00
Sebastian Dröge
e2e1d1a158 videomixer: Add FIXME comment about the DURATION query from adder
Currently the code just takes with maximum upstream duration, which
is wrong. It should be the maximum upstream duration in running time.
2013-05-30 23:56:38 +02:00
Mathieu Duponchelle
5223868caa videomixer: Set a reference to mix->current_caps as the QUERY_CAPS result. 2013-05-30 15:36:48 -04:00
Stefan Sauer
6feaf69bec level: misc cleanups
Fix some oudated comments. Sort out some confusion of interval_frames and num_frames.
2013-05-30 17:38:55 +02:00
Sebastian Dröge
82e7826af0 v4l2: Only conditionally use V4L2_CTRL_TYPE_INTEGER_MENU, it's not available in older versions 2013-05-29 20:35:41 +02:00
Michael Olbrich
0fb59275b0 v4l2: add a property for arbitrary v4l2 controls
This makes it possible to set any controls that can be set with
VIDIOC_S_CTRL.
The controls are set when the property is set (if the device is open)
and when the device is opened.

https://bugzilla.gnome.org/show_bug.cgi?id=698837
2013-05-29 20:18:11 +02:00
Stefan Sauer
52282b5faa level: fix discontinuities in timestamps 2013-05-28 19:09:12 +02:00
Sebastian Dröge
f287756f87 gdkpixbufdec: Keep serialized events in order, and don't send SEGMENT before CAPS 2013-05-28 15:47:38 +02:00
Wim Taymans
80850df711 rtspsrc: create and push stream-start in TCP mode 2013-05-28 15:45:49 +02:00
Wim Taymans
4fc1f3088b rtspsrc: remove some obsolete code
It is not needed to do a state change from the _play() function on
ourselves. The state change function already did that and we don't want to
interfere with that (or use hacks to avoid interference).
2013-05-28 15:10:07 +02:00
Wim Taymans
e6f850996b rtspsrc: set RTCP caps on the RTCP pads 2013-05-28 12:26:25 +02:00
Wim Taymans
63f0ecbbe7 rtpsession: send stream-start and segment events
Also send stream-start and segment event on the RTCP pad.
We don't need to send anything on the sync_src pad because we
already forwarded all incomming events.
2013-05-28 12:26:25 +02:00
Wim Taymans
779bcc093c rtspsrc: add signal to handle server requests
Add a signal to be notified of a server request. The signal handler can then
construct the response message for the server.

See https://bugzilla.gnome.org/show_bug.cgi?id=632207
2013-05-28 12:26:24 +02:00
Nicolas Dufresne
cd30a81ee3 videomixer: Maintain z-order when new pad are added
https://bugzilla.gnome.org/show_bug.cgi?id=701109
2013-05-27 22:43:25 -04:00
Tom Greenwood
5532989728 vp8enc: Add property to manually specify the timebase of the encoder
https://bugzilla.gnome.org/show_bug.cgi?id=695709
2013-05-26 10:23:08 +02:00
Thibault Saunier
7a3df1ab31 videomixer: Always handle flush_stop_pending atomically
It is not protected with the COLLECT_PADS_STREAM_LOCK anymore
2013-05-25 12:20:08 -04:00
Thibault Saunier
03fc515f66 tests: videomixer: Add a testsuite for videomixer
This is mostly copy pasted from -base/tests/check/elements/adder.c
2013-05-25 11:05:37 -04:00
Thibault Saunier
608bd3e2db videomixer: Do not take COLLECT_PADS_STREAM_LOCK when unnecessary
Collectpad takes the lock itself when receiving serialized events
and we should not take it for not serialized ones
2013-05-25 11:03:31 -04:00
Sebastian Dröge
1b5a8ac41c flxdec: Properly skip non-frame chunks 2013-05-24 19:34:05 +02:00
Sebastian Dröge
ae3ee32f42 flxdec: Flush data from adapter after reading it
Otherwise we're going in an infinite loop, reading the same data
over and over again.
2013-05-24 19:31:14 +02:00
Andoni Morales Alastruey
a62af107ae goom2k1: fix more duplicated symbols 2013-05-24 09:29:23 +02:00
Sebastian Rasmussen
9fd25a810b rtpjpegpay/depay: Replace framerate caps field with fraction
The previous implementation had the formatting of SDP attributes happen
in each RTP payloader, now instead the constituent values are propagated
as caps fields. This allows for applications to do SDP offer/answer
based on caps negotiation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700748
2013-05-23 21:05:49 +02:00
Sebastian Rasmussen
0075d111b4 rtpjpegpay/depay: Replace framesize caps with width/height
The previous implementation had the formatting of SDP attributes happen
in each RTP payloader, now instead the constituent values are propagated
as caps fields. This allows for applications to do SDP offer/answer
based on caps negotiation.

Keep parsing a-framerate, x-framerate and x-dimensions in rtpjpegdepay
to be backwards compatible with previous payloaders.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700748
2013-05-23 21:05:43 +02:00
Sebastian Rasmussen
d8825e2a5c rtph264pay/depay: Add optional framerate caps for use in SDP
This allows for applications to format SDP attributes and still do SDP
offer/answer based on caps negotiation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700749
2013-05-23 21:04:17 +02:00
Sebastian Rasmussen
3dca756a5d rtph264pay/depay: Add frame dimensions a payloaded caps
This allows for applications to format SDP attributes and still do SDP
offer/answer based on caps negotiation.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700749
2013-05-23 21:04:11 +02:00
Sebastian Rasmussen
61666898cf rtph264pay: Restructuring to allow for adding optional caps
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700749
2013-05-23 21:04:00 +02:00
Sebastian Dröge
e26b8c2832 (dyn|multi)udpsink: Add properties to specify the bind address and port
By default we use the any addresses and a random port for binding the socket.
2013-05-23 18:42:09 +02:00
Sebastian Dröge
5b79b8ff3c (dyn|multi)udpsink: Bind socket before using it
https://bugzilla.gnome.org/show_bug.cgi?id=700878
2013-05-23 18:05:07 +02:00
Sebastian Dröge
1ed7f7a6a8 (multi)udpsink: Add missing getters for socket-v6 and used-socket-v6 properties 2013-05-23 17:26:31 +02:00
Nicolas Dufresne
d8c5e31657 videomixer: Don't hold stream-lock while pushing non-serialized events
https://bugzilla.gnome.org/show_bug.cgi?id=700868
2013-05-23 09:20:04 -04:00
Nicolas Dufresne
a7e0f251ca videomixer: Don't hold object lock while sending events
https://bugzilla.gnome.org/show_bug.cgi?id=700868
2013-05-23 09:20:04 -04:00
Sebastian Dröge
ecc6c607ff deinterlace: The return value of gst_pad_set_caps() is not relevant anymore
Caps can fail to be set because the pad is not linked yet for example.
2013-05-22 17:34:07 +02:00
David Schleef
318cd39c3e qtdemux: Add error if file has playready drm 2013-05-21 18:21:49 -07:00
Thibault Saunier
18ef4f18d0 videomixer: Send a reconfigure event upstream if sinkpad caps are not usable
https://bugzilla.gnome.org/show_bug.cgi?id=684237
2013-05-21 12:15:36 -04:00
Michael Olbrich
f9cc655adf v4l2: keep a reference to all queued buffers
Without this, a queued buffer may be required, filled and queued before it
is dequeued.
Calling gst_buffer_pool_acquire_buffer() ensures that the buffer is set up
correctly and gst_buffer_unref() calls buffer_release().

https://bugzilla.gnome.org/show_bug.cgi?id=700781
2013-05-21 16:44:58 +02:00
Alexander Schrab
a1df050356 mulawdec: Handle NULL buffers in handle_frame
https://bugzilla.gnome.org/show_bug.cgi?id=698894
2013-05-21 15:18:04 +02:00
Sebastian Rasmussen
2361567bae rtpjpegpay/depay: Add framesize caps for use in SDP
The format of the value adheres to RFC6064 and it is meant to be parsed
and included in the SDP sent by gst-rtsp-server to its clients.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=700748
2013-05-21 09:09:03 +02:00