armbox: gst-playback reformat code

Origin commit data
------------------
Branch: master
Commit: fec61c7e1c
Author: TangoCash <eric@loxat.de>
Date: 2017-10-15 (Sun, 15 Oct 2017)


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

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-10-15 16:06:48 +02:00
parent f0ea38c2f9
commit 7bdd73dc9c
2 changed files with 323 additions and 316 deletions

View File

@@ -195,7 +195,7 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
int ret = write(fd, Info.data, Info.size);
close(fd);
gst_buffer_unmap(buf_image, &Info);
lt_info_c( "%s:%s - GST_MESSAGE_INFO: cPlayback::state /tmp/.id3coverart %d bytes written\n", FILENAME, __FUNCTION__ , ret);
lt_info_c( "%s:%s - GST_MESSAGE_INFO: cPlayback::state /tmp/.id3coverart %d bytes written\n", FILENAME, __FUNCTION__, ret);
}
//FIXME: how shall playback handle this event???
}
@@ -259,7 +259,8 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
}
gst_iterator_free(children);
} break;
}
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
{
} break;
@@ -278,7 +279,8 @@ 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;
@@ -529,7 +531,7 @@ bool cPlayback::Stop(void)
return true;
}
bool cPlayback::SetAPid(int pid , bool /*ac3*/)
bool cPlayback::SetAPid(int pid, bool /*ac3*/)
{
lt_info("%s: pid %i\n", __func__, pid);
@@ -693,12 +695,15 @@ bool cPlayback::SetPosition(int position, bool absolute)
if(m_gst_playbin)
{
if (!absolute) {
if (!absolute)
{
gst_element_query_position(m_gst_playbin, fmt, &pos);
time_nanoseconds = pos + (position * 1000000.0);
if(time_nanoseconds < 0)
time_nanoseconds = 0;
} else {
}
else
{
time_nanoseconds = position * 1000000.0;
}

View File

@@ -26,7 +26,8 @@
#include <config.h>
typedef enum {
typedef enum
{
STATE_STOP,
STATE_PLAY,
STATE_PAUSE,
@@ -35,7 +36,8 @@ typedef enum {
STATE_SLOW
} playstate_t;
typedef enum {
typedef enum
{
PLAYMODE_TS = 0,
PLAYMODE_FILE,
} playmode_t;
@@ -44,13 +46,13 @@ struct AVFormatContext;
class cPlayback
{
private:
private:
bool playing;
int mSpeed;
int mAudioStream;
public:
public:
playstate_t playstate;
cPlayback(int);