Commit graph

1263 commits

Author SHA1 Message Date
Sebastian Dröge 26beed7277 gstreamer-audio: Follow-up commit for updating audio clipping meta tests 2020-04-30 10:57:03 +03:00
Andrew Eikum d9a06b31de gstreamer-audio: Add support for GstAudioClippingMeta 2020-04-30 10:57:03 +03:00
Sebastian Dröge 5479b23eb9 Use mem::ManuallyDrop instead of mem::forget() everywhere
It makes the intentions clearer and potentially results in simpler
assembly, at least in debug builds.
2020-04-30 10:56:38 +03:00
Sebastian Dröge 973ac7344e gstreamer/buffer: Add tests for various memory related buffer API 2020-04-30 10:56:20 +03:00
Sebastian Dröge 2bbfbb5842 gstreamer/buffer: Add iterators for iterating over the memories inside a buffer
With immutable, mutable and owned variant.
2020-04-30 10:56:13 +03:00
Sebastian Dröge 0749250743 gstreamer/buffer: Add BufferRef::peek_memory_mut() function
This gives a mutable reference to the given memory and fails if the
memory is not actually writable.
2020-04-30 10:56:02 +03:00
Sebastian Dröge e8c5f5fb6b gstreamer/log: Replace % with %% in the debug message
Otherwise gst_debug_log() will look for further arguments that don't
exist, and will likely crash or worse.
2020-04-30 10:54:09 +03:00
Sebastian Dröge 8077b7ac82 Revert "gstreamer/log: Allow any glib::Object as target for logging"
This reverts commit 67e6afc628.

Unfortunately this breaks the API due to how subclassing is modeled in
the GObject bindings.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/251
2020-04-30 10:19:55 +03:00
Sebastian Dröge ef77a5ae92 Update versions to 0.15.4 2020-03-09 23:01:42 +02:00
Sebastian Dröge 079095b55c Update CHANGELOG.md for 0.15.4 2020-03-09 23:01:42 +02:00
Sebastian Dröge 2599acc681 gstreamer/caps: Assert on ANY caps in fixate() and work around bug in handling EMPTY caps
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/388
2020-03-09 23:01:42 +02:00
Sebastian Dröge 671605d8ac Minor cleanup in various places 2020-03-09 22:49:51 +02:00
Sebastian Dröge 01da01c9e6 app: Handle panicking callbacks by converting into an error message
And never calling the callbacks again but instead just failing.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/241
2020-03-09 22:49:51 +02:00
Sebastian Dröge 4e30798ac7 Add #[must_use] attribute to mutex guards / stream lock
It's usually a mistake if creating one of these and immediately dropping
them again as that would immediately unlock the mutex again.
2020-03-09 22:49:51 +02:00
Sebastian Dröge ed80467ff6 Make sure to hold MutexGuard for the remainder of the function in various places
Not assigning it to a variable would cause it to be dropped immediately
and the lock to be released again immediately.
2020-03-09 22:49:50 +02:00
Sebastian Dröge 19295f75b5 rtsp_server: Add example making use of subclassing RTSPMediaFactory and RTSPMedia 2020-03-09 22:49:50 +02:00
Sebastian Dröge e02ec7a8c9 rtsp_server: Add support for subclassing RTSPServer and RTSPClient 2020-03-09 22:49:50 +02:00
Sebastian Dröge 21ffeb5e82 rtsp_server: Add subclassing support for MediaFactory and Media 2020-03-09 22:49:50 +02:00
Sebastian Dröge aa86c804bd rtsp_server/media: Implement take_pipeline() manually
Because of floating reference problems in the API that have to be worked
around.
2020-03-09 22:42:49 +02:00
Sebastian Dröge 38071f1897 rtsp-server: Add bindings for RTSPThread 2020-03-09 22:42:42 +02:00
Sebastian Dröge d429fad50d gstreamer/base_transform: Add support for implementing prepare_output_buffer()
This requires some acrobatics due to inconsistent ownership handling of
the buffers on the C side.
2020-03-09 22:42:35 +02:00
Sebastian Dröge 67e6afc628 gstreamer/log: Allow any glib::Object as target for logging
gst::Object is not actually required. For plain glib::Objects only the
pointer address is printed instead of a name but it works fine.
2020-03-09 22:42:26 +02:00
Sebastian Dröge 0e69898faf Update version to 0.15.3 2020-02-15 10:46:41 +01:00
Sebastian Dröge 45b7676d02 Update CHANGELOG.md for 0.15.3 2020-02-15 10:46:14 +01:00
Sebastian Dröge 315a59e47d Allow changing bus sync handler and appsink/src callbacks when running with 1.16.3 or newer
Previously it was not thread-safe to change them and could lead to
crashes but with 1.16.3 it is now.

Unsetting the bus sync handler before 1.16.3 will have no effect at all,
setting a new bus sync handler or appsink/src callbacks will panic.

