Commit graph

4398 commits

Author SHA1 Message Date
Tim-Philipp Müller 7dac2e1eb1 audiobasesink: fix misleading error message debug detail
https://bugzilla.gnome.org/show_bug.cgi?id=754260
2015-08-29 10:44:28 +01:00
Carlos Rafael Giani c95d809a96 audiobasesink: Fix incorrect/missing custom slaving method documentation
https://bugzilla.gnome.org/show_bug.cgi?id=754199
2015-08-28 10:13:44 +03:00
Sebastian Dröge 64301f1005 video(en|de)coder: Return TRUE when we consumed a tag event without creating a new event
Fixes spurious flow errors that especially break gst-validate.
2015-08-18 16:28:42 +03:00
Sebastian Dröge 6cda5d3494 audiodecoder: If there are no tags, don't try to do event handling on a NULL event
Fixes some crashes.
2015-08-18 16:01:28 +03:00
Sebastian Dröge 2de91c32e4 audioencoder: If there are no tags, don't try to do event handling on a NULL event
Fixes some crashes.
2015-08-18 15:58:57 +03:00
Tim-Philipp Müller c21a972421 videoencoder: fix tag handling
Merge upstream tags with encoder tags and update whenever
any of those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-18 12:44:04 +01:00
Tim-Philipp Müller 4c00709e22 audioencoder: fix tag handling
Merge upstream tags with encoder tags and update whenever
any of those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-18 11:46:21 +01:00
Vineeth TM fd7724b6e1 pbutils: discoverer: Set GError when NULL info is being returned.
When discovering the URI, if info is NULL, then instead of just returning NULL,
set the GError, so the error can be printed and notified.

https://bugzilla.gnome.org/show_bug.cgi?id=753701
2015-08-18 12:13:41 +03:00
Tim-Philipp Müller 135cad5b6e audiodecoder: try harder to avoid sending unnecessary tag updates 2015-08-16 18:28:09 +01:00
Tim-Philipp Müller 30b7cc6670 videodecoder: fix tag handling
Before we just merged everything in pretty much random ways
ad-hoc instead of keeping state properly. In 0.10 that was
how it worked, but in 1.x the tag events sent should always
reflect the latest state and replace any previous tags.

So save the upstream (stream) tags, and save the tags set
by the decoder subclass with merge mode, and then update
the merged tags whenever either of those two changes.

This slightly changes the behaviour of gst_video_decoder_merge_tags()
in case it is called multiple times, since now any call replaces
the previously-set tags. However, it leads to much more predictable
outcomes, and also we are not aware of any subclass which sets this
multiple times and expects all the tags set to be merged.

If more complex tag merging scenarios are required, we'll have
to add a new vfunc for that or the subclass has to intercept
the upstream tags itself and send merged tags itself.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 18:23:07 +01:00
Tim-Philipp Müller 5ccc8432e0 audiodecoder: fix tag handling
Before we just merged everything in pretty much random ways
ad-hoc instead of keeping state properly. In 0.10 that was
how it worked, but in 1.x the tag events sent should always
reflect the latest state and replace any previous tags.

So save the upstream (stream) tags, and save the tags set
by the decoder subclass with merge mode, and then update
the merged tags whenever either of those two changes.

This slightly changes the behaviour of gst_audio_decoder_merge_tags()
in case it is called multiple times, since now any call replaces
the previously-set tags. However, it leads to much more predictable
outcomes, and also we are not aware of any subclass which sets this
multiple times and expects all the tags set to be merged.

If more complex tag merging scenarios are required, we'll have
to add a new vfunc for that or the subclass has to intercept
the upstream tags itself and send merged tags itself.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 16:34:31 +01:00
Thiago Santos 5a0bee3f13 audioencoder: add src and sink query methods
Allows subclasses to do their own handling of GstQuery and still
chain up to the parent class to handle the ones that they don't want
to handle
2015-08-16 08:14:35 -03:00
Thiago Santos d19f347223 Revert "audiodecoder: expose default query handling function"
Apparently I forgot how gobject works, there is no need to expose
it directly as one can call it from the parent_class pointer

This reverts commit 8a64592481.
2015-08-15 13:44:35 -03:00
Thiago Santos c63db0e104 Revert "videodecoder: expose default query handling function"
Apparently I forgot how gobject works, there is no need to expose
it directly as one can call it from the parent_class pointer

This reverts commit ea9b6a7e3c.
2015-08-15 13:44:35 -03:00
Thiago Santos 33b1da7b80 audiodecoder: add option to use default pad accept-caps handling
Add gst_audio_decoder_set_use_default_pad_acceptcaps() to allow
subclasses to make videodecoder use the default pad acceptcaps
handling instead of resorting to the caps query that is, usually,
less efficient and unecessary

API: gst_audio_decoder_set_use_default_pad_acceptcaps
2015-08-15 13:44:34 -03:00
Thiago Santos 4982188cf7 videodecoder: add option to use default pad accept-caps handling
Add gst_video_decoder_set_use_default_pad_acceptcaps() to allow
subclasses to make videodecoder use the default pad acceptcaps
handling instead of resorting to the caps query that is, usually,
less efficient and unecessary

API: gst_video_decoder_set_use_default_pad_acceptcaps
2015-08-15 13:44:34 -03:00
Jan Schmidt 95eb641821 rtpbasedepayload: Make stats creation threadsafe, fix a CRITICAL
Use the object lock to protect the internal segment when updating
against access from getting the stats property.

Fix a critical in gst-inspect or when retrieving the stats
before any segment has arrived by checking whether the
segment has been initted..
2015-08-15 23:37:26 +10:00
George Kiagiadakis 897371ac4f appsink: unref the preroll buffer and cleanup the segments on stop()
Just for consistency. No need to keep data around.
2015-08-14 19:27:07 +02:00
George Kiagiadakis c3e4d8ca6f appsink: do not update preroll_caps unless the sink is prerolling
Just for consistency with the preroll_segment
2015-08-14 19:27:07 +02:00
George Kiagiadakis c411819452 appsink: put the correct segment in the preroll sample
last_segment is only being updated in dequeue_buffer(),
which is only called from _pull_sample(). _pull_preroll()
simply re-uses an old or dummy segment while the actual
one sits and waits in the queue.

https://bugzilla.gnome.org/show_bug.cgi?id=751147
2015-08-14 19:27:06 +02:00
Thiago Santos ea9b6a7e3c videodecoder: expose default query handling function
Subclasses can use it to select what queries they want to handle
and forward the rest to the default handling function.

API: gst_video_decoder_sink_query_default

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:41:58 -03:00
Thiago Santos 8a64592481 audiodecoder: expose default query handling function
Subclasses can use it to select what queries they want to handle
and forward the rest to the default handling function.

API: gst_audio_decoder_sink_query_default

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:41:58 -03:00
Sebastian Dröge 8dc4bfdd0e rtp: Depend on the audio library 2015-08-11 14:10:57 +02:00
Sebastian Dröge a0f1b964f1 rtpbaseaudiopayload: Copy metadata in the (de)payloader, but only the relevant ones
The payloader didn't copy anything so far, the depayloader copied every
possible meta. Let's make it consistent and just copy all metas without
tags or with only the audio tag.

https://bugzilla.gnome.org/show_bug.cgi?id=751774
2015-08-11 12:46:36 +02:00
Nicolas Dufresne 6ddab6918d basedepayloader: Don't re-timestamp with running-time
There was a confusion, six depayloaders where passing through the
timestamp while the base class was re-timestamping to running
time. This inconstancy has been unnoticed has in most use cases
the incoming segment is [0, inifnity] in which case timestamps are
the same as running time. With DTS/PTS shifting added (to avoid
negative values) and pcapparse sending a different segment this
started being an issue.

