Merge lp:~rakete/eidete/custom-recording-area-fix into lp:eidete

Proposed by Andreas Raster
Status: Merged
Merged at revision: 48
Proposed branch: lp:~rakete/eidete/custom-recording-area-fix
Merge into: lp:eidete
Diff against target: 108 lines (+47/-10)
3 files modified
src/Widgets/keyview.vala (+5/-0)
src/Widgets/selectionarea.vala (+39/-7)
src/eidete.vala (+3/-3)
To merge this branch: bzr merge lp:~rakete/eidete/custom-recording-area-fix
Reviewer Review Type Date Requested Status
Tom Beckmann (community) Approve
Review via email: mp+99051@code.launchpad.net

Description of the change

A few small fixes to make recording custom areas work for me on oneiric.

I couldn't record a custom area, it would always record the whole screen. Changing when the recording pipline is set to State.READY fixed that. I made the assumption that setting configuration values of the ximagesrc element needs to be able to allocate new resources, and that setting the pipeline to State.READY before would prevent that.

I made other small fixes like making sure the area coordinates are within a screen and to the discrete recantangle that marks the recording area after recording started, it shouldn't show up in the video.

I added a missing check to disable showing the super key when it is released in keyview.

To post a comment you must log in.
Revision history for this message
Tom Beckmann (tombeckmann) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/keyview.vala'
2--- src/Widgets/keyview.vala 2012-01-20 19:34:41 +0000
3+++ src/Widgets/keyview.vala 2012-03-23 15:47:18 +0000
4@@ -150,6 +150,11 @@
5 this.alt = false;
6 this.queue_draw ();
7 break;
8+ case "Super_L":
9+ case "Super_R":
10+ this.super = false;
11+ this.queue_draw ();
12+ return;
13 }
14 }else{
15 string res = keyvalue;
16
17=== modified file 'src/Widgets/selectionarea.vala'
18--- src/Widgets/selectionarea.vala 2012-01-14 22:32:06 +0000
19+++ src/Widgets/selectionarea.vala 2012-03-23 15:47:18 +0000
20@@ -40,13 +40,45 @@
21 this.begin_move_drag ((int)e.button, (int)e.x_root, (int)e.y_root, e.time);
22 return false;
23 });
24-
25+
26 this.configure_event.connect ((e) => {
27- x = e.x;
28- y = e.y;
29- w = e.width;
30- h = e.height;
31- geometry_changed (e.x, e.y, e.width, e.height);
32+ // check if coordinates are out of the screen and check
33+ // if coordinate + width/height is out of the screen, then
34+ // adjust coordinates to keep width and height (and aspect
35+ // ratio) intact
36+ if( e.x < 0 || e.x > e.window.get_screen().width() ) {
37+ x = 0;
38+ } else if( e.x + e.width > e.window.get_screen().width()
39+ && e.width < e.window.get_screen().width() ) {
40+ x = e.window.get_screen().width() - e.width;
41+ } else {
42+ x = e.x;
43+ }
44+
45+ if( e.y < 0 ) {
46+ y = 0;
47+ } else if( e.y + e.height >= e.window.get_screen().height()
48+ && e.height < e.window.get_screen().height() ) {
49+ y = e.window.get_screen().height() - e.height - 1;
50+ } else {
51+ y = e.y;
52+ }
53+
54+ // just in case an edge is still outside of the screen
55+ // we'll modify the width/height if thats the case
56+ if( x + e.width > e.window.get_screen().width() ) {
57+ w = e.window.get_screen().width() - x;
58+ } else {
59+ w = e.width;
60+ }
61+
62+ if( y + e.height > e.window.get_screen().height() ) {
63+ h = e.window.get_screen().height() - y;
64+ } else {
65+ h = e.height;
66+ }
67+
68+ geometry_changed (x, y, w, h);
69 return false;
70 });
71
72@@ -103,7 +135,7 @@
73 this.set_keep_above (true);
74 this.queue_draw ();
75 this.resize (w+6, h+6);
76- this.move (x, y);
77+ this.move (x, y-1);
78 this.deletable = false;
79
80 this.realize ();
81
82=== modified file 'src/eidete.vala'
83--- src/eidete.vala 2012-01-20 21:04:36 +0000
84+++ src/eidete.vala 2012-03-23 15:47:18 +0000
85@@ -431,7 +431,6 @@
86 audioconvert ! audioresample ! audiorate ! vorbisenc ! queue", true);
87 }catch (Error e){ stderr.printf ("Error: %s\n", e.message);}
88
89- pipeline.set_state (State.READY);
90
91 string cores;
92 try{
93@@ -471,12 +470,13 @@
94 muxer.link (sink);
95
96 pipeline.get_bus ().add_watch (bus_message_cb);
97- pipeline.set_state (State.PLAYING);
98-
99+
100+ pipeline.set_state (State.READY);
101
102 if (selectionarea != null)
103 selectionarea.to_discrete ();
104
105+ pipeline.set_state (State.PLAYING);
106 }
107
108 private bool bus_message_cb (Gst.Bus bus, Message msg){

Subscribers

People subscribed via source and target branches