Commit graph

4831 commits

Author SHA1 Message Date
Tim-Philipp Müller
2cfb446eb9 tag: id3v2: turn redundant check into an assert
We checked this already earlier, so this is dead code.
Leave an assert in place for consistency with the other
branch and in case the rest of the code changes.

CID 1397350.
2016-12-18 12:29:42 +00:00
Sebastian Dröge
15123c0455 discoverer: Get caps from the element's srcpad if possible
The caps put into the stream topology by decodebin are the caps at the
moment the pads are exposed on it. This is usually before decoders
received any buffers.
In discoverer we however wait for pre-roll, which ensures that each
decoder handled buffers already. At this point, there might be more
information known about the caps already that we could make use of.

One example here is extra information stored in the SEI of H264, like
the multiview-mode. This will be known if there is a SEI before the
first keyframe, but decodebin won't put this into the topology as it
only waits for the initial caps of h264parse (which come directly after
SPS/PPS).

With this change, the multiview-mode is in the caps reported by
discoverer in many cases.
2016-12-17 22:01:10 +02:00
Thibault Saunier
d67f945177 encoding-profile: Fix documentation and port to gtk markdown
And remove some trailling whitepsaces
2016-12-16 11:27:31 -03:00
Thibault Saunier
f4ed0e1af1 base: Actually support using the default encoding target 2016-12-16 11:27:31 -03:00
Thibault Saunier
646e0499fb encoding-target: Remove useless check for local presence 2016-12-16 11:27:31 -03:00
Thibault Saunier
7f76713835 pbutils: Add safe guard too encoding profile API 2016-12-16 11:27:31 -03:00
Thibault Saunier
8bbf67c37d audio: Fix introspection annotation
In gst_audio_check_valid_channel_positions the mask
is an out parameter.

And minor conversion from a print to a GST_ERROR.
2016-12-16 11:27:31 -03:00
Thibault Saunier
1c7c51fa23 encoding-target: Handle GST_ENCODING_TARGET_PATH in list_all
And fix the compare_target function
2016-12-16 11:27:31 -03:00
Tim-Philipp Müller
e0742b8759 rtsp: add boxed types for new authentication credential API
To make the structs usable in bindings, and fix

gstrtspmessage.c:1188: Warning: GstRtsp:
gst_rtsp_message_parse_auth_credentials: return value: Invalid
non-constant return of bare structure or union; register as
boxed type or (skip)

https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-12-13 22:45:02 +00:00
Vincent Penquerc'h
6ee5922f2f audioringbuffer: do not require 4 byte multiple for encoded MPEG
Bytes per frame doesn't make sense for encoded audio.

https://bugzilla.gnome.org/show_bug.cgi?id=776038
2016-12-13 10:16:07 +00:00
Sebastian Dröge
2f62720d71 xmptag: Don't leak the namespace string if there are multiple
https://bugzilla.gnome.org/show_bug.cgi?id=775887
2016-12-09 17:36:47 +02:00
Jan Schmidt
7ff1de380f id3v2: Clarify id3v2_add_id3v2_frame_blob_to_taglist()
Pass the frame data and size explicitly to
id3v2_add_id3v2_frame_blob_to_taglist() and add a
comment that it's being deliberately / manually
passed the full ID3v2 frame including header.
2016-12-09 18:06:35 +11:00
Jan Schmidt
d178f7626a id3v2: Add missing overrun check for frame sizes
When frames claim to have a footer, ensure they
are large enough to contain one to avoid an invalid
read overrun.

Spotted by Joshua Yabut
2016-12-09 18:06:35 +11:00
Sebastian Dröge
7c1a32e28b tagdemux: Fix crash when shutting down element during getrange()
Ensure that nothing is in any of the streaming thread functions
anymore when going from PAUSED to READY. While the parent's state change
function has deactivated all pads, there is nothing preventing
downstream from activating our srcpad again and calling the getrange()
function. Although we're in READY!

https://bugzilla.gnome.org/show_bug.cgi?id=775687
2016-12-06 16:29:23 +02:00
Sebastian Dröge
71e819ae7d audio-converter: In passthrough, also don't copy if in and out block are the same
In and out array are usually different, they are stack allocated arrays.
However the blocks inside them still can be the same.

https://bugzilla.gnome.org/show_bug.cgi?id=775369
2016-11-30 10:43:50 +02:00
Sebastian Dröge
7e24acc67f discoverer: Handle NULL/ANY/EMPTY caps without crashing 2016-11-28 19:46:10 +02:00
Edward Hervey
216ee52090 video-info: Properly initialize/set extra fields
The flags and field order weren't properly initialized in the
gst_video_info_init().

Furthermore in gst_video_info_from_caps() we might set unitiliazed
values previously, this only sets them if valid.
2016-11-28 16:53:10 +01:00
Edward Hervey
e3216d1648 sdp: Fix attribute leak
We need to free the strdup'd string (to_free) in all cases
2016-11-28 16:51:43 +01:00
Edward Hervey
fb4856c839 rtsp: Don't leak authorization string 2016-11-28 16:51:23 +01:00
Petr Kulhavy
010b9547d3 audio-converter: optimize endian conversion
Optimize LE<->BE conversion by adding a dedicated fast path instead of
using the generic converter. Implement transform_ip function in order to do the
endian swap in place.

This saves buffer allocation for the intermediate format, can be done in place
and also performs the conversion in one step instead of unpack-convert-pack.

For all bit widths the naive algorithm is implemented, which provides the best
performance when compiled with -O3. ORC was considered but eventually removed
as it requires a dedicated function for in-place conversion (due to the
"restrict" parameters).

A more complex algorithm for the 24-bit conversion with unrolled loop and
32-bit processing is implemented in the #if 0 section. It performs better if
compiled with -O2. With -O3 however the naive algorithm performs better.

https://bugzilla.gnome.org/show_bug.cgi?id=773073
2016-11-28 17:24:17 +02:00
Petr Kulhavy
640c54d8f8 audio-convert: simplify the chain free process
It is not needed to store a pointer to every single chain element to free it.
Instead walk the channel list backwards and free the chain elements one by one.

Rename GstAudioConverter->chain_pack to chain_end.

https://bugzilla.gnome.org/show_bug.cgi?id=773073
2016-11-28 17:24:13 +02:00
Sebastian Dröge
4efc15dffb discoverer: Extract video information from caps manually without GstVideoInfo
The caps might not be fixated (which is required by GstVideoInfo) and we
would assert otherwise. However the caps often contain useful
information in the already-fixed parts that we can use here.
2016-11-28 10:12:49 +02:00
Sebastian Dröge
bd74b102fa discoverer: Also stop waiting for subtitles if we get EOS
We're not going to get a buffer or GAP event anymore after EOS and would
wait forever otherwise.
2016-11-28 10:04:38 +02:00
Sebastian Dröge
0846eb5b27 riff-media: Check if caps are NULL before using them for the first time, not afterwards
Otherwise we'll get a g_critical() before erroring out cleanly on
https://samples.mplayerhq.hu/A-codecs/ATRAC3/SND0.AT3
2016-11-26 13:54:41 +02:00
Miguel Paris
036bdf5d2d rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory
When gst_rtp_buffer_add_extension_onebyte_header() is used over a
GstRtpBuffer that only contains a memory for the whole packet,
ensure_buffers function crashes at the next point:

mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);

when i==2 because the payload is not mapped.

In addition the offset is calculated subtracting in the wrong direction.

https://bugzilla.gnome.org/show_bug.cgi?id=774959
2016-11-25 13:15:24 +02:00
Sebastian Dröge
47fdb15074 video-info: Add unit test for overflow checks
And also prevent overflows caused by allowing uint width/height in
gst_video_info_set_format() but storing them as (signed!) ints.
2016-11-24 15:40:22 +02:00
Sebastian Dröge
3d7a566640 video-info: And change the overflow check to not actually overflow itself 2016-11-24 15:12:40 +02:00
Sebastian Dröge
681d97aed7 video: Handle errors in gst_video_info_set_format() / gst_video_info_align()
https://bugzilla.gnome.org/show_bug.cgi?id=774588
2016-11-24 15:06:39 +02:00
Sebastian Dröge
17cdd369e6 video-info: Sanity check the frame size to prevent overflows
https://bugzilla.gnome.org/show_bug.cgi?id=774588
2016-11-24 15:06:39 +02:00
Ulf Olsson
a4c1dfe4cd mikey: Generate the correct SRTP policy
https://bugzilla.gnome.org/show_bug.cgi?id=774911
2016-11-23 17:44:29 +01:00
Sebastian Dröge
7e4697ec98 rtspdefs: Assert on the excepted MD5 digest string length
CID 1394494.
2016-11-23 18:26:29 +02:00
Scott D Phillips
c2dd0149c9 tag: fix some warnings in mklicensestables
https://bugzilla.gnome.org/show_bug.cgi?id=774878
2016-11-23 10:20:04 +02:00
Julien Isorce
b68d9bbe43 gstfdmemory: log with GST_INFO instead of GST_ERROR on permission denied
For example mmap can fail with EACCES if the the fd has been open
with read only mode. And mapping the memory might be the only way
to check that. So no need to print out an error.

