Commit 0dca7a1f authored by Marcin Kolny's avatar Marcin Kolny

plugins: add deprecated ifdef to configuration file

parent 3440f119
......@@ -207,6 +207,10 @@ MM_ARG_ENABLE_WARNINGS([GSTREAMERMM_WXXFLAGS],
[-Wall], [-Wall -Wextra],
[G GSTREAMER])
# Offer the ability to omit some API from the library,
# to reduce the code size:
MM_ARG_DISABLE_DEPRECATED_API([GSTREAMERMM])
AC_CONFIG_FILES([Makefile
tools/Makefile
gstreamer/${GSTREAMERMM_MODULE_NAME}.pc:gstreamer/gstreamermm.pc.in
......@@ -235,7 +239,9 @@ ${PACKAGE}-${VERSION}
gstreamer-plugins-bad: ${gstmm_enable_plugins_bad} ${gstmm_plugins_bad_version}
gstreamer-gl: ${gstmm_enable_gl}
Extra features
Use deprecated API: ${mm_enable_deprecated_api}
GUI Examples: ${gstmm_enable_gui_examples}
Unit Tests: ${enable_unittests}
......
......@@ -18,7 +18,13 @@ class AllMediaPlayer
private:
RefPtr<Glib::MainLoop> main_loop;
RefPtr<Pipeline> pipeline;
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
RefPtr<FileSrc> source;
#else
RefPtr<Gst::Element> source;
#endif
RefPtr<Element> decoder;
bool on_bus_message(const RefPtr<Bus>&, const RefPtr<Message>& message);
......@@ -26,7 +32,12 @@ private:
void init()
{
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
source = FileSrc::create();
#else
source = ElementFactory::create_element("filesrc");
#endif
decoder = ElementFactory::create_element("decodebin");
if (!decoder || !source)
......@@ -51,7 +62,13 @@ public:
void play_until_eos(const std::string& filename)
{
init();
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
source->property_location() = filename;
#else
source->set_property("location", filename);
#endif
pipeline->set_state(STATE_PLAYING);
main_loop->run();
pipeline->set_state(STATE_NULL);
......
......@@ -68,8 +68,15 @@ int main(int argc, char** argv)
RefPtr<Bus> bus = pipeline->get_bus();
bus->add_watch(sigc::ptr_fun(&on_bus_message));
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
RefPtr<FileSrc> video_source = FileSrc::create(),
audio_source = FileSrc::create();
RefPtr<FileSink> filesink = FileSink::create();
#else
RefPtr<Element> video_source = ElementFactory::create_element("filesrc"),
audio_source = ElementFactory::create_element("filesrc"),
filesink = ElementFactory::create_element("filesink");
#endif
RefPtr<Element> ogg_demuxer = ElementFactory::create_element("oggdemux");
audio_parser = ElementFactory::create_element("mad");
......@@ -78,7 +85,7 @@ int main(int argc, char** argv)
videosink = ElementFactory::create_element("autovideosink");
RefPtr<Element> muxer = ElementFactory::create_element("matroskamux");
RefPtr<FileSink> filesink = FileSink::create();
video_parser = ElementFactory::create_element("theoraparse");
......@@ -88,10 +95,16 @@ int main(int argc, char** argv)
return 1;
}
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
video_source->property_location() = argv[1];
audio_source->property_location() = argv[2];
filesink->property_location() = argv[3];
#else
video_source->set_property<Glib::ustring>("location", argv[1]);
audio_source->set_property<Glib::ustring>("location", argv[2]);
filesink->set_property<Glib::ustring>("location", argv[3]);
#endif
pipeline->add(video_source)->
add(ogg_demuxer)->
add(video_parser)->
......
......@@ -75,9 +75,13 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
// Create a playbin2 element.
// Create a playbin element.
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::PlayBin> playbin = Gst::PlayBin::create();
#else
Glib::RefPtr<Gst::Element> playbin = Gst::ElementFactory::create_element("playbin");
#endif
if(!playbin)
{
std::cerr << "The playbin2 element could not be created." << std::endl;
......@@ -93,7 +97,7 @@ int main(int argc, char** argv)
uri = Glib::filename_to_uri(argv[1]);
// Set the playbyin2's uri property.
playbin->property_uri() = uri;
playbin->set_property("uri", uri);
// Create the main loop.
mainloop = Glib::MainLoop::create();
......
......@@ -19,7 +19,7 @@
#include "player_window.h"
#include <gtkmm.h>
#include <gstreamermm/init.h>
#include <gstreamermm.h>
#include <iostream>
......@@ -30,7 +30,11 @@ int main (int argc, char **argv)
// playbin plays any media type, choosing an appropriate set of elements
// and linking them together.
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::PlayBin> playbin = Gst::PlayBin::create("playbin");
#else
Glib::RefPtr<Gst::Element> playbin = Gst::ElementFactory::create_element("playbin");
#endif
if(!playbin)
{
......
......@@ -18,7 +18,6 @@
#include "player_window.h"
#include <gstreamermm.h>
#include <gstreamermm/xvimagesink.h>
#if defined (GDK_WINDOWING_X11)
......@@ -30,7 +29,19 @@
#include <iostream>
#include <iomanip>
PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin)
#ifdef GSTREAMERMM_DISABLE_DEPRECATED
static const Glib::SignalProxyInfo PlayBin_signal_video_changed_info =
{
"video-changed",
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};
#endif
PlayerWindow::PlayerWindow(const Glib::RefPtr<PlayBinT>& playbin)
: m_vbox(false, 6),
m_progress_label("000:00:00.000000000 / 000:00:00.000000000"),
m_play_button("Play"),
......@@ -102,10 +113,17 @@ PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin)
m_forward_button.set_sensitive(false);
m_playbin = playbin;
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
m_playbin->property_video_sink() = Gst::XvImageSink::create();
m_playbin->signal_video_changed().connect(
sigc::mem_fun(*this, &PlayerWindow::on_video_changed) );
#else
m_playbin->set_property("video-sink", Gst::ElementFactory::create_element("xvimagesink"));
Glib::SignalProxy< void >(m_playbin.operator->(), &PlayBin_signal_video_changed_info).connect(
sigc::mem_fun(*this, &PlayerWindow::on_video_changed) );
#endif
show_all_children();
m_pause_button.hide();
}
......@@ -206,7 +224,14 @@ bool PlayerWindow::on_bus_message(const Glib::RefPtr<Gst::Bus>& /* bus */,
void PlayerWindow::on_video_changed()
{
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::Pad> pad = m_playbin->get_video_pad(0);
#else
GstPad* result;
g_signal_emit_by_name(m_playbin->gobj(), "get-video-pad", 0, &result, static_cast<void*>(0));
Glib::RefPtr<Gst::Pad> pad = Glib::wrap(result);
#endif
if(pad)
{
// Add a buffer probe to the video sink pad which will be removed after
......@@ -384,7 +409,7 @@ void PlayerWindow::on_button_open()
working_dir = chooser.get_current_folder();
// Set uri property on the playbin.
m_playbin->property_uri() = chooser.get_uri();
m_playbin->set_property("uri", chooser.get_uri());
// Resize m_video_area and window to minimum when opening a file
m_video_area.set_size_request(0, 0);
......
......@@ -20,12 +20,17 @@
#define PLAYER_WINDOW_H_
#include <gtkmm.h>
#include <gstreamermm/playbin.h>
#include <gstreamermm.h>
class PlayerWindow : public Gtk::Window
{
public:
PlayerWindow(const Glib::RefPtr<Gst::PlayBin>& playbin);
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
using PlayBinT = Gst::PlayBin;
#else
using PlayBinT = Gst::Element;
#endif
PlayerWindow(const Glib::RefPtr<PlayBinT>& playbin);
virtual ~PlayerWindow();
protected:
......@@ -61,7 +66,12 @@ protected:
Gtk::Button m_forward_button;
Gtk::Button m_open_button;
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::PlayBin> m_playbin;
#else
Glib::RefPtr<Gst::Element> m_playbin;
#endif
sigc::connection m_timeout_connection;
guint m_watch_id;
gint64 m_duration;
......
......@@ -19,6 +19,7 @@
#include <gtkmm/main.h>
#include <gstreamermm/init.h>
#include <gstreamermm/element.h>
#include <gstreamermm/elementfactory.h>
#include <gstreamermm/pad.h>
#include <gstreamermm/pipeline.h>
......@@ -33,7 +34,12 @@
#include "player_window.h"
Glib::RefPtr<Gst::Pipeline> pipeline;
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::VorbisDec> decoder;
#else
Glib::RefPtr<Gst::Element> decoder;
#endif
void on_parser_pad_added(const Glib::RefPtr<Gst::Pad>& newPad)
{
......@@ -58,7 +64,11 @@ int main(int argc, char** argv)
// Create the elements
// Reads file from disk
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::FileSrc> source = Gst::FileSrc::create();
#else
Glib::RefPtr<Gst::Element> source = Gst::ElementFactory::create_element("filesrc");
#endif
if(!source)
{
std::cerr << "filesrc element could not be created" << std::endl;
......@@ -67,7 +77,11 @@ int main(int argc, char** argv)
// Parses the ogg streams into elementary streams (note that an ogg file may
// contain a video stream too)
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::OggDemux> parser = Gst::OggDemux::create();
#else
Glib::RefPtr<Gst::Element> parser = Gst::ElementFactory::create_element("oggdemux");
#endif
if(!parser)
{
std::cerr << "oggdemux element could not be created" << std::endl;
......@@ -75,7 +89,12 @@ int main(int argc, char** argv)
}
// Decodes a vorbis stream
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
decoder = Gst::VorbisDec::create();
#else
decoder = Gst::ElementFactory::create_element("vorbisdec");
#endif
if(!decoder)
{
std::cerr << "vorbisdec element could not be created" << std::endl;
......@@ -83,7 +102,12 @@ int main(int argc, char** argv)
}
// Converts audio to a format which can be used by the next element
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::AudioConvert> conv = Gst::AudioConvert::create();
#else
Glib::RefPtr<Gst::Element> conv = Gst::ElementFactory::create_element("audioconvert");
#endif
if(!conv)
{
std::cerr << "audioconvert element could not be created" << std::endl;
......@@ -91,7 +115,11 @@ int main(int argc, char** argv)
}
// Outputs sound to an ALSA audio device
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::AlsaSink> sink = Gst::AlsaSink::create();
#else
Glib::RefPtr<Gst::Element> sink = Gst::ElementFactory::create_element("alsasink");
#endif
if(!sink)
{
std::cerr << "sink element could not be created" << std::endl;
......
......@@ -30,7 +30,7 @@
#include <iomanip>
#include "player_window.h"
PlayerWindow::PlayerWindow(const Glib::RefPtr<Gst::FileSrc>& source_element,
PlayerWindow::PlayerWindow(const Glib::RefPtr<FileSrcT>& source_element,
const Glib::RefPtr<Gst::Pipeline>& main_pipeline)
: m_vbox(false, 5),
m_progress_label("000:00:00.000000000 / 000:00:00.000000000"),
......@@ -290,7 +290,7 @@ void PlayerWindow::on_button_open()
// Set uri on the file source.
const std::string uri = chooser.get_uri();
m_source_element->set_uri(uri);
m_source_element->set_property("uri", uri);
set_title(uri);
m_play_button.set_sensitive();
......
......@@ -25,6 +25,7 @@
#include <gtkmm/label.h>
#include <gtkmm/button.h>
#include <gtkmm/scale.h>
#include <gstreamermmconfig.h>
#include <gstreamermm/element.h>
#include <gstreamermm/pipeline.h>
#include <gstreamermm/filesrc.h>
......@@ -32,7 +33,12 @@
class PlayerWindow : public Gtk::Window
{
public:
PlayerWindow(const Glib::RefPtr<Gst::FileSrc>& sourceElement,
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
using FileSrcT = Gst::FileSrc;
#else
using FileSrcT = Gst::Element;
#endif
PlayerWindow(const Glib::RefPtr<FileSrcT>& sourceElement,
const Glib::RefPtr<Gst::Pipeline>& mainPipeline);
virtual ~PlayerWindow();
......@@ -65,7 +71,7 @@ protected:
Gtk::Button m_forward_button;
Gtk::Button m_open_button;
Glib::RefPtr<Gst::FileSrc> m_source_element;
Glib::RefPtr<FileSrcT> m_source_element;
Glib::RefPtr<Gst::Pipeline> m_main_pipeline;
sigc::connection m_progress_connection;
unsigned int m_watch_id;
......
......@@ -37,20 +37,30 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::FileSrc> filesrc = Gst::FileSrc::create();
Glib::RefPtr<Gst::FileSink> filesink = Gst::FileSink::create();
#else
Glib::RefPtr<Gst::Element> filesrc = Gst::ElementFactory::create_element("filesrc");
Glib::RefPtr<Gst::Element> filesink = Gst::ElementFactory::create_element("filesink");
#endif
if(!filesrc)
if(!filesrc || !filesink)
{
std::cerr << "The FileSrc element could not be created." << std::endl;
std::cerr << "The FileSrc or FileSink element could not be created." << std::endl;
return EXIT_FAILURE;
}
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
filesrc->property_location() = argv[1];
filesink->property_location() = argv[2];
#else
filesrc->set_property<Glib::ustring>("location", argv[1]);
filesink->set_property<Glib::ustring>("location", argv[2]);
#endif
mainloop = Glib::MainLoop::create();
pipeline = Gst::Pipeline::create("rewriter");
Glib::RefPtr<Gst::FileSink> filesink = Gst::FileSink::create();
filesink->property_location() = argv[2];
Glib::RefPtr<Gst::Bus> bus = pipeline->get_bus();
bus->add_watch(sigc::ptr_fun(&on_bus_message));
......
......@@ -18,6 +18,7 @@
#include <gstreamermm.h>
#include <glibmm/main.h>
#include <glibmm/exceptionhandler.h>
#include <iostream>
Glib::RefPtr<Glib::MainLoop> mainloop;
......@@ -63,6 +64,38 @@ static void on_typefind_have_type(guint probability, const Glib::RefPtr<Gst::Cap
std::cerr << "on_typefind_have_type(): mainloop is null" << std::endl;
}
#ifdef GSTREAMERMM_DISABLE_DEPRECATED
#include <gst/gsttypefind.h>
static void TypeFindElement_signal_have_type_callback(struct _GstTypeFindElement* self, guint p0,GstCaps* p1,void* data)
{
using SlotType = sigc::slot< void,guint,const Glib::RefPtr<Gst::Caps>& >;
auto obj = dynamic_cast<Gst::Element*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
if(obj)
{
try
{
if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
(*static_cast<SlotType*>(slot))(p0, Glib::wrap(p1, true));
}
catch(...)
{
Glib::exception_handlers_invoke();
}
}
}
static const Glib::SignalProxyInfo TypeFindElement_signal_have_type_info =
{
"have-type",
(GCallback) &TypeFindElement_signal_have_type_callback,
(GCallback) &TypeFindElement_signal_have_type_callback
};
#endif
int main(int argc, char** argv)
{
// Initialize Gstreamermm:
......@@ -81,18 +114,28 @@ int main(int argc, char** argv)
Glib::RefPtr<Gst::Pipeline> pipeline = Gst::Pipeline::create("my-pipeline");
// Create elements:
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
Glib::RefPtr<Gst::FileSrc> element_source = Gst::FileSrc::create();
element_source->property_location() = filename;
Glib::RefPtr<Gst::FakeSink> element_sink = Gst::FakeSink::create();
Glib::RefPtr<Gst::TypeFindElement> element_typefind = Gst::TypeFindElement::create();
element_typefind->signal_have_type().connect(
sigc::ptr_fun(&on_typefind_have_type) );
#else
Glib::RefPtr<Gst::Element> element_source = Gst::ElementFactory::create_element("filesrc");
element_source->set_property("location", filename);
Glib::RefPtr<Gst::Element> element_sink = Gst::ElementFactory::create_element("fakesink");
Glib::RefPtr<Gst::Element> element_typefind = Gst::ElementFactory::create_element("typefind");
Glib::SignalProxy< void,guint,const Glib::RefPtr<Gst::Caps>& > proxy(element_typefind.operator->(), &TypeFindElement_signal_have_type_info);
proxy.connect(sigc::ptr_fun(&on_typefind_have_type));
#endif
//If using an MP3 file, this should provide more Caps information from typefind.
//Glib::RefPtr<Gst::Element> element_id3demux = Gst::ElementFactory::create_element("id3demux");
//g_assert(element_id3demux);
Glib::RefPtr<Gst::TypeFindElement> element_typefind = Gst::TypeFindElement::create();
element_typefind->signal_have_type().connect(
sigc::ptr_fun(&on_typefind_have_type) );
Glib::RefPtr<Gst::Element> element_sink = Gst::FakeSink::create();
// We must add the elements to the pipeline before linking them:
try
{
......
......@@ -58,6 +58,8 @@
* @endcode
*/
#include <gstreamermmconfig.h>
#include <gstreamermm/check.h>
#include <gstreamermm/init.h>
#include <gstreamermm/version.h>
......
......@@ -5,6 +5,9 @@
#include "glibmmconfig.h"
/* Define to omit deprecated API from the library. */
#undef GSTREAMERMM_DISABLE_DEPRECATED
/* Major version of gstreamermm */
#undef GSTREAMERMM_MAJOR_VERSION
......
......@@ -10,8 +10,6 @@
#include <gstreamermm.h>
#include <gstreamermm/private/bin_p.h>
#include <gstreamermm/filesrc.h>
#include <gstreamermm/filesink.h>
#include <cstdio>
#include <sys/stat.h>
......@@ -50,10 +48,10 @@ public:
{
if (transition == Gst::STATE_CHANGE_NULL_TO_READY)
{
Glib::RefPtr<Gst::FileSrc> source_file = Gst::FileSrc::create("source-file");
Glib::RefPtr<Gst::Element> source_file = Gst::ElementFactory::create_element("filesrc", "source-file");
Glib::RefPtr<Gst::Element> png_decoder = Gst::ElementFactory::create_element("pngdec");
Glib::ustring str = "resources/input-image.png";
source_file->property_location() = location.get_value();
source_file->set_property("location", location.get_value());
add(source_file);
add(png_decoder);
......
......@@ -7,8 +7,6 @@
#include "mmtest.h"
#include <gstreamermm.h>
#include <gstreamermm/filesrc.h>
#include <gstreamermm/filesink.h>
#include <glibmm/main.h>
using namespace Gst;
......@@ -17,14 +15,14 @@ using Glib::RefPtr;
class CustomBin : public Bin
{
private:
RefPtr<FileSrc> source_file;
RefPtr<Element> source_file;
RefPtr<Element> queue;
RefPtr<GhostPad> src_pad;
protected:
explicit CustomBin(const Glib::ustring& name)
: Bin(name)
{
source_file = FileSrc::create("source-file");
source_file = ElementFactory::create_element("filesrc", "source-file");
queue = ElementFactory::create_element("queue");
add(source_file);
......@@ -44,7 +42,7 @@ public:
void set_location(const Glib::ustring& filename)
{
source_file->property_location() = filename;
source_file->set_property("location", filename);
}
};
......@@ -69,8 +67,8 @@ bool on_bus_message(const RefPtr<Bus>&, const Glib::RefPtr<Message>& message)
TEST(IntegrationBinInPipelineTest, CustomBinShouldCorrectPassThroughImage)
{
Glib::ustring input_png = "resources/input-image.png",
output_jpg = "resources/test-integration-bininpipeline-output-image.jpg";
Glib::ustring input_png = "/home/loganek/repos/gstreamermm/tests/resources/input-image.png",
output_jpg = "test-integration-bininpipeline-output-image.jpg";
mainloop = Glib::MainLoop::create();
MM_ASSERT_TRUE(mainloop);
......@@ -78,7 +76,7 @@ TEST(IntegrationBinInPipelineTest, CustomBinShouldCorrectPassThroughImage)
MM_ASSERT_TRUE(custom_bin);
RefPtr<Element> queue = ElementFactory::create_element("queue");
MM_ASSERT_TRUE(queue);
RefPtr<FileSink> file_sink = FileSink::create("file-sink");
RefPtr<Element> file_sink = ElementFactory::create_element("filesink", "file-sink");
MM_ASSERT_TRUE(file_sink);
RefPtr<Pipeline> pipeline = Pipeline::create("image-converter-pipeline");
MM_ASSERT_TRUE(custom_bin);
......@@ -92,9 +90,10 @@ TEST(IntegrationBinInPipelineTest, CustomBinShouldCorrectPassThroughImage)
custom_bin->set_location(input_png);
file_sink->property_location() = output_jpg;
file_sink->set_property("location", output_jpg);
pipeline->set_state(STATE_PLAYING);
mainloop->run();
pipeline->set_state(Gst::STATE_NULL);
......
......@@ -48,7 +48,7 @@ TEST(IntegrationBinPluginTest, DISABLED_ShouldDecodeAndEncodeFile)
MM_ASSERT_TRUE(pluginbin);
RefPtr<Element> jpg_encoder = ElementFactory::create_element("queue");
MM_ASSERT_TRUE(jpg_encoder);
RefPtr<FileSink> file_sink = FileSink::create("file-sink");
RefPtr<Element> file_sink = ElementFactory::create_element("filesink", "file-sink");
MM_ASSERT_TRUE(file_sink);
RefPtr<Pipeline> pipeline = Pipeline::create("image-converter-pipeline");
MM_ASSERT_TRUE(pipeline);
......@@ -61,7 +61,7 @@ TEST(IntegrationBinPluginTest, DISABLED_ShouldDecodeAndEncodeFile)
bus->add_watch(sigc::ptr_fun(&on_bus_message));
pluginbin->set_property("location", input_png);
file_sink->property_location() = output_jpg;
file_sink->set_property("location", output_jpg);
pipeline->set_state(STATE_PLAYING);
mainloop->run();
......
......@@ -41,17 +41,17 @@ TEST(IntegrationRewriteFileTest, CreateAndRewriteFile)
GenerateSampleOggFile(20, input_filename);
Glib::RefPtr<Gst::Pipeline> pipeline;
RefPtr<FileSrc> filesrc = Gst::FileSrc::create();
RefPtr<Element> filesrc = Gst::ElementFactory::create_element("filesrc");
MM_ASSERT_TRUE(filesrc);
filesrc->property_location() = input_filename;
filesrc->set_property("location", input_filename);
mainloop = Glib::MainLoop::create();
pipeline = Gst::Pipeline::create("rewriter");
Glib::RefPtr<Gst::FileSink> filesink = Gst::FileSink::create();
Glib::RefPtr<Gst::Element> filesink = Gst::ElementFactory::create_element("filesink");
MM_ASSERT_TRUE(filesink);
filesink->property_location() = output_filename;
filesink->set_property("location", output_filename);
Glib::RefPtr<Gst::Bus> bus = pipeline->get_bus();
bus->add_watch(sigc::ptr_fun(&on_bus_message));
......
......@@ -7,7 +7,6 @@
#include "mmtest.h"
#include <gstreamermm.h>
#include <gstreamermm/fakesink.h>
#include <glibmm/main.h>
#include "utils.h"
......@@ -63,10 +62,10 @@ TEST(IntegrationVideodurationTest, CreateVideoAndCheckDuration)
GenerateSampleOggFile(10, input_filename);
RefPtr<FileSrc> filesrc = Gst::FileSrc::create();
RefPtr<Element> filesrc = Gst::ElementFactory::create_element("filesrc");
MM_ASSERT_TRUE(filesrc);
filesrc->property_location() = input_filename;
filesrc->set_property("location", input_filename);
mainloop = Glib::MainLoop::create();
pipeline = Pipeline::create("rewriter");
......
......@@ -37,10 +37,10 @@ bool utils_on_bus_message(const RefPtr<Bus>&, const Glib::RefPtr<Message>& messa
void GenerateSampleOggFile(int num_buffers, const Glib::ustring& filename)
{
RefPtr<Pipeline> pipeline = Pipeline::create("create-ogg");
RefPtr<VideoTestSrc> source = VideoTestSrc::create("testsource");
RefPtr<Element> source = ElementFactory::create_element("videotestsrc", "testsource");
RefPtr<Element> encoder = ElementFactory::create_element("theoraenc"),
muxer = ElementFactory::create_element("oggmux");
RefPtr<FileSink> sink = FileSink::create("fsink");
RefPtr<Element> sink = ElementFactory::create_element("filesink", "fsink");
//RefPtr<Element> sink = ElementFactory::create_element("xvimagesink");
Glib::RefPtr<Gst::Bus> bus = pipeline->get_bus();
......@@ -50,8 +50,8 @@ void GenerateSampleOggFile(int num_buffers, const Glib::ustring& filename)
pipeline->add(source)->add(encoder)->add(muxer)->add(sink);
source->property_num_buffers() = num_buffers;
sink->property_location() = filename;
source->set_property("num_buffers", num_buffers);
sink->set_property("location", filename);
muxer->link(sink);
source->link(encoder);
......
......@@ -7,6 +7,9 @@
#include "mmtest.h"
#include <gstreamermm.h>
#ifndef GSTREAMERMM_DISABLE_DEPRECATED
#include <gstreamermm/appsink.h>
#include <gstreamermm/appsrc.h>
......@@ -120,3 +123,5 @@ TEST_F(AppSinkPluginTest, UseAppSinkDuringDataFlowInPipeline)
EXPECT_EQ(MESSAGE_EOS, msg->get_message_type());
EXPECT_EQ(STATE_CHANGE_SUCCESS, pipeline->set_state(STATE_NULL));
}
#endif
......@@ -7,6 +7,9 @@
#include "mmtest.h"
#include <gstreamermm.h>