https://bugzilla.gnome.org/show_bug.cgi?id=753037
2015-08-10 13:26:20 -04:00
Thiago Santos d259a233a5 videoencoder: remove empty line to make g-i-scanner happy
gstvideoencoder.h:228: Warning: GstVideo: "@transform_meta"
parameter unexpected at this location:
 * @transform_meta: Optional. Transform the metadata on ...
2015-08-10 10:40:19 -03:00
Thiago Santos a1c3276159 videodecoder: documentation cleanup
Remove some whitespace and break lines longer than 80 columns
2015-08-10 10:40:07 -03:00
Thiago Santos e59d1308cc videodecoder: push pending events before gap
Push all pending events before pushing the gap. This ensures the
segment is pushed before the gap so it can be properly translated
to the running time

Includes unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=753360
2015-08-10 00:21:37 -03:00
Brian Peters 1273848bf5 rtpbuffer: avoid accessing NULL buffer even more
Previous commit was incompletely applied.

https://bugzilla.gnome.org/show_bug.cgi?id=753001
2015-07-30 15:16:57 +01:00
Brian Peters 04c69952c0 rtp: buffer: don't access NULL buffer pointer
unmap will set rtpbuffer->buffer to NULL, so we need to
save the pointer to access it while the RTP buffer is
unmapped.

https://bugzilla.gnome.org/show_bug.cgi?id=753001
2015-07-30 14:30:44 +01:00
Tim-Philipp Müller 232bdf1711 rtpbasedepayload: fix leaks in error code paths
This was introduced when reshuffling the buffer unmaps
in commit bc14cdf529
rtp: rtpbasedepayload: add process_rtp_packet() vfunc

Fixes make check-valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=750235
2015-07-30 12:50:56 +01:00
Nicolas Dufresne 7c638e06ff depayloader: Use input segment start
When there is no clock_base provided, the start position is
set to 0 instead of the original segment start value. This
would break synchronization if start was not 0.

https://bugzilla.gnome.org/show_bug.cgi?id=752228
2015-07-18 15:40:26 -04:00
Wim Taymans 14083178b8 video: improve logging
Add logging categories for most video objects.
Remove some useless debug lines in video-info and videotestsrc.
Add a performance debug line in the video scaler.
2015-07-15 12:47:42 +02:00
Olivier Crête dec3fb3723 rtsp: Include generated enum types in gstrtsptransport.h
GST_TYPE_RTSP_LOWER_TRANS used to be defined in there, not
including the generated file makes older gst-p-good fail to build,
so it constitues an API break.
2015-07-14 17:18:12 -04:00
Tim-Philipp Müller bc14cdf529 rtp: rtpbasedepayload: add process_rtp_packet() vfunc
Add process_rtp_packet() vfunc that works just like the
existing process() vfunc only that it takes the GstRTPBuffer
that the base class has already mapped (with MAP_READ),
which means that the subclass doesn't have to map it again,
which allows more performant processing of input buffers
for most RTP depayloaders.

https://bugzilla.gnome.org/show_bug.cgi?id=750235
2015-07-12 14:29:29 +01:00
Nicolas Dufresne 8be88f0364 doc/build: Fix doc typos
This minor update should workaround a build system bug. While the
makefile has been updated to generate more enum type, there is nothing
that updates the header and would lead to the generated code to be
produced again. This minor doc fix should ensure no one get a build with
missing symbols.
2015-07-09 10:47:20 -04:00
Tim-Philipp Müller 3d7a92b452 rtpbasedepayload: fix typo in comment 2015-07-07 19:56:52 +01:00
Tim-Philipp Müller fbf2773b2e rtpbasepayload: fix possible segment event leak
Need to clear it when shutting down, not when starting up.
Fixes leak in rtp-payloading unit test.
2015-07-07 15:05:59 +01:00
Hyunjun Ko 9dc463346e video/audio meta: transform_func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
2015-07-07 16:41:23 +03:00
Sebastian Dröge a1f8fb32cb video: Add some more GTypes for enums 2015-07-07 14:32:56 +03:00
Tobias Mueller 190c7f1928 GstVideoScaler: Initialised scaling functions to get rid of compiler messages
E.g.

