Commit graph

59 commits

Author SHA1 Message Date
Mathieu Duponchelle
8562f10969 avaudenc: port to send_frame / receive_packet
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
8f3bc07e09 avaudenc: further cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
59b9e66542 avaudenc: install options generically
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
e4bf6147a0 av_codec_next (deprecated) -> av_codec_iterate
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
9cc57a74d8 avaudenc: remove obsolete setting of rc_strategy
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Nicolas Dufresne
aa724e2f14 Use AV_ namespace for all CODEC_ macro
The remaining use of CODEC_ are codec flags that has been moved into the
new codec private properties or have been deperated. Will be fixed in
later patches.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Sebastian Dröge
32addd9757 avaudenc/dec: Blacklist more PCM decoders/encoders 2017-04-13 15:23:45 +03:00
Garima Gaur
14dc964f0e Fix some caps leaks when creating pad templates
https://bugzilla.gnome.org/show_bug.cgi?id=776700
2017-01-02 12:41:20 +00:00
Sebastian Dröge
f1bca3115e avaudenc/dec: Allow compilation against ffmpeg < 3.2 again 2016-10-26 23:29:40 +03:00
Sebastian Dröge
440482475f avaudenc/dec: Ignore S64BE/LE pseudo-codecs 2016-10-26 23:20:52 +03:00
Sebastian Dröge
8443af343e av: Cast AVContext::bit_rate to a guint before passing to varargs functions
We expect it to be a int or uint, however it changed the type to a
int64_t in later versions of ffmpeg. As such it would be passed as a 64
bit value to varargs functions, while the consumer of the arguments
assumes only 32 bits. This causes crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=771092
2016-09-14 11:20:48 +02:00
Sebastian Dröge
3e93ad1bcd libav: Ignore more quasi-codecs 2016-07-22 14:54:21 +03:00
Sebastian Dröge
0bdceaad8a avaudenc: Use gst_caps_fixate() instead of gst_caps_truncate()
Just truncating might not be enough.
2016-07-05 20:16:45 +03:00
Sebastian Dröge
832b42301d avaudenc: Create caps from the codec context after it is opened
We won't get codec_data and various other information otherwise.
2016-07-05 20:16:09 +03:00
Sebastian Dröge
151cd32a10 avaudenc: Set all required fields in the AVFrame
Various functions in libavcodec need them, like the format, sample rate, etc.
and just having them in the context is not enough.

This fixes draining for codecs like MP2 that require a fixed frame size and
require libav to pad the last frame if required.
2016-04-28 18:43:37 +03:00
Sebastian Dröge
3f41aaff30 avaudenc: Also use av_free() instead of g_free() 2016-01-25 20:13:10 +01:00
Sebastian Dröge
a7d9d448bd avaudenc: Use av_malloc() instead of GLib malloc() wrappers for memory freed by ffmpeg
It has its own allocator that is not necessarily doing the same as malloc and
will then usually crash. E.g. on Windows or when memalign() is available.
2016-01-25 20:08:11 +01:00
Sebastian Dröge
46fb2e9f11 libav: Bitrate field changed from int to int64_t, fix compiler warnings
Cast it to a gint64 for now though, as otherwise we will fail compilation
with ffmpeg 2.8.

https://bugzilla.gnome.org/show_bug.cgi?id=757498
2016-01-16 17:23:37 +02:00
Jan Schmidt
30a406591a avvid/audenc: Set some tags in the output for downstream's info
Add the codec name and bitrate into the output for informational
purposes. Bitrate in particular is now used by flvmux to set
videodatarate and audiodatarate in the resulting stream
2015-08-24 00:01:40 +10:00
Thiago Santos
ad215706ec avaudenc: use pad template caps for accept-caps
use template subset check for accept-caps