Ex: ioctl(dev, DRM_IOCTL_PRIME_HANDLE_TO_FD, flags & ~DRM_RDWR)

https://bugzilla.gnome.org/show_bug.cgi?id=765600
2016-11-21 21:22:47 +00:00
Sebastian Dröge
90b24d34b3 rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials
https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-11-21 09:39:21 +02:00
Sebastian Dröge
828c8604dd rtsp: Add gst_rtsp_generate_digest_auth_response() to calculate digest auth response
https://bugzilla.gnome.org/show_bug.cgi?id=774416
2016-11-21 09:39:21 +02:00
Nicolas Dufresne
a1a2a33315 dmabuf-allocator: Add missing padding in the class
This class was made subclassable, though for future growth of the code,
it's better if we have some room for add class members. Using the small
padding since this is unlikely.
2016-11-18 14:56:20 -05:00
Sebastian Dröge
b9f59fd999 rtpbasepayload: Ensure to set the RECONFIGURE flag again if reconfiguration failed
https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:04:27 +02:00
Vivia Nikolaidou
f578c00a14 videotimecode: Fix incorrect nsec_since_daily_jam calculation
For drop-frame timecodes, the nsec_since_daily_jam doesn't necessarily
directly correspond to this many hours/minutes/seconds/frames. We have
to get the frame count as per frames_since_daily_jam and then convert.

https://bugzilla.gnome.org/show_bug.cgi?id=774585
2016-11-17 10:04:26 +02:00
Sebastian Dröge
088aebfda9 riff: Extract bpp from the strf for vnmc
Needed for avdec_vnmc to work.
2016-11-16 20:49:11 +02:00
Scott D Phillips
e740103669 videodecoder, audiodecoder: parse format before checking in src_query_default
The logic change in these commits misordered the parsing and checking of
format in position queries:

 2b06e54 videodecoder: Don't answer BYTES queries
 1840b02 audio: Don't answer BYTES queries

https://bugzilla.gnome.org/show_bug.cgi?id=774484
2016-11-16 07:57:31 +11:00
Tim-Philipp Müller
826eec22f7 appsink: fix g-i warnings and add since markers
Rename function parameter and make sure the name in the
declaration matches the name in the implementation, to
avoid g-i warnings. Also add Since markers for gtk-doc.

gstappsink.c:1248: Warning: GstApp: gst_app_sink_set_buffer_list_support:
unknown parameter 'buffer_list' in documentation comment, should be 'drop'
2016-11-15 18:38:48 +00:00
Thibault Saunier
0c0dfbd455 discoverer: Do not try to unref the bus if it has not been set yet
It might happen if creation of the discoverer failed
2016-11-15 15:22:45 -03:00
Patricia Muscalu
f1562053fe appsink: add support for buffer lists
https://bugzilla.gnome.org/show_bug.cgi?id=752363
2016-11-16 02:06:40 +11:00
Jan Schmidt
2b06e54651 videodecoder: Don't answer BYTES queries
Refuse to answer BYTES queries ourselves. The only
time they make sense is on raw elementary streams,
in which case upstream would already have answered.

https://bugzilla.gnome.org/show_bug.cgi?id=757631
2016-11-16 00:14:47 +11:00
Jan Schmidt
1840b0233a audio: Don't answer BYTES queries
Refuse to answer BYTES queries ourselves. The only
time they make sense is on raw elementary streams,
in which case upstream would already have answered.

They especially don't make sense for encoders to answer
based on upstream values - although perhaps later
we could make it do TIME->BYTES conversion on the source
pad based on bitrate.

https://bugzilla.gnome.org/show_bug.cgi?id=757631
2016-11-16 00:14:47 +11:00
Scott D Phillips
6a4c14c39a sdp: cast away const in call to g_free
MSVC warns about the const here. It's safe to cast away.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-15 14:52:22 +02:00
Scott D Phillips
6e71583d07 Cast away const from GstMetaInfo in *_get_meta_info() functions
MSVC warns about the const in the implicit argument conversion in the
calls to g_once_init_{enter,leave}. It's OK so explicitly cast it.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-15 14:52:22 +02:00
Thibault Saunier
5bdb38995f meson: Fix build when orc is disabled
Making sure not to use the orc_dep variable in case
orc has been explicitely disabled.
2016-11-14 17:26:02 -03:00
Scott D Phillips
ff8d49a4c8 Use intermediate guint when handling GstVideoMultiviewFlags
The underlying integer type of the enum GstVideoMultiviewFlags is
implementation defined and may not have the same size as guint.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-12 10:51:30 +02:00
Scott D Phillips
ab3c8caeed Remove 'return' from void functions
https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-12 10:51:30 +02:00