Commit graph

700 commits

Author SHA1 Message Date
Sjoerd Simons
19e81024a3 Always give the most video restricted caps possible
When the video caps aren't fixed yet, make sure we return the most
precise set of caps. It seems a regression was introduced in cc082f,
causing restricted caps to never be used if the context == NULL

None of the restricted caps generation uses the context, so no need to
check whether the context.

Fixes bug #578160.
2009-11-10 12:30:50 +01:00
Edward Hervey
a1384f990b ffmpegdec: Only restore default in AVCodecContext when needed.
Resetting default values is currently very complex in libavcodec, so
we only call it when needed (i.e. when a context was previously used).

Shaves off 10% of the setup of a decoder.
2009-11-09 19:21:35 +01:00
Tim-Philipp Müller
72cd8f1843 ffmpegdec: printf format fixes 2009-11-05 23:54:47 +00:00
Edward Hervey
019a6020e4 ffdec: Don't use an allocated 1-entry structure for private data.
If there's only one entry, just use that entry.
2009-11-02 09:06:46 +01:00
Edward Hervey
bd1b315c43 ffmux: avoid generating caps when registering
Don't generate caps when we register the class but delay that till when
we actually create an instance of the class.
2009-11-02 09:06:40 +01:00
Edward Hervey
e8c689fe94 ffdemux: avoid generating caps when registering
Don't generate caps when we register the class but delay that till when
we actually create an instance of the class.
2009-11-02 09:06:05 +01:00
Edward Hervey
a7dd30d8eb ffenc: avoid generating caps when registering
Don't generate caps when we register the class but delay that till when
we actually create an instance of the class.
2009-11-02 09:06:05 +01:00
Wim Taymans
343c82b18c ffdec: avoid generating caps when registering
Don't generate caps when we register the class but delay that till when
we actually create an instance of the class.
2009-10-22 16:27:28 -04:00
Sebastian Dröge
2ed8b6728d ffmpegenc: Add a note to the buffer-size property description
Setting it has no effect anymore and is deprecated.
2009-10-08 13:54:45 +02:00
Sebastian Dröge
087582d7cd Revert "ffenc: Make the buffer-size property read-only"
This reverts commit 98439aacc7.

Instead of printing a warning when trying to set the property
it should do nothing as before and the property description
should contain a note that setting it has no effect.
2009-10-08 13:52:22 +02:00
Sebastian Dröge
98439aacc7 ffenc: Make the buffer-size property read-only
...instead of just doing nothing when setting it. This makes sure
that people notice that they shouldn't set the property because
it creates a warning now.
2009-10-08 12:29:30 +02:00
Sebastian Dröge
c914f08b40 ffenc: Make sure to always provide large enough buffers
For audio always add the minimum ffmpeg buffer size, for video
use the same weird buffer size as they use in ffmpeg.c:
width*height*6 + 200

Also make setting of the buffer-size property a no-op.

Fixes bug #593651.
2009-10-07 09:15:40 +02:00
Sebastian Dröge
3a96bed6e6 ffmpegenc: Use dash instead of underscore in property names
GLib internally converts them to dashs anyway.
2009-10-07 09:13:56 +02:00
Sebastian Dröge
ee31435d49 Revert "ffmpegenc: Use dash instead of underscore in property names"
This reverts commit b814d25cc9.
2009-10-01 17:03:49 +02:00
Sebastian Dröge
25003e4307 Revert "ffenc: Make sure to always provide large enough buffers"
This reverts commit d9f6febe70.
2009-10-01 17:03:42 +02:00
Sebastian Dröge
799b19c2f2 Revert "ffmpegenc: Also add FF_MIN_BUFFER_SIZE to video buffers too"
This reverts commit 577525af3d.
2009-10-01 17:03:33 +02:00
Sebastian Dröge
577525af3d ffmpegenc: Also add FF_MIN_BUFFER_SIZE to video buffers too
Just to make sure we never get below it in case of very small videos.
2009-10-01 16:46:34 +02:00
Sebastian Dröge
d9f6febe70 ffenc: Make sure to always provide large enough buffers
For audio always add the minimum ffmpeg buffer size, for video
use the same weird buffer size as they use in ffmpeg.c:
width*height*6 + 200

Also make setting of the buffer-size property a no-op.

