Commit 7d06ecb3 authored by Seungha Yang's avatar Seungha Yang Committed by Reynaldo H. Verdejo Pinochet

isoff: Move isoff to gst-libs

Also rename unit test dash_isoff to isoff

https://bugzilla.gnome.org/show_bug.cgi?id=777825
parent 4686dc47
......@@ -3656,6 +3656,7 @@ gst-libs/gst/gl/x11/Makefile
gst-libs/gst/gl/viv-fb/Makefile
gst-libs/gst/insertbin/Makefile
gst-libs/gst/interfaces/Makefile
gst-libs/gst/isoff/Makefile
gst-libs/gst/codecparsers/Makefile
gst-libs/gst/mpegts/Makefile
gst-libs/gst/uridownloader/Makefile
......
......@@ -4,14 +4,12 @@ plugin_LTLIBRARIES = libgstdashdemux.la
libgstdashdemux_la_SOURCES = \
gstmpdparser.c \
gstdashdemux.c \
gstisoff.c \
gstplugin.c
# headers we need but don't want installed
noinst_HEADERS = \
gstmpdparser.h \
gstdashdemux.h \
gstisoff.h \
gstdash_debug.h
# compiler and linker flags used to compile this plugin, set in configure.ac
......@@ -24,6 +22,7 @@ libgstdashdemux_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) \
libgstdashdemux_la_LIBADD = \
$(top_builddir)/gst-libs/gst/uridownloader/libgsturidownloader-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/adaptivedemux/libgstadaptivedemux-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/isoff/libgstisoff-@GST_API_VERSION@.la \
$(GST_PLUGINS_BASE_LIBS) \
-lgsttag-$(GST_API_VERSION) \
$(GST_BASE_LIBS) \
......
......@@ -35,7 +35,7 @@
#include <gst/base/gstadapter.h>
#include <gst/base/gstdataqueue.h>
#include "gstmpdparser.h"
#include "gstisoff.h"
#include <gst/isoff/gstisoff.h>
#include <gst/uridownloader/gsturidownloader.h>
G_BEGIN_DECLS
......
dash_sources = [
'gstdashdemux.c',
'gstisoff.c',
'gstmpdparser.c',
'gstplugin.c',
]
......@@ -13,7 +12,7 @@ if xml2_dep.found()
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstadaptivedemux_dep, gsturidownloader_dep, gsttag_dep,
gstnet_dep, gstbase_dep, gio_dep, xml2_dep],
gstnet_dep, gstbase_dep, gstisoff_dep, gio_dep, xml2_dep],
install : true,
install_dir : plugins_install_dir,
)
......
......@@ -15,12 +15,12 @@ OPENCV_DIR=opencv
endif
SUBDIRS = uridownloader adaptivedemux interfaces basecamerabinsrc codecparsers \
insertbin mpegts base video audio player allocators $(GL_DIR) $(WAYLAND_DIR) \
insertbin mpegts base video audio player allocators isoff $(GL_DIR) $(WAYLAND_DIR) \
$(OPENCV_DIR)
noinst_HEADERS = gst-i18n-plugin.h gettext.h glib-compat-private.h
DIST_SUBDIRS = uridownloader adaptivedemux interfaces gl basecamerabinsrc \
codecparsers insertbin mpegts wayland opencv base video audio player allocators
codecparsers insertbin mpegts wayland opencv base video audio player allocators isoff
#dependencies
video, audio: base
......@@ -30,7 +30,7 @@ adaptivedemux: uridownloader
INDEPENDENT_SUBDIRS = \
interfaces basecamerabinsrc codecparsers insertbin uridownloader \
mpegts base player allocators $(GL_DIR) $(WAYLAND_DIR) $(OPENCV_DIR)
mpegts base player allocators isoff $(GL_DIR) $(WAYLAND_DIR) $(OPENCV_DIR)
.PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS)
......
lib_LTLIBRARIES = libgstisoff-@GST_API_VERSION@.la
libgstisoff_@GST_API_VERSION@_la_SOURCES = \
gstisoff.c
libgstisoff_@GST_API_VERSION@includedir = \
$(includedir)/gstreamer-@GST_API_VERSION@/gst/isoff
libgstisoff_@GST_API_VERSION@include_HEADERS = \
gstisoff.h
libgstisoff_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DGST_USE_UNSTABLE_API \
$(GST_CFLAGS)
libgstisoff_@GST_API_VERSION@_la_LIBADD = \
$(GST_BASE_LIBS) \
$(GST_LIBS)
libgstisoff_@GST_API_VERSION@_la_LDFLAGS = \
$(GST_LIB_LDFLAGS) \
$(GST_ALL_LDFLAGS) \
$(GST_LT_LDFLAGS)
......@@ -26,11 +26,20 @@
#include <gst/base/gstbytereader.h>
#include <string.h>
#include "gstdash_debug.h"
#define GST_CAT_DEFAULT gst_dash_demux_debug
GST_DEBUG_CATEGORY (gst_isoff_debug);
#define GST_CAT_DEFAULT gst_isoff_debug
/* gst_isoff_parse_box:
static gboolean initialized = FALSE;
#define INITIALIZE_DEBUG_CATEGORY \
if (!initialized) { \
GST_DEBUG_CATEGORY_INIT (gst_isoff_debug, "isoff", 0, \
"ISO File Format parsing library"); \
initialized = TRUE; \
}
/* gst_isoff_parse_box_header:
* @reader:
* @type: type that was found at the current position
* @extended_type: (allow-none): extended type if type=='uuid'
......@@ -49,6 +58,7 @@ gst_isoff_parse_box_header (GstByteReader * reader, guint32 * type,
guint header_start_offset;
guint32 size_field;
INITIALIZE_DEBUG_CATEGORY;
header_start_offset = gst_byte_reader_get_pos (reader);
if (gst_byte_reader_get_remaining (reader) < 8)
......@@ -288,6 +298,8 @@ gst_isoff_moof_box_parse (GstByteReader * reader)
GstMoofBox *moof;
gboolean had_mfhd = FALSE;
INITIALIZE_DEBUG_CATEGORY;
moof = g_new0 (GstMoofBox, 1);
moof->traf = g_array_new (FALSE, FALSE, sizeof (GstTrafBox));
g_array_set_clear_func (moof->traf,
......@@ -390,6 +402,7 @@ gst_isoff_sidx_parser_parse (GstSidxParser * parser,
GstIsoffParserResult res = GST_ISOFF_PARSER_OK;
gsize remaining;
INITIALIZE_DEBUG_CATEGORY;
switch (parser->status) {
case GST_ISOFF_SIDX_PARSER_INIT:
/* Try again once we have enough data for the FullBox header */
......@@ -492,6 +505,7 @@ gst_isoff_sidx_parser_add_buffer (GstSidxParser * parser, GstBuffer * buffer,
GstMapInfo info;
guint32 fourcc;
INITIALIZE_DEBUG_CATEGORY;
if (!gst_buffer_map (buffer, &info, GST_MAP_READ)) {
*consumed = 0;
return GST_ISOFF_PARSER_ERROR;
......
......@@ -193,4 +193,3 @@ GstIsoffParserResult gst_isoff_sidx_parser_add_buffer (GstSidxParser * parser, G
G_END_DECLS
#endif /* __GST_ISOFF_H__ */
isoff_sources = [
'gstisoff.c',
]
isoff_headers = [
'gstisoff.h',
]
install_headers(isoff_headers, subdir : 'gstreamer-1.0/gst/isoff')
gstisoff = library('gstisoff-' + api_version,
isoff_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,
install : true,
dependencies : [gstbase_dep],
vs_module_defs: vs_module_defs_dir + 'libgstisoff.def',
)
gstisoff_dep = declare_dependency(link_with : gstisoff,
include_directories : [libsinc],
dependencies : [gstbase_dep])
......@@ -8,6 +8,7 @@ subdir('basecamerabinsrc')
subdir('codecparsers')
subdir('insertbin')
subdir('interfaces')
subdir('isoff')
subdir('mpegts')
subdir('opencv')
subdir('player')
......
......@@ -41,7 +41,7 @@ check_assrender =
endif
if USE_DASH
check_dash = elements/dash_mpd elements/dash_isoff
check_dash = elements/dash_mpd
check_dash_demux = elements/dash_demux
else
check_dash =
......@@ -281,6 +281,7 @@ check_PROGRAMS = \
elements/id3mux \
pipelines/mxf \
$(check_ipcpipeline) \
libs/isoff \
libs/mpegvideoparser \
libs/mpegts \
libs/h264parser \
......@@ -301,7 +302,7 @@ check_PROGRAMS = \
$(check_player) \
$(EXPERIMENTAL_CHECKS)
noinst_HEADERS = elements/mxfdemux.h elements/dash_isoff.h
noinst_HEADERS = elements/mxfdemux.h libs/isoff.h
TESTS = $(check_PROGRAMS)
......@@ -343,6 +344,11 @@ elements_h264parse_LDADD = libparser.la $(LDADD)
elements_pcapparse_LDADD = libparser.la $(LDADD)
libs_isoff_CFLAGS = $(AM_CFLAGS) $(GST_BASE_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS)
libs_isoff_LDADD = $(LDADD) $(GST_BASE_LIBS) \
$(top_builddir)/gst-libs/gst/isoff/libgstisoff-@GST_API_VERSION@.la
libs_isoff_SOURCES = libs/isoff.c
libs_mpegvideoparser_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
-DGST_USE_UNSTABLE_API \
......@@ -458,9 +464,6 @@ elements_dash_mpd_LDADD = $(GST_BASE_LIBS) $(LDADD) $(LIBXML2_LIBS) \
$(top_builddir)/gst-libs/gst/uridownloader/libgsturidownloader-@GST_API_VERSION@.la
elements_dash_mpd_SOURCES = elements/dash_mpd.c
elements_dash_isoff_CFLAGS = $(AM_CFLAGS) $(GST_BASE_CFLAGS)
elements_dash_isoff_LDADD = $(LDADD) $(GST_BASE_LIBS)
elements_dash_isoff_SOURCES = elements/dash_isoff.c
elements_dash_demux_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(AM_CFLAGS) $(LIBXML2_CFLAGS)
elements_dash_demux_LDADD = \
......
#include "../../ext/dash/gstisoff.c"
#undef GST_CAT_DEFAULT
#include <gst/check/gstcheck.h>
#include <gst/base/base.h>
#include <gst/isoff/gstisoff.h>
GST_DEBUG_CATEGORY (gst_dash_demux_debug);
#include "dash_isoff.h"
#include "isoff.h"
GST_START_TEST (dash_isoff_box_header_minimal)
GST_START_TEST (isoff_box_header_minimal)
{
/* INDENT-OFF */
static const guint8 data[] = {
......@@ -31,7 +27,7 @@ GST_START_TEST (dash_isoff_box_header_minimal)
GST_END_TEST;
GST_START_TEST (dash_isoff_box_header_long_size)
GST_START_TEST (isoff_box_header_long_size)
{
/* INDENT-OFF */
static const guint8 data[] = {
......@@ -55,7 +51,7 @@ GST_START_TEST (dash_isoff_box_header_long_size)
GST_END_TEST;
GST_START_TEST (dash_isoff_box_header_uuid_type)
GST_START_TEST (isoff_box_header_uuid_type)
{
/* INDENT-OFF */
static const guint8 data[] = {
......@@ -83,7 +79,7 @@ GST_START_TEST (dash_isoff_box_header_uuid_type)
GST_END_TEST;
GST_START_TEST (dash_isoff_box_header_uuid_type_long_size)
GST_START_TEST (isoff_box_header_uuid_type_long_size)
{
/* INDENT-OFF */
static const guint8 data[] = {
......@@ -112,7 +108,7 @@ GST_START_TEST (dash_isoff_box_header_uuid_type_long_size)
GST_END_TEST;
GST_START_TEST (dash_isoff_moof_parse)
GST_START_TEST (isoff_moof_parse)
{
/* INDENT-ON */
GstByteReader reader = GST_BYTE_READER_INIT (moof1, sizeof (moof1));
......@@ -187,22 +183,19 @@ GST_END_TEST;
static Suite *
dash_isoff_suite (void)
{
Suite *s = suite_create ("dash-isoff");
Suite *s = suite_create ("isoff");
TCase *tc_isoff_box = tcase_create ("isoff-box-parsing");
TCase *tc_moof = tcase_create ("moof");
GST_DEBUG_CATEGORY_INIT (gst_dash_demux_debug, "gst_dash_demux_debug", 0,
"mpeg dash tests");
tcase_add_test (tc_isoff_box, dash_isoff_box_header_minimal);
tcase_add_test (tc_isoff_box, dash_isoff_box_header_long_size);
tcase_add_test (tc_isoff_box, dash_isoff_box_header_uuid_type);
tcase_add_test (tc_isoff_box, dash_isoff_box_header_uuid_type_long_size);
tcase_add_test (tc_isoff_box, isoff_box_header_minimal);
tcase_add_test (tc_isoff_box, isoff_box_header_long_size);
tcase_add_test (tc_isoff_box, isoff_box_header_uuid_type);
tcase_add_test (tc_isoff_box, isoff_box_header_uuid_type_long_size);
suite_add_tcase (s, tc_isoff_box);
tcase_add_test (tc_moof, dash_isoff_moof_parse);
tcase_add_test (tc_moof, isoff_moof_parse);
suite_add_tcase (s, tc_moof);
return s;
......
EXPORTS
gst_isoff_moof_box_free
gst_isoff_moof_box_parse
gst_isoff_parse_box_header
gst_isoff_sidx_parser_add_buffer
gst_isoff_sidx_parser_clear
gst_isoff_sidx_parser_init
gst_isoff_sidx_parser_parse
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