mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
armbox: Cosmetics replace spaces with tabs and delete unnecessary tabs
Origin commit data
------------------
Branch: master
Commit: 41083fe79e
Author: max_10 <max_10@gmx.de>
Date: 2017-10-08 (Sun, 08 Oct 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -49,18 +49,18 @@ static const char * FILENAME = "[playback.cpp]";
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_PLAY_FLAG_VIDEO = (1 << 0),
|
||||
GST_PLAY_FLAG_AUDIO = (1 << 1),
|
||||
GST_PLAY_FLAG_TEXT = (1 << 2),
|
||||
GST_PLAY_FLAG_VIS = (1 << 3),
|
||||
GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
|
||||
GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
|
||||
GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
|
||||
GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
|
||||
GST_PLAY_FLAG_BUFFERING = (1 << 8),
|
||||
GST_PLAY_FLAG_DEINTERLACE = (1 << 9),
|
||||
GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
|
||||
GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11),
|
||||
GST_PLAY_FLAG_VIDEO = (1 << 0),
|
||||
GST_PLAY_FLAG_AUDIO = (1 << 1),
|
||||
GST_PLAY_FLAG_TEXT = (1 << 2),
|
||||
GST_PLAY_FLAG_VIS = (1 << 3),
|
||||
GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
|
||||
GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
|
||||
GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
|
||||
GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
|
||||
GST_PLAY_FLAG_BUFFERING = (1 << 8),
|
||||
GST_PLAY_FLAG_DEINTERLACE = (1 << 9),
|
||||
GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
|
||||
GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11),
|
||||
} GstPlayFlags;
|
||||
|
||||
|
||||
@@ -192,7 +192,8 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
{
|
||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
{
|
||||
GstIterator *children;
|
||||
@@ -209,6 +210,8 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
gst_object_unref(GST_OBJECT(videoSink));
|
||||
videoSink = NULL;
|
||||
}
|
||||
|
||||
// set audio sink
|
||||
children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin));
|
||||
|
||||
if (gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBAudioSink"))
|
||||
@@ -219,6 +222,8 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
}
|
||||
|
||||
gst_iterator_free(children);
|
||||
|
||||
// set video sink
|
||||
children = gst_bin_iterate_recurse(GST_BIN(m_gst_playbin));
|
||||
|
||||
if (gst_iterator_find_custom(children, (GCompareFunc)match_sinktype, &r, (gpointer)"GstDVBVideoSink"))
|
||||
@@ -227,15 +232,21 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
g_value_unset (&r);
|
||||
lt_info_c( "%s %s - video sink created\n", FILENAME, __FUNCTION__);
|
||||
}
|
||||
gst_iterator_free(children);
|
||||
|
||||
} break;
|
||||
gst_iterator_free(children);
|
||||
}
|
||||
break;
|
||||
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
{
|
||||
if (audioSink)
|
||||
@@ -248,10 +259,13 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
gst_object_unref(GST_OBJECT(videoSink));
|
||||
videoSink = NULL;
|
||||
}
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -263,27 +277,27 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
||||
return GST_BUS_DROP;
|
||||
}
|
||||
|
||||
|
||||
cPlayback::cPlayback(int num)
|
||||
{
|
||||
lt_info( "%s:%s\n", FILENAME, __FUNCTION__);
|
||||
const gchar *nano_str;
|
||||
guint major, minor, micro, nano;
|
||||
const gchar *nano_str;
|
||||
guint major, minor, micro, nano;
|
||||
|
||||
/* init gstreamer */
|
||||
gst_init(NULL, NULL);
|
||||
|
||||
gst_version (&major, &minor, µ, &nano);
|
||||
|
||||
if (nano == 1)
|
||||
nano_str = "(CVS)";
|
||||
else if (nano == 2)
|
||||
nano_str = "(Prerelease)";
|
||||
if (nano == 1)
|
||||
nano_str = "(CVS)";
|
||||
else if (nano == 2)
|
||||
nano_str = "(Prerelease)";
|
||||
else
|
||||
nano_str = "";
|
||||
nano_str = "";
|
||||
|
||||
lt_info( "%s:%s - This program is linked against GStreamer %d.%d.%d %s\n",
|
||||
lt_info( "%s:%s - This program is linked against GStreamer %d.%d.%d %s\n",
|
||||
FILENAME, __FUNCTION__,
|
||||
major, minor, micro, nano_str);
|
||||
major, minor, micro, nano_str);
|
||||
|
||||
mAudioStream = 0;
|
||||
mSpeed = 0;
|
||||
@@ -292,6 +306,7 @@ cPlayback::cPlayback(int num)
|
||||
playstate = STATE_STOP;
|
||||
}
|
||||
|
||||
/* called at housekepping */
|
||||
cPlayback::~cPlayback()
|
||||
{
|
||||
lt_info( "%s:%s\n", FILENAME, __FUNCTION__);
|
||||
@@ -393,7 +408,7 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/,
|
||||
isHTTP = true;
|
||||
}
|
||||
else
|
||||
strcat(file, "file://");
|
||||
strcat(file, "file://");
|
||||
|
||||
strcat(file, filename);
|
||||
|
||||
@@ -404,8 +419,8 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/,
|
||||
|
||||
lt_info("%s:%s - filename=%s\n", FILENAME, __FUNCTION__, filename);
|
||||
|
||||
guint flags = GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | \
|
||||
GST_PLAY_FLAG_TEXT | GST_PLAY_FLAG_NATIVE_VIDEO;
|
||||
guint flags = GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | \
|
||||
GST_PLAY_FLAG_TEXT | GST_PLAY_FLAG_NATIVE_VIDEO;
|
||||
|
||||
/* increase the default 2 second / 2 MB buffer limitations to 5s / 5MB */
|
||||
int m_buffer_size = 5*1024*1024;
|
||||
@@ -417,20 +432,22 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/,
|
||||
{
|
||||
lt_info("%s:%s - m_gst_playbin\n", FILENAME, __FUNCTION__);
|
||||
|
||||
if(isHTTP)
|
||||
if(isHTTP)
|
||||
{
|
||||
// set buffer size
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-size", m_buffer_size, NULL);
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-duration", 5LL * GST_SECOND, NULL);
|
||||
flags |= GST_PLAY_FLAG_BUFFERING;
|
||||
}
|
||||
// set buffer size
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-size", m_buffer_size, NULL);
|
||||
g_object_set(G_OBJECT(m_gst_playbin), "buffer-duration", 5LL * GST_SECOND, NULL);
|
||||
flags |= GST_PLAY_FLAG_BUFFERING;
|
||||
}
|
||||
|
||||
// set flags
|
||||
g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL);
|
||||
|
||||
// set uri
|
||||
g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL);
|
||||
|
||||
//gstbus handler
|
||||
GstBus * bus = gst_pipeline_get_bus( GST_PIPELINE(m_gst_playbin) );
|
||||
GstBus * bus = gst_pipeline_get_bus(GST_PIPELINE(m_gst_playbin));
|
||||
gst_bus_set_sync_handler(bus, Gst_bus_call, NULL, NULL);
|
||||
gst_object_unref(bus);
|
||||
|
||||
@@ -476,6 +493,7 @@ bool cPlayback::Stop(void)
|
||||
{
|
||||
if(playing == false)
|
||||
return false;
|
||||
|
||||
lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing);
|
||||
|
||||
// stop
|
||||
@@ -626,7 +644,7 @@ bool cPlayback::GetPosition(int &position, int &duration)
|
||||
unsigned long long int sec = 0;
|
||||
|
||||
gst_element_query_position(m_gst_playbin, fmt, &pts);
|
||||
position = pts / 1000000.0;
|
||||
position = pts / 1000000.0;
|
||||
|
||||
// duration
|
||||
GstFormat fmt_d = GST_FORMAT_TIME; //Returns time in nanosecs
|
||||
@@ -687,7 +705,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] = i;
|
||||
|
||||
GstPad * pad = 0;
|
||||
g_signal_emit_by_name (m_gst_playbin, "get-audio-pad", i, &pad);
|
||||
@@ -751,7 +769,7 @@ void cPlayback::FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *nu
|
||||
}
|
||||
|
||||
// numpids
|
||||
*numpida=i;
|
||||
*numpida = i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,7 +783,7 @@ bool cPlayback::SyncAV(void)
|
||||
{
|
||||
lt_info( "%s:%s playing %d\n", FILENAME, __FUNCTION__, playing);
|
||||
|
||||
if(playing == false )
|
||||
if(playing == false)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user