It is faster than doing a query that propagates downstream and
should be enough
2015-08-17 04:35:41 -03:00
Thiago Santos
15ef18c3e1 avaudenc: remove useless getcaps method
It just calls the exact same function as the default handler
2015-08-16 14:14:27 -03:00
Sebastian Dröge
1dcdeb977c avaudenc: Remember how many samples the codec consumed for telling the base class 2015-06-30 20:01:46 +02:00
Sebastian Dröge
45ab256e54 av{aud,vid}enc: Create wrapped output buffers with GST_MEMORY_FLAG_READONLY
libav might still have references to the buffers itself and uses a writability
system similar to ours based on reference counts.
2015-06-28 16:32:02 +02:00
Sebastian Dröge
3ca7c041b1 avaudenc: Make sure to keep input data alive until libav is done with it 2015-06-28 16:21:33 +02:00
Sebastian Dröge
d6b5fc4f34 av{aud,vid}enc: Stop using deprecated AVFrame APIs 2015-06-28 15:37:23 +02:00
Vincent Penquerc'h
10e0606491 avaudenc: add a comment about using -1 in _finish_frame
See https://bugzilla.gnome.org/show_bug.cgi?id=729268
2014-06-06 12:40:57 +01:00
Vincent Penquerc'h
17e2e9acd9 avaudenc: avoid using wrong number of samples
If audio_in is NULL, we'll send a NULL frame to libav, to flush
the codec. In that case, we won't know how many samples the codec
will have used, so we use -1 (for don't know) when letting the
base class know about the buffer.

Coverity 1195177
2014-06-06 12:29:54 +01:00
Sebastian Dröge
6d92f18d1b avaudenc: Fix leak of AVBufferRef
AVPacket contains AVBufferRef which may leak unless unreffed properly.

https://bugzilla.gnome.org/show_bug.cgi?id=726814
2014-04-29 09:13:44 +02:00
Edward Hervey
3a81f604fe avaudenc: Fix compile without gst debug
We can just re-use the encoder variable
2014-04-14 13:37:02 +02:00
Thiago Santos
845b874575 avaudenc: fix audio encoder flushing according to libav docs
* @param[in] frame AVFrame containing the raw audio data to be encoded.
 *                  May be NULL when flushing an encoder that has the
 *                  CODEC_CAP_DELAY capability set.

The AVFrame itself should be null, not the frame.data pointer

https://bugzilla.gnome.org/show_bug.cgi?id=724536
2014-02-20 17:32:12 -03:00
Vincent Penquerc'h
ca1b5d8576 gst-libav: fix context leaks
A AVCodecContext needs cleaning up before being freed.
Go through all of the allocations/setups to ensure none of them
can leak a context or its contents.
2014-01-15 09:02:33 +00:00
Sebastian Dröge
0a819702c0 avenc: Stop using the removed inter_threshold field 2014-01-03 16:27:34 +01:00
Tim-Philipp Müller
e9e31ebada avaudenc: post better error message if experimental codecs don't work
https://bugzilla.gnome.org/show_bug.cgi?id=691617
2013-10-26 09:34:30 +01:00
Greg Rutz
13ffed87b1 avenc: Add compliance property
Add a new property to GstFFMpegVidEnc and GstFFMpegAudEnc to supply
the "strict compliance" value to AVCodecContext

https://bugzilla.gnome.org/show_bug.cgi?id=691617
2013-10-15 09:27:03 +02:00
Sebastian Dröge
6571196fb8 libav: avcodec_close() also resets fields like the AVCodec
We need to reload the defaults for the codec after closing it,
otherwise we can't access codec information like the supported
sample rates and can crash.

https://bugzilla.gnome.org/show_bug.cgi?id=707040
2013-08-29 16:53:28 +02:00
Tim-Philipp Müller
068be939cb CODEC_ID_* -> AV_CODEC_ID_* 2013-05-06 23:56:22 +01:00
Tim-Philipp Müller
ed6561bee6 avenc_aac: downgrade to RANK_NONE until it gets fixed
Currently just fails to initialize.

https://bugzilla.gnome.org/show_bug.cgi?id=691617
2013-01-22 12:57:41 +00:00
Sebastian Dröge
022ab84288 av: Fix some memory leaks and misuse of libav API 2012-12-17 16:35:36 +01:00
Sebastian Dröge
faf985e8fb avcodecmap: Only set "formats" field on raw audio/video caps 2012-12-17 13:42:13 +01:00
Wim Taymans
b333e1204e avaudenc: init frame with defaults
Init the AVFrame with the right method. This sets the extended_data field
correctly that is needed for some formats (G726 for example).
2012-12-12 16:47:19 +01:00
Sebastian Dröge
cb9e40ff4c avaudenc: Properly handle planar audio formats with more than AV_NUM_DATA_POINTERS channels 2012-12-12 13:04:54 +00:00
Sebastian Dröge
86361bf6df avvidenc: Simplify color formats in the raw video caps 2012-12-11 18:48:34 +00:00
Sebastian Dröge
fbe1221d70 avaudenc: Reorder audio channels if necessary and add proper support for channel layouts 2012-12-11 18:07:34 +00:00
Sebastian Dröge
cab519f370 avaudenc: Add support for planar audio formats 2012-12-05 19:28:33 +01:00
Sebastian Dröge
2d7ebf9514 av: Correctly populate the codec context with the defaults 2012-12-05 19:25:37 +01:00
Sebastian Dröge
d840211412 av: Use av_codec_is_{en,de}coder() API instead of private struct fields 2012-12-05 10:52:34 +01:00
Sebastian Dröge
f5c112990f av: Port remaining simple bits 2012-12-04 18:36:56 +01:00
Luca Barbato
5f03a7d869 av: update to use AVOption variants. 2012-12-04 18:36:30 +01:00
Tim-Philipp Müller
5a823a5fbf avaudenc: log error string as well in debug output 2012-12-02 12:31:43 +00:00
Tim-Philipp Müller
a3d930afbe avaudenc: use sample rate as ticks per second fallback
The 25/1 value presumably came from the video encoder class.
2012-12-01 23:21:41 +00:00