Is it possible to use glviewconvert on Android?

Matthew Waters ystreet00 at gmail.com
Mon Oct 26 00:32:48 PDT 2015


On 26/10/15 02:59, 少华王 wrote:
> I wrote a small demo on Linux using glviewconvert like this:
> #include <gst/gst.h>
> #include <gst/video/video.h>
> #include <gst/video/videooverlay.h>
>
> int main(int argc, char *argv[]) {
>   GstMessage *msg;
>   /* Initialize GStreamer */
>   gst_init (&argc, &argv);
>   /* Build the pipeline */
>   GstElement *pipeline = gst_element_factory_make ("playbin", NULL);
>   GstBin *sinkbin = (GstBin *) gst_parse_bin_from_description ("glupload ! glcolorconvert ! glviewconvert name=viewconvert ! glimagesink name=sink", TRUE, NULL);
>   GstElement *glconvert = gst_bin_get_by_name (sinkbin, "viewconvert");
>   GstElement *videosink = gst_bin_get_by_name (sinkbin, "sink");
>   g_object_set (G_OBJECT (pipeline), "video-sink", sinkbin, NULL);
>   g_object_set (G_OBJECT (pipeline), "uri", "file:///home/sheldon/1.webm", NULL); 
>
>   // g_object_get (pipeline, "video-multiview-mode", &state.in_mode,
>   //   "video-multiview-flags", &state.in_flags, NULL);
>
>   g_object_set (G_OBJECT (glconvert), "input-mode-override", 0,
>     NULL);
>   g_object_set (G_OBJECT (glconvert), "input-flags-override", 0,
>       NULL);
>
>   GstElement *sink = gst_bin_get_by_name (GST_BIN (videosink), "sink");
>   g_object_set (G_OBJECT (sink), "output-multiview-mode", GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE, NULL);
>
>   g_object_set (G_OBJECT (glconvert), "input-mode-override", GST_VIDEO_MULTIVIEW_FRAME_PACKING_COLUMN_INTERLEAVED, NULL);
>
>   gst_element_set_state (pipeline, GST_STATE_PLAYING);
>   GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>   msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
>
>   // /* Free resources */
>   if (msg != NULL)
>     gst_message_unref (msg);
>   gst_object_unref (bus);
>   gst_element_set_state (pipeline, GST_STATE_NULL);
>   gst_object_unref (pipeline);
>   return 0;
> }
> And I want to use this on Android. Then I got a error log like "cannot find glviewconvert". Is there a way to use glviewconvert directly? If not, what can I do? Like compile the glviewconvert?

Looks like glviewconvert was only built for desktop OpenGL systems. 
That's since been rectified by
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=09976e021b8d222daf96e1b1328fde4a00b5c05f. 
As hinted by the commit message, if you have a gles2 system (no gles3)
then you cannot output the separated/frame-by-frame modes due to
limitations in the GLES 2.0 API.

Cheers
-Matt

> I'm new on GStreamer, it's very nice of you if you could help me or give me any tips. Thank you very much.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151026/0f5f4ed4/attachment.sig>


More information about the gstreamer-devel mailing list