#include <lib/base/init_num.h>
#include <lib/base/init.h>
#include <gst/gst.h>
+#include <gst/pbutils/missing-plugins.h>
#include <sys/stat.h>
/* for subtitles */
#include <lib/gui/esubtitle.h>
extensions.push_back("wave");
extensions.push_back("mkv");
extensions.push_back("avi");
+ extensions.push_back("dat");
+ extensions.push_back("flac");
sc->addServiceFactory(eServiceFactoryMP3::id, this, extensions);
}
int is_video = is_mpeg_ps || is_mpeg_ts || is_matroska || is_avi;
int is_streaming = !strncmp(filename, "http://", 7);
int is_AudioCD = !(strncmp(filename, "/autofs/", 8) || strncmp(filename+strlen(filename)-13, "/track-", 7) || strcasecmp(ext, ".wav"));
+ int is_VCD = !strcasecmp(ext, ".dat");
- eDebug("filename: %s, is_mpeg_ps: %d, is_mpeg_ts: %d, is_video: %d, is_streaming: %d, is_mp3: %d, is_matroska: %d, is_avi: %d, is_AudioCD: %d", filename, is_mpeg_ps, is_mpeg_ts, is_video, is_streaming, is_mp3, is_matroska, is_avi, is_AudioCD);
+ eDebug("filename: %s, is_mpeg_ps: %d, is_mpeg_ts: %d, is_video: %d, is_streaming: %d, is_mp3: %d, is_matroska: %d, is_avi: %d, is_AudioCD: %d, is_VCD: %d", filename, is_mpeg_ps, is_mpeg_ts, is_video, is_streaming, is_mp3, is_matroska, is_avi, is_AudioCD, is_VCD);
int is_audio = !is_video;
g_object_set (G_OBJECT(switch_subtitles), "select-all", TRUE, NULL);
g_object_set (G_OBJECT(sink), "signal-handoffs", TRUE, NULL);
g_object_set (G_OBJECT(sink), "sync", TRUE, NULL);
+ g_object_set (G_OBJECT(parser), "subtitle-encoding", "ISO-8859-15", NULL);
g_signal_connect(sink, "handoff", G_CALLBACK(gstCBsubtitleAvail), this);
subtitleStream subs;
subs.language_code = std::string(".srt file");
gst_bin_add(GST_BIN(m_gst_pipeline), switch_audio);
gst_element_link(switch_audio, queue_audio);
}
- gst_element_link(source, videodemux);
+
+ if (is_VCD)
+ {
+ GstElement *cdxaparse = gst_element_factory_make("cdxaparse", "cdxaparse");
+ gst_bin_add(GST_BIN(m_gst_pipeline), cdxaparse);
+ gst_element_link(source, cdxaparse);
+ gst_element_link(cdxaparse, videodemux);
+ }
+ else
+ gst_element_link(source, videodemux);
gst_element_link(queue_audio, audio);
gst_element_link(queue_video, video);
g_signal_connect(videodemux, "pad-added", G_CALLBACK (gstCBpadAdded), this);
case sTracknumber:
case sGenre:
case sVideoType:
+ case sUser+12:
return resIsString;
case sCurrentTitle:
tag = GST_TAG_TRACK_NUMBER;
case sVideoType:
tag = GST_TAG_VIDEO_CODEC;
break;
+ case sUser+12:
+ return m_error_message;
default:
return "";
}
// eDebug("eServiceMP3::getTrackInfo(&info, %i)",i);
if (i >= m_audioStreams.size())
return -2;
- if (m_audioStreams[i].type == audioStream::atMPEG)
+ if (m_audioStreams[i].type == atMPEG)
info.m_description = "MPEG";
- else if (m_audioStreams[i].type == audioStream::atMP3)
+ else if (m_audioStreams[i].type == atMP3)
info.m_description = "MP3";
- else if (m_audioStreams[i].type == audioStream::atAC3)
+ else if (m_audioStreams[i].type == atAC3)
info.m_description = "AC3";
- else if (m_audioStreams[i].type == audioStream::atAAC)
+ else if (m_audioStreams[i].type == atAAC)
info.m_description = "AAC";
- else if (m_audioStreams[i].type == audioStream::atDTS)
+ else if (m_audioStreams[i].type == atDTS)
info.m_description = "DTS";
- else if (m_audioStreams[i].type == audioStream::atPCM)
+ else if (m_audioStreams[i].type == atPCM)
info.m_description = "PCM";
- else if (m_audioStreams[i].type == audioStream::atOGG)
+ else if (m_audioStreams[i].type == atOGG)
info.m_description = "OGG";
else
info.m_description = "???";
source = GST_MESSAGE_SRC(msg);
sourceName = gst_object_get_name(source);
-
+#if 0
if (gst_message_get_structure(msg))
{
gchar *string = gst_structure_to_string(gst_message_get_structure(msg));
}
else
eDebug("gst_message from %s: %s (without structure)", sourceName, GST_MESSAGE_TYPE_NAME(msg));
-
+#endif
switch (GST_MESSAGE_TYPE (msg))
{
case GST_MESSAGE_EOS:
}
}
}
+ case GST_MESSAGE_ELEMENT:
+ {
+ if ( gst_is_missing_plugin_message(msg) )
+ {
+ gchar *description = gst_missing_plugin_message_get_description(msg);
+ if ( description )
+ {
+ m_error_message = description;
+ g_free(description);
+ m_event((iPlayableService*)this, evUser+12);
+ }
+ }
+ }
default:
break;
}
return GST_BUS_PASS;
}
-int eServiceMP3::gstCheckAudioPad(GstStructure* structure)
+audiotype_t eServiceMP3::gstCheckAudioPad(GstStructure* structure)
{
const gchar* type;
type = gst_structure_get_name(structure);
case 1:
{
if ( layer == 3 )
- return audioStream::atMP3;
+ return atMP3;
else
- return audioStream::atMPEG;
+ return atMPEG;
}
case 2:
- return audioStream::atMPEG;
+ return atMPEG;
case 4:
- return audioStream::atAAC;
+ return atAAC;
default:
- return audioStream::atUnknown;
+ return atUnknown;
}
}
else
{
eDebug("mime %s", type);
if (!strcmp(type, "audio/x-ac3") || !strcmp(type, "audio/ac3"))
- return audioStream::atAC3;
+ return atAC3;
else if (!strcmp(type, "audio/x-dts") || !strcmp(type, "audio/dts"))
- return audioStream::atDTS;
+ return atDTS;
else if (!strcmp(type, "audio/x-raw-int"))
- return audioStream::atPCM;
+ return atPCM;
}
- return audioStream::atUnknown;
+ return atUnknown;
}
void eServiceMP3::gstCBpadAdded(GstElement *decodebin, GstPad *pad, gpointer user_data)
}
eAutoInitPtr<eServiceFactoryMP3> init_eServiceFactoryMP3(eAutoInitNumbers::service+1, "eServiceFactoryMP3");
-#else
-#warning gstreamer not available, not building media player
-#endif
void eServiceMP3::gstCBsubtitleAvail(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer user_data)
{
return l;
}
+
+#else
+#warning gstreamer not available, not building media player
+#endif