[PATCH] Provide framework to define a video output area within the OSD area

View: New views
4 Messages — Rating Filter:   Alert me  

[PATCH] Provide framework to define a video output area within the OSD area

by Reinhard Nissl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The supplied functions and constants allow to define a video output area
(called video window) within the OSD area to show for example a small
preview of the current channel in the top right corner while zapping
through the channel list displayed as OSD.
A VDPAU enabled xine-lib implements VO_CAP_VIDEO_WINDOW_OVERLAY already.


5 files changed, 56 insertions(+)
include/xine.h                   |    8 ++++++++
include/xine/osd.h               |   11 +++++++++++
include/xine/video_out.h         |    7 +++++++
src/xine-engine/osd.c            |   26 ++++++++++++++++++++++++++
src/xine-engine/xine_interface.c |    4 ++++




# HG changeset patch
# User Reinhard Nißl <rnissl@...>
# Date 1244673570 -7200
# Node ID 32e8bf9e15e4aa8b6d80fa75d8c69b83436a3463
# Parent  e9675a108ff67871bdf570dd662773397ef38d7a
Provide framework to define a video output area within the OSD area.
The supplied functions and constants allow to define a video output area
(called video window) within the OSD area to show for example a small
preview of the current channel in the top right corner while zapping
through the channel list displayed as OSD.
A VDPAU enabled xine-lib implements VO_CAP_VIDEO_WINDOW_OVERLAY already.

