Commit graph

80 commits

Author SHA1 Message Date
Sebastian Dröge
70db210315 vp8enc: Ensure that we always have valid frame user data before using it
Otherwise we're going to dereference NULL pointers.
2016-01-20 13:41:33 +02:00
Sebastian Dröge
7eee775d5f vpxdec: Unref frame in all code paths of handle_frame()
https://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-20 10:02:48 +02:00
Thibault Saunier
01f995b8dd vpxenc: Unref frame on ERROR
All code paths for handle_frame() must somehow take ownership of the frame, be
it by actually unreffing, forwarding the frame elsewhere or storing it for
later.

http://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-20 10:02:44 +02:00
Thibault Saunier
17838829eb vp8enc: Return FLOW_ERROR when an error accures
FALSE would mean FLOW_OK

https://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-16 08:58:48 +01:00
Sebastian Dröge
bed1f0a0a6 vpxdec: Initialize buffer variable to NULL
False positive but trivial to fix and possibly causing compiler warnings at
some point in the future too.

CID 1346535
2015-12-29 17:58:38 +02:00
Nicolas Dufresne
9808cff566 vpx: Add missing headers in Makefile.am
This fixes distcheck.

https://bugzilla.gnome.org/show_bug.cgi?id=755510
2015-12-15 14:27:22 -05:00
Prashant Gotarne
5c7eb0f886 vpx: created common baseclass GstVPXEnc
GstVP8Enc and GstVP9Enc has almost 80% code in common.
created common baseclass GstVPXEnc for GstVP8Enc and GstVP9Enc

https://bugzilla.gnome.org/show_bug.cgi?id=755510
2015-12-15 14:03:29 -05:00
Nicolas Dufresne
90dcc3921a vpxdec: Remove unneeded add video_meta
This also remove copies for VP8, which was not correctly in place
in previous related patch.
2015-12-15 12:57:53 -05:00
Prashant Gotarne
75fb614c1e vpx: created common base class GstVPXdec for vpx decoders
Base class for the vp8dec and vp9dec.

https://bugzilla.gnome.org/show_bug.cgi?id=755510
2015-12-15 12:06:45 -05:00
Nicolas Dufresne
189c291805 vpxdec: Use GstMemory to avoid copies
With the VPX decoders it's not simple to use downstream buffer pool,
because we don't know the image size and alignment when buffers get
allocated. We can though use GstAllocator (for downstream, or the system
allocator) to avoid a copy before pushing if downstream supports
GstVideoMeta. This would still cause a copy for sink that requires
specialized memory and does not have a GstAllocator for that, though
it will greatly improve performance for sink like glimagesink and
cluttersink. To avoid allocating for every buffer, we also use a
internal buffer pool.

https://bugzilla.gnome.org/show_bug.cgi?id=745372
2015-12-04 17:29:15 -05:00
Nicolas Dufresne
b848c1b6ff vpxdec: Use threads on multi-core systems
This adds an automatic mode to the threads property of vpxdec in order to
use as many threads as there is CPU on the platform. This brings back
GStreamer VPX decoding performance closer to what is achieved by other
players, including Chromium.

https://bugzilla.gnome.org/show_bug.cgi?id=758195
2015-11-17 12:27:31 -05:00
Reynaldo H. Verdejo Pinochet
2b7a1b4bb9 vp9enc: remove unnecessary NULL check before g_free() 2015-11-15 01:43:08 -08:00
Reynaldo H. Verdejo Pinochet
97a94b02ae vp8enc: remove unnecessary NULL check before g_free() 2015-11-15 01:43:08 -08:00
Thiago Santos
1b27badcfd videoencoders: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and
should be enough

Elements: jpegenc, pngenc, vp8enc, vp9enc, y4menc
2015-08-16 14:30:57 -03:00
Thiago Santos
16fbd4f86f videodecoders: use default pad accept-caps handling
Avoids useless check of downstream caps when handling an
accept-caps query

