Commit graph

981 commits

Author SHA1 Message Date
Stian Selnes
f682772898 rtph261pay: rtph261depay: Add documentation
https://bugzilla.gnome.org/show_bug.cgi?id=751982
2015-07-05 16:09:02 +01:00
Sebastian Dröge
ab77906a37 rtph261pay: Fix compiler warning
gstrtph261pay.c: In function 'gst_rtp_h261_pay_class_init':
gstrtph261pay.c:1003:17: error: variable 'gobject_class' set but not used [-Werror=unused-but-set-variable]
   GObjectClass *gobject_class;
2015-07-03 14:29:16 +02:00
Sebastian Dröge
e0204938a8 rtph261depay: Let the base class push the buffer so it can deal with the flow return 2015-07-03 14:15:31 +02:00
Sebastian Dröge
b653fae8c9 rtph261pay: Remove unused adapter 2015-07-03 14:15:29 +02:00
Sebastian Dröge
90d47bff9e speexpay: Directly attach payload to the output buffer instead of copying it 2015-07-03 14:00:04 +02:00
Sebastian Dröge
6675e33109 sbcpay: Attach payload directly to the output instead of copying 2015-07-03 14:00:04 +02:00
Stian Selnes
ef8d630a59 rtp: add H.261 RTP payloader and depayloader
Implementation according to RFC 4587.

Payloader create fragments on MB boundaries in order to match MTU size
the best it can. Some decoders/depayloaders in the wild are very strict
about receiving a continuous bit-stream (e.g. no no-op bits between
frames), so the payloader will shift the compressed bit-stream of a
frame to align with the last significant bit of the previous frame.

Depayloader does not try to be fancy in case of packet loss. It simply
drops all packets for a frame if there is a loss, keeping it simple.

https://bugzilla.gnome.org/show_bug.cgi?id=751886
2015-07-03 11:48:41 +01:00
Sebastian Dröge
9dfae82566 rtpmpvdepay: Don't forget to unmap the input buffer 2015-07-03 12:19:05 +02:00
Sebastian Dröge
7e1d28d27f rtpmpvpay: Create buffer lists instead of pushing each buffer individually 2015-07-03 12:15:10 +02:00
Sebastian Dröge
f67bafb90d rtpmpapay: Use buffer lists instead of pushing each fragment individually 2015-07-03 12:04:18 +02:00
Sebastian Dröge
002bba37f7 rtpmp4apay: Create buffer lists and don't copy payload memory 2015-07-03 12:00:26 +02:00
Sebastian Dröge
6a59cc4b76 rtph263ppay: Generate buffer lists and attach the payload directly instead of copying it 2015-07-02 12:26:03 +02:00
Sebastian Dröge
9ceb15bcf8 rtph263pdepay: Simplify code a bit and do less direct memcpy and let GstBuffer do that for us 2015-07-02 09:49:44 +02:00
Sebastian Dröge
8b0d11a0ee rtph263pay: Stop using an adapter and directly use the buffer
We always pushed one buffer into the adapter, then handled exactly that one
buffer and flushed it from the adapter. Now also don't memcpy() the actual
payload but just attach the input buffer's data to the output buffer.

This code still needs some serious refactoring/rewriting.
2015-07-02 09:26:27 +02:00
Sebastian Dröge
51cd22c912 rtpgsmpay: Remove non-existing includes for now
git add -p mistake.
2015-07-01 21:57:28 +02:00
Sebastian Dröge
ef5e14989b rtpgstpay: Use the return value of gst_buffer_append() 2015-07-01 21:39:25 +02:00
Sebastian Dröge
137672ff18 rtpgsmpay: Attach payload to the output buffer instead of copying it 2015-07-01 21:39:25 +02:00
Sebastian Dröge
cb0232ba4e rtpg729pay: Attach payload directly to output buffers instead of copying 2015-07-01 21:39:25 +02:00
Sebastian Dröge
0a71dbc80c rtpg723pay: Attach payload buffer to the output instead of copying 2015-07-01 21:39:25 +02:00
Sebastian Dröge
8aca30799a rtpdvdepay: Map the output buffer once instead of once every 80 bytes 2015-07-01 21:39:25 +02:00
Sebastian Dröge
3af36ed8fe rtpac3pay: Attach the payload to the output buffer instead of copying it
Might also want to produce buffer lists here if needed.
2015-07-01 15:46:07 +02:00
Sebastian Dröge
adf2d8459f rtp: Fix indention 2015-07-01 15:46:06 +02:00
Sebastian Dröge
978903cd87 rtph264pay: Use GST_WARNING_OBJECT() instead of GST_WARNING() 2015-07-01 11:58:26 +02:00
Sebastian Dröge
ceaf90f027 vp8depay: Don't lock/map every non-keyframe buffer twice
Just copy the complete header instead of first looking at the first byte
and then at the remaining 10 bytes.
2015-06-30 14:07:28 +02:00
Sebastian Dröge
dc059efa60 rtp: Use GST_BUFFER_PTS() instead of GST_BUFFER_TIMESTAMP()
The mix between all these in the RTP code is confusing, let's try to be
consistent.
2015-06-10 14:34:47 +02:00
Chris Clayton
e29f231e5d rtpvp8depay: potential access beyond end of array
Compiling (with gcc-4.9-20150603) produces an error because of an access beyond
the end of an array. This patch fixes the error by initializing the loop
control/array index variable (i) to 1 and returning i - 1 when a match is found.
Also, because the values stored in the array increase in value as the index
increases, the >= test unnecessary, so it is removed.
2015-06-08 20:16:20 +01:00
Nicolas Dufresne
3ab70e4677 asteriskh263: Un-rank clashing depayloader
This depayloader clash with the standard one for H263p. It produces an
H263p stream with a modified header. It uses encoding-name that is the
same as H263p (H263-1998) though the resulting ES is not decodable or
parsable in GStreamer, making it unsuable in dynamic pipeline. This
patch unrank this specialized depayloader since it can only be used in
custom pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=739935
2015-06-03 08:57:57 -04:00
Tim-Philipp Müller
80998dadba rtpvrawdepay: don't shadow existing outbuf variable
And fix unref of the wrong one which will contain NULL
in an error code path.
2015-05-25 16:16:47 +01:00
Tim-Philipp Müller
2aafb3951d rtpvrawdepay: map/unmap output frame only once, not for every input packet
Map output buffer after creating it and keep it mapped
until we're done with it instead of mapping/unmapping
it for every single input buffer.
2015-05-25 16:16:42 +01:00
Nicola Murino
5e226d63f9 rtpg726pay: fix caps leak
https://bugzilla.gnome.org/show_bug.cgi?id=749544
2015-05-18 17:40:55 +01:00
Nicola Murino
335afc982b rtpg726depay: don't leak input buffer
https://bugzilla.gnome.org/show_bug.cgi?id=749543
2015-05-18 17:40:39 +01:00
Nicola Murino
fefeda5e6c rtpg726depay: add block_align to output caps
It is needed to correctly negotiate caps with matroskamux
and most other muxers.

https://bugzilla.gnome.org/show_bug.cgi?id=749129
2015-05-13 12:39:07 +01:00
Tim-Philipp Müller
2e412a447a docs: update example pipelines in element docs
Mostly gst-launch -> gst-launch-1.0
Use autovideosink/autoaudiosink more often.
Sprinkle some converters here and there.
2015-05-10 11:05:00 +01:00
Luis de Bethencourt
9391622579 Rename property enums from ARG_ to PROP_
Property enum items should be named PROP_ for consistency and readability.
2015-04-27 11:22:11 +01:00
Tim-Philipp Müller
d753a3eeb1 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 17:55:07 +01:00
Luis de Bethencourt
671b4d25cd remove unused enum items PROP_LAST
This were probably added to the enums due to cargo cult programming and are
unused. Removing them.
2015-04-24 17:01:12 +01:00
Olivier Crête
1394a66e62 rtpvp8depay: When dropping intra packet, request keyframe
https://bugzilla.gnome.org/show_bug.cgi?id=747208
2015-04-13 18:13:35 -06:00
Edward Hervey
5e0329235e rtph263depay: Fix framesize parsing
The string passed to the parsing function only contains a framesize, and
not <pt> + <framesize>

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726416
2015-04-08 11:17:31 +02:00
Sebastian Rasmussen
cf54d4cc67 rtph263pay/-depay: add framesize SDP attribute
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726416
2015-04-02 19:38:21 -04:00
Sebastian Rasmussen
896fc20806 rtpjpegpay/-depay: Remove incorrectly introduced framesize SDP attribute
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726415
2015-04-02 17:52:41 -04:00
Olivier Crête
d410acf649 rtpvp8depay: Parse width/height/profile from keyframes
This makes it possible to mux the result into a container
such as matroska.

