mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
ges: Switch to encoding-profile API from base
Remove dependency on gst-convenience.
This commit is contained in:
parent
7fc7bfb110
commit
4c63aa21f2
10 changed files with 65 additions and 64 deletions
10
configure.ac
10
configure.ac
|
@ -51,7 +51,7 @@ AM_PROG_LIBTOOL
|
|||
|
||||
dnl *** required versions of GStreamer stuff ***
|
||||
GST_REQ=0.10.30.4
|
||||
GSTPB_REQ=0.10.30.4
|
||||
GSTPB_REQ=0.10.31.1
|
||||
|
||||
dnl *** autotools stuff ****
|
||||
|
||||
|
@ -156,14 +156,6 @@ GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable
|
|||
AC_SUBST(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
|
||||
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
|
||||
|
|
|
@ -84,8 +84,8 @@ libges_@GST_MAJORMINOR@include_HEADERS = \
|
|||
ges-keyfile-formatter.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_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_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_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)
|
||||
|
||||
DISTCLEANFILE = $(CLEANFILES)
|
||||
|
|
|
@ -95,7 +95,7 @@ ges_timeline_pipeline_dispose (GObject * object)
|
|||
}
|
||||
|
||||
if (self->priv->profile) {
|
||||
gst_encoding_profile_free (self->priv->profile);
|
||||
gst_encoding_profile_unref (self->priv->profile);
|
||||
self->priv->profile = NULL;
|
||||
}
|
||||
|
||||
|
@ -165,10 +165,9 @@ ges_timeline_pipeline_new (void)
|
|||
return g_object_new (GES_TYPE_TIMELINE_PIPELINE, NULL);
|
||||
}
|
||||
|
||||
#define TRACK_COMPATIBLE_PROFILE(tracktype, proftype) \
|
||||
(((proftype) == GST_ENCODING_PROFILE_AUDIO && (tracktype) == GES_TRACK_TYPE_AUDIO) || \
|
||||
((proftype) == GST_ENCODING_PROFILE_VIDEO && (tracktype) == GES_TRACK_TYPE_VIDEO) || \
|
||||
((proftype) == GST_ENCODING_PROFILE_TEXT && (tracktype) == GES_TRACK_TYPE_TEXT))
|
||||
#define TRACK_COMPATIBLE_PROFILE(tracktype, profile) \
|
||||
( (GST_IS_ENCODING_AUDIO_PROFILE (profile) && (tracktype) == GES_TRACK_TYPE_AUDIO) || \
|
||||
(GST_IS_ENCODING_VIDEO_PROFILE (profile) && (tracktype) == GES_TRACK_TYPE_VIDEO))
|
||||
|
||||
static gboolean
|
||||
ges_timeline_pipeline_update_caps (GESTimelinePipeline * self)
|
||||
|
@ -186,19 +185,22 @@ ges_timeline_pipeline_update_caps (GESTimelinePipeline * self)
|
|||
* track to set the caps on */
|
||||
for (ltrack = tracks; ltrack; ltrack = ltrack->next) {
|
||||
GESTrack *track = (GESTrack *) ltrack->data;
|
||||
GList *allstreams;
|
||||
|
||||
allstreams = (GList *)
|
||||
gst_encoding_container_profile_get_profiles (
|
||||
(GstEncodingContainerProfile *) self->priv->profile);
|
||||
|
||||
/* Find a matching stream setting */
|
||||
for (lstream = self->priv->profile->encodingprofiles; lstream;
|
||||
lstream = lstream->next) {
|
||||
GstStreamEncodingProfile *prof =
|
||||
(GstStreamEncodingProfile *) lstream->data;
|
||||
for (lstream = allstreams; lstream; lstream = lstream->next) {
|
||||
GstEncodingProfile *prof = (GstEncodingProfile *) 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) {
|
||||
GstCaps *ocaps, *rcaps;
|
||||
|
||||
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)
|
||||
rcaps = gst_caps_from_string ("audio/x-raw-int;audio/x-raw-float");
|
||||
else
|
||||
|
@ -251,8 +253,8 @@ ges_timeline_pipeline_change_state (GstElement * element,
|
|||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
if (self->priv->
|
||||
mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
|
||||
if (self->
|
||||
priv->mode & (TIMELINE_MODE_RENDER | TIMELINE_MODE_SMART_RENDER))
|
||||
GST_DEBUG ("rendering => Updating pipeline caps");
|
||||
if (!ges_timeline_pipeline_update_caps (self)) {
|
||||
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)
|
||||
gst_encoding_profile_free (pipeline->priv->profile);
|
||||
gst_encoding_profile_unref (pipeline->priv->profile);
|
||||
g_object_set (pipeline->priv->encodebin, "use-smartencoder",
|
||||
!(!(pipeline->priv->mode & TIMELINE_MODE_SMART_RENDER)), 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;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <glib-object.h>
|
||||
#include <ges/ges.h>
|
||||
#include <gst/profile/gstprofile.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
@ -17,5 +17,5 @@ noinst_PROGRAMS = \
|
|||
text_properties \
|
||||
$(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)
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
*/
|
||||
|
||||
#include <ges/ges.h>
|
||||
#include <gst/profile/gstprofile.h>
|
||||
#include <gst/pbutils/gstdiscoverer.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
|
||||
GstDiscovererInfo *get_info_for_file (GstDiscoverer * disco, gchar * filename);
|
||||
|
||||
|
@ -51,15 +51,15 @@ get_info_for_file (GstDiscoverer * disco, gchar * filename)
|
|||
static GstEncodingProfile *
|
||||
make_profile_from_info (GstDiscovererInfo * info)
|
||||
{
|
||||
GstEncodingProfile *profile = NULL;
|
||||
GstEncodingContainerProfile *profile = NULL;
|
||||
GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info);
|
||||
|
||||
/* Get the container format */
|
||||
if (GST_IS_DISCOVERER_CONTAINER_INFO (sinfo)) {
|
||||
GList *tmp, *substreams;
|
||||
|
||||
profile = gst_encoding_profile_new ((gchar *) "concatenate",
|
||||
gst_discoverer_stream_info_get_caps (sinfo), NULL, FALSE);
|
||||
profile = gst_encoding_container_profile_new ((gchar *) "concatenate", NULL,
|
||||
gst_discoverer_stream_info_get_caps (sinfo), NULL);
|
||||
|
||||
substreams =
|
||||
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 (tmp = substreams; tmp; tmp = tmp->next) {
|
||||
GstDiscovererStreamInfo *stream = GST_DISCOVERER_STREAM_INFO (tmp->data);
|
||||
GstStreamEncodingProfile *sprof;
|
||||
GstEncodingProfile *sprof;
|
||||
|
||||
sprof =
|
||||
gst_stream_encoding_profile_new (GST_IS_DISCOVERER_VIDEO_INFO (stream)
|
||||
? GST_ENCODING_PROFILE_VIDEO : GST_ENCODING_PROFILE_AUDIO,
|
||||
gst_discoverer_stream_info_get_caps (stream), NULL, NULL, 1);
|
||||
gst_encoding_profile_add_stream (profile, sprof);
|
||||
if (GST_IS_DISCOVERER_VIDEO_INFO (stream)) {
|
||||
sprof = (GstEncodingProfile *)
|
||||
gst_encoding_video_profile_new (gst_discoverer_stream_info_get_caps
|
||||
(stream), NULL, NULL, 1);
|
||||
} 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)
|
||||
gst_discoverer_stream_info_list_free (substreams);
|
||||
|
@ -85,7 +92,7 @@ make_profile_from_info (GstDiscovererInfo * info)
|
|||
if (sinfo)
|
||||
gst_discoverer_stream_info_unref (sinfo);
|
||||
|
||||
return profile;
|
||||
return (GstEncodingProfile *) profile;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <ges/ges.h>
|
||||
#include <gst/profile/gstprofile.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
|
||||
GstEncodingProfile *make_ogg_vorbis_profile (void);
|
||||
|
||||
|
@ -32,15 +32,14 @@ GstEncodingProfile *make_ogg_vorbis_profile (void);
|
|||
GstEncodingProfile *
|
||||
make_ogg_vorbis_profile (void)
|
||||
{
|
||||
GstEncodingProfile *profile;
|
||||
GstStreamEncodingProfile *audiostream;
|
||||
GstEncodingContainerProfile *profile;
|
||||
|
||||
profile = gst_encoding_profile_new ((gchar *) "ges-test4",
|
||||
gst_caps_new_simple ("application/ogg", NULL), NULL, FALSE);
|
||||
audiostream = gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_AUDIO,
|
||||
gst_caps_new_simple ("audio/x-vorbis", NULL), NULL, NULL, 1);
|
||||
gst_encoding_profile_add_stream (profile, audiostream);
|
||||
return profile;
|
||||
profile = gst_encoding_container_profile_new ((gchar *) "ges-test4", NULL,
|
||||
gst_caps_new_simple ("application/ogg", NULL), NULL);
|
||||
gst_encoding_container_profile_add_profile (profile, (GstEncodingProfile *)
|
||||
gst_encoding_audio_profile_new (gst_caps_new_simple ("audio/x-vorbis",
|
||||
NULL), NULL, NULL, 1));
|
||||
return (GstEncodingProfile *) profile;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <ges/ges.h>
|
||||
#include <gst/profile/gstprofile.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
#include <regex.h>
|
||||
|
||||
/* GLOBAL VARIABLE */
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
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)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <string.h>
|
||||
#include <glib.h>
|
||||
#include <ges/ges.h>
|
||||
#include <gst/profile/gstprofile.h>
|
||||
#include <gst/pbutils/encoding-profile.h>
|
||||
#include <regex.h>
|
||||
|
||||
/* GLOBAL VARIABLE */
|
||||
|
@ -165,29 +165,29 @@ static GstEncodingProfile *
|
|||
make_encoding_profile (gchar * audio, gchar * video, gchar * video_restriction,
|
||||
gchar * container)
|
||||
{
|
||||
GstEncodingProfile *profile;
|
||||
GstStreamEncodingProfile *stream;
|
||||
GstEncodingContainerProfile *profile;
|
||||
GstEncodingProfile *stream;
|
||||
GstCaps *caps;
|
||||
|
||||
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);
|
||||
|
||||
caps = gst_caps_from_string (audio);
|
||||
stream =
|
||||
gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_AUDIO,
|
||||
caps, NULL, NULL, 0);
|
||||
gst_encoding_profile_add_stream (profile, stream);
|
||||
stream = (GstEncodingProfile *)
|
||||
gst_encoding_audio_profile_new (caps, NULL, NULL, 0);
|
||||
gst_encoding_container_profile_add_profile (profile, stream);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
caps = gst_caps_from_string (video);
|
||||
stream = gst_stream_encoding_profile_new (GST_ENCODING_PROFILE_VIDEO,
|
||||
gst_caps_from_string (video),
|
||||
NULL, gst_caps_from_string (video_restriction), 0);
|
||||
gst_encoding_profile_add_stream (profile, stream);
|
||||
stream = (GstEncodingProfile *)
|
||||
gst_encoding_video_profile_new (caps, NULL, NULL, 0);
|
||||
gst_encoding_container_profile_add_profile (profile, stream);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
return profile;
|
||||
return (GstEncodingProfile *) profile;
|
||||
}
|
||||
|
||||
static GESTimeline *
|
||||
|
@ -544,7 +544,7 @@ main (int argc, gchar ** argv)
|
|||
exit (1);
|
||||
|
||||
g_free (outputuri);
|
||||
gst_encoding_profile_free (prof);
|
||||
gst_encoding_profile_unref (prof);
|
||||
} else {
|
||||
ges_timeline_pipeline_set_mode (pipeline, TIMELINE_MODE_PREVIEW);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue