Meego Wiki
Views

UMMS User Manual

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(API Reference)
(API Reference)
Line 72: Line 72:
   Play()
   Play()
 +
   Pause()
   Pause()
 +
   Stop()
   Stop()
 +
   SetPosition(x: pos)
   SetPosition(x: pos)
 +
    Seek to position.
 +
    Parameters:
 +
                pos: Stream position in millisecond.
 +
   GetPosition(x(out): pos)
   GetPosition(x(out): pos)
 +
    Get the current position of stream in millisecond.
 +
    Parameters:
 +
                pos(out): The current stream position.
 +
   SetPlaybackRate(d: rate)
   SetPlaybackRate(d: rate)
 +
      Set the playback rate.
 +
    Parameters:
 +
                rate: rate to playback the media asset.
 +
   GetPlaybackRate(d(out): rate)
   GetPlaybackRate(d(out): rate)
 +
      Get current playback rate.
 +
    Parameters:
 +
                rate(out): The current playback rate.
 +
   SetVolume(i: volume)
   SetVolume(i: volume)
 +
   GetVolume(i(out): volume)
   GetVolume(i(out): volume)
 +
   SetVideoSize(u: x, u: y, u: w, u: h)
   SetVideoSize(u: x, u: y, u: w, u: h)
 +
    Set video dimension.
 +
    Paramters:
 +
              x: X coordinate of top-left.
 +
              y: Y coordinate of top-left.
 +
              w: Width of video rectangle.
 +
              h: Height of video rectangle.
 +
   GetVideoSize(u(out): w, u(out): h)
   GetVideoSize(u(out): w, u(out): h)
 +
    Get current width and height of video rectangle.
 +
    Parameters:
 +
                w(out): Width of current video rectangle.
 +
                h(out): Height of current video rectangle.
 +
   GetBufferedTime(x(out): length_time)
   GetBufferedTime(x(out): length_time)
 +
    Get the approximate duration of playable data buffered so far in millisecond.
 +
    Parameters:
 +
                length_time(out): amount of playable data buffered so far in millisecond.
 +
   GetBufferedBytes(x(out): length_byte)
   GetBufferedBytes(x(out): length_byte)
 +
    Get the approximate amount of playable data buffered so far in bytes.
 +
    Parameters:
 +
                length_byte(out): amount of playable data buffered so far in byte.
 +
   GetMediaSizeTime(x(out): duration)
   GetMediaSizeTime(x(out): duration)
 +
    Get the duration of the media.
 +
    Parameters:
 +
                duration(out): duration in millisecond.
 +
   GetMediaSizeBytes(x(out): size)
   GetMediaSizeBytes(x(out): size)
 +
    Get the total size of the media file.
 +
    Parameters:
 +
                size(out): total size of the media file.
 +
   HasVideo(b(out): has_video)
   HasVideo(b(out): has_video)
 +
    Indicates the existance of video stream in the media asset.
 +
    Parameters:
 +
                has_video(out): True if media asset has video. False otherwise.
 +
   HasAudio(b(out): has_audio)
   HasAudio(b(out): has_audio)
 +
    Indicates the existance of audio stream in the media asset.
 +
    Parameters:
 +
                has_audio(out): True if media asset has audio. False otherwise.
 +
   IsStreaming(b(out): is_stream)
   IsStreaming(b(out): is_stream)
 +
    Indicates whether the URI represents a stream media.
 +
    Parameters:
 +
                is_stream(out): True for stream media. False otherwise.
 +
   IsSeekable(b(out): is_seekable)
   IsSeekable(b(out): is_seekable)
 +
    Indicates whether this media asset is seekable.
 +
    Parameters:
 +
                is_seekable(out): True for seekable. False otherwise.
 +
   SupportFullScreen(b(out): support_fullscreen)
   SupportFullScreen(b(out): support_fullscreen)
 +
    Indicates whether the backend supports a fullscreen mode.
 +
    Parameters:
 +
                support_fullscreen(out): True if backend supports fullscreen. False otherwise.
 +
   GetPlayerState(i(out): current_state)
   GetPlayerState(i(out): current_state)
 +
    Get current state of ''MediaPlayer'' object.
 +
    Parameters:
 +
                current_state(out):
 +
                                  0:Null,
 +
                                  1:Stopped,
 +
                                  2:Paused,
 +
                                  3:Playing
 +
   Reply()
   Reply()
 +
    Response the UMMS server’s heartbeat check. In the attended-execution mode, client should connect to NeedReply
 +
    signal with a callback in which Reply() method should be called.
 +
   SetProxy(a{sv}: param)
   SetProxy(a{sv}: param)
 +
    Set proxy stuffs.
 +
    Parameters:
 +
                param: A list of key-value pair to sepcify the proxy attributes.
 +
                      The attribute structure is:
 +
                      "proxy-uri":(s)HTTP proxy server URI
 +
                      "proxy-id" :(s)HTTP proxy URI user id for authentication)
 +
                      "proxy-pw" :(s)HTTP proxy URI user password for authentication
 +
   Suspend()
   Suspend()
 +
    Suspend current execution of player. After this invoking, all the resources ocuppied by this session will be released.
 +
   Restore()
   Restore()
 +
    Play the media asset from the position at where it suspended.
 +
   GetCurrentVideo(i(out): current_video)
   GetCurrentVideo(i(out): current_video)
   GetCurrentAudio(i(out): current_audio)
   GetCurrentAudio(i(out): current_audio)

Revision as of 07:02, 19 November 2011

Contents

UMMS User Manual and Sample code

Introduction

This page provides the User Manual and some sample code for the Universal Multi Media Service (UMMS).
UMMS general description can found on its main page

Service Name

com.UMMS

Objects and Interfaces

ObjectManager: Object to create and remove MediaPlayer object.

 Path:      /com/UMMS/ObjectManager
 Interface: com.UMMS.ObjectManager.iface

MediaPlayer: Player object to control the playback of media assets.

 Path:      Returned by ObjectManager
 Interface: com.UMMS.MediaPlayer

AudioManager: Object to manage the system audio output.

 Path:      /com/UMMS/AudioManager
 Interface: com.UMMS.AudioManger

API Reference

  • Interface com.UMMS.ObjectManager.iface

Methods:

  RequestMediaPlayer(s(out): object_path)
    Request a MediaPlayer object operate in attended-execution mode. The ObjectManager will creat a new MediaPlayer object,
    register it on the bus and return the object path to client.
    Parameters: 
        object_path(out): The object path belong to the newly created MediaPlayer object.
  RequestMediaPlayerUnattended(d: time_to_execution, s(out): token, s(out): object_path)
    Request a MediaPlayer object operate in unattended-execution mode. The ObjectManager will creat a new MediaPlayer object,
    register it on the bus and return the object path to client.
    Parameters:
               time_to_execution: Times in seconds for which this MediaPlayer object keep alive.
               token(out):        The unique token belongs to this execution. Application can use it to identify the execution log file which 
                                  named by the token. 
               object_path(out):  The object path belongs to the newly created MediaPlayer object.
  RemoveMediaPlayer(s: object_path)
    Remove the MediaPlayer object which was exposed on the object_path.
    Parameters:
               object_path: The path on which this object was exposed.
   


  • Interface com.UMMS.MediaPlayer

