cheese r779 - in branches/cheese-vala: . src
- From: jhaitsma svn gnome org
- To: svn-commits-list gnome org
- Subject: cheese r779 - in branches/cheese-vala: . src
- Date: Mon, 23 Jun 2008 20:35:24 +0000 (UTC)
Author: jhaitsma
Date: Mon Jun 23 20:35:24 2008
New Revision: 779
URL: http://svn.gnome.org/viewvc/cheese?rev=779&view=rev
Log:
Implement set_effect_filter
Modified:
branches/cheese-vala/ (props changed)
branches/cheese-vala/src/cheese-webcam.vala
Modified: branches/cheese-vala/src/cheese-webcam.vala
==============================================================================
--- branches/cheese-vala/src/cheese-webcam.vala (original)
+++ branches/cheese-vala/src/cheese-webcam.vala Mon Jun 23 20:35:24 2008
@@ -95,7 +95,7 @@
{Effect.WARP, "warptv", ColorSpace.RGB}
};
- public Widget video_window {get; construct; }
+ public Widget video_window { get; construct; }
public string udi { get; construct; }
int cur_device_num = -1;
@@ -290,8 +290,7 @@
}
}
- void get_video_devices_from_hal () throws WebcamError {
-
+ void get_video_devices_from_hal () throws WebcamError {
RawError dbus_error;
dbus_error.init ();
@@ -324,9 +323,7 @@
}
-
void get_supported_framerates (VideoFormat format, Structure structure) {
-
var frame_rates = structure.get_value ("framerate");
if (frame_rates.holds (fraction_get_type ())) {
@@ -364,12 +361,10 @@
}
} else {
critical ("GValue type %s, cannot be handled for framerates", frame_rates.type_name ());
- }
-
+ }
}
void get_supported_video_formats (Device device, Caps caps) {
-
for (int i = 0; i < caps.get_size (); i++) {
weak Structure structure;
structure = caps.get_structure (i);
@@ -437,15 +432,13 @@
}
}
-
// FIXME: Move into get_webcam_device_data when local const are supported by vala
const string[] GSTREAMER_VIDEO_SOURCES = {
"v4l2src",
"v4lsrc"
};
- void get_webcam_device_data (Device device) {
-
+ void get_webcam_device_data (Device device) {
bool pipeline_works = false;
int i = 0;
while (!pipeline_works && (i < GSTREAMER_VIDEO_SOURCES.length)) {
@@ -655,7 +648,17 @@
}
void set_effect_filter (Element filter) {
+ bool is_playing = pipeline_is_playing;
+ stop ();
+ webcam_source_bin.unlink_many (effect_filter, csp_post_effect);
+ video_display_bin.remove (effect_filter);
+ video_display_bin.add (filter);
+ webcam_source_bin.link_many (filter, csp_post_effect);
+ if (is_playing)
+ play ();
+
+ effect_filter = filter;
}
void change_sink (Element src, Element new_sink, Element old_sink) {
@@ -668,9 +671,8 @@
pipeline.add (new_sink);
src.link (new_sink);
- if (is_playing) {
- play ();
- }
+ if (is_playing)
+ play ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]