const gchar ** attribute_values, gpointer user_data, GError ** error)
{
GstValidateMediaFileNode
- * filenode = GST_VALIDATE_MEDIA_DESCRIPTOR (user_data)->filenode;
+ * filenode =
+ gst_validate_media_descriptor_get_file_node (GST_VALIDATE_MEDIA_DESCRIPTOR
+ (user_data));
GstValidateMediaDescriptorParserPrivate *priv =
GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER (user_data)->priv;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) parser), FALSE);
caps = gst_pad_query_caps (pad, NULL);
- for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
- tmp = tmp->next) {
+ for (tmp =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) parser)->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
tmp->data;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) parser), FALSE);
- for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
- tmp = tmp->next) {
+ for (tmp =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) parser)->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
tmp->data;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) parser), FALSE);
g_return_val_if_fail (GST_IS_STRUCTURE (taglist), FALSE);
- tagsnode = ((GstValidateMediaDescriptor *) parser)->filenode->tags;
+ tagsnode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) parser)->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_PARSER (parser),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) parser), FALSE);
- tagsnode = ((GstValidateMediaDescriptor *) parser)->filenode->tags;
+ tagsnode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) parser)->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
gchar *tag = NULL;
GList *tmp, *tmp2;
GstValidateMediaTagsNode *tagsnode;
GstValidateMediaFileNode
- * filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
+ * filenode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer);
tmpstr = g_markup_printf_escaped ("<file duration=\"%" G_GUINT64_FORMAT
"\" frame-detection=\"%i\" skip-parsers=\"%i\" uri=\"%s\" seekable=\"%s\">\n",
{
GList *tmp;
- for (tmp = md->filenode->streams; tmp; tmp = tmp->next) {
- GstValidateMediaStreamNode
- * streamnode = (GstValidateMediaStreamNode *) tmp->data;
+ for (tmp = gst_validate_media_descriptor_get_file_node (md)->streams; tmp;
+ tmp = tmp->next) {
+ GstValidateMediaStreamNode *streamnode =
+ (GstValidateMediaStreamNode *) tmp->data;
if (streamnode->pad == pad) {
return streamnode;
g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
"validate-runner", runner, NULL);
- fnode = ((GstValidateMediaDescriptor *) writer)->filenode;
+ fnode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer);
fnode->uri = g_strdup (uri);
fnode->duration = duration;
fnode->seekable = seekable;
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
snode = g_slice_new0 (GstValidateMediaStreamNode);
snode->frames = NULL;
snode->str_close = g_markup_printf_escaped ("</stream>");
- ((GstValidateMediaDescriptor *) writer)->filenode->streams =
- g_list_prepend (((GstValidateMediaDescriptor *) writer)->
- filenode->streams, snode);
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
+ writer)->streams =
+ g_list_prepend (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer)->streams, snode);
if (gst_discoverer_stream_info_get_tags (info)) {
gst_validate_media_descriptor_writer_add_tags (writer, snode->id,
const gchar *stream_id;
gst_event_parse_stream_start (*event, &stream_id);
- for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
- tmp = tmp->next) {
+ for (tmp =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode *subnode =
(GstValidateMediaStreamNode *) tmp->data;
if (g_strcmp0 (subnode->id, stream_id) == 0) {
g_main_loop_run (writer->priv->loop);
- filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
+ filenode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer);
/* Segment are always prepended, let's reorder them. */
for (tmp = filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode
gst_validate_media_descriptor_writer_add_taglist (writer, tags);
if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
- ((GstValidateMediaDescriptor *) writer)->filenode->caps =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->caps =
gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO
(streaminfo));
if (!GST_IS_DISCOVERER_AUDIO_INFO (info)
&& !GST_IS_DISCOVERER_AUDIO_INFO (info)
&& gst_discoverer_stream_info_get_next (streaminfo)) {
- ((GstValidateMediaDescriptor *) writer)->filenode->caps =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->caps =
gst_discoverer_stream_info_get_caps (streaminfo);
streaminfo = gst_discoverer_stream_info_get_next (streaminfo);
}
}
media_descriptor = (GstValidateMediaDescriptor *) writer;
- if (streams == NULL && media_descriptor->filenode->caps)
- writer->priv->raw_caps = gst_caps_copy (media_descriptor->filenode->caps);
+ if (streams == NULL
+ && gst_validate_media_descriptor_get_file_node (media_descriptor)->caps)
+ writer->priv->raw_caps =
+ gst_caps_copy (gst_validate_media_descriptor_get_file_node
+ (media_descriptor)->caps);
gst_discoverer_stream_info_list_free (streams);
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
- for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
- tmp = tmp->next) {
+ for (tmp =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode *subnode =
(GstValidateMediaStreamNode *) tmp->data;
if (g_strcmp0 (subnode->id, stream_id) == 0) {
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
caps = gst_pad_get_current_caps (pad);
- for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
- tmp = tmp->next) {
- GstValidateMediaStreamNode
- * streamnode = (GstValidateMediaStreamNode *) tmp->data;
+ for (tmp =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->streams; tmp; tmp = tmp->next) {
+ GstValidateMediaStreamNode *streamnode =
+ (GstValidateMediaStreamNode *) tmp->data;
if (streamnode->pad == pad) {
goto done;
snode->str_close = g_markup_printf_escaped ("</stream>");
- ((GstValidateMediaDescriptor *) writer)->filenode->streams =
- g_list_prepend (((GstValidateMediaDescriptor *) writer)->
- filenode->streams, snode);
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
+ writer)->streams =
+ g_list_prepend (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer)->streams, snode);
done:
if (caps != NULL)
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
- if (((GstValidateMediaDescriptor *) writer)->filenode->tags == NULL) {
+ if (gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->tags == NULL) {
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;
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
+ writer)->tags = tagsnode;
} else {
- tagsnode = ((GstValidateMediaDescriptor *) writer)->filenode->tags;
+ tagsnode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer)->tags;
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
tmptag->data, taglist)) {
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
- filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
+ filenode =
+ gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
+ *) writer);
filenode->frame_detection = TRUE;
filenode->skip_parsers =
FLAG_IS_SET (writer,
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
serialized = serialize_filenode (writer);
{
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR_WRITER (writer),
FALSE);
- g_return_val_if_fail (((GstValidateMediaDescriptor *) writer)->filenode,
- FALSE);
+ g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
+ (GstValidateMediaDescriptor *) writer), FALSE);
return serialize_filenode (writer);
}
struct _GstValidateMediaDescriptorPrivate
{
- gpointer dummy;
+ GstValidateMediaFileNode *filenode;
};
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
static void
gst_validate_media_descriptor_finalize (GstValidateMediaDescriptor * self)
{
- if (self->filenode)
- gst_validate_filenode_free (self->filenode);
+ if (self->priv->filenode)
+ gst_validate_filenode_free (self->priv->filenode);
G_OBJECT_CLASS (gst_validate_media_descriptor_parent_class)->finalize
(G_OBJECT (self));
static void
gst_validate_media_descriptor_init (GstValidateMediaDescriptor * self)
{
- self->filenode = g_slice_new0 (GstValidateMediaFileNode);
+ self->priv = gst_validate_media_descriptor_get_instance_private (self);
+ self->priv->filenode = g_slice_new0 (GstValidateMediaFileNode);
}
static void
{
GstCaps *rcaps, *ccaps;
- if (!stream_id_is_equal (ref->filenode->uri, rstream->id, cstream->id))
+ if (!stream_id_is_equal (ref->priv->filenode->uri, rstream->id, cstream->id))
return FALSE;
rcaps = caps_cleanup_parsing_fields (rstream->caps);
{
GList *rstream_list;
GstValidateMediaFileNode
- * rfilenode = ref->filenode, *cfilenode = compared->filenode;
+ * rfilenode = ref->priv->filenode, *cfilenode = compared->priv->filenode;
if (rfilenode->duration != cfilenode->duration) {
GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT,
gst_validate_media_descriptor_detects_frames (GstValidateMediaDescriptor * self)
{
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR (self), FALSE);
- g_return_val_if_fail (self->filenode, FALSE);
+ g_return_val_if_fail (self->priv->filenode, FALSE);
- return self->filenode->frame_detection;
+ return self->priv->filenode->frame_detection;
}
/**
GstCaps *pad_caps = gst_pad_get_current_caps (pad);
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR (self), FALSE);
- g_return_val_if_fail (self->filenode, FALSE);
+ g_return_val_if_fail (self->priv->filenode, FALSE);
- for (tmpstream = self->filenode->streams;
+ for (tmpstream = self->priv->filenode->streams;
tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
{
GList *tmpstream;
- for (tmpstream = self->filenode->streams;
+ for (tmpstream = self->priv->filenode->streams;
tmpstream; tmpstream = tmpstream->next) {
GstValidateMediaStreamNode
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
gst_validate_media_descriptor_get_duration (GstValidateMediaDescriptor * self)
{
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR (self), FALSE);
- g_return_val_if_fail (self->filenode, FALSE);
+ g_return_val_if_fail (self->priv->filenode, FALSE);
- return self->filenode->duration;
+ return self->priv->filenode->duration;
}
gboolean
gst_validate_media_descriptor_get_seekable (GstValidateMediaDescriptor * self)
{
g_return_val_if_fail (GST_IS_VALIDATE_MEDIA_DESCRIPTOR (self), FALSE);
- g_return_val_if_fail (self->filenode, FALSE);
+ g_return_val_if_fail (self->priv->filenode, FALSE);
- return self->filenode->seekable;
+ return self->priv->filenode->seekable;
}
/**
{
GList *ret = NULL, *tmp;
- for (tmp = self->filenode->streams; tmp; tmp = tmp->next) {
+ for (tmp = self->priv->filenode->streams; tmp; tmp = tmp->next) {
GstValidateMediaStreamNode
* snode = (GstValidateMediaStreamNode *) tmp->data;
ret = g_list_append (ret, gst_pad_new (snode->padname, GST_PAD_UNKNOWN));
return ret;
}
+
+
+GstValidateMediaFileNode *
+gst_validate_media_descriptor_get_file_node (GstValidateMediaDescriptor * self)
+{
+ return self->priv->filenode;
+}