Commit Graph

46 Commits

Author SHA1 Message Date
Tats
093a10de7b Removed unused variable _currentMovie. 2014-10-23 16:37:08 +00:00
Tats
5cb66e6175 Don't ask to change movie rate if calling setRate() with the same rate to avoid pausing and playing pipeline. 2014-10-23 16:36:55 +00:00
Tats
a50d44da23 Merge branch 'develop' of github.com:mapmapteam/mapmap into develop 2014-10-21 20:14:07 +00:00
Vasilis Liaskovitis
c4c7d9a8ef MediaImpl:: do not call updateRate() on GST_MESSAGE_ASYNC_DONE (bug #51)
GST_MESSAGE_ASYNC_DONE is received when elements finish changing state. If we
initiate an updateRate here, we keep generating seek events in a loop forever,
pausing and re-starting the pipeline without reason.
2014-10-21 21:47:09 +02:00
Tats
898eb67f9d Fixed bug where movie was constantly polled for seeking and paused/played. 2014-10-21 19:24:56 +00:00
Tats
db97f6dcf5 Implemented basic control of rate (reverse playback not yet operational so disabled option in the gui). 2014-10-21 16:20:20 +00:00
Tats
f9d51e6880 More cleanups and documentation in media related stuff. 2014-10-20 19:10:08 +00:00
Tats
7fe2a1f1a7 Bugfix #30 : Reimplemented MediaImpl removing the defective queue system and implementing a thread-safe system. Removed the memory leaks previously shown by valgrind. 2014-10-20 17:00:22 +00:00
Alexandre Quessy
4ea8f78c94 Merge branch 'develop' of github.com:mapmapteam/mapmap into develop
Conflicts:
	MediaImpl.h
2014-10-20 12:12:03 -04:00
Alexandre Quessy
a9898f4585 Fix a memory leak with the shmsrc poller 2014-10-20 12:08:59 -04:00
Tats
2d55e6d9c6 Free memory from call to gst_structure_to_string(). 2014-10-20 11:54:21 +00:00
Tats
2022379c81 Unref more leaking samples in MediaImpl.cpp (queues are kept at a limited size). 2014-10-20 11:53:46 +00:00
Vasilis Liaskovitis
c85b4e073c MediaImpl: move buffer processing in gstNewSampleCallback (bug #30)
Buffer releasing should happen independently of videoPull() getting called for
texture updates. We move all processing and buffer unreferencing in
gstNewSampleCallback. This way we don't run out of memory in case of video
pipeline playing without texture/mappings.
2014-10-20 10:14:38 +00:00
Vasilis Liaskovitis
835165c89a Fix some issues with shmsrc pipeline and video dimensions (bug #29)
Shmsrc seems to work with a gstreamer 1.4 build, but not with distro gstreamer
(segfault due to missing fix https://bugzilla.gnome.org/show_bug.cgi?id=731093)
Reader / writer of live source need to be using same gstreamer build, otherwise
some pipeline problems appear in deserializing and caps detection.

Playback of the first shape mapped with the live source doesn't seem to work (?),
so this bug stiil needs investigation.
2014-10-18 19:03:06 +02:00
Tats
d667313ce8 Merge branch 'develop' of github.com:mapmapteam/mapmap into develop
Conflicts:
	MainWindow.cpp
	MediaImpl.cpp
2014-10-18 13:22:36 +00:00
Alexandre Quessy
436dc9d5a0 Refactor the pipeline + fix merge shmsrc feature 2014-10-18 12:17:38 -04:00
Tats
c9b0888231 Reenabled seeking when clip is over (loop) without having to reload the movie. 2014-10-18 13:11:21 +00:00
Tats
6f015b1cb8 Moved gst_init() in main application and added gst_deinit(). 2014-10-18 10:05:53 +00:00
Tats
d3c54a183f Merge branch 'develop' of github.com:mapmapteam/mapmap into develop 2014-10-16 21:47:31 +00:00
Alexandre Quessy
880cf70e93 Check if file exists before creating the pipeline 2014-10-16 20:30:20 -04:00
Tats
bafff221bd Merge branch 'feature/shmsrcbin-rebase-oct2014' of https://github.com/vliaskov/libremapping into feature-merge-vliaskov-shmsrcbin
Conflicts:
	MainWindow.cpp
	MainWindow.h
	MediaImpl.cpp
	ProjectReader.cpp
2014-10-16 21:46:33 +00:00
Vasilis Liaskovitis
f3e94f743c Support shmsrc (live source)
If the imported file is a socket path, we mark the media as "live". We
continuously poll for the socket path (in case e.g. it disappears / reappears).
As soon as the source socket patch exists, we connect a shmsrc ! gdpdepay
pipeline  (instead of a normal uridecodebin element for file-based media) and we
set the pipeline state to PLAYING (playAction button is not needed at the moment
for live sources, but we can change behaviour to only start the pipeline if
play is selected, like with normal file-based media)

In case of a GST_MESSAGE_ERROR, the polling function keeps looking for the
socket path until it exists again. The existing shmsrc pipeline is re-used
once the live source is transmitting again.

Tested with live source gst-launch-1.0:

gst-launch-1.0 uridecodebin uri=file:////opt/Videos/test.avi !  queue !
videoconvert ! video/x-raw, format="RGBA" ! gdppay ! shmsink
socket-path=/tmp/sock  shm-size=100000000

The live source was interrupted and restarted again, and the shmsrc in mapmap is
able to pick up the reappearing media stream.

Signed-off-by: Vasilis Liaskovitis <vliaskov@gmail.com>
2014-10-13 16:07:50 +02:00
Tats
2e7eb8d5b0 Major cleanup in MediaImpl 2014-10-12 00:12:04 -05:00
Tats
4246c5a3b4 Bugfix: video size was not properly set for many videos. 2014-09-16 20:54:40 -04:00
Tats
cb0deae5f1 Base implementation of play/pause/rewind (working, still adjustments to do in the GUI) 2014-06-23 16:54:44 -04:00
Vasilis Liaskovitis
78d8f88e52 MediaImpl: Do buffer pull in "new-sample" gstreamer callback
Doing the buffer pull in the gstreamer "new-buffer" callback decreases the work
needed to be done by the videoPull() thread. This seems to give lower average
timestamps between successive draw/updatecanvas() calls, so perhaps better
framerates can be achieved.

In order to decouple videoPull from pulling the buffer, an async queue is
introduced between the gstreamer "new-sample" callback and the qt videoPull
function. On the release path, gst_sample_unref is decoupled from the qt side by
putting the already used frame in an output async queue. The bffers in the queue
are unreferenced in the gst "new-sample" callback.
2014-05-10 16:26:37 +02:00
Vasilis Liaskovitis
4c80d2c543 MediaImpl: ALways do memcpy, no conversion needed
Because of the RGBA caps, bpp will always be 32
2014-05-10 16:11:59 +02:00
Alexandre Quessy
4776dd2717 fix 2014-05-09 20:20:43 -04:00
Vasilis Liaskovitis
7177796844 MediaImpl: always set bitsChanged to true to avoid texture "flickering" 2014-05-09 14:57:30 -04:00
Vasilis Liaskovitis
f914b84be6 MediaImpl: remove gst_sample_ref to avoid leak
The gst_sample pulled from the appsink is already reference counted. We just
need to unref it after copying it, which we do.

If we reference it again, the sample/buffer is not freed - I have seen the app
crashing while consuming most of system memory (can lead OS to out-of-memory
condition) before this commit.
2014-05-09 14:57:15 -04:00
Vasilis Liaskovitis
b818fd3926 "new-sample" callback should return GstFlowReturn 2014-05-09 14:57:00 -04:00
Alexandre Quessy
f4ecddd664 we can assume depth and bpp of 32 2014-05-08 16:38:18 -04:00
Alexandre Quessy
f23fa9cb9d add a FIXME 2014-05-08 16:14:02 -04:00
Alexandre Quessy
7177d62f90 remove useless endl in prints 2014-05-08 16:06:31 -04:00
Alexandre Quessy
4426142f80 fix pixel format bug - but playback still doesn't 2014-05-08 16:03:15 -04:00
Alexandre Quessy
7f1cea5553 Aparently, no need for bpp=32,depth=32 2014-05-08 15:09:22 -04:00
Alexandre Quessy
19b3ca3826 build against GStreamer 1.0 2014-05-08 13:03:02 -04:00
Tats
ad67794978 Removed reversal of data (prevented by changing the way we select texture coordinates). 2014-05-03 19:27:40 -04:00
Alexandre Quessy
c36a7b8f67 FIX: Play movies when load a project 2014-05-03 11:46:33 -04:00
Alexandre Quessy
6fa7379c84 Fix: Media URI doesn't stay when changed via OSC 2014-05-03 11:31:50 -04:00
Tats
2574841b9c Fixed bug: reverse video image (was showing upside down) 2014-05-02 00:24:15 -04:00
Alexandre Quessy
79583fbe1f less verbose 2014-04-30 21:37:24 -04:00
Alexandre Quessy
69640f8e32 just more prints 2014-04-30 16:15:46 -04:00
Tats
ca9ba38682 Performance improvement: copy texture bits to video card only if they have changed 2014-04-26 13:32:27 +01:00
Tats
ce305140a8 Allow media filenames (URI) with accents (ie. utf8) 2014-04-26 12:38:28 +01:00
Tats
430b0f223a Refactor Video -> Media 2014-04-26 12:22:33 +01:00