Commit graph

1300 commits

Author SHA1 Message Date
Guillaume Desmottes 669bf98128 ci: run 'cargo outdated' in scheduled jobs
Automatically detect if a crate we are directly using is outdated.
2020-04-10 12:27:38 +02:00
Sebastian Dröge 62c0f5ef42 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-09 16:57:06 +03:00
Sebastian Dröge 9f96c5e573 gstreamer/buffer: Unmap memory in flush() of the Write impl of the buffer cursor
This makes sure that any remaining data is actually written out as part
of the unmapping, which might be necessary depending on the memory type.
2020-04-07 13:47:04 +03:00
Sebastian Dröge 2fbb10ec92 gstreamer/buffer: Only unmap memory in buffer cursor seek impl if we have to move to a different memory
Prevents some unnecessary unmaps.
2020-04-07 13:45:36 +03:00
Sebastian Dröge 35f7c910a9 gstreamer/buffer: Refactor buffer cursor implementation with macros to reduce code duplication 2020-04-07 13:45:36 +03:00
Sebastian Dröge 42d09c2834 gstreamer/buffer: Move BufferCursor/BufferRefCursor into its own module
It's quite a bit of code and can be kept nicely separate.
2020-04-07 12:59:24 +03:00
Sebastian Dröge 5fc68e252d gstreamer: Add missing BufferCursorRef re-export 2020-04-06 21:00:42 +03:00
Sebastian Dröge ee3a8caa7d gstreamer/buffer: Add various tests for the BufferCursor / BufferCursorRef 2020-04-06 20:15:51 +03:00
Sebastian Dröge a884a419db gstreamer/buffer: Add a BufferCursor / BufferCursorRef helper structs
This implements Read/Seek or Write/Seek and allows to read/write/seek
into the buffer without merging the memories inside.

The writer also only maps the memory write-only as compared to all other
ways of accessing the buffer/memory data in a writable way, which have
to map it read-write.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/425
for a similar API proposal for GStreamer core.
2020-04-06 20:15:35 +03:00
Sebastian Dröge 9b782b4dfa gstreamer/buffer: Add tests for various memory related buffer API 2020-04-06 19:29:19 +03:00
Sebastian Dröge 9e0c980a49 gstreamer/buffer: Add iterators for iterating over the memories inside a buffer
With immutable, mutable and owned variant.
2020-04-06 19:28:28 +03:00
Sebastian Dröge 2b70db3a9e 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-06 19:27:40 +03:00
Sebastian Dröge 019afd54f9 Update for new from_glib_borrow signature
See https://github.com/gtk-rs/glib/pull/605
2020-04-05 18:48:48 +03:00
Sebastian Dröge 64368f0e75 Update gir 2020-04-05 18:48:48 +03:00
Sebastian Dröge d3e93f172f gstreamer-base/basetransform: Rename PreparedOutputBuffer and GeneratedOutput enums
PrepareOutputBufferSuccess and GenerateOutputSuccess is more consistent
with what we do elsewhere.
2020-04-02 19:58:47 +03:00
Sebastian Dröge 2006bd51cc gstreamer-base: Add pushsrc subclassing bindings
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/244
2020-04-02 19:58:42 +03:00
Sebastian Dröge 13411b7461 gstreamer-base: Add basesrc alloc() vfunc 2020-04-02 19:58:42 +03:00
Sebastian Dröge 68332e854e gstreamer-base: Add get_allocator() functions to aggregator, basesrc and basetransform base classes 2020-04-02 19:58:42 +03:00
Sebastian Dröge 0651bfb51b gstreamer-audio/video: Make allocator optional in get_allocator() functions for encoder/decoder base classes
They can be and are often None.
2020-04-02 19:58:42 +03:00
Sebastian Dröge 0b0544da63 gstreamer-base/basesrc: Add support for filling the passed in buffer in the create function
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:58:42 +03:00
Sebastian Dröge 7120d54a46 gstreamer/pad: Add tests for getrange functions 2020-04-02 19:58:15 +03:00
Sebastian Dröge d7e6c2e37f gstreamer/pad: Add support for filling the passed in buffer in the getrange function
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:58:09 +03:00
Sebastian Dröge 7c2f3bafa0 gstreamer/pad: Add get_range_fill() and pull_range_fill() functions
These allow providing an already allocated, writable buffer.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/242
2020-04-02 19:57:28 +03:00
Vikram Fugro 0ca6be25c5 examples: remove the use of description() in Error
Replace the use of deprecated method "Error::description()"
with to_string() method
2020-04-01 17:30:17 +03:00
Sebastian Dröge 962da8a63d gstreamer/datetime: Add TryFrom impls for converting between glib::DateTime and gst::DateTime 2020-03-22 14:01:32 +02:00
Sebastian Dröge 7dd0404927 gstreamer/datetime: new_from_g_date_time() can actually return NULL
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/411
2020-03-22 14:01:32 +02:00
Sebastian Dröge ca6bcf36ab examples: Stop using deprecated Error::description() 2020-03-19 14:20:52 +02:00
Sebastian Dröge d0bfdda97f examples: Update for new GLib boxed deriving API 2020-03-19 14:20:52 +02:00
Sebastian Dröge 8bb64bb825 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-03-18 23:54:46 +02:00
mur.at ML group 1ce02d4ce5 add libges-1.0-dev to debian/ubuntu build dependencies 2020-03-13 12:59:52 +01:00
Jan Alexander Steffens (heftig) af27d73e5c
gstreamer: Return &'static str from StructureRef
The names are backed by Quarks and thus eternally valid.
2020-03-12 19:25:12 +01:00
Sebastian Dröge 8a80c2c574 Clean up dependencies for the different target version features
Should speed up the build on the CI a bit.
2020-03-10 11:10:20 +02:00
Sebastian Dröge 755ef9da33 Update CHANGELOG.md for 0.15.4 2020-03-10 10:57:33 +02:00
Sebastian Dröge 8e038572cb 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 13:02:20 +02:00
Sebastian Dröge 8d0fa62275 Minor cleanup in various places 2020-03-09 12:55:14 +02:00
Sebastian Dröge 9d5ae8ed14 gstreamer: Don't take mini objects by value for append() and similar operations
Compared to
  let foo = Foo::bar(foo);
