Stephen Nelson > Video-Xine > Video::Xine

Download:
Video-Xine-0.18.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Module Version: 0.18   Source  

NAME ^

Video::Xine - Perl interface to libxine

SYNOPSIS ^

  use Video::Xine;
  use Video::Xine::Stream;
  use Video::Xine::Driver::Audio;
  use Video::Xine::Driver::Video qw/:constants/;

  # Create and initialize the Xine object
  my $xine = Video::Xine->new(
    config_file => "$ENV{'HOME'}/.xine/config",
  );

  # Load a video driver
  my $video_driver = Video::Xine::Driver::Video->new($xine,"auto", XINE_VISUAL_TYPE_X11,$x11_visual);

  # Load an audio driver
  my $audio_driver = Video::Xine::Driver::Audio->new($xine, "auto");

  # Create a new stream
  my $stream = $xine->stream_new($AUDIO_DRIVER,$VIDEO_DRIVER);

  # Open a file on the stream
  $stream->open('file://my/movie/file.avi')
    or die "Couldn't open stream: ", $stream->get_error();

  # Get the current position (0 .. 65535), position in time, and length
  # of stream in milliseconds
  my ($pos, $pos_time, $length_time) = $stream->get_pos_length();

  # Start the stream playing
  $stream->play()
     or die "Couldn't play stream: ", $xine->get_error();

  # Play the stream to the end
  while ( $stream->get_status() == XINE_STATUS_PLAY ) {
    sleep(1);
  }

DESCRIPTION ^

A perl interface to Xine, the Linux movie player. More properly, an interface to libxine, the development library. Requires installation of libxine.

Xine by itself does not provide a user interface or windowing system, and neither does this interface. Instead, you must set up the window using your own windowing code, and pass the window information to Xine. The "X11::FullScreen" module provides a simple interface for doing this with X.

METHODS

new()

Constructor. Takes named argument 'config_file'.

Example:

  my $xine = Video::Xine->new( config_file => "$ENV{'HOME'}/xine/config" )

get_version()

Returns the version of the xine library to which we're linked. Static method.

Example:

 my $version = Video::Xine->get_version(); # returns something like '1.1.8'

set_param()

  set_param($param, $value);

Sets an engine parameter.

Xine engine parameter constants:

stream_new()

  stream_new($audio_port, $video_port)

Creates a new stream. The $audio_port and $video_port options are optional and default to automatically-selected drivers. A convenience method around Xine::Stream::new.

See Video::Xine::Stream for stream methods.

get_error()

Returns the error code for the last error. Xine error codes are:

SEE ALSO ^

xine(1)

AUTHOR ^

Stephen Nelson, <stephen@cpan.org>

SPECIAL THANKS TO ^

Joern Reder

COPYRIGHT AND LICENSE ^

Copyright (C) 2005-2008 by Stephen Nelson

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.