From 87b995aa1eb9fe166f113e1d35bb2b7f5885e2d8 Mon Sep 17 00:00:00 2001 From: "chen89.chen" Date: Mon, 3 Dec 2018 19:09:38 +0800 Subject: [PATCH] add service_profile field for pvr table Change-Id: I2a89f0abc806b3fa4e8a8cb09094b9b4760232a9 --- include_product/media_info_private.h | 1 + include_product/media_pvr.h | 1 + packaging/capi-content-media-content.spec | 2 +- src/media_db.c | 3 +++ src/media_pvr.c | 17 +++++++++++++++++ test/media-content_test.c | 6 ++++++ 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include_product/media_info_private.h b/include_product/media_info_private.h index 04d03f4..396c0e0 100755 --- a/include_product/media_info_private.h +++ b/include_product/media_info_private.h @@ -423,6 +423,7 @@ typedef struct { int play_count; int highlight; char* private_data; + unsigned int service_profile; } media_pvr_s; typedef struct { diff --git a/include_product/media_pvr.h b/include_product/media_pvr.h index 4a3ab98..165422c 100755 --- a/include_product/media_pvr.h +++ b/include_product/media_pvr.h @@ -73,6 +73,7 @@ int media_pvr_get_major(media_pvr_h pvr, int *major); int media_pvr_get_minor(media_pvr_h pvr, int *minor); int media_pvr_get_channel_type(media_pvr_h pvr, int *channel_type); int media_pvr_get_program_num(media_pvr_h pvr, int *program_num); +int media_pvr_get_service_profile(media_pvr_h pvr,unsigned int *service_profile); int media_pvr_get_duration(media_pvr_h pvr, int *duration); int media_pvr_get_embargo_time(media_pvr_h pvr, int *embaro_time); int media_pvr_get_expiry_time(media_pvr_h pvr, int *expiry_time); diff --git a/packaging/capi-content-media-content.spec b/packaging/capi-content-media-content.spec index 70c81a4..ae3b7a3 100755 --- a/packaging/capi-content-media-content.spec +++ b/packaging/capi-content-media-content.spec @@ -1,6 +1,6 @@ Name: capi-content-media-content Summary: A Media content library in Tizen Native API -Version: 0.3.35 +Version: 0.3.36 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_db.c b/src/media_db.c index 5d15b71..59bad95 100755 --- a/src/media_db.c +++ b/src/media_db.c @@ -1584,6 +1584,7 @@ typedef enum { MEDIA_PVR_CHANNEL_TYPE, MEDIA_PVR_CHANNEL_NAME, MEDIA_PVR_CHANNEL_NUM, + MEDIA_PVR_SERVICE_PROFILE, MEDIA_PVR_PROGRAM_TITLE, MEDIA_PVR_PROGRAM_NUM, MEDIA_PVR_PROGRAM_CRID, @@ -1648,6 +1649,8 @@ void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr) _pvr->channel_type = (int)sqlite3_column_int(stmt, MEDIA_PVR_CHANNEL_TYPE); + _pvr->service_profile = (unsigned int)sqlite3_column_int(stmt, MEDIA_PVR_SERVICE_PROFILE); + if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NAME))) _pvr->channel_name = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NAME)); diff --git a/src/media_pvr.c b/src/media_pvr.c index 9b33323..04d94d4 100755 --- a/src/media_pvr.c +++ b/src/media_pvr.c @@ -212,6 +212,7 @@ int media_pvr_clone(media_pvr_h *dst, media_pvr_h src) _dst->minor = _src->minor; _dst->channel_type = _src->channel_type; _dst->program_num = _src->program_num; + _dst->service_profile = _src->service_profile; _dst->timer_record = _src->timer_record; _dst->series_record = _src->series_record; _dst->hd = _src->hd; @@ -678,6 +679,22 @@ int media_pvr_get_program_num(media_pvr_h pvr, int *program_num) return ret; } +int media_pvr_get_service_profile(media_pvr_h pvr,unsigned int *service_profile) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + media_pvr_s *_pvr = (media_pvr_s*)pvr; + + if (_pvr && service_profile) { + *service_profile = _pvr->service_profile; + ret = MEDIA_CONTENT_ERROR_NONE; + } else { + media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + } + + return ret; +} + int media_pvr_get_duration(media_pvr_h pvr, int *duration) { int ret = MEDIA_CONTENT_ERROR_NONE; diff --git a/test/media-content_test.c b/test/media-content_test.c index 809382f..3f6035d 100755 --- a/test/media-content_test.c +++ b/test/media-content_test.c @@ -3850,6 +3850,12 @@ bool pvr_item_cb(media_pvr_h pvr, void *user_data) media_content_error("Fail to media_pvr_get_program_num"); media_content_debug("program_num [%d]", i_value); + unsigned int ui_value = 0; + ret = media_pvr_get_service_profile(pvr, &ui_value); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("Fail to media_pvr_get_service_profile"); + media_content_debug("service_profile [%u]", ui_value); + ret = media_pvr_get_duration(pvr, &i_value); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("Fail to media_pvr_get_duration"); -- 2.7.4