mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 18:50:48 +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;
|
||||
}
|
||||
|
||||
sub->pts = pts;
|
||||
sub->page_time_out = priv->page_time_out;
|
||||
sub->num_rects = i;
|
||||
|
||||
if (priv->callbacks.new_data) {
|
||||
priv->callbacks.new_data (dvb_sub, pts, sub, priv->page_time_out,
|
||||
priv->user_data);
|
||||
priv->callbacks.new_data (dvb_sub, sub, priv->user_data);
|
||||
} else {
|
||||
/* 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... */
|
||||
|
|
|
@ -101,6 +101,8 @@ typedef struct DVBSubtitleRect {
|
|||
* A structure representing a set of subtitle objects.
|
||||
*/
|
||||
typedef struct DVBSubtitles {
|
||||
guint64 pts;
|
||||
guint8 page_time_out;
|
||||
unsigned int num_rects;
|
||||
DVBSubtitleRect **rects;
|
||||
} DVBSubtitles;
|
||||
|
@ -118,7 +120,7 @@ typedef struct DVBSubtitles {
|
|||
* dvb_sub_set_callbacks().
|
||||
*/
|
||||
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 >*/
|
||||
gpointer _dvb_sub_reserved[3];
|
||||
} 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_src (GstPad * pad, GstEvent * event);
|
||||
|
||||
static void new_dvb_subtitles_cb (DvbSub * dvb_sub, guint64 pts,
|
||||
DVBSubtitles * subs, guint8 page_time_out, gpointer user_data);
|
||||
static void new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs,
|
||||
gpointer user_data);
|
||||
|
||||
static GstFlowReturn gst_dvbsub_overlay_bufferalloc_video (GstPad * pad,
|
||||
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buffer);
|
||||
|
@ -921,14 +921,14 @@ gst_dvbsub_overlay_process_text (GstDVBSubOverlay * overlay, GstBuffer * buffer,
|
|||
}
|
||||
|
||||
static void
|
||||
new_dvb_subtitles_cb (DvbSub * dvb_sub, guint64 pts, DVBSubtitles * subs,
|
||||
guint8 page_time_out, gpointer user_data)
|
||||
new_dvb_subtitles_cb (DvbSub * dvb_sub, DVBSubtitles * subs, gpointer user_data)
|
||||
{
|
||||
GstDVBSubOverlay *overlay = GST_DVBSUB_OVERLAY (user_data);
|
||||
GST_INFO_OBJECT (overlay,
|
||||
"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,
|
||||
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);
|
||||
overlay->subtitle_buffer = subs->num_rects;
|
||||
//GST_OBJECT_UNLOCK (overlay);
|
||||
|
|
Loading…
Reference in a new issue