-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize recording state policy #44
Conversation
If you tell me where libuca on the camera1 machine is. It is not in /opt |
Never mind, found it. |
|
On 08/13/14 13:24, Tomas Farago wrote:
It's in /root/libuca. |
Could you give me a bit more detailed information? For example by giving me the output of
|
There is tens of thousands of lines, but they all repeat this pattern:
|
This change fixes and unifies handling of different "is-recording" states. First of all there are potentially two different states: the priv->is_recording state from the base class and some device-specific state. Device authors can override the "is-recording" property to provide device-specific information. This change sets the global recording state as follows: 1. uca_camera_is_recording returns the value of ::is-recording. 2. priv->is_recording is the default state that is returned for ::is-recording and set after successfully calling uca_camera_start_recording and uca_camera_stop_recording. 3. uca_camera_start_recording, uca_camera_stop_recording, uca_camera_trigger use ::is-recording to determine how to proceed. 4. For performance reasons, uca_camera_grab relies on priv->is_recording.
7275dba
to
3dde711
Compare
This would require this change to uca-net (git diff, I think it says it best):
the change from unref to clear is not so huge, but unless we release the connection after we call parent, the is-recording check will try to use the released connections, jajks. I didn't read the docs too carefully yet, maybe @matze can comment whether this will doom us completely or not. The alternative is to a) release the client in the |
The segfault came from both btw, the error being freed when not initialized and the connection usage after freeing it, that's fixed now. |
You are half-way there. |
yep, but then the recording cannot be stopped in the parent, because it will try to use our freed connection. |
Then do the obvious thing, reset the state properly when destroying the object so that calling stop will not use any freed connection. |
Sure, when I find 10 minutes between other things. Just FYI: it's not about the stop but about the |
to comply with ufo-kit/libuca#44
Done there. |
to comply with ufo-kit/libuca#44
When I kill a concert session (no stop recording) and start it again, the state is correct but the grab will fail because of this. But sure, we cannot be checking over network all the time if the camera is recording. This should be addressed before we merge. |
src/uca-camera.c
Outdated
@@ -926,6 +926,7 @@ uca_camera_is_recording (UcaCamera *camera) | |||
gboolean result; | |||
g_return_val_if_fail (UCA_IS_CAMERA (camera), FALSE); | |||
g_object_get (camera, "is-recording", &result, NULL); | |||
camera->priv->is_recording = result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will I go to hell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean you like it or I will? 😄 Anyway, it's not good yet, more on Monday...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got rid of this.
This solves point 4. |
Todo: make sure the property is consistent with the parameter. Right now child's property getter will not update the cached state, whereas call to |
88c7921
to
ae678ae
Compare
to comply with ufo-kit/libuca#44
stop_recording used the property and start_recording the cached value. Also make sure the caches are updated according to real state values.
fb54456
to
02b6dfd
Compare
Alright, so now the camera calls plugin getters when the construction is done to make sure that the cached states ( Some remarks:
|
For the past history of this plugin refer to the libuca Git history.
@matze, does your silence mean approval or the opposite? Or you don't like it but don't have a better solution yet? 😄 |
By the way, if we merge this it will probably go to the Guiness world records book for the longest open PR 😄 |
There is only noise coming from me when confused ;-) so take my approval! |
This change fixes and unifies handling of different "is-recording" states. First
of all there are potentially two different states: the priv->is_recording state
from the base class and some device-specific state. Device authors can override
the "is-recording" property to provide device-specific information. This change
sets the global recording state as follows:
and set after successfully calling uca_camera_start_recording and
uca_camera_stop_recording.
use ::is-recording to determine how to proceed.