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

View file

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

View file

@ -122,9 +122,8 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
GString *res; GString *res;
gchar *tmpstr, *caps_str; gchar *tmpstr, *caps_str;
GList *tmp, *tmp2; GList *tmp, *tmp2;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode GstValidateMediaTagsNode *tagsnode;
* tagsnode; GstValidateMediaFileNode
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode
* filenode = ((GstValidateMediaDescriptor *) writer)->filenode; * filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
tmpstr = g_markup_printf_escaped ("<file duration=\"%" G_GUINT64_FORMAT tmpstr = g_markup_printf_escaped ("<file duration=\"%" G_GUINT64_FORMAT
@ -143,25 +142,20 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
g_free (tmpstr); g_free (tmpstr);
for (tmp = filenode->streams; tmp; tmp = tmp->next) { for (tmp = filenode->streams; tmp; tmp = tmp->next) {
GList *tmp3; GList *tmp3;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* snode = * snode = ((GstValidateMediaStreamNode *) tmp->data);
(
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data);
STR_APPEND2 (snode->str_open); STR_APPEND2 (snode->str_open);
for (tmp2 = snode->frames; tmp2; tmp2 = tmp2->next) { for (tmp2 = snode->frames; tmp2; tmp2 = tmp2->next) {
STR_APPEND3 (((GstValidateMediaGstValidateMediaGstValidateMediaFrameNode STR_APPEND3 (((GstValidateMediaFrameNode *) tmp2->data)->str_open);
*) tmp2->data)->str_open);
} }
tagsnode = snode->tags; tagsnode = snode->tags;
if (tagsnode) { if (tagsnode) {
STR_APPEND3 (tagsnode->str_open); STR_APPEND3 (tagsnode->str_open);
for (tmp3 = tagsnode->tags; tmp3; tmp3 = tmp3->next) { for (tmp3 = tagsnode->tags; tmp3; tmp3 = tmp3->next) {
STR_APPEND4 (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode STR_APPEND4 (((GstValidateMediaTagNode *) tmp3->data)->str_open);
*) tmp3->data)->str_open);
} }
STR_APPEND3 (tagsnode->str_close); STR_APPEND3 (tagsnode->str_close);
} }
@ -174,7 +168,7 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
if (tagsnode) { if (tagsnode) {
STR_APPEND1 (tagsnode->str_open); STR_APPEND1 (tagsnode->str_open);
for (tmp2 = tagsnode->tags; tmp2; tmp2 = tmp2->next) { for (tmp2 = tagsnode->tags; tmp2; tmp2 = tmp2->next) {
STR_APPEND2 (((GstValidateMediaGstValidateMediaGstValidateMediaTagNode *) STR_APPEND2 (((GstValidateMediaTagNode *)
tmp2->data)->str_open); tmp2->data)->str_open);
} }
STR_APPEND1 (tagsnode->str_close); STR_APPEND1 (tagsnode->str_close);
@ -187,17 +181,15 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
/* Should be called with GST_VALIDATE_MEDIA_DESCRIPTOR_LOCK */ /* Should be called with GST_VALIDATE_MEDIA_DESCRIPTOR_LOCK */
static static
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* gst_validate_media_descriptor_find_stream_node_by_pad * gst_validate_media_descriptor_find_stream_node_by_pad
(GstValidateMediaDescriptor * md, GstPad * pad) (GstValidateMediaDescriptor * md, GstPad * pad)
{ {
GList *tmp; GList *tmp;
for (tmp = md->filenode->streams; tmp; tmp = tmp->next) { for (tmp = md->filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* streamnode = * streamnode = (GstValidateMediaStreamNode *) tmp->data;
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
if (streamnode->pad == pad) { if (streamnode->pad == pad) {
return streamnode; return streamnode;
@ -213,8 +205,7 @@ gst_validate_media_descriptor_writer_new (GstValidateRunner * runner,
const gchar * uri, GstClockTime duration, gboolean seekable) const gchar * uri, GstClockTime duration, gboolean seekable)
{ {
GstValidateMediaDescriptorWriter *writer; GstValidateMediaDescriptorWriter *writer;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode GstValidateMediaFileNode *fnode;
* fnode;
writer = writer =
g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER, g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
@ -239,17 +230,14 @@ static gboolean
gboolean ret = FALSE; gboolean ret = FALSE;
GstCaps *caps; GstCaps *caps;
gchar *capsstr = NULL; gchar *capsstr = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *snode = NULL;
* snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer), g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE); FALSE);
g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode, g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
FALSE); FALSE);
snode = snode = g_slice_new0 (GstValidateMediaStreamNode);
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode);
snode->frames = NULL; snode->frames = NULL;
snode->cframe = NULL; snode->cframe = NULL;
@ -258,9 +246,7 @@ static gboolean
caps = gst_discoverer_stream_info_get_caps (info); caps = gst_discoverer_stream_info_get_caps (info);
capsstr = gst_caps_to_string (caps); capsstr = gst_caps_to_string (caps);
g_slice_free g_slice_free (GstValidateMediaStreamNode, snode);
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode,
snode);
GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_ID, GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_ID,
"Stream with caps: %s has no stream ID", capsstr); "Stream with caps: %s has no stream ID", capsstr);
gst_caps_unref (caps); gst_caps_unref (caps);
@ -323,8 +309,7 @@ _uridecodebin_probe (GstPad * pad, GstPadProbeInfo * info,
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:{ case GST_EVENT_SEGMENT:{
const GstSegment *segment; const GstSegment *segment;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *streamnode;
* streamnode;
streamnode = streamnode =
gst_validate_media_descriptor_find_stream_node_by_pad ( 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) { if (GST_EVENT_TYPE (*event) == GST_EVENT_STREAM_START) {
GList *tmp; GList *tmp;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *snode = NULL;
* snode = NULL;
const gchar *stream_id; const gchar *stream_id;
gst_event_parse_stream_start (*event, &stream_id); gst_event_parse_stream_start (*event, &stream_id);
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp; for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) { tmp = tmp->next) {
if (g_strcmp0 (( if (g_strcmp0 (((GstValidateMediaStreamNode *)
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*)
tmp->data)->id, stream_id) == 0) { tmp->data)->id, stream_id) == 0) {
snode = tmp->data; snode = tmp->data;
@ -426,8 +408,7 @@ static void
pad_added_cb (GstElement * decodebin, GstPad * pad, pad_added_cb (GstElement * decodebin, GstPad * pad,
GstValidateMediaDescriptorWriter * writer) GstValidateMediaDescriptorWriter * writer)
{ {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *snode = NULL;
* snode = NULL;
GstPad *sinkpad, *srcpad; GstPad *sinkpad, *srcpad;
/* Try to plug a parser so we have as much info as possible /* 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 gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
* writer, const gchar * stream_id, const GstTagList * taglist) * writer, const gchar * stream_id, const GstTagList * taglist)
{ {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode GstValidateMediaTagsNode *tagsnode;
* tagsnode; GstValidateMediaTagNode *tagnode;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *tagnode;
GList *tmp, *tmptag; GList *tmp, *tmptag;
gchar *str_str = NULL; gchar *str_str = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *snode = NULL;
* snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer), g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE); FALSE);
@ -708,7 +687,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp; for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) { tmp = tmp->next) {
if (g_strcmp0 (( if (g_strcmp0 ((
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode (GstValidateMediaStreamNode
*) tmp->data)->id, stream_id) == 0) { *) tmp->data)->id, stream_id) == 0) {
snode = tmp->data; snode = tmp->data;
@ -723,9 +702,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
} }
if (snode->tags == NULL) { if (snode->tags == NULL) {
tagsnode = tagsnode = g_slice_new0 (GstValidateMediaTagsNode);
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode);
tagsnode->str_open = g_markup_printf_escaped ("<tags>"); tagsnode->str_open = g_markup_printf_escaped ("<tags>");
tagsnode->str_close = g_markup_printf_escaped ("</tags>"); tagsnode->str_close = g_markup_printf_escaped ("</tags>");
snode->tags = tagsnode; snode->tags = tagsnode;
@ -733,8 +710,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
tagsnode = snode->tags; tagsnode = snode->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) { for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare ( if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
tmptag->data, taglist)) { tmptag->data, taglist)) {
GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT, GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT,
taglist); taglist);
@ -743,8 +719,7 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
} }
} }
tagnode = tagnode = g_slice_new0 (GstValidateMediaTagNode);
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaTagNode);
tagnode->taglist = gst_tag_list_copy (taglist); tagnode->taglist = gst_tag_list_copy (taglist);
str_str = gst_tag_list_to_string (tagnode->taglist); str_str = gst_tag_list_to_string (tagnode->taglist);
tagnode->str_open = tagnode->str_open =
@ -764,8 +739,7 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
gboolean ret = FALSE; gboolean ret = FALSE;
GstCaps *caps; GstCaps *caps;
gchar *capsstr = NULL, *padname = NULL; gchar *capsstr = NULL, *padname = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *snode = NULL;
* snode = NULL;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer), g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE); FALSE);
@ -775,19 +749,15 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
caps = gst_pad_get_current_caps (pad); caps = gst_pad_get_current_caps (pad);
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp; for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
tmp = tmp->next) { tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* streamnode = * streamnode = (GstValidateMediaStreamNode *) tmp->data;
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
if (streamnode->pad == pad) { if (streamnode->pad == pad) {
goto done; goto done;
} }
} }
snode = snode = g_slice_new0 (GstValidateMediaStreamNode);
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode);
snode->frames = NULL; snode->frames = NULL;
snode->cframe = NULL; snode->cframe = NULL;
@ -819,9 +789,8 @@ gboolean
gst_validate_media_descriptor_writer_add_taglist gst_validate_media_descriptor_writer_add_taglist
(GstValidateMediaDescriptorWriter * writer, const GstTagList * taglist) { (GstValidateMediaDescriptorWriter * writer, const GstTagList * taglist) {
gchar *str_str = NULL; gchar *str_str = NULL;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode GstValidateMediaTagsNode *tagsnode;
* tagsnode; GstValidateMediaTagNode *tagnode;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *tagnode;
GList *tmptag; GList *tmptag;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer), g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
@ -830,17 +799,14 @@ gboolean
FALSE); FALSE);
if (((GstValidateMediaDescriptor *) writer)->filenode->tags == NULL) { if (((GstValidateMediaDescriptor *) writer)->filenode->tags == NULL) {
tagsnode = tagsnode = g_slice_new0 (GstValidateMediaTagsNode);
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode);
tagsnode->str_open = g_markup_printf_escaped ("<tags>"); tagsnode->str_open = g_markup_printf_escaped ("<tags>");
tagsnode->str_close = g_markup_printf_escaped ("</tags>"); tagsnode->str_close = g_markup_printf_escaped ("</tags>");
((GstValidateMediaDescriptor *) writer)->filenode->tags = tagsnode; ((GstValidateMediaDescriptor *) writer)->filenode->tags = tagsnode;
} else { } else {
tagsnode = ((GstValidateMediaDescriptor *) writer)->filenode->tags; tagsnode = ((GstValidateMediaDescriptor *) writer)->filenode->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) { for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare ( if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
tmptag->data, taglist)) { tmptag->data, taglist)) {
GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT, GST_DEBUG ("Tag already in... not adding again %" GST_PTR_FORMAT,
taglist); taglist);
@ -849,8 +815,7 @@ gboolean
} }
} }
tagnode = tagnode = g_slice_new0 (GstValidateMediaTagNode);
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaTagNode);
tagnode->taglist = gst_tag_list_copy (taglist); tagnode->taglist = gst_tag_list_copy (taglist);
str_str = gst_tag_list_to_string (tagnode->taglist); str_str = gst_tag_list_to_string (tagnode->taglist);
tagnode->str_open = tagnode->str_open =
@ -866,12 +831,11 @@ gboolean
gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter
* writer, GstPad * pad, GstBuffer * buf) * writer, GstPad * pad, GstBuffer * buf)
{ {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode *streamnode;
* streamnode;
GstMapInfo map; GstMapInfo map;
gchar *checksum; gchar *checksum;
guint id; guint id;
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *fnode; GstValidateMediaFrameNode *fnode;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer), g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE); FALSE);
@ -890,8 +854,7 @@ gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter
} }
id = g_list_length (streamnode->frames); id = g_list_length (streamnode->frames);
fnode = fnode = g_slice_new0 (GstValidateMediaFrameNode);
g_slice_new0 (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode);
g_assert (gst_buffer_map (buf, &map, GST_MAP_READ)); g_assert (gst_buffer_map (buf, &map, GST_MAP_READ));
checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5, 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)) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptorPrivate))
static inline void static inline void
free_tagnode (GstValidateMediaGstValidateMediaGstValidateMediaTagNode * tagnode) free_tagnode (GstValidateMediaTagNode * tagnode)
{ {
g_free (tagnode->str_open); g_free (tagnode->str_open);
g_free (tagnode->str_close); g_free (tagnode->str_close);
if (tagnode->taglist) if (tagnode->taglist)
gst_tag_list_unref (tagnode->taglist); gst_tag_list_unref (tagnode->taglist);
g_slice_free (GstValidateMediaGstValidateMediaGstValidateMediaTagNode, g_slice_free (GstValidateMediaTagNode, tagnode);
tagnode);
} }
static inline void static inline void
free_tagsnode free_tagsnode (GstValidateMediaTagsNode * tagsnode)
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode *
tagsnode)
{ {
g_free (tagsnode->str_open); g_free (tagsnode->str_open);
g_free (tagsnode->str_close); g_free (tagsnode->str_close);
g_list_free_full (tagsnode->tags, (GDestroyNotify) free_tagnode); g_list_free_full (tagsnode->tags, (GDestroyNotify) free_tagnode);
g_slice_free g_slice_free (GstValidateMediaTagsNode, tagsnode);
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode,
tagsnode);
} }
static inline void static inline void
free_framenode (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * free_framenode (GstValidateMediaFrameNode * framenode)
framenode)
{ {
g_free (framenode->str_open); g_free (framenode->str_open);
g_free (framenode->str_close); g_free (framenode->str_close);
@ -65,14 +59,11 @@ free_framenode (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *
if (framenode->buf) if (framenode->buf)
gst_buffer_unref (framenode->buf); gst_buffer_unref (framenode->buf);
g_slice_free (GstValidateMediaGstValidateMediaGstValidateMediaFrameNode, g_slice_free (GstValidateMediaFrameNode, framenode);
framenode);
} }
static inline void static inline void
free_streamnode free_streamnode (GstValidateMediaStreamNode * streamnode)
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
* streamnode)
{ {
if (streamnode->caps) if (streamnode->caps)
gst_caps_unref (streamnode->caps); gst_caps_unref (streamnode->caps);
@ -93,14 +84,11 @@ static inline void
g_free (streamnode->str_open); g_free (streamnode->str_open);
g_free (streamnode->str_close); g_free (streamnode->str_close);
g_slice_free g_slice_free (GstValidateMediaStreamNode, streamnode);
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode,
streamnode);
} }
void gst_validate_filenode_free void
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode * gst_validate_filenode_free (GstValidateMediaFileNode * filenode)
filenode)
{ {
g_list_free_full (filenode->streams, (GDestroyNotify) free_streamnode); g_list_free_full (filenode->streams, (GDestroyNotify) free_streamnode);
if (filenode->tags) if (filenode->tags)
@ -115,15 +103,12 @@ void gst_validate_filenode_free
g_free (filenode->str_open); g_free (filenode->str_open);
g_free (filenode->str_close); g_free (filenode->str_close);
g_slice_free g_slice_free (GstValidateMediaFileNode, filenode);
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode,
filenode);
} }
gboolean gboolean
gst_validate_gst_validate_gst_validate_gst_validate_tag_node_compare gst_validate_tag_node_compare
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode * tnode, (GstValidateMediaTagNode * tnode, const GstTagList * tlist)
const GstTagList * tlist)
{ {
if (gst_structure_is_equal (GST_STRUCTURE (tlist), if (gst_structure_is_equal (GST_STRUCTURE (tlist),
GST_STRUCTURE (tnode->taglist)) == FALSE) { GST_STRUCTURE (tnode->taglist)) == FALSE) {
@ -168,9 +153,7 @@ gst_validate_media_descriptor_finalize (GstValidateMediaDescriptor * self)
static void static void
gst_validate_media_descriptor_init (GstValidateMediaDescriptor * self) gst_validate_media_descriptor_init (GstValidateMediaDescriptor * self)
{ {
self->filenode = self->filenode = g_slice_new0 (GstValidateMediaFileNode);
g_slice_new0
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode);
} }
static void static void
@ -230,16 +213,12 @@ gst_validate_media_descriptor_class_init (GstValidateMediaDescriptorClass *
static gint static gint
compare_tags (GstValidateMediaDescriptor * ref, compare_tags (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode * GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
{ {
gboolean found; gboolean found;
GstValidateMediaGstValidateMediaGstValidateMediaTagNode *rtag, *ctag; GstValidateMediaTagNode *rtag, *ctag;
GList *rtag_list, *ctag_list; GList *rtag_list, *ctag_list;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaTagsNode GstValidateMediaTagsNode *rtags, *ctags;
* rtags, *ctags;
rtags = rstream->tags; rtags = rstream->tags;
ctags = cstream->tags; ctags = cstream->tags;
@ -250,9 +229,7 @@ compare_tags (GstValidateMediaDescriptor * ref,
GString *all_tags = g_string_new (NULL); GString *all_tags = g_string_new (NULL);
for (taglist = ctags->tags; taglist; taglist = taglist->next) { for (taglist = ctags->tags; taglist; taglist = taglist->next) {
gchar *stags = gchar *stags = gst_tag_list_to_string (((GstValidateMediaTagNode *)
gst_tag_list_to_string ((
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
taglist->data)->taglist); taglist->data)->taglist);
g_string_append_printf (all_tags, "%s\n", stags); g_string_append_printf (all_tags, "%s\n", stags);
@ -271,9 +248,7 @@ compare_tags (GstValidateMediaDescriptor * ref,
GString *all_tags = g_string_new (NULL); GString *all_tags = g_string_new (NULL);
for (taglist = rtags->tags; taglist; taglist = taglist->next) { for (taglist = rtags->tags; taglist; taglist = taglist->next) {
gchar *stags = gchar *stags = gst_tag_list_to_string (((GstValidateMediaTagNode *)
gst_tag_list_to_string ((
(GstValidateMediaGstValidateMediaGstValidateMediaTagNode *)
taglist->data)->taglist); taglist->data)->taglist);
g_string_append_printf (all_tags, "%s\n", stags); 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 static gboolean
compare_frames (GstValidateMediaDescriptor * ref, compare_frames (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode * GstValidateMediaStreamNode *
rstream, GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * rframe, rstream, GstValidateMediaFrameNode * rframe,
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode * cframe) GstValidateMediaFrameNode * cframe)
{ {
if (rframe->id != cframe->id) { if (rframe->id != cframe->id) {
GST_VALIDATE_REPORT (ref, FILE_FRAMES_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_FRAMES_INCORRECT,
@ -401,10 +376,7 @@ compare_frames (GstValidateMediaDescriptor * ref,
static gboolean static gboolean
compare_frames_list (GstValidateMediaDescriptor * ref, compare_frames_list (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode * GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
{ {
GList *rframes, *cframes; GList *rframes, *cframes;
@ -417,7 +389,7 @@ compare_frames_list (GstValidateMediaDescriptor * ref,
for (rframes = rstream->frames, cframes = cstream->frames; rframes; for (rframes = rstream->frames, cframes = cstream->frames; rframes;
rframes = g_list_next (rframes), cframes = g_list_next (cframes)) { rframes = g_list_next (rframes), cframes = g_list_next (cframes)) {
GstValidateMediaGstValidateMediaGstValidateMediaFrameNode *rframe, *cframe; GstValidateMediaFrameNode *rframe, *cframe;
if (cframes == NULL) { if (cframes == NULL) {
/* The list was checked to be of the same size */ /* 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 */ /* Return -1 if not found 1 if OK 0 if an error occured */
static gint static gint
compare_streams (GstValidateMediaDescriptor * ref, compare_streams (GstValidateMediaDescriptor * ref,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode * GstValidateMediaStreamNode * rstream, GstValidateMediaStreamNode * cstream)
rstream,
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *
cstream)
{ {
if (stream_id_is_equal (ref->filenode->uri, rstream->id, cstream->id)) { if (stream_id_is_equal (ref->filenode->uri, rstream->id, cstream->id)) {
if (!gst_caps_is_equal (rstream->caps, cstream->caps)) { if (!gst_caps_is_equal (rstream->caps, cstream->caps)) {
@ -473,7 +442,7 @@ gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * ref,
GstValidateMediaDescriptor * compared) GstValidateMediaDescriptor * compared)
{ {
GList *rstream_list; GList *rstream_list;
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaFileNode GstValidateMediaFileNode
* rfilenode = ref->filenode, *cfilenode = compared->filenode; * rfilenode = ref->filenode, *cfilenode = compared->filenode;
if (rfilenode->duration != cfilenode->duration) { if (rfilenode->duration != cfilenode->duration) {
@ -518,7 +487,7 @@ gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * ref,
if (sfound == -1) { if (sfound == -1) {
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Could not find stream %s in the compared descriptor", "Could not find stream %s in the compared descriptor",
((GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode *) rstream_list->data)->id); ((GstValidateMediaStreamNode *) rstream_list->data)->id);
return FALSE; return FALSE;
} }
@ -552,10 +521,8 @@ gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * self,
for (tmpstream = self->filenode->streams; for (tmpstream = self->filenode->streams;
tmpstream; tmpstream = tmpstream->next) { tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* streamnode = * streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmpstream->data;
if (pad && streamnode->pad == pad) if (pad && streamnode->pad == pad)
check = TRUE; check = TRUE;
@ -571,14 +538,13 @@ gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * self,
*bufs = *bufs =
g_list_insert_sorted (*bufs, g_list_insert_sorted (*bufs,
gst_buffer_ref (( gst_buffer_ref ((
(GstValidateMediaGstValidateMediaGstValidateMediaFrameNode (GstValidateMediaFrameNode
*) tmpframe->data)->buf), compare_func); *) tmpframe->data)->buf), compare_func);
else else
*bufs = *bufs =
g_list_prepend (*bufs, g_list_prepend (*bufs,
gst_buffer_ref (( gst_buffer_ref ((
(GstValidateMediaGstValidateMediaGstValidateMediaFrameNode (GstValidateMediaFrameNode *) tmpframe->data)->buf));
*) tmpframe->data)->buf));
} }
if (pad != NULL) if (pad != NULL)
@ -603,10 +569,8 @@ gst_validate_media_descriptor_has_frame_info (GstValidateMediaDescriptor * self)
for (tmpstream = self->filenode->streams; for (tmpstream = self->filenode->streams;
tmpstream; tmpstream = tmpstream->next) { tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* streamnode = * streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmpstream->data;
if (g_list_length (streamnode->frames)) if (g_list_length (streamnode->frames))
return TRUE; return TRUE;
@ -642,10 +606,8 @@ gst_validate_media_descriptor_get_pads (GstValidateMediaDescriptor * self)
GList *ret = NULL, *tmp; GList *ret = NULL, *tmp;
for (tmp = self->filenode->streams; tmp; tmp = tmp->next) { for (tmp = self->filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode GstValidateMediaStreamNode
* snode = * snode = (GstValidateMediaStreamNode *) tmp->data;
(GstValidateMediaGstValidateMediaGstValidateMediaGstValidateMediaStreamNode
*) tmp->data;
ret = g_list_append (ret, gst_pad_new (snode->padname, GST_PAD_UNKNOWN)); ret = g_list_append (ret, gst_pad_new (snode->padname, GST_PAD_UNKNOWN));
} }

View file

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