Index: trunk/cortado/src/com/fluendo/player/CortadoPipeline.java |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | private String password; |
34 | 34 | private boolean enableAudio; |
35 | 35 | private boolean enableVideo; |
| 36 | + private boolean ignoreAspect; |
36 | 37 | private int enableKate; |
37 | 38 | private Component component; |
38 | 39 | private int bufferSize = -1; |
— | — | @@ -111,7 +112,7 @@ |
112 | 113 | v_queue = ElementFactory.makeByName("queue", "v_queue"); |
113 | 114 | if (v_queue == null) { |
114 | 115 | noSuchElement ("queue"); |
115 | | - return; |
| 116 | + return; |
116 | 117 | } |
117 | 118 | |
118 | 119 | if (!setupVideoDec ("theoradec")) |
— | — | @@ -329,6 +330,9 @@ |
330 | 331 | public void setUserId(String aUserId) { |
331 | 332 | userId = aUserId; |
332 | 333 | } |
| 334 | + public void setIgnoreAspect(boolean ignore) { |
| 335 | + ignoreAspect = ignore; |
| 336 | + } |
333 | 337 | public void setPassword(String aPassword) { |
334 | 338 | password = aPassword; |
335 | 339 | } |
— | — | @@ -559,6 +563,9 @@ |
560 | 564 | noSuchElement ("videosink"); |
561 | 565 | return false; |
562 | 566 | } |
| 567 | + |
| 568 | + videosink.setProperty("ignore-aspect", ignoreAspect ? "true" : "false"); |
| 569 | + |
563 | 570 | videosink.setProperty ("component", component); |
564 | 571 | resize(component.getSize()); |
565 | 572 | |
Index: trunk/cortado/src/com/fluendo/player/Cortado.java |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | private int kateIndex; |
39 | 39 | private boolean showSpeaker; |
40 | 40 | private boolean keepAspect; |
| 41 | + private boolean ignoreAspect; |
41 | 42 | private boolean autoPlay; |
42 | 43 | private int bufferSize; |
43 | 44 | private String userId; |
— | — | @@ -110,6 +111,8 @@ |
111 | 112 | {"showSpeaker", "boolean", "Show a speaker icon when audio is available (default true)"}, |
112 | 113 | {"keepAspect", "boolean", |
113 | 114 | "Use aspect ratio of video (default true)"}, |
| 115 | + {"ignoreAspect", "boolean", |
| 116 | + "Ignore the aspect ratio as signalled by the video, always assume square pixels (default false)"}, |
114 | 117 | {"bufferSize", "int", |
115 | 118 | "The size of the prebuffer in Kbytes (default 100)"}, |
116 | 119 | {"bufferLow", "int", "Percent of empty buffer (default 10)"}, |
— | — | @@ -232,6 +235,7 @@ |
233 | 236 | hideTimeout = getIntParam("hideTimeout", 3); |
234 | 237 | showSpeaker = getBoolParam("showSpeaker", true); |
235 | 238 | keepAspect = getBoolParam("keepAspect", true); |
| 239 | + ignoreAspect = getBoolParam("ignoreAspect", false); |
236 | 240 | bufferSize = getIntParam("bufferSize", 200); |
237 | 241 | bufferLow = getIntParam("bufferLow", 10); |
238 | 242 | bufferHigh = getIntParam("bufferHigh", 70); |
— | — | @@ -260,6 +264,7 @@ |
261 | 265 | pipeline.setPassword(password); |
262 | 266 | pipeline.enableAudio(audio); |
263 | 267 | pipeline.enableVideo(video); |
| 268 | + pipeline.setIgnoreAspect(ignoreAspect); |
264 | 269 | pipeline.enableKateIndex(kateIndex); |
265 | 270 | pipeline.setBufferSize(bufferSize); |
266 | 271 | pipeline.setBufferLow(bufferLow); |
Index: trunk/cortado/src/com/fluendo/plugin/VideoSink.java |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | { |
29 | 29 | private Component component; |
30 | 30 | private boolean keepAspect; |
| 31 | + private boolean ignoreAspect; |
31 | 32 | private boolean scale; |
32 | 33 | private Frame frame; |
33 | 34 | |
— | — | @@ -56,17 +57,16 @@ |
57 | 58 | aspectX = caps.getFieldInt("aspect_x", 1); |
58 | 59 | aspectY = caps.getFieldInt("aspect_y", 1); |
59 | 60 | |
60 | | - /* |
61 | | - Debug.log(Debug.DEBUG, this+" dimension: "+width+"x"+height+", aspect: "+aspectX+"/"+aspectY); |
| 61 | + if(!ignoreAspect) { |
| 62 | + Debug.log(Debug.DEBUG, this+" dimension: "+width+"x"+height+", aspect: "+aspectX+"/"+aspectY); |
62 | 63 | |
63 | | - if (aspectY > aspectX) { |
64 | | - height = height * aspectY / aspectX; |
| 64 | + if (aspectY > aspectX) { |
| 65 | + height = height * aspectY / aspectX; |
| 66 | + } else { |
| 67 | + width = width * aspectX / aspectY; |
| 68 | + } |
| 69 | + Debug.log(Debug.DEBUG, this+" scaled source: "+width+"x"+height); |
65 | 70 | } |
66 | | - else { |
67 | | - width = width * aspectX / aspectY; |
68 | | - } |
69 | | - Debug.log(Debug.DEBUG, this+" scaled source: "+width+"x"+height); |
70 | | - */ |
71 | 71 | |
72 | 72 | component.setVisible(true); |
73 | 73 | |
— | — | @@ -166,8 +166,9 @@ |
167 | 167 | } |
168 | 168 | else if (name.equals("keep-aspect")) { |
169 | 169 | keepAspect = String.valueOf(value).equals("true"); |
170 | | - } |
171 | | - else if (name.equals("scale")) { |
| 170 | + } else if(name.equals("ignore-aspect")) { |
| 171 | + ignoreAspect = value.toString().equals("true"); |
| 172 | + } else if (name.equals("scale")) { |
172 | 173 | scale = String.valueOf(value).equals("true"); |
173 | 174 | } else if (name.equals("bounds")) { |
174 | 175 | bounds = (Rectangle) value; |