Commit a2c6e2b6 authored by Vivia Nikolaidou's avatar Vivia Nikolaidou Committed by Sebastian Dröge

timecodestamper: New element to attach SMPTE timecode to buffers

The timecodestamper element attaches a SMPTE timecode to each video buffer.
This timecode corresponds to the current stream time.

https://bugzilla.gnome.org/show_bug.cgi?id=766419
parent de1f42a2
......@@ -524,6 +524,7 @@ AG_GST_CHECK_PLUGIN(smooth)
AG_GST_CHECK_PLUGIN(speed)
AG_GST_CHECK_PLUGIN(subenc)
AG_GST_CHECK_PLUGIN(stereo)
AG_GST_CHECK_PLUGIN(timecode)
AG_GST_CHECK_PLUGIN(tta)
AG_GST_CHECK_PLUGIN(videofilters)
AG_GST_CHECK_PLUGIN(videomeasure)
......@@ -3642,6 +3643,7 @@ gst/speed/Makefile
gst/subenc/Makefile
gst/stereo/Makefile
gst/tta/Makefile
gst/timecode/Makefile
gst/videofilters/Makefile
gst/videomeasure/Makefile
gst/videoparsers/Makefile
......
plugin_LTLIBRARIES = libgsttimecode.la
libgsttimecode_la_SOURCES = plugin.c gsttimecodestamper.c
libgsttimecode_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgsttimecode_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-1.0 $(GST_LIBS)
libgsttimecode_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsttimecode_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = gsttimecodestamper.h
This diff is collapsed.
/*
* GStreamer
* Copyright (C) 2016 Vivia Nikolaidou <vivia@toolsonair.com>
*
* gsttimecodestamper.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_TIME_CODE_STAMPER_H__
#define __GST_TIME_CODE_STAMPER_H__
#include <gst/gst.h>
#include <gst/video/video.h>
#define GST_TYPE_TIME_CODE_STAMPER (gst_timecodestamper_get_type())
#define GST_TIME_CODE_STAMPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TIME_CODE_STAMPER,GstTimeCodeStamper))
#define GST_TIME_CODE_STAMPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_TIME_CODE_STAMPER,GstTimeCodeStamperClass))
#define GST_TIME_CODE_STAMPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_TIME_CODE_STAMPER,GstTimeCodeStamperClass))
#define GST_IS_TIME_CODE_STAMPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TIME_CODE_STAMPER))
#define GST_IS_TIME_CODE_STAMPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_TIME_CODE_STAMPER))
typedef struct _GstTimeCodeStamper GstTimeCodeStamper;
typedef struct _GstTimeCodeStamperClass GstTimeCodeStamperClass;
/**
* GstTimeCodeStamper:
*
* Opaque data structure.
*/
struct _GstTimeCodeStamper
{
GstBaseTransform videofilter;
/* < private > */
gboolean override_existing;
gboolean drop_frame;
GstVideoTimeCode *current_tc;
GstVideoInfo vinfo;
GstClock *source_clock;
};
struct _GstTimeCodeStamperClass
{
GstBaseTransformClass parent_class;
};
GType gst_timecodestamper_get_type (void);
G_END_DECLS
#endif /* __GST_TIME_CODE_STAMPER_H__ */
/*
* GStreamer
* Copyright (C) 2016 Vivia Nikolaidou <vivia@toolsonair.com>
*
* plugin.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gsttimecodestamper.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "timecodestamper", GST_RANK_NONE,
GST_TYPE_TIME_CODE_STAMPER);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
timecode,
"Timecode-related elements",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment