diff options
author | Yuqing Zhu <b54851@freescale.com> | 2015-08-10 11:41:42 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-11 09:28:49 -0700 |
commit | e9a3cfad288b79dd6036d7de7a4e21b8bb5c05ca (patch) | |
tree | b7a69ec0153c6c8ddc09051897c937e834bc3aa3 /meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base | |
parent | 96cc8de72c6bd4308a4a2a269b06084f024f3597 (diff) | |
download | poky-e9a3cfad288b79dd6036d7de7a4e21b8bb5c05ca.tar.gz |
gstreamer1.0-plugins-base: Set need_segment after sink pad receive GST_EVENT_SEGMENT
Subparse works in push mode, chain funciton will be called once
up stream element finished the seeking and flushing.
If set need_segment flag in src pad event handler, the segment
event will be pushed earlier, result in the subtitle text will
be send out to down stream from the beginning.
(From OE-Core rev: 48742378cd91297db439ee83576f3663befaa8f9)
Signed-off-by: Yuqing Zhu <b54851@freescale.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base')
-rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch new file mode 100644 index 0000000000..7813915d8d --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From ed09c8fd2c9c2b5384b72cc70af3728be6694e64 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingke Wang <mingke.wang@freescale.com> | ||
3 | Date: Thu, 19 Mar 2015 14:20:26 +0800 | ||
4 | Subject: [PATCH 4/4] subparse: set need_segment after sink pad received | ||
5 | GST_EVENT_SEGMENT | ||
6 | |||
7 | subparse works in push mode, chain funciton will be called once | ||
8 | up stream element finished the seeking and flushing. | ||
9 | if set need_segment flag in src pad event handler, the segment | ||
10 | event will be pushed earlier, result in the subtitle text will | ||
11 | be send out to down stream from the beginning. | ||
12 | |||
13 | Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747498] | ||
14 | |||
15 | Signed-off-by: Mingke Wang <mingke.wang@freescale.com> | ||
16 | |||
17 | diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c | ||
18 | old mode 100644 | ||
19 | new mode 100755 | ||
20 | index b565e93..7741ccc | ||
21 | --- a/gst/subparse/gstsubparse.c | ||
22 | +++ b/gst/subparse/gstsubparse.c | ||
23 | @@ -266,22 +266,20 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event) | ||
24 | goto beach; | ||
25 | } | ||
26 | |||
27 | + /* Apply the seek to our segment */ | ||
28 | + gst_segment_do_seek (&self->segment, rate, format, flags, | ||
29 | + start_type, start, stop_type, stop, &update); | ||
30 | + | ||
31 | + GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT, | ||
32 | + &self->segment); | ||
33 | + | ||
34 | /* Convert that seek to a seeking in bytes at position 0, | ||
35 | FIXME: could use an index */ | ||
36 | ret = gst_pad_push_event (self->sinkpad, | ||
37 | gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, | ||
38 | GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0)); | ||
39 | |||
40 | - if (ret) { | ||
41 | - /* Apply the seek to our segment */ | ||
42 | - gst_segment_do_seek (&self->segment, rate, format, flags, | ||
43 | - start_type, start, stop_type, stop, &update); | ||
44 | - | ||
45 | - GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT, | ||
46 | - &self->segment); | ||
47 | - | ||
48 | - self->need_segment = TRUE; | ||
49 | - } else { | ||
50 | + if (!ret) { | ||
51 | GST_WARNING_OBJECT (self, "seek to 0 bytes failed"); | ||
52 | } | ||
53 | |||
54 | @@ -1632,8 +1630,10 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) | ||
55 | gst_event_parse_segment (event, &s); | ||
56 | if (s->format == GST_FORMAT_TIME) | ||
57 | gst_event_copy_segment (event, &self->segment); | ||
58 | - GST_DEBUG_OBJECT (self, "newsegment (%s)", | ||
59 | - gst_format_get_name (self->segment.format)); | ||
60 | + GST_DEBUG_OBJECT (self, "newsegment (%s) %" GST_SEGMENT_FORMAT, | ||
61 | + gst_format_get_name (self->segment.format), &self->segment); | ||
62 | + | ||
63 | + self->need_segment = TRUE; | ||
64 | |||
65 | /* if not time format, we'll either start with a 0 timestamp anyway or | ||
66 | * it's following a seek in which case we'll have saved the requested | ||
67 | -- | ||
68 | 1.7.9.5 | ||
69 | |||