Elements: jpegdec, pngdec, vp8dec, vp9dec
2015-08-15 11:46:32 -03:00
Tim-Philipp Müller
98527a6ea2 vp8enc, vp9enc: reset multipass file index when stopping encoder
Fixes multipass encoding when re-using the same element/pipeline
for subsequent encoding runs.

https://bugzilla.gnome.org/show_bug.cgi?id=747728
2015-08-15 11:21:02 +01:00
Tim-Philipp Müller
0e10e92953 vp9enc: provide support for multiple pass cache files
Some files may provide different caps insight of one stream. Since
vp9enc support caps reinit, we should support cache reinit too.
If more then file cache file will be created, the naming will be:
cache cache.1 cache.2 ...

Based on patch by: Oleksij Rempel <linux@rempel-privat.de>

https://bugzilla.gnome.org/show_bug.cgi?id=747728
2015-08-15 11:09:42 +01:00
Oleksij Rempel
abc33c928f vp8enc: provide support for multiple pass cache files
Some files may provide different caps insight of one stream. Since vp8enc
support caps reinit, we should support cache reinit too.
If more then file cache file will be created, the naming will be:
cache
cache.1
cache.2
...

https://bugzilla.gnome.org/show_bug.cgi?id=747728
2015-08-14 11:40:58 +01:00
Sebastian Dröge
a0b69c8dac vp[89]enc: Properly convert between GStreamer and encoder timebase
... by switching numerator and denominator when scaling.

https://bugzilla.gnome.org/show_bug.cgi?id=749122
2015-05-12 12:13:16 +03:00
Sebastian Dröge
eb365cc3bb vp[89]enc: Don't set timebase from the framerate
The framerate very often is just an indication of the ideal framerate, not the
actual framerate of the stream. By just using the framerate, we confuse the
rate control algorithm algorithm as multiple frames will map to the same PTS
or have durations of 0.

https://bugzilla.gnome.org/show_bug.cgi?id=749122
2015-05-12 11:54:40 +03: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
Thiago Santos
5c7c90ff2c vp8dec: optimize vpx image to gstbuffer copy when strides match
Solving this FIXME. Copy the full plane when strides are the same
2015-04-17 14:27:27 -03:00
Thiago Santos
3270137702 vp9dec: optimize vpx image to gstbuffer copy when strides match
Solving this FIXME. Copy the full plane when strides are the same
2015-04-17 13:06:41 -03:00
Olivier Crête
12867fcb3d vp8enc: Expose VP8 width/height limitations in the caps template
The VP8 format specification (RFC 6386 section 18.1) specifies
that the maximum size is 16383x16383.
2015-04-01 19:31:18 -04:00
Luis de Bethencourt
3763f4057a vp9enc: remove duplicate declaration of function 2015-03-09 16:25:43 +00:00
Sebastian Dröge
a52e432fda vp[89]enc: Reset the encoder when flushing
https://bugzilla.gnome.org/show_bug.cgi?id=745704
2015-03-09 16:47:57 +01:00
Sebastian Dröge
627e492b7e vp[89]dec: Drop frames that have no output buffer because of errors
finish_frame() assumes that there is an output buffer.
2015-03-05 10:01:09 +01:00
Sebastian Dröge
379621fd0b vp8enc: Use 0 as duration for the EOS "frame" 2015-03-02 15:06:09 +01:00
Sebastian Dröge
51ebca3c03 vp{8,9}enc: Tell the encoder about actual timestamps and durations of frames
... instead of just counting frames. The values are supposed to be in timebase
units, not frame units. This fixes various quality problems with VP8/VP9
encoding and in general makes the encoder behave better.

