From c76ab3cfc9d9f208704276ab19191f85421fc68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 23 Dec 2013 10:50:53 +0900 Subject: [PATCH] emotion: initial port of emotion to GStreamer 1.0 Some commits to port emotion to GStreamer 1.0 and implement some missing features, clean up code a bit and fix some bugs on the way. This works as good as the 0.10 code for me now with the emotion examples, just the Samsung hardware specific code is commented out. This should be ported by someone who has such hardware, and also in a clean way now that GStreamer since 1.0 has features to handle all this properly. There's still a lot of potential to clean things up and fix many bugs, and also to implement zerocopy rendering. But those are for later if there's actual interest in this at all. Commits: - Update configure checks and ecore example to GStreamer 1.0 - Initial port of emotion to GStreamer 1.0 - Samsung specific code commented out, should be ported by someone with the hardware. - Return GST_FLOW_FLUSHING when the sink is unlocked - Remove unused GSignal from the sink - Use GstVideoInfo to store the format details inside the sink - Add support for pixel-aspect-ratio - Store video format information in GstVideoInfo for the different video streams - Use GstAudioInfo to store the audio format information - Remove some unused defines - Header cleanup - Implement initial support for GstNavigation interface - Implement setting of audio/video channel Reviewers: cedric CC: cedric Differential Revision: https://phab.enlightenment.org/D387 Signed-off-by: Cedric BAIL --- unsorted/ecore/Makefile.examples | 9 ++++++++- unsorted/ecore/ecore_pipe_gstreamer_example.c | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/unsorted/ecore/Makefile.examples b/unsorted/ecore/Makefile.examples index f8ac82d5..63e5f6b7 100644 --- a/unsorted/ecore/Makefile.examples +++ b/unsorted/ecore/Makefile.examples @@ -1,6 +1,13 @@ CC=gcc + +if HAVE_GSTREAMER_1 + GSTREAMER_DEP="gstreamer-1.0" +else + GSTREAMER_DEP="gstreamer-0.10" +endif + COMMON_FLAGS=`pkg-config --libs --cflags eina,ecore,evas,ecore-evas,ecore-audio,ecore-con,ecore-file, \ - eo,evas-software-buffer,gnutls,ecore-imf,ecore-imf-evas,gstreamer-0.10` -lm + eo,evas-software-buffer,gnutls,ecore-imf,ecore-imf-evas,$(GSTREAMER_DEP)` -lm EXAMPLES= ecore_animator_example \ ecore_audio_custom \ diff --git a/unsorted/ecore/ecore_pipe_gstreamer_example.c b/unsorted/ecore/ecore_pipe_gstreamer_example.c index 008b96e5..20d3fa11 100644 --- a/unsorted/ecore/ecore_pipe_gstreamer_example.c +++ b/unsorted/ecore/ecore_pipe_gstreamer_example.c @@ -1,4 +1,6 @@ //Compile with: +// gcc -o ecore_pipe_gstreamer_example ecore_pipe_gstreamer_example.c `pkg-config --libs --cflags ecore gstreamer-1.0` +// or // gcc -o ecore_pipe_gstreamer_example ecore_pipe_gstreamer_example.c `pkg-config --libs --cflags ecore gstreamer-0.10` #include @@ -98,23 +100,33 @@ new_decoded_pad_cb(GstElement *demuxer, GstElement *decoder; GstPad *pad; GstCaps *caps; - gchar *str; + GstStructure *s; + const gchar *str; +#if GST_CHECK_VERSION(1,0,0) + caps = gst_pad_get_current_caps(new_pad); +#else caps = gst_pad_get_caps(new_pad); - str = gst_caps_to_string(caps); +#endif + s = gst_caps_get_structure(caps, 0); + str = gst_structure_get_name(s); if (g_str_has_prefix(str, "video/")) { decoder = GST_ELEMENT(user_data); +#if GST_CHECK_VERSION(1,0,0) + pad = gst_element_get_static_pad(decoder, "sink"); +#else pad = gst_element_get_pad(decoder, "sink"); +#endif if (GST_PAD_LINK_FAILED(gst_pad_link(new_pad, pad))) { g_warning("Failed to link %s:%s to %s:%s", GST_DEBUG_PAD_NAME(new_pad), GST_DEBUG_PAD_NAME(pad)); } + gst_object_unref(pad); } - g_free(str); gst_caps_unref(caps); }