validate: Fix seding mistakes

When we added namespace to make GI happy we ended up with
structure called like GstValidateMediaGstValidateMediaXXX.
This commit is contained in:
Thibault Saunier 2016-03-08 17:01:09 +01:00
parent ef4635fe51
commit c2a35eef15
6 changed files with 119 additions and 219 deletions

View file

@ -43,7 +43,7 @@ typedef struct
jmp_buf err_jmp_buf;
const gchar *error;
void *user_data;
GstValidateGstValidateParseVariableFunc variable_func;
GstValidateParseVariableFunc variable_func;
} MathParser;
static gdouble _read_power (MathParser * parser);
@ -298,7 +298,7 @@ _read_boolean_or (MathParser * parser)
static gboolean
_init (MathParser * parser, const gchar * str,
GstValidateGstValidateParseVariableFunc variable_func, void *user_data)
GstValidateParseVariableFunc variable_func, void *user_data)
{
parser->str = str;
parser->len = strlen (str) + 1;
@ -451,7 +451,7 @@ _read_power (MathParser * parser)
*/
gdouble
gst_validate_utils_parse_expression (const gchar * expr,
GstValidateGstValidateParseVariableFunc variable_func, gpointer user_data,
GstValidateParseVariableFunc variable_func, gpointer user_data,
gchar ** error)
{
gdouble val;

View file

@ -29,11 +29,11 @@
#include<gio/gio.h>
#include <gst/gst.h>
typedef int (*GstValidateGstValidateParseVariableFunc) (const gchar *name,
typedef int (*GstValidateParseVariableFunc) (const gchar *name,
double *value, gpointer user_data);
gdouble gst_validate_utils_parse_expression (const gchar *expr,
GstValidateGstValidateParseVariableFunc variable_func,
GstValidateParseVariableFunc variable_func,
gpointer user_data,
gchar **error);
guint gst_validate_utils_flags_from_str (GType type, const gchar * str_flags);

View file

@ -43,8 +43,8 @@ struct _GstValidateMediaDescriptorParserPrivate
/* Private methods and callbacks */
static gint
compare_frames (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * frm,
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * frm1)
compare_frames (GstValidateMediaFrameNode * frm,
GstValidateMediaFrameNode * frm1)
{
if (frm->id < frm1->id)
return -1;
@ -57,7 +57,7 @@ compare_frames (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * frm,
static void
deserialize_filenode
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode *
(GstValidateMediaFileNode *
filenode, const gchar ** names, const gchar ** values)
{
gint i;
@ -75,14 +75,12 @@ static void
}
}
static GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
static GstValidateMediaStreamNode *
deserialize_streamnode (const gchar ** names, const gchar ** values)
{
gint i;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode);
GstValidateMediaStreamNode
* streamnode = g_slice_new0 (GstValidateMediaStreamNode);
for (i = 0; names[i] != NULL; i++) {
if (g_strcmp0 (names[i], "id") == 0)
@ -97,23 +95,19 @@ deserialize_streamnode (const gchar ** names, const gchar ** values)
return streamnode;
}
static GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode *
static GstValidateMediaTagsNode *
deserialize_tagsnode (const gchar ** names, const gchar ** values)
{
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode);
GstValidateMediaTagsNode *tagsnode = g_slice_new0 (GstValidateMediaTagsNode);
return tagsnode;
}
static GstValidateMediaGstValidateMediaGstValidateMediaTagNode *
static GstValidateMediaTagNode *
deserialize_tagnode (const gchar ** names, const gchar ** values)
{
gint i;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *tagnode =
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaTagNode);
GstValidateMediaTagNode *tagnode = g_slice_new0 (GstValidateMediaTagNode);
for (i = 0; names[i] != NULL; i++) {
if (g_strcmp0 (names[i], "content") == 0)
@ -123,13 +117,13 @@ deserialize_tagnode (const gchar ** names, const gchar ** values)
return tagnode;
}
static GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *
static GstValidateMediaFrameNode *
deserialize_framenode (const gchar ** names, const gchar ** values)
{
gint i;
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *framenode =
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode);
GstValidateMediaFrameNode *framenode =
g_slice_new0 (GstValidateMediaFrameNode);
for (i = 0; names[i] != NULL; i++) {
if (g_strcmp0 (names[i], "id") == 0)
@ -192,7 +186,7 @@ on_start_element_cb (GMarkupParseContext * context,
const gchar * element_name, const gchar ** attribute_names,
const gchar ** attribute_values, gpointer user_data, GError ** error)
{
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode
GstValidateMediaFileNode
* filenode = GST_VALIDATE_MEDIA_DESCRIPTOR (user_data)->filenode;
GstValidateMediaDescriptorParserPrivate *priv =
@ -201,13 +195,12 @@ on_start_element_cb (GMarkupParseContext * context,
if (g_strcmp0 (element_name, "file") == 0) {
deserialize_filenode (filenode, attribute_names, attribute_values);
} else if (g_strcmp0 (element_name, "stream") == 0) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
GstValidateMediaStreamNode
* node = deserialize_streamnode (attribute_names, attribute_values);
priv->in_stream = TRUE;
filenode->streams = g_list_prepend (filenode->streams, node);
} else if (g_strcmp0 (element_name, "frame") == 0) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode = filenode->streams->data;
GstValidateMediaStreamNode *streamnode = filenode->streams->data;
streamnode->cframe = streamnode->frames =
g_list_insert_sorted (streamnode->frames,
@ -215,10 +208,7 @@ on_start_element_cb (GMarkupParseContext * context,
(GCompareFunc) compare_frames);
} else if (g_strcmp0 (element_name, "tags") == 0) {
if (priv->in_stream) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
GstValidateMediaStreamNode *snode = (GstValidateMediaStreamNode *)
filenode->streams->data;
snode->tags = deserialize_tagsnode (attribute_names, attribute_values);
@ -226,14 +216,10 @@ on_start_element_cb (GMarkupParseContext * context,
filenode->tags = deserialize_tagsnode (attribute_names, attribute_values);
}
} else if (g_strcmp0 (element_name, "tag") == 0) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaTagsNode *tagsnode;
if (priv->in_stream) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
GstValidateMediaStreamNode *snode = (GstValidateMediaStreamNode *)
filenode->streams->data;
tagsnode = snode->tags;
} else {
@ -441,10 +427,7 @@ gboolean
caps = gst_pad_query_caps (pad, NULL);
for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
tmp->data;
if (streamnode->pad == NULL && gst_caps_is_equal (streamnode->caps, caps)) {
@ -474,10 +457,7 @@ gboolean
for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
tmp->data;
if (streamnode->pad == NULL)
@ -492,8 +472,7 @@ gboolean
gst_validate_media_descriptor_parser_add_taglist
(GstValidateMediaDescriptorParser * parser, GstTagList * taglist) {
GList *tmptag;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaTagsNode *tagsnode;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
FALSE);
@ -504,8 +483,7 @@ gboolean
tagsnode = ((GstValidateMediaDescriptor *) parser)->filenode->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare (
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
tmptag->data, taglist)) {
GST_DEBUG ("Adding tag %" GST_PTR_FORMAT, taglist);
return TRUE;
@ -519,8 +497,7 @@ gboolean
gst_validate_media_descriptor_parser_all_tags_found
(GstValidateMediaDescriptorParser * parser) {
GList *tmptag;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaTagsNode *tagsnode;
gboolean ret = TRUE;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
@ -532,14 +509,12 @@ gboolean
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
gchar *tag = NULL;
tag =
gst_tag_list_to_string ((
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
tag = gst_tag_list_to_string (((GstValidateMediaTagNode *)
tmptag->data)->taglist);
if (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
if (((GstValidateMediaTagNode *)
tmptag->data)->found == FALSE) {
if (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
if (((GstValidateMediaTagNode *)
tmptag->data)->taglist != NULL) {
GST_DEBUG ("Tag not found %s", tag);
} else {

View file

@ -122,9 +122,8 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
GString *res;
gchar *tmpstr, *caps_str;
GList *tmp, *tmp2;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode
GstValidateMediaTagsNode *tagsnode;
GstValidateMediaFileNode
* filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
tmpstr = g_markup_printf_escaped ("<file duration=\"%" G_GUINT64_FORMAT
@ -143,25 +142,20 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
g_free (tmpstr);
for (tmp = filenode->streams; tmp; tmp = tmp->next) {
GList *tmp3;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode =
(
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data);
GstValidateMediaStreamNode
* snode = ((GstValidateMediaStreamNode *) tmp->data);
STR_APPEND2 (snode->str_open);
for (tmp2 = snode->frames; tmp2; tmp2 = tmp2->next) {
STR_APPEND3 (((GstValidateMediaGstValidateMediaGstValidateMediaFrameNode
*) tmp2->data)->str_open);
STR_APPEND3 (((GstValidateMediaFrameNode *) tmp2->data)->str_open);
}
tagsnode = snode->tags;
if (tagsnode) {
STR_APPEND3 (tagsnode->str_open);
for (tmp3 = tagsnode->tags; tmp3; tmp3 = tmp3->next) {
STR_APPEND4 (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode
*) tmp3->data)->str_open);
STR_APPEND4 (((GstValidateMediaTagNode *) tmp3->data)->str_open);
}
STR_APPEND3 (tagsnode->str_close);
}
@ -174,7 +168,7 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
if (tagsnode) {
STR_APPEND1 (tagsnode->str_open);
for (tmp2 = tagsnode->tags; tmp2; tmp2 = tmp2->next) {
STR_APPEND2 (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
STR_APPEND2 (((GstValidateMediaTagNode *)
tmp2->data)->str_open);
}
STR_APPEND1 (tagsnode->str_close);
@ -187,17 +181,15 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
/* Should be called with GST_VALIDATE_MEDIA_DESCRIPTOR_LOCK */
static
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
GstValidateMediaStreamNode
* gst_validate_media_descriptor_find_stream_node_by_pad
(GstValidateMediaDescriptor * md, GstPad * pad)
{
GList *tmp;
for (tmp = md->filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmp->data;
if (streamnode->pad == pad) {
return streamnode;
@ -213,8 +205,7 @@ gst_validate_media_descriptor_writer_new (GstValidateRunner * runner,
const gchar * uri, GstClockTime duration, gboolean seekable)
{
GstValidateMediaDescriptorWriter *writer;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode
* fnode;
GstValidateMediaFileNode *fnode;
writer =
g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
@ -239,17 +230,14 @@ static gboolean
gboolean ret = FALSE;
GstCaps *caps;
gchar *capsstr = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode = NULL;
GstValidateMediaStreamNode *snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
FALSE);
snode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode);
snode = g_slice_new0 (GstValidateMediaStreamNode);
snode->frames = NULL;
snode->cframe = NULL;
@ -258,9 +246,7 @@ static gboolean
caps = gst_discoverer_stream_info_get_caps (info);
capsstr = gst_caps_to_string (caps);
g_slice_free
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode,
snode);
g_slice_free (GstValidateMediaStreamNode, snode);
GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_ID,
"Stream with caps: %s has no stream ID", capsstr);
gst_caps_unref (caps);
@ -323,8 +309,7 @@ _uridecodebin_probe (GstPad * pad, GstPadProbeInfo * info,
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:{
const GstSegment *segment;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode;
GstValidateMediaStreamNode *streamnode;
streamnode =
gst_validate_media_descriptor_find_stream_node_by_pad (
@ -352,16 +337,13 @@ _find_stream_id (GstPad * pad, GstEvent ** event,
{
if (GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START) {
GList *tmp;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode = NULL;
GstValidateMediaStreamNode *snode = NULL;
const gchar *stream_id;
gst_event_parse_stream_start (*event, &stream_id);
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) {
if (g_strcmp0 ((
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
if (g_strcmp0 (((GstValidateMediaStreamNode *)
tmp->data)->id, stream_id) == 0) {
snode = tmp->data;
@ -426,8 +408,7 @@ static void
pad_added_cb (GstElement * decodebin, GstPad * pad,
GstValidateMediaDescriptorWriter * writer)
{
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode = NULL;
GstValidateMediaStreamNode *snode = NULL;
GstPad *sinkpad, *srcpad;
/* Try to plug a parser so we have as much info as possible
@ -691,14 +672,12 @@ gboolean
gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
* writer, const gchar * stream_id, const GstTagList * taglist)
{
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *tagnode;
GstValidateMediaTagsNode *tagsnode;
GstValidateMediaTagNode *tagnode;
GList *tmp, *tmptag;
gchar *str_str = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode = NULL;
GstValidateMediaStreamNode *snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
@ -708,7 +687,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) {
if (g_strcmp0 ((
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
(GstValidateMediaStreamNode
*) tmp->data)->id, stream_id) == 0) {
snode = tmp->data;
@ -723,9 +702,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
}
if (snode->tags == NULL) {
tagsnode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode);
tagsnode = g_slice_new0 (GstValidateMediaTagsNode);
tagsnode->str_open = g_markup_printf_escaped ("<tags>");
tagsnode->str_close = g_markup_printf_escaped ("</tags>");
snode->tags = tagsnode;
@ -733,8 +710,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
tagsnode = snode->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare (
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
tmptag->data, taglist)) {
GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT,
taglist);
@ -743,8 +719,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
}
}
tagnode =
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaTagNode);
tagnode = g_slice_new0 (GstValidateMediaTagNode);
tagnode->taglist = gst_tag_list_copy (taglist);
str_str = gst_tag_list_to_string (tagnode->taglist);
tagnode->str_open =
@ -764,8 +739,7 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
gboolean ret = FALSE;
GstCaps *caps;
gchar *capsstr = NULL, *padname = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode = NULL;
GstValidateMediaStreamNode *snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
@ -775,19 +749,15 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
caps = gst_pad_get_current_caps (pad);
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmp->data;
if (streamnode->pad == pad) {
goto done;
}
}
snode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode);
snode = g_slice_new0 (GstValidateMediaStreamNode);
snode->frames = NULL;
snode->cframe = NULL;
@ -819,9 +789,8 @@ gboolean
gst_validate_media_descriptor_writer_add_taglist
(GstValidateMediaDescriptorWriter * writer, const GstTagList * taglist) {
gchar *str_str = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* tagsnode;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *tagnode;
GstValidateMediaTagsNode *tagsnode;
GstValidateMediaTagNode *tagnode;
GList *tmptag;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
@ -830,17 +799,14 @@ gboolean
FALSE);
if (((GstValidateMediaDescriptor *) writer)->filenode->tags == NULL) {
tagsnode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode);
tagsnode = g_slice_new0 (GstValidateMediaTagsNode);
tagsnode->str_open = g_markup_printf_escaped ("<tags>");
tagsnode->str_close = g_markup_printf_escaped ("</tags>");
((GstValidateMediaDescriptor *) writer)->filenode->tags = tagsnode;
} else {
tagsnode = ((GstValidateMediaDescriptor *) writer)->filenode->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare (
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
tmptag->data, taglist)) {
GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT,
taglist);
@ -849,8 +815,7 @@ gboolean
}
}
tagnode =
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaTagNode);
tagnode = g_slice_new0 (GstValidateMediaTagNode);
tagnode->taglist = gst_tag_list_copy (taglist);
str_str = gst_tag_list_to_string (tagnode->taglist);
tagnode->str_open =
@ -866,12 +831,11 @@ gboolean
gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter
* writer, GstPad * pad, GstBuffer * buf)
{
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode;
GstValidateMediaStreamNode *streamnode;
GstMapInfo map;
gchar *checksum;
guint id;
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *fnode;
GstValidateMediaFrameNode *fnode;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
@ -890,8 +854,7 @@ gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter
}
id = g_list_length (streamnode->frames);
fnode =
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode);
fnode = g_slice_new0 (GstValidateMediaFrameNode);
g_assert (gst_buffer_map (buf, &map, GST_MAP_READ));
checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5,

View file

@ -31,33 +31,27 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptorPrivate))
static inline void
free_tagnode (GstValidateMediaGstValidateMediaGstValidateMediaTagNode * tagnode)
free_tagnode (GstValidateMediaTagNode * tagnode)
{
g_free (tagnode->str_open);
g_free (tagnode->str_close);
if (tagnode->taglist)
gst_tag_list_unref (tagnode->taglist);
g_slice_free (GstValidateMediaGstValidateMediaGstValidateMediaTagNode,
tagnode);
g_slice_free (GstValidateMediaTagNode, tagnode);
}
static inline void
free_tagsnode
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode *
tagsnode)
free_tagsnode (GstValidateMediaTagsNode * tagsnode)
{
g_free (tagsnode->str_open);
g_free (tagsnode->str_close);
g_list_free_full (tagsnode->tags, (GDestroyNotify) free_tagnode);
g_slice_free
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode,
tagsnode);
g_slice_free (GstValidateMediaTagsNode, tagsnode);
}
static inline void
free_framenode (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *
framenode)
free_framenode (GstValidateMediaFrameNode * framenode)
{
g_free (framenode->str_open);
g_free (framenode->str_close);
@ -65,14 +59,11 @@ free_framenode (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *
if (framenode->buf)
gst_buffer_unref (framenode->buf);
g_slice_free (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode,
framenode);
g_slice_free (GstValidateMediaFrameNode, framenode);
}
static inline void
free_streamnode
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode)
free_streamnode (GstValidateMediaStreamNode * streamnode)
{
if (streamnode->caps)
gst_caps_unref (streamnode->caps);
@ -93,14 +84,11 @@ static inline void
g_free (streamnode->str_open);
g_free (streamnode->str_close);
g_slice_free
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode,
streamnode);
g_slice_free (GstValidateMediaStreamNode, streamnode);
}
void gst_validate_filenode_free
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode *
filenode)
void
gst_validate_filenode_free (GstValidateMediaFileNode * filenode)
{
g_list_free_full (filenode->streams, (GDestroyNotify) free_streamnode);
if (filenode->tags)
@ -115,15 +103,12 @@ void gst_validate_filenode_free
g_free (filenode->str_open);
g_free (filenode->str_close);
g_slice_free
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode,
filenode);
g_slice_free (GstValidateMediaFileNode, filenode);
}
gboolean
gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode * tnode,
const GstTagList * tlist)
gst_validate_tag_node_compare
(GstValidateMediaTagNode * tnode, const GstTagList * tlist)
{
if (gst_structure_is_equal (GST_STRUCTURE (tlist),
GST_STRUCTURE (tnode->taglist)) == FALSE) {
@ -168,9 +153,7 @@ gst_validate_media_descriptor_finalize (GstValidateMediaDescriptor * self)
static void
gst_validate_media_descriptor_init (GstValidateMediaDescriptor * self)
{
self->filenode =
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode);
self->filenode = g_slice_new0 (GstValidateMediaFileNode);
}
static void
@ -230,16 +213,12 @@ gst_validate_media_descriptor_class_init (GstValidateMediaDescriptorClass *
static gint
compare_tags (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
{
gboolean found;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *rtag, *ctag;
GstValidateMediaTagNode *rtag, *ctag;
GList *rtag_list, *ctag_list;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode
* rtags, *ctags;
GstValidateMediaTagsNode *rtags, *ctags;
rtags = rstream->tags;
ctags = cstream->tags;
@ -250,9 +229,7 @@ compare_tags (GstValidateMediaDescriptor * ref,
GString *all_tags = g_string_new (NULL);
for (taglist = ctags->tags; taglist; taglist = taglist->next) {
gchar *stags =
gst_tag_list_to_string ((
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
gchar *stags = gst_tag_list_to_string (((GstValidateMediaTagNode *)
taglist->data)->taglist);
g_string_append_printf (all_tags, "%s\n", stags);
@ -271,9 +248,7 @@ compare_tags (GstValidateMediaDescriptor * ref,
GString *all_tags = g_string_new (NULL);
for (taglist = rtags->tags; taglist; taglist = taglist->next) {
gchar *stags =
gst_tag_list_to_string ((
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
gchar *stags = gst_tag_list_to_string (((GstValidateMediaTagNode *)
taglist->data)->taglist);
g_string_append_printf (all_tags, "%s\n", stags);
@ -369,9 +344,9 @@ stream_id_is_equal (const gchar * uri, const gchar * rid, const gchar * cid)
static gboolean
compare_frames (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
rstream, GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * rframe,
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * cframe)
GstValidateMediaStreamNode *
rstream, GstValidateMediaFrameNode * rframe,
GstValidateMediaFrameNode * cframe)
{
if (rframe->id != cframe->id) {
GST_VALIDATE_REPORT (ref, FILE_FRAMES_INCORRECT,
@ -401,10 +376,7 @@ compare_frames (GstValidateMediaDescriptor * ref,
static gboolean
compare_frames_list (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
{
GList *rframes, *cframes;
@ -417,7 +389,7 @@ compare_frames_list (GstValidateMediaDescriptor * ref,
for (rframes = rstream->frames, cframes = cstream->frames; rframes;
rframes = g_list_next (rframes), cframes = g_list_next (cframes)) {
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *rframe, *cframe;
GstValidateMediaFrameNode *rframe, *cframe;
if (cframes == NULL) {
/* The list was checked to be of the same size */
@ -439,10 +411,7 @@ compare_frames_list (GstValidateMediaDescriptor * ref,
/* Return -1 if not found 1 if OK 0 if an error occured */
static gint
compare_streams (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
{
if (stream_id_is_equal (ref->filenode->uri, rstream->id, cstream->id)) {
if (!gst_caps_is_equal (rstream->caps, cstream->caps)) {
@ -473,7 +442,7 @@ gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * ref,
GstValidateMediaDescriptor * compared)
{
GList *rstream_list;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode
GstValidateMediaFileNode
* rfilenode = ref->filenode, *cfilenode = compared->filenode;
if (rfilenode->duration != cfilenode->duration) {
@ -518,7 +487,7 @@ gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * ref,
if (sfound == -1) {
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Could not find stream %s in the compared descriptor",
((GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *) rstream_list->data)->id);
((GstValidateMediaStreamNode *) rstream_list->data)->id);
return FALSE;
}
@ -552,10 +521,8 @@ gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * self,
for (tmpstream = self->filenode->streams;
tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmpstream->data;
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
if (pad && streamnode->pad == pad)
check = TRUE;
@ -571,14 +538,13 @@ gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * self,
*bufs =
g_list_insert_sorted (*bufs,
gst_buffer_ref ((
(GstValidateMediaGstValidateMediaGstValidateMediaFrameNode
(GstValidateMediaFrameNode
*) tmpframe->data)->buf), compare_func);
else
*bufs =
g_list_prepend (*bufs,
gst_buffer_ref ((
(GstValidateMediaGstValidateMediaGstValidateMediaFrameNode
*) tmpframe->data)->buf));
(GstValidateMediaFrameNode *) tmpframe->data)->buf));
}
if (pad != NULL)
@ -603,10 +569,8 @@ gst_validate_media_descriptor_has_frame_info (GstValidateMediaDescriptor * self)
for (tmpstream = self->filenode->streams;
tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmpstream->data;
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
if (g_list_length (streamnode->frames))
return TRUE;
@ -642,10 +606,8 @@ gst_validate_media_descriptor_get_pads (GstValidateMediaDescriptor * self)
GList *ret = NULL, *tmp;
for (tmp = self->filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* snode =
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
GstValidateMediaStreamNode
* snode = (GstValidateMediaStreamNode *) tmp->data;
ret = g_list_append (ret, gst_pad_new (snode->padname, GST_PAD_UNKNOWN));
}

View file

@ -30,21 +30,21 @@
G_BEGIN_DECLS typedef struct
{
/* Children */
/* GstValidateMediaGstValidateMediaGstValidateMediaTagNode */
/* GstValidateMediaTagNode */
GList *tags;
gchar *str_open;
gchar *str_close;
} GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode;
} GstValidateMediaTagsNode;
/* Parsing structures */
typedef struct
{
/* Children */
/* GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode */
/* GstValidateMediaStreamNode */
GList *streams;
/* GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode */
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode *tags;
/* GstValidateMediaTagsNode */
GstValidateMediaTagsNode *tags;
/* attributes */
guint64 id;
@ -57,7 +57,7 @@ typedef struct
gchar *str_open;
gchar *str_close;
} GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode;
} GstValidateMediaFileNode;
typedef struct
{
@ -69,16 +69,16 @@ typedef struct
gchar *str_open;
gchar *str_close;
} GstValidateMediaGstValidateMediaGstValidateMediaTagNode;
} GstValidateMediaTagNode;
typedef struct
{
/* Children */
/* GstValidateMediaGstValidateMediaGstValidateMediaFrameNode */
/* GstValidateMediaFrameNode */
GList *frames;
/* GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode */
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode *tags;
/* GstValidateMediaTagsNode */
GstValidateMediaTagsNode *tags;
/* Attributes */
GstCaps *caps;
@ -92,7 +92,7 @@ typedef struct
gchar *str_open;
gchar *str_close;
} GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode;
} GstValidateMediaStreamNode;
typedef struct
{
@ -110,11 +110,11 @@ typedef struct
gchar *checksum;
gchar *str_open;
gchar *str_close;
} GstValidateMediaGstValidateMediaGstValidateMediaFrameNode;
} GstValidateMediaFrameNode;
void gst_validate_filenode_free (GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode *
void gst_validate_filenode_free (GstValidateMediaFileNode *
filenode);
gboolean gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare (GstValidateMediaGstValidateMediaGstValidateMediaTagNode *
gboolean gst_validate_tag_node_compare (GstValidateMediaTagNode *
tnode, const GstTagList * tlist);
GType gst_validate_media_descriptor_get_type (void);
@ -137,7 +137,7 @@ typedef struct
{
GObject parent;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode *filenode;
GstValidateMediaFileNode *filenode;
GMutex lock;