This partially reverts 2f88dc6576
2020-02-15 10:35:35 +01:00
Sebastian Dröge 3b56f470e5 Only allow setting Bus sync handler and AppSrc/Sink callbacks once
Re-setting them is not thread-safe and can cause segfaults or worse.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/506
and https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/729
2020-02-15 10:33:53 +01:00
Valmir Pretto 0d34e70e3e gstreamer-app: AppSink futures adapter
An adapter for AppSink that adds futures capabilities to it in the form of a Stream.
2020-02-15 10:29:56 +01:00
Valmir Pretto 7a05ff52af gstreamer-app: AppSrc futures adapter
An adapter for AppSrc that adds futures capabilities to it in the form of a Sink.
2020-02-15 10:29:49 +01:00
Valmir Pretto 66338881e8 gstreamer: BusStream tests 2020-02-15 10:29:43 +01:00
Valmir Pretto 5beb871419 gstreamer: BusStream cleanup
A few small readability changes
2020-02-15 10:29:38 +01:00
Sebastian Dröge 462f4ac3b8 video/video-info: Don't use bool return of gst_video_info_set_format()/align() when running with GStreamer < 1.11.1
The bool return value was added in 1.11.1 and using the return value
with older versions gives a random value that might be true or false,
and then causes spurious errors.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/236#note_399872
2020-02-15 10:15:03 +01:00
Sebastian Dröge a61c50c21a base/base_transform: Fix minor clippy warning
warning: called `map(f)` on an Option value where `f` is a unit closure
   --> gstreamer-base/src/subclass/base_transform.rs:683:13
    |
683 | /             (*parent_class)
684 | |                 .before_transform
685 | |                 .map(|f| f(element.to_glib_none().0, inbuf.as_ptr() as *mut _));
    | |_______________________________________________________________________________^
    |
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
2020-02-15 10:14:54 +01:00
Sebastian Dröge e6d3ac4e4b base/base_transform: Add before_transform/copy_metadata/transform_meta support for subclasses 2020-02-15 10:14:46 +01:00
Sebastian Dröge 89b9dc80dc base/base_transform: Add submit_input_buffer/generate_output support for subclasses
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/155
2020-02-15 10:14:41 +01:00
Sebastian Dröge 9b593f626b gstreamer/promise: Add Future constructor for Promise
This returns a tuple that basically works like a oneshot channel: the
Promise acts as the "sender" and once the promise resolves the
"receiver" contains the result.
2020-02-15 10:14:35 +01:00
Sebastian Dröge 605d4fbf24 video: Add Future variant of convert_sample_async()
Requires to be spawned on the GLib main context futures executor as the
function itself requires a GLib main context to call the callback.
2020-02-15 10:14:22 +01:00
Sebastian Dröge 7fa810873f audio/stream_align: Don't require mutable references in getters 2020-02-15 10:13:48 +01:00
Sebastian Dröge 0ffd86c37e base/flow_combiner: UniqueFlowCombiner::clear() should take &mut self
It's modifying the state of the combiner and requires a unique, mutable
reference.
2020-02-15 10:13:40 +01:00
Sebastian Dröge ea38e022be video: Add VideoConverter bindings 2020-02-15 10:11:41 +01:00
Sebastian Dröge 23fdd2c5ad video: Autogenerate bindings for a few more enums 2020-02-15 10:11:35 +01:00
Sebastian Dröge 3ae8b48400 video/video-frame: Implement immutable frame functions more generically 2020-02-15 10:11:25 +01:00
Sebastian Dröge 188ef1e242 impl Clone for BufferPoolConfig and PlayerConfig 2020-02-15 10:11:19 +01:00
Sebastian Dröge a47a6ea76c Update versions to 0.15.2 2020-01-30 00:20:38 +02:00
Sebastian Dröge e5397f5a33 Update CHANGELOG.md for 0.15.2 2020-01-30 00:20:22 +02:00
Sebastian Dröge 41663f15ef bus: Don't use the bus sync handler in the bus Stream to notify about messages being available
This is racy and can cause the consumer of the messages to never be
woken up anymore:

1. Waker is stored because no message on the bus
2. Sync handler is called, waker is woken up
3. Bus is polled again and no message is on it (yet),
   new waker is registered
4. Bus stores the message from 2. in its queue (after
   the sync handler has returned BusSyncReply::Pass)
5. No new message ever appears on the bus because all
   this happened for the very last message

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/235
2020-01-28 23:43:41 +02:00
Sebastian Dröge 8a9be64c3f Update version to 0.15.1 2020-01-23 08:06:17 +02:00
Sebastian Dröge 3a8ae5ddd4 Update CHANGELOG.md for 0.15.1 2020-01-23 08:06:00 +02:00
Sebastian Dröge fc1e909925 gstreamer/childproxy: Fix unused variable compiler warnings 2020-01-22 22:31:10 +02:00
Sebastian Dröge 5577e8a457 Don't derive Debug impls for generic types where the type parameters don't have to impl Debug themselves
This allows to use MappedBuffer and similar types to be properly
debug-printed.

Also change VideoFrame/VideoFrameRef/RTPBuffer from a tuple struct to a
struct with proper field names to make the code easier to understand.
2020-01-22 22:31:10 +02:00
Sebastian Dröge 456ad9fb4a gstreamer/childproxy: Don't require implementing child_added/removed() signal vfuncs
Most implementers will not care about default handlers for these signals
so requiring to implement them is only unnecessarily verbose.
2020-01-22 22:31:10 +02:00