Commit graph

4049 commits

Author SHA1 Message Date
Nicolas Dufresne
ab29217726 glimagesink: Keep aspect ratio by default
The expected default behaviour for video sink is to maintain the
aspect ratio. Fix the default value to reflect this. The property
default was already TRUE, but the value was not initially TRUE.
2014-07-09 15:03:53 -04:00
Nicolas Dufresne
25c289f6c4 facedetect: Make cascades dir a little more portable 2014-07-04 21:13:49 -04:00
Nicolas Dufresne
09fc19b83f handdetect: Use already mapped image
No need to map again the image, it's already handled by the base class.
2014-07-04 21:13:49 -04:00
Nicolas Dufresne
efde572cec handdetect: Move size warning in set_caps so it's called once 2014-07-04 21:13:49 -04:00
Nicolas Dufresne
34e23c2e21 faceblur: Port to OpencvVideoFilter base class
This fixes issue whit black frames when special memory, like GlMemory is
in used.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:13:49 -04:00
Nicolas Dufresne
42a83d2c64 cvvideofilter: Don't try to make buffer writable
First this is handle by base transform, hence this is a no-op, and if it wasn't it
would lead to a buffer copy being leaked, and then an unreffed buffer being
pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:13:11 -04:00
Nicolas Dufresne
2acdb2ecf2 cvvideofilter: Check buffer_map return value
Check the resturn value and cleanly fail if we could not mapped the buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=732756
2014-07-04 21:12:38 -04:00
Sebastian Rasmussen
77905f632e mimdec: Print invalid fourcc in error message in hex
Previously this was printed as characters which caused later processing
of the error message to sometimes warn about non-UTF-8 characters.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732715
2014-07-04 17:48:14 +01:00
Arun Raghavan
652f0b4fd2 openni2src: Add proper clean up of OpenNI2 objects
https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
46a7f258a1 openni2src: Don't embed C++ objects in our GObject
Since C++ objects shoudl be properly constructed, we keep only pointers
to them and manually construct them on the heap.

https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
357298c84f openni2src: Close device when stopping the stream
https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
0b6eae66df openni2src: Fix timestamping
OpenNI2 makes no guarantees of timestamp starting from zero, just that
it will be a millisecond timestamp. Make timestamps start from zero
manually so things work correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
6c4269c0e5 openni2src: Make the location property not be mandatory
Our calls to device open already handle the unset location case (by
opening any available device).

https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
7afb4a386a openni2src: Open device on NULL->READY
https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
b6e07e77c2 openni2src: Fix deadlock when _get_caps() is called before READY
The object lock was not being dropped in the empty case. Restructured
the code a bit to make this sort of error less likely.

https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Arun Raghavan
65bddd1e0c openni2src: Mark element as a live source
https://bugzilla.gnome.org/show_bug.cgi?id=732535
2014-07-03 23:08:22 +05:30
Jan Alexander Steffens (heftig)
86080cb5cc rtmpsrc: Report limited bandwidth
Makes uridecodebin treat this source as a stream source,
allowing timeshifting.

