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 760963 - ahcsrc: Add an example using the android hardware camera
ahcsrc: Add an example using the android hardware camera
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-examples
git master
Other Linux
: Normal enhancement
: git master
Assigned To: Justin Kim
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-21 19:10 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-11-03 11:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
an example app (47.12 KB, patch)
2016-01-25 10:04 UTC, Justin Kim
none Details | Review
add comment (47.96 KB, patch)
2016-01-27 02:02 UTC, Justin Kim
none Details | Review
remove sync=false (47.94 KB, patch)
2016-01-28 02:00 UTC, Justin Kim
none Details | Review
Add more UIs (1.24 MB, patch)
2017-07-24 05:59 UTC, Justin Kim
none Details | Review
Move from 'bad' to 'examples' (1.24 MB, patch)
2017-07-25 00:36 UTC, Justin Kim
none Details | Review

Description Nicolas Dufresne (ndufresne) 2016-01-21 19:10:56 UTC
Working example code can be found here, though it requires a lot of cleanup. Ideally we can add this back in gst-bad as a single commit.

https://git.collabora.com/cgit/user/joykim/gst-camera-test.git/
Comment 1 Justin Kim 2016-01-25 09:01:53 UTC
Can I be a volunteer of this task if anyone hasn't started yet?

Btw, I found some of files in the url above were declared as Apache License 2.0. As I understand, this license cannot be compatible with LGPL. Actually there are two files; one is Android.mk, another is a java file.

In this case, can we change the license, or am I misinformed about the license?
Comment 2 Justin Kim 2016-01-25 10:04:23 UTC
Created attachment 319672 [details] [review]
an example app

I made all of the codes under LGPL.
Comment 3 Nicolas Dufresne (ndufresne) 2016-01-25 23:34:04 UTC
Review of attachment 319672 [details] [review]:

It's nice, though it would be cool if we could add some sliders and knobs so we can exercise some of the features. This element implement a lot of the Photography interface.

::: tests/examples/androidcamera/jni/camera_test.c
@@ +202,3 @@
+  data->pipeline =
+      gst_parse_launch
+      ("ahcsrc !  video/x-raw,format=(string)NV21 ! glimagesink name=vsink sync=false",

Can we let it negotiate ? And I tested already, sync=false is not required. Note that on my Nexus 5, we get 1080p stream, which in the current state, does not work well. So maybe we could reuse the caps filter, remove the format file and set a width and height range that make sure it does not go over 720p ?
Comment 4 Justin Kim 2016-01-26 06:59:48 UTC
Review of attachment 319672 [details] [review]:

::: tests/examples/androidcamera/jni/camera_test.c
@@ +202,3 @@
+  data->pipeline =
+      gst_parse_launch
+      ("ahcsrc !  video/x-raw,format=(string)NV21 ! glimagesink name=vsink sync=false",

Okay, we can use the pipeline without caps filter.
However regarding sync property, it may show different results on different devices.
On my LG V410 pad, flicker in every few seconds happens if sync is true.
About resolution, we can set resolution via caps filter currently because there's no property for resolution in ahcsrc.
The pipeline might be "ahcsrc ! video/x-raw,width=(int)320,height=(int)240 ! glimagesink".

Regarding to resolution, I don't think we make sure the resolution is supported in ahcsrc as a gstreamer element
because this is for android and there are easier way to gather the information in java side.
Before building a pipeline, the android UI application should set the resolution properly based on gathered information.
In addition, although android-hardware-camera.c has a function to set resolution, it is used internally.

In my opinion, it's good to write comments here or in README about restrictions, then make android app UI more abundant.
What do you think?
Comment 5 Justin Kim 2016-01-27 02:02:28 UTC
Created attachment 319800 [details] [review]
add comment

because of my test result about 'sync' property, I didn't change the value. Instead, I added some comments there.
Comment 6 Nicolas Dufresne (ndufresne) 2016-01-27 13:56:59 UTC
We keep fighting when explaining how wrong it is to use sync to false in general, I'm not going to merge an example that encourage that.
Comment 7 Justin Kim 2016-01-28 02:00:37 UTC
Created attachment 319888 [details] [review]
remove sync=false

Oh, no. I wanna make it merge. Here's a patch to ask for a ceasefire. :)

About flickering issue on my android pad, I'll create another issue if I get any concrete clue.
Comment 8 Justin Kim 2017-07-24 05:59:22 UTC
Created attachment 356254 [details] [review]
Add more UIs

Hello. It's been an age to update.
 
I moved my personal repository to github because of screenshot.
Please refer to the below URL for screenshot.

https://github.com/justinjoy/gst-android-camera

With controlling knobs, it becomes little more complex than the first patch.
So I am wondering `gst-plugins-bad` is a proper repository for this example.
If not, please suggest a good place and also let me know whether GStreamer community is still interested in having this example.
Thanks.
Comment 9 Nicolas Dufresne (ndufresne) 2017-07-24 12:42:43 UTC
That other option would be in gst-examples repository. It already contains few UI.
Comment 10 Justin Kim 2017-07-25 00:36:20 UTC
Created attachment 356327 [details] [review]
Move from 'bad' to 'examples'

Thanks for replying. I moved the patch to gst-examples.
Comment 11 GStreamer system administrator 2018-11-03 11:08:32 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-examples/issues/1.