Methods:

  SetUri(s: uri)
    Set URI to UMMS.
    Parameters:
               uri: URI to set.
  SetTarget(i: type, a{sv}: param)
    Set video target and pass all target parameters to UMMS. The video target is where your decoded video data should be rendered.
    Parameters:
               type: The type of video target.
                     0:XWindow,       the video data will be rendered on the X Window.
                     1:DataCopy,      the video data will be copied to a memory instead of directly rendering. E.g. copied to a GL Texture. 
                     2:Socket,        the video data will sent to a socket.
                     3:ReservedType0, reserved for custom target.
                     4:ReservedType1, reserved for custom target.
                     5:ReservedType2, reserved for custom target.
                     6:ReservedType3, reserved for custom target.
               param:The list of key-value pair to specify the attributes of the target. The definition of attribute structure is 
                     target-specific and up to the implementor. The UMMS framwork just defined the XWindow target attribute: "window-id":int. 
  Play()
  Pause()
  Stop()
  SetPosition(x: pos)
    Seek to position.
    Parameters:
               pos: Stream position in millisecond.
  GetPosition(x(out): pos)
    Get the current position of stream in millisecond.
    Parameters:
               pos(out): The current stream position.
  SetPlaybackRate(d: rate)
     Set the playback rate. 
    Parameters:
               rate: rate to playback the media asset.
  GetPlaybackRate(d(out): rate)
     Get current playback rate.
    Parameters:
               rate(out): The current playback rate.
  SetVolume(i: volume)
  GetVolume(i(out): volume)
  SetVideoSize(u: x, u: y, u: w, u: h)
    Set video dimension.
    Paramters:
              x: X coordinate of top-left.
              y: Y coordinate of top-left.
              w: Width of video rectangle.
              h: Height of video rectangle.
  GetVideoSize(u(out): w, u(out): h)
    Get current width and height of video rectangle.
    Parameters:
               w(out): Width of current video rectangle.
               h(out): Height of current video rectangle.
  GetBufferedTime(x(out): length_time)
    Get the approximate duration of playable data buffered so far in millisecond.
    Parameters:
               length_time(out): amount of playable data buffered so far in millisecond.
  GetBufferedBytes(x(out): length_byte)
    Get the approximate amount of playable data buffered so far in bytes. 
    Parameters:
               length_byte(out): amount of playable data buffered so far in byte.
  GetMediaSizeTime(x(out): duration)
    Get the duration of the media.
    Parameters: 
               duration(out): duration in millisecond.
  GetMediaSizeBytes(x(out): size)
    Get the total size of the media file.
    Parameters:
               size(out): total size of the media file.
  HasVideo(b(out): has_video)
    Indicates the existance of video stream in the media asset.
    Parameters:
               has_video(out): True if media asset has video. False otherwise.
  HasAudio(b(out): has_audio)
    Indicates the existance of audio stream in the media asset.
    Parameters:
               has_audio(out): True if media asset has audio. False otherwise. 
  IsStreaming(b(out): is_stream)
    Indicates whether the URI represents a stream media.
    Parameters:
               is_stream(out): True for stream media. False otherwise.
  IsSeekable(b(out): is_seekable)
    Indicates whether this media asset is seekable.
    Parameters:
               is_seekable(out): True for seekable. False otherwise.
  SupportFullScreen(b(out): support_fullscreen)
    Indicates whether the backend supports a fullscreen mode.
    Parameters:
               support_fullscreen(out): True if backend supports fullscreen. False otherwise.
  GetPlayerState(i(out): current_state)
    Get current state of MediaPlayer object.
    Parameters:
               current_state(out): 
                                  0:Null,
                                  1:Stopped,
                                  2:Paused,
                                  3:Playing
  Reply()
    Response the UMMS server’s heartbeat check. In the attended-execution mode, client should connect to NeedReply
    signal with a callback in which Reply() method should be called.
  SetProxy(a{sv}: param)
    Set proxy stuffs.
    Parameters:
               param: A list of key-value pair to sepcify the proxy attributes.
                      The attribute structure is:
                      "proxy-uri":(s)HTTP proxy server URI
                      "proxy-id" :(s)HTTP proxy URI user id for authentication)
                      "proxy-pw" :(s)HTTP proxy URI user password for authentication
  Suspend()
    Suspend current execution of player. After this invoking, all the resources ocuppied by this session will be released.
  Restore()
    Play the media asset from the position at where it suspended.

  GetCurrentVideo(i(out): current_video)
  GetCurrentAudio(i(out): current_audio)
  SetCurrentVideo(i: current_video)
  SetCurrentAudio(i: current_audio)
  GetVideoNum(i(out): video_num)
  GetAudioNum(i(out): audio_num)
  SetSubtitleUri(s: sub_uri)
  SetCurrentSubtitle(i: current_sub)
  GetCurrentSubtitle(i(out): current_sub)
  SetBufferDepth(i: format, x: buf_depth)
  GetBufferDepth(i: format, x(out): buf_depth)
  SetMute(i: is_mute)
  IsMute(i(out): is_mute)
  SetScaleMode(i: mode)
  GetScaleMode(i(out): mode)
  GetVideoCodec(i: channel, s(out): video_codec)
  GetAudioCodec(i: channel, s(out): audio_codec)
  GetVideoBitrate(i: channel, i(out): video_bitrate)
  GetAudioBitrate(i: channel, i(out): audio_bitrate)
  GetEncapsulation(s(out): encapsulation)
  GetAudioSampleRate(i: channel, i(out): sample_rate)
  GetVideoFrameRate(i: channel, i(out): frame_rate_num, i(out): frame_rate_denum)
  GetVideoResolution(i: channel, i(out): width, i(out): height)
  GetVideoAspectRatio(i: channel, i(out): ratio_num, i(out): ratio_denum)
  GetProtocolName(s(out): protocol_name)
  Record(b: to_record, s: location)
  GetPat(aa{sv}(out): pat)
  GetPmt(u(out): program_number, u(out): pcr_pid, aa{sv}(out): stream_info)
  GetCurrentUri(s(out): current_uri)
  GetAssociatedDataChannel(s(out): ip, i(out): port)

Signals:

  Initialized
  Eof
  Error(u: id, s: message)
  Buffering
  Buffered
  RequestWindow
  Seeked
  Stopped
  PlayerStateChanged(i: old_state, i: new_state)
  NeedReply
  TargetReady(a{sv}: info)
  Suspended
  Restored
  NoResource
  VideoTagChanged(i: video_number)
  AudioTagChanged(i: audio_number)
  TextTagChanged(i: text_number)


  • Interface: com.UMMS.AudioManger'

Methods:

  SetVolume(i: output_type, i: volume)
  GetVolume(i: output_type, i(out): volume)
  SetState(i: output_type, i: state)
  GetState(i: output_type, i(out): state)

Sample Code

Personal tools