https://bugzilla.gnome.org/show_bug.cgi?id=732335
2014-07-01 15:02:37 +02:00
Thiago Santos
f2400d7f16 faceblur: release the haar cascade 2014-06-30 11:54:41 -03:00
Sebastian Dröge
e77a93f6a8 segmentation: Release memory storage in finalize 2014-06-30 00:22:22 +02:00
Sebastian Dröge
d5e7c7bffe textoverlay: Release memory storage and resize image when caps change 2014-06-30 00:18:20 +02:00
Sebastian Dröge
2683c87863 templatematch: Release cvImages when reloading templates are changing caps 2014-06-30 00:15:38 +02:00
Sebastian Dröge
7e0503ca89 pyramidsegment: Release image when changing caps or reusing the element 2014-06-30 00:12:26 +02:00
Sebastian Dröge
e1366c29be handdetect: Release memory storage 2014-06-30 00:09:28 +02:00
Sebastian Dröge
ae1027297c faceblur: Release memory storage
And also release cvImages and memory storage when changing caps or reusing the
element.
2014-06-30 00:07:22 +02:00
Sebastian Dröge
48e95f3d6f edgedetect: Don't leak cvImages when caps are changing or the element is reused 2014-06-30 00:05:53 +02:00
Sebastian Dröge
45ac4ba663 pyramidsegment: Release memory storage when finalizing 2014-06-29 23:43:07 +02:00
Sebastian Dröge
7b63bd6348 schroenc: Remove obsolete FIXME comment 2014-06-29 23:33:20 +02:00
Sebastian Dröge
b4ef216f0b schroenc: Don't leak all input buffers 2014-06-29 23:31:50 +02:00
Sebastian Dröge
dcccabfe22 textoverlay: Free text buffer in finalize 2014-06-29 22:30:56 +02:00
Sebastian Dröge
a84320be50 glimagesink: Chain up to the parent class' finalize function 2014-06-29 22:26:47 +02:00
Sebastian Dröge
f068b64285 glimagesink: Make sure to always unref the display
Even if we didn't create a context yet.
2014-06-29 22:25:43 +02:00
Sebastian Dröge
7f7793ef79 assrender: Make static caps actually static
Otherwise we leak once caps instance on every function call.
2014-06-29 21:05:27 +02:00
Sebastian Dröge
64160a1392 kate: Use G_GSIZE_FORMAT instead of unportable %zu 2014-06-28 23:26:23 +02:00
Thiago Santos
cf76aa2a1d kate: unref events when freeing events list
Instead of just feeing the queue structs
2014-06-27 17:00:03 -03:00
Thiago Santos
c2ebc2349f kateenc: fix segment event leak
gst_event_replace increments the refcount
2014-06-27 16:59:58 -03:00
Matthew Waters
7797b15de7 glshader: enable glshader on GLES2 2014-06-25 18:26:13 +10:00
Julien Isorce
13023f2975 glcolorscale: do passthrough on same caps
See https://bugzilla.gnome.org/show_bug.cgi?id=732178
2014-06-25 06:56:43 +01:00
Julien Isorce
6f45d00a9b gl: enable glvideomixer on GLES2 2014-06-25 06:55:11 +01:00
Matthew Waters
c37ace1844 glvideomixer: bas output width/height on the pad properties
Allows automatic negotiation of the size in the following case:
gst-launch-1.0 glvideomixer name=m sink_0::xpos=0 sink_1::xpos=320 ! glimagesink \
    videotestsrc ! m. \
    videotestsrc pattern=1 ! m.

https://bugzilla.gnome.org/show_bug.cgi?id=731878
2014-06-25 12:00:34 +10:00
Matthew Waters
4c02c4f004 glvideomixer: don't clobber already allocated shader 2014-06-25 10:19:42 +10:00
Sebastian Rasmussen
96c78695f9 curls?ftpsink: Fix memory leaks due to new error handling
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732174
2014-06-24 19:05:34 +02:00
Matthew Waters
5409a3ea2f gl: XInitThreads when env variable is set
This is too allow gst-launch debugging with multiple GL contexts as
well as avoiding segfaulting innocent gtk+ apps that have not called
XInitThreads.

https://bugzilla.gnome.org/show_bug.cgi?id=731525
2014-06-24 23:51:24 +10:00
Koop Mast
386e5774a7 modplug: don't hardcode c++ standard library
Fixes build with llvm on FreeBSD.

https://bugzilla.gnome.org//show_bug.cgi?id=731930
2014-06-22 21:51:21 +01:00
Sebastian Dröge
8a18ac76e1 gl: Need to link to new badvideo library for the video aggregator base class 2014-06-22 18:58:51 +02:00
Thomas Bluemel
b1fac8c781 hlsdemux: Fix decrypting fragments
Only reset the decryption engine on the first buffer of a fragment,
not again for the second buffer.  This fixes corrupting the second
buffer of a fragment.

https://bugzilla.gnome.org/show_bug.cgi?id=731968
2014-06-22 14:21:35 +02:00
Sebastian Dröge
902a9a56d0 waylandsink: Fix compiler warning
gstwaylandsink.c:480:14: error: comparison of constant -1 with expression of
      type 'enum wl_shm_format' is always false
      [-Werror,-Wtautological-constant-out-of-range-compare]
  if (format == -1)
      ~~~~~~ ^  ~~
