tv-service  0.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tv_service_proxy_live.h File Reference
#include <glib.h>
#include "tv_service_proxy_base.h"

Go to the source code of this file.

Data Structures

struct  TvServiceResolutionData
 

Typedefs

typedef gpointer TvServiceLive
 
typedef void(* TvServiceLiveCallback )(TvServiceLiveEvent event, gpointer user_data, const gpointer data)
 

Enumerations

enum  TvServiceLiveEvent {
  TV_SERVICE_LIVE_EVENT_BEGIN, TV_SERVICE_LIVE_EVENT_TUNER_LOCK, TV_SERVICE_LIVE_EVENT_CHANNEL_LOCK, TV_SERVICE_LIVE_EVENT_CHANNEL_UNLOCK,
  TV_SERVICE_LIVE_EVENT_AUTO_DESTROY, TV_SERVICE_LIVE_EVENT_RESOLUTION
}
 

Functions

gint tv_service_live_create (TvServiceLive *live)
 
gint tv_service_live_register_callback (TvServiceLive live, TvServiceLiveCallback callback_func, gpointer user_data)
 
gint tv_service_live_destroy (TvServiceLive live)
 
gint tv_service_live_tune_full (TvServiceLive live, gint freq, gint mod, gint apid, gint vpid, gint ppid)
 
gint tv_service_live_tune (TvServiceLive live, gint service_id)
 
gint tv_service_live_tune_up (TvServiceLive live, TvServiceChannelMode mode, TvServiceAntenna type)
 
gint tv_service_live_tune_down (TvServiceLive live, TvServiceChannelMode mode, TvServiceAntenna type)
 
int tv_service_live_get_service_id (TvServiceLive live, gint *service_id)
 
gint tv_service_live_set_antenna_type (TvServiceLive live, TvServiceAntenna type)
 
gint tv_service_live_get_antenna_type (TvServiceLive live, TvServiceAntenna *type)
 
gint tv_service_live_set_audio_mute (TvServiceLive live, gboolean mute)
 
gint tv_service_live_get_audio_mute (TvServiceLive live, gboolean *mute)
 
gint tv_service_live_set_volume (TvServiceLive live, gdouble volume)
 
gint tv_service_live_get_volume (TvServiceLive live, gdouble *volume)
 
gint tv_service_live_set_window_overlay (TvServiceLive live, gpointer window_id)
 
gint tv_service_live_set_video_mute (TvServiceLive live, gboolean mute)
 
gint tv_service_live_get_video_mute (TvServiceLive live, gboolean *mute)
 
gint tv_service_live_tune_by_program_number (TvServiceLive live, gint freq, gint mod, gint pro_num)
 
gint tv_service_live_get_last_channel (gint *service_id)
 
gint tv_service_live_tune_locked_channel (TvServiceLive live, gint service_id, gchar *password)
 
gboolean tv_service_live_tune_pause (TvServiceLive live)
 
gboolean tv_service_live_tune_resume (TvServiceLive live)
 

Detailed Description

This API is not official tv-service API. It can always be changed without announcement.

Typedef Documentation

typedef gpointer TvServiceLive
typedef void(* TvServiceLiveCallback)(TvServiceLiveEvent event, gpointer user_data, const gpointer data)

Enumeration Type Documentation

An enumeration. Enumeration define live event type.

Enumerator:
TV_SERVICE_LIVE_EVENT_BEGIN 
TV_SERVICE_LIVE_EVENT_TUNER_LOCK 
TV_SERVICE_LIVE_EVENT_CHANNEL_LOCK 
TV_SERVICE_LIVE_EVENT_CHANNEL_UNLOCK 
TV_SERVICE_LIVE_EVENT_AUTO_DESTROY 
TV_SERVICE_LIVE_EVENT_RESOLUTION 

Function Documentation

gint tv_service_live_create ( TvServiceLive live)

This function creates a live proxy for playing multimedia contents.
The attributes of live are created to get/set some values with application.
And, mutex, gstreamer and other resources are initialized at this time.
Before create the proxy handle, the daemon must be launched first.

