Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
kb_machblue_tv_service.c
Package: ST_5105DTV.rar [view]
Upload User: fy98168
Upload Date: 2015-06-26
Package Size: 13771k
Code Size: 24k
Category:
DVD
Development Platform:
C/C++
- //*****************************************************************************
- //File Name: kb_machblue_tv_service.c
- //
- //Description: service function
- //
- // used by Machblue to retrieve the system's service lists
- // used by Machblue to retrieve a service object attributes including its present event,
- // following event and event schedule list objects
- // used by Machblue to access and control the system' service contexts
- //
- //Author: steven
- //
- //Date: 2007.01.20
- //
- //Version: v1.0
- //*****************************************************************************
- #include "gendef.h"
- #include "db.h"
- #include "av.h"
- #include "avplay.h"
- #include "machblue_defines.h"
- #include "machblue_porting_core.h"
- #include "machblue_tv_defines.h"
- #include "machblue_tv_customer.h"
- #include "machblue_tv_porting.h"
- #include "kb_machblue_client.h"
- #include "kb_machblue_client_data.h"
- #include "kb_machblue_client_define.h"
- /*
- * ======================= TV Service List API ===========================================
- */
- /**
- * This function returns the number of service lists available on the platform.
- * svl_count < user provided int to store service list count >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_list_count_get(int *svl_count)
- {
- if(svl_count==NULL)
- {
- mb_printf("n[Machblue]:Service list get list count NULL.");
- return MB_FAILURE ;
- }
- *svl_count=list_last;
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service list object from the system.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_LISTS_GET notification once the request is completed.
- * The "All Channel" service list should always be at index 0 (MB_TV_SVL_ALL_ID).
- * @see MB_TV_NR_SERVICE_LISTS_GET
- * @see MB_TV_SVL_ALL_ID
- * first_svl_pos < position of the first service list to get (0 based) >
- * svl_count < pointer to number of service lists to retrieve.
- This pointer should be updated with number of service lists actually returned. >
- * svl_list < user provided list (array) of service list pointers to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_lists_get(int first_svl_pos,int *svl_count,mb_tv_service_list_t *svl_list)
- {
- mb_args_t args;
- mb_error_t ret;
- int index;
- mb_tv_service_list_t *pSvl = svl_list ;
- kb_movie_serviceList_t *pSlist=kb_mb_service_list_get();;
- if((svl_count==NULL)||(svl_list==NULL))
- {
- mb_printf("n[Machblue]:Service list get lists NULL.");
- return MB_FAILURE ;
- }
- for(index=first_svl_pos;index<*svl_count;index++)
- *(pSvl++)=&pSlist[index];
- *svl_count = index - first_svl_pos;
- MB_TV_SVL_LIST_ARG(&args)=svl_list;
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICE_LISTS_GET, &args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service list get lists send notification error.");
- return MB_FAILURE ;
- }
- return MB_SUCCESS;
- }
- /**
- * This function releases a service list object.
- * svl < service list object to release >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svl_release(mb_tv_service_list_t svl)
- {
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service list info from the system.
- * svl < service list to query >
- * svl_info < service info structure to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svl_info_get(mb_tv_service_list_t svl,mb_tv_svl_info_t *svl_info)
- {
- kb_movie_serviceList_t *pSlist=(kb_movie_serviceList_t*)svl;
- if(svl_info==NULL||pSlist==NULL)
- {
- mb_printf("n[Machblue]:Service list get information NULL.");
- return MB_FAILURE ;
- }
- *svl_info=pSlist->info;
- return MB_SUCCESS;
- }
- /**
- * This function returns the number of services available in a service list.
- * svl < service list to query >
- * service_count < pointer to int to store service count >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svl_service_count_get(mb_tv_service_list_t svl,int *service_count)
- {
- kb_movie_serviceList_t *pSlist=(kb_movie_serviceList_t*)svl;
- if((service_count==NULL)||(pSlist==NULL))
- {
- mb_printf("n[Machblue]:Service list get service count NULL.");
- return MB_FAILURE ;
- }
- *service_count=(int)pSlist->count;
- return MB_SUCCESS;
- }
- /**
- * This function retrieves service objects from a service list.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICES_GET notification once the request is completed.
- * @see MB_TV_NR_SERVICES_GET
- * svl < service list to retrieve service from >
- * first_service_pos < position of the first service to retrieve (0 based) >
- * service_count < pointer to number of service to retrieve.
- This pointer should be updated with number of services actually retrieved >
- * service_list < user provided list (array) of service pointers to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svl_services_get(mb_tv_service_list_t svl,int first_service_pos,
- int *service_count,mb_tv_service_t *service_list)
- {
- unsigned long index=0;
- mb_error_t ret;
- mb_args_t args;
- kb_movie_serviceList_t *pSlist=(kb_movie_serviceList_t*)svl;
- kb_movie_service_t **pSer=(kb_movie_service_t**)service_list;
- if(pSer==NULL||service_count==NULL||pSlist==NULL)
- {
- mb_printf("n[Machblue]:Service list get services NULL.");
- return MB_FAILURE;
- }
- for(index=first_service_pos;index-first_service_pos<*service_count&&index<pSlist->count;index++)
- *(pSer++)=&pSlist->services[index];
- *service_count=(int)(index-first_service_pos);
- pSer-=*service_count;
- MB_TV_SERVICE_LIST_ARG(&args)=pSer;
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICES_GET, &args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service list get services send notification error.");
- return MB_FAILURE ;
- }
- return MB_SUCCESS;
- }
- /*
- * ======================= TV Service API ===========================================
- */
- /**
- * This function releases a service object.
- * service < service object to release >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_release(mb_tv_service_t service)
- {
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service object from a service url.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_GET_FROM_URL notification once the request
- * is completed.
- * @see MB_TV_NR_SERVICE_GET_FROM_URL
- * url < url of the service object to retrieve. The following
- service url syntax should be used:
- @li To get a service object from a DVB triplet:
- @c "dvb://network_id.transport_id.service_id"
- @li To get a service object from an SDP url:
- @c "sdp://hostname:port/path"
- @li To get a service object from an RTSP url:
- @c "rtsp://hostname:port/path" >
- * service < pointer to service object to update >
- * @return MB_SUCCESS on success MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_get_from_url(const mb_char_t *url,mb_tv_service_t *service)
- {
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service info from the system.
- * service < service to query >
- * service_info < service info structure to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_info_get(mb_tv_service_t service,mb_tv_service_info_t *service_info)
- {
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- if(service_info==NULL|pSer==NULL)
- {
- mb_printf("n[Machblue]:Service get information NULL.");
- return MB_FAILURE;
- }
- *service_info=pSer->info;
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a given service authorization flags.
- * Note this does not indicate if the program event currently
- * running on the service is authorized. It only indicates the
- * service' status. The list of authorization flags is enumerated
- * in mb_tv_authorization_flag_t.
- * @see mb_tv_authorization_flag_t.
- * service < service to query >
- * auth_flags < pointer to service authorization flags to update. @see mb_tv_authorization_flag_t. >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_auth_flags_get(mb_tv_service_t service,unsigned int *auth_flags)
- {
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- if(auth_flags==NULL||pSer==NULL)
- {
- mb_printf("n[Machblue]:Service get auth flag NULL.");
- return MB_FAILURE;
- }
- *auth_flags=MB_TV_AF_AUTHORIZED;
- return MB_SUCCESS;
- }
- /**
- * This function retrieves the current event of a service.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_CURRENT_EVENT_GET notification once the request
- * is completed.
- * @see MB_TV_NR_SERVICE_CURRENT_EVENT_GET
- * service < service to query >
- * event < pointer to event to update >
- * @return MB_SUCCESS on success MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_current_event_get(mb_tv_service_t service,mb_tv_event_t *event)
- {
- mb_error_t ret;
- mb_args_t args;
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- kb_movie_event_t **pEvt=(kb_movie_event_t**)event;
- if(pEvt==NULL||pSer==NULL)
- {
- mb_printf("n[Machblue]:Service get current event NULL.");
- return MB_FAILURE;
- }
- *pEvt=&(pSer->current_event);
- #if MB_PLAYER_1_2
- MB_TV_EVENT_PTR_ARG(&args)=(void*)pEvt;
- #else
- MB_TV_EVENT_ARG(&args)=(long)pEvt;
- #endif
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICE_CURRENT_EVENT_GET, &args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service list get current event send notification error.");
- return MB_FAILURE ;
- }
- return MB_SUCCESS;
- }
- /**
- * This function retrieves the following event of a service.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_FOLLOWING_EVENT_GET notification once the
- * request is completed.
- * @see MB_TV_NR_SERVICE_FOLLOWING_EVENT_GET
- * service < service to query >
- * event < pointer to event to update >
- * @return MB_SUCCESS on success MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_following_event_get(mb_tv_service_t service,mb_tv_event_t *event)
- {
- mb_error_t ret;
- mb_args_t args;
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- kb_movie_event_t **pEvt=(kb_movie_event_t**)event;
- if(pEvt==NULL||pSer==NULL)
- {
- mb_printf("n[Machblue]:Service get following event NULL.");
- return MB_FAILURE;
- }
- *pEvt=&(pSer->following_event);
- #if MB_PLAYER_1_2
- MB_TV_EVENT_PTR_ARG(&args)=(void*)pEvt;
- #else
- MB_TV_EVENT_ARG(&args)=(long)pEvt;
- #endif
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICE_FOLLOWING_EVENT_GET, &args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service list get following event send notification error.");
- return MB_FAILURE ;
- }
- return MB_SUCCESS;
- }
- /**
- * This function returns an event schedule object representing a
- * section of the service complete event schedule.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_EVENT_SCHEDULE_GET notification once the request
- * is completed.
- * @see MB_TV_NR_SERVICE_EVENT_SCHEDULE_GET
- * service < service to query >
- * start_time < requested start time of the event schedule query
- window in seconds since 01/01/1970 UTC.
- If set to 0 or if the requested start time is smaller
- than the start time of the first available event of the
- event schedule cache then the first available event start
- time should be used for the query. >
- * end_time < requested end time of the event schedule query
- window in seconds since 01/01/1970 UTC.
- If set to 0 or if the requested end time is greater
- than the end time of the last available event of the
- event schedule cache then the last available event start
- time should be used for the query.>
- * event_schedule < pointer to event schedule object to update >
- * @return MB_SUCCESS on success MB_FAILURE otherwise.
- */
- #if MB_PLAYER_1_2
- mb_error_t mb_tv_service_event_schedule_get(mb_tv_service_t service,
- mb_time_t start_time,mb_time_t end_time,
- unsigned long timeout,mb_tv_event_schedule_t *event_schedule)
- #else
- mb_error_t mb_tv_service_event_schedule_get(mb_tv_service_t service,
- mb_time_t start_time,mb_time_t end_time,
- mb_tv_event_schedule_t *event_schedule)
- #endif
- {
- mb_args_t args;
- mb_error_t ret;
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- kb_movie_eventSchedule_t **pSch=(kb_movie_eventSchedule_t**)event_schedule;
- mb_printf("n[HYF]:mb_tv_service_event_schedule_get [%d][%d].",start_time,end_time);
- if((pSer==NULL)||(pSch==NULL))
- {
- mb_printf("n[Machblue]:Service get event schedule NULL.");
- return MB_FAILURE;
- }
- *pSch=&(pSer->evs[start_time]);
- MB_TV_EVS_ARG(&args)=(long)pSch;
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICE_EVENT_SCHEDULE_GET,&args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service get event schedule send notification error.");
- return MB_FAILURE;
- }
- return MB_SUCCESS;
- }
- /**
- * This function retrieves the service list object containing
- * the provided object if any. If the service is a recorded or
- * vod service that has no associated service list
- * MB_TV_INVALID_SERVICE_LIST should be returned. The function also
- * retrieve the index of the service object in the service list.
- * service < service to query >
- * svl < pointer to service list object to update >
- * index < pointer to the service index to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_svl_get(mb_tv_service_t service,mb_tv_service_list_t *svl,int *index)
- {
- mb_error_t ret;
- unsigned long serviceIndex=0,serviceCnt=0;
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- kb_movie_serviceList_t **pSlist=(kb_movie_serviceList_t**)svl;
- if(index==NULL||pSlist==NULL||pSer==NULL)
- {
- mb_printf("n[Machblue]:Service get service list NULL.");
- return MB_FAILURE;
- }
- if(pSer->svl==NULL)
- {
- mb_printf("n[Machblue]:Service get service list NULL.");
- return MB_FAILURE;
- }
- *pSlist=pSer->svl;
- ret=mb_tv_svl_service_count_get(*pSlist,(int*)&serviceCnt);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service get service count from list error.");
- return MB_FAILURE;
- }
- for(serviceIndex=0;serviceIndex<serviceCnt;serviceIndex++)
- {
- if(pSer->info.id==(*pSlist)->services[serviceIndex].info.id)
- {
- *index=(int)serviceIndex;
- break;
- }
- }
- return MB_SUCCESS;
- }
- /*
- * ======================= TV Service Context API ===========================================
- */
- /**
- * This function returns the number of service contexts
- * available on the platform.
- * svc_count < user provided int to store service context count >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_context_count_get(int *svc_count)
- {
- if(svc_count==NULL)
- {
- mb_printf("n[Machblue]:Service context get context count NULL.");
- return MB_FAILURE;
- }
- *svc_count=1;
- return MB_SUCCESS;
- }
- /**
- * This function retrieves service context objects from the system.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_CONTEXTS_GET notification once the request is
- * completed.
- * @see MB_TV_NR_SERVICE_CONTEXTS_GET
- * first_sc_pos < position of the first service context to retrieve (0 based) >
- * sc_count < pointer to number of service contexts to retrieve.
- This pointer should be updated with number of service context actually retrieved >
- * svc_list < pointer to list (array) of service contexts update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_service_contexts_get(int first_sc_pos,int *sc_count,mb_tv_service_context_t *svc_list)
- {
- mb_error_t ret;
- mb_args_t args;
- kb_movie_serviceContext_t **pContext=(kb_movie_serviceContext_t**)svc_list;
- if(pContext==NULL||sc_count==NULL)
- {
- mb_printf("n[Machblue]:Service context get context list NULL.");
- return MB_FAILURE;
- }
- *sc_count=1;
- *pContext=kb_mb_service_context_get();
- MB_TV_SVC_LIST_ARG(&args)=pContext;
- MB_TV_STATUS_ARG(&args)=MB_SUCCESS;
- ret=kb_mb_notification_send(MB_TV_NR_SERVICE_CONTEXTS_GET,&args);
- if(ret!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:Service context get context list send notification error.");
- return MB_FAILURE ;
- }
- return MB_SUCCESS;
- }
- /**
- * This function retrieves the service context object associated to a client if any.
- * client < client handle to query >
- * client_svc < pointer to service context to update with client's service context if any,
- otherwise MB_TV_INVALID_SERVICE_CONTEXT should be returned >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_get_from_client(mb_client_t client,mb_tv_service_context_t *client_svc)
- {
- kb_movie_serviceContext_t **pContext=(kb_movie_serviceContext_t**)client_svc;
- if(pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context get context from client NULL.");
- return MB_FAILURE;
- }
- *pContext=kb_mb_service_context_get();
- return MB_SUCCESS;
- }
- /**
- * This function releases a service context object.
- * svc < service context object to release >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_release(mb_tv_service_context_t svc)
- {
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service info from the system.
- * svc < service to query >
- * svc_info < service context info structure to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_info_get(mb_tv_service_context_t svc,mb_tv_service_context_info_t *svc_info)
- {
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- if(svc_info==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context get information NULL.");
- return MB_FAILURE;
- }
- *svc_info=pContext->info;
- return MB_SUCCESS;
- }
- /**
- * This function gets a service context viewport attributes
- * svc < service context to query >
- * viewport < pointer to viewport coordinates to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_viewport_get(mb_tv_service_context_t svc,mb_tv_viewport_t *viewport)
- {
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- if(viewport==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context get viewport NULL.");
- return MB_FAILURE;
- }
- *viewport=pContext->viewport;
- return MB_SUCCESS;
- }
- /**
- * This function sets a service context viewport attributes.
- * svc < service context to modify >
- * viewport < pointer to viewport coordinates to set >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_viewport_set(mb_tv_service_context_t svc,mb_tv_viewport_t *viewport)
- {
- INT32 nLeft, nTop, nRight, nBottom;
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- if(viewport==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context set viewport NULL.");
- return MB_FAILURE;
- }
- pContext->viewport =*viewport;
- nLeft = viewport->bounds.x;
- nTop = viewport->bounds.y;
- nRight = viewport->bounds.width;
- nBottom = viewport->bounds.height;
- KB_AVSetWindow(nLeft, nTop, nRight, nBottom);
- return MB_SUCCESS;
- }
- /**
- * This function retrieves a service object representing
- * the service that is currently active in a service context.
- * If the context is idle, null is returned.
- * svc < service context to query >
- * service < pointer to service context service to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_service_get(mb_tv_service_context_t svc,mb_tv_service_t *service)
- {
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- kb_movie_service_t **pSer=(kb_movie_service_t**)service;
- if(pSer==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context get current service NULL.");
- return MB_FAILURE;
- }
- *pSer=pContext->service;
- //mb_printf("n[mb_tv_svc_service_get]the service name is %s n",pContext->service->info.name);
- return MB_SUCCESS;
- }
- /**
- * This function selects a service (tune in the case of a
- * braodcast service). The currently running service if any
- * is replaced with the selected service.
- * This function is ASYNCHRONOUS. The system should send an
- * MB_TV_NR_SERVICE_SELECTED or an MB_TV_NR_SERVICE_ERROR
- * notification once the request is completed.
- * @see MB_TV_NR_SERVICE_SELECTED
- * @see MB_TV_NR_SERVICE_ERROR
- * svc < service context to modify >
- * service < service to select >
- * enable_streams < 1 if default streams should be enabled after service selection, 0 otherwise. >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_service_select(mb_tv_service_context_t svc,mb_tv_service_t service,int enable_streams)
- {
- int pPrgNO;
- UINT8 pPrgType ;
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- kb_movie_service_t *pSer=(kb_movie_service_t*)service;
- if(pSer==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context select service NULL.");
- return MB_FAILURE;
- }
- if(pSer->svl->info.id!=DTVPRG)
- pPrgType = RADIOPRG;
- else
- pPrgType = DTVPRG;
- //pPrgNO = KD_GetPrgInxBySvcID(pPrgType,pSer->info.display_id);
- pPrgNO=KD_GetPrgInxByTsidSvcID(pPrgType,pSer->serInfo.tsID,pSer->info.display_id);
- KB_DTVPlayPrg(pPrgType, pPrgNO+1);
- //mb_printf("");
- return MB_SUCCESS;
- }
- /**
- * This function retrieves the stream controller associated
- * to a service context.
- * svc < service context to query >
- * stream_controller < pointer to service context stream controller to update >
- * @return MB_SUCCESS on success, MB_FAILURE otherwise.
- */
- mb_error_t mb_tv_svc_stream_controller_get(mb_tv_service_context_t svc,mb_tv_stream_controller_t *stream_controller)
- {
- kb_movie_serviceContext_t *pContext=(kb_movie_serviceContext_t*)svc;
- kb_movie_streamController_t **pScontrol=(kb_movie_streamController_t**)stream_controller;
- if(pScontrol==NULL||pContext==NULL)
- {
- mb_printf("n[Machblue]:Service context get stream controller NULL.");
- return MB_FAILURE;
- }
- *pScontrol=pContext->stc;
- return MB_SUCCESS;
- }