2014-06-21 16:57:18 +02:00
Thibault Saunier
d516c951e7 gl:glvideomixer: Add the Compositor in the element metadata class
So it is possible to pick one compositing element from the registry
2014-06-20 19:53:33 +02:00
Thibault Saunier
4ce8b409cc gl: Port glmixer to the GstVideoAggregator baseclass
https://bugzilla.gnome.org/show_bug.cgi?id=731921
2014-06-20 19:53:33 +02:00
Sebastian Dröge
95404609c0 hlsdemux: Include the debug string in the error messages we propagate from the
source
2014-06-19 18:34:05 +02:00
Sebastian Dröge
48987fd5a1 hlsdemux: Include a more descriptive error message 2014-06-19 18:34:05 +02:00
Sebastian Dröge
1e795ccce1 hlsdemux: Propagate error messages from the source element up in the hierarchy
Instead of inventing our own generic error strings which are mostly useless.
2014-06-19 18:34:05 +02:00
Sebastian Dröge
213883eb51 hlsdemux: Directly convert GErrors to error messages
This will make sure that we don't leak debug information into the actual
error message string and keep it behind the debug string.
2014-06-19 18:34:05 +02:00
Miguel París Díaz
bf003caf9d gstsrtpenc: unref event when needed
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731768
2014-06-18 15:54:08 +02:00
Wim Taymans
52d4b7de07 srtpenc: improve property comments
Add a Note to the allow-repeat-tx property because it is potentially
insecure when used incorrectly.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731714
2014-06-18 15:37:23 +02:00
Miguel París Díaz
c1052066e8 gstsrtpenc: add allow-repeat-tx property 2014-06-18 15:33:00 +02:00
Lubosz Sarnecki
053252ccc6 opengl: add element for transforming video geometry
* add graphene as soft dependency for linear algebra
2014-06-18 20:41:03 +10:00
Matthew Waters
19e8dbd6ac glfiltershader: port to GLES2
Provide a time variable
2014-06-17 23:21:15 +10:00
George Kiagiadakis
0badc1f5fb waylandsink/wldisplay: verify that all the required interfaces have been found on the compositor
This allows waylandsink to fail gracefully before going to READY
in case one of the required interfaces does not exist. Not all
interfaces are necessary for all modes of operation, but it is
better imho to fail before going to READY if at least one feature
is not supported, than to fail and/or crash at some later point.

In the future we may want to relax this restriction and allow certain
interfaces not to be present under certain circumstances, for example
if there is an alternative similar interface available (for instance,
xdg_shell instead of wl_shell), but for now let's require them all.
Weston supports them all, which is enough for us now. Other compositors
should really implement them if they don't already. I don't like the
idea of supporting many different compositors with different sets of
interfaces implemented. wl_subcompositor, wl_shm and wl_scaler are
really essential for having a nice video sink. Enough said.
2014-06-17 13:51:30 +02:00
George Kiagiadakis
c4616a550a waylandsink: remove the buffer from the surface when going PAUSED -> READY
This essentially hides the video and allows the application to
potentially draw a black background or whatever else it wants.
This allows to differentiate the "paused" and "stopped" modes
from the user's point of view.

Also reworded a comment there to make my thinking more clear,
since the "reason for keeping the display around" is not really
the exposed() calls, as there is no buffer shown in READY/NULL
anymore.
2014-06-17 13:51:30 +02:00
George Kiagiadakis
e5334a1f8b waylandsink/wlwindow: do not commit a resize when it happens due to a video info change
1) We know that gst_wayland_sink_render() will commit the surface
   in the same thread a little later, as gst_wl_window_set_video_info()
   is always called from there, so we can save the compositor from
   some extra calculations.
2) We should not commit a resize with the new video info while we are still
   showing the buffer of the previous video, with the old caps, as that
   would probably be a visible resize glitch.
2014-06-17 13:51:30 +02:00
George Kiagiadakis
04b0e54838 waylandsink/wlwindow: take into account the video aspect ratio when determining the size of the surface 2014-06-17 13:51:30 +02:00
George Kiagiadakis
bda600ed92 waylandsink: improve the way the video size is passed to wlwindow and also improve the code for window creation 2014-06-17 13:51:29 +02:00
George Kiagiadakis
86930cab13 waylandsink: rename pause/resume_rendering to begin/end_geometry_change and update their documentation 2014-06-17 13:51:28 +02:00
George Kiagiadakis
06639dd727 waylandsink: remove the manual synchronization from pause/resume_rendering and use subsurface sync/desync
Previously, in order to change the surface size we had to let the pipeline
redraw it, which at first also involved re-negotiating caps, etc, so a
synchronization with the pipeline was absolutely necessary.

At the moment, we are using wl_viewport, which separates the surface size
from the buffer size and it also allows us to commit a surface resize without
attaching a new buffer, so it is enough to just do:

gst_wayland_video_pause_rendering():
	wl_subsurface_set_sync()
gst_video_overlay_set_render_rectangle():
	wl_subsurface_set_position()
	wl_viewport_set_destination()
	wl_surface_damage()
	wl_surface_commit()
... commit the parent surface ...
gst_wayland_video_resume_rendering():
	wl_subsurface_set_desync()