Parameters
live[in] Handle of live.
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_create.
Remarks
You can create multiple handles on a context at the same time.
However, live cannot guarantee proper operation because of limitation of resources,
such as audio device or display device.
Examples:
tv_service_channel_lock_unlock_test.c, tv_service_epg_live_test.c, tv_service_live_overlay_resize_test.c, tv_service_live_overlay_tune_test.c, tv_service_live_overlay_vol_test.c, tv_service_live_test.c, tv_service_live_tune_test.c, and tv_service_utils_test.c.
gint tv_service_live_destroy ( TvServiceLive  live)

This function releases live object and all resources which were created by tv_service_live_create().
And, live handle will also be destroyed.

Parameters
live[in] Handle of live
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_destroy.
Remarks
This method can be called with a valid live handle from any state to
completely shutdown the live operation.
Examples:
tv_service_channel_lock_unlock_test.c, tv_service_epg_live_test.c, tv_service_live_overlay_resize_test.c, tv_service_live_overlay_tune_test.c, tv_service_live_overlay_vol_test.c, tv_service_live_test.c, tv_service_live_tune_test.c, and tv_service_utils_test.c.
gint tv_service_live_get_antenna_type ( TvServiceLive  live,
TvServiceAntenna type 
)

This function is to get the antenna type(AIR/CABLE/ALL), which is setted before.

Parameters
live[in] Handle of live
type[in] Pointer to get value
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_antenna_type.
Remarks
None.
Examples:
tv_service_live_overlay_tune_test.c.
gint tv_service_live_get_audio_mute ( TvServiceLive  live,
gboolean *  mute 
)

This function is to get the mute value which is setted before.

Parameters
live[in] Handle of live
mute[in] Pointer to get value
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_audio_mute.
Remarks
None.
Examples:
tv_service_live_test.c.
gint tv_service_live_get_last_channel ( gint *  service_id)

This function is to get the latest tuned service id which is setted before.

Parameters
service_id[out] Pointer to get value. Zero means no channel.
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_last_channel.
Remarks
None.
int tv_service_live_get_service_id ( TvServiceLive  live,
gint *  service_id 
)

This function is to get the current service id which is setted before.

Parameters
live[in] Handle of live
service_id[in] Pointer to get value
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_service_id.
Remarks
None.
Examples:
tv_service_live_overlay_tune_test.c.
gint tv_service_live_get_video_mute ( TvServiceLive  live,
gboolean *  mute 
)

This function is to get the mute value which is setted before.

Parameters
live[in] Handle of live
mute[in] Pointer to get value
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_video_mute.
Remarks
None.
Examples:
tv_service_live_test.c.
gint tv_service_live_get_volume ( TvServiceLive  live,
gdouble *  volume 
)

This function is to get the audio volume which is setted before.

Parameters
live[in] Handle of live
volume[in] Pointer to get value
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_get_volume.
Remarks
None.
Examples:
tv_service_live_overlay_vol_test.c, and tv_service_live_test.c.
gint tv_service_live_register_callback ( TvServiceLive  live,
TvServiceLiveCallback  callback_func,
gpointer  user_data 
)

This function sets callback function for receiving messages from daemon. So, live can notify events to application.

Parameters
live[in] Handle of live.
callback_func[in] Message callback function.
user_data[in] User user_data.
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_register_callback.
Remarks
None.
Examples:
tv_service_channel_lock_unlock_test.c, tv_service_epg_live_test.c, tv_service_live_overlay_resize_test.c, tv_service_live_overlay_tune_test.c, tv_service_live_overlay_vol_test.c, tv_service_live_test.c, and tv_service_live_tune_test.c.
gint tv_service_live_set_antenna_type ( TvServiceLive  live,
TvServiceAntenna  type 
)

This function is to set the antenna type(AIR/CABLE/ALL), if the antenna type changed, the service should be reset and the service should set the dafault channel info to daemon.

Parameters
live[in] Handle of live
type[in] Type of the tuner
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_set_antenna_type.
Remarks
None.
Examples:
tv_service_live_tune_test.c.
gint tv_service_live_set_audio_mute ( TvServiceLive  live,
gboolean  mute 
)

This function is set the audio to mute or not.

Parameters
live[in] Handle of live
mute[in] Mute or not
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_set_audio_mute.
Remarks
None.
Examples:
tv_service_live_overlay_vol_test.c, and tv_service_live_test.c.
gint tv_service_live_set_video_mute ( TvServiceLive  live,
gboolean  mute 
)

This function is set the video to mute or unmute.