the new form is easier to follow
  foo.bar();
2020-03-07 00:31:30 +02:00
Sebastian Dröge a07d6f2823 Revert "tutorials: Temporarily pin quote to 1.0.2"
This reverts commit bcfc88a560.

It was fixed in the meantime.
2020-03-06 11:17:17 +02:00
Sebastian Dröge b1b0103b3b 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-05 14:05:36 +00:00
Philippe Normand bcfc88a560 tutorials: Temporarily pin quote to 1.0.2
See https://github.com/rust-lang-nursery/failure/issues/342

gstreamer/gst-build#83
2020-03-05 13:28:41 +00:00
Sebastian Dröge b21f576430 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-02-28 16:29:48 +02:00
Sebastian Dröge 98ecef7153 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-02-27 12:10:14 +02:00
Guillaume Desmottes 50234bb5e6 pbutils: encoding_profile: remove get_restriction() from Container API
Same rationale as the preceding commit, restriction isn't meant to be
used with container profiles.
2020-02-26 15:48:53 +05:30
Guillaume Desmottes 745aee629b pbutils: encoding_profile: remove restriction setters from Container API
As stated in the GstEncodingProfile documentation, restrictions are not
meant to be used for container profiles. So remove the APIs allowing to
set one when building and to change it later on.
2020-02-26 15:47:09 +05:30
Sebastian Dröge 7e989631f8 rtsp_server: Add example making use of subclassing RTSPMediaFactory and RTSPMedia 2020-02-24 11:41:35 +02:00
Sebastian Dröge 51545b90f0 rtsp_server: Add support for subclassing RTSPServer and RTSPClient 2020-02-24 11:41:35 +02:00
Sebastian Dröge b49f6320b0 rtsp_server: Add subclassing support for MediaFactory and Media 2020-02-23 10:26:53 +02:00
Sebastian Dröge 1a4487c245 rtsp_server/media: Implement take_pipeline() manually
Because of floating reference problems in the API that have to be worked
around.
2020-02-23 10:03:47 +02:00
Sebastian Dröge 042c1b5fd0 rtsp-server: Add bindings for RTSPThread 2020-02-23 10:03:47 +02:00
Sebastian Dröge e0a71563ba 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-02-22 18:55:56 +02:00
Sebastian Dröge 71497e77de 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-02-22 18:42:02 +02:00