This is enough to synchronize a surface resize and the pipeline can continue
drawing independently. Now of course, the names pause/resume_rendering are
bad. I will rename them in another commit.
2014-06-17 13:51:28 +02:00
George Kiagiadakis
c17521c096 waylandsink: protect access to properties with the OBJECT_LOCK 2014-06-17 13:51:28 +02:00
George Kiagiadakis
d4d46fa43a waylandsink: protect access to the display with a new display_lock
Access is protected only for setting/creating/destroying the display
handle. set_caps() for example is not protected because it cannot be
called before changing state to READY, at which point there will be
a display handle available and which cannot change by any thread at
that point
2014-06-17 13:51:28 +02:00
George Kiagiadakis
c323171dc1 waylandsink: remove the OBJECT_LOCK from set_caps()
It's not really necessary, this method is protected from GstBaseSink with the PREROLL_LOCK
2014-06-17 13:51:28 +02:00
George Kiagiadakis
db8caa9da4 waylandsink: Replace the OBJECT_LOCK with a private render_lock to lock render operations
This is because:
* GST_ELEMENT_WARNING/ERROR do lock the OBJECT_LOCK and we deadlock instantly
* In future commits I want to make use of GstBaseSink functions that also
  lock the OBJECT_LOCK inside this code
2014-06-17 13:51:28 +02:00
George Kiagiadakis
cffb38993d waylandsink: move surface resizing logic to the GstWlWindow and make it be called from the main thread 2014-06-17 13:51:28 +02:00
George Kiagiadakis
61e077155b waylandsink: cleanup GstWlWindow a bit after the overlaying semantics change
* own_surface is not needed anymore
* gst_wl_window_from_surface is not used externally anymore
* many initializations to 0 are not needed (GObject does them)
2014-06-17 13:51:27 +02:00
George Kiagiadakis
07f671fcaf waylandsink: create and maintain the subsurface inside the sink
This means that the given surface in set_window_handle can now be
the window's top-level surface on top of which waylandsink creates
its own subsurface for rendering the video.

This has many advantages:
* We can maintain aspect ratio by overlaying the subsurface in
  the center of the given area and fill the parent surface's area
  black in case we need to draw borders (instead of adding another
  subsurface inside the subsurface given from the application,
  so, less subsurfaces)
* We can more easily support toolkits without subsurfaces (see gtk)
* We can get properly use gst_video_overlay_set_render_rectangle
  as our api to set the video area size from the application and
  therefore remove gst_wayland_video_set_surface_size.
2014-06-17 13:51:27 +02:00
George Kiagiadakis
b806313396 wayland: add public API for creating & using the display handle GstContext 2014-06-17 13:51:27 +02:00
George Kiagiadakis
c62ec6f815 waylandsink: get the external display handle using GstContext
This drops the ugly GstWaylandWindowHandle structure and is much
more elegant because we can now request the display separately
from the window handle. Therefore the window handle can be requested
in render(), i.e. when it is really needed and we can still open
the correct display for getting caps and creating the pool earlier.

This change also separates setting the wl_surface from setting its size.
Applications should do that by calling two functions in sequence:

  gst_video_overlay_set_window_handle (overlay, surface);
  gst_wayland_video_set_surface_size (overlay, w, h);
2014-06-17 13:51:27 +02:00
George Kiagiadakis
bd5ad17e58 waylandsink: drop width/height arguments from gst_wl_window_new_from_surface() 2014-06-17 13:51:27 +02:00
George Kiagiadakis
0187be8e0c waylandsink: add G_BEGIN/END_DECLS on all headers for consistency 2014-06-17 13:51:27 +02:00
George Kiagiadakis
882e1dd240 waylandsink: fix assertion failure when stopping immediately after starting, without displaying anything
This was triggered in scenarios like
filesrc location=nonexistent_file ! decodebin ! waylandsink
2014-06-17 13:51:27 +02:00
George Kiagiadakis
a543aef5ee waylandsink: Update wl_scaler to version 2 2014-06-17 13:51:26 +02:00
George Kiagiadakis
c86906d76c waylandsink/Makefile.am: Fix scaler-client-protocol.h generation 2014-06-17 13:51:26 +02:00
George Kiagiadakis
87949dcb07 waylandsink: remove unused functions 2014-06-17 13:51:26 +02:00
George Kiagiadakis
2f45d91ccd waylandsink: Add myself to the authors list 2014-06-17 13:51:26 +02:00
George Kiagiadakis
ec18fe8965 waylandsink/wldisplay: bind to the latest available wl_compositor version 2014-06-17 13:51:26 +02:00
George Kiagiadakis
c015a96dda waylandsink: create/destroy the display when entering/leaving the READY state instead of PAUSED
This is the only way to get the negotiation working with the dynamic
detection of formats from the display, because the pipeline needs
to know the supported formats in the READY state and the supported
formats can only be known if we open the display.

