The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Video::Xine::OSD - Xine onscreen display

METHODS

These methods are used for the Xine on-screen display.

new()

  my $osd = Video::Xine::OSD->new($stream, $x, $y, $width, $height);

Creates a new OSD.

get_capabilities()

  my $caps = $osd->get_capabilities();
  print "Got freetype2" if ($caps & XINE_OSD_CAP_FREETYPE2);

Returns a number indicating the OSD's capabilities as flags. Import the :cap_constants tag to get the flag constants. See EXPORTS for details.

clear()

 $osd->clear()

Clears out the on-screen display.

draw_text()

 $osd->draw_text(x => 0, y => 0, text => 'hello world', color_base => 1)

Draw text on the on-screen display. Set the font with set_font() before calling this method, or no text will be drawn.

set_font()

 $osd->set_font($font_name, $font_size);

Sets the font and font size. $font_name can be either a straight name or a path to a TrueType font file. $font_size is the point size of the font. The Xine header seems to want you to make this a multiple of 11; not sure why.

Returns true on success, false on failure.

show()

 $osd->show();

Renders the OSD onto the screen.

hide()

 $osd->hide();

Hides the OSD from the screen.

EXPORTS

None by default.

Capabilities Constants

The tag :cap_constants exports constants for OSD capabilities for use with the get_capabilities() method:

  • XINE_OSD_CAP_FREETYPE2

  • XINE_OSD_CAP_UNSCALED