Parameters
live[in] Handle of live
mute[in] Mute or unmute
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_set_video_mute.
Remarks
None.
Examples:
tv_service_live_test.c.
gint tv_service_live_set_volume ( TvServiceLive  live,
gdouble  volume 
)

This function is to set the audio volume.

Parameters
live[in] Handle of live
volume[in] The volume of audio, should be double and the value is in [0.0 ~ 10.0]
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_set_volume.
Remarks
None.
Examples:
tv_service_channel_lock_unlock_test.c, tv_service_live_overlay_vol_test.c, and tv_service_live_test.c.
gint tv_service_live_set_window_overlay ( TvServiceLive  live,
gpointer  window_id 
)

This function is to set the window id, the window id was generated by app, and the tv service does not care the window size and other window properties, just set the window id to the TVplayer.

Parameters
live[in] Handle of live
window_id[in] Value of the window id
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_set_window_overlay.
Remarks
None.
Examples:
tv_service_live_overlay_resize_test.c, tv_service_live_overlay_tune_test.c, and tv_service_live_overlay_vol_test.c.
gint tv_service_live_tune ( TvServiceLive  live,
gint  service_id 
)

This function is to set the tuner property by service id.
The service id can be transform into tuner property by calling channel info interfaces.
Than call the tv_service_live_tune_full to set tune.

Parameters
live[in] Handle of live
service_id[in] The service id of service
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune.
Remarks
None.
Examples:
tv_service_channel_lock_unlock_test.c, tv_service_epg_live_test.c, tv_service_live_overlay_tune_test.c, tv_service_live_test.c, tv_service_live_tune_test.c, and tv_service_utils_test.c.
gint tv_service_live_tune_by_program_number ( TvServiceLive  live,
gint  freq,
gint  mod,
gint  pro_num 
)

This function is to set the demuxer property and start playing media contents.
The property was containts program_number.

Parameters
live[in] Handle of live
freq[in] Frequence of channel
mod[in] Modulation of service
pro_num[in] program number of channel
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune_by_program_number.
Remarks
None.
Examples:
tv_service_live_test.c.
gint tv_service_live_tune_down ( TvServiceLive  live,
TvServiceChannelMode  mode,
TvServiceAntenna  type 
)

This function is to tune down channel, it can be tune_up by channel mode and antenna type.

Parameters
live[in] Handle of live
mode[in] value of channel mode
type[in] value of antenna type
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune_down.
Remarks
None.
Examples:
tv_service_live_overlay_tune_test.c, and tv_service_live_tune_test.c.
gint tv_service_live_tune_full ( TvServiceLive  live,
gint  freq,
gint  mod,
gint  apid,
gint  vpid,
gint  ppid 
)

This function is to set the tuner property and start playing media contents.
The property was containts freq, mod, apid, vpid.
*Demux(parser), codec and related plugins are decided at this time.

Parameters
live[in] Handle of live
freq[in] Frequence of channel
mod[in] Modulation of service
apid[in] Audio pid of service
vpid[in] Video pid of service
ppid[in] Pmt pid of service
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune_full.
Remarks
None.
Examples:
tv_service_live_overlay_resize_test.c, tv_service_live_overlay_vol_test.c, and tv_service_live_test.c.
gint tv_service_live_tune_locked_channel ( TvServiceLive  live,
gint  service_id,
gchar *  password 
)

This function is to tune the channel with was locked before, to let the uses see the tv broadcast temporary by using the passwird and service id.

Parameters
live[in] Handle of live
service_id[in] The service id of service
password[in] The password of channel
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune_lock_channel.
Remarks
None.
Examples:
tv_service_live_tune_test.c.
gboolean tv_service_live_tune_pause ( TvServiceLive  live)

temp API

Examples:
tv_service_live_test.c.
gboolean tv_service_live_tune_resume ( TvServiceLive  live)
gint tv_service_live_tune_up ( TvServiceLive  live,
TvServiceChannelMode  mode,
TvServiceAntenna  type 
)

This function is to tune up channel, it can be tune_up by channel mode and antenna type.

Parameters
live[in] Handle of live
mode[in] value of channel mode
type[in] value of antenna type
Returns
This function returns zero on success, or negative value with error code.
See Also
tv_service_live_tune_up.
Remarks
None.
Examples:
tv_service_live_overlay_tune_test.c, and tv_service_live_tune_test.c.