00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "propertyprobe.h"
00018 #include <gst/interfaces/propertyprobe.h>
00019
00020 namespace QGst {
00021
00022 QList<QGlib::ParamSpecPtr> PropertyProbe::properties() const
00023 {
00024 QList<QGlib::ParamSpecPtr> result;
00025 const GList *list = gst_property_probe_get_properties(object<GstPropertyProbe>());
00026 while(list) {
00027 result.append(QGlib::ParamSpecPtr::wrap(G_PARAM_SPEC(list->data)));
00028 list = list->next;
00029 }
00030 return result;
00031 }
00032
00033 bool PropertyProbe::propertySupportsProbe(const QGlib::ParamSpecPtr & property) const
00034 {
00035 const GList *list = gst_property_probe_get_properties(object<GstPropertyProbe>());
00036 while(list) {
00037 GParamSpec *param = G_PARAM_SPEC(list->data);
00038 if (param == property) {
00039 return true;
00040 }
00041 list = list->next;
00042 }
00043 return false;
00044 }
00045
00046 bool PropertyProbe::propertySupportsProbe(const char *property) const
00047 {
00048 const GParamSpec *param = gst_property_probe_get_property(object<GstPropertyProbe>(), property);
00049 return param != NULL;
00050 }
00051
00052 bool PropertyProbe::needsProbe(const QGlib::ParamSpecPtr & property) const
00053 {
00054 return gst_property_probe_needs_probe(object<GstPropertyProbe>(), property);
00055 }
00056
00057 bool PropertyProbe::needsProbe(const char *property) const
00058 {
00059 return gst_property_probe_needs_probe_name(object<GstPropertyProbe>(), property);
00060 }
00061
00062 void PropertyProbe::probe(const QGlib::ParamSpecPtr & property)
00063 {
00064 gst_property_probe_probe_property(object<GstPropertyProbe>(), property);
00065 }
00066
00067 void PropertyProbe::probe(const char *property)
00068 {
00069 gst_property_probe_probe_property_name(object<GstPropertyProbe>(), property);
00070 }
00071
00072 static QList<QGlib::Value> valueArrayToList(GValueArray *array)
00073 {
00074 QList<QGlib::Value> result;
00075 if (array) {
00076 for(uint i = 0; i < array->n_values; ++i) {
00077 const GValue *v = g_value_array_get_nth(array, i);
00078 result.append(QGlib::Value(v));
00079 }
00080 g_value_array_free(array);
00081 }
00082 return result;
00083 }
00084
00085 QList<QGlib::Value> PropertyProbe::values(const QGlib::ParamSpecPtr & property) const
00086 {
00087 GValueArray *array = gst_property_probe_get_values(object<GstPropertyProbe>(), property);
00088 return valueArrayToList(array);
00089 }
00090
00091 QList<QGlib::Value> PropertyProbe::values(const char *property) const
00092 {
00093 GValueArray *array = gst_property_probe_get_values_name(object<GstPropertyProbe>(), property);
00094 return valueArrayToList(array);
00095 }
00096
00097 QList<QGlib::Value> PropertyProbe::probeAndGetValues(const QGlib::ParamSpecPtr & property)
00098 {
00099 GValueArray *array = gst_property_probe_probe_and_get_values(object<GstPropertyProbe>(), property);
00100 return valueArrayToList(array);
00101 }
00102
00103 QList<QGlib::Value> PropertyProbe::probeAndGetValues(const char *property)
00104 {
00105 GValueArray *array = gst_property_probe_probe_and_get_values_name(object<GstPropertyProbe>(), property);
00106 return valueArrayToList(array);
00107 }
00108
00109 }