ges: Switch to encoding-profile API from base

Remove dependency on gst-convenience.
This commit is contained in:
Edward Hervey 2010-12-15 12:36:25 +01:00
parent 7fc7bfb110
commit 4c63aa21f2
10 changed files with 65 additions and 64 deletions

View file

@ -51,7 +51,7 @@ AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff *** dnl *** required versions of GStreamer stuff ***
GST_REQ=0.10.30.4 GST_REQ=0.10.30.4
GSTPB_REQ=0.10.30.4 GSTPB_REQ=0.10.31.1
dnl *** autotools stuff **** dnl *** autotools stuff ****
@ -156,14 +156,6 @@ GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable
AC_SUBST(GSTPB_PLUGINS_DIR) AC_SUBST(GSTPB_PLUGINS_DIR)
AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR) AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
dnl check for gstreamer-profile
PKG_CHECK_MODULES(GST_PROFILE, gstreamer-profile-$GST_MAJORMINOR, HAVE_GST_PROFILE="yes", HAVE_GST_PROFILE="no")
if test "x$HAVE_GST_PROFILE" != "xyes"; then
AC_ERROR([gst-profile is required for rendering support])
fi
AC_SUBST(GST_PROFILE_LIBS)
AC_SUBST(GST_PROFILE_CFLAGS)
dnl check for gstreamer-pbutils dnl check for gstreamer-pbutils
PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_MAJORMINOR, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no") PKG_CHECK_MODULES(GST_PBUTILS, gstreamer-pbutils-$GST_MAJORMINOR, HAVE_GST_PBUTILS="yes", HAVE_GST_PBUTILS="no")
if test "x$HAVE_GST_PBUTILS" != "xyes"; then if test "x$HAVE_GST_PBUTILS" != "xyes"; then

View file

@ -84,8 +84,8 @@ libges_@GST_MAJORMINOR@include_HEADERS = \
ges-keyfile-formatter.h \ ges-keyfile-formatter.h \
ges-utils.h ges-utils.h
libges_@GST_MAJORMINOR@_la_CFLAGS = -I$(top_srcdir) $(GST_PROFILE_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) libges_@GST_MAJORMINOR@_la_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) $(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libges_@GST_MAJORMINOR@_la_LIBADD = $(GST_PROFILE_LIBS) $(GST_PBUTILS_LIBS) $(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS) libges_@GST_MAJORMINOR@_la_LIBADD = $(GST_PBUTILS_LIBS) $(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)
libges_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) libges_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
DISTCLEANFILE = $(CLEANFILES) DISTCLEANFILE = $(CLEANFILES)

View file

