From 5819ef8b836c48b582245e2ed15aafe1fecd4663 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 28 Oct 2017 18:10:04 +0200 Subject: [PATCH 1/3] armbox: gstreamer tags support Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/d908c7a9476fcc9f093238a4a85f98f5727ac314 Author: TangoCash Date: 2017-10-28 (Sat, 28 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index 8b0b832..cd44af0 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -230,6 +230,12 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data) result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_REPLACE); if (result) { + if (m_stream_tags && gst_tag_list_is_equal(m_stream_tags, result)) + { + gst_tag_list_free(tags); + gst_tag_list_free(result); + break; + } if (m_stream_tags) gst_tag_list_free(m_stream_tags); m_stream_tags = result; @@ -949,6 +955,62 @@ void cPlayback::GetMetadata(std::vector &keys, std::vector Date: Sat, 28 Oct 2017 19:56:28 +0200 Subject: [PATCH 2/3] fixup gstreamer tags Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/b443fa07ac730978950743a592f8ebc7fe1cdc73 Author: TangoCash Date: 2017-10-28 (Sat, 28 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 22 ++++++++++++++-------- libspark/playback_libeplayer3.cpp | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index cd44af0..5a815bc 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -72,7 +72,7 @@ GstElement * m_gst_playbin = NULL; GstElement * audioSink = NULL; GstElement * videoSink = NULL; gchar * uri = NULL; -GstTagList * m_stream_tags = 0; +GstTagList * m_stream_tags = NULL; static int end_eof = 0; #define HTTP_TIMEOUT 30 @@ -232,13 +232,14 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data) { if (m_stream_tags && gst_tag_list_is_equal(m_stream_tags, result)) { - gst_tag_list_free(tags); - gst_tag_list_free(result); + gst_tag_list_unref(tags); + gst_tag_list_unref(result); break; } if (m_stream_tags) - gst_tag_list_free(m_stream_tags); - m_stream_tags = result; + gst_tag_list_unref(m_stream_tags); + m_stream_tags = gst_tag_list_copy(result); + gst_tag_list_unref(result); } const GValue *gv_image = gst_tag_list_get_value_index(tags, GST_TAG_IMAGE, 0); @@ -260,10 +261,10 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data) int ret = write(fd, data, size); gst_buffer_unmap(buf_image, &map); close(fd); - lt_info_c("%s:%s - /tmp/.id3coverart %d bytes written ", FILENAME, __FUNCTION__, ret); + lt_info_c("%s:%s - /tmp/.id3coverart %d bytes written\n", FILENAME, __FUNCTION__, ret); } } - gst_tag_list_free(tags); + gst_tag_list_unref(tags); lt_debug_c( "%s:%s - GST_MESSAGE_INFO: update info tags\n", FILENAME, __FUNCTION__); //FIXME: how shall playback handle this event??? break; } @@ -395,7 +396,7 @@ cPlayback::~cPlayback() lt_info( "%s:%s\n", FILENAME, __FUNCTION__); //FIXME: all deleting stuff is done in Close() if (m_stream_tags) - gst_tag_list_free(m_stream_tags); + gst_tag_list_unref(m_stream_tags); } //Used by Fileplay @@ -484,6 +485,11 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, mAudioStream = 0; init_jump = -1; + gst_tag_list_unref(m_stream_tags); + m_stream_tags = NULL; + + unlink("/tmp/.id3coverart"); + //create playback path bool isHTTP = false; diff --git a/libspark/playback_libeplayer3.cpp b/libspark/playback_libeplayer3.cpp index 13f9bef..b1e9ac3 100644 --- a/libspark/playback_libeplayer3.cpp +++ b/libspark/playback_libeplayer3.cpp @@ -67,6 +67,8 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in init_jump = -1; + unlink("/tmp/.id3coverart"); + std::string file; if (*filename == '/') file = "file://"; From 73605cf1c6b578b05253ccceb4e0228bc5c706fc Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 28 Oct 2017 22:16:28 +0200 Subject: [PATCH 3/3] armbox: fix get blank Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/564e40bd72ad22d39ae4ffdd514db8c49b994a48 Author: TangoCash Date: 2017-10-28 (Sat, 28 Oct 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/video.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 5269187..e810efa 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -560,33 +560,9 @@ void cVideo::Standby(unsigned int bOn) int cVideo::getBlank(void) { - static unsigned int lastcount = 0; - unsigned int count = 0; - size_t n = 0; - ssize_t r; - char *line = NULL; - /* hack: the "mailbox" irq is not increasing if - * no audio or video is decoded... */ - FILE *f = fopen("/proc/interrupts", "r"); - if (! f) /* huh? */ - return 0; - while ((r = getline(&line, &n, f)) != -1) - { - if (r <= (ssize_t) strlen("mailbox")) /* should not happen... */ - continue; - line[r - 1] = 0; /* remove \n */ - if (!strcmp(&line[r - 1 - strlen("mailbox")], "mailbox")) - { - count = atoi(line + 5); - break; - } - } - free(line); - fclose(f); - int ret = (count == lastcount); /* no new decode -> return 1 */ - lt_debug("#%d: %s: %d (irq++: %d)\n", devnum, __func__, ret, count - lastcount); - lastcount = count; - return ret; + int ret = proc_get_hex(VMPEG_xres[devnum]); + lt_debug("%s => %d\n", __func__, !ret); + return !ret; } void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h, int startx, int starty, int endx, int endy)