Merge remote-tracking branch 'tangocash/master'

Origin commit data
------------------
Branch: master
Commit: 14cbe23776
Author: max_10 <max_10@gmx.de>
Date: 2017-11-01 (Wed, 01 Nov 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2017-11-01 08:51:09 +01:00
3 changed files with 45 additions and 3 deletions

View File

@@ -15,7 +15,8 @@ AM_LDFLAGS = \
@SWRESAMPLE_LIBS@ \
-lpthread -lasound -lrt \
-lgstreamer-1.0 \
-lgsttag-1.0
-lgsttag-1.0 \
-lgstmpegts-1.0
libarmbox_la_SOURCES = \
hardware_caps.c \

View File

@@ -10,6 +10,7 @@
#include <unistd.h>
#include "pwrmngr.h"
#include <proc_tools.h>
#include "lt_debug.h"
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_INIT, NULL, args)
@@ -26,6 +27,16 @@ void init_td_api()
{
cCpuFreqManager f;
f.SetCpuFreq(0); /* CPUFREQ == 0 is the trigger for leaving standby */
char buffer[64];
sprintf(buffer, "%x", 0);
proc_put("/proc/stb/fb/dst_top", buffer, strlen(buffer));
proc_put("/proc/stb/fb/dst_left", buffer, strlen(buffer));
sprintf(buffer, "%x", 576);
proc_put("/proc/stb/fb/dst_height", buffer, strlen(buffer));
sprintf(buffer, "%x", 720);
proc_put("/proc/stb/fb/dst_width", buffer, strlen(buffer));
sprintf(buffer, "%x", 1);
proc_put("/proc/stb/fb/dst_apply", buffer, strlen(buffer));
}
initialized = true;
lt_info("%s end\n", __FUNCTION__);

View File

@@ -50,6 +50,7 @@ extern cDemux * videoDemux;
#include <gst/gst.h>
#include <gst/tag/tag.h>
#include <gst/mpegts/mpegts.h>
#include <gst/pbutils/missing-plugins.h>
typedef enum
@@ -76,6 +77,9 @@ gchar * uri = NULL;
GstTagList * m_stream_tags = NULL;
static int end_eof = 0;
#define HTTP_TIMEOUT 30
// taken from record.h
#define REC_MAX_APIDS 20
int real_apids[REC_MAX_APIDS];
gint match_sinktype(const GValue *velement, const gchar *type)
{
@@ -83,6 +87,25 @@ gint match_sinktype(const GValue *velement, const gchar *type)
return strcmp(g_type_name(G_OBJECT_TYPE(element)), type);
}
void processMpegTsSection(GstMpegtsSection* section)
{
for (unsigned int i = 0; i < REC_MAX_APIDS; i++) {
real_apids[i] = 0;
}
int cnt = 0;
if (section->section_type == GST_MPEGTS_SECTION_PMT) {
const GstMpegtsPMT* pmt = gst_mpegts_section_get_pmt(section);
for (guint i = 0; i < pmt->streams->len; ++i) {
const GstMpegtsPMTStream* stream = static_cast<const GstMpegtsPMTStream*>(g_ptr_array_index(pmt->streams, i));
if (stream->stream_type == 0x05 || stream->stream_type >= 0x80) {
lt_info_c( "%s:%s Audio Stream pid: %d\n", FILENAME, __FUNCTION__, stream->pid);
real_apids[cnt] = stream->pid;
cnt++;
}
}
}
}
void playbinNotifySource(GObject *object, GParamSpec *unused, gpointer user_data)
{
GstElement *source = NULL;
@@ -269,7 +292,14 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
lt_debug_c( "%s:%s - GST_MESSAGE_INFO: update info tags\n", FILENAME, __FUNCTION__); //FIXME: how shall playback handle this event???
break;
}
case GST_MESSAGE_ELEMENT:
{
GstMpegtsSection* section = gst_message_parse_mpegts_section(msg);
if (section) {
processMpegTsSection(section);
gst_mpegts_section_unref(section);
}
}
case GST_MESSAGE_STATE_CHANGED:
{
if(GST_MESSAGE_SRC(msg) != GST_OBJECT(m_gst_playbin))
@@ -853,7 +883,7 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
for (i = 0; i < n_audio; i++)
{
// apids
apids[i]=i;
apids[i]= real_apids[i] ? real_apids[i] : i;
GstPad * pad = 0;
g_signal_emit_by_name (m_gst_playbin, "get-audio-pad", i, &pad);