video-scaler.c: In function 'gst_video_scaler_horizontal':
video-scaler.c:1332:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src, dest, dest_offset, width, n_elems);
   ^

video-scaler.c: In function 'gst_video_scaler_vertical':
video-scaler.c:1373:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src_lines, dest, dest_offset, width, n_elems);
   ^

GCC's analyses seem to be correct, for the simple fact that if you pass
get_functions a known format, but no hscale or vscale, it'll return
True without having done anything.
Some callers check for the scale values to be not NULL, but then
hscale->resampler.max_taps could return 0.
A different approach to the one presented in this patch is to check
for those max_taps, too, before calling get_functions.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=752051
2015-07-07 13:06:34 +02:00
Sebastian Dröge b495dfa5e6 {audio,video}info: Add GST_TYPE_{AUDIO,VIDEO}_INFO macros 2015-07-06 12:53:15 +03:00
Marcin Kolny 95fa0c58a2 video-info: implement GstVideoInfo as boxed type
GstVideoInfo usually is created on the stack, but boxed type can be useful
for bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=752011
2015-07-06 12:52:51 +03:00
Stian Selnes 1586981b1b rtcpbuffer: Fix validation of packets with padding
The padding (if any) is included in the length of the last packet, see
RFC 3550.

Section 6.4.1:
   padding (P): 1 bit
      If the padding bit is set, this individual RTCP packet contains
      some additional padding octets at the end which are not part of
      the control information but are included in the length field. The
      last octet of the padding is a count of how many padding octets
      should be ignored, including itself (it will be a multiple of
      four).

Section A.2:
   *  The padding bit (P) should be zero for the first packet of a
      compound RTCP packet because padding should only be applied, if it
      is needed, to the last packet.

   *  The length fields of the individual RTCP packets must add up to
      the overall length of the compound RTCP packet as received.

https://bugzilla.gnome.org/show_bug.cgi?id=751883
2015-07-06 12:06:47 +03:00
Stian Selnes 008a228865 videodecoder: Fix setting default pixel-aspect-ratio
It's needed to check if pixel-aspect-ratio exists before fixating.
It does not exist if input caps is not set yet and allowed caps
does not contain pixel-aspect-ratio (e.g. when using GST_VIDEO_CAPS_MAKE)

https://bugzilla.gnome.org/show_bug.cgi?id=751932
2015-07-06 11:59:38 +03:00
Sebastian Dröge 56add20dc7 audioencoder: Don't try to get buffers from an empty adapter 2015-07-02 13:16:15 +02:00
Sebastian Dröge f5eebb27a2 {audio,video}{en,de}oder: Also copy POOL metas and make sure to copy over metas when creating subbuffers
POOL meta just means that this specific instance of the meta is related to a
pool, a copy should be made when reasonable and the flag should just not be
set in the copy.
2015-07-01 10:58:07 +02:00
Sebastian Dröge 844fa28c67 audiodecoder: Add transform_meta() vfunc with default implementation
The default implementation copies all metadata without tags, and metadata
with only the audio tag. Same behaviour as in GstAudioFilter.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 10:40:10 +02:00
Sebastian Dröge cc1719130b audioencoder: Add transform_meta() vfunc with default implementation
The default implementation copies all metadata without tags, and metadata
with only the audio tag. Same behaviour as in GstAudioFilter.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 10:40:10 +02:00
Sebastian Dröge d2cc76b228 videodecoder: Add transform_meta() vfunc with default implementation
The default implementation copies all metadata without tags, and metadata
with only the video tag. Same behaviour as in GstVideoFilter.

This currently does not work if the ::parse() vfunc is implemented as all
metas are getting lost inside GstAdapter.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 10:40:09 +02:00