mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
videoparsers: port to baseparse, which is now in libgstbase in core
This commit is contained in:
parent
38c6f6366c
commit
5365dbfdce
8 changed files with 18 additions and 20 deletions
|
@ -5,9 +5,8 @@ libgstvideoparsersbad_la_SOURCES = plugin.c \
|
|||
gsth264parse.c h264parse.c \
|
||||
gstdiracparse.c dirac_parse.c
|
||||
libgstvideoparsersbad_la_CFLAGS = \
|
||||
$(GST_PLUGINS_BAD_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
$(GST_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstvideoparsersbad_la_LIBADD = \
|
||||
$(top_builddir)/gst-libs/gst/baseparse/libgstbaseparse-$(GST_MAJORMINOR).la \
|
||||
$(GST_BASE_LIBS) $(GST_LIBS)
|
||||
libgstvideoparsersbad_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstvideoparsersbad_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstbytereader.h>
|
||||
#include <gst/baseparse/gstbaseparse.h>
|
||||
#include "gstdiracparse.h"
|
||||
|
||||
/* prototypes */
|
||||
|
@ -239,8 +238,8 @@ gst_dirac_parse_check_valid_frame (GstBaseParse * parse,
|
|||
GstDiracParse *diracparse = GST_DIRAC_PARSE (parse);
|
||||
int off;
|
||||
guint32 next_header;
|
||||
gboolean sync;
|
||||
gboolean drain;
|
||||
gboolean lost_sync;
|
||||
gboolean draining;
|
||||
|
||||
if (G_UNLIKELY (GST_BUFFER_SIZE (frame->buffer) < 13))
|
||||
return FALSE;
|
||||
|
@ -269,10 +268,10 @@ gst_dirac_parse_check_valid_frame (GstBaseParse * parse,
|
|||
|
||||
GST_LOG ("framesize %d", *framesize);
|
||||
|
||||
sync = GST_BASE_PARSE_FRAME_SYNC (frame);
|
||||
drain = GST_BASE_PARSE_FRAME_DRAIN (frame);
|
||||
lost_sync = GST_BASE_PARSE_LOST_SYNC (frame);
|
||||
draining = GST_BASE_PARSE_DRAINING (frame);
|
||||
|
||||
if (!sync && !drain) {
|
||||
if (lost_sync && !draining) {
|
||||
guint32 next_sync_word = 0;
|
||||
|
||||
next_header = GST_READ_UINT32_BE (GST_BUFFER_DATA (frame->buffer) + 5);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define _GST_DIRAC_PARSE_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/baseparse/gstbaseparse.h>
|
||||
#include <gst/base/gstbaseparse.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ gst_h263_parse_check_valid_frame (GstBaseParse * parse,
|
|||
next_psc_pos = find_psc (buffer, next_psc_pos);
|
||||
|
||||
if (next_psc_pos == -1) {
|
||||
if (GST_BASE_PARSE_FRAME_DRAIN (frame))
|
||||
if (GST_BASE_PARSE_DRAINING (parse))
|
||||
/* FLUSH/EOS, it's okay if we can't find the next frame */
|
||||
next_psc_pos = GST_BUFFER_SIZE (buffer);
|
||||
else
|
||||
|
@ -290,11 +290,11 @@ gst_h263_parse_check_valid_frame (GstBaseParse * parse,
|
|||
res = gst_h263_parse_get_params (¶ms, buffer, FALSE, &h263parse->state);
|
||||
if (res != GST_FLOW_OK || h263parse->state != GOT_HEADER) {
|
||||
GST_WARNING ("Couldn't parse header - setting passthrough mode");
|
||||
gst_base_parse_set_format (parse,
|
||||
GST_BASE_PARSE_FORMAT_PASSTHROUGH, TRUE);
|
||||
gst_base_parse_set_passthrough (parse, TRUE);
|
||||
} else {
|
||||
/* Set srcpad caps since we now have sufficient information to do so */
|
||||
gst_h263_parse_set_src_caps (h263parse, ¶ms);
|
||||
gst_base_parse_set_passthrough (parse, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ gst_h263_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
* parse the header, which should not be possible. Either way, go into
|
||||
* passthrough mode and let downstream handle it if it can. */
|
||||
GST_WARNING ("Couldn't parse header - setting passthrough mode");
|
||||
gst_base_parse_set_format (parse, GST_BASE_PARSE_FORMAT_PASSTHROUGH, TRUE);
|
||||
gst_base_parse_set_passthrough (parse, TRUE);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include <gst/baseparse/gstbaseparse.h>
|
||||
#include <gst/base/gstbaseparse.h>
|
||||
|
||||
#include "h263parse.h"
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <gst/base/gstbytereader.h>
|
||||
#include <gst/base/gstbytewriter.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include "gsth264parse.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -495,7 +496,7 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
|
|||
sc_pos = 0;
|
||||
}
|
||||
|
||||
drain = GST_BASE_PARSE_FRAME_DRAIN (frame);
|
||||
drain = GST_BASE_PARSE_DRAINING (parse);
|
||||
while (TRUE) {
|
||||
gint prev_sc_pos;
|
||||
|
||||
|
@ -684,7 +685,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse)
|
|||
GST_TYPE_FRACTION, sps->fps_num, sps->fps_den, NULL);
|
||||
h264parse->fps_num = sps->fps_num;
|
||||
h264parse->fps_den = sps->fps_den;
|
||||
gst_base_parse_set_frame_props (GST_BASE_PARSE (h264parse),
|
||||
gst_base_parse_set_frame_rate (GST_BASE_PARSE (h264parse),
|
||||
h264parse->fps_num, h264parse->fps_den, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -978,6 +979,7 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
|
|||
/* arrange to insert codec-data in-stream if needed */
|
||||
h264parse->push_codec = h264parse->packetized;
|
||||
}
|
||||
gst_base_parse_set_passthrough (parse, FALSE);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (h264parse, "passing on packetized AVC");
|
||||
/* no choice to negotiate */
|
||||
|
@ -986,8 +988,7 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
|
|||
/* fallback codec-data */
|
||||
h264parse->codec_data = gst_buffer_ref (buffer);
|
||||
/* pass through unharmed, though _chain will parse a bit */
|
||||
gst_base_parse_set_format (parse,
|
||||
GST_BASE_PARSE_FORMAT_PASSTHROUGH, TRUE);
|
||||
gst_base_parse_set_passthrough (parse, TRUE);
|
||||
/* we did parse codec-data and might supplement src caps */
|
||||
gst_h264_parse_update_src_caps (h264parse);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#define __GST_H264_PARSE_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/baseparse/gstbaseparse.h>
|
||||
#include <gst/base/gstbaseparse.h>
|
||||
|
||||
#include "h264parse.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
#include <gst/baseparse/gstbaseparse.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
Loading…
Reference in a new issue