mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-11 19:06:33 +00:00
dvdspu: beginning of port to 0.11
This commit is contained in:
parent
e83fb140d5
commit
3267a38e37
1 changed files with 55 additions and 95 deletions
|
@ -82,7 +82,8 @@ static const guint32 default_clut[16] = {
|
||||||
0x808080, 0x808080, 0x808080, 0x808080
|
0x808080, 0x808080, 0x808080, 0x808080
|
||||||
};
|
};
|
||||||
|
|
||||||
GST_BOILERPLATE (GstDVDSpu, gst_dvd_spu, GstElement, GST_TYPE_ELEMENT);
|
#define gst_dvd_spu_parent_class parent_class
|
||||||
|
G_DEFINE_TYPE (GstDVDSpu, gst_dvd_spu, GST_TYPE_ELEMENT);
|
||||||
|
|
||||||
static void gst_dvd_spu_dispose (GObject * object);
|
static void gst_dvd_spu_dispose (GObject * object);
|
||||||
static void gst_dvd_spu_finalize (GObject * object);
|
static void gst_dvd_spu_finalize (GObject * object);
|
||||||
|
@ -91,12 +92,11 @@ static GstStateChangeReturn gst_dvd_spu_change_state (GstElement * element,
|
||||||
|
|
||||||
static gboolean gst_dvd_spu_src_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_dvd_spu_src_event (GstPad * pad, GstEvent * event);
|
||||||
|
|
||||||
static GstCaps *gst_dvd_spu_video_proxy_getcaps (GstPad * pad);
|
static GstCaps *gst_dvd_spu_video_proxy_getcaps (GstPad * pad,
|
||||||
|
GstCaps * filter);
|
||||||
static gboolean gst_dvd_spu_video_set_caps (GstPad * pad, GstCaps * caps);
|
static gboolean gst_dvd_spu_video_set_caps (GstPad * pad, GstCaps * caps);
|
||||||
static GstFlowReturn gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf);
|
static GstFlowReturn gst_dvd_spu_video_chain (GstPad * pad, GstBuffer * buf);
|
||||||
static gboolean gst_dvd_spu_video_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_dvd_spu_video_event (GstPad * pad, GstEvent * event);
|
||||||
static GstFlowReturn gst_dvd_spu_buffer_alloc (GstPad * sinkpad, guint64 offset,
|
|
||||||
guint size, GstCaps * caps, GstBuffer ** buf);
|
|
||||||
static void gst_dvd_spu_redraw_still (GstDVDSpu * dvdspu, gboolean force);
|
static void gst_dvd_spu_redraw_still (GstDVDSpu * dvdspu, gboolean force);
|
||||||
|
|
||||||
static void gst_dvd_spu_check_still_updates (GstDVDSpu * dvdspu);
|
static void gst_dvd_spu_check_still_updates (GstDVDSpu * dvdspu);
|
||||||
|
@ -114,38 +114,35 @@ dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf);
|
||||||
static void gst_dvd_spu_handle_dvd_event (GstDVDSpu * dvdspu, GstEvent * event);
|
static void gst_dvd_spu_handle_dvd_event (GstDVDSpu * dvdspu, GstEvent * event);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_dvd_spu_base_init (gpointer gclass)
|
gst_dvd_spu_class_init (GstDVDSpuClass * klass)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
|
|
||||||
|
gobject_class->dispose = (GObjectFinalizeFunc) gst_dvd_spu_dispose;
|
||||||
|
gobject_class->finalize = (GObjectFinalizeFunc) gst_dvd_spu_finalize;
|
||||||
|
|
||||||
|
gstelement_class->change_state = gst_dvd_spu_change_state;
|
||||||
|
|
||||||
|
gst_element_class_add_pad_template (gstelement_class,
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_static_pad_template_get (&src_factory));
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (gstelement_class,
|
||||||
gst_static_pad_template_get (&video_sink_factory));
|
gst_static_pad_template_get (&video_sink_factory));
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (gstelement_class,
|
||||||
gst_static_pad_template_get (&subpic_sink_factory));
|
gst_static_pad_template_get (&subpic_sink_factory));
|
||||||
gst_element_class_set_details_simple (element_class, "Sub-picture Overlay",
|
|
||||||
|
gst_element_class_set_details_simple (gstelement_class, "Sub-picture Overlay",
|
||||||
"Mixer/Video/Overlay/SubPicture/DVD/Bluray",
|
"Mixer/Video/Overlay/SubPicture/DVD/Bluray",
|
||||||
"Parses Sub-Picture command streams and renders the SPU overlay "
|
"Parses Sub-Picture command streams and renders the SPU overlay "
|
||||||
"onto the video as it passes through",
|
"onto the video as it passes through",
|
||||||
"Jan Schmidt <thaytan@noraisin.net>");
|
"Jan Schmidt <thaytan@noraisin.net>");
|
||||||
|
|
||||||
element_class->change_state = gst_dvd_spu_change_state;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_dvd_spu_class_init (GstDVDSpuClass * klass)
|
gst_dvd_spu_init (GstDVDSpu * dvdspu)
|
||||||
{
|
|
||||||
GObjectClass *gobject_class;
|
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
|
||||||
|
|
||||||
gobject_class->dispose = (GObjectFinalizeFunc) gst_dvd_spu_dispose;
|
|
||||||
gobject_class->finalize = (GObjectFinalizeFunc) gst_dvd_spu_finalize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_dvd_spu_init (GstDVDSpu * dvdspu, GstDVDSpuClass * gclass)
|
|
||||||
{
|
{
|
||||||
dvdspu->videosinkpad =
|
dvdspu->videosinkpad =
|
||||||
gst_pad_new_from_static_template (&video_sink_factory, "video");
|
gst_pad_new_from_static_template (&video_sink_factory, "video");
|
||||||
|
@ -155,8 +152,6 @@ gst_dvd_spu_init (GstDVDSpu * dvdspu, GstDVDSpuClass * gclass)
|
||||||
gst_dvd_spu_video_proxy_getcaps);
|
gst_dvd_spu_video_proxy_getcaps);
|
||||||
gst_pad_set_chain_function (dvdspu->videosinkpad, gst_dvd_spu_video_chain);
|
gst_pad_set_chain_function (dvdspu->videosinkpad, gst_dvd_spu_video_chain);
|
||||||
gst_pad_set_event_function (dvdspu->videosinkpad, gst_dvd_spu_video_event);
|
gst_pad_set_event_function (dvdspu->videosinkpad, gst_dvd_spu_video_event);
|
||||||
gst_pad_set_bufferalloc_function (dvdspu->videosinkpad,
|
|
||||||
gst_dvd_spu_buffer_alloc);
|
|
||||||
|
|
||||||
dvdspu->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
dvdspu->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||||
gst_pad_set_event_function (dvdspu->srcpad, gst_dvd_spu_src_event);
|
gst_pad_set_event_function (dvdspu->srcpad, gst_dvd_spu_src_event);
|
||||||
|
@ -279,21 +274,6 @@ gst_dvd_spu_flush_spu_info (GstDVDSpu * dvdspu, gboolean keep_events)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Proxy buffer allocations on the video sink pad downstream */
|
|
||||||
static GstFlowReturn
|
|
||||||
gst_dvd_spu_buffer_alloc (GstPad * sinkpad, guint64 offset, guint size,
|
|
||||||
GstCaps * caps, GstBuffer ** buf)
|
|
||||||
{
|
|
||||||
GstDVDSpu *dvdspu = GST_DVD_SPU (gst_pad_get_parent (sinkpad));
|
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
|
||||||
|
|
||||||
ret = gst_pad_alloc_buffer (dvdspu->srcpad, offset, size, caps, buf);
|
|
||||||
|
|
||||||
gst_object_unref (dvdspu);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvd_spu_src_event (GstPad * pad, GstEvent * event)
|
gst_dvd_spu_src_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
|
@ -359,7 +339,7 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_dvd_spu_video_proxy_getcaps (GstPad * pad)
|
gst_dvd_spu_video_proxy_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstDVDSpu *dvdspu = GST_DVD_SPU (gst_pad_get_parent (pad));
|
GstDVDSpu *dvdspu = GST_DVD_SPU (gst_pad_get_parent (pad));
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -369,7 +349,7 @@ gst_dvd_spu_video_proxy_getcaps (GstPad * pad)
|
||||||
* subpicture sink pad */
|
* subpicture sink pad */
|
||||||
otherpad = (pad == dvdspu->srcpad) ? dvdspu->videosinkpad : dvdspu->srcpad;
|
otherpad = (pad == dvdspu->srcpad) ? dvdspu->videosinkpad : dvdspu->srcpad;
|
||||||
|
|
||||||
caps = gst_pad_peer_get_caps (otherpad);
|
caps = gst_pad_peer_get_caps (otherpad, filter);
|
||||||
if (caps) {
|
if (caps) {
|
||||||
GstCaps *temp;
|
GstCaps *temp;
|
||||||
const GstCaps *templ;
|
const GstCaps *templ;
|
||||||
|
@ -435,36 +415,29 @@ gst_dvd_spu_video_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_NEWSEGMENT:
|
case GST_EVENT_SEGMENT:
|
||||||
{
|
{
|
||||||
gboolean update;
|
GstSegment seg;
|
||||||
gdouble rate, arate;
|
|
||||||
GstFormat format;
|
|
||||||
gint64 start, stop, time;
|
|
||||||
|
|
||||||
gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
|
gst_event_copy_segment (event, &seg);
|
||||||
&start, &stop, &time);
|
|
||||||
|
|
||||||
if (format != GST_FORMAT_TIME)
|
if (seg.format != GST_FORMAT_TIME)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Only print updates if they have an end time (don't print start_time
|
/* Only print updates if they have an end time (don't print start_time
|
||||||
* updates */
|
* updates */
|
||||||
GST_DEBUG_OBJECT (dvdspu, "video pad NewSegment:"
|
GST_DEBUG_OBJECT (dvdspu, "video pad Segment: %" GST_SEGMENT_FORMAT,
|
||||||
" Update %d, rate %g arate %g format %d start %" GST_TIME_FORMAT
|
&seg);
|
||||||
" %" GST_TIME_FORMAT " position %" GST_TIME_FORMAT,
|
|
||||||
update, rate, arate, format, GST_TIME_ARGS (start),
|
|
||||||
GST_TIME_ARGS (stop), GST_TIME_ARGS (time));
|
|
||||||
|
|
||||||
DVD_SPU_LOCK (dvdspu);
|
DVD_SPU_LOCK (dvdspu);
|
||||||
|
|
||||||
if (update && start > dvdspu->video_seg.last_stop) {
|
if (seg.start > dvdspu->video_seg.position) {
|
||||||
#if 0
|
#if 0
|
||||||
g_print ("Segment update for video. Advancing from %" GST_TIME_FORMAT
|
g_print ("Segment update for video. Advancing from %" GST_TIME_FORMAT
|
||||||
" to %" GST_TIME_FORMAT "\n",
|
" to %" GST_TIME_FORMAT "\n",
|
||||||
GST_TIME_ARGS (dvdspu->video_seg.last_stop), GST_TIME_ARGS (start));
|
GST_TIME_ARGS (dvdspu->video_seg.position), GST_TIME_ARGS (start));
|
||||||
#endif
|
#endif
|
||||||
while (dvdspu->video_seg.last_stop < start &&
|
while (dvdspu->video_seg.position < seg.start &&
|
||||||
!(state->flags & SPU_STATE_STILL_FRAME)) {
|
!(state->flags & SPU_STATE_STILL_FRAME)) {
|
||||||
DVD_SPU_UNLOCK (dvdspu);
|
DVD_SPU_UNLOCK (dvdspu);
|
||||||
if (dvdspu_handle_vid_buffer (dvdspu, NULL) != GST_FLOW_OK) {
|
if (dvdspu_handle_vid_buffer (dvdspu, NULL) != GST_FLOW_OK) {
|
||||||
|
@ -475,9 +448,7 @@ gst_dvd_spu_video_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_segment_set_newsegment_full (&dvdspu->video_seg, update, rate, arate,
|
dvdspu->video_seg = seg;
|
||||||
format, start, stop, time);
|
|
||||||
|
|
||||||
DVD_SPU_UNLOCK (dvdspu);
|
DVD_SPU_UNLOCK (dvdspu);
|
||||||
|
|
||||||
res = gst_pad_event_default (pad, event);
|
res = gst_pad_event_default (pad, event);
|
||||||
|
@ -539,7 +510,7 @@ dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf)
|
||||||
DVD_SPU_LOCK (dvdspu);
|
DVD_SPU_LOCK (dvdspu);
|
||||||
|
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
GstClockTime next_ts = dvdspu->video_seg.last_stop;
|
GstClockTime next_ts = dvdspu->video_seg.position;
|
||||||
|
|
||||||
next_ts += gst_util_uint64_scale_int (GST_SECOND,
|
next_ts += gst_util_uint64_scale_int (GST_SECOND,
|
||||||
dvdspu->spu_state.fps_d, dvdspu->spu_state.fps_n);
|
dvdspu->spu_state.fps_d, dvdspu->spu_state.fps_n);
|
||||||
|
@ -547,7 +518,7 @@ dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf)
|
||||||
/* NULL buffer was passed - use the reference frame and update the timestamp,
|
/* NULL buffer was passed - use the reference frame and update the timestamp,
|
||||||
* or else there's nothing to draw, and just return GST_FLOW_OK */
|
* or else there's nothing to draw, and just return GST_FLOW_OK */
|
||||||
if (dvdspu->ref_frame == NULL) {
|
if (dvdspu->ref_frame == NULL) {
|
||||||
gst_segment_set_last_stop (&dvdspu->video_seg, GST_FORMAT_TIME, next_ts);
|
dvdspu->video_seg.position = next_ts;
|
||||||
goto no_ref_frame;
|
goto no_ref_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,16 +535,15 @@ dvdspu_handle_vid_buffer (GstDVDSpu * dvdspu, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
gst_segment_set_last_stop (&dvdspu->video_seg, GST_FORMAT_TIME,
|
dvdspu->video_seg.position = GST_BUFFER_TIMESTAMP (buf);
|
||||||
GST_BUFFER_TIMESTAMP (buf));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
new_ts = gst_segment_to_running_time (&dvdspu->video_seg, GST_FORMAT_TIME,
|
new_ts = gst_segment_to_running_time (&dvdspu->video_seg, GST_FORMAT_TIME,
|
||||||
dvdspu->video_seg.last_stop);
|
dvdspu->video_seg.position);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
g_print ("TS %" GST_TIME_FORMAT " running: %" GST_TIME_FORMAT "\n",
|
g_print ("TS %" GST_TIME_FORMAT " running: %" GST_TIME_FORMAT "\n",
|
||||||
GST_TIME_ARGS (dvdspu->video_seg.last_stop), GST_TIME_ARGS (new_ts));
|
GST_TIME_ARGS (dvdspu->video_seg.position), GST_TIME_ARGS (new_ts));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_dvd_spu_advance_spu (dvdspu, new_ts);
|
gst_dvd_spu_advance_spu (dvdspu, new_ts);
|
||||||
|
@ -671,7 +641,7 @@ gst_dvd_spu_redraw_still (GstDVDSpu * dvdspu, gboolean force)
|
||||||
} else if (force) {
|
} else if (force) {
|
||||||
/* Simply output the reference frame */
|
/* Simply output the reference frame */
|
||||||
GstBuffer *buf = gst_buffer_ref (dvdspu->ref_frame);
|
GstBuffer *buf = gst_buffer_ref (dvdspu->ref_frame);
|
||||||
buf = gst_buffer_make_metadata_writable (buf);
|
buf = gst_buffer_make_writable (buf);
|
||||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||||
GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE;
|
||||||
GST_BUFFER_DURATION (buf) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_DURATION (buf) = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -694,7 +664,7 @@ gst_dvd_spu_handle_dvd_event (GstDVDSpu * dvdspu, GstEvent * event)
|
||||||
gboolean hl_change = FALSE;
|
gboolean hl_change = FALSE;
|
||||||
|
|
||||||
GST_INFO_OBJECT (dvdspu, "DVD event of type %s on subp pad OOB=%d",
|
GST_INFO_OBJECT (dvdspu, "DVD event of type %s on subp pad OOB=%d",
|
||||||
gst_structure_get_string (event->structure, "event"),
|
gst_structure_get_string (gst_event_get_structure (event), "event"),
|
||||||
(GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_DOWNSTREAM_OOB));
|
(GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_DOWNSTREAM_OOB));
|
||||||
|
|
||||||
switch (dvdspu->spu_input_type) {
|
switch (dvdspu->spu_input_type) {
|
||||||
|
@ -755,13 +725,13 @@ gst_dvd_spu_advance_spu (GstDVDSpu * dvdspu, GstClockTime new_ts)
|
||||||
|
|
||||||
vid_run_ts =
|
vid_run_ts =
|
||||||
gst_segment_to_running_time (&dvdspu->video_seg, GST_FORMAT_TIME,
|
gst_segment_to_running_time (&dvdspu->video_seg, GST_FORMAT_TIME,
|
||||||
dvdspu->video_seg.last_stop);
|
dvdspu->video_seg.position);
|
||||||
GST_LOG_OBJECT (dvdspu,
|
GST_LOG_OBJECT (dvdspu,
|
||||||
"Popped new SPU packet with TS %" GST_TIME_FORMAT
|
"Popped new SPU packet with TS %" GST_TIME_FORMAT
|
||||||
". Video last_stop=%" GST_TIME_FORMAT " (%" GST_TIME_FORMAT
|
". Video position=%" GST_TIME_FORMAT " (%" GST_TIME_FORMAT
|
||||||
") type %s",
|
") type %s",
|
||||||
GST_TIME_ARGS (packet->event_ts), GST_TIME_ARGS (vid_run_ts),
|
GST_TIME_ARGS (packet->event_ts), GST_TIME_ARGS (vid_run_ts),
|
||||||
GST_TIME_ARGS (dvdspu->video_seg.last_stop),
|
GST_TIME_ARGS (dvdspu->video_seg.position),
|
||||||
packet->buf ? "buffer" : "event");
|
packet->buf ? "buffer" : "event");
|
||||||
|
|
||||||
if (packet->buf) {
|
if (packet->buf) {
|
||||||
|
@ -796,9 +766,9 @@ gst_dvd_spu_check_still_updates (GstDVDSpu * dvdspu)
|
||||||
if (dvdspu->spu_state.flags & SPU_STATE_STILL_FRAME) {
|
if (dvdspu->spu_state.flags & SPU_STATE_STILL_FRAME) {
|
||||||
|
|
||||||
vid_ts = gst_segment_to_running_time (&dvdspu->video_seg,
|
vid_ts = gst_segment_to_running_time (&dvdspu->video_seg,
|
||||||
GST_FORMAT_TIME, dvdspu->video_seg.last_stop);
|
GST_FORMAT_TIME, dvdspu->video_seg.position);
|
||||||
sub_ts = gst_segment_to_running_time (&dvdspu->subp_seg,
|
sub_ts = gst_segment_to_running_time (&dvdspu->subp_seg,
|
||||||
GST_FORMAT_TIME, dvdspu->subp_seg.last_stop);
|
GST_FORMAT_TIME, dvdspu->subp_seg.position);
|
||||||
|
|
||||||
vid_ts = MAX (vid_ts, sub_ts);
|
vid_ts = MAX (vid_ts, sub_ts);
|
||||||
|
|
||||||
|
@ -818,7 +788,7 @@ submit_new_spu_packet (GstDVDSpu * dvdspu, GstBuffer * buf)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dvdspu,
|
GST_DEBUG_OBJECT (dvdspu,
|
||||||
"Complete subpicture buffer of %u bytes with TS %" GST_TIME_FORMAT,
|
"Complete subpicture buffer of %u bytes with TS %" GST_TIME_FORMAT,
|
||||||
GST_BUFFER_SIZE (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
gst_buffer_get_size (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
||||||
|
|
||||||
/* Decide whether to pass this buffer through to the rendering code */
|
/* Decide whether to pass this buffer through to the rendering code */
|
||||||
ts = GST_BUFFER_TIMESTAMP (buf);
|
ts = GST_BUFFER_TIMESTAMP (buf);
|
||||||
|
@ -874,13 +844,12 @@ gst_dvd_spu_subpic_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
GST_INFO_OBJECT (dvdspu, "Have subpicture buffer with timestamp %"
|
GST_INFO_OBJECT (dvdspu, "Have subpicture buffer with timestamp %"
|
||||||
GST_TIME_FORMAT " and size %u",
|
GST_TIME_FORMAT " and size %u",
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), GST_BUFFER_SIZE (buf));
|
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), gst_buffer_get_size (buf));
|
||||||
|
|
||||||
DVD_SPU_LOCK (dvdspu);
|
DVD_SPU_LOCK (dvdspu);
|
||||||
|
|
||||||
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||||
gst_segment_set_last_stop (&dvdspu->subp_seg, GST_FORMAT_TIME,
|
dvdspu->subp_seg.position = GST_BUFFER_TIMESTAMP (buf);
|
||||||
GST_BUFFER_TIMESTAMP (buf));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_BUFFER_IS_DISCONT (buf) && dvdspu->partial_spu) {
|
if (GST_BUFFER_IS_DISCONT (buf) && dvdspu->partial_spu) {
|
||||||
|
@ -1053,29 +1022,20 @@ gst_dvd_spu_subpic_event (GstPad * pad, GstEvent * event)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_NEWSEGMENT:
|
case GST_EVENT_SEGMENT:
|
||||||
{
|
{
|
||||||
gboolean update;
|
GstSegment seg;
|
||||||
gdouble rate;
|
|
||||||
GstFormat format;
|
|
||||||
gint64 start, stop, time;
|
|
||||||
gdouble arate;
|
|
||||||
|
|
||||||
gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
|
gst_event_copy_segment (event, &seg);
|
||||||
&start, &stop, &time);
|
|
||||||
|
|
||||||
/* Only print updates if they have an end time (don't print start_time
|
/* Only print updates if they have an end time (don't print start_time
|
||||||
* updates */
|
* updates */
|
||||||
GST_DEBUG_OBJECT (dvdspu, "subpic pad NewSegment:"
|
GST_DEBUG_OBJECT (dvdspu, "subpic pad Segment: %" GST_SEGMENT_FORMAT,
|
||||||
" Update %d, rate %g arate %g format %d start %" GST_TIME_FORMAT
|
&seg);
|
||||||
" %" GST_TIME_FORMAT " position %" GST_TIME_FORMAT,
|
|
||||||
update, rate, arate, format, GST_TIME_ARGS (start),
|
|
||||||
GST_TIME_ARGS (stop), GST_TIME_ARGS (time));
|
|
||||||
|
|
||||||
DVD_SPU_LOCK (dvdspu);
|
DVD_SPU_LOCK (dvdspu);
|
||||||
|
|
||||||
gst_segment_set_newsegment_full (&dvdspu->subp_seg, update, rate, arate,
|
dvdspu->subp_seg = seg;
|
||||||
format, start, stop, time);
|
|
||||||
GST_LOG_OBJECT (dvdspu, "Subpicture segment now: %" GST_SEGMENT_FORMAT,
|
GST_LOG_OBJECT (dvdspu, "Subpicture segment now: %" GST_SEGMENT_FORMAT,
|
||||||
&dvdspu->subp_seg);
|
&dvdspu->subp_seg);
|
||||||
DVD_SPU_UNLOCK (dvdspu);
|
DVD_SPU_UNLOCK (dvdspu);
|
||||||
|
@ -1152,7 +1112,7 @@ gst_dvd_spu_change_state (GstElement * element, GstStateChange transition)
|
||||||
GstDVDSpu *dvdspu = (GstDVDSpu *) element;
|
GstDVDSpu *dvdspu = (GstDVDSpu *) element;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
ret = parent_class->change_state (element, transition);
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
|
|
Loading…
Reference in a new issue