diff --git a/include/xine.h b/include/xine.h
--- a/include/xine.h
+++ b/include/xine.h
@@ -2082,6 +2082,7 @@ void xine_event_send (xine_stream_t *str
 #define XINE_OSD_CAP_UNSCALED      0x0002 /* unscaled overlays supp. by vo drv */
 #define XINE_OSD_CAP_CUSTOM_EXTENT 0x0004 /* hardware scaled to match video output window */
 #define XINE_OSD_CAP_ARGB_LAYER    0x0008 /* supports separate true color layer */
+#define XINE_OSD_CAP_VIDEO_WINDOW  0x0010 /* can scale video to an area within osd extent */
 
 typedef struct xine_osd_s xine_osd_t;
 
@@ -2169,6 +2170,13 @@ void xine_osd_set_extent(xine_osd_t *sel
 void xine_osd_set_extent(xine_osd_t *self, int extent_width, int extent_height) XINE_PROTECTED;
 
 /*
+ * define area within osd extent to output
+ * video to while osd is on screen
+ * see also XINE_OSD_CAP_VIDEO_WINDOW
+ */
+void xine_osd_set_video_window(xine_osd_t *self, int window_x, int window_y, int window_width, int window_height) XINE_PROTECTED;
+
+/*
  * close osd rendering engine
  * loaded fonts are unloaded
  * osd objects are closed
diff --git a/include/xine/osd.h b/include/xine/osd.h
--- a/include/xine/osd.h
+++ b/include/xine/osd.h
@@ -42,6 +42,10 @@ struct osd_object_s {
   uint8_t *area;        /* work area */
   int area_touched;     /* work area was used for painting */
   int display_x,display_y;  /* where to display it in screen */
+
+  /* video output area within osd extent */
+  int video_window_x, video_window_y;
+  int video_window_width, video_window_height;
 
   /* extent of reference coordinate system */
   int extent_width, extent_height;
@@ -237,6 +241,13 @@ struct osd_renderer_s {
   void (*set_argb_buffer) (osd_object_t *osd, uint32_t *argb_buffer,
                            int dirty_x, int dirty_y, int dirty_width, int dirty_height);
 
+  /*
+   * osd video window defines an area withing osd extent where the
+   * video shall be scaled to while an osd is displayed on screen.
+   * both width and height must be > 0 to take effect.
+   */
+  void (*set_video_window) (osd_object_t *osd,
+                            int window_x, int window_y, int window_width, int window_height);
 
   /* private stuff */
 
diff --git a/include/xine/video_out.h b/include/xine/video_out.h
--- a/include/xine/video_out.h
+++ b/include/xine/video_out.h
@@ -296,6 +296,7 @@ struct xine_video_port_s {
 #define VO_CAP_ZOOM_Y                 0x00800000
 #define VO_CAP_CUSTOM_EXTENT_OVERLAY  0x01000000 /* driver can blend custom extent overlay to output extent */
 #define VO_CAP_ARGB_LAYER_OVERLAY     0x02000000 /* driver supports true color overlay */
+#define VO_CAP_VIDEO_WINDOW_OVERLAY   0x04000000 /* driver can scale video to an area within overlay */
 
 /*
  * vo_driver_s contains the functions every display driver
@@ -442,6 +443,12 @@ struct vo_overlay_s {
   int               width;         /* width of subpicture area         */
   int               height;        /* height of subpicture area        */
 
+  /* area within osd extent to scale video to */
+  int               video_window_x;
+  int               video_window_y;
+  int               video_window_width;
+  int               video_window_height;
+
   /* extent of reference coordinate system */
   int               extent_width;
   int               extent_height;
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -251,6 +251,10 @@ static osd_object_t *XINE_MALLOC osd_new
   osd->next = this->osds;
   this->osds = osd;
 
+  osd->video_window_x = 0;
+  osd->video_window_y = 0;
+  osd->video_window_width = 0;
+  osd->video_window_height = 0;
   osd->extent_width = 0;
   osd->extent_height = 0;  
   osd->width = width;
@@ -292,6 +296,19 @@ static void osd_set_extent (osd_object_t
 
   osd->extent_width  = extent_width;
   osd->extent_height = extent_height;
+}
+
+/*
+ * osd video window defines an area withing osd extent where the
+ * video shall be scaled to while an osd is displayed on screen.
+ * both width and height must be > 0 to take effect.
+ */
+static void osd_set_video_window (osd_object_t *osd, int window_x, int window_y, int window_width, int window_height) {
+
+  osd->video_window_x      = window_x;
+  osd->video_window_y      = window_y;
+  osd->video_window_width  = window_width;
+  osd->video_window_height = window_height;
 }
 
 
@@ -361,6 +378,11 @@ static int _osd_show (osd_object_t *osd,
     this->event.object.overlay->y = osd->display_y + osd->y1;
     this->event.object.overlay->width = osd->x2 - osd->x1;
     this->event.object.overlay->height = osd->y2 - osd->y1;
+
+    this->event.object.overlay->video_window_x      = osd->video_window_x;
+    this->event.object.overlay->video_window_y      = osd->video_window_y;
+    this->event.object.overlay->video_window_width  = osd->video_window_width;
+    this->event.object.overlay->video_window_height = osd->video_window_height;
 
     this->event.object.overlay->extent_width  = osd->extent_width;
     this->event.object.overlay->extent_height = osd->extent_height;
@@ -1768,6 +1790,9 @@ static uint32_t osd_get_capabilities (os
   if (vo_capabilities & VO_CAP_ARGB_LAYER_OVERLAY)
     capabilities |= XINE_OSD_CAP_ARGB_LAYER;
 
+  if (vo_capabilities & VO_CAP_VIDEO_WINDOW_OVERLAY)
+    capabilities |= XINE_OSD_CAP_VIDEO_WINDOW;
+
   return capabilities;
 }
 
@@ -1841,6 +1866,7 @@ osd_renderer_t *_x_osd_renderer_init( xi
   this->show_unscaled      = osd_show_unscaled;
   this->get_capabilities   = osd_get_capabilities;
   this->set_extent         = osd_set_extent;
+  this->set_video_window   = osd_set_video_window;
 
   return this;
 }
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -858,6 +858,10 @@ void xine_osd_set_extent(xine_osd_t *thi
   this->osd.renderer->set_extent(&this->osd, extent_width, extent_height);
 }
 
+void xine_osd_set_video_window(xine_osd_t *this, int window_x, int window_y, int window_width, int window_height) {
+  this->osd.renderer->set_video_window(&this->osd, window_x, window_y, window_width, window_height);
+}
+
 
 const char *const *xine_post_list_inputs(xine_post_t *this_gen) {
   post_plugin_t *this = (post_plugin_t *)this_gen;


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
xine-devel mailing list
xine-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-devel

Re: [PATCH] Provide framework to define a video output area within the OSD area

by VDR User :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jun 10, 2009 at 3:39 PM, Reinhard Nissl<rnissl@...> wrote:
> The supplied functions and constants allow to define a video output area
> (called video window) within the OSD area to show for example a small
> preview of the current channel in the top right corner while zapping
> through the channel list displayed as OSD.
> A VDPAU enabled xine-lib implements VO_CAP_VIDEO_WINDOW_OVERLAY already.

Thanks so much for your work on this!  I know many guys have been
anxiously waiting so this is great news!  Will there be a patch for
xine-lib 1.1 as well?  And if so, any idea when we might see it?

Cheers,
Derek

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
xine-devel mailing list
xine-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-devel

Re: [PATCH] Provide framework to define a video output area within the OSD area

by Darren Salt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I demand that VDR User may or may not have written...

> On Wed, Jun 10, 2009 at 3:39 PM, Reinhard Nissl<rnissl@...> wrote:
>> The supplied functions and constants allow to define a video output area
>> (called video window) within the OSD area to show for example a small
>> preview of the current channel in the top right corner while zapping
>> through the channel list displayed as OSD.
>> A VDPAU enabled xine-lib implements VO_CAP_VIDEO_WINDOW_OVERLAY already.

> Thanks so much for your work on this!  I know many guys have been anxiously
> waiting so this is great news!  Will there be a patch for xine-lib 1.1 as
> well? [...]

There's no possibility of that due to backward-incompatible ABI changes.

--
| Darren Salt      | linux at youmustbejoking | nr. Ashington, | Doon
| Debian GNU/Linux | or ds    ,demon,co,uk    | Northumberland | Army
| + Use more efficient products. Use less.          BE MORE ENERGY EFFICIENT.

Whoops! Here comes Mr Jelly!

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
xine-devel mailing list
xine-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-devel

Re: [PATCH] Provide framework to define a video output area within the OSD area

by VDR User :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jun 11, 2009 at 10:27 AM, Darren
Salt<linux@...> wrote:

> I demand that VDR User may or may not have written...
>
>> On Wed, Jun 10, 2009 at 3:39 PM, Reinhard Nissl<rnissl@...> wrote:
>>> The supplied functions and constants allow to define a video output area
>>> (called video window) within the OSD area to show for example a small
>>> preview of the current channel in the top right corner while zapping
>>> through the channel list displayed as OSD.
>>> A VDPAU enabled xine-lib implements VO_CAP_VIDEO_WINDOW_OVERLAY already.
>
>> Thanks so much for your work on this!  I know many guys have been anxiously
>> waiting so this is great news!  Will there be a patch for xine-lib 1.1 as
>> well? [...]
>
> There's no possibility of that due to backward-incompatible ABI changes.

Right, but I meant a patch for 1.1 users to apply to their local
source, not a patch to be added to your main 1.1 vanilla tree.  I'll
likely follow along with everyone else and switch to the 1.2 tree once
all the necessary components for this are in vanilla 1.2.

Cheers

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
xine-devel mailing list
xine-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-devel