https://bugzilla.gnome.org/show_bug.cgi?id=747208
2015-04-01 19:31:18 -04:00
Luis de Bethencourt
823194284c rtph264depay: remove unused value
CID #1226474
2015-03-09 16:22:33 +00:00
Luis de Bethencourt
5cd293fe76 rtph263pay: fix leak
CID 1212156
2015-03-09 16:17:45 +00:00
Luis de Bethencourt
e87113781a rtph263pay: remove uneeded variable
We just need to save the ebit information in case there is an error decoding.
2015-03-09 16:17:45 +00:00
Sebastian Rasmussen
d331d931db rtpvorbispay: fix payloader description and author e-mail
https://bugzilla.gnome.org/show_bug.cgi?id=745226
2015-02-26 15:57:08 +00:00
Vincent Penquerc'h
dc73d153cb rtpvp8pay: default encoding name to VP8
https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 14:29:02 +00:00
Vincent Penquerc'h
b88ea286d2 rtpvp8pay: make caps writable before truncating them
https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 14:06:51 +00:00
Vincent Penquerc'h
b866c989f5 rtpvp8pay: negotiate encoding name
Chrome uses a different one than gstreamer.

https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 13:52:29 +00:00
Wim Taymans
009a62fddb rtph263depay: fix compilation with gcc 5.0 2015-02-10 18:54:24 +01:00
Thiago Santos
a6d73797d0 rtph264depay: prevent trying to get 0 bytes from adapter
This causes an assertion and would lead to getting a NULL instead
of a buffer. Without proper checking this would easily lead to
a segfault

https://bugzilla.gnome.org/show_bug.cgi?id=737199
2015-02-04 21:37:50 -03:00
Patrick Radizi
0a359cdbdc rtph264pay: fix potential crash when shutting down
A race condition in the state change function may cause buffers
to be unreffed while they are still used by the streaming thread
in gst_rtp_h264_pay_send_sps_pps() resulting in a crash. Chain
up to the parent class first in the state change function to
make sure streaming has stopped and only then free those buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=741381
2014-12-11 14:00:19 +00:00
Patrick Radizi
fef1a8d88a rtph264pay: Fixes buffer leak when using SPS/PPS
Fixes a buffer leak that would occurr if the pipeline was shutdown
while a SPS/PPS header was being created.

https://bugzilla.gnome.org/show_bug.cgi?id=741271
2014-12-09 09:47:23 +01:00
Olivier Crête
e3b0fb2a5d rtpmpadepay: Relax caps to allow any clock-rate
Some Wowza setups seem to send an invalid non-90000 clock-rate.
2014-12-02 15:33:25 -05:00
Wim Taymans
3d7b0f30d7 rtpgstpay: put 0-byte at the end of events
Put a 0-byte at the end of the event string. Does not break ABI because
old depayloaders will skip the 0 byte (which is included in the length).
Expect a 0-byte at the end of the event string or a ; for old
payloaders.

See https://bugzilla.gnome.org/show_bug.cgi?id=737591
2014-11-20 13:14:14 +01:00
Wim Taymans
9d2902d978 rtpgstdepay: avoid buffer overread.
Check that a caps event string is 0 terminated and the event string is
terminated with a ; to avoid buffer overreads.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=737591
2014-11-20 12:44:26 +01:00
Nicolas Dufresne
0f4f948f5f rtpvp8: Use VP8 encoding name
Both Firefox and Chrome uses VP8 as the encoding in their SDP.
Adding this now defacto standard name removes the need for special
case in SDP parsing code.

https://bugzilla.gnome.org/show_bug.cgi?id=737810
2014-11-01 11:26:26 -04:00
Tim-Philipp Müller
92c1d289b8 rtpmp2tpay: fix up template caps so we can output the default pt 33
Add fixed payload type for mp2t to template caps as well, so
our output caps match the advertised default pt. Fixes a
regression from 1.2.

There's still something wrong with caps negotiation though,
rtpmp2tpay payload=96 ! fakesink will not output caps with
payload=96.
2014-11-01 12:40:07 +00:00
Tim-Philipp Müller
f3fec86bc9 Revert "rtp: add h265 RTP payloader + depayloader"
This reverts commit d06ba9051f.

This breaks the build, as it depends on parser API in -bad.
2014-10-15 17:48:46 +01:00
Jurgen Slowack
d06ba9051f rtp: add h265 RTP payloader + depayloader 2014-10-15 17:34:50 +02:00
Sebastian Dröge
4bc10e755a rtpvrawdepay: Declare some more required caps fields in the sink template caps
Now only missing are width and height, which are expressed as strings
for RTP... so we can't put them into the template caps.
2014-09-16 22:47:13 +03:00
Sebastian Rasmussen
276269d956 rtph263ppay: Unref pad template caps after use
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734435
2014-08-08 16:02:24 -03:00
Srimanta Panda
421b00cd17 rtph264pay: append packetization mode parameter to SDP
Append packetization-mode parameter to SDP description.
Packetization mode signals the properties of an RTP payload type.