@ -95,7 +95,7 @@ ges_timeline_pipeline_dispose (GObject * object)
} }
if (self->priv->profile) { if (self->priv->profile) {
gst_encoding_profile_free (self->priv->profile); gst_encoding_profile_unref (self->priv->profile);
self->priv->profile = NULL; self->priv->profile = NULL;
} }
@ -165,10 +165,9 @@ ges_timeline_pipeline_new (void)
return g_object_new (GES_TYPE_TIMELINE_PIPELINE, NULL); return g_object_new (GES_TYPE_TIMELINE_PIPELINE, NULL);
} }
#define TRACK_COMPATIBLE_PROFILE(tracktype, proftype) \ #define TRACK_COMPATIBLE_PROFILE(tracktype, profile) \
(((proftype) == GST_ENCODING_PROFILE_AUDIO && (tracktype) == GES_TRACK_TYPE_AUDIO) || \ ( (GST_IS_ENCODING_AUDIO_PROFILE (profile) && (tracktype) == GES_TRACK_TYPE_AUDIO) || \
((proftype) == GST_ENCODING_PROFILE_VIDEO && (tracktype) == GES_TRACK_TYPE_VIDEO) || \ (GST_IS_ENCODING_VIDEO_PROFILE (profile) && (tracktype) == GES_TRACK_TYPE_VIDEO))
((proftype) == GST_ENCODING_PROFILE_TEXT && (tracktype) == GES_TRACK_TYPE_TEXT))
static gboolean static gboolean
ges_timeline_pipeline_update_caps (GESTimelinePipeline * self) ges_timeline_pipeline_update_caps (GESTimelinePipeline * self)
@ -186,19 +185,22 @@ ges_timeline_pipeline_update_caps (GESTimelinePipeline * self)
* track to set the caps on */ * track to set the caps on */
for (ltrack = tracks; ltrack; ltrack = ltrack->next) { for (ltrack = tracks; ltrack; ltrack = ltrack->next) {
GESTrack *track = (GESTrack *) ltrack->data; GESTrack *track = (GESTrack *) ltrack->data;
GList *allstreams;
allstreams = (GList *)
gst_encoding_container_profile_get_profiles (
(GstEncodingContainerProfile *) self->priv->profile);
/* Find a matching stream setting */ /* Find a matching stream setting */
for (lstream = self->priv->profile->encodingprofiles; lstream; for (lstream = allstreams; lstream; lstream = lstream->next) {
lstream = lstream->next) { GstEncodingProfile *prof = (GstEncodingProfile *) lstream->data;
GstStreamEncodingProfile *prof =
(GstStreamEncodingProfile *) lstream->data;
if (TRACK_COMPATIBLE_PROFILE (track->type, prof->type)) { if (TRACK_COMPATIBLE_PROFILE (track->type, prof)) {
if (self->priv->mode == TIMELINE_MODE_SMART_RENDER) { if (self->priv->mode == TIMELINE_MODE_SMART_RENDER) {
GstCaps *ocaps, *rcaps; GstCaps *ocaps, *rcaps;
GST_DEBUG ("Smart Render mode, setting output caps"); GST_DEBUG ("Smart Render mode, setting output caps");
ocaps = gst_stream_encoding_profile_get_output_caps (prof); ocaps = gst_encoding_profile_get_output_caps (prof);
if (track->type == GES_TRACK_TYPE_AUDIO) if (track->type == GES_TRACK_TYPE_AUDIO)
rcaps = gst_caps_from_string ("audio/x-raw-int;audio/x-raw-float"); rcaps = gst_caps_from_string ("audio/x-raw-int;audio/x-raw-float");
else else
@ -251,8 +253,8 @@ ges_timeline_pipeline_change_state (GstElement * element,
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
goto done; goto done;
} }
if (self->priv-> if (self->
mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER)) priv->mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
GST_DEBUG ("rendering => Updating pipeline caps"); GST_DEBUG ("rendering => Updating pipeline caps");
if (!ges_timeline_pipeline_update_caps (self)) { if (!ges_timeline_pipeline_update_caps (self)) {
GST_ERROR_OBJECT (element, "Error setting the caps for rendering"); GST_ERROR_OBJECT (element, "Error setting the caps for rendering");
@ -630,11 +632,12 @@ ges_timeline_pipeline_set_render_settings (GESTimelinePipeline * pipeline,
} }
if (pipeline->priv->profile) if (pipeline->priv->profile)
gst_encoding_profile_free (pipeline->priv->profile); gst_encoding_profile_unref (pipeline->priv->profile);
g_object_set (pipeline->priv->encodebin, "use-smartencoder", g_object_set (pipeline->priv->encodebin, "use-smartencoder",
!(!(pipeline->priv->mode & TIMELINE_MODE_SMART_RENDER)), NULL); !(!(pipeline->priv->mode & TIMELINE_MODE_SMART_RENDER)), NULL);
g_object_set (pipeline->priv->encodebin, "profile", profile, NULL); g_object_set (pipeline->priv->encodebin, "profile", profile, NULL);
pipeline->priv->profile = gst_encoding_profile_copy (profile); pipeline->priv->profile =
(GstEncodingProfile *) gst_encoding_profile_ref (profile);
return TRUE; return TRUE;
} }

View file

@ -23,7 +23,7 @@
#include <glib-object.h> #include <glib-object.h>
#include <ges/ges.h> #include <ges/ges.h>
#include <gst/profile/gstprofile.h> #include <gst/pbutils/encoding-profile.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -17,5 +17,5 @@ noinst_PROGRAMS = \
text_properties \ text_properties \
$(graphical) $(graphical)
AM_CFLAGS = -I$(top_srcdir) $(GST_PROFILE_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_CFLAGS) $(GTK_CFLAGS) -export-dynamic AM_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) $(GST_CFLAGS) $(GTK_CFLAGS) -export-dynamic
LDADD = $(top_builddir)/ges/libges-@GST_MAJORMINOR@.la $(GST_PBUTILS_LIBS) $(GST_LIBS) $(GTK_LIBS) LDADD = $(top_builddir)/ges/libges-@GST_MAJORMINOR@.la $(GST_PBUTILS_LIBS) $(GST_LIBS) $(GTK_LIBS)

View file

@ -18,8 +18,8 @@
*/ */
#include <ges/ges.h> #include <ges/ges.h>
#include <gst/profile/gstprofile.h>
#include <gst/pbutils/gstdiscoverer.h> #include <gst/pbutils/gstdiscoverer.h>
#include <gst/pbutils/encoding-profile.h>
GstDiscovererInfo *get_info_for_file (GstDiscoverer * disco, gchar * filename); GstDiscovererInfo *get_info_for_file (GstDiscoverer * disco, gchar * filename);
@ -51,15 +51,15 @@ get_info_for_file (GstDiscoverer * disco, gchar * filename)
static GstEncodingProfile * static GstEncodingProfile *
make_profile_from_info (GstDiscovererInfo * info) make_profile_from_info (GstDiscovererInfo * info)
{ {
GstEncodingProfile *profile = NULL; GstEncodingContainerProfile *profile = NULL;
GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info); GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info);
/* Get the container format */ /* Get the container format */
if (GST_IS_DISCOVERER_CONTAINER_INFO (sinfo)) { if (GST_IS_DISCOVERER_CONTAINER_INFO (sinfo)) {
GList *tmp, *substreams; GList *tmp, *substreams;
profile = gst_encoding_profile_new ((gchar *) "concatenate", profile = gst_encoding_container_profile_new ((gchar *) "concatenate", NULL,
gst_discoverer_stream_info_get_caps (sinfo), NULL, FALSE); gst_discoverer_stream_info_get_caps (sinfo), NULL);
substreams = substreams =
gst_discoverer_container_info_get_streams ((GstDiscovererContainerInfo gst_discoverer_container_info_get_streams ((GstDiscovererContainerInfo
@ -68,13 +68,20 @@ make_profile_from_info (GstDiscovererInfo * info)
/* For each on the formats add stream profiles */ /* For each on the formats add stream profiles */
for (tmp = substreams; tmp; tmp = tmp->next) { for (tmp = substreams; tmp; tmp = tmp->next) {
GstDiscovererStreamInfo *stream = GST_DISCOVERER_STREAM_INFO (tmp->data); GstDiscovererStreamInfo *stream = GST_DISCOVERER_STREAM_INFO (tmp->data);
GstStreamEncodingProfile *sprof; GstEncodingProfile *sprof;
sprof = if (GST_IS_DISCOVERER_VIDEO_INFO (stream)) {
gst_stream_encoding_profile_new (GST_IS_DISCOVERER_VIDEO_INFO (stream) sprof = (GstEncodingProfile *)
? GST_ENCODING_PROFILE_VIDEO : GST_ENCODING_PROFILE_AUDIO, gst_encoding_video_profile_new (gst_discoverer_stream_info_get_caps
gst_discoverer_stream_info_get_caps (stream), NULL, NULL, 1); (stream), NULL, NULL, 1);
gst_encoding_profile_add_stream (profile, sprof); } else if (GST_IS_DISCOVERER_AUDIO_INFO (stream)) {
sprof = (GstEncodingProfile *)
gst_encoding_audio_profile_new (gst_discoverer_stream_info_get_caps
(stream), NULL, NULL, 1);
} else
GST_WARNING ("Unsupported streams");
gst_encoding_container_profile_add_profile (profile, sprof);
} }
if (substreams) if (substreams)
gst_discoverer_stream_info_list_free (substreams); gst_discoverer_stream_info_list_free (substreams);
@ -85,7 +92,7 @@ make_profile_from_info (GstDiscovererInfo * info)
if (sinfo) if (sinfo)
gst_discoverer_stream_info_unref (sinfo); gst_discoverer_stream_info_unref (sinfo);
return profile; return (GstEncodingProfile *) profile;
} }
static void static void

View file

@ -18,7 +18,7 @@
*/ */
#include <ges/ges.h> #include <ges/ges.h>
#include <gst/profile/gstprofile.h> #include <gst/pbutils/encoding-profile.h>
GstEncodingProfile *make_ogg_vorbis_profile (void); GstEncodingProfile *make_ogg_vorbis_profile (void);
@ -32,15 +32,14 @@ GstEncodingProfile *make_ogg_vorbis_profile (void);
GstEncodingProfile * GstEncodingProfile *
make_ogg_vorbis_profile (void) make_ogg_vorbis_profile (void)
{ {
GstEncodingProfile *profile; GstEncodingContainerProfile *profile;
GstStreamEncodingProfile *audiostream;
profile = gst_encoding_profile_new ((gchar *) "ges-test4", profile = gst_encoding_container_profile_new ((gchar *) "ges-test4", NULL,
gst_caps_new_simple ("application/ogg", NULL), NULL, FALSE); gst_caps_new_simple ("application/ogg", NULL), NULL);
audiostream = gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_AUDIO, gst_encoding_container_profile_add_profile (profile, (GstEncodingProfile *)
gst_caps_new_simple ("audio/x-vorbis", NULL), NULL, NULL, 1); gst_encoding_audio_profile_new (gst_caps_new_simple ("audio/x-vorbis",
gst_encoding_profile_add_stream (profile, audiostream); NULL), NULL, NULL, 1));
return profile; return (GstEncodingProfile *) profile;
} }
int int

View file

@ -27,7 +27,7 @@
#include <glib.h> #include <glib.h>
#include <glib/gstdio.h> #include <glib/gstdio.h>
#include <ges/ges.h> #include <ges/ges.h>
#include <gst/profile/gstprofile.h> #include <gst/pbutils/encoding-profile.h>
#include <regex.h> #include <regex.h>
/* GLOBAL VARIABLE */ /* GLOBAL VARIABLE */

View file

@ -1,3 +1,3 @@
bin_PROGRAMS = ges-launch bin_PROGRAMS = ges-launch
AM_CFLAGS = -I$(top_srcdir) $(GST_PROFILE_CFLAGS) $(GST_PBUTILS_CFLAGS) $(GST_CFLAGS) AM_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) $(GST_CFLAGS)
LDADD = $(top_builddir)/ges/libges-@GST_MAJORMINOR@.la $(GST_PBUTILS_LIBS) $(GST_LIBS) LDADD = $(top_builddir)/ges/libges-@GST_MAJORMINOR@.la $(GST_PBUTILS_LIBS) $(GST_LIBS)

View file

@ -26,7 +26,7 @@
#include <string.h> #include <string.h>
#include <glib.h> #include <glib.h>
#include <ges/ges.h> #include <ges/ges.h>
#include <gst/profile/gstprofile.h> #include <gst/pbutils/encoding-profile.h>
#include <regex.h> #include <regex.h>
/* GLOBAL VARIABLE */ /* GLOBAL VARIABLE */
@ -165,29 +165,29 @@ static GstEncodingProfile *
make_encoding_profile (gchar * audio, gchar * video, gchar * video_restriction, make_encoding_profile (gchar * audio, gchar * video, gchar * video_restriction,
gchar * container) gchar * container)
{ {
GstEncodingProfile *profile; GstEncodingContainerProfile *profile;
GstStreamEncodingProfile *stream; GstEncodingProfile *stream;
GstCaps *caps; GstCaps *caps;
caps = gst_caps_from_string (container); caps = gst_caps_from_string (container);
profile = gst_encoding_profile_new ((gchar *) "ges-test4", caps, NULL, FALSE); profile =
gst_encoding_container_profile_new ((gchar *) "ges-test4", NULL, caps,
NULL);
gst_caps_unref (caps); gst_caps_unref (caps);
caps = gst_caps_from_string (audio); caps = gst_caps_from_string (audio);
stream = stream = (GstEncodingProfile *)
gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_AUDIO, gst_encoding_audio_profile_new (caps, NULL, NULL, 0);
caps, NULL, NULL, 0); gst_encoding_container_profile_add_profile (profile, stream);
gst_encoding_profile_add_stream (profile, stream);
gst_caps_unref (caps); gst_caps_unref (caps);
caps = gst_caps_from_string (video); caps = gst_caps_from_string (video);
stream = gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_VIDEO, stream = (GstEncodingProfile *)
gst_caps_from_string (video), gst_encoding_video_profile_new (caps, NULL, NULL, 0);
NULL, gst_caps_from_string (video_restriction), 0); gst_encoding_container_profile_add_profile (profile, stream);
gst_encoding_profile_add_stream (profile, stream);
gst_caps_unref (caps); gst_caps_unref (caps);
return profile; return (GstEncodingProfile *) profile;
} }
static GESTimeline * static GESTimeline *
@ -544,7 +544,7 @@ main (int argc, gchar ** argv)
exit (1); exit (1);
g_free (outputuri); g_free (outputuri);
gst_encoding_profile_free (prof); gst_encoding_profile_unref (prof);
} else { } else {
ges_timeline_pipeline_set_mode (pipeline, TIMELINE_MODE_PREVIEW); ges_timeline_pipeline_set_mode (pipeline, TIMELINE_MODE_PREVIEW);
} }