After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752758 - validate: descriptor-writer: Print proper error message when discover fails
validate: descriptor-writer: Print proper error message when discover fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-devtools
git master
Other Linux
: Normal enhancement
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-23 06:08 UTC by Vineeth
Modified: 2015-08-16 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
print proper error message when discovering fails (2.28 KB, patch)
2015-07-23 06:10 UTC, Vineeth
committed Details | Review
handle error when stream info is not present (3.69 KB, patch)
2015-07-23 06:56 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-07-23 06:08:45 UTC
When discovering the files, there will be different kind of errors. If we print
 the exact message, then it will be more helpful for user. Especially in the case
 of missing plugins, displaying which plugin is missing as error message
Comment 1 Vineeth 2015-07-23 06:10:18 UTC
Created attachment 307963 [details] [review]
print proper error message when discovering fails
Comment 2 Vineeth 2015-07-23 06:56:56 UTC
Created attachment 307970 [details] [review]
handle error when stream info is not present

When stream info is not present in the discoverer, then it asserts as below
gst_discoverer_stream_info_get_stream_id: assertion 'GST_IS_DISCOVERER_STREAM_INFO (info)' failed

Added proper Error check for the same and added it to Validate report as warnings.
Comment 3 Thibault Saunier 2015-07-23 07:45:47 UTC
Review of attachment 307963 [details] [review]:

::: validate/gst/validate/media-descriptor-writer.c
@@ -534,1 +531,2 @@
     goto out;
+  } else {

Why would the first condition not be met?

@@ -535,0 +532,21 @@
+  } else {
+    GstDiscovererResult result = gst_discoverer_info_get_result (info);
+    switch (result) {
... 18 more ...

Than one is indeed pretty usefull :)
Comment 4 Thibault Saunier 2015-07-23 07:45:49 UTC
Review of attachment 307963 [details] [review]:

::: validate/gst/validate/media-descriptor-writer.c
@@ -534,1 +531,2 @@
     goto out;
+  } else {

Why would the first condition not be met?

@@ -535,0 +532,21 @@
+  } else {
+    GstDiscovererResult result = gst_discoverer_info_get_result (info);
+    switch (result) {
... 18 more ...

Than one is indeed pretty usefull :)
Comment 5 Thibault Saunier 2015-07-23 07:48:00 UTC
Review of attachment 307970 [details] [review]:

How would that happen? If there is no stream info it means the discovering failed no?
Comment 6 Vineeth 2015-07-23 07:55:45 UTC
In case of (In reply to Thibault Saunier from comment #4)
> Review of attachment 307963 [details] [review] [review]:
> 
> ::: validate/gst/validate/media-descriptor-writer.c
> @@ -534,1 +531,2 @@
>      goto out;
> +  } else {
> 
> Why would the first condition not be met?
> 
> @@ -535,0 +532,21 @@
> +  } else {
> +    GstDiscovererResult result = gst_discoverer_info_get_result (info);
> +    switch (result) {
> ... 18 more ...
> 
> Than one is indeed pretty usefull :)

For some files, i don't have plugins installed.
So it will throw GST_DISCOVERER_MISSING_PLUGINS. But in this case, info is not NULL and gst_discoverer_discover_uri doesn't throw any error.
Only on result = gst_discoverer_info_get_result (info), i get an error.
So i checked how gst-discoverer is handling this and added the code here.




(In reply to Thibault Saunier from comment #5)
> Review of attachment 307970 [details] [review] [review]:
> 
> How would that happen? If there is no stream info it means the discovering
> failed no?

It was able to get the discoverer info and was not failing with any error. But there was no stream info and since there was no check, it was throwing an assertion error.
Comment 7 Vineeth 2015-07-23 08:06:49 UTC
(In reply to Thibault Saunier from comment #5)
> Review of attachment 307970 [details] [review] [review]:
> 
> How would that happen? If there is no stream info it means the discovering
> failed no?

It was basically some file named as .h264.. It was able to discover the file and its info including duration as 0. But not able to get the stream.. I guess the changes should be made such that even media_info is not created for this.. I think these changes are ok. But the check should be done even before creating the writer instance.. what do you think?
Comment 8 Thibault Saunier 2015-07-23 08:24:53 UTC
Review of attachment 307963 [details] [review]:

OK
Comment 9 Thibault Saunier 2015-07-23 08:25:27 UTC
Review of attachment 307970 [details] [review]:

OK then
Comment 10 Nicolas Dufresne (ndufresne) 2015-08-05 21:40:52 UTC
Comment on attachment 307963 [details] [review]
print proper error message when discovering fails

commit 97e630efbaa0587fbd3343375718e6d89100e2b3
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Thu Jul 23 15:08:55 2015 +0900

    validate: descriptor-writer: Print proper error message when discover fails
    
    When discovering the files, there will be different kind of errors. If we print
    the exact message, then it will be more helpful for user. Especially in the case
    of missing plugins, displaying which plugin is missing as error message
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752758
Comment 11 Nicolas Dufresne (ndufresne) 2015-08-05 21:41:11 UTC
Comment on attachment 307970 [details] [review]
handle error when stream info is not present

commit 82ffd9c53e57a41deee5b9c220e7c1b216b7b34a
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Thu Jul 23 15:51:09 2015 +0900

    validate: descriptor-writer: Handle error when stream info is not available
    
    There is no check to see if stream info is available. This leads to
    assertion error. Adding proper error messages for the same and reported
    the same as a validate warning message.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752758