https://bugzilla.gnome.org/show_bug.cgi?id=733556
2014-08-08 13:41:36 +01:00
Mark Nauwelaerts
d5d28055c1 rtph264pay: unbreak au aligned byte-stream payloading 2014-08-03 14:42:45 +02:00
Srimanta Panda
dd9f716892 rtph264pay: append profile-level-id to SDP
Append profile-level-id to SDP if available.

https://bugzilla.gnome.org/show_bug.cgi?id=733539
2014-08-01 16:01:07 +01:00
Wim Taymans
8a78fa1ff5 vp8depay: fix header size checking
Use a different variable name to make it clear that we are calculating
the header size.
Correctly check that we have enough bytes to read the header bits. We
were checking if there were 5 bytes available in the header while we
only needed 3, causing the packet to be discarded as too small.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=723595
2014-06-19 15:29:46 +02:00
Guillaume Desmottes
f00c2b7155 rtph264pay: propagate the GST_BUFFER_FLAG_DISCONT flag
Similarly to what we did with the DELTA_UNIT flag, this patch
propagates the DISCONT flag to the first RTP packet being used to transfer a
DISCONT buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=730563
2014-06-19 12:22:49 +02:00
Guillaume Desmottes
4be99ec7d5 rtph264pay: propagate the GST_BUFFER_FLAG_DELTA_UNIT flag
Downstream elements may be interested knowing if a RTP packet is the start
of a key frame (to implement a RTP extension as defined in the
ONVIF Streaming Spec for example).

We do this by checking the GST_BUFFER_FLAG_DELTA_UNIT flag we receive from
upstream and propagate it to the *first* RTP packet outputted to transfer this
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=730563
2014-06-19 12:22:38 +02:00
Guillaume Desmottes
42ff642372 gstrtpmp4gpay: propagate the GST_BUFFER_FLAG_DISCONT flag
Propagate the DISCONT flag to the first RTP packet being used to transfer
a DISCONT buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=730563
2014-06-18 16:25:07 +02:00
Guillaume Desmottes
9a7479fb0d rtpjpegpay: propagate the GST_BUFFER_FLAG_DISCONT flag
Propagate the DISCONT flag to the first RTP packet being used to transfer
a DISCONT buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=730563
2014-06-18 16:25:07 +02:00
Tim-Philipp Müller
6347ec522d rtpjp2kpay: pre-allocate buffer-list of the right size 2014-06-18 14:54:59 +01:00
Tim-Philipp Müller
ccb7380689 rtpjpegpay: pre-allocate buffer list of the right size 2014-06-18 14:54:59 +01:00
Tim-Philipp Müller
70bfc35756 rtpmp4vpay: pre-allocate buffer list of the right size 2014-06-18 14:54:59 +01:00
Tim-Philipp Müller
4b1f771e4d rtpvp8pay: allocate bitreader on the stack 2014-06-18 14:54:59 +01:00
Tim-Philipp Müller
725b8f272b rtpvp8pay: post error message on bus on error and don't use g_message() 2014-06-18 14:54:59 +01:00
Tim-Philipp Müller
f4db7443ae rtpvp8pay: couple of minor optimisations
Pre-allocate buffer list of the right size to avoid re-allocs.
Avoid plenty of double runtime cast checks and re-doing the
same calculation over and over again in rtp_vp8_calc_payload_len().
Only call gst_buffer_get_size() once.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
6c9e2194d2 rtpgstpay: pre-allocate buffer list of the right size
To avoid re-allocs.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
01ee993d8d rtph264pay: pre-allocate bufferlist of the right size
To avoid unnecessary re-allocs.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
c7c72c00b1 rtph264pay: push single buffer directly, no need to wrap it in a bufferlist
No point in a buffer list if we just have one single
buffer to push. Fix up unit test to handle that case
as well.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
0f5da64de3 rtpvrawpay: make chunks per frame configurable
Bit of a misnomer because it's really chunks per field
and not per frame, but we're going to ignore that for
the time being.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
2cf13b603f rtpvrawpay: remove unused variables 2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
a09e237b85 rtpvrawpay: pre-allocate buffer lists of sufficient size
Avoids unnecessary reallocs when appending buffers
to the bufferlist.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
15a33ccc65 rtpvrawpay: micro-optimise variable access in inner loop
Store some values that don't change during the execution
of the inner loops locally, so the compiler knows that too.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
fdf95fecbd rtpvrawpay: use buffer lists
Collect buffers to send out in buffer lists instead of
pushing out single buffers one at a time. For HD video
each frame might easily add up to a couple of thousand
packets, multiply that by the frame rate and that's a
lot of push() and sendmsg() calls per second.