Fixes bug #593651.
2009-10-01 16:44:22 +02:00
Sebastian Dröge
b814d25cc9 ffmpegenc: Use dash instead of underscore in property names
GLib internally converts them to dashs anyway.
2009-10-01 16:20:13 +02:00
Wim Taymans
b85d889582 ffdec: correctly check for NONE timestamp 2009-09-10 14:11:18 +02:00
Wim Taymans
669a0e359a ffmpeg: add support for G721
Add support for g721, which is like G726 but with 1 channel, 8KHz and a bitrate
of 32000.

Fixes #594454
2009-09-09 13:35:20 +02:00
Jonathan Matthew
595de04316 codecmap: don't set channel-positions for common mono and stereo cases 2009-09-08 15:29:24 +02:00
Wim Taymans
46bf3b92d0 ffdec: disable interpolation when dropping frames
When we are dropping frames because of QoS disable the DTS interpolation because
we won't be able to update the timestamps and end up setting the wrong
timestamps. Instead, simply use the timestamps from ffmpeg.
2009-09-01 21:42:26 +02:00
Tim-Philipp Müller
0044128487 typefinders: skip ffmpeg typefinders if there isn't enough data
ffmpeg typefinders don't do bounds checking for small chunks of
data, so just skip them if we don't have a lot of data, to avoid
invalid memory access and/or crashes.
2009-08-21 02:58:58 +01:00
Wim Taymans
2b967b4122 ffdec: reset timestamp queue after flush 2009-08-18 13:20:55 +02:00
Tim-Philipp Müller
37875a95eb Lower minimum sample rate in generic template caps from 8000 to 4000
Fixes playback of ADPCM clip (#591809).
2009-08-14 16:09:05 +01:00
Sebastian Dröge
5497a8d140 ffmpegdec: Fix strict aliasing warnings 2009-08-13 17:38:32 +02:00
Sebastian Dröge
6923de9378 ffmpegdec: Don't use guintptr as it's new in GLib 2.18
Fixes bug #591469.
2009-08-12 10:57:18 +02:00
Edward Hervey
305e80e7d6 gstffmpeg: Lower debugging levels from WARNING to DEBUG
These statements aren't critical per se... and just clutter debug logs.
2009-08-10 12:04:39 +02:00
Sebastian Dröge
0111edbf5d ffmpegenc: Return all supported caps instead of only the first 2009-08-09 09:47:26 +02:00
Sebastian Dröge
d181dbd7a0 ffmpegenc: If an encoder lists the supported pixfmts use them to create the caps
...instead of creating standard caps with all pixfmts.

Fixes bug #591038.
2009-08-08 22:43:06 +02:00
Sjoerd Simons
ea6a66b5b3 ffmpegdec: Fix duration calculation when ticks_per_frame isn't 1
Fixes bug #591163.
2009-08-08 22:20:03 +02:00
Sebastian Dröge
1c283b8c22 ffmpegdec: Fix compiler warning and indention 2009-08-06 06:57:18 +02:00
Руслан Ижбулатов
54428c186b ffmpegdec: Assign offsets to outgoing buffers more accurate
This now uses ffmpeg functionality to keep random metadata next to
the buffers and to get the correct offset for a frame, similar to how
timestamps are handled.

Fixes bug #578278.
2009-08-06 06:57:09 +02:00
Edward Hervey
56887682d0 gstffmpegenc: Try getting the caps for the declared pixfmt without a context.
PixFmt that are declared in AVCodec.pix_fmts are ones which are 'officially'
declared as being supported. We should therefore not have to create a
AVCodecContext and open an encoder to know if it's supported or not.
Also, doing it this way allows us to better pickup configuration overrides
we have in gstffmpegcodecmap for some codecs (like restrictions on width,
height, framerate like it's the case for dnxhd).

Fixes #575545
2009-07-31 13:27:28 +02:00
Olivier Crête
597f32e895 ffmpegdec: Disable theora decoder
The wrapper does not give the decoder the extradata correctly.
Just use theoradec.

Fixes bug #590172
2009-07-29 14:49:56 -04:00
Руслан Ижбулатов
a5f9485917 Codec frame delay fix and trailing zero-length frame fix
Takes codec frame delay into account (roughly the same way it does for timestamps for reordered frames) to produce frames with correct offsets.
A special hack to allow trailing frame with timestamp=segment.stop to be displayed.

Fixes bug #578278.
2009-07-29 14:19:20 +02:00
Tim-Philipp Müller
508ab716b0 ffmpegdemux: use gst_element_found_tags() for global tags
So we get a message on the bus *and* tag events pushed downstream.
2009-07-28 23:58:02 +01:00
Tim-Philipp Müller
d917f59a84 ffmpegdemux: cache events from upstream and re-send them later
Cache any events we get from upstream before we're open, especially
tag events we may be getting from apedemux/id3demux or the like, and
push them downstream later when we've added our pads instead of just
dropping them silently. Fixes transcoding tags for Monkey's Audio
Files with preceding APE or ID3v2 tags (#586957). Add minimal unit
test for this.

Also push stream tags later after the global tags and the newsegment
event rather than right after creating the pad.
2009-07-28 23:58:02 +01:00
Jordi Mas
c27b4babf1 ffmpegmux: Add proper audio mapping for DVD muxer. Fixes #588546 2009-07-20 11:48:45 +02:00
Tim-Philipp Müller
2f8f014d9b ffmpegmux: don't leak caps if type already exists
We don't know if gst_element_register() will replace the known type
or reject it, so we really need to free the caps before.
2009-07-01 10:45:32 +01:00
Tim-Philipp Müller
048b0145a8 ffmpegdemux: post tags after the initial newsegment event 2009-07-01 10:45:32 +01:00
Wim Taymans
fe10ecd097 ffdec: don't wait for keyframe after discont
After a DISCONT, mark the next frame with DISCONT but don't wait for a new
keyframe. This greatly improves performance on lossy networks or currupted
frames as the decoder can usually continue and conceil errors up to the next
keyframe.
2009-07-01 11:23:59 +02:00
Wim Taymans
31a9d9330b Merge branch 'master' of ssh://git.freedesktop.org/git/gstreamer/gst-ffmpeg 2009-07-01 11:21:46 +02:00
Edward Hervey
fe2291e9e1 gstffmpegdec: Fix debug arguments. Fixes #587297 2009-06-29 13:53:50 +02:00
Arnout Vandecappelle
0192717045 ffmpegdec: don't drop buffers when caps change.
Fixes #585257
2009-06-25 16:05:56 +02:00
Jan Schmidt
473d7391a9 ffmpeg: Don't enter infinite loops in the timestamp tracking
Avoid an infinite loop consuming buffer timestamp info when
the video frames contain only GST_CLOCK_TIME_NONE timestamps.

Add some debug logging in the timestamp tracking paths.

Fixes: #585845
2009-06-24 15:20:12 +01:00
Stefan Kost
8e798e0082 debug: fix unused variable when building with debug disabled 2009-06-17 09:22:14 +03:00
Wim Taymans
608a920771 ffmpegdec: don't do QoS on invalid timestamps
When we convert the timestamp to running_time, don't try to do QoS on invalid
times.

Fixes #580810
2009-06-05 13:47:15 +02:00
Jordi Mas
cfbb046f1e ffmpeg: make elements reusable after registry rescan
If the same instance of the plugin is asked to be initialised more that once,
instances after the first one do not register the elements properly and the
elements become not usable.

For example, if you call gst_update_registry (), is not possible to create
elements after the call since the plugin is asked to be initialised again and
does not register the elements.

Fixes #584291
2009-06-05 13:19:03 +02:00
Wim Taymans
686aadaf01 ffmpeg: properly integrate timestamp handling
The patch from Bug #580796 hacked around existing infrastructure to handle
timestamps as DTS (as in all AVI files) causing the logic to be disabled.

Properly hook the timestamp handling into the existing infrastructure to handle
these cases too, partially reverting a26b94d92c
and moving some stuff around.

Refixes #580796.
2009-06-05 12:32:25 +02:00
Wim Taymans
54273a5771 enc: use standard multipass-cache-file
Deprecate the old statsfile property and add a the new standard
mulitpass-cache-file property to match other encoders.
Fixes #583627
2009-05-25 12:36:06 +02:00
Jan Schmidt
81e91e54c1 ffmpeg: Don't add sink pad template to the muxers when not needed.
If the set of caps for either audio or video is completely empty, skip
adding that pad template to the class. Some muxers only support audio-only
or video-only and otherwise end up with EMPTY caps in the pad template.
2009-05-20 10:59:47 +01:00
Wim Taymans
ff2f62ac8a ffenc: avoid malloc more for audio encoders
Use _adapter_peek() to retrieve data so that we can reuse previously
allocated memory.
2009-05-13 23:18:50 +02:00
Edward Hervey
9fdc5a5d64 gstffmpegdec: demote mpeg2 video decoding back to MARGINAL. Fixes #574461 2009-05-13 19:35:32 +02:00
Sebastian Dröge
63a4d4f332 Add mapping for VQF caps 2009-05-13 16:21:36 +02:00
Edward Hervey
ee5a964293 gstffmpegdec: Don't forget to copy over the reordered_opaque in our buffers.
This is to be on-par with the default get_buffer() implementation (which is
detailed in libavcodec/utils.c).
2009-05-13 13:47:58 +02:00
Vanista
a26b94d92c gstffmpegdec: Handle out-of-order frames. Fixes #580796 2009-05-13 12:45:38 +02:00
Wim Taymans
e2dd913f4c ffenc: make the output buffer big enough
The ffmpeg docs say that the output buffer should at least be
FF_MIN_BUFFER_SIZE (which is overly large, but anyways).
2009-05-13 11:21:35 +02:00
Wim Taymans
25b41829b9 ffmpeg: rewrite audio encoders.
Rewrite the audio encoders to use the right API functions of ffmpeg. Also get
rid of the handrolled cache and use adapter instead for formats that require
fixed frame_size as input.
2009-05-13 01:04:30 +02:00
Wim Taymans
92b8a5adc9 codecmap: revert bogus commit.
We don't need to set a default frame_size, ffmpeg has set this value to 0 to
inform us that there is a fixed relation between the amount of input samples
and output samples. Now we only need to implement handling that fact.
2009-05-12 22:20:49 +02:00
Edward Hervey
a0c7a2d0c5 ffmpegcfg: Expose two more CODEC_FLAG. 2009-05-12 18:13:16 +02:00
Edward Hervey
f384b2a006 gstffmpegdec: No, really, we don't want the VDPAU decoders.
They've changed the names, keeping the old ones til we switch upstream
revision.
2009-05-12 15:30:10 +02:00
Sebastian Dröge
b9617cac31 ffdec: Update rank of ffdec_mpeg2video to SECONDARY to make it the default
ffdec_mpeg2video is much faster, fixes bug #574461.
2009-05-12 11:21:01 +02:00
Edward Hervey
fb613191ae gstffmpegdec: Implement interlaced support.
ffmpeg only tells us on a per-decoded-buffer basis if the stream is
interlaced or not. When we see a change, we force negotiation.

We can't detect that in our get_buffer() (when doing downstream allocation),
because at that point the interlaced flags aren't set on the outgoing
buffer.
2009-05-12 11:16:43 +02:00
Edward Hervey
36bdeea0e7 win32: Fix non-portable printf format. 2009-05-09 10:57:55 +02:00
David Hoyt
da8d4abad2 Use av_{i,o}format_next instead of the private next field
This fixes compilation with MSVC where the initializer variables
are aliased to different names. Fixes bug #576126.
2009-05-07 12:57:10 +02:00
Sebastian Dröge
c2a9ee9264 ffenc: Implement preset interface 2009-05-04 13:00:49 +02:00
Thiago Santos
9133bb9ba2 ffenc: Send error upstream when gst_pad_push return is different from GST_FLOW_OK 2009-04-23 14:35:10 -03:00
Edward Hervey
f07223fd24 gstffmpegenc: Don't change properties once opened. Fixes #570815
Based on a patch by Tristan Matthews <le businessman at gmail dot com>
2009-04-21 18:38:03 +02:00
Janin Kolenc
ec5ad411a5 gstffmpegcfg: Add H263 to the list of mpeg property-compatible codecs. 2009-04-21 18:34:22 +02:00
Edward Hervey
57e66c5a22 Make sure we provide ffmpeg with 128bit-aligned data.
Add a new function new_aligned_buffer() which creates a GstBuffer of
the requested size/caps, with the memory being allocated/freed by ffmpeg's
av_malloc/av_free which guarantees properly aligned memory.
Added a can_allocate_aligned internal property which we use to figure out
whether downstream can provide us with 128bit aligned buffers.
2009-04-21 18:28:54 +02:00
Edward Hervey
ea76b43723 Reverting Jan's fix-the-buildbot commit
This reverts commit 5465d40b8d.
2009-04-19 14:07:58 +02:00
Jan Schmidt
5465d40b8d build: Deliberately break the build, temporarily.
This is to force the buildbots to run autogen.sh one time. I can't
figure out a more elegant way.
2009-04-19 02:42:20 +01:00
Edward Hervey
ae018718d4 gstffmpegdec: Really fix the arguments this time.
I blame compilers who can't figure out there's the wrong number of arguments
for the given print format :)
2009-04-18 09:08:39 +02:00
Edward Hervey
199d95c390 gstffmpegdec: Fix build on macosx.
The arguments were in the wrong order (and therefore the types were wrong).
2009-04-18 08:50:12 +02:00
Wim Taymans
010871cb77 ffmpegdec: resize padding buffer when it's small
Only resize the padding buffer when the size is too small, when it's just right,
we don't need to call realloc.
2009-04-17 19:07:26 +02:00
Wim Taymans
11db4588a6 ffmpeg: add default frame_size for g726
Without a frame_size configured in the context, the ffmpeg encoders do nothing.
Since the G726 does not configure a size itself, we set ourselves a frame_size
that corresponds to 20ms of audio, which is a reasonable default.
2009-04-17 16:27:09 +02:00
Edward Hervey
cbea9841ec gstffmpegutils: Add the files :) 2009-04-16 11:00:46 +02:00
Edward Hervey
cc7ce2639c Move all non-codecmap-related methods to a new file.
We were starting to get too much unrelated code in there. This makes it
a bit easier to maintain.
2009-04-15 22:33:16 +02:00
Edward Hervey
55336b1c5c gstffmpeg.c: Fix the description of the plugin. 2009-04-15 22:14:09 +02:00
Edward Hervey
05a1470151 gstffmpeg.c: Point to the new ffmpeg website (ffmpeg.org). 2009-04-15 22:11:33 +02:00
Edward Hervey
f3c1a56a60 The proper spelling is 'FFmpeg'. 2009-04-15 22:11:10 +02:00
Edward Hervey
d39ad81ad7 gstffmpegmux: Use the AVFormat long_name in our descriptions.
This is the same behaviour we use in the demuxers.
2009-04-15 22:04:02 +02:00
Edward Hervey
9b8a99761a Disable more fake codecs (raw audio). 2009-04-15 21:56:00 +02:00
LRN
2b25dbe12e ffdec: copy input offsets to output buffers
Copy the incomming offsets to the outgoing buffers.
Fixes 578278.
2009-04-10 00:19:50 +02:00
Janin Kolenc
a44f5b4df3 ffenc: Add support for I-frame request.
Add request for I-frame request using GstForceKeyUnit event.
Fixes #575709.
2009-03-25 12:51:55 +01:00
Sebastian Dröge
3fcef3b6a7 ffmux: Actually set caps on the srcpad instead of working with NULL caps 2009-03-23 14:07:06 +01:00
Edward Hervey
7ca2836193 Take into account ticks_per_frame for framerate calculation. Fixes #575759 2009-03-17 23:45:34 +01:00
Edward Hervey
983d2f2b36 Re-enable amr muxer. It's a muxer after all. Fixes #575664 2009-03-17 11:51:28 +01:00
Edward Hervey
59796dd0bc gstffmpegdec: Disable vdpau decoders. Fixes #573400 2009-03-11 13:25:40 +01:00
Edward Hervey
2df7d3e960 pixfmt: Stop using PIX_FMT that were marked as deprecated 3 years ago.
It still worked... until the 0.5 ffmpeg release, which made those defines unused.

See the bottom of libavutil/pixfmt.h for more details.
2009-03-11 12:56:29 +01:00
Edward Hervey
45ec23e37c codecmapping: Fix caps for ATRAC3. Fixes #574663 2009-03-10 21:14:21 +01:00
Edward Hervey
1e689f057f Disable exposing decoder/encoder using external library. Fixes #574746 2009-03-10 21:11:43 +01:00
Edward Hervey
ca1321b224 blacklist bogus demuxer/muxer/typefind. Fixes #567336 and #574814 2009-03-10 21:05:52 +01:00
Edward Hervey
8cfa2c4314 gstffmpegdec: Use 64bit scaling function to avoid overflows detected in some situations. 2009-03-09 18:18:24 +01:00
Edward Hervey
146aab9dcb demux: If the demuxer isn't initialized yet, forward serialized events without waiting.
We do this, because the demuxer is initialized in the loop function. If it's not
initialized yet, that means the loop hasn't been entered... and therefore the
PIPE GCond will never be signalled.
2009-03-09 15:09:10 +01:00
Edward Hervey
f8e3a0007f demuxers: Blacklist push-mode for avformat demuxers which aren't reliable in push-mode.
Currently, only one is blacklisted : ffdemux_ape. This has been confirmed by
ffmpeg developers.
2009-03-09 13:46:06 +01:00
Edward Hervey
3f34bf8ef4 demuxers: Add more debugging 2009-03-09 13:45:22 +01:00
Edward Hervey
cc9dace674 gstffmpegcodecmap: Add proper caps for Fraps video codec 2009-03-09 10:07:39 +01:00