mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-01 11:56:45 +01:00
Remove use of deprecated gstreamer functions.
This commit is contained in:
parent
d34e3b5404
commit
90803fa0e0
@ -481,7 +481,7 @@ SongLoader::Result SongLoader::LoadRemote() {
|
||||
gst_bus_add_watch(bus, BusCallback, this);
|
||||
|
||||
// Add a probe to the sink so we can capture the data if it's a playlist
|
||||
GstPad* pad = gst_element_get_pad(fakesink, "sink");
|
||||
GstPad* pad = gst_element_get_static_pad(fakesink, "sink");
|
||||
gst_pad_add_buffer_probe(pad, G_CALLBACK(DataReady), this);
|
||||
gst_object_unref(pad);
|
||||
|
||||
|
@ -279,20 +279,20 @@ bool GstEnginePipeline::Init() {
|
||||
|
||||
// Create a pad on the outside of the audiobin and connect it to the pad of
|
||||
// the first element.
|
||||
GstPad* pad = gst_element_get_pad(queue_, "sink");
|
||||
GstPad* pad = gst_element_get_static_pad(queue_, "sink");
|
||||
gst_element_add_pad(audiobin_, gst_ghost_pad_new("sink", pad));
|
||||
gst_object_unref(pad);
|
||||
|
||||
// Add a data probe on the src pad of the audioconvert element for our scope.
|
||||
// We do it here because we want pre-equalized and pre-volume samples
|
||||
// so that our visualization are not be affected by them.
|
||||
pad = gst_element_get_pad(event_probe, "src");
|
||||
pad = gst_element_get_static_pad(event_probe, "src");
|
||||
gst_pad_add_event_probe(pad, G_CALLBACK(EventHandoffCallback), this);
|
||||
gst_object_unref(pad);
|
||||
|
||||
// Configure the fakesink properly
|
||||
g_object_set(G_OBJECT(probe_sink), "sync", TRUE, NULL);
|
||||
|
||||
|
||||
// Set the equalizer bands
|
||||
g_object_set(G_OBJECT(equalizer_), "num-bands", 10, NULL);
|
||||
|
||||
@ -325,7 +325,7 @@ bool GstEnginePipeline::Init() {
|
||||
}
|
||||
|
||||
gst_element_link(queue_, audioconvert_);
|
||||
|
||||
|
||||
// Create the caps to put in each path in the tee. The scope path gets 16-bit
|
||||
// ints and the audiosink path gets float32.
|
||||
GstCaps* caps16 = gst_caps_new_simple ("audio/x-raw-int",
|
||||
@ -346,8 +346,8 @@ bool GstEnginePipeline::Init() {
|
||||
gst_caps_unref(caps32);
|
||||
|
||||
// Link the outputs of tee to the queues on each path.
|
||||
gst_pad_link(gst_element_get_request_pad(tee, "src%d"), gst_element_get_pad(probe_queue, "sink"));
|
||||
gst_pad_link(gst_element_get_request_pad(tee, "src%d"), gst_element_get_pad(audio_queue, "sink"));
|
||||
gst_pad_link(gst_element_get_request_pad(tee, "src%d"), gst_element_get_static_pad(probe_queue, "sink"));
|
||||
gst_pad_link(gst_element_get_request_pad(tee, "src%d"), gst_element_get_static_pad(audio_queue, "sink"));
|
||||
|
||||
// Link replaygain elements if enabled.
|
||||
if (rg_enabled_) {
|
||||
@ -360,7 +360,7 @@ bool GstEnginePipeline::Init() {
|
||||
audioscale_, convert, audiosink_, NULL);
|
||||
|
||||
// Add probes and handlers.
|
||||
gst_pad_add_buffer_probe(gst_element_get_pad(probe_converter, "src"), G_CALLBACK(HandoffCallback), this);
|
||||
gst_pad_add_buffer_probe(gst_element_get_static_pad(probe_converter, "src"), G_CALLBACK(HandoffCallback), this);
|
||||
gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), BusCallbackSync, this);
|
||||
bus_cb_id_ = gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)), BusCallback, this);
|
||||
|
||||
@ -647,7 +647,7 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage* msg) {
|
||||
|
||||
void GstEnginePipeline::NewPadCallback(GstElement*, GstPad* pad, gpointer self) {
|
||||
GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
GstPad* const audiopad = gst_element_get_pad(instance->audiobin_, "sink");
|
||||
GstPad* const audiopad = gst_element_get_static_pad(instance->audiobin_, "sink");
|
||||
|
||||
if (GST_PAD_IS_LINKED(audiopad)) {
|
||||
qLog(Warning) << instance->id() << "audiopad is already linked, unlinking old pad";
|
||||
|
@ -133,7 +133,8 @@ void MoodbarPipeline::ReportError(GstMessage* msg) {
|
||||
|
||||
void MoodbarPipeline::NewPadCallback(GstElement*, GstPad* pad, gpointer data) {
|
||||
MoodbarPipeline* self = reinterpret_cast<MoodbarPipeline*>(data);
|
||||
GstPad* const audiopad = gst_element_get_pad(self->convert_element_, "sink");
|
||||
GstPad* const audiopad = gst_element_get_static_pad(
|
||||
self->convert_element_, "sink");
|
||||
|
||||
if (GST_PAD_IS_LINKED(audiopad)) {
|
||||
qLog(Warning) << "audiopad is already linked, unlinking old pad";
|
||||
@ -146,7 +147,7 @@ void MoodbarPipeline::NewPadCallback(GstElement*, GstPad* pad, gpointer data) {
|
||||
|
||||
GstFlowReturn MoodbarPipeline::NewBufferCallback(GstAppSink* app_sink, gpointer data) {
|
||||
MoodbarPipeline* self = reinterpret_cast<MoodbarPipeline*>(data);
|
||||
|
||||
|
||||
GstBuffer* buffer = gst_app_sink_pull_buffer(app_sink);
|
||||
self->data_.append(reinterpret_cast<const char*>(buffer->data), buffer->size);
|
||||
gst_buffer_unref(buffer);
|
||||
@ -161,7 +162,7 @@ GstBusSyncReply MoodbarPipeline::BusCallbackSync(GstBus*, GstMessage* msg, gpoin
|
||||
case GST_MESSAGE_EOS:
|
||||
self->Stop(true);
|
||||
break;
|
||||
|
||||
|
||||
case GST_MESSAGE_ERROR:
|
||||
self->ReportError(msg);
|
||||
self->Stop(false);
|
||||
|
@ -163,7 +163,8 @@ QString Chromaprinter::CreateFingerprint() {
|
||||
|
||||
void Chromaprinter::NewPadCallback(GstElement*, GstPad* pad, gboolean, gpointer data) {
|
||||
Chromaprinter* instance = reinterpret_cast<Chromaprinter*>(data);
|
||||
GstPad* const audiopad = gst_element_get_pad(instance->convert_element_, "sink");
|
||||
GstPad* const audiopad = gst_element_get_static_pad(
|
||||
instance->convert_element_, "sink");
|
||||
|
||||
if (GST_PAD_IS_LINKED(audiopad)) {
|
||||
qLog(Warning) << "audiopad is already linked, unlinking old pad";
|
||||
|
@ -340,7 +340,8 @@ Transcoder::StartJobStatus Transcoder::MaybeStartNextJob() {
|
||||
|
||||
void Transcoder::NewPadCallback(GstElement*, GstPad* pad, gboolean, gpointer data) {
|
||||
JobState* state = reinterpret_cast<JobState*>(data);
|
||||
GstPad* const audiopad = gst_element_get_pad(state->convert_element_, "sink");
|
||||
GstPad* const audiopad = gst_element_get_static_pad(
|
||||
state->convert_element_, "sink");
|
||||
|
||||
if (GST_PAD_IS_LINKED(audiopad)) {
|
||||
qLog(Debug) << "audiopad is already linked, unlinking old pad";
|
||||
|
Loading…
x
Reference in New Issue
Block a user