mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
validate: Totally hide media descriptor node types from the API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1986>
This commit is contained in:
parent
2913ab9dbf
commit
692750efae
5 changed files with 122 additions and 85 deletions
|
@ -74,6 +74,9 @@ G_GNUC_INTERNAL gboolean is_tty (void);
|
||||||
|
|
||||||
/* MediaDescriptor structures */
|
/* MediaDescriptor structures */
|
||||||
|
|
||||||
|
typedef struct _GstValidateMediaFileNode GstValidateMediaFileNode;
|
||||||
|
typedef struct _GstValidateMediaTagNode GstValidateMediaTagNode;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* Children */
|
/* Children */
|
||||||
|
@ -170,4 +173,11 @@ typedef struct
|
||||||
gchar *str_close;
|
gchar *str_close;
|
||||||
} GstValidateSegmentNode;
|
} GstValidateSegmentNode;
|
||||||
|
|
||||||
|
void gst_validate_filenode_free (GstValidateMediaFileNode *
|
||||||
|
filenode);
|
||||||
|
gboolean gst_validate_tag_node_compare (GstValidateMediaTagNode *
|
||||||
|
tnode, const GstTagList * tlist);
|
||||||
|
|
||||||
|
GstValidateMediaFileNode * gst_validate_media_descriptor_get_file_node (GstValidateMediaDescriptor *self);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -230,7 +230,9 @@ on_start_element_cb (GMarkupParseContext * context,
|
||||||
const gchar ** attribute_values, gpointer user_data, GError ** error)
|
const gchar ** attribute_values, gpointer user_data, GError ** error)
|
||||||
{
|
{
|
||||||
GstValidateMediaFileNode
|
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 =
|
GstValidateMediaDescriptorParserPrivate *priv =
|
||||||
GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER (user_data)->priv;
|
GST_VALIDATE_MEDIA_DESCRIPTOR_PARSER (user_data)->priv;
|
||||||
|
@ -468,12 +470,13 @@ gboolean
|
||||||
|
|
||||||
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);
|
||||||
g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
|
g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) parser), FALSE);
|
||||||
|
|
||||||
caps = gst_pad_query_caps (pad, NULL);
|
caps = gst_pad_query_caps (pad, NULL);
|
||||||
for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
|
for (tmp =
|
||||||
tmp = tmp->next) {
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) parser)->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
|
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
|
||||||
tmp->data;
|
tmp->data;
|
||||||
|
|
||||||
|
@ -499,11 +502,12 @@ gboolean
|
||||||
|
|
||||||
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);
|
||||||
g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
|
g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) parser), FALSE);
|
||||||
|
|
||||||
for (tmp = ((GstValidateMediaDescriptor *) parser)->filenode->streams; tmp;
|
for (tmp =
|
||||||
tmp = tmp->next) {
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) parser)->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
|
GstValidateMediaStreamNode *streamnode = (GstValidateMediaStreamNode *)
|
||||||
tmp->data;
|
tmp->data;
|
||||||
|
|
||||||
|
@ -523,11 +527,13 @@ gboolean
|
||||||
|
|
||||||
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);
|
||||||
g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
|
g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) parser), FALSE);
|
||||||
g_return_val_if_fail (GST_IS_STRUCTURE (taglist), 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) {
|
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
|
||||||
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
|
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
|
||||||
|
@ -549,10 +555,12 @@ gboolean
|
||||||
|
|
||||||
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);
|
||||||
g_return_val_if_fail (((GstValidateMediaDescriptor *) parser)->filenode,
|
g_return_val_if_fail (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(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) {
|
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
|
||||||
gchar *tag = NULL;
|
gchar *tag = NULL;
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,9 @@ serialize_filenode (GstValidateMediaDescriptorWriter * writer)
|
||||||
GList *tmp, *tmp2;
|
GList *tmp, *tmp2;
|
||||||
GstValidateMediaTagsNode *tagsnode;
|
GstValidateMediaTagsNode *tagsnode;
|
||||||
GstValidateMediaFileNode
|
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
|
tmpstr = g_markup_printf_escaped ("<file duration=\"%" G_GUINT64_FORMAT
|
||||||
"\" frame-detection=\"%i\" skip-parsers=\"%i\" uri=\"%s\" seekable=\"%s\">\n",
|
"\" frame-detection=\"%i\" skip-parsers=\"%i\" uri=\"%s\" seekable=\"%s\">\n",
|
||||||
|
@ -197,9 +199,10 @@ static
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
for (tmp = md->filenode->streams; tmp; tmp = tmp->next) {
|
for (tmp = gst_validate_media_descriptor_get_file_node (md)->streams; tmp;
|
||||||
GstValidateMediaStreamNode
|
tmp = tmp->next) {
|
||||||
* streamnode = (GstValidateMediaStreamNode *) tmp->data;
|
GstValidateMediaStreamNode *streamnode =
|
||||||
|
(GstValidateMediaStreamNode *) tmp->data;
|
||||||
|
|
||||||
if (streamnode->pad == pad) {
|
if (streamnode->pad == pad) {
|
||||||
return streamnode;
|
return streamnode;
|
||||||
|
@ -221,7 +224,9 @@ gst_validate_media_descriptor_writer_new (GstValidateRunner * runner,
|
||||||
g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
|
g_object_new (GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
|
||||||
"validate-runner", runner, NULL);
|
"validate-runner", runner, NULL);
|
||||||
|
|
||||||
fnode = ((GstValidateMediaDescriptor *) writer)->filenode;
|
fnode =
|
||||||
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) writer);
|
||||||
fnode->uri = g_strdup (uri);
|
fnode->uri = g_strdup (uri);
|
||||||
fnode->duration = duration;
|
fnode->duration = duration;
|
||||||
fnode->seekable = seekable;
|
fnode->seekable = seekable;
|
||||||
|
@ -271,8 +276,8 @@ static gboolean
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
snode = g_slice_new0 (GstValidateMediaStreamNode);
|
snode = g_slice_new0 (GstValidateMediaStreamNode);
|
||||||
snode->frames = NULL;
|
snode->frames = NULL;
|
||||||
|
@ -314,9 +319,10 @@ static gboolean
|
||||||
|
|
||||||
snode->str_close = g_markup_printf_escaped ("</stream>");
|
snode->str_close = g_markup_printf_escaped ("</stream>");
|
||||||
|
|
||||||
((GstValidateMediaDescriptor *) writer)->filenode->streams =
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
|
||||||
g_list_prepend (((GstValidateMediaDescriptor *) writer)->
|
writer)->streams =
|
||||||
filenode->streams, snode);
|
g_list_prepend (gst_validate_media_descriptor_get_file_node (
|
||||||
|
(GstValidateMediaDescriptor *) writer)->streams, snode);
|
||||||
|
|
||||||
if (gst_discoverer_stream_info_get_tags (info)) {
|
if (gst_discoverer_stream_info_get_tags (info)) {
|
||||||
gst_validate_media_descriptor_writer_add_tags (writer, snode->id,
|
gst_validate_media_descriptor_writer_add_tags (writer, snode->id,
|
||||||
|
@ -398,8 +404,9 @@ _find_stream_id (GstPad * pad, GstEvent ** event,
|
||||||
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 =
|
||||||
tmp = tmp->next) {
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) writer)->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode *subnode =
|
GstValidateMediaStreamNode *subnode =
|
||||||
(GstValidateMediaStreamNode *) tmp->data;
|
(GstValidateMediaStreamNode *) tmp->data;
|
||||||
if (g_strcmp0 (subnode->id, stream_id) == 0) {
|
if (g_strcmp0 (subnode->id, stream_id) == 0) {
|
||||||
|
@ -614,7 +621,9 @@ _run_frame_analysis (GstValidateMediaDescriptorWriter * writer,
|
||||||
|
|
||||||
g_main_loop_run (writer->priv->loop);
|
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. */
|
/* Segment are always prepended, let's reorder them. */
|
||||||
for (tmp = filenode->streams; tmp; tmp = tmp->next) {
|
for (tmp = filenode->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode
|
GstValidateMediaStreamNode
|
||||||
|
@ -714,7 +723,8 @@ gst_validate_media_descriptor_writer_new_discover (GstValidateRunner * runner,
|
||||||
gst_validate_media_descriptor_writer_add_taglist (writer, tags);
|
gst_validate_media_descriptor_writer_add_taglist (writer, tags);
|
||||||
|
|
||||||
if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
|
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
|
gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO
|
||||||
(streaminfo));
|
(streaminfo));
|
||||||
|
|
||||||
|
@ -728,7 +738,8 @@ gst_validate_media_descriptor_writer_new_discover (GstValidateRunner * runner,
|
||||||
if (!GST_IS_DISCOVERER_AUDIO_INFO (info)
|
if (!GST_IS_DISCOVERER_AUDIO_INFO (info)
|
||||||
&& !GST_IS_DISCOVERER_AUDIO_INFO (info)
|
&& !GST_IS_DISCOVERER_AUDIO_INFO (info)
|
||||||
&& gst_discoverer_stream_info_get_next (streaminfo)) {
|
&& 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);
|
gst_discoverer_stream_info_get_caps (streaminfo);
|
||||||
streaminfo = gst_discoverer_stream_info_get_next (streaminfo);
|
streaminfo = gst_discoverer_stream_info_get_next (streaminfo);
|
||||||
}
|
}
|
||||||
|
@ -743,8 +754,11 @@ gst_validate_media_descriptor_writer_new_discover (GstValidateRunner * runner,
|
||||||
}
|
}
|
||||||
|
|
||||||
media_descriptor = (GstValidateMediaDescriptor *) writer;
|
media_descriptor = (GstValidateMediaDescriptor *) writer;
|
||||||
if (streams == NULL && media_descriptor->filenode->caps)
|
if (streams == NULL
|
||||||
writer->priv->raw_caps = gst_caps_copy (media_descriptor->filenode->caps);
|
&& 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);
|
gst_discoverer_stream_info_list_free (streams);
|
||||||
|
|
||||||
|
@ -774,11 +788,12 @@ gst_validate_media_descriptor_writer_add_tags (GstValidateMediaDescriptorWriter
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
|
for (tmp =
|
||||||
tmp = tmp->next) {
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) writer)->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode *subnode =
|
GstValidateMediaStreamNode *subnode =
|
||||||
(GstValidateMediaStreamNode *) tmp->data;
|
(GstValidateMediaStreamNode *) tmp->data;
|
||||||
if (g_strcmp0 (subnode->id, stream_id) == 0) {
|
if (g_strcmp0 (subnode->id, stream_id) == 0) {
|
||||||
|
@ -836,14 +851,15 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
caps = gst_pad_get_current_caps (pad);
|
caps = gst_pad_get_current_caps (pad);
|
||||||
for (tmp = ((GstValidateMediaDescriptor *) writer)->filenode->streams; tmp;
|
for (tmp =
|
||||||
tmp = tmp->next) {
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
GstValidateMediaStreamNode
|
*) writer)->streams; tmp; tmp = tmp->next) {
|
||||||
* streamnode = (GstValidateMediaStreamNode *) tmp->data;
|
GstValidateMediaStreamNode *streamnode =
|
||||||
|
(GstValidateMediaStreamNode *) tmp->data;
|
||||||
|
|
||||||
if (streamnode->pad == pad) {
|
if (streamnode->pad == pad) {
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -865,9 +881,10 @@ gst_validate_media_descriptor_writer_add_pad (GstValidateMediaDescriptorWriter *
|
||||||
|
|
||||||
snode->str_close = g_markup_printf_escaped ("</stream>");
|
snode->str_close = g_markup_printf_escaped ("</stream>");
|
||||||
|
|
||||||
((GstValidateMediaDescriptor *) writer)->filenode->streams =
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
|
||||||
g_list_prepend (((GstValidateMediaDescriptor *) writer)->
|
writer)->streams =
|
||||||
filenode->streams, snode);
|
g_list_prepend (gst_validate_media_descriptor_get_file_node (
|
||||||
|
(GstValidateMediaDescriptor *) writer)->streams, snode);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (caps != NULL)
|
if (caps != NULL)
|
||||||
|
@ -888,16 +905,20 @@ gboolean
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(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 = g_slice_new0 (GstValidateMediaTagsNode);
|
||||||
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;
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor *)
|
||||||
|
writer)->tags = tagsnode;
|
||||||
} else {
|
} 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) {
|
for (tmptag = tagsnode->tags; tmptag; tmptag = tmptag->next) {
|
||||||
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
|
if (gst_validate_tag_node_compare ((GstValidateMediaTagNode *)
|
||||||
tmptag->data, taglist)) {
|
tmptag->data, taglist)) {
|
||||||
|
@ -934,10 +955,12 @@ gst_validate_media_descriptor_writer_add_frame (GstValidateMediaDescriptorWriter
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
filenode = ((GstValidateMediaDescriptor *) writer)->filenode;
|
filenode =
|
||||||
|
gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor
|
||||||
|
*) writer);
|
||||||
filenode->frame_detection = TRUE;
|
filenode->frame_detection = TRUE;
|
||||||
filenode->skip_parsers =
|
filenode->skip_parsers =
|
||||||
FLAG_IS_SET (writer,
|
FLAG_IS_SET (writer,
|
||||||
|
@ -1004,8 +1027,8 @@ gst_validate_media_descriptor_writer_write (GstValidateMediaDescriptorWriter *
|
||||||
|
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
serialized = serialize_filenode (writer);
|
serialized = serialize_filenode (writer);
|
||||||
|
|
||||||
|
@ -1025,8 +1048,8 @@ gst_validate_media_descriptor_writer_serialize (GstValidateMediaDescriptorWriter
|
||||||
{
|
{
|
||||||
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 (gst_validate_media_descriptor_get_file_node (
|
||||||
FALSE);
|
(GstValidateMediaDescriptor *) writer), FALSE);
|
||||||
|
|
||||||
return serialize_filenode (writer);
|
return serialize_filenode (writer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
struct _GstValidateMediaDescriptorPrivate
|
struct _GstValidateMediaDescriptorPrivate
|
||||||
{
|
{
|
||||||
gpointer dummy;
|
GstValidateMediaFileNode *filenode;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
|
||||||
|
@ -148,8 +148,8 @@ gst_validate_media_descriptor_dispose (GstValidateMediaDescriptor * self)
|
||||||
static void
|
static void
|
||||||
gst_validate_media_descriptor_finalize (GstValidateMediaDescriptor * self)
|
gst_validate_media_descriptor_finalize (GstValidateMediaDescriptor * self)
|
||||||
{
|
{
|
||||||
if (self->filenode)
|
if (self->priv->filenode)
|
||||||
gst_validate_filenode_free (self->filenode);
|
gst_validate_filenode_free (self->priv->filenode);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gst_validate_media_descriptor_parent_class)->finalize
|
G_OBJECT_CLASS (gst_validate_media_descriptor_parent_class)->finalize
|
||||||
(G_OBJECT (self));
|
(G_OBJECT (self));
|
||||||
|
@ -158,7 +158,8 @@ 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 = g_slice_new0 (GstValidateMediaFileNode);
|
self->priv = gst_validate_media_descriptor_get_instance_private (self);
|
||||||
|
self->priv->filenode = g_slice_new0 (GstValidateMediaFileNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -533,7 +534,7 @@ compare_streams (GstValidateMediaDescriptor * ref,
|
||||||
{
|
{
|
||||||
GstCaps *rcaps, *ccaps;
|
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;
|
return FALSE;
|
||||||
|
|
||||||
rcaps = caps_cleanup_parsing_fields (rstream->caps);
|
rcaps = caps_cleanup_parsing_fields (rstream->caps);
|
||||||
|
@ -567,7 +568,7 @@ gst_validate_media_descriptors_compare (GstValidateMediaDescriptor * ref,
|
||||||
{
|
{
|
||||||
GList *rstream_list;
|
GList *rstream_list;
|
||||||
GstValidateMediaFileNode
|
GstValidateMediaFileNode
|
||||||
* rfilenode = ref->filenode, *cfilenode = compared->filenode;
|
* rfilenode = ref->priv->filenode, *cfilenode = compared->priv->filenode;
|
||||||
|
|
||||||
if (rfilenode->duration != cfilenode->duration) {
|
if (rfilenode->duration != cfilenode->duration) {
|
||||||
GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT,
|
GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT,
|
||||||
|
@ -619,9 +620,9 @@ gboolean
|
||||||
gst_validate_media_descriptor_detects_frames (GstValidateMediaDescriptor * self)
|
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 (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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -636,9 +637,9 @@ gst_validate_media_descriptor_get_buffers (GstValidateMediaDescriptor * self,
|
||||||
GstCaps *pad_caps = gst_pad_get_current_caps (pad);
|
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 (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) {
|
tmpstream; tmpstream = tmpstream->next) {
|
||||||
GstValidateMediaStreamNode
|
GstValidateMediaStreamNode
|
||||||
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
|
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
|
||||||
|
@ -686,7 +687,7 @@ gst_validate_media_descriptor_has_frame_info (GstValidateMediaDescriptor * self)
|
||||||
{
|
{
|
||||||
GList *tmpstream;
|
GList *tmpstream;
|
||||||
|
|
||||||
for (tmpstream = self->filenode->streams;
|
for (tmpstream = self->priv->filenode->streams;
|
||||||
tmpstream; tmpstream = tmpstream->next) {
|
tmpstream; tmpstream = tmpstream->next) {
|
||||||
GstValidateMediaStreamNode
|
GstValidateMediaStreamNode
|
||||||
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
|
* streamnode = (GstValidateMediaStreamNode *) tmpstream->data;
|
||||||
|
@ -702,18 +703,18 @@ GstClockTime
|
||||||
gst_validate_media_descriptor_get_duration (GstValidateMediaDescriptor * self)
|
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 (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
|
gboolean
|
||||||
gst_validate_media_descriptor_get_seekable (GstValidateMediaDescriptor * self)
|
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 (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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -724,7 +725,7 @@ 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->priv->filenode->streams; tmp; tmp = tmp->next) {
|
||||||
GstValidateMediaStreamNode
|
GstValidateMediaStreamNode
|
||||||
* snode = (GstValidateMediaStreamNode *) tmp->data;
|
* snode = (GstValidateMediaStreamNode *) 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));
|
||||||
|
@ -732,3 +733,10 @@ gst_validate_media_descriptor_get_pads (GstValidateMediaDescriptor * self)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GstValidateMediaFileNode *
|
||||||
|
gst_validate_media_descriptor_get_file_node (GstValidateMediaDescriptor * self)
|
||||||
|
{
|
||||||
|
return self->priv->filenode;
|
||||||
|
}
|
||||||
|
|
|
@ -33,16 +33,6 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_VALIDATE_UNKNOWN_BOOL - 1
|
#define GST_VALIDATE_UNKNOWN_BOOL - 1
|
||||||
|
|
||||||
typedef struct _GstValidateMediaFileNode GstValidateMediaFileNode;
|
|
||||||
typedef struct _GstValidateMediaTagNode GstValidateMediaTagNode;
|
|
||||||
|
|
||||||
GST_VALIDATE_API
|
|
||||||
void gst_validate_filenode_free (GstValidateMediaFileNode *
|
|
||||||
filenode);
|
|
||||||
GST_VALIDATE_API
|
|
||||||
gboolean gst_validate_tag_node_compare (GstValidateMediaTagNode *
|
|
||||||
tnode, const GstTagList * tlist);
|
|
||||||
|
|
||||||
GST_VALIDATE_API
|
GST_VALIDATE_API
|
||||||
GType gst_validate_media_descriptor_get_type (void);
|
GType gst_validate_media_descriptor_get_type (void);
|
||||||
|
|
||||||
|
@ -66,8 +56,6 @@ typedef struct
|
||||||
{
|
{
|
||||||
GstObject parent;
|
GstObject parent;
|
||||||
|
|
||||||
GstValidateMediaFileNode *filenode;
|
|
||||||
|
|
||||||
GMutex lock;
|
GMutex lock;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
|
|
Loading…
Reference in a new issue