mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
meta: remove timing metadata
This is now on buffers by default
This commit is contained in:
parent
88e12228cf
commit
89fd4ded72
2 changed files with 0 additions and 77 deletions
|
@ -104,50 +104,3 @@ gst_meta_get_info (const gchar * impl)
|
|||
|
||||
return info;
|
||||
}
|
||||
|
||||
/* Timing metadata */
|
||||
static void
|
||||
meta_timing_copy (GstBuffer * copybuf, GstMetaTiming * meta,
|
||||
GstBuffer * buffer, gsize offset, gsize size)
|
||||
{
|
||||
GstMetaTiming *timing;
|
||||
|
||||
GST_DEBUG ("trans called from buffer %p to %p, meta %p,"
|
||||
"offset %" G_GSIZE_FORMAT ", size %" G_GSIZE_FORMAT, buffer,
|
||||
copybuf, meta, offset, size);
|
||||
|
||||
timing = gst_buffer_add_meta_timing (copybuf);
|
||||
if (offset == 0) {
|
||||
/* same offset, copy timestamps */
|
||||
timing->pts = meta->pts;
|
||||
timing->dts = meta->dts;
|
||||
if (size == gst_buffer_get_size (buffer)) {
|
||||
/* same size, copy duration */
|
||||
timing->duration = meta->duration;
|
||||
} else {
|
||||
/* else clear */
|
||||
timing->duration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
} else {
|
||||
timing->pts = -1;
|
||||
timing->dts = -1;
|
||||
timing->duration = -1;
|
||||
}
|
||||
timing->clock_rate = meta->clock_rate;
|
||||
}
|
||||
|
||||
const GstMetaInfo *
|
||||
gst_meta_timing_get_info (void)
|
||||
{
|
||||
static const GstMetaInfo *meta_info = NULL;
|
||||
|
||||
if (meta_info == NULL) {
|
||||
meta_info = gst_meta_register ("GstMetaTiming", "GstMetaTiming",
|
||||
sizeof (GstMetaTiming),
|
||||
(GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL,
|
||||
(GstMetaCopyFunction) meta_timing_copy,
|
||||
(GstMetaTransformFunction) NULL);
|
||||
}
|
||||
return meta_info;
|
||||
}
|
||||
|
|
|
@ -116,36 +116,6 @@ const GstMetaInfo * gst_meta_register (const gchar *api, const gchar *im
|
|||
GstMetaTransformFunction transform_func);
|
||||
const GstMetaInfo * gst_meta_get_info (const gchar * impl);
|
||||
|
||||
/* default metadata */
|
||||
|
||||
/* timing metadata */
|
||||
typedef struct _GstMetaTiming GstMetaTiming;
|
||||
|
||||
const GstMetaInfo *gst_meta_timing_get_info(void);
|
||||
#define GST_META_TIMING_INFO (gst_meta_timing_get_info())
|
||||
|
||||
/**
|
||||
* GstMetaTiming:
|
||||
* @meta: parent metadata
|
||||
* @dts: the decoding timestamp
|
||||
* @pts: the presentation timestamp
|
||||
* @duration: the duration
|
||||
* @clock_rate: the clock rate of the dts, pts and duration values
|
||||
*
|
||||
* Extra timing metadata
|
||||
*/
|
||||
struct _GstMetaTiming {
|
||||
GstMeta meta; /* common meta header */
|
||||
|
||||
GstClockTime dts; /* decoding timestamp */
|
||||
GstClockTime pts; /* presentation timestamp */
|
||||
GstClockTime duration; /* duration of the data */
|
||||
GstClockTime clock_rate; /* clock rate for the above values */
|
||||
};
|
||||
|
||||
#define gst_buffer_get_meta_timing(b) ((GstMetaTiming*)gst_buffer_get_meta((b),GST_META_TIMING_INFO))
|
||||
#define gst_buffer_add_meta_timing(b) ((GstMetaTiming*)gst_buffer_add_meta((b),GST_META_TIMING_INFO,NULL))
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_META_H__ */
|
||||
|
|
Loading…
Reference in a new issue