away from being frame accurate (yet).
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PLAYPAUSE" mapto="pause" flags="m" />
</device>
<device name="dreambox advanced remote control (native)">
<key id="KEY_PLAYPAUSE" mapto="pause" flags="m" />
+ <key id="KEY_PLAY" mapto="pause" flags="m" />
<key id="KEY_STOP" mapto="stop" flags="b" />
<key id="KEY_STOP" mapto="shift_stop" flags="l" />
<key id="KEY_RECORD" mapto="shift_record" flags="l" />
<key id="KEY_STOP" mapto="stop" flags="b" />
<key id="KEY_STOP" mapto="shift_stop" flags="l" />
<key id="KEY_RECORD" mapto="shift_record" flags="l" />
def pauseEntry(self):
self.pauseService()
def pauseEntry(self):
self.pauseService()
+ if self.seekstate == self.SEEK_STATE_PAUSE:
+ self.show()
+ else:
+ self.hide()
def stopEntry(self):
self.playlist.stopFile()
def stopEntry(self):
self.playlist.stopFile()
m_stream_tags = 0;
m_audioStreams.clear();
m_currentAudioStream = 0;
m_stream_tags = 0;
m_audioStreams.clear();
m_currentAudioStream = 0;
+ m_currentTrickRatio = 0;
+ CONNECT(m_seekTimeout.timeout, eServiceMP3::seekTimeoutCB);
CONNECT(m_pump.recv_msg, eServiceMP3::gstPoll);
GstElement *source = 0;
CONNECT(m_pump.recv_msg, eServiceMP3::gstPoll);
GstElement *source = 0;
gst_object_unref(GST_OBJECT(queue_video));
if (videodemux)
gst_object_unref(GST_OBJECT(videodemux));
gst_object_unref(GST_OBJECT(queue_video));
if (videodemux)
gst_object_unref(GST_OBJECT(videodemux));
+ if (switch_audio)
+ gst_object_unref(GST_OBJECT(switch_audio));
eDebug("sorry, can't play.");
m_gst_pipeline = 0;
eDebug("sorry, can't play.");
m_gst_pipeline = 0;
RESULT eServiceMP3::setSlowMotion(int ratio)
{
RESULT eServiceMP3::setSlowMotion(int ratio)
{
+ /* we can't do slomo yet */
return -1;
}
RESULT eServiceMP3::setFastForward(int ratio)
{
return -1;
}
RESULT eServiceMP3::setFastForward(int ratio)
{
+ m_currentTrickRatio = ratio;
+ if (ratio)
+ m_seekTimeout.start(1000, 0);
+ else
+ m_seekTimeout.stop();
+ return 0;
+}
+
+void eServiceMP3::seekTimeoutCB()
+{
+ pts_t ppos, len;
+ getPlayPosition(ppos);
+ getLength(len);
+ ppos += 90000*m_currentTrickRatio;
+
+ if (ppos < 0)
+ {
+ ppos = 0;
+ m_seekTimeout.stop();
+ }
+ if (ppos > len)
+ {
+ ppos = 0;
+ stop();
+ m_seekTimeout.stop();
+ return;
+ }
+ seekTo(ppos);
// iPausableService
RESULT eServiceMP3::pause()
{
if (!m_gst_pipeline)
return -1;
// iPausableService
RESULT eServiceMP3::pause()
{
if (!m_gst_pipeline)
return -1;
- gst_element_set_state(m_gst_pipeline, GST_STATE_PAUSED);
+ GstStateChangeReturn res = gst_element_set_state(m_gst_pipeline, GST_STATE_PAUSED);
+ if (res == GST_STATE_CHANGE_ASYNC)
+ {
+ pts_t ppos;
+ getPlayPosition(ppos);
+ seekTo(ppos);
+ }
{
if (!m_gst_pipeline)
return -1;
{
if (!m_gst_pipeline)
return -1;
- gst_element_set_state(m_gst_pipeline, GST_STATE_PLAYING);
+
+ GstStateChangeReturn res;
+ res = gst_element_set_state(m_gst_pipeline, GST_STATE_PLAYING);
if (!m_gst_pipeline)
return -1;
if (!m_gst_pipeline)
return -1;
pts_t ppos;
getPlayPosition(ppos);
ppos += to * direction;
pts_t ppos;
getPlayPosition(ppos);
ppos += to * direction;
RESULT eServiceMP3::setTrickmode(int trick)
{
RESULT eServiceMP3::setTrickmode(int trick)
{
- /* trickmode currently doesn't make any sense for us. */
+ /* trickmode is not yet supported by our dvbmediasinks. */
}
RESULT eServiceMP3::selectTrack(unsigned int i)
}
RESULT eServiceMP3::selectTrack(unsigned int i)
+{
+ int ret = selectAudioStream(i);
+ /* flush */
+ pts_t ppos;
+ getPlayPosition(ppos);
+ seekTo(ppos);
+
+ return ret;
+}
+
+int eServiceMP3::selectAudioStream(int i)
{
gint nb_sources;
GstPad *active_pad;
{
gint nb_sources;
GstPad *active_pad;
return -1;
}
g_object_get (G_OBJECT (selector), "n-pads", &nb_sources, NULL);
return -1;
}
g_object_get (G_OBJECT (selector), "n-pads", &nb_sources, NULL);
- g_object_get (G_OBJECT (selector), "active-pad", &active_pad, NULL);
if ( i >= m_audioStreams.size() || i >= nb_sources || m_currentAudioStream >= m_audioStreams.size() )
return -2;
char sinkpad[8];
if ( i >= m_audioStreams.size() || i >= nb_sources || m_currentAudioStream >= m_audioStreams.size() )
return -2;
char sinkpad[8];
IterAudioStream->type = audioStream::atMP3;
else if ( g_strrstr(g_audiocodec, "AC-3 audio") )
IterAudioStream->type = audioStream::atAC3;
IterAudioStream->type = audioStream::atMP3;
else if ( g_strrstr(g_audiocodec, "AC-3 audio") )
IterAudioStream->type = audioStream::atAC3;
- else if ( g_strrstr(g_audiocodec, "Uncompressed\ 16-bit\ PCM\ audio") )
+ else if ( g_strrstr(g_audiocodec, "Uncompressed 16-bit PCM audio") )
IterAudioStream->type = audioStream::atPCM;
gchar *g_language;
if ( gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_language) )
IterAudioStream->type = audioStream::atPCM;
gchar *g_language;
if ( gst_tag_list_get_string(tags, GST_TAG_LANGUAGE_CODE, &g_language) )
GstPadLinkReturn ret = gst_pad_link(pad, gst_element_get_request_pad (selector, "sink%d"));
if ( _this->m_audioStreams.size() == 1 )
{
GstPadLinkReturn ret = gst_pad_link(pad, gst_element_get_request_pad (selector, "sink%d"));
if ( _this->m_audioStreams.size() == 1 )
{
+ _this->selectAudioStream(0);
gst_element_set_state (_this->m_gst_pipeline, GST_STATE_PLAYING);
}
else
gst_element_set_state (_this->m_gst_pipeline, GST_STATE_PLAYING);
}
else
};
private:
int m_currentAudioStream;
};
private:
int m_currentAudioStream;
- int m_currentTrickRate;
+ int m_currentTrickRatio;
+ eTimer m_seekTimeout;
+ void eServiceMP3::seekTimeoutCB();
+ int selectAudioStream(int i);
std::vector<audioStream> m_audioStreams;
friend class eServiceFactoryMP3;
std::string m_filename;
std::vector<audioStream> m_audioStreams;
friend class eServiceFactoryMP3;
std::string m_filename;