- char *targets[]={"left", "top", "width", "height"};
- char filename[128];
- snprintf(filename, 128, "/proc/stb/vmpeg/%d/dst_%s", m_decoder, targets[i]);
- FILE *f = fopen(filename, "w");
- if (!f)
- {
- eDebug("failed to open %s - %m", filename);
- break;
- }
- int val = 0;
- switch (i)
+// eDebug("matched");
+ return;
+ }
+
+ if (!(m_state & 1))
+ {
+ m_user_rect = pos;
+ m_state |= 1;
+// eDebug("set user rect pos!");
+ }
+
+// eDebug("m_user_rect %d %d -> %d %d", m_user_rect.left(), m_user_rect.top(), m_user_rect.width(), m_user_rect.height());
+
+ int left = pos.left() * 720 / m_fb_size.width();
+ int top = pos.top() * 576 / m_fb_size.height();
+ int width = pos.width() * 720 / m_fb_size.width();
+ int height = pos.height() * 576 / m_fb_size.height();
+
+ int tmp = left - (width * 4) / 100;
+ left = tmp < 0 ? 0 : tmp;
+ tmp = top - (height * 4) / 100;
+ top = tmp < 0 ? 0 : tmp;
+ tmp = (width * 108) / 100;
+ width = left + tmp > 720 ? 720 - left : tmp;
+ tmp = (height * 108) / 100;
+ height = top + tmp > 576 ? 576 - top : tmp;
+
+// eDebug("picture recalced %d %d -> %d %d", left, top, width, height);
+
+ if (!disable)
+ {
+ for (int i=0; i<4; ++i)