A good reason to push out buffers as early as possible is
latency, so we don't accumulate the whole frame in a single
buffer list, but instead push it out in a few chunks, which
is hopefully a reasonable compromise.
2014-06-18 14:54:58 +01:00
Tim-Philipp Müller
054f774455 rtptheoradepay: fix double frees
Fix double-frees introduced to fix another coverity report.

CID 1223053
2014-06-16 12:03:38 +01:00
Vincent Penquerc'h
25c26a4c4c rtptheordepay: fix leaks
Coverity 1212163
2014-06-12 11:24:15 +01:00
Vincent Penquerc'h
8e80478cf7 rtpg729pay: leak fixes
Coverity 1212159
2014-06-12 11:16:08 +01:00
Vincent Penquerc'h
fe4c5b92b1 rtph263pay: fix leak
Coverity 1212157
2014-06-12 11:11:38 +01:00
Vincent Penquerc'h
6ef26e4a8a rtph263pay: fix leaks
Coverity 1212149
2014-06-12 10:43:53 +01:00
Vincent Penquerc'h
c58a2d9bbb rtpdvpay: catch failures to map buffer
Coverity 1139741
2014-06-12 10:31:47 +01:00
Wim Taymans
a5a7649831 h264depay: make sure we call handle_nal for each NAL
Call handle_nal for each NAL in the STAP-A RTP packet. This makes
sure we correctly extract the SPS and PPS.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730999
2014-05-30 16:51:37 +02:00
Guillaume Desmottes
d089f99a39 rtp/README: update pipelines to work with 1.0
- Use gst-libav encoders/decoders instead of gst-ffmpeg
- gstrtpjitterbuffer -> rtpjitterbuffer
- gst-launch-0.10 -> gst-launch-1.0
- Add 'videoconvert' element
- xvimagesink -> autovideosink

https://bugzilla.gnome.org/show_bug.cgi?id=729247
2014-05-05 20:23:56 -04:00
Vincent Penquerc'h
60ba2d7aee rtpqdmdepay: remove pointless check
Besides, the pointer was dereferenced earlier anyway.

Coverity 1139853
2014-05-02 14:09:02 +01:00
Vincent Penquerc'h
a55b8e9c00 rtpvrawpay: guard against pathological "no space" condition
Even if one woul hope one pixel can fit in a MTU, ensure we do not
overwrite a buffer if this is not the case.

Spotted while looking at Coverity 1208786
2014-04-30 14:50:44 +01:00
Vincent Penquerc'h
dfa2df1c88 rtpjpegdepay: sanity check for NULL qtable
Can happen (at least in crafted stream)

Coverity 1208778
2014-04-30 11:52:10 +01:00
Wim Taymans
9994ff2c6c rtpvraw: use plane pointers when needed
Pack/unpack planar formats to/from the first plane.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=729058
2014-04-28 14:45:57 +02:00
Tim-Philipp Müller
c9597298f9 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 23:35:17 +01:00
Göran Jönsson
80967c7638 gstrtph264pay: Reset sps pps variable when state change.
Reset last_spspps and sps/pps arrays  when state transition
GST_STATE_CHANGE_PAUSED_TO_READY.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726015
2014-04-21 12:07:20 +02:00
Josep Torra
eaee14aff4 rtph264depay: only guess AU boundaries when aren't indicated by marker
The marker bit isn't mandatory and we had in place code to guess AU
boundaries by detecting a new picture start. This guessing code
didn't work with interlaced content that has proper marker bits
to indicate the AU boundaries. It was leaking the first field buffer
and producing a corrupted output.

fixes: https://bugzilla.gnome.org/show_bug.cgi?id=728041
2014-04-12 04:42:36 +02:00
Ognyan Tonchev
2143a6e452 jpegpay: consider header len when calculating payload len
Fixed https://bugzilla.gnome.org/show_bug.cgi?id=726777
2014-03-27 09:45:20 +01:00
Olivier Crête
15d276058e rtp: Remove caps restrictions from RTP depayloader sink caps
Remove caps restrictions that correspond to the default and are not
required in SDP. With the new usage of having pads require a subset
of the caps, they will make the negotiation fail.
2014-03-06 12:06:43 -05:00