Thanks to Nirbheek Chauhan for noticing this bug.
2015-03-02 15:03:49 +01:00
Nicolas Dufresne
501a53b26d vpxdec: Fix calculation of width in bytes
Right now we only support I420, but vpx seems to support more formats.
This will prevent hard to find bug in the future.
2015-03-01 14:03:05 -05:00
Nicolas Dufresne
1521f65e8d vpxdec: Don't memcpy in frame map failed
This avoid a crash if mapping the frame failed.
2015-03-01 14:03:04 -05:00
Sebastian Dröge
f4b5107796 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 13:53:02 +01:00
Thibault Saunier
7874bba773 vpXenc: CLOCK_TIME_NONE is not a valid min_latency value
We should just use 0 if we do not have the information
2014-12-09 20:38:22 +01:00
Aurélien Zanelli
d0e8a385e0 vpx: mark arnr-type properties as deprecated and set them to no-op
ARNR type control in libvpx has been deprecated so this commit mark the
vp8enc and vp9enc associated properties as deprecated and change their
behavior to just display a warning message.

https://bugzilla.gnome.org/show_bug.cgi?id=739476
2014-11-10 16:14:17 +01:00
Aurélien Zanelli
130873c8fd vpx: remove compatibility defines
We are guaranteed to have VPX_IMG_FMT_I420, VPX_PLANE_Y,
VPX_PLANE_U and VPX_PLANE_V as we require libvpx > 1.1.0.

https://bugzilla.gnome.org/show_bug.cgi?id=739476
2014-11-01 15:40:44 +00:00
Sebastian Dröge
23a3377b1e vp8enc/vp9enc: Protect the encoder with a mutex in all situations 2014-09-30 11:35:42 +03:00
Sebastian Dröge
df053c997c vp9enc: Allow caps renegotiation
https://bugzilla.gnome.org/show_bug.cgi?id=726329
2014-09-30 11:35:42 +03:00
Sebastian Dröge
ced5d657e3 vp8enc: finish() and drain() should return a GstFlowReturn 2014-09-30 11:35:42 +03:00
Jose Antonio Santos Cadenas
a2e2012ae3 vp8enc: Allow caps renegotiation
https://bugzilla.gnome.org/show_bug.cgi?id=726329
2014-09-30 11:35:35 +03:00
Sebastian Dröge
9eb22a533b vp9dec: Get input width/height from the codec instead of the input caps
They are reported properly by libvpx if the correct struct members are used.
This also fixes handling of resolution changes without input caps changes.

https://bugzilla.gnome.org/show_bug.cgi?id=719359
2014-09-02 09:09:49 +03:00
Tom Greenwood
5430b6c351 vp8dec: Fix for handling resolution changes when decoding VP8
If the resolution changes in the bitstream without the input caps changing we
would previously output corrupted video or crash.

https://bugzilla.gnome.org/show_bug.cgi?id=719359
2014-09-02 08:42:24 +03:00
Thiago Santos
8bee49c85e vp9dec: Fix segfault when a new caps is received
Remember to unref the output caps when a new caps event is received
as it should generate a new one based on the new caps.

https://bugzilla.gnome.org/show_bug.cgi?id=734266
2014-09-02 01:01:43 -03:00
Jose Antonio Santos Cadenas
f22b91dad5 vp8dec: Reset output and input states when changing format
https://bugzilla.gnome.org/show_bug.cgi?id=734266
2014-09-01 23:56:51 -03:00
Edward Hervey
eb30edae9f vp9enc: Don't dereference NULL checks
CID #1197703
2014-06-02 09:47:34 +02:00
Edward Hervey
b4a129ad71 vp8enc: Don't dereference NULL variable
CID #1139838
2014-06-02 09:46:05 +02:00
Edward Hervey
ce4bb3ffef vp8enc: Don't dereference NULL variable
CID #1139838
2014-05-20 08:24:48 +02:00
Edward Hervey
5263f91e13 vp9enc: Don't dereference NULL checks
CID #1197703
2014-05-20 08:24:48 +02:00
Vincent Penquerc'h
1da2fd457d vp9enc: do not dereference NULL pointer
Coverity 1197703
2014-05-05 14:33:38 +01:00
Vincent Penquerc'h
a6e7948711 vp8enc: guard against NULL pointer dereference
Coverity 1139838
2014-05-02 14:02:52 +01:00
Sebastian Dröge
5c8163a685 vpx: Use new gst_video_decoder_set_needs_format() API 2013-12-05 11:42:34 +01:00