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 745740 - camerabin: update zoom param spec if video source changes its max-zoom
camerabin: update zoom param spec if video source changes its max-zoom
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.5
Other All
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-06 12:54 UTC by Mohammed Sameer
Modified: 2015-03-08 19:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.38 KB, patch)
2015-03-06 12:55 UTC, Mohammed Sameer
committed Details | Review

Description Mohammed Sameer 2015-03-06 12:54:53 UTC
I have a video source that allows zooming beyond the maximum hardcoded in camerabin (10f). The source updates its max-zoom properly but camerabin cannot proxy the zoom property changes due to the hard coded limit.

This patch allows using the full range of zoom values.
Comment 1 Mohammed Sameer 2015-03-06 12:55:43 UTC
Created attachment 298704 [details] [review]
proposed fix

I am attaching a proposed fix that works for my case.
Comment 2 Thiago Sousa Santos 2015-03-06 14:23:25 UTC
Thanks for the fix.

Do you think it would also make sense to read this value in initialization when the camera source is set and proxy it?
Comment 3 Mohammed Sameer 2015-03-06 14:42:31 UTC
I don't think it's needed but it really depends on how we expect the pipeline to behave/API to be used.

If someone does something like:
g_object_set (camerabin, "camera-source", src, NULL);
g_object_set (camerabin, "zoom", 11, NULL);
then it will fail because the pspec has 10 as its max.

However if the user waits until the pipeline is PLAYING then it should work fine.

in my case for example, there is no way to tell the max zoom until we reach PAUSED state (we open the device and probe its caps). I am not also sure that probing in ready state (which is when the source is taken into use) will help but I cannot tell here.
Comment 4 Thiago Sousa Santos 2015-03-06 15:37:37 UTC
(In reply to Mohammed Sameer from comment #3)
> I don't think it's needed but it really depends on how we expect the
> pipeline to behave/API to be used.
> 
> If someone does something like:
> g_object_set (camerabin, "camera-source", src, NULL);
> g_object_set (camerabin, "zoom", 11, NULL);
> then it will fail because the pspec has 10 as its max.
> 
> However if the user waits until the pipeline is PLAYING then it should work
> fine.
> 
> in my case for example, there is no way to tell the max zoom until we reach
> PAUSED state (we open the device and probe its caps). I am not also sure
> that probing in ready state (which is when the source is taken into use)
> will help but I cannot tell here.

Does your source always do a max-zoom notify when it reaches playing to notify about its zoom maximum?

I'm considering the case where a source would have a different max-zoom but doesn't notify because it is always the same since the beginning. So the camerabin API and the source API wouldn't be agreeing to each other.

Do you see this as possible?
Comment 5 Mohammed Sameer 2015-03-07 13:53:35 UTC
(In reply to Thiago Sousa Santos from comment #4)
> Does your source always do a max-zoom notify when it reaches playing to
> notify about its zoom maximum?

Yes it does.

> I'm considering the case where a source would have a different max-zoom but
> doesn't notify because it is always the same since the beginning. So the
> camerabin API and the source API wouldn't be agreeing to each other.

It still depends on how you expect the API to be used :-)
a GObject property needs to have a default min, current and max values anyway so it depends on what the developer of the custom source chooses for those values.

> Do you see this as possible?
It seems possible but not like we get a new camera source every day ;-)

I'd personally not be concerned about it but if you still believe it's a possibility then I can try to find time to create another patch.

There is also something I noticed, why does camerabin proxy the zoom and max-zoom only? Either we proxy all the photography properties or we proxy none. I was tempted to suggest removing those properties completely.
Comment 6 Thiago Sousa Santos 2015-03-08 19:26:05 UTC
I see your point that sources should be emitting a notify to update the property as default should always be present while the element is in NULL.

Thanks for the patch, pushed.

commit d49dbefd6c49193073c6334fd493f6899bf237d2
Author: Mohammed Hassan <mohammed.hassan@jolla.com>
Date:   Fri Mar 6 14:49:20 2015 +0200

    camerabin: update zoom param spec if video source changes its max-zoom
    
    If the video source happens to allow max-zoom to be greater than our maximum hard coded
    value of 10 then the user cannot set anything greater than our maximum specified in the
    param spec. We have to update our param spec to prevent glib from capping the value
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745740