Unfortunately,in wayland we cannot have a separate connection to
the display from the rest of the application, so we need to ask for a
window handle when going to READY in order to get the display from it.

And since it's too early to create a top level window from the state
change to READY, create it in render() when there is no other window.

This also changes set_window_handle() to not support window handle
changes in PAUSED/PLAYING (because it's complex to handle and useless
in practice) and make sure that there is always a valid display pointer
around in the READY state.
2014-06-17 13:51:26 +02:00
George Kiagiadakis
f6e824ecba waylandsink: Support all video formats supported by the display 2014-06-17 13:51:26 +02:00
George Kiagiadakis
de15c21413 waylandsink: fix crash in case there is no pool because of a caps negotiation error 2014-06-17 13:51:25 +02:00
George Kiagiadakis
162dbd412c waylandsink: set an empty input region on the video surface 2014-06-17 13:51:25 +02:00
George Kiagiadakis
94d02288d0 waylandsink/wlwindow: reuse code between the two constructors 2014-06-17 13:51:25 +02:00
George Kiagiadakis
a98f589aef waylandsink: increase debug messages 2014-06-17 13:51:25 +02:00
George Kiagiadakis
5bb889a3df waylandsink: Use a boolean in combination with render_cond to comply with GCond's usage documentation 2014-06-17 13:51:25 +02:00
George Kiagiadakis
66f8c1389b waylandsink: Implement expose() and handle resizing properly in non-PLAYING states 2014-06-17 13:51:25 +02:00
George Kiagiadakis
086ac4ee81 waylandsink: Use wl_scaler/wl_viewport to scale the surface in the compositor/hardware 2014-06-17 13:51:25 +02:00
George Kiagiadakis
1cbfba5034 waylandsink: Build bindings for the unstable wl_scaler spec 2014-06-17 13:51:24 +02:00
George Kiagiadakis
12444ec84e waylandsink: Set external surfaces and their child objects to use our own event queue
This fixes weird freezes because of frame_redraw_callback() not being
called from the main thread when it should with weston's toy toolkit.

It's also safer to know that frame_redraw_callback() will always be
called from our display thread... Otherwise it could be called after
the sink has been destroyed for example.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
fabc5305be waylandsink: Wait for the frame_cb to redraw and drop frames meanwhile
We are not supposed to redraw until we receive a frame callback and this
is especially useful to avoid allocating too many buffers while the
window is not visible, because the compositor may not call wl_buffer.release
until the window becomes visible (ok, this is a wayland bug, but...).
2014-06-17 13:51:24 +02:00
George Kiagiadakis
51a2c694ad waylandsink: Handle wl_buffer::release and don't reuse buffers that are not released
This is achieved by adding an extra reference on the buffers, which does
not allow them to return to the pool. When they are released, this reference
is dropped.

The rest complexity of this patch (hash table, mutex, flag, explicit release calls)
merely exists to allow a safe, guaranteed and deadlock-free destruction sequence.
See the added comment on gstwaylandsink.c for details.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
4b2d76873d waylandsink/waylandpool: remove useless munmap call
This data pointer is part of a bigger mmap'ed region,
it has not been returned from mmap itself.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
bf2232c999 waylandsink/waylandpool: call the start/stop methods of the parent class
start() makes sure that the minimum ammount of buffers requested is allocated.

stop() makes sure that buffers are actually destroyed and prevents
filling the file system when resizing the surface a lot, because the
wayland-shm-* files will stay on the file system as long as the wl_buffers
created out of them are alive.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
bf19d792d0 waylandsink/waylandpool: unlink mmaped shm files so that they don't remain on the file system 2014-06-17 13:51:24 +02:00
George Kiagiadakis
e56f305274 waylandsink: implement the GstVideoOverlay & GstWaylandVideo interfaces
This is the initial implementation, without the GstVideoOverlay.expose()
method. It only implements using an external (sub)surface and resizing
it with GstWaylandVideo.
2014-06-17 13:51:24 +02:00
George Kiagiadakis
68133361ec waylandsink: implement with stubs the GstWaylandVideo & GstVideoOverlay interfaces 2014-06-17 13:51:23 +02:00
George Kiagiadakis
26ce7f2344 waylandsink: handle the list of supported formats properly
enum wl_shm_format is not a flags enum, as it may have been in the past,
so multiple formats cannot be stored in a bitfield. Use an array instead.
2014-06-17 13:51:23 +02:00