Skip to content

Instantly share code, notes, and snippets.

@lfranchi
Created April 25, 2011 12:26
Show Gist options
  • Save lfranchi/940445 to your computer and use it in GitHub Desktop.
Save lfranchi/940445 to your computer and use it in GitHub Desktop.
phonon-vlc-git patch osx homebrew
diff --git a/vlc/backend.cpp b/vlc/backend.cpp
index 1120fc3..a31a748 100644
--- a/vlc/backend.cpp
+++ b/vlc/backend.cpp
@@ -298,13 +298,13 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
case Phonon::SubtitleType: {
list << GlobalSubtitles::instance()->globalIndexes();
}
- break;
+ break; /*
case Phonon::VideoCaptureDeviceType: {
deviceList = deviceManager()->videoCaptureDevices();
for (dev = 0 ; dev < deviceList.size() ; ++dev)
list.append(deviceList[dev].id);
}
- break;
+ break; */
}
return list;
@@ -332,6 +332,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
}
}
break;
+ /*
case Phonon::AudioCaptureDeviceType: {
deviceList = deviceManager()->audioCaptureDevices();
if (index >= 0 && index < deviceList.size()) {
@@ -345,6 +346,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
}
}
break;
+ */
case Phonon::EffectType: {
QList<EffectInfo *> effectList = effectManager()->effects();
if (index >= 0 && index <= effectList.size()) {
@@ -363,7 +365,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
ret.insert("description", description.description());
ret.insert("type", description.property("type"));
}
- break;
+ break; /*
case Phonon::VideoCaptureDeviceType: {
deviceList = deviceManager()->videoCaptureDevices();
if (index >= 0 && index < deviceList.size()) {
@@ -376,7 +378,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
ret.insert("hasaudio", true);
}
}
- break;
+ break; */
}
return ret;
diff --git a/vlc/devicemanager.cpp b/vlc/devicemanager.cpp
index cb060d6..576f3cc 100644
--- a/vlc/devicemanager.cpp
+++ b/vlc/devicemanager.cpp
@@ -200,13 +200,13 @@ void DeviceManager::updateDeviceList()
while (p_ao_list) {
if (checkpulse && strcmp(p_ao_list->psz_name, "pulse") == 0) {
aos.last().isAdvanced = false;
- aos.last().accessList.append(DeviceAccess("pulse", "default"));
+ aos.last().accessList.append(DeviceAccess1("pulse", "default"));
haspulse = true;
break;
}
aos.append(DeviceInfo(p_ao_list->psz_name, p_ao_list->psz_description, true));
- aos.last().accessList.append(DeviceAccess(p_ao_list->psz_name, QString()));
+ aos.last().accessList.append(DeviceAccess1(p_ao_list->psz_name, QString()));
aos.last().capabilities = DeviceInfo::AudioOutput;
p_ao_list = p_ao_list->p_next;
diff --git a/vlc/devicemanager.h b/vlc/devicemanager.h
index 10c0f3c..267601e 100644
--- a/vlc/devicemanager.h
+++ b/vlc/devicemanager.h
@@ -31,6 +31,8 @@ namespace Phonon
{
namespace VLC
{
+ typedef QPair<QByteArray, QString> DeviceAccess1;
+ typedef QList<DeviceAccess1> DeviceAccessList1;
class Backend;
@@ -60,7 +62,7 @@ public:
QByteArray name;
QString description;
bool isAdvanced;
- DeviceAccessList accessList;
+ DeviceAccessList1 accessList;
quint16 capabilities;
};
@@ -161,4 +163,7 @@ private:
QT_END_NAMESPACE
+//Q_DECLARE_METATYPE(Phonon::VLC::DeviceAccess1)
+//Q_DECLARE_METATYPE(Phonon::VLC::DeviceAccessList1)
+
#endif // Phonon_VLC_DEVICEMANAGER_H
diff --git a/vlc/mediaobject.cpp b/vlc/mediaobject.cpp
index acd810a..90d1b39 100644
--- a/vlc/mediaobject.cpp
+++ b/vlc/mediaobject.cpp
@@ -287,7 +287,7 @@ void MediaObject::setSource(const MediaSource &source)
case MediaSource::LocalFile:
case MediaSource::Url: {
debug() << "MediaSource::Url:" << source.url();
- loadMedia(source.mrl().toEncoded());
+ loadMedia(source.url().toEncoded());
} // Keep these braces and the following break as-is, some compilers fall over the var decl above.
break;
case MediaSource::Disc:
@@ -310,15 +310,17 @@ void MediaObject::setSource(const MediaSource &source)
break;
}
break;
+ /*
case MediaSource::CaptureDevice:
if (source.deviceAccessList().isEmpty()) {
error() << Q_FUNC_INFO << "No device access list for this capture device";
break;
}
-
+ */
// TODO try every device in the access list until it works, not just the first one
- driverName = source.deviceAccessList().first().first;
- deviceName = source.deviceAccessList().first().second;
+ // driverName = source.deviceAccessList().first().first;
+ // deviceName = source.deviceAccessList().first().second;
+ driverName = "foobar";
if (driverName == QByteArray("v4l2")) {
loadMedia(QLatin1Literal("v4l2://") % deviceName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment