Various bits for gstreamer-1.0 compatability

This commit is contained in:
David Sansome 2014-09-21 19:35:43 +10:00
parent 50551d987a
commit 6b32ecec27
4 changed files with 13 additions and 14 deletions

View File

@ -39,8 +39,7 @@ static Level sDefaultLevel = Level_Debug;
static QMap<QString, Level>* sClassLevels = nullptr;
static QIODevice* sNullDevice = nullptr;
//const char* kDefaultLogLevels = "GstEnginePipeline:2,*:3";
const char* kDefaultLogLevels = "*:3";
const char* kDefaultLogLevels = "GstEnginePipeline:2,*:3";
static const char* kMessageHandlerMagic = "__logging_message__";
static const int kMessageHandlerMagicLength = strlen(kMessageHandlerMagic);

View File

@ -281,8 +281,11 @@ void GstEngine::UpdateScope(int chunk_length) {
if (!GST_CLOCK_TIME_IS_VALID(GST_BUFFER_DURATION(latest_buffer_))) return;
if (GST_BUFFER_DURATION(latest_buffer_) == 0) return;
GstMapInfo map;
gst_buffer_map(latest_buffer_, &map, GST_MAP_READ);
// determine where to split the buffer
int chunk_density = (GST_BUFFER_SIZE(latest_buffer_) * kNsecPerMsec) /
int chunk_density = (map.size * kNsecPerMsec) /
GST_BUFFER_DURATION(latest_buffer_);
int chunk_size = chunk_length * chunk_density;
@ -293,7 +296,6 @@ void GstEngine::UpdateScope(int chunk_length) {
return;
}
gst_buffer_map(latest_buffer_, &map, GST_MAP_READ);
const sample_type* source = reinterpret_cast<sample_type*>(map.data);
sample_type* dest = scope_.data();
source += (chunk_size / sizeof(sample_type)) * scope_chunk_;
@ -733,7 +735,7 @@ GstEngine::PluginDetailsList GstEngine::GetPluginList(
GstElementFactory* factory = GST_ELEMENT_FACTORY(p->data);
if (QString(gst_element_factory_get_klass(factory)).contains(classname)) {
PluginDetails details;
details.name = QString::fromUtf8(GST_PLUGIN_FEATURE_NAME(p->data));
details.name = QString::fromUtf8(gst_plugin_feature_get_name(p->data));
details.description = QString::fromUtf8(
gst_element_factory_get_metadata(factory,
GST_ELEMENT_METADATA_DESCRIPTION));

View File

@ -384,9 +384,9 @@ 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_pad_link(gst_element_get_request_pad(tee, "src_%u"),
gst_element_get_static_pad(probe_queue, "sink"));
gst_pad_link(gst_element_get_request_pad(tee, "src_%d"),
gst_pad_link(gst_element_get_request_pad(tee, "src_%u"),
gst_element_get_static_pad(audio_queue, "sink"));
// Link replaygain elements if enabled.
@ -401,13 +401,13 @@ bool GstEnginePipeline::Init() {
audiosink_, nullptr);
// Add probes and handlers.
gst_pad_add_buffer_probe(gst_element_get_static_pad(probe_converter, "src"),
GST_PAD_PROBE_TYPE_BUFFER,
HandoffCallback, this, nullptr);
gst_pad_add_probe(gst_element_get_static_pad(probe_converter, "src"),
GST_PAD_PROBE_TYPE_BUFFER,
HandoffCallback, this, nullptr);
gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)),
BusCallbackSync, this, nullptr);
bus_cb_id_ = gst_bus_add_watch(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)),
BusCallback, this, nullptr);
BusCallback, this);
MaybeLinkDecodeToAudio();

View File

@ -156,9 +156,7 @@
#include <cmath>
#include <gst/cdda/gstcddabasesrc.h>
#endif
#ifdef Q_OS_DARWIN
// Non exported mac-specific function.
void qt_mac_set_dock_menu(QMenu*);
#endif