#include <gst/pbutils/missing-plugins.h>
#include <sys/stat.h>
-static GstStaticPadTemplate subsinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS("text/plain; text/x-pango-markup; video/x-dvd-subpicture"));
+static GstStaticPadTemplate subsinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS("text/plain; text/x-pango-markup; video/x-dvd-subpicture; subpicture/x-pgs"));
+// int ret = gst_pad_set_caps (ghostpad, caps2);
+// gst_caps_unref(caps2);));
// eServiceFactoryMP3
GstPad *ghostpad = gst_ghost_pad_new_no_target_from_template("sink", templ);
gst_element_add_pad (m_gst_subtitlebin, ghostpad);
- GstCaps* caps = gst_caps_from_string("text/plain; text/x-pango-markup; video/x-raw-rgb");
+ GstCaps* caps = gst_caps_from_string("text/plain; text/x-pango-markup; video/x-raw-rgb; subpicture/x-pgs");
g_object_set (G_OBJECT (appsink), "caps", caps, NULL);
gst_caps_unref(caps);
type = stSSA;
else if ( !strcmp(g_type, "text/plain") )
type = stPlainText;
+ else if ( !strcmp(g_type, "subpicture/x-pgs") )
+ type = stPGS;
else
eDebug("getSubtitleType::unsupported subtitle caps %s (%s)", g_type, g_codec);
}
gboolean eServiceMP3::gstGhostpadSinkEvent(GstPad * pad, GstEvent * event)
{
- eDebug("eServiceMP3::gstGhostpadSinkEvent %s", gst_structure_get_name (event->structure));
+// eDebug("eServiceMP3::gstGhostpadSinkEvent %s", gst_structure_get_name (event->structure));
// eServiceMP3 *_this = (eServiceMP3*) (gst_pad_get_parent (pad));
eServiceMP3 *_this = g_object_get_data (G_OBJECT (pad), "application-instance");
}
ret = _this->m_ghost_pad_subtitle_sink_event (pad, gst_event_ref (event));
-eDebug("original EVENTFUNC returned %i", ret);
+// eDebug("original EVENTFUNC returned %i", ret);
if (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT) {
gboolean update;
m_subtitle_pages.push_back(subtitlepage);
pushSubtitles();
}
- else
+ else if ( m_subtitleStreams[m_currentSubtitleStream].type == stVOB )
{
eDebug("got new subpicture @ buf_pos = %lld ns (in pts=%lld), duration=%lld ns, len=%i bytes. ", buf_pos, buf_pos/11111, duration_ns, len);
eVobSubtitlePage* page = new eVobSubtitlePage;
m_subtitle_pages.push_back(subtitlepage);
pushSubtitles();
}
+ else
+ {
+ eDebug("unsupported subpicture... ignoring");
+ }
}
gst_buffer_unref(buffer);
}
typedef struct _GstElement GstElement;
typedef enum { atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC } audiotype_t;
-typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB } subtype_t;
+typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t;
typedef enum { ctNone, ctMPEGTS, ctMPEGPS, ctMKV, ctAVI, ctMP4, ctVCD, ctCDA } containertype_t;
struct SubtitlePage