Nice when I have the patch I will push it to multiboxmediasink
Edited by christophecvr, 5 February 2016 - 13:41.
Posted 5 February 2016 - 15:49
Thank you my friend.
So far I have this:
--- a/gstdvbaudiosink.h 2016-02-02 23:49:58.384026363 +0100 +++ b/gstdvbaudiosink.h 2016-02-02 23:50:26.742251563 +0100 @@ -134,6 +134,8 @@ gint64 timestamp_offset; gint8 ok_to_write; + gboolean use_set_encoding; + queue_entry_t *queue; }; --- a/gstdvbvideosink.h 2016-02-02 23:49:58.384026363 +0100 +++ b/gstdvbvideosink.h 2016-02-02 23:50:26.742251563 +0100 @@ -136,6 +136,8 @@ gboolean must_send_header, wmv_asf; gint8 ok_to_write; + gboolean use_set_encoding; + queue_entry_t *queue; }; --- a/configure.ac 2016-02-04 21:50:01.122507363 +0100 +++ b/configure.ac 2016-02-04 21:52:08.071026123 +0100 @@ -236,6 +236,13 @@ AC_DEFINE([VUPLUS],[1],[Define to 1 for vuplus ]) fi +AC_ARG_WITH(spark, + AS_HELP_STRING([--with-spark],[build for spark, yes or no]), + [spark=$withval],[spark=no]) +if test "$spark" = "yes"; then + AC_DEFINE([SPARK],[1],[Define to 1 for spark ]) +fi + AC_ARG_WITH(dreambox, AS_HELP_STRING([--with-dreambox],[build for dreambox, yes or no]), [dreambox=$withval],[dreambox=no]) --- a/gstdvbvideosink.c 2016-02-04 21:42:39.982609460 +0100 +++ b/gstdvbvideosink.c 2016-02-05 00:20:39.646901581 +0100 @@ -64,6 +64,10 @@ #include <config.h> #endif +#ifdef __sh__ +#include <linux/dvb/stm_ioctls.h> +#endif + #include <gst/gst.h> #include <gst/base/gstbasesink.h> @@ -275,6 +279,42 @@ ) ); +#define VIDEO_ENCODING_UNKNOWN 0xFF + +unsigned int streamtype_to_encoding(unsigned int streamtype) +{ +#ifdef VIDEO_SET_ENCODING + switch(streamtype) + { + case STREAMTYPE_MPEG2: + return VIDEO_ENCODING_AUTO; + case STREAMTYPE_MPEG4_H264: + return VIDEO_ENCODING_H264; + case STREAMTYPE_H263: + return VIDEO_ENCODING_H263; + case STREAMTYPE_MPEG4_Part2: + return VIDEO_ENCODING_MPEG4P2; + case STREAMTYPE_MPEG1: + return VIDEO_ENCODING_AUTO; + case STREAMTYPE_XVID: + return VIDEO_ENCODING_MPEG4P2; + case STREAMTYPE_DIVX311: + return VIDEO_ENCODING_MPEG4P2; + case STREAMTYPE_DIVX4: + return VIDEO_ENCODING_MPEG4P2; + case STREAMTYPE_DIVX5: + return VIDEO_ENCODING_MPEG4P2; + case STREAMTYPE_VC1: + return VIDEO_ENCODING_VC1; + case STREAMTYPE_VC1_SM: + return VIDEO_ENCODING_WMV; + default: + return VIDEO_ENCODING_UNKNOWN; + } +#endif + return VIDEO_ENCODING_UNKNOWN; +} + static void gst_dvbvideosink_init(GstDVBVideoSink *self); static void gst_dvbvideosink_dispose(GObject *obj); static void gst_dvbvideosink_reset(GObject *obj); @@ -373,6 +413,11 @@ self->saved_fallback_framerate[0] = 0; self->rate = 1.0; self->wmv_asf = FALSE; +#ifdef VIDEO_SET_ENCODING + self->use_set_encoding = TRUE; +#else + self->use_set_encoding = FALSE; +#endif #ifdef VUPLUS gst_base_sink_set_sync(GST_BASE_SINK(self), FALSE); @@ -510,6 +555,10 @@ pfd[1].fd = self->fd; pfd[1].events = POLLIN; +#ifdef VIDEO_FLUSH + gst_sleepms(100); + if (self->fd >= 0) ioctl(self->fd, VIDEO_FLUSH, 1/*NONBLOCK*/); //Notify the player that no addionional data will be injected +#endif GST_BASE_SINK_PREROLL_UNLOCK(sink); while (1) { @@ -1680,9 +1729,22 @@ if (self->fd >= 0) ioctl(self->fd, VIDEO_STOP, 0); self->playing = FALSE; } - if (!self->playing && (self->fd < 0 || ioctl(self->fd, VIDEO_SET_STREAMTYPE, self->stream_type) < 0)) + if (self->use_set_encoding) + { +#ifdef VIDEO_SET_ENCODING + unsigned int encoding = streamtype_to_encoding(self->stream_type); + if (!self->playing && (self->fd < 0 || ioctl(self->fd, VIDEO_SET_ENCODING, encoding) < 0)) + { + GST_ELEMENT_ERROR(self, STREAM, DECODE, (NULL), ("hardware decoder can't be set to encoding %i", encoding)); + } +#endif + } + else { - GST_ELEMENT_ERROR(self, STREAM, CODEC_NOT_FOUND, (NULL), ("hardware decoder can't handle streamtype %i", self->stream_type)); + if (!self->playing && (self->fd < 0 || ioctl(self->fd, VIDEO_SET_STREAMTYPE, self->stream_type) < 0)) + { + GST_ELEMENT_ERROR(self, STREAM, CODEC_NOT_FOUND, (NULL), ("hardware decoder can't handle streamtype %i", self->stream_type)); + } } if (self->fd >= 0) { --- a/gstdvbaudiosink.c 2016-02-05 00:25:12.736570814 +0100 +++ b/gstdvbaudiosink.c 2016-02-05 00:28:06.715938682 +0100 @@ -64,6 +64,10 @@ #include <config.h> #endif +#ifdef __sh__ +#include <linux/dvb/stm_ioctls.h> +#endif + #include <gst/gst.h> #include <gst/audio/audio.h> #include <gst/base/gstbasesink.h> @@ -188,6 +192,36 @@ ) ); +#define AUDIO_ENCODING_UNKNOWN 0xFF + +unsigned int bypass_to_encoding (unsigned int bypass) +{ +#ifdef AUDIO_SET_ENCODING + switch(bypass) + { + case AUDIOTYPE_AC3: + case AUDIOTYPE_AC3_PLUS: + return AUDIO_ENCODING_AC3; + case AUDIOTYPE_MPEG: + return AUDIO_ENCODING_MPEG1; + case AUDIOTYPE_DTS: + return AUDIO_ENCODING_DTS; + case AUDIOTYPE_LPCM: + return AUDIO_ENCODING_LPCMA; + case AUDIOTYPE_MP3: + return AUDIO_ENCODING_MP3; + case AUDIOTYPE_AAC_PLUS: + return AUDIO_ENCODING_AAC; + case AUDIOTYPE_WMA: + case AUDIOTYPE_WMA_PRO: + return AUDIO_ENCODING_WMA; + default: + return AUDIO_ENCODING_UNKNOWN; + } +#endif + return AUDIO_ENCODING_UNKNOWN; +} + static void gst_dvbaudiosink_init(GstDVBAudioSink *self); static void gst_dvbaudiosink_dispose(GObject *obj); static void gst_dvbaudiosink_reset(GObject *obj); @@ -282,6 +316,11 @@ self->unlockfd[0] = self->unlockfd[1] = -1; self->rate = 1.0; self->timestamp = GST_CLOCK_TIME_NONE; +#ifdef AUDIO_SET_ENCODING + self->use_set_encoding = TRUE; +#else + self->use_set_encoding = FALSE; +#endif #ifdef VUPLUS gst_base_sink_set_sync(GST_BASE_SINK(self), FALSE); gst_base_sink_set_async_enabled(GST_BASE_SINK(self), FALSE); @@ -720,10 +759,23 @@ if (self->fd >= 0) ioctl(self->fd, AUDIO_STOP, 0); self->playing = FALSE; } - if (self->fd < 0 || ioctl(self->fd, AUDIO_SET_BYPASS_MODE, bypass) < 0) + if (self->use_set_encoding) { - GST_ELEMENT_ERROR(self, STREAM, TYPE_NOT_FOUND,(NULL),("hardware decoder can't be set to bypass mode type %s", type)); - return FALSE; +#ifdef AUDIO_SET_ENCODING + unsigned int encoding = bypass_to_encoding(bypass); + if (self->fd < 0 || ioctl(self->fd, AUDIO_SET_ENCODING, encoding) < 0) + { + GST_ELEMENT_WARNING(self, STREAM, DECODE,(NULL),("hardware decoder can't be set to encoding %i", encoding)); + } +#endif + } + else + { + if (self->fd < 0 || ioctl(self->fd, AUDIO_SET_BYPASS_MODE, bypass) < 0) + { + GST_ELEMENT_ERROR(self, STREAM, TYPE_NOT_FOUND,(NULL),("hardware decoder can't be set to bypass mode type %s", type)); + return FALSE; + } } if (self->fd >= 0) ioctl(self->fd, AUDIO_PLAY); self->playing = TRUE; @@ -779,6 +831,10 @@ { gboolean pass_eos = FALSE; struct pollfd pfd[2]; +#ifdef AUDIO_FLUSH + gst_sleepms(100); + if (self->fd >= 0) ioctl(self->fd, AUDIO_FLUSH, 1/*NONBLOCK*/); //Notify the player that no addionional data will be injected +#endif pfd[0].fd = self->unlockfd[0]; pfd[0].events = POLLIN; pfd[1].fd = self->fd; @@ -916,12 +972,16 @@ { GST_LOG_OBJECT(self, "going into poll, have %d bytes to write", len - written); } +#if CHECK_DRAIN if (poll(pfd, 2, -1) < 0) { if (errno == EINTR) continue; retval = -1; break; } +#else + pfd[1].revents = POLLOUT; +#endif if (pfd[0].revents & POLLIN) { /* read all stop commands */
I've added your gst_sleepms right before the video flush.
So far I couldn't get it to freeze up, but I just tried it 3 or 4 times (playing +5minutes and stopping).
However I've moved spark FLUSH (for both video and audio) back to "case GST_EVENT_EOS", because that's where it's at in the original sh4 patch.
Still what's not clear to me is whether it's better to place it under GST_EVENT_FLUSH_STOP right before the: "if (self->fd >= 0) ioctl(self->fd, VIDEO_CLEAR_BUFFER)" or not.
But if the 100ms indeed fixes the freezing for good, then I'll wrap the rest of the changes into #ifdef SPARK statements.
Edited by MastaG, 5 February 2016 - 15:53.
Posted 5 February 2016 - 16:07
I think the 100ms delay before the VIDEO_FLUSH and AUDIO_FLUSH has possitive effect for now.
So far it succesfully returns from playing back to the main menu everytime using both DreamPlex and the internal enigma2 movie player.
It only makes me wonder why it would never freeze up when playing and stopping the movie using gst-launch's playbin (with or without the 100ms delay).
And since I didn't make any changes to enigma2's servicemp3.cpp at all.. I'm wondering why adding a delay before the flush in the dvbmediasink fixes a freeze which only happens when stopping a video file in enigma2.
But so far my little spark cinema is looking good :-)
Edited by MastaG, 5 February 2016 - 16:09.
Posted 5 February 2016 - 19:08
To paraphrase Croatian Canadian PM: "Stay calm and code on..."
Posted 7 February 2016 - 20:56
@lostman
You'll have to wait for me to release new images and push my changes to the feed.
I'm still working out the nasty freeze when stopping a movie but this weekend I had to do family stuff.
You can also try Taapat's PLi5 image, he works very hard on his image to ensure perfection.
He uses ePlayer which pretty much works for everything, I've tested it last week for myself.
However I'd like to continue using gstreamer.
@cornetster
It should be in the feeds for every receiver.
@odokrim
I purposely break the number keys just to annoy the testers
Posted 7 February 2016 - 21:21
@lostman
You'll have to wait for me to release new images and push my changes to the feed.
I'm still working out the nasty freeze when stopping a movie but this weekend I had to do family stuff.
You can also try Taapat's PLi5 image, he works very hard on his image to ensure perfection.
He uses ePlayer which pretty much works for everything, I've tested it last week for myself.
However I'd like to continue using gstreamer.
@cornetster
It should be in the feeds for every receiver.
@odokrim
I purposely break the number keys just to annoy the testers
ok i am waiting
i already use taapat`s image , but your image faster when change between encrypted channels i dont know if its right or not but i feel it work better with sharing server
Posted 8 February 2016 - 04:32
are there any updates for this one ..
Firmware versie: 4.0 Driver date: 4.0.1+20151109-r0 Kernel versie: 4.0.1 Gui versie: 2016-01-04-(HEAD detached at 83f9ba2)
http://jam.japhar.co...all/Packages.gz
Installed this on a Formuler F1, works extremely well now
only auttimer settings gives me error via WebIF
"html><head><title>web.Server Traceback (most recent call last)</title></head><body><b>web.Server Traceback (most recent call last):</b> <div> <style type="text/css"> div.error { color: red; font-family: Verdana, Arial, helvetica, sans-serif; font-weight: bold; } div { font-family: Verdana, Arial, helvetica, sans-serif; } div.stackTrace { } div.frame { padding: 1em; background: white; border-bottom: thin black dashed; } div.frame:first-child { padding: 1em; background: white; border-top: thin black "
Posted 12 February 2016 - 14:29
Looking forward to testing it...
Sorted out the WLAN issues?
Posted 12 February 2016 - 18:13
Yes I believe so.
The firmware files and rt configuration file for wpa_supplicant were missing in the last image.
Taapat showed me the files I needed to add, and I did.
However I couldnt test this myself since I have no such wifi usb stick.
Also I'm shipping the latest ffmpeg as well and I'll also upload a libeplayer version of my image with a sepperate feed for the ones that were asking for it.
Posted 12 February 2016 - 20:35
Zram was argued against by none other than Graugans and Delfi, m8.... Just so you know...
Edited by MiLo, 12 February 2016 - 20:35.
0 members, 1 guests, 0 anonymous users