Stephen Nelson > Video-Xine > Video::Xine::Stream

Download:
Video-Xine-0.26.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.26   Source  

NAME ^

Video::Xine::Stream - Audio-video stream for Xine

SYNOPSIS ^

  use Video::Xine;
  use Video::Xine::Stream;

  my $stream = Video::Xine::Stream->new($xine, $audio, $video);

  $stream->open('file://foo/bar');

METHODS ^

These are methods which can be used on the Video::Xine::Stream class and object.

new()

  new($xine, $audio_port, $video_port)

Creates a new Stream object. The $audio_port and $video_port options are optional and default to automatically-selected drivers.

get_video_port()

 Returns the video port, also known as the video driver.

master_slave()

  $stream->master_slave( $slave_stream, $affection )

Sets up a master-slave relationship with $slave_stream. You can import the constants for $affection with the ':master_slave_constants' tag. They are XINE_MASTER_SLAVE_PLAY, XINE_MASTER_SLAVE_STOP, and XINE_MASTER_SLAVE_SPEED.

open()

 $stream->open($mrl)

Opens the stream to an MRL, which is a URL-like construction used by Xine to locate media files. See the xine documentation for details.

play()

 $stream->play($start_pos, $start_time)

Starts playing the stream at a specific position or specific time. Both $start_pos and $start_time are optional and default to 0.

stop()

 $stream->stop()

Stops the stream.

close()

 $stream->close()

Close the stream. You can re-use the same stream again and again.

eject()

  $stream->eject()

Eject the stream, if possible. Returns 1 if OK, 0 if error.

get_pos_length()

  ($pos_pct, $pos_time, $length_millis) = $stream->get_pos_length();

Gets position / length information. $pos_pct is a value between 1 and 65535 indicating how far we've proceeded through the stream. $pos_time gives how far we've proceeded through the stream in milliseconds, and $length_millis gives the total length of the stream in milliseconds.

get_status()

Returns the play status of the stream. It will return one of the following constants, which are exported in the tag ':status_constants':

STREAM CONSTANTS

set_param()

  $s->set_param($param, $value)

Sets a parameter on the stream. $param should be a xine parameter constant. See "PARAMETER CONSTANTS" for a list of available parameter constants.

get_param()

  my $param = $s->get_param($param)

Returns a parameter from the stream. $param should be a xine parameter constant.

get_info()

  my $info = $s->get_info($info_const)

Returns information about the stream, such as its bit rate, audio channels, width, or height. $info_const should be a xine info constant.

get_meta_info()

  my $meta_info = $stream->get_meta_info($meta_info_const)

Returns meta-information about the stream, such as its title. $meta_info_const should be a xine meta info constant; see META CONSTANTS below for details.

PARAM CONSTANTS

These constants are exported with the :param_constants tag.

INFO CONSTANTS

Exported in the tag 'info_constants'.

META CONSTANTS

Exported with the :meta_constants tag.

SEE ALSO ^

Video::Xine

syntax highlighting: