mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
dvbsuboverlay: Pass page_time_out and pts with the DVBSubtitles structure
Eases holding onto the information in gst plugins side queue of DVBSubtitles, so we won't need to create yet another temporary struct to keep the pts and page_time_out too. And this really logically belongs at the toplevel information set anyway and in that struct...
This commit is contained in:
parent
aca7237878
commit
7e2e52cab8
3 changed files with 11 additions and 8 deletions
|
@ -1350,11 +1350,12 @@ _dvb_sub_parse_end_of_display_set (DvbSub * dvb_sub, guint16 page_id,
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub->pts = pts;
|
||||||
|
sub->page_time_out = priv->page_time_out;
|
||||||
sub->num_rects = i;
|
sub->num_rects = i;
|
||||||
|
|
||||||
if (priv->callbacks.new_data) {
|
if (priv->callbacks.new_data) {
|
||||||
priv->callbacks.new_data (dvb_sub, pts, sub, priv->page_time_out,
|
priv->callbacks.new_data (dvb_sub, sub, priv->user_data);
|
||||||
priv->user_data);
|
|
||||||
} else {
|
} else {
|
||||||
/* No-one responsible to clean up memory, so do it ourselves */
|
/* No-one responsible to clean up memory, so do it ourselves */
|
||||||
/* FIXME: Just don't bother with all this palette image creation in the first place then... */
|
/* FIXME: Just don't bother with all this palette image creation in the first place then... */
|
||||||
|
|
|
@ -101,6 +101,8 @@ typedef struct DVBSubtitleRect {
|
||||||
* A structure representing a set of subtitle objects.
|
* A structure representing a set of subtitle objects.
|
||||||
*/
|
*/
|
||||||
typedef struct DVBSubtitles {
|
typedef struct DVBSubtitles {
|
||||||
|
guint64 pts;
|
||||||
|
guint8 page_time_out;
|
||||||
unsigned int num_rects;
|
unsigned int num_rects;
|
||||||
DVBSubtitleRect **rects;
|
DVBSubtitleRect **rects;
|
||||||
} DVBSubtitles;
|
} DVBSubtitles;
|
||||||
|
@ -118,7 +120,7 @@ typedef struct DVBSubtitles {
|
||||||
* dvb_sub_set_callbacks().
|
* dvb_sub_set_callbacks().
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*new_data) (DvbSub *dvb_sub, guint64 pts, DVBSubtitles * subs, guint8 page_time_out, gpointer user_data);
|
void (*new_data) (DvbSub *dvb_sub, DVBSubtitles * subs, gpointer user_data);
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gpointer _dvb_sub_reserved[3];
|
gpointer _dvb_sub_reserved[3];
|
||||||
} DvbSubCallbacks;
|
} DvbSubCallbacks;
|
||||||
|
|
|
@ -120,8 +120,8 @@ static gboolean gst_dvbsub_overlay_event_video (GstPad * pad, GstEvent * event);
|
||||||
static gboolean gst_dvbsub_overlay_event_text (GstPad * pad, GstEvent * event);
|
static gboolean gst_dvbsub_overlay_event_text (GstPad * pad, GstEvent * event);
|
||||||
static gboolean gst_dvbsub_overlay_event_src (GstPad * pad, GstEvent * event);
|
static gboolean gst_dvbsub_overlay_event_src (GstPad * pad, GstEvent * event);
|
||||||
|
|
||||||
static void new_dvb_subtitles_cb (DvbSub * dvb_sub, guint64 pts,
|
static void new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs,
|
||||||
DVBSubtitles * subs, guint8 page_time_out, gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static GstFlowReturn gst_dvbsub_overlay_bufferalloc_video (GstPad * pad,
|
static GstFlowReturn gst_dvbsub_overlay_bufferalloc_video (GstPad * pad,
|
||||||
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buffer);
|
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buffer);
|
||||||
|
@ -921,14 +921,14 @@ gst_dvbsub_overlay_process_text (GstDVBSubOverlay * overlay, GstBuffer * buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
new_dvb_subtitles_cb (DvbSub * dvb_sub, guint64 pts, DVBSubtitles * subs,
|
new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs, gpointer user_data)
|
||||||
guint8 page_time_out, gpointer user_data)
|
|
||||||
{
|
{
|
||||||
GstDVBSubOverlay *overlay = GST_DVBSUB_OVERLAY (user_data);
|
GstDVBSubOverlay *overlay = GST_DVBSUB_OVERLAY (user_data);
|
||||||
GST_INFO_OBJECT (overlay,
|
GST_INFO_OBJECT (overlay,
|
||||||
"New DVB subtitles arrived with a page_time_out of %d and %d regions for PTS=%"
|
"New DVB subtitles arrived with a page_time_out of %d and %d regions for PTS=%"
|
||||||
G_GUINT64_FORMAT ", which should be at running time %" GST_TIME_FORMAT,
|
G_GUINT64_FORMAT ", which should be at running time %" GST_TIME_FORMAT,
|
||||||
page_time_out, subs->num_rects, pts, GST_TIME_ARGS (pts));
|
subs->page_time_out, subs->num_rects, subs->pts,
|
||||||
|
GST_TIME_ARGS (subs->pts));
|
||||||
//GST_OBJECT_LOCK (overlay);
|
//GST_OBJECT_LOCK (overlay);
|
||||||
overlay->subtitle_buffer = subs->num_rects;
|
overlay->subtitle_buffer = subs->num_rects;
|
||||||
//GST_OBJECT_UNLOCK (overlay);
|
//GST_OBJECT_UNLOCK (overlay);
|
||||||
|
|
Loading…
Reference in a new issue