libdvr: flooding logs when playing DTV [1/1]
PD#SWPL-85528
Problem:
Libdvr has flooding logs when playing DTV
Solution:
Introduce a new API dvr_wrapper_set_log_level to control log level;
Provide new macros for logging;
Adjust log levels of existing prints;
Verify:
Locally tested OK in AH212 RDK environment.
Signed-off-by: Wentao.MA <wentao.ma@amlogic.com>
Change-Id: Ie4ef235639da4d6e92e45ce8e94b85439dc04f69
diff --git a/src/dvr_playback.c b/src/dvr_playback.c
index 9c4e5d1..771fceb 100644
--- a/src/dvr_playback.c
+++ b/src/dvr_playback.c
@@ -17,8 +17,12 @@
#include "dvr_playback.h"
#include "am_crypt.h"
-#define DVR_PB_DG(_level, _fmt...) \
- DVR_DEBUG_FL(_level, "playback", _fmt)
+#define PB_LOG_TAG "libdvr-playback"
+#define DVR_PB_DEBUG(...) DVR_LOG_PRINT(LOG_LV_DEBUG, PB_LOG_TAG, __VA_ARGS__)
+#define DVR_PB_INFO(...) DVR_LOG_PRINT(LOG_LV_INFO, PB_LOG_TAG, __VA_ARGS__)
+#define DVR_PB_WARN(...) DVR_LOG_PRINT(LOG_LV_WARN, PB_LOG_TAG, __VA_ARGS__)
+#define DVR_PB_ERROR(...) DVR_LOG_PRINT(LOG_LV_ERROR, PB_LOG_TAG, __VA_ARGS__)
+#define DVR_PB_FATAL(...) DVR_LOG_PRINT(LOG_LV_FATAL, PB_LOG_TAG, __VA_ARGS__)
#define VALID_PID(_pid_) ((_pid_)>0 && (_pid_)<0x1fff)
@@ -144,23 +148,23 @@
ret = DVR_TRUE;
break;
default:
- DVR_PB_DG(1, "not support speed is set [%d]", speed);
+ DVR_PB_INFO("not support speed is set [%d]", speed);
break;
}
return ret;
}
void _dvr_tsplayer_callback_test(void *user_data, am_tsplayer_event *event)
{
- DVR_PB_DG(1, "in callback test ");
+ DVR_PB_INFO("in callback test ");
DVR_Playback_t *player = NULL;
if (user_data != NULL) {
player = (DVR_Playback_t *) user_data;
- DVR_PB_DG(1, "play speed [%f] in callback test ", player->speed);
+ DVR_PB_INFO("play speed [%f] in callback test ", player->speed);
}
switch (event->type) {
case AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED:
{
- DVR_PB_DG(1,"[evt] test AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED: %d x %d @%d\n",
+ DVR_PB_INFO("[evt] test AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED: %d x %d @%d\n",
event->event.video_format.frame_width,
event->event.video_format.frame_height,
event->event.video_format.frame_rate);
@@ -168,7 +172,7 @@
}
case AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME:
{
- DVR_PB_DG(1, "[evt] test AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME\n");
+ DVR_PB_INFO("[evt] test AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME\n");
player->first_frame = 1;
break;
}
@@ -181,12 +185,12 @@
DVR_Playback_t *player = NULL;
if (user_data != NULL) {
player = (DVR_Playback_t *) user_data;
- DVR_PB_DG(1, "play speed [%f] in-- callback", player->speed);
+ DVR_PB_INFO("play speed [%f] in-- callback", player->speed);
}
switch (event->type) {
case AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED:
{
- DVR_PB_DG(1,"[evt] AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED: %d x %d @%d\n",
+ DVR_PB_INFO("[evt] AM_TSPLAYER_EVENT_TYPE_VIDEO_CHANGED: %d x %d @%d\n",
event->event.video_format.frame_width,
event->event.video_format.frame_height,
event->event.video_format.frame_rate);
@@ -194,7 +198,7 @@
}
case AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME:
{
- DVR_PB_DG(1, "[evt] AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME\n");
+ DVR_PB_INFO("[evt] AM_TSPLAYER_EVENT_TYPE_FIRST_FRAME\n");
if (player->first_trans_ok == DVR_FALSE) {
player->first_trans_ok = DVR_TRUE;
_dvr_playback_sent_transition_ok((DVR_PlaybackHandle_t)player, DVR_FALSE);
@@ -206,28 +210,28 @@
break;
}
case AM_TSPLAYER_EVENT_TYPE_DECODE_FIRST_FRAME_AUDIO:
- DVR_PB_DG(1, "[evt]AM_TSPLAYER_EVENT_TYPE_DECODE_FIRST_FRAME_AUDIO [%d]\n", event->type);
+ DVR_PB_INFO("[evt]AM_TSPLAYER_EVENT_TYPE_DECODE_FIRST_FRAME_AUDIO [%d]\n", event->type);
if (player->first_trans_ok == DVR_FALSE && player->has_video == DVR_FALSE) {
player->first_trans_ok = DVR_TRUE;
_dvr_playback_sent_transition_ok((DVR_PlaybackHandle_t)player, DVR_FALSE);
}
if (player != NULL && player->has_video == DVR_FALSE) {
- DVR_PB_DG(1, "[evt]AM_TSPLAYER_EVENT_TYPE_DECODE_FIRST_FRAME_AUDIO [%d]\n", event->type);
+ DVR_PB_INFO("[evt]AM_TSPLAYER_EVENT_TYPE_DECODE_FIRST_FRAME_AUDIO [%d]\n", event->type);
player->first_frame = 1;
player->seek_pause = DVR_FALSE;
}
break;
default:
- DVR_PB_DG(1, "[evt]unkown event [%d]\n", event->type);
+ DVR_PB_INFO("[evt]unkown event [%d]\n", event->type);
break;
}
if (player&&player->player_callback_func) {
- DVR_PB_DG(1, "player is nonull, --call callback\n");
+ DVR_PB_INFO("player is nonull, --call callback\n");
player->player_callback_func(player->player_callback_userdata, event);
} else if (player == NULL){
- DVR_PB_DG(1, "player is null, get userdata error\n");
+ DVR_PB_INFO("player is null, get userdata error\n");
} else {
- DVR_PB_DG(1, "player callback is null, get callback error\n");
+ DVR_PB_INFO("player callback is null, get callback error\n");
}
}
@@ -304,7 +308,7 @@
uint32_t s;
clock_gettime(CLOCK_REALTIME, &ts);
s = (uint32_t)(ts.tv_sec);
- DVR_PB_DG(1, "n:%u", s);
+ DVR_PB_INFO("n:%u", s);
return s;
}
@@ -325,7 +329,7 @@
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -352,11 +356,11 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
int64_t cache = 0;
if (player == NULL || player->handle == (am_tsplayer_handle)NULL) {
- DVR_PB_DG(1, "tsplayer delay time error, handle is NULL");
+ DVR_PB_INFO("tsplayer delay time error, handle is NULL");
return 0;
}
AmTsPlayer_getDelayTime(player->handle, &cache);
- DVR_PB_DG(1, "tsplayer cache time [%lld]ms", cache);
+ DVR_PB_INFO("tsplayer cache time [%lld]ms", cache);
return cache;
}
//send signal
@@ -365,13 +369,13 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;\
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "lock---");
+ DVR_PB_DEBUG("lock---");
dvr_mutex_lock(&player->lock);
pthread_cond_signal(&player->cond);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
return 0;
}
@@ -382,7 +386,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -392,7 +396,7 @@
break;
case DVR_PLAYBACK_EVENT_TRANSITION_OK:
//GET STATE
- DVR_PB_DG(1, "trans ok EVENT");
+ DVR_PB_INFO("trans ok EVENT");
_dvr_playback_get_status(handle, &(notify->play_status), is_lock);
break;
case DVR_PLAYBACK_EVENT_TRANSITION_FAILED:
@@ -403,12 +407,12 @@
break;
case DVR_PLAYBACK_EVENT_REACHED_BEGIN:
//GET STATE
- DVR_PB_DG(1, "reached begin EVENT");
+ DVR_PB_INFO("reached begin EVENT");
_dvr_playback_get_status(handle, &(notify->play_status), is_lock);
break;
case DVR_PLAYBACK_EVENT_REACHED_END:
//GET STATE
- DVR_PB_DG(1, "reached end EVENT");
+ DVR_PB_INFO("reached end EVENT");
_dvr_playback_get_status(handle, &(notify->play_status), is_lock);
break;
case DVR_PLAYBACK_EVENT_NOTIFY_PLAYTIME:
@@ -440,7 +444,7 @@
return DVR_SUCCESS;
}
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -452,7 +456,7 @@
} else if (player->send_time >= _dvr_time_getClock()) {
if ((player->send_time - _dvr_time_getClock()) > 1000) {
player->send_time = _dvr_time_getClock() + 500;
- DVR_PB_DG(1, "player send time occur system time changed!!!!!");
+ DVR_PB_INFO("player send time occur system time changed!!!!!");
} else {
return DVR_SUCCESS;
}
@@ -477,7 +481,7 @@
int ret = DVR_FAILURE;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
ret = segment_ongoing(player->r_handle);
@@ -491,7 +495,7 @@
static int _dvr_init_fffb_t(DVR_PlaybackHandle_t handle) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
player->fffb_start = _dvr_time_getClock();
- DVR_PB_DG(1, " player->fffb_start:%u", player->fffb_start);
+ DVR_PB_INFO(" player->fffb_start:%u", player->fffb_start);
player->fffb_current = player->fffb_start;
//get segment current time pos
player->fffb_start_pcr = _dvr_get_cur_time(handle);
@@ -503,7 +507,7 @@
static int _dvr_init_fffb_time(DVR_PlaybackHandle_t handle) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
player->fffb_start = _dvr_time_getClock();
- DVR_PB_DG(1, " player->fffb_start:%u", player->fffb_start);
+ DVR_PB_INFO(" player->fffb_start:%u", player->fffb_start);
player->fffb_current = player->fffb_start;
//get segment current time pos
player->fffb_start_pcr = _dvr_get_cur_time(handle);
@@ -520,7 +524,7 @@
DVR_PlaybackSegmentInfo_t *pre_segment = NULL;
if (player == NULL) {
- DVR_PB_DG(1, " player is NULL");
+ DVR_PB_INFO(" player is NULL");
return DVR_FAILURE;
}
@@ -544,7 +548,7 @@
found = 1;
} else {
//not find next id.
- DVR_PB_DG(1, "not has find next segment on fb mode");
+ DVR_PB_INFO("not has find next segment on fb mode");
return DVR_FAILURE;
}
}
@@ -557,10 +561,10 @@
}
if (found != 2) {
//list is null or reache list end
- DVR_PB_DG(1, "not found next segment return failure");
+ DVR_PB_INFO("not found next segment return failure");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "found next segment return success");
+ DVR_PB_INFO("found next segment return success");
return DVR_SUCCESS;
}
@@ -573,7 +577,7 @@
uint64_t segmentid;
uint32_t pos;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -583,10 +587,10 @@
//case cur id < segment id
if (player->cur_segment_id <= segmentid) {
//expired ts data is player,return error
- DVR_PB_DG(1, "reach start segment ,return error");
+ DVR_PB_INFO("reach start segment ,return error");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "has segment to fb play [%lld][%u]", segmentid, pos);
+ DVR_PB_INFO("has segment to fb play [%lld][%u]", segmentid, pos);
}
int found = 0;
@@ -610,7 +614,7 @@
found = 1;
} else {
//not find next id.
- DVR_PB_DG(1, "not find next segment on fb mode");
+ DVR_PB_INFO("not find next segment on fb mode");
return DVR_FAILURE;
}
}
@@ -635,7 +639,7 @@
player->cur_segment_id = segment->segment_id;
player->cur_segment.segment_id = segment->segment_id;
player->cur_segment.flags = segment->flags;
- DVR_PB_DG(1, "set cur id cur flag[0x%x]segment->flags flag[0x%x] id [%lld]", player->cur_segment.flags, segment->flags, segment->segment_id);
+ DVR_PB_INFO("set cur id cur flag[0x%x]segment->flags flag[0x%x] id [%lld]", player->cur_segment.flags, segment->flags, segment->segment_id);
memcpy(player->cur_segment.location, segment->location, DVR_MAX_LOCATION_SIZE);
//pids
memcpy(&player->cur_segment.pids, &segment->pids, sizeof(DVR_PlaybackPids_t));
@@ -651,7 +655,7 @@
player->cur_segment_id = pre_segment->segment_id;
player->cur_segment.segment_id = pre_segment->segment_id;
player->cur_segment.flags = pre_segment->flags;
- DVR_PB_DG(1, "set cur id fb last one cur flag[0x%x]segment->flags flag[0x%x] id [%lld]", player->cur_segment.flags, pre_segment->flags, pre_segment->segment_id);
+ DVR_PB_INFO("set cur id fb last one cur flag[0x%x]segment->flags flag[0x%x] id [%lld]", player->cur_segment.flags, pre_segment->flags, pre_segment->segment_id);
memcpy(player->cur_segment.location, pre_segment->location, DVR_MAX_LOCATION_SIZE);
//pids
memcpy(&player->cur_segment.pids, &pre_segment->pids, sizeof(DVR_PlaybackPids_t));
@@ -671,20 +675,20 @@
int ret = DVR_SUCCESS;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
pthread_mutex_lock(&player->segment_lock);
retry:
ret = _dvr_get_next_segmentId(handle);
if (ret == DVR_FAILURE) {
- DVR_PB_DG(1, "not found segment info");
+ DVR_PB_INFO("not found segment info");
pthread_mutex_unlock(&player->segment_lock);
return DVR_FAILURE;
}
if (player->r_handle != NULL) {
- DVR_PB_DG(1, "close segment");
+ DVR_PB_INFO("close segment");
segment_close(player->r_handle);
player->r_handle = NULL;
}
@@ -694,11 +698,11 @@
memcpy(params.location, player->cur_segment.location, DVR_MAX_LOCATION_SIZE);
params.segment_id = (uint64_t)player->cur_segment.segment_id;
params.mode = SEGMENT_MODE_READ;
- DVR_PB_DG(1, "open segment location[%s]id[%lld]flag[0x%x]", params.location, params.segment_id, player->cur_segment.flags);
+ DVR_PB_INFO("open segment location[%s]id[%lld]flag[0x%x]", params.location, params.segment_id, player->cur_segment.flags);
ret = segment_open(¶ms, &(player->r_handle));
if (ret == DVR_FAILURE) {
- DVR_PB_DG(1, "open segment error");
+ DVR_PB_INFO("open segment error");
goto retry;
}
// Keep the start segment_id when the first segment_open is called during a playback
@@ -712,11 +716,11 @@
//seek end pos -FB_DEFAULT_LEFT_TIME
player->ts_cache_len = 0;
segment_seek(player->r_handle, total - FB_DEFAULT_LEFT_TIME, player->openParams.block_size);
- DVR_PB_DG(1, "seek pos [%d]", total - FB_DEFAULT_LEFT_TIME);
+ DVR_PB_INFO("seek pos [%d]", total - FB_DEFAULT_LEFT_TIME);
}
player->dur = total;
pthread_mutex_unlock(&player->segment_lock);
- DVR_PB_DG(1, "next segment dur [%d] flag [0x%x]", player->dur, player->cur_segment.flags);
+ DVR_PB_INFO("next segment dur [%d] flag [0x%x]", player->dur, player->cur_segment.flags);
return ret;
}
@@ -727,7 +731,7 @@
Segment_OpenParams_t params;
int ret = DVR_SUCCESS;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (segment_id == player->cur_segment_id && player->segment_is_open == DVR_TRUE) {
@@ -735,10 +739,10 @@
}
uint64_t id = segment_id;
if (id < 0) {
- DVR_PB_DG(1, "not found segment info");
+ DVR_PB_INFO("not found segment info");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "start found segment[%lld]info", id);
+ DVR_PB_INFO("start found segment[%lld]info", id);
pthread_mutex_lock(&player->segment_lock);
DVR_PlaybackSegmentInfo_t *segment;
@@ -747,12 +751,12 @@
list_for_each_entry(segment, &player->segment_list, head)
{
- DVR_PB_DG(1, "see 1 location [%s]id[%lld]flag[%x]segment_id[%lld]", segment->location, segment->segment_id, segment->flags, segment_id);
+ DVR_PB_INFO("see 1 location [%s]id[%lld]flag[%x]segment_id[%lld]", segment->location, segment->segment_id, segment->flags, segment_id);
if (segment->segment_id == segment_id) {
found = 1;
}
if (found == 1) {
- DVR_PB_DG(1, "found [%s]id[%lld]flag[%x]segment_id[%lld]", segment->location, segment->segment_id, segment->flags, segment_id);
+ DVR_PB_INFO("found [%s]id[%lld]flag[%x]segment_id[%lld]", segment->location, segment->segment_id, segment->flags, segment_id);
//get segment info
player->segment_is_open = DVR_TRUE;
player->cur_segment_id = segment->segment_id;
@@ -761,12 +765,12 @@
strncpy(player->cur_segment.location, segment->location, sizeof(segment->location));//DVR_MAX_LOCATION_SIZE
//pids
memcpy(&player->cur_segment.pids, &segment->pids, sizeof(DVR_PlaybackPids_t));
- DVR_PB_DG(1, "cur found location [%s]id[%lld]flag[%x]", player->cur_segment.location, player->cur_segment.segment_id,player->cur_segment.flags);
+ DVR_PB_INFO("cur found location [%s]id[%lld]flag[%x]", player->cur_segment.location, player->cur_segment.segment_id,player->cur_segment.flags);
break;
}
}
if (found == 0) {
- DVR_PB_DG(1, "not found segment info.error..");
+ DVR_PB_INFO("not found segment info.error..");
pthread_mutex_unlock(&player->segment_lock);
return DVR_FAILURE;
}
@@ -775,14 +779,14 @@
strncpy(params.location, player->cur_segment.location, sizeof(player->cur_segment.location));
params.segment_id = (uint64_t)player->cur_segment.segment_id;
params.mode = SEGMENT_MODE_READ;
- DVR_PB_DG(1, "open segment location[%s][%lld]cur flag[0x%x]", params.location, params.segment_id, player->cur_segment.flags);
+ DVR_PB_INFO("open segment location[%s][%lld]cur flag[0x%x]", params.location, params.segment_id, player->cur_segment.flags);
if (player->r_handle != NULL) {
segment_close(player->r_handle);
player->r_handle = NULL;
}
ret = segment_open(¶ms, &(player->r_handle));
if (ret == DVR_FAILURE) {
- DVR_PB_DG(1, "segment opne error");
+ DVR_PB_INFO("segment opne error");
}
// Keep the start segment_id when the first segment_open is called during a playback
if (player->first_start_id == UINT64_MAX) {
@@ -791,7 +795,7 @@
pthread_mutex_unlock(&player->segment_lock);
player->dur = _dvr_get_end_time(handle);
- DVR_PB_DG(1, "player->dur [%d]cur id [%lld]cur flag [0x%x]\r\n", player->dur,player->cur_segment.segment_id, player->cur_segment.flags);
+ DVR_PB_INFO("player->dur [%d]cur id [%lld]cur flag [0x%x]\r\n", player->dur,player->cur_segment.segment_id, player->cur_segment.flags);
return ret;
}
@@ -805,7 +809,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
DVR_PlaybackSegmentInfo_t *segment;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -824,7 +828,7 @@
//get segment info
if (player->cur_segment_id != UINT64_MAX)
player->cur_segment_id = segment->segment_id;
- DVR_PB_DG(1, "get play info id [%lld]", player->cur_segment_id);
+ DVR_PB_INFO("get play info id [%lld]", player->cur_segment_id);
player->cur_segment.segment_id = segment->segment_id;
player->cur_segment.flags = segment->flags;
//pids
@@ -845,14 +849,14 @@
aparam->pid = segment->pids.audio.pid;
adparam->codectype =_dvr_convert_stream_fmt(segment->pids.ad.format, DVR_TRUE);
adparam->pid =segment->pids.ad.pid;
- DVR_PB_DG(1, "get play info sucess[0x%x]apid[0x%x]vfmt[%d]afmt[%d]", vparam->pid, aparam->pid, vparam->codectype, aparam->codectype);
+ DVR_PB_INFO("get play info sucess[0x%x]apid[0x%x]vfmt[%d]afmt[%d]", vparam->pid, aparam->pid, vparam->codectype, aparam->codectype);
found = 2;
break;
}
}
if (found != 2) {
//list is null or reache list end
- DVR_PB_DG(1, "get play info fail");
+ DVR_PB_INFO("get play info fail");
return DVR_FAILURE;
}
@@ -861,7 +865,7 @@
static int _dvr_replay_changed_pid(DVR_PlaybackHandle_t handle) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -874,7 +878,7 @@
_do_check_pid_info(handle, player->last_segment.pids, player->cur_segment.pids, 2);
//check audio pids stop or restart
_do_check_pid_info(handle, player->last_segment.pids, player->cur_segment.pids, 1);
- DVR_PB_DG(1, ":last apid: %d set apid: %d", player->last_segment.pids.audio.pid,player->cur_segment.pids.audio.pid);
+ DVR_PB_INFO(":last apid: %d set apid: %d", player->last_segment.pids.audio.pid,player->cur_segment.pids.audio.pid);
//check pcr pids stop or restart
_do_check_pid_info(handle, player->last_segment.pids, player->cur_segment.pids, 3);
}
@@ -885,18 +889,18 @@
{
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_TRUE;
}
char buf[10];
dvr_prop_read("vendor.tv.libdvr.con", buf, sizeof(buf));
- DVR_PB_DG(1, "player get prop[%d][%s]", atoi(buf), buf);
+ DVR_PB_INFO("player get prop[%d][%s]", atoi(buf), buf);
if (atoi(buf) != 1) {
//return DVR_TRUE;
}
- DVR_PB_DG(1, ":play speed: %f ply dur: %u sys_dur: %u",
+ DVR_PB_INFO(":play speed: %f ply dur: %u sys_dur: %u",
player->speed,
player->con_spe.ply_dur,
player->con_spe.sys_dur);
@@ -915,14 +919,14 @@
{
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (player->vendor == DVR_PLAYBACK_VENDOR_AML) {
- DVR_PB_DG(1, "vendor is amlogic. no used segment flag to hide or show av");
+ DVR_PB_INFO("vendor is amlogic. no used segment flag to hide or show av");
return DVR_SUCCESS;
}
- DVR_PB_DG(1, "flag[0x%x]id[%lld]last[0x%x][%llu]",
+ DVR_PB_INFO("flag[0x%x]id[%lld]last[0x%x][%llu]",
player->cur_segment.flags,
player->cur_segment.segment_id,
player->last_segment.flags,
@@ -930,13 +934,13 @@
if ((player->cur_segment.flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == DVR_PLAYBACK_SEGMENT_DISPLAYABLE &&
(player->last_segment.flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == 0) {
//enable display
- DVR_PB_DG(1, "unmute");
+ DVR_PB_INFO("unmute");
AmTsPlayer_showVideo(player->handle);
AmTsPlayer_setAudioMute(player->handle, 0, 0);
} else if ((player->cur_segment.flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == 0 &&
(player->last_segment.flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == DVR_PLAYBACK_SEGMENT_DISPLAYABLE) {
//disable display
- DVR_PB_DG(1, "mute");
+ DVR_PB_INFO("mute");
AmTsPlayer_hideVideo(player->handle);
AmTsPlayer_setAudioMute(player->handle, 1, 1);
}
@@ -950,7 +954,7 @@
static DVR_Bool_t _dvr_pauselive_decode_sucess(DVR_PlaybackHandle_t handle) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_TRUE;
}
if (player->first_frame == 1) {
@@ -984,26 +988,26 @@
memset(prop_buf, 0 ,sizeof(prop_buf));
dvr_prop_read("vendor.tv.libdvr.writetm", prop_buf, sizeof(prop_buf));
- DVR_PB_DG(1, "---vendor.tv.libdvr.writetm get prop[%d][%s]block_size[%d]", atoi(prop_buf), prop_buf, player->openParams.block_size);
+ DVR_PB_INFO("---vendor.tv.libdvr.writetm get prop[%d][%s]block_size[%d]", atoi(prop_buf), prop_buf, player->openParams.block_size);
if (atoi(prop_buf) > 0)
write_timeout_ms = atoi(prop_buf);
memset(prop_buf, 0 ,sizeof(prop_buf));
dvr_prop_read("vendor.tv.libdvr.waittm", prop_buf, sizeof(prop_buf));
- DVR_PB_DG(1, "---vendor.tv.libdvr.waittm get prop[%d][%s]block_size[%d]", atoi(prop_buf), prop_buf, player->openParams.block_size);
+ DVR_PB_INFO("---vendor.tv.libdvr.waittm get prop[%d][%s]block_size[%d]", atoi(prop_buf), prop_buf, player->openParams.block_size);
if (atoi(prop_buf) > 0)
timeout = atoi(prop_buf);
if (player->is_secure_mode) {
if (dec_buf_size > player->secure_buffer_size) {
- DVR_PB_DG(1, "playback blocksize too large");
+ DVR_PB_INFO("playback blocksize too large");
return NULL;
}
}
buf = malloc(buf_len);
if (!buf) {
- DVR_PB_DG(1, "Malloc buffer failed");
+ DVR_PB_INFO("Malloc buffer failed");
return NULL;
}
wbufs.buf_type = TS_INPUT_BUFFER_TYPE_NORMAL;
@@ -1011,7 +1015,7 @@
dec_bufs.buf_data = malloc(dec_buf_size);
if (!dec_bufs.buf_data) {
- DVR_PB_DG(1, "Malloc dec buffer failed");
+ DVR_PB_INFO("Malloc dec buffer failed");
free(buf);
return NULL;
}
@@ -1028,10 +1032,10 @@
buf = NULL;
}
free(dec_bufs.buf_data);
- DVR_PB_DG(1, "get segment error");
+ DVR_PB_INFO("get segment error");
return NULL;
}
- DVR_PB_DG(1, "--player->vendor %d,player->has_video[%d] bufsize[0x%x]whole block[%d]",
+ DVR_PB_INFO("--player->vendor %d,player->has_video[%d] bufsize[0x%x]whole block[%d]",
player->vendor, player->has_video, buf_len, b_writed_whole_block);
//get play statue not here,send ok event when vendor is aml or only audio channel if not send ok event
if (((player->first_trans_ok == DVR_FALSE) && (player->vendor == DVR_PLAYBACK_VENDOR_AML) ) ||
@@ -1048,7 +1052,7 @@
while (player->is_running/* || player->cmd.last_cmd != player->cmd.cur_cmd*/) {
//check trick stat
- //DVR_PB_DG(1, "lock check_no_data_time:%d", check_no_data_time);
+ //DVR_PB_INFO("lock check_no_data_time:%d", check_no_data_time);
dvr_mutex_lock(&player->lock);
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_SEEK ||
@@ -1060,7 +1064,7 @@
{
trick_stat = _dvr_playback_get_trick_stat((DVR_PlaybackHandle_t)player);
if (trick_stat > 0) {
- DVR_PB_DG(1, "trick stat[%d] is > 0 cur cmd[%d]last cmd[%d]flag[0x%x]",
+ DVR_PB_INFO("trick stat[%d] is > 0 cur cmd[%d]last cmd[%d]flag[0x%x]",
trick_stat, player->cmd.cur_cmd, player->cmd.last_cmd, player->play_flag);
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_SEEK || (player->play_flag&DVR_PLAYBACK_STARTED_PAUSEDLIVE) == DVR_PLAYBACK_STARTED_PAUSEDLIVE) {
//check last cmd
@@ -1070,7 +1074,7 @@
||player->cmd.last_cmd == DVR_PLAYBACK_CMD_VSTART
|| player->cmd.last_cmd == DVR_PLAYBACK_CMD_ASTART
|| player->cmd.last_cmd == DVR_PLAYBACK_CMD_START))) {
- DVR_PB_DG(1, "pause play-------cur cmd[%d]last cmd[%d]flag[0x%x]",
+ DVR_PB_INFO("pause play-------cur cmd[%d]last cmd[%d]flag[0x%x]",
player->cmd.cur_cmd, player->cmd.last_cmd, player->play_flag);
//need change to pause state
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_PAUSE;
@@ -1083,7 +1087,7 @@
AmTsPlayer_pauseVideoDecoding(player->handle);
AmTsPlayer_pauseAudioDecoding(player->handle);
} else {
- DVR_PB_DG(1, "clear first frame value-------");
+ DVR_PB_INFO("clear first frame value-------");
player->first_frame = 0;
}
} else if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF
@@ -1091,7 +1095,7 @@
||player->speed > FF_SPEED ||player->speed < FB_SPEED) {
//restart play stream if speed > 2
if (player->state == DVR_PLAYBACK_STATE_PAUSE) {
- DVR_PB_DG(1, "fffb pause state----speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
+ DVR_PB_INFO("fffb pause state----speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
player->speed,
player->fffb_current,
_dvr_time_getClock(),
@@ -1101,11 +1105,11 @@
//dvr_mutex_unlock(&player->lock);
//dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
continue;
} else if (_dvr_time_getClock() < player->next_fffb_time) {
- DVR_PB_DG(1, "fffb timeout-to pause video---speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
+ DVR_PB_INFO("fffb timeout-to pause video---speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
player->speed,
player->fffb_current,
_dvr_time_getClock(),
@@ -1116,35 +1120,31 @@
//dvr_mutex_lock(&player->lock);
AmTsPlayer_pauseVideoDecoding(player->handle);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
continue;
}
- DVR_PB_DG(1, "fffb play-------speed[%f][%d][%d][%s][%d]",
+ DVR_PB_INFO("fffb play-------speed[%f][%d][%d][%s][%d]",
player->speed,
goto_rewrite,
real_read,
_dvr_playback_state_toString(player->state),
player->cmd.cur_cmd);
-
goto_rewrite = DVR_FALSE;
real_read = 0;
player->play_flag = player->play_flag & (~DVR_PLAYBACK_STARTED_PAUSEDLIVE);
player->first_frame = 0;
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_INFO("unlock---");
dvr_mutex_unlock(&player->lock);
_dvr_playback_fffb((DVR_PlaybackHandle_t)player);
-
- DVR_PB_DG(1, "lock---");
+ DVR_PB_DEBUG("lock---");
dvr_mutex_lock(&player->lock);
-
player->fffb_play = DVR_FALSE;
-
} else if(player->state == DVR_PLAYBACK_STATE_PAUSE) {
//on pause state,user seek to new pos,we need pause and wait
//user to resume
- DVR_PB_DG(1, "pause, when got first frame event when user seek end");
+ DVR_PB_INFO("pause, when got first frame event when user seek end");
player->first_frame = 0;
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
AmTsPlayer_pauseVideoDecoding(player->handle);
@@ -1154,7 +1154,7 @@
//for first into fffb when reset speed
if (player->state == DVR_PLAYBACK_STATE_PAUSE ||
_dvr_time_getClock() < player->next_fffb_time) {
- DVR_PB_DG(1, "fffb timeout-fffb play---speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
+ DVR_PB_INFO("fffb timeout-fffb play---speed[%f] fffb cur[%u] cur sys[%u] [%s] [%u]",
player->speed,
player->fffb_current,
_dvr_time_getClock(),
@@ -1164,18 +1164,18 @@
//dvr_mutex_unlock(&player->lock);
//dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
continue;
}
- DVR_PB_DG(1, "fffb replay-------speed[%f][%d][%d][%s][%d]player->fffb_play[%d]",
+ DVR_PB_INFO("fffb replay-------speed[%f][%d][%d][%s][%d]player->fffb_play[%d]",
player->speed,
goto_rewrite,
real_read,
_dvr_playback_state_toString(player->state),
player->cmd.cur_cmd,
player->fffb_play);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
goto_rewrite = DVR_FALSE;
real_read = 0;
@@ -1191,13 +1191,13 @@
if (player->state == DVR_PLAYBACK_STATE_PAUSE
&& player->seek_pause == DVR_FALSE) {
//check is need send time send end
- DVR_PB_DG(1, "pause, continue");
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_INFO("pause, continue");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
_dvr_playback_sent_playtime((DVR_PlaybackHandle_t)player, DVR_FALSE);
dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
continue;
}
@@ -1209,10 +1209,10 @@
}
if (goto_rewrite == DVR_TRUE) {
goto_rewrite = DVR_FALSE;
- //DVR_PB_DG(1, "unlock---");
+ //DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
_dvr_playback_sent_playtime((DVR_PlaybackHandle_t)player, DVR_FALSE);
- //DVR_PB_DG(1, "rewrite-player->speed[%f]", player->speed);
+ //DVR_PB_INFO("rewrite-player->speed[%f]", player->speed);
goto rewrite;
}
//.check is need send time send end
@@ -1220,17 +1220,17 @@
_dvr_playback_sent_playtime((DVR_PlaybackHandle_t)player, DVR_FALSE);
dvr_mutex_lock(&player->lock);
pthread_mutex_lock(&player->segment_lock);
- //DVR_PB_DG(1, "start read");
+ //DVR_PB_INFO("start read");
int read = segment_read(player->r_handle, buf + real_read, buf_len - real_read);
real_read = real_read + read;
player->ts_cache_len = real_read;
- //DVR_PB_DG(1, "start read end [%d]", read);
+ //DVR_PB_INFO("start read end [%d]", read);
pthread_mutex_unlock(&player->segment_lock);
- //DVR_PB_DG(1, "unlock---");
+ //DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
if (read < 0 && errno == EIO) {
//EIO ERROR, EXIT THRAD
- DVR_PB_DG(1, "read error.EIO error, exit thread");
+ DVR_PB_INFO("read error.EIO error, exit thread");
DVR_Play_Notify_t notify;
memset(¬ify, 0 , sizeof(DVR_Play_Notify_t));
notify.event = DVR_PLAYBACK_EVENT_ERROR;
@@ -1238,25 +1238,25 @@
_dvr_playback_sent_event((DVR_PlaybackHandle_t)player,DVR_PLAYBACK_EVENT_ERROR, ¬ify, DVR_TRUE);
goto end;
} else if (read < 0) {
- DVR_PB_DG(1, "read error.:%d EIO:%d", errno, EIO);
+ DVR_PB_INFO("read error.:%d EIO:%d", errno, EIO);
}
//if on fb mode and read file end , we need calculate pos to retry read.
if (read == 0 && IS_FB(player->speed) && real_read == 0) {
- DVR_PB_DG(1, "recalculate read [%d] readed [%d]buf_len[%d]speed[%f]id=[%llu]",
+ DVR_PB_INFO("recalculate read [%d] readed [%d]buf_len[%d]speed[%f]id=[%llu]",
read,
real_read,
buf_len,
player->speed,
player->cur_segment_id);
_dvr_playback_calculate_seekpos((DVR_PlaybackHandle_t)player);
- DVR_PB_DG(1, "lock---");
+ DVR_PB_DEBUG("lock---");
dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
continue;
}
- //DVR_PB_DG(1, "read ts [%d]buf_len[%d]speed[%f]real_read:%d", read, buf_len, player->speed, real_read);
+ //DVR_PB_INFO("read ts [%d]buf_len[%d]speed[%f]real_read:%d", read, buf_len, player->speed, real_read);
if (read == 0) {
//file end.need to play next segment
#define MIN_CACHE_TIME (3000)
@@ -1266,13 +1266,13 @@
//dvr_mutex_lock(&player->lock);
/*if cache time > 20s , we think get time is error,*/
if (_cache_time - MIN_CACHE_TIME > 20 * 1000) {
- DVR_PB_DG(1, "read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
- DVR_PB_DG(1, "read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
- DVR_PB_DG(1, "read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
+ DVR_PB_INFO("read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
+ DVR_PB_INFO("read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
+ DVR_PB_INFO("read end but cache time is %d > 20s, this is an error at media_hal", _cache_time);
}
//_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, ((_cache_time - MIN_CACHE_TIME) > MIN_CACHE_TIME ? MIN_CACHE_TIME : (_cache_time - MIN_CACHE_TIME)));
//dvr_mutex_unlock(&player->lock);
- // DVR_PB_DG(1, "read end but cache time is %d > %d, to sleep end and continue", _cache_time, MIN_CACHE_TIME);
+ // DVR_PB_INFO("read end but cache time is %d > %d, to sleep end and continue", _cache_time, MIN_CACHE_TIME);
//continue;
}
@@ -1284,14 +1284,14 @@
if (ret != DVR_SUCCESS && delay < MIN_TSPLAYER_DELAY_TIME) {
player->noData++;
- DVR_PB_DG(1, "playback nodata[%d]", player->noData);
+ DVR_PB_INFO("playback nodata[%d]", player->noData);
if (player->noData == check_no_data_time) {
- DVR_PB_DG(1, "playback send nodata event nodata[%d]", player->noData);
+ DVR_PB_INFO("playback send nodata event nodata[%d]", player->noData);
//send event here and pause
DVR_Play_Notify_t notify;
memset(¬ify, 0 , sizeof(DVR_Play_Notify_t));
notify.event = DVR_PLAYBACK_EVENT_NODATA;
- DVR_PB_DG(1, "send event DVR_PLAYBACK_EVENT_NODATA--");
+ DVR_PB_INFO("send event DVR_PLAYBACK_EVENT_NODATA--");
//get play statue not here
_dvr_playback_sent_event((DVR_PlaybackHandle_t)player, DVR_PLAYBACK_EVENT_NODATA, ¬ify, DVR_FALSE);
}
@@ -1311,13 +1311,13 @@
dvr_playback_pause((DVR_PlaybackHandle_t)player, DVR_FALSE);
_dvr_playback_sent_event((DVR_PlaybackHandle_t)player, DVR_PLAYBACK_EVENT_REACHED_END, ¬ify, DVR_TRUE);
//continue,timeshift mode, when read end,need wait cur recording segment
- DVR_PB_DG(1, "playback is send end delay:[%d]reach_end_timeout[%d]ms", delay, reach_end_timeout);
+ DVR_PB_INFO("playback is send end delay:[%d]reach_end_timeout[%d]ms", delay, reach_end_timeout);
dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
dvr_mutex_unlock(&player->lock);
continue;
} else if (ret != DVR_SUCCESS) {
- DVR_PB_DG(1, "delay:%d pauselive:%d", delay, _dvr_pauselive_decode_sucess((DVR_PlaybackHandle_t)player));
+ DVR_PB_INFO("delay:%d pauselive:%d", delay, _dvr_pauselive_decode_sucess((DVR_PlaybackHandle_t)player));
dvr_mutex_lock(&player->lock);
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
dvr_mutex_unlock(&player->lock);
@@ -1338,7 +1338,7 @@
_dvr_playback_sent_transition_ok((DVR_PlaybackHandle_t)player, DVR_FALSE);
dvr_mutex_lock(&player->lock);
player->noData = 0;
- DVR_PB_DG(1, "_dvr_replay_changed_pid:start");
+ DVR_PB_INFO("_dvr_replay_changed_pid:start");
_dvr_replay_changed_pid((DVR_PlaybackHandle_t)player);
_dvr_check_cur_segment_flag((DVR_PlaybackHandle_t)player);
pthread_mutex_lock(&player->segment_lock);
@@ -1351,12 +1351,12 @@
}//read len 0 check end
if (player->noData >= check_no_data_time) {
player->noData = 0;
- DVR_PB_DG(1, "playback send data event resume[%d]", player->noData);
+ DVR_PB_INFO("playback send data event resume[%d]", player->noData);
//send event here and pause
DVR_Play_Notify_t notify;
memset(¬ify, 0 , sizeof(DVR_Play_Notify_t));
notify.event = DVR_PLAYBACK_EVENT_DATARESUME;
- DVR_PB_DG(1, "----send event DVR_PLAYBACK_EVENT_DATARESUME");
+ DVR_PB_INFO("----send event DVR_PLAYBACK_EVENT_DATARESUME");
//get play statue not here
_dvr_playback_sent_event((DVR_PlaybackHandle_t)player, DVR_PLAYBACK_EVENT_DATARESUME, ¬ify, DVR_FALSE);
}
@@ -1367,7 +1367,7 @@
//check read data len,iflen < 0, we need continue
if (wbufs.buf_size <= 0 || wbufs.buf_data == NULL) {
- DVR_PB_DG(1, "error occur read_read [%d],buf=[%p]",wbufs.buf_size, wbufs.buf_data);
+ DVR_PB_INFO("error occur read_read [%d],buf=[%p]",wbufs.buf_size, wbufs.buf_data);
real_read = 0;
player->ts_cache_len = 0;
continue;
@@ -1377,14 +1377,14 @@
//buf_len is block size value.
if (real_read < buf_len) {
//coontinue to read data from file
- DVR_PB_DG(1, "read buf len[%d] is < block size [%d]", real_read, buf_len);
+ DVR_PB_INFO("read buf len[%d] is < block size [%d]", real_read, buf_len);
dvr_mutex_lock(&player->lock);
- _dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
- dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "read buf len[%d] is < block size [%d] continue", real_read, buf_len);
+ _dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
+ dvr_mutex_unlock(&player->lock);
+ DVR_PB_INFO("read buf len[%d] is < block size [%d] continue", real_read, buf_len);
continue;
} else if (real_read > buf_len) {
- DVR_PB_DG(1, "read buf len[%d] is > block size [%d],this error occur", real_read, buf_len);
+ DVR_PB_INFO("read buf len[%d] is > block size [%d],this error occur", real_read, buf_len);
}
}
@@ -1398,7 +1398,7 @@
crypto_params.segment_id = player->cur_segment.segment_id;
crypto_params.offset = segment_tell_position(player->r_handle) - wbufs.buf_size;
if ((crypto_params.offset % (player->openParams.block_size)) != 0)
- DVR_PB_DG(1, "offset is not block_size %d", player->openParams.block_size);
+ DVR_PB_INFO("offset is not block_size %d", player->openParams.block_size);
crypto_params.input_buffer.type = DVR_BUFFER_TYPE_NORMAL;
crypto_params.input_buffer.addr = (size_t)buf;
crypto_params.input_buffer.size = real_read;
@@ -1411,7 +1411,7 @@
wbufs.buf_data = player->secure_buffer;
wbufs.buf_type = TS_INPUT_BUFFER_TYPE_SECURE;
if (ret != DVR_SUCCESS) {
- DVR_PB_DG(1, "decrypt failed");
+ DVR_PB_INFO("decrypt failed");
}
wbufs.buf_size = crypto_params.output_size;
} else { // only for NAGRA
@@ -1422,7 +1422,7 @@
wbufs.buf_data = (uint8_t*)crypto_params.output_buffer.addr;
wbufs.buf_type = TS_INPUT_BUFFER_TYPE_NORMAL;
if (ret != DVR_SUCCESS) {
- DVR_PB_DG(1, "decrypt failed");
+ DVR_PB_INFO("decrypt failed");
}
wbufs.buf_size = crypto_params.output_buffer.size;
}
@@ -1440,7 +1440,7 @@
real_read = 0;
player->ts_cache_len = 0;
player->drop_ts = DVR_FALSE;
- DVR_PB_DG(1, "----drop ts");
+ DVR_PB_INFO("----drop ts");
continue;
}
@@ -1450,7 +1450,7 @@
//to check change channel kpi.
if (first_write == 0) {
first_write++;
- DVR_PB_DG(1, "----firsr write ts data");
+ DVR_PB_INFO("----firsr write ts data");
}
ret = AmTsPlayer_writeData(player->handle, &wbufs, write_timeout_ms);
@@ -1469,11 +1469,11 @@
goto check0;
}
}
- //DVR_PB_DG(1, "write write_success:%d wbufs.buf_size:%d", write_success, wbufs.buf_size);
+ //DVR_PB_INFO("write write_success:%d wbufs.buf_size:%d", write_success, wbufs.buf_size);
continue;
} else {
pthread_mutex_unlock(&player->segment_lock);
- DVR_PB_DG(1, "write time out write_success:%d wbufs.buf_size:%d systime:%u",
+ DVR_PB_INFO("write time out write_success:%d wbufs.buf_size:%d systime:%u",
write_success,
wbufs.buf_size,
_dvr_time_getClock());
@@ -1493,7 +1493,7 @@
_dvr_playback_timeoutwait((DVR_PlaybackHandle_t)player, timeout);
dvr_mutex_unlock(&player->lock);
if (!player->is_running) {
- DVR_PB_DG(1, "playback thread exit");
+ DVR_PB_INFO("playback thread exit");
break;
}
goto_rewrite = DVR_TRUE;
@@ -1501,7 +1501,7 @@
}
}
end:
- DVR_PB_DG(1, "playback thread is end");
+ DVR_PB_INFO("playback thread is end");
free(buf);
free(dec_bufs.buf_data);
return NULL;
@@ -1513,10 +1513,10 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "start thread is_running:[%d]", player->is_running);
+ DVR_PB_INFO("start thread is_running:[%d]", player->is_running);
if (player->is_running == DVR_TRUE) {
return 0;
}
@@ -1533,11 +1533,11 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "stopthread------[%d]", player->is_running);
+ DVR_PB_INFO("stopthread------[%d]", player->is_running);
if (player->is_running == DVR_TRUE)
{
player->is_running = DVR_FALSE;
@@ -1548,7 +1548,7 @@
segment_close(player->r_handle);
player->r_handle = NULL;
}
- DVR_PB_DG(1, ":end");
+ DVR_PB_INFO(":end");
return 0;
}
@@ -1562,7 +1562,7 @@
if (sscanf(buf, "%i", &pid) != 1)
{
- DVR_PB_DG(1, "get fake pid error");
+ DVR_PB_INFO("get fake pid error");
pid = 0xffff;
}
return pid;
@@ -1573,18 +1573,18 @@
DVR_ASSERT(handle);
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return ;
}
if (player->need_seek_start == DVR_FALSE) {
- DVR_PB_DG(1, "player need_seek_start is false");
+ DVR_PB_INFO("player need_seek_start is false");
return ;
}
if (pid != player->fake_pid) {
player->need_seek_start = DVR_FALSE;
}
- DVR_PB_DG(1, "player player->need_seek_start=%d", player->need_seek_start);
+ DVR_PB_INFO("player player->need_seek_start=%d", player->need_seek_start);
}
/**\brief Open an dvr palyback
@@ -1621,7 +1621,7 @@
//store open params
player->openParams.dmx_dev_id = params->dmx_dev_id;
player->openParams.block_size = params->block_size;
- DVR_PB_DG(1, "playback open block_size:[%d]",params->block_size);
+ DVR_PB_INFO("playback open block_size:[%d]",params->block_size);
player->openParams.is_timeshift = params->is_timeshift;
player->openParams.event_fn = params->event_fn;
player->openParams.event_userdata = params->event_userdata;
@@ -1637,7 +1637,7 @@
if (0 && player->player_callback_func == NULL) {
AmTsPlayer_registerCb(player->handle, _dvr_tsplayer_callback_test, player);
AmTsPlayer_getCb(player->handle, &player->player_callback_func, &player->player_callback_userdata);
- DVR_PB_DG(1, "playback open get callback[%p][%p][%p][%p]",
+ DVR_PB_INFO("playback open get callback[%p][%p][%p][%p]",
player->player_callback_func,
player->player_callback_userdata,
_dvr_tsplayer_callback_test,
@@ -1666,7 +1666,7 @@
(uint8_t *)params->cleariv,
params->keylen * 8);
if (!player->cryptor) {
- DVR_DEBUG(1, "%s , open des cryptor failed!!!\n", __func__);
+ DVR_INFO("%s , open des cryptor failed!!!\n", __func__);
}
} else {
player->cryptor = NULL;
@@ -1716,35 +1716,35 @@
int dvr_playback_close(DVR_PlaybackHandle_t handle) {
DVR_ASSERT(handle);
- DVR_PB_DG(1, ":into");
+ DVR_PB_INFO(":into");
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (player->state != DVR_PLAYBACK_STATE_STOP)
{
- DVR_PB_DG(1, "player->state %s", _dvr_playback_state_toString(player->state));
+ DVR_PB_INFO("player->state %s", _dvr_playback_state_toString(player->state));
if (player->cryptor) {
am_crypt_des_close(player->cryptor);
player->cryptor = NULL;
}
dvr_playback_stop(handle, DVR_TRUE);
- DVR_PB_DG(1, "player->state %s", _dvr_playback_state_toString(player->state));
+ DVR_PB_INFO("player->state %s", _dvr_playback_state_toString(player->state));
} else {
- DVR_PB_DG(1, ":is stoped state");
+ DVR_PB_INFO(":is stoped state");
}
- DVR_PB_DG(1, ":into");
+ DVR_PB_INFO(":into");
dvr_mutex_destroy(&player->lock);
- pthread_mutex_destroy(&player->segment_lock);
+ pthread_mutex_destroy(&player->lock);
pthread_cond_destroy(&player->cond);
if (player) {
free(player);
player = NULL;
}
- DVR_PB_DG(1, ":end");
+ DVR_PB_INFO(":end");
return DVR_SUCCESS;
}
@@ -1764,11 +1764,11 @@
memset(&aparams, 0, sizeof(aparams));
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
uint64_t segment_id = player->cur_segment_id;
- DVR_PB_DG(1, "[%p]segment_id:[%lld]", handle, segment_id);
+ DVR_PB_INFO("[%p]segment_id:[%lld]", handle, segment_id);
player->first_frame = 0;
//can used start api to resume playback
@@ -1779,23 +1779,23 @@
//if flag is puased and not decodec first frame. if user resume, we need
//clear flag and set trickmode none
if ((player->play_flag&DVR_PLAYBACK_STARTED_PAUSEDLIVE) == DVR_PLAYBACK_STARTED_PAUSEDLIVE) {
- DVR_PB_DG(1, "[%p]clear pause live flag and clear trick mode", handle);
+ DVR_PB_INFO("[%p]clear pause live flag and clear trick mode", handle);
player->play_flag = player->play_flag & (~DVR_PLAYBACK_STARTED_PAUSEDLIVE);
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
}
- DVR_PB_DG(1, "stat is start, not need into start play");
+ DVR_PB_INFO("stat is start, not need into start play");
return DVR_SUCCESS;
}
player->play_flag = flag;
player->first_trans_ok = DVR_FALSE;
//get segment info and audio video pid fmt ;
- DVR_PB_DG(1, "lock flag:0x%x", flag);
+ DVR_PB_INFO("lock flag:0x%x", flag);
dvr_mutex_lock(&player->lock);
_dvr_playback_get_playinfo(handle, segment_id, &vparams, &aparams, &adparams);
//start audio and video
if (vparams.pid != player->fake_pid && !VALID_PID(vparams.pid) && !VALID_PID(aparams.pid)) {
//audio abnd video pis is all invalid, return error.
- DVR_PB_DG(0, "unlock dvr play back start error, not found audio and video info [0x%x]", vparams.pid);
+ DVR_PB_ERROR("unlock dvr play back start error, not found audio and video info [0x%x]", vparams.pid);
dvr_mutex_unlock(&player->lock);
DVR_Play_Notify_t notify;
memset(¬ify, 0 , sizeof(DVR_Play_Notify_t));
@@ -1812,14 +1812,14 @@
player->has_video = DVR_TRUE;
//if set flag is pause live, we need set trick mode
if ((player->play_flag&DVR_PLAYBACK_STARTED_PAUSEDLIVE) == DVR_PLAYBACK_STARTED_PAUSEDLIVE) {
- DVR_PB_DG(1, "set trick mode -pauselive flag--");
+ DVR_PB_INFO("set trick mode -pauselive flag--");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
} else if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FB
|| player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF) {
- DVR_PB_DG(1, "set trick mode -fffb--at pause live");
+ DVR_PB_INFO("set trick mode -fffb--at pause live");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
} else {
- DVR_PB_DG(1, "set trick mode ---none");
+ DVR_PB_INFO("set trick mode ---none");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
}
AmTsPlayer_showVideo(player->handle);
@@ -1828,7 +1828,7 @@
AmTsPlayer_startVideoDecoding(player->handle);
}
- DVR_PB_DG(1, "player->cmd.cur_cmd:%d vpid[0x%x]apis[0x%x]", player->cmd.cur_cmd, vparams.pid, aparams.pid);
+ DVR_PB_INFO("player->cmd.cur_cmd:%d vpid[0x%x]apis[0x%x]", player->cmd.cur_cmd, vparams.pid, aparams.pid);
player->last_send_time_id = UINT64_MAX;
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FB
|| player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF) {
@@ -1839,18 +1839,18 @@
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_START;
if (IS_FAST_SPEED(player->cmd.speed.speed.speed)) {
//set fast play
- DVR_PB_DG(1, "start fast");
+ DVR_PB_INFO("start fast");
AmTsPlayer_startFast(player->handle, (float)player->cmd.speed.speed.speed/100.0f);
} else {
if (VALID_PID(adparams.pid)) {
player->has_ad_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio");
+ DVR_PB_INFO("start ad audio");
dvr_playback_change_seek_state(handle, adparams.pid);
AmTsPlayer_setADParams(player->handle, &adparams);
AmTsPlayer_enableADMix(player->handle);
}
if (VALID_PID(aparams.pid)) {
- DVR_PB_DG(1, "start audio");
+ DVR_PB_INFO("start audio");
player->has_audio = DVR_TRUE;
dvr_playback_change_seek_state(handle, aparams.pid);
AmTsPlayer_setAudioParams(player->handle, &aparams);
@@ -1863,11 +1863,11 @@
}
#ifdef AVSYNC_USED_PCR
if (player && VALID_PID(player->cur_segment.pids.pcr.pid)) {
- DVR_PB_DG(1, "start set pcr [%d]", player->cur_segment.pids.pcr.pid);
+ DVR_PB_INFO("start set pcr [%d]", player->cur_segment.pids.pcr.pid);
AmTsPlayer_setPcrPid(player->handle, player->cur_segment.pids.pcr.pid);
}
#endif
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
_start_playback_thread(handle);
return DVR_SUCCESS;
@@ -1882,11 +1882,11 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "add segment id: %lld %p", info->segment_id, handle);
+ DVR_PB_INFO("add segment id: %lld %p", info->segment_id, handle);
DVR_PlaybackSegmentInfo_t *segment;
segment = malloc(sizeof(DVR_PlaybackSegmentInfo_t));
@@ -1897,7 +1897,7 @@
//cp location
memcpy(segment->location, info->location, DVR_MAX_LOCATION_SIZE);
- DVR_PB_DG(1, "add location [%s]id[%lld]flag[%x]", segment->location, segment->segment_id, info->flags);
+ DVR_PB_INFO("add location [%s]id[%lld]flag[%x]", segment->location, segment->segment_id, info->flags);
segment->flags = info->flags;
//pids
@@ -1915,11 +1915,11 @@
segment->pids.pcr.pid = info->pids.pcr.pid;
- DVR_PB_DG(1, "lock pid [0x%x][0x%x][0x%x][0x%x]", segment->pids.video.pid,segment->pids.audio.pid, info->pids.video.pid,info->pids.audio.pid);
+ DVR_PB_INFO("lock pid [0x%x][0x%x][0x%x][0x%x]", segment->pids.video.pid,segment->pids.audio.pid, info->pids.video.pid,info->pids.audio.pid);
dvr_mutex_lock(&player->lock);
list_add_tail(&segment->head, &player->segment_list);
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
return DVR_SUCCESS;
}
@@ -1931,17 +1931,17 @@
*/
int dvr_playback_remove_segment(DVR_PlaybackHandle_t handle, uint64_t segment_id) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
- DVR_PB_DG(1, "remove segment id: %lld", segment_id);
+ DVR_PB_INFO("remove segment id: %lld", segment_id);
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (segment_id == player->cur_segment_id) {
- DVR_PB_DG(1, "not suport remove curren segment id: %lld", segment_id);
+ DVR_PB_INFO("not suport remove curren segment id: %lld", segment_id);
return DVR_FAILURE;
}
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
DVR_PlaybackSegmentInfo_t *segment = NULL;
DVR_PlaybackSegmentInfo_t *segment_tmp = NULL;
@@ -1953,7 +1953,7 @@
break;
}
}
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
@@ -1967,18 +1967,18 @@
int dvr_playback_update_segment_flags(DVR_PlaybackHandle_t handle,
uint64_t segment_id, DVR_PlaybackSegmentFlag_t flags) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
- DVR_PB_DG(1, "update segment id: %lld flag:%d", segment_id, flags);
+ DVR_PB_INFO("update segment id: %lld flag:%d", segment_id, flags);
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (player->vendor == DVR_PLAYBACK_VENDOR_AML) {
- DVR_PB_DG(1, "vendor is amlogic. not hide or show av and update segment");
+ DVR_PB_INFO("vendor is amlogic. not hide or show av and update segment");
return DVR_SUCCESS;
}
DVR_PlaybackSegmentInfo_t *segment;
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
list_for_each_entry(segment, &player->segment_list, head)
{
@@ -1992,13 +1992,13 @@
if ((segment->flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == DVR_PLAYBACK_SEGMENT_DISPLAYABLE
&& (flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == 0) {
//disable display, mute
- DVR_PB_DG(1, "mute av");
+ DVR_PB_INFO("mute av");
AmTsPlayer_hideVideo(player->handle);
AmTsPlayer_setAudioMute(player->handle, 1, 1);
} else if ((segment->flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == 0 &&
(flags & DVR_PLAYBACK_SEGMENT_DISPLAYABLE) == DVR_PLAYBACK_SEGMENT_DISPLAYABLE) {
//enable display, unmute
- DVR_PB_DG(1, "unmute av");
+ DVR_PB_INFO("unmute av");
AmTsPlayer_showVideo(player->handle);
AmTsPlayer_setAudioMute(player->handle, 0, 0);
} else {
@@ -2010,7 +2010,7 @@
//continue , only set flag
segment->flags = flags;
}
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2036,10 +2036,10 @@
}
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, " do check");
+ DVR_PB_INFO(" do check");
if (now_pid.pid == set_pid.pid) {
//do nothing
return 0;
@@ -2049,20 +2049,20 @@
if (type == 0) {
//stop vieo
if (player->has_video == DVR_TRUE) {
- DVR_PB_DG(1, "stop video");
+ DVR_PB_INFO("stop video");
AmTsPlayer_stopVideoDecoding(player->handle);
player->has_video = DVR_FALSE;
}
} else if (type == 1) {
//stop audio
if (player->has_audio == DVR_TRUE) {
- DVR_PB_DG(1, "stop audio");
+ DVR_PB_INFO("stop audio");
AmTsPlayer_stopAudioDecoding(player->handle);
player->has_audio = DVR_FALSE;
}
} else if (type == 2) {
//stop sub audio
- DVR_PB_DG(1, "stop ad");
+ DVR_PB_INFO("stop ad");
AmTsPlayer_disableADMix(player->handle);
} else if (type == 3) {
//pcr
@@ -2076,7 +2076,7 @@
vparams.pid = set_pid.pid;
vparams.codectype = _dvr_convert_stream_fmt(set_pid.format, DVR_FALSE);
player->has_video = DVR_TRUE;
- DVR_PB_DG(1, "start video pid[%d]fmt[%d]",vparams.pid, vparams.codectype);
+ DVR_PB_INFO("start video pid[%d]fmt[%d]",vparams.pid, vparams.codectype);
AmTsPlayer_setVideoParams(player->handle, &vparams);
AmTsPlayer_startVideoDecoding(player->handle);
//playback_device_video_start(player->handle,&vparams);
@@ -2087,7 +2087,7 @@
am_tsplayer_audio_params adparams;
adparams.pid = set_pids.ad.pid;
adparams.codectype= _dvr_convert_stream_fmt(set_pids.ad.format, DVR_TRUE);
- DVR_PB_DG(1, "start ad audio pid[%d]fmt[%d]",adparams.pid, adparams.codectype);
+ DVR_PB_INFO("start ad audio pid[%d]fmt[%d]",adparams.pid, adparams.codectype);
AmTsPlayer_setADParams(player->handle, &adparams);
AmTsPlayer_enableADMix(player->handle);
}
@@ -2099,7 +2099,7 @@
aparams.pid = set_pid.pid;
aparams.codectype= _dvr_convert_stream_fmt(set_pid.format, DVR_TRUE);
player->has_audio = DVR_TRUE;
- DVR_PB_DG(1, "start audio pid[%d]fmt[%d]",aparams.pid, aparams.codectype);
+ DVR_PB_INFO("start audio pid[%d]fmt[%d]",aparams.pid, aparams.codectype);
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
//playback_device_audio_start(player->handle,&aparams);
@@ -2108,7 +2108,7 @@
if (player->cmd.speed.speed.speed == PLAYBACK_SPEED_X1) {
if (set_pids.audio.pid == now_pids.audio.pid) {
//stop audio if audio pid not change
- DVR_PB_DG(1, "stop audio when start ad");
+ DVR_PB_INFO("stop audio when start ad");
AmTsPlayer_stopAudioDecoding(player->handle);
}
am_tsplayer_audio_params aparams;
@@ -2117,7 +2117,7 @@
aparams.pid = set_pid.pid;
aparams.codectype= _dvr_convert_stream_fmt(set_pid.format, DVR_TRUE);
player->has_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio pid[%d]fmt[%d]",aparams.pid, aparams.codectype);
+ DVR_PB_INFO("start ad audio pid[%d]fmt[%d]",aparams.pid, aparams.codectype);
AmTsPlayer_setADParams(player->handle, &aparams);
AmTsPlayer_enableADMix(player->handle);
@@ -2129,14 +2129,14 @@
aparams.pid = set_pids.audio.pid;
aparams.codectype= _dvr_convert_stream_fmt(set_pids.audio.format, DVR_TRUE);
player->has_audio = DVR_TRUE;
- DVR_PB_DG(1, "restart audio when start ad");
+ DVR_PB_INFO("restart audio when start ad");
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
}
}
} else if (type == 3) {
//pcr
- DVR_PB_DG(1, "start set pcr [%d]", set_pid.pid);
+ DVR_PB_INFO("start set pcr [%d]", set_pid.pid);
AmTsPlayer_setPcrPid(player->handle, set_pid.pid);
}
//audio and video all close
@@ -2145,11 +2145,11 @@
}
} else if (type == 2) {
//case disable ad
- DVR_PB_DG(1, "restart audio when stop ad");
+ DVR_PB_INFO("restart audio when stop ad");
if (player->cmd.speed.speed.speed == PLAYBACK_SPEED_X1) {
if (VALID_PID(now_pids.audio.pid)) {
//stop audio if audio pid not change
- DVR_PB_DG(1, "stop audio when stop ad pid [0x%x]", now_pids.audio.pid);
+ DVR_PB_INFO("stop audio when stop ad pid [0x%x]", now_pids.audio.pid);
AmTsPlayer_stopAudioDecoding(player->handle);
am_tsplayer_audio_params aparams;
@@ -2158,7 +2158,7 @@
aparams.pid = now_pids.audio.pid;
aparams.codectype= _dvr_convert_stream_fmt(now_pids.audio.format, DVR_TRUE);
player->has_audio = DVR_TRUE;
- DVR_PB_DG(1, "restart audio when stop ad");
+ DVR_PB_INFO("restart audio when stop ad");
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
}
@@ -2178,14 +2178,14 @@
int dvr_playback_only_update_segment_pids(DVR_PlaybackHandle_t handle, uint64_t segment_id, DVR_PlaybackPids_t *p_pids) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
DVR_PlaybackSegmentInfo_t *segment;
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
- DVR_PB_DG(1, "get lock update segment id: %lld cur id %lld", segment_id, player->cur_segment_id);
+ DVR_PB_INFO("get lock update segment id: %lld cur id %lld", segment_id, player->cur_segment_id);
list_for_each_entry(segment, &player->segment_list, head)
{
if (segment->segment_id == segment_id) {
@@ -2193,20 +2193,20 @@
if (player->cmd.state == DVR_PLAYBACK_STATE_FF
|| player->cmd.state == DVR_PLAYBACK_STATE_FF) {
//do nothing when ff fb
- DVR_PB_DG(1, "unlock now is ff fb, not to update cur segment info\r\n");
+ DVR_PB_INFO("unlock now is ff fb, not to update cur segment info\r\n");
dvr_mutex_unlock(&player->lock);
return 0;
}
memcpy(&player->cur_segment.pids, p_pids, sizeof(DVR_PlaybackPids_t));
}
//save pids info
- DVR_PB_DG(1, ":apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
+ DVR_PB_INFO(":apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
memcpy(&segment->pids, p_pids, sizeof(DVR_PlaybackPids_t));
- DVR_PB_DG(1, ":cp apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
+ DVR_PB_INFO(":cp apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
break;
}
}
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2222,14 +2222,14 @@
int dvr_playback_update_segment_pids(DVR_PlaybackHandle_t handle, uint64_t segment_id, DVR_PlaybackPids_t *p_pids) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
DVR_PlaybackSegmentInfo_t *segment;
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
- DVR_PB_DG(1, "get lock update segment id: %lld cur id %lld", segment_id, player->cur_segment_id);
+ DVR_PB_INFO("get lock update segment id: %lld cur id %lld", segment_id, player->cur_segment_id);
list_for_each_entry(segment, &player->segment_list, head)
{
@@ -2239,14 +2239,14 @@
if (player->cmd.state == DVR_PLAYBACK_STATE_FF
|| player->cmd.state == DVR_PLAYBACK_STATE_FF) {
//do nothing when ff fb
- DVR_PB_DG(1, "unlock now is ff fb, not to update cur segment info\r\n");
+ DVR_PB_INFO("unlock now is ff fb, not to update cur segment info\r\n");
dvr_mutex_unlock(&player->lock);
return 0;
}
//if segment is on going segment,we need stop start stream
if (player->cmd.state == DVR_PLAYBACK_STATE_START) {
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
if (segment->pids.audio.pid != p_pids->audio.pid &&
segment->pids.audio.pid == 0x1fff) {
@@ -2262,7 +2262,7 @@
if (player->first_start_time > 0)
player->first_start_time = player->first_start_time - 1;
segment_seek(player->r_handle, (uint64_t)(player->first_start_time), player->openParams.block_size);
- DVR_PB_DG(0, "unlock segment update need seek time_offset %llu [0x%x][0x%x]", player->first_start_time, segment->pids.audio.pid, segment->pids.ad.pid);
+ DVR_PB_ERROR("unlock segment update need seek time_offset %llu [0x%x][0x%x]", player->first_start_time, segment->pids.audio.pid, segment->pids.ad.pid);
pthread_mutex_unlock(&player->segment_lock);
}
}
@@ -2370,13 +2370,13 @@
memcpy(&player->cur_segment.pids, p_pids, sizeof(DVR_PlaybackPids_t));
}
//save pids info
- DVR_PB_DG(1, ":apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
+ DVR_PB_INFO(":apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
memcpy(&segment->pids, p_pids, sizeof(DVR_PlaybackPids_t));
- DVR_PB_DG(1, ":cp apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
+ DVR_PB_INFO(":cp apid :%d %d", segment->pids.audio.pid, p_pids->audio.pid);
break;
}
}
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2390,21 +2390,21 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
UNDVRUSED(clear);
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (player->state == DVR_PLAYBACK_STATE_STOP) {
- DVR_PB_DG(1, ":playback is stoped");
+ DVR_PB_INFO(":playback is stoped");
return DVR_SUCCESS;
}
if (player->state == DVR_PLAYBACK_STATE_STOP) {
- DVR_PB_DG(1, ":playback is stoped");
+ DVR_PB_INFO(":playback is stoped");
return DVR_SUCCESS;
}
_stop_playback_thread(handle);
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
- DVR_PB_DG(1, ":get lock into stop fast");
+ DVR_PB_INFO(":get lock into stop fast");
AmTsPlayer_stopFast(player->handle);
if (player->has_video) {
AmTsPlayer_resumeVideoDecoding(player->handle);
@@ -2432,8 +2432,8 @@
player->state = DVR_PLAYBACK_STATE_STOP;
player->cur_segment_id = UINT64_MAX;
player->segment_is_open = DVR_FALSE;
- DVR_PB_DG(1, "unlock");
- DVR_PB_DG(1, "player->state %s", _dvr_playback_state_toString(player->state));
+ DVR_PB_DEBUG("unlock");
+ DVR_PB_INFO("player->state %s", _dvr_playback_state_toString(player->state));
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2448,22 +2448,22 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
_start_playback_thread(handle);
//start audio and video
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
if (VALID_PID(adparam->pid)) {
player->has_ad_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio");
+ DVR_PB_INFO("start ad audio");
AmTsPlayer_setADParams(player->handle, adparam);
AmTsPlayer_enableADMix(player->handle);
}
if (VALID_PID(param->pid)) {
- DVR_PB_DG(1, "start audio");
+ DVR_PB_INFO("start audio");
player->has_audio = DVR_TRUE;
AmTsPlayer_setAudioParams(player->handle, param);
AmTsPlayer_startAudioDecoding(player->handle);
@@ -2473,7 +2473,7 @@
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_ASTART;
player->cmd.state = DVR_PLAYBACK_STATE_START;
player->state = DVR_PLAYBACK_STATE_START;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2486,7 +2486,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -2499,7 +2499,7 @@
} else {
//do nothing.video is playing
}
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
if (player->has_audio) {
@@ -2515,7 +2515,7 @@
player->cmd.last_cmd = player->cmd.cur_cmd;
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_ASTOP;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2529,13 +2529,13 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
_start_playback_thread(handle);
//start audio and video
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
player->has_video = DVR_TRUE;
AmTsPlayer_setVideoParams(player->handle, param);
@@ -2545,7 +2545,7 @@
//playback_device_video_start(player->handle , param);
//if set flag is pause live, we need set trick mode
if ((player->play_flag&DVR_PLAYBACK_STARTED_PAUSEDLIVE) == DVR_PLAYBACK_STARTED_PAUSEDLIVE) {
- DVR_PB_DG(1, "settrick mode at video start");
+ DVR_PB_INFO("settrick mode at video start");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
//playback_device_trick_mode(player->handle, 1);
}
@@ -2553,7 +2553,7 @@
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_VSTART;
player->cmd.state = DVR_PLAYBACK_STATE_START;
player->state = DVR_PLAYBACK_STATE_START;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2566,7 +2566,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -2579,7 +2579,7 @@
//do nothing.audio is playing
}
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
player->has_video = DVR_FALSE;
@@ -2590,7 +2590,7 @@
player->cmd.last_cmd = player->cmd.cur_cmd;
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_VSTOP;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2604,16 +2604,16 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
UNDVRUSED(flush);
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (player->state == DVR_PLAYBACK_STATE_PAUSE ||player->state == DVR_PLAYBACK_STATE_STOP ) {
- DVR_PB_DG(1, "player state is [%d] pause or stop", player->state);
+ DVR_PB_INFO("player state is [%d] pause or stop", player->state);
return DVR_SUCCESS;
}
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
- DVR_PB_DG(1, "get lock");
+ DVR_PB_DEBUG("get lock");
if (player->has_video)
AmTsPlayer_pauseVideoDecoding(player->handle);
if (player->has_audio)
@@ -2631,7 +2631,7 @@
player->state = DVR_PLAYBACK_STATE_PAUSE;
}
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
return DVR_SUCCESS;
}
@@ -2642,12 +2642,12 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
//get video params and audio params
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
am_tsplayer_video_params vparams;
am_tsplayer_audio_params aparams;
@@ -2658,13 +2658,13 @@
memset(&aparams, 0, sizeof(aparams));
_dvr_playback_get_playinfo(handle, segmentid, &vparams, &aparams, &adparams);
- DVR_PB_DG(1, "unlock cmd: %d", cmd);
+ DVR_PB_INFO("unlock cmd: %d", cmd);
dvr_mutex_unlock(&player->lock);
switch (cmd) {
case DVR_PLAYBACK_CMD_AVRESTART:
//av restart
- DVR_PB_DG(1, "do_cmd avrestart");
+ DVR_PB_INFO("do_cmd avrestart");
_dvr_playback_replay((DVR_PlaybackHandle_t)player, DVR_FALSE);
break;
case DVR_PLAYBACK_CMD_VRESTART:
@@ -2736,27 +2736,27 @@
uint32_t pos = 0;
uint64_t segmentid = 0;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (dvr_playback_check_limit(handle)) {
//get id and pos to check if we can seek to this pos
- DVR_PB_DG(1, "player start calculate time");
+ DVR_PB_INFO("player start calculate time");
dvr_playback_calculate_last_valid_segment(handle, &segmentid, &pos);
if (segmentid != player->cur_segment_id ||
(segmentid == player->cur_segment_id &&
pos > _dvr_get_cur_time(handle))) {
//first to seek new pos and to resume
- DVR_PB_DG(1, "seek new pos and to resume");
+ DVR_PB_INFO("seek new pos and to resume");
dvr_playback_seek(handle, segmentid, pos);
}
} else {
- DVR_PB_DG(1, "player is not set limit");
+ DVR_PB_INFO("player is not set limit");
}
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_PAUSE) {
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
player->first_frame = 0;
if (player->has_video)
@@ -2765,7 +2765,7 @@
AmTsPlayer_pauseAudioDecoding(player->handle);
if (player->has_video) {
- DVR_PB_DG(1, "dvr_playback_resume set trick mode none");
+ DVR_PB_INFO("dvr_playback_resume set trick mode none");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
AmTsPlayer_resumeVideoDecoding(player->handle);
}
@@ -2787,7 +2787,7 @@
//valid audio pid, start audio
if (player->has_ad_audio == DVR_FALSE && VALID_PID(adparams.pid) && (player->cmd.speed.speed.speed == PLAYBACK_SPEED_X1)) {
player->has_ad_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio");
+ DVR_PB_INFO("start ad audio");
dvr_playback_change_seek_state(handle, adparams.pid);
AmTsPlayer_setADParams(player->handle, &adparams);
AmTsPlayer_enableADMix(player->handle);
@@ -2799,7 +2799,7 @@
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
} else {
- DVR_PB_DG(1, "aparams.pid:%d player->has_audio:%d speed:%d", aparams.pid, player->has_audio, player->cmd.speed.speed.speed);
+ DVR_PB_INFO("aparams.pid:%d player->has_audio:%d speed:%d", aparams.pid, player->has_audio, player->cmd.speed.speed.speed);
}
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
@@ -2812,10 +2812,10 @@
player->cmd.state = DVR_PLAYBACK_STATE_START;
player->state = DVR_PLAYBACK_STATE_START;
}
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
} else if (player->state == DVR_PLAYBACK_STATE_PAUSE){
- DVR_PB_DG(1, "lock");
+ DVR_PB_INFO("lock");
dvr_mutex_lock(&player->lock);
player->first_frame = 0;
if (player->has_video)
@@ -2824,23 +2824,23 @@
AmTsPlayer_pauseAudioDecoding(player->handle);
if (player->has_video) {
- DVR_PB_DG(1, "dvr_playback_resume set trick mode none 1");
+ DVR_PB_INFO("dvr_playback_resume set trick mode none 1");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
AmTsPlayer_resumeVideoDecoding(player->handle);
}
if (player->has_audio)
AmTsPlayer_resumeAudioDecoding(player->handle);
- DVR_PB_DG(1, "set start state cur cmd[%d]", player->cmd.cur_cmd);
+ DVR_PB_INFO("set start state cur cmd[%d]", player->cmd.cur_cmd);
if (player->cmd.speed.speed.speed == PLAYBACK_SPEED_X1)
_dvr_cmd(handle, player->cmd.cur_cmd);
player->cmd.state = DVR_PLAYBACK_STATE_START;
player->state = DVR_PLAYBACK_STATE_START;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_INFO("unlock");
dvr_mutex_unlock(&player->lock);
} else {
if ((player->play_flag&DVR_PLAYBACK_STARTED_PAUSEDLIVE) == DVR_PLAYBACK_STARTED_PAUSEDLIVE)
{
- DVR_PB_DG(1, "lock ---\r\n");
+ DVR_PB_DEBUG("lock ---\r\n");
dvr_mutex_lock(&player->lock);
player->first_frame = 0;
if (player->has_video)
@@ -2848,7 +2848,7 @@
if (player->has_audio)
AmTsPlayer_pauseAudioDecoding(player->handle);
//clear flag
- DVR_PB_DG(1, "clear pause live flag cur cmd[%d]", player->cmd.cur_cmd);
+ DVR_PB_INFO("clear pause live flag cur cmd[%d]", player->cmd.cur_cmd);
player->play_flag = player->play_flag & (~DVR_PLAYBACK_STARTED_PAUSEDLIVE);
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
if (player->has_video) {
@@ -2856,7 +2856,7 @@
}
if (player->has_audio)
AmTsPlayer_resumeAudioDecoding(player->handle);
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
}
}
@@ -2883,17 +2883,17 @@
}
}
if (cur_segment == NULL || set_segment == NULL) {
- DVR_PB_DG(1, "set segmen or cur segment is null");
+ DVR_PB_INFO("set segmen or cur segment is null");
return DVR_TRUE;
}
if (cur_segment->pids.video.format != set_segment->pids.video.format ||
cur_segment->pids.video.pid != set_segment->pids.video.pid ||
cur_segment->pids.audio.format != set_segment->pids.audio.format ||
cur_segment->pids.audio.pid != set_segment->pids.audio.pid) {
- DVR_PB_DG(1, "cur v[%d]a[%d] set v[%d]a[%d]",cur_segment->pids.video.pid,cur_segment->pids.audio.pid,set_segment->pids.video.pid,set_segment->pids.audio.pid);
+ DVR_PB_INFO("cur v[%d]a[%d] set v[%d]a[%d]",cur_segment->pids.video.pid,cur_segment->pids.audio.pid,set_segment->pids.video.pid,set_segment->pids.audio.pid);
return DVR_TRUE;
}
- DVR_PB_DG(1, "play info not change");
+ DVR_PB_INFO("play info not change");
return DVR_FALSE;
}
@@ -2908,15 +2908,15 @@
{ DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
_dvr_getClock_sec();
- DVR_PB_DG(1, "lock time %lu limit: %u player->state:%d", time, limit, player->state);
+ DVR_PB_INFO("lock time %lu limit: %u player->state:%d", time, limit, player->state);
dvr_mutex_lock(&player->lock);
player->rec_start = time;
player->limit = limit;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -2931,36 +2931,36 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
int ret = DVR_SUCCESS;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "lock segment_id %llu cur id %llu time_offset %u cur end: %d player->state:%d", segment_id,player->cur_segment_id, (uint32_t)time_offset, _dvr_get_end_time(handle), player->state);
+ DVR_PB_INFO("lock segment_id %llu cur id %llu time_offset %u cur end: %d player->state:%d", segment_id,player->cur_segment_id, (uint32_t)time_offset, _dvr_get_end_time(handle), player->state);
dvr_mutex_lock(&player->lock);
int offset = -1;
DVR_Bool_t replay = _dvr_check_playinfo_changed(handle, player->cur_segment_id, segment_id);
- DVR_PB_DG(1, "player->state[%d]-replay[%d]--get lock-", player->state, replay);
+ DVR_PB_INFO("player->state[%d]-replay[%d]--get lock-", player->state, replay);
//open segment if id is not current segment
ret = _dvr_open_segment(handle, segment_id);
if (ret ==DVR_FAILURE) {
- DVR_PB_DG(1, "unlock seek error at open segment");
+ DVR_PB_INFO("unlock seek error at open segment");
dvr_mutex_unlock(&player->lock);
return DVR_FAILURE;
}
if (time_offset >_dvr_get_end_time(handle) &&_dvr_has_next_segmentId(handle, segment_id) == DVR_FAILURE) {
if (segment_ongoing(player->r_handle) == DVR_SUCCESS) {
- DVR_PB_DG(1, "is ongoing segment when seek end, need return success");
+ DVR_PB_INFO("is ongoing segment when seek end, need return success");
time_offset = _dvr_get_end_time(handle);
} else {
- DVR_PB_DG(1, "is not ongoing segment when seek end, return failure");
+ DVR_PB_INFO("is not ongoing segment when seek end, return failure");
time_offset = _dvr_get_end_time(handle);
ret = DVR_FAILURE;
}
}
- DVR_PB_DG(1, "seek open id[%lld]flag[0x%x] time_offset %u",
+ DVR_PB_INFO("seek open id[%lld]flag[0x%x] time_offset %u",
player->cur_segment.segment_id,
player->cur_segment.flags,
time_offset);
@@ -2981,7 +2981,7 @@
player->drop_ts = DVR_TRUE;
player->ts_cache_len = 0;
offset = segment_seek(player->r_handle, (uint64_t)time_offset, player->openParams.block_size);
- DVR_PB_DG(0, "seek get offset by time offset, offset=%d time_offset %u",offset, time_offset);
+ DVR_PB_ERROR("seek get offset by time offset, offset=%d time_offset %u",offset, time_offset);
pthread_mutex_unlock(&player->segment_lock);
player->offset = offset;
@@ -2998,12 +2998,12 @@
//pause state if need to replayer false
if (player->state == DVR_PLAYBACK_STATE_STOP) {
//only seek file,not start
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
//stop play
- DVR_PB_DG(0, "seek stop play, not inject data has video[%d]audio[%d]",
+ DVR_PB_ERROR("seek stop play, not inject data has video[%d]audio[%d]",
player->has_video, player->has_audio);
if (player->has_video) {
@@ -3038,11 +3038,11 @@
//start audio and video
if (vparams.pid != player->fake_pid && !VALID_PID(vparams.pid) && !VALID_PID(aparams.pid)) {
//audio and video pid is all invalid, return error.
- DVR_PB_DG(0, "unlock seek start dvr play back start error, not found audio and video info [0x%x]", vparams.pid);
+ DVR_PB_ERROR("unlock seek start dvr play back start error, not found audio and video info [0x%x]", vparams.pid);
dvr_mutex_unlock(&player->lock);
return -1;
}
- DVR_PB_DG(0, "seek start[0x%x]", vparams.pid);
+ DVR_PB_ERROR("seek start[0x%x]", vparams.pid);
//add
if (sync == DVR_PLAYBACK_SYNC) {
if (VALID_PID(vparams.pid)) {
@@ -3052,10 +3052,10 @@
player->speed > 2.0f||
player->speed <= -1.0f) {
//if is pause state. we need set trick mode.
- DVR_PB_DG(1, "seek set trick mode player->speed [%f]", player->speed);
+ DVR_PB_INFO("seek set trick mode player->speed [%f]", player->speed);
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
}
- DVR_PB_DG(1, "start video");
+ DVR_PB_INFO("start video");
AmTsPlayer_setVideoParams(player->handle, &vparams);
AmTsPlayer_setVideoBlackOut(player->handle, 1);
AmTsPlayer_startVideoDecoding(player->handle);
@@ -3071,13 +3071,13 @@
}
if (VALID_PID(adparams.pid) && player->speed == 1.0) {
player->has_ad_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio");
+ DVR_PB_INFO("start ad audio");
dvr_playback_change_seek_state(handle, adparams.pid);
AmTsPlayer_setADParams(player->handle, &adparams);
AmTsPlayer_enableADMix(player->handle);
}
if (VALID_PID(aparams.pid) && player->speed == 1.0) {
- DVR_PB_DG(1, "start audio seek");
+ DVR_PB_INFO("start audio seek");
dvr_playback_change_seek_state(handle, aparams.pid);
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
@@ -3085,7 +3085,7 @@
}
#ifdef AVSYNC_USED_PCR
if (player && VALID_PID(player->cur_segment.pids.pcr.pid)) {
- DVR_PB_DG(1, "start set pcr [%d]", player->cur_segment.pids.pcr.pid);
+ DVR_PB_INFO("start set pcr [%d]", player->cur_segment.pids.pcr.pid);
AmTsPlayer_setPcrPid(player->handle, player->cur_segment.pids.pcr.pid);
}
#endif
@@ -3095,22 +3095,22 @@
player->state = DVR_PLAYBACK_STATE_PAUSE;
if (VALID_PID(aparams.pid) || VALID_PID(vparams.pid))
player->seek_pause = DVR_TRUE;
- DVR_PB_DG(1, "set state pause in seek vpid[0x%x]apid[0x%x]",vparams.pid, aparams.pid);
+ DVR_PB_INFO("set state pause in seek vpid[0x%x]apid[0x%x]",vparams.pid, aparams.pid);
} else if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
player->speed > 1.0f||
player->speed <= -1.0f) {
- DVR_PB_DG(1, "not set cmd to seek");
+ DVR_PB_INFO("not set cmd to seek");
//not pause state, we need not set cur cmd
} else {
- DVR_PB_DG(1, "set cmd to seek");
+ DVR_PB_INFO("set cmd to seek");
player->cmd.last_cmd = player->cmd.cur_cmd;
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_SEEK;
player->cmd.state = DVR_PLAYBACK_STATE_START;
player->state = DVR_PLAYBACK_STATE_START;
}
player->last_send_time_id = UINT64_MAX;
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
@@ -3121,7 +3121,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL || player->handle == (am_tsplayer_handle)NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -3138,7 +3138,7 @@
}
AmTsPlayer_getDelayTime(player->handle, &cache);
pthread_mutex_unlock(&player->segment_lock);
- DVR_PB_DG(1, "get cur time [%lld] cache:%lld cur id [%lld]last id [%lld] pb cache len [%d] [%lld]", cur, cache, player->cur_segment_id,player->last_send_time_id, player->ts_cache_len, pos);
+ DVR_PB_INFO("get cur time [%lld] cache:%lld cur id [%lld]last id [%lld] pb cache len [%d] [%lld]", cur, cache, player->cur_segment_id,player->last_send_time_id, player->ts_cache_len, pos);
if (player->state == DVR_PLAYBACK_STATE_STOP) {
cache = 0;
}
@@ -3151,7 +3151,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL || player->handle == 0) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -3165,7 +3165,7 @@
//this case is open new segment end,but cache data is last segment.
//we need used last segment len to send play time.
cur = 0;
- DVR_PB_DG(1, "change segment [%lld][%lld]",
+ DVR_PB_INFO("change segment [%lld][%lld]",
player->last_segment_id, player->cur_segment_id);
} else {
cur = segment_tell_position_time(player->r_handle, pos);
@@ -3204,8 +3204,8 @@
player->check_cache_flag=DVR_FALSE;
}
- DVR_PB_DG(1, "***get play cur time [%lld] cache:%lld cur id [%lld]\
- last id [%lld] pb cache len [%d] pos [%lld][%lld]",
+ DVR_PB_INFO("***get play cur time [%lld] cache:%lld cur id [%lld]"
+ " last id [%lld] pb cache len [%d] pos [%lld][%lld]",
cur,
cache,
player->cur_segment_id,
@@ -3233,7 +3233,7 @@
cur_time = (int)(cur);
*id = player->cur_segment_id;
}
- DVR_PB_DG(1, "get play cur time[%lld][%lld][%d]", player->last_segment_id, player->cur_segment_id, player->last_segment_tatol);
+ DVR_PB_INFO("get play cur time[%lld][%lld][%d]", player->last_segment_id, player->cur_segment_id, player->last_segment_tatol);
} else {
cur_time = 0;
*id = player->cur_segment_id;
@@ -3247,13 +3247,13 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
pthread_mutex_lock(&player->segment_lock);
uint64_t end = segment_tell_total_time(player->r_handle);
- DVR_PB_DG(1, "get tatal time [%lld]", end);
+ DVR_PB_INFO("get total time [%lld]", end);
pthread_mutex_unlock(&player->segment_lock);
return (int)end;
}
@@ -3264,7 +3264,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FALSE;
}
if (player->rec_start > 0 || player->limit > 0) {
@@ -3286,11 +3286,11 @@
uint32_t tmp_time;
uint32_t expired = 0;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return expired;
}
if (player->rec_start == 0 || player->limit == 0) {
- DVR_PB_DG(1, "rec limit 0");
+ DVR_PB_INFO("rec limit 0");
return expired;
}
//get system time
@@ -3298,7 +3298,7 @@
if ((cur_time - player->rec_start) > player->limit) {
tmp_time = (uint32_t)((cur_time - player->rec_start) - player->limit) * 1000U;
expired = *(int*)&tmp_time;
- DVR_PB_DG(1, "cur_time:%u, rec start:%u limit:%d c_r_diff:%u expired:%u tmp_time:%u",
+ DVR_PB_INFO("cur_time:%u, rec start:%u limit:%d c_r_diff:%u expired:%u tmp_time:%u",
cur_time,
player->rec_start,
player->limit,
@@ -3320,14 +3320,14 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FALSE;
}
//get system time
- DVR_PB_DG(1, "lock ---\r\n");
+ DVR_PB_DEBUG("lock ---\r\n");
dvr_mutex_lock(&player->lock);
player->obsolete = obsolete;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return expired;
}
@@ -3347,7 +3347,7 @@
DVR_PlaybackSegmentInfo_t *pre_segment = NULL;
if (player == NULL) {
- DVR_PB_DG(1, " player is NULL");
+ DVR_PB_INFO(" player is NULL");
return DVR_FAILURE;
}
//update the newest segment duration on timeshift mode
@@ -3374,7 +3374,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
expired = dvr_playback_calculate_expiredlen(handle);
@@ -3418,7 +3418,7 @@
uint64_t segmentid = 0;
int pos = 0;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -3428,7 +3428,7 @@
player->fffb_current = player->fffb_start;
//get segment current time pos
player->fffb_start_pcr = _dvr_get_cur_time(handle);
- DVR_PB_DG(1, "calculate seek pos player->fffb_start_pcr[%d]ms, speed[%f]",
+ DVR_PB_INFO("calculate seek pos player->fffb_start_pcr[%d]ms, speed[%f]",
player->fffb_start_pcr, player->speed);
t_diff = 0;
//default first time 2s seek
@@ -3448,7 +3448,7 @@
player->ts_cache_len = 0;
if (seek_time < FB_MIX_SEEK_TIME && IS_FB(player->speed)) {
//set seek time to 0;
- DVR_PB_DG(1, "segment seek to 0 at fb mode [%d]id[%lld]",
+ DVR_PB_INFO("segment seek to 0 at fb mode [%d]id[%lld]",
seek_time,
player->cur_segment_id);
seek_time = 0;
@@ -3481,9 +3481,9 @@
pthread_mutex_unlock(&player->segment_lock);
} else {
//
- DVR_PB_DG(1, "segment not open,can not seek");
+ DVR_PB_INFO("segment not open,can not seek");
}
- DVR_PB_DG(1, "calculate seek pos seek_time[%d]ms, speed[%f]id[%lld]cur [%d]",
+ DVR_PB_INFO("calculate seek pos seek_time[%d]ms, speed[%f]id[%lld]cur [%d]",
seek_time,
player->speed,
player->cur_segment_id,
@@ -3499,23 +3499,23 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
//stop
if (player->has_video) {
- DVR_PB_DG(1, "fffb stop video");
+ DVR_PB_INFO("fffb stop video");
AmTsPlayer_setVideoBlackOut(player->handle, 0);
AmTsPlayer_stopVideoDecoding(player->handle);
}
if (player->has_audio) {
- DVR_PB_DG(1, "fffb stop audio");
+ DVR_PB_INFO("fffb stop audio");
player->has_audio =DVR_FALSE;
AmTsPlayer_stopAudioDecoding(player->handle);
}
if (player->has_ad_audio) {
- DVR_PB_DG(1, "fffb stop audio");
+ DVR_PB_INFO("fffb stop audio");
player->has_ad_audio =DVR_FALSE;
AmTsPlayer_disableADMix(player->handle);
}
@@ -3537,14 +3537,14 @@
//start audio and video
if (!VALID_PID(vparams.pid) && !VALID_PID(aparams.pid)) {
//audio abnd video pis is all invalid, return error.
- DVR_PB_DG(0, "dvr play back restart error, not found audio and video info");
+ DVR_PB_ERROR("dvr play back restart error, not found audio and video info");
return -1;
}
if (VALID_PID(vparams.pid)) {
player->has_video = DVR_TRUE;
- DVR_PB_DG(1, "fffb start video");
- //DVR_PB_DG(1, "fffb start video and save last frame");
+ DVR_PB_INFO("fffb start video");
+ //DVR_PB_INFO("fffb start video and save last frame");
//AmTsPlayer_setVideoBlackOut(player->handle, 0);
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_NONE);
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
@@ -3556,7 +3556,7 @@
//playback_device_trick_mode(player->handle, 1);
}
//fffb mode need stop fast;
- DVR_PB_DG(1, "stop fast");
+ DVR_PB_INFO("stop fast");
AmTsPlayer_stopFast(player->handle);
return 0;
}
@@ -3564,16 +3564,16 @@
static int _dvr_playback_fffb(DVR_PlaybackHandle_t handle) {
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
player->first_frame = 0;
- DVR_PB_DG(1, "lock speed [%f]", player->speed);
+ DVR_PB_INFO("lock speed [%f]", player->speed);
dvr_mutex_lock(&player->lock);
int seek_time = _dvr_playback_calculate_seekpos(handle);
- DVR_PB_DG(1, "get lock speed [%f]id [%lld]seek_time[%d]", player->speed, player->cur_segment_id, seek_time);
+ DVR_PB_INFO("get lock speed [%f]id [%lld]seek_time[%d]", player->speed, player->cur_segment_id, seek_time);
if (_dvr_has_next_segmentId(handle, player->cur_segment_id) == DVR_FAILURE && seek_time < FB_MIX_SEEK_TIME && IS_FB(player->speed)) {
//seek time set 0
@@ -3584,7 +3584,7 @@
int ret = _change_to_next_segment((DVR_PlaybackHandle_t)player);
if (ret != DVR_SUCCESS && IS_FB(player->speed)) {
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
dvr_playback_pause(handle, DVR_FALSE);
//send event here and pause
DVR_Play_Notify_t notify;
@@ -3592,19 +3592,19 @@
notify.event = DVR_PLAYBACK_EVENT_REACHED_BEGIN;
//get play statue not here
_dvr_playback_sent_event(handle, DVR_PLAYBACK_EVENT_REACHED_BEGIN, ¬ify, DVR_TRUE);
- DVR_PB_DG(1, "*******************send begin event speed [%f] cur [%d]", player->speed, _dvr_get_cur_time(handle));
+ DVR_PB_INFO("*******************send begin event speed [%f] cur [%d]", player->speed, _dvr_get_cur_time(handle));
//change to pause
return DVR_SUCCESS;
}
_dvr_playback_sent_transition_ok(handle, DVR_FALSE);
_dvr_init_fffb_time(handle);
- DVR_PB_DG(1, "*******************send trans ok event speed [%f]", player->speed);
+ DVR_PB_INFO("*******************send trans ok event speed [%f]", player->speed);
}
player->next_fffb_time =_dvr_time_getClock() + FFFB_SLEEP_TIME;
_dvr_playback_fffb_replay(handle);
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
return DVR_SUCCESS;
}
@@ -3615,7 +3615,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -3641,19 +3641,19 @@
memset(&aparams, 0, sizeof(aparams));
//get segment info and audio video pid fmt ;
- DVR_PB_DG(1, "into");
+ DVR_PB_INFO("into");
_dvr_playback_get_playinfo(handle, segment_id, &vparams, &aparams, &adparams);
//start audio and video
if (!VALID_PID(vparams.pid) && !VALID_PID(aparams.pid)) {
//audio and video pis is all invalid, return error.
- DVR_PB_DG(0, "dvr play back restart error, not found audio and video info");
+ DVR_PB_ERROR("dvr play back restart error, not found audio and video info");
return -1;
}
if (VALID_PID(vparams.pid)) {
player->has_video = DVR_TRUE;
if (trick == DVR_TRUE) {
- DVR_PB_DG(1, "settrick mode at replay");
+ DVR_PB_INFO("settrick mode at replay");
AmTsPlayer_setTrickMode(player->handle, AV_VIDEO_TRICK_MODE_PAUSE_NEXT);
}
else {
@@ -3665,31 +3665,31 @@
}
if (IS_FAST_SPEED(player->cmd.speed.speed.speed)) {
- DVR_PB_DG(1, "start fast");
+ DVR_PB_INFO("start fast");
AmTsPlayer_startFast(player->handle, (float)player->cmd.speed.speed.speed/(float)100);
player->speed = (float)player->cmd.speed.speed.speed/100.0f;
} else {
if (VALID_PID(adparams.pid)) {
player->has_ad_audio = DVR_TRUE;
- DVR_PB_DG(1, "start ad audio");
+ DVR_PB_INFO("start ad audio");
AmTsPlayer_setADParams(player->handle, &adparams);
AmTsPlayer_enableADMix(player->handle);
}
if (VALID_PID(aparams.pid)) {
player->has_audio = DVR_TRUE;
- DVR_PB_DG(1, "start audio");
+ DVR_PB_INFO("start audio");
AmTsPlayer_setAudioParams(player->handle, &aparams);
AmTsPlayer_startAudioDecoding(player->handle);
}
- DVR_PB_DG(1, "stop fast");
+ DVR_PB_INFO("stop fast");
AmTsPlayer_stopFast(player->handle);
player->cmd.speed.speed.speed = PLAYBACK_SPEED_X1;
player->speed = (float)PLAYBACK_SPEED_X1/100.0f;
}
#ifdef AVSYNC_USED_PCR
if (player && VALID_PID(player->cur_segment.pids.pcr.pid)) {
- DVR_PB_DG(1, "start set pcr [%d]", player->cur_segment.pids.pcr.pid);
+ DVR_PB_INFO("start set pcr [%d]", player->cur_segment.pids.pcr.pid);
AmTsPlayer_setPcrPid(player->handle, player->cur_segment.pids.pcr.pid);
}
#endif
@@ -3712,19 +3712,19 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (_dvr_support_speed(speed.speed.speed) == DVR_FALSE) {
- DVR_PB_DG(1, " func: not support speed [%d]", speed.speed.speed);
+ DVR_PB_INFO(" func: not support speed [%d]", speed.speed.speed);
return DVR_FAILURE;
}
if (speed.speed.speed == player->cmd.speed.speed.speed) {
- DVR_PB_DG(1, " func: eq speed [%d]", speed.speed.speed);
+ DVR_PB_INFO(" func: eq speed [%d]", speed.speed.speed);
return DVR_SUCCESS;
}
- DVR_PB_DG(1, "lock func: speed [%d]", speed.speed.speed);
+ DVR_PB_INFO("lock func: speed [%d]", speed.speed.speed);
dvr_mutex_lock(&player->lock);
if (player->cmd.cur_cmd != DVR_PLAYBACK_CMD_FF
@@ -3742,7 +3742,7 @@
player->speed = (float)speed.speed.speed/(float)100;
player->fffb_play = DVR_FALSE;
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock");
+ DVR_PB_DEBUG("unlock");
return DVR_SUCCESS;
}
//case 2. cur speed is 100,set 200 50 25 12 .
@@ -3751,28 +3751,28 @@
//if last speed is x2 or s2, we need stop fast
if (speed.speed.speed == PLAYBACK_SPEED_X1) {
// resume audio and stop fast play
- DVR_PB_DG(1, "stop fast");
+ DVR_PB_INFO("stop fast");
AmTsPlayer_stopFast(player->handle);
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
_dvr_cmd(handle, DVR_PLAYBACK_CMD_ASTART);
- DVR_PB_DG(1, "lock ---\r\n");
+ DVR_PB_DEBUG("lock ---\r\n");
dvr_mutex_lock(&player->lock);
} else {
//set play speed and if audio is start, stop audio.
if (player->has_audio) {
- DVR_PB_DG(1, "fast play stop audio");
+ DVR_PB_INFO("fast play stop audio");
AmTsPlayer_stopAudioDecoding(player->handle);
player->has_audio = DVR_FALSE;
}
- DVR_PB_DG(1, "start fast");
+ DVR_PB_INFO("start fast");
AmTsPlayer_startFast(player->handle, (float)speed.speed.speed/(float)100);
}
player->fffb_play = DVR_FALSE;
player->cmd.speed.mode = DVR_PLAYBACK_KERNEL_SUPPORT;
player->cmd.speed.speed = speed.speed;
player->speed = (float)speed.speed.speed/(float)100;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -3780,13 +3780,13 @@
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FB) {
//restart play at normal speed exit ff fb
- DVR_PB_DG(1, "set speed normal and replay playback");
+ DVR_PB_INFO("set speed normal and replay playback");
player->cmd.speed.mode = DVR_PLAYBACK_KERNEL_SUPPORT;
player->cmd.speed.speed = speed.speed;
player->speed = (float)speed.speed.speed/(float)100;
_dvr_playback_replay(handle, DVR_FALSE);
player->fffb_play = DVR_FALSE;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -3798,24 +3798,24 @@
//if last speed is x2 or s2, we need stop fast
if (speed.speed.speed == PLAYBACK_SPEED_X1) {
// resume audio and stop fast play
- DVR_PB_DG(1, "stop fast");
+ DVR_PB_INFO("stop fast");
AmTsPlayer_stopFast(player->handle);
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_ASTART;
} else {
//set play speed and if audio is start, stop audio.
if (player->has_audio) {
- DVR_PB_DG(1, "fast play stop audio at pause");
+ DVR_PB_INFO("fast play stop audio at pause");
AmTsPlayer_stopAudioDecoding(player->handle);
player->has_audio = DVR_FALSE;
}
- DVR_PB_DG(1, "start fast");
+ DVR_PB_INFO("start fast");
AmTsPlayer_startFast(player->handle, (float)speed.speed.speed/(float)100);
}
player->cmd.speed.mode = DVR_PLAYBACK_KERNEL_SUPPORT;
player->cmd.speed.speed = speed.speed;
player->speed = (float)speed.speed.speed/(float)100;
player->fffb_play = DVR_FALSE;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -3823,13 +3823,13 @@
if (player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FB) {
//restart play at normal speed exit ff fb
- DVR_PB_DG(1, "set speed x1 s2 and replay playback");
+ DVR_PB_INFO("set speed x1 s2 and replay playback");
player->cmd.speed.mode = DVR_PLAYBACK_KERNEL_SUPPORT;
player->cmd.speed.speed = speed.speed;
player->speed = (float)speed.speed.speed/(float)100;
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_AVRESTART;
player->fffb_play = DVR_FALSE;
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -3862,14 +3862,14 @@
(player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FF ||
player->cmd.cur_cmd == DVR_PLAYBACK_CMD_FB)) {
//restart play at normal speed exit ff fb
- DVR_PB_DG(1, "set speed normal and replay playback");
+ DVR_PB_INFO("set speed normal and replay playback");
_dvr_playback_replay(handle, DVR_FALSE);
} else if (speed.speed.speed == PLAYBACK_SPEED_X1 &&
(player->state == DVR_PLAYBACK_STATE_PAUSE)) {
player->cmd.cur_cmd = DVR_PLAYBACK_CMD_AVRESTART;
- DVR_PB_DG(1, "set speed normal at pause state ,set cur cmd");
+ DVR_PB_INFO("set speed normal at pause state ,set cur cmd");
}
- DVR_PB_DG(1, "unlock speed[%f]cmd[%d]", player->speed, player->cmd.cur_cmd);
+ DVR_PB_INFO("unlock speed[%f]cmd[%d]", player->speed, player->cmd.cur_cmd);
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
}
@@ -3886,11 +3886,11 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
uint64_t segment_id = 0LL;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
if (is_lock ==DVR_TRUE) {
- DVR_PB_DG(1, "lock");
+ DVR_PB_DEBUG("lock");
dvr_mutex_lock(&player->lock);
}
@@ -3906,14 +3906,14 @@
if (CONTROL_SPEED_ENABLE == 1) {
if (player->con_spe.ply_sta == 0) {
- DVR_PB_DG(1, "player dur[%u] sta[%u] cur[%d] -----reinit",
+ DVR_PB_INFO("player dur[%u] sta[%u] cur[%d] -----reinit",
player->con_spe.ply_dur,
player->con_spe.ply_sta,
p_status->time_cur);
player->con_spe.ply_sta = p_status->time_cur;
} else if (player->speed == 1.0f && player->con_spe.ply_sta < p_status->time_cur) {
player->con_spe.ply_dur += (p_status->time_cur - player->con_spe.ply_sta);
- DVR_PB_DG(1, "player dur[%u] sta[%u] cur[%d]",
+ DVR_PB_INFO("player dur[%u] sta[%u] cur[%d]",
player->con_spe.ply_dur,
player->con_spe.ply_sta,
p_status->time_cur);
@@ -3936,7 +3936,7 @@
if (player->speed > 0.0f ) {
//ff
if (p_status->time_cur < player->last_cur_time ) {
- DVR_PB_DG(1, "get ff time error last[%d]cur[%d]diff[%d]",
+ DVR_PB_INFO("get ff time error last[%d]cur[%d]diff[%d]",
player->last_cur_time,
p_status->time_cur,
player->last_cur_time - p_status->time_cur);
@@ -3947,7 +3947,7 @@
} else if (player->speed <= -1.0f){
//fb
if (p_status->time_cur > player->last_cur_time ) {
- DVR_PB_DG(1, "get fb time error last[%d]cur[%d]diff[%d]",
+ DVR_PB_INFO("get fb time error last[%d]cur[%d]diff[%d]",
player->last_cur_time,
p_status->time_cur,
p_status->time_cur - player->last_cur_time );
@@ -3965,7 +3965,7 @@
memcpy(&p_status->pids, &player->cur_segment.pids, sizeof(DVR_PlaybackPids_t));
p_status->speed = player->cmd.speed.speed.speed;
p_status->flags = player->cur_segment.flags;
- DVR_PB_DG(1, "player real state[%s]state[%s]cur[%d]end[%d] id[%lld]playflag[%d]speed[%f]is_lock[%d]",
+ DVR_PB_INFO("player real state[%s]state[%s]cur[%d]end[%d] id[%lld]playflag[%d]speed[%f]is_lock[%d]",
_dvr_playback_state_toString(player->state),
_dvr_playback_state_toString(p_status->state),
p_status->time_cur, p_status->time_end,
@@ -3973,7 +3973,7 @@
player->speed,
is_lock);
if (is_lock ==DVR_TRUE) {
- DVR_PB_DG(1, "unlock ---\r\n");
+ DVR_PB_DEBUG("unlock ---\r\n");
dvr_mutex_unlock(&player->lock);
}
return DVR_SUCCESS;
@@ -3994,14 +3994,14 @@
_dvr_playback_get_status(handle, p_status, DVR_TRUE);
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
- DVR_PB_DG(1, "lock---");
+ DVR_PB_DEBUG("lock---");
dvr_mutex_lock(&player->lock);
if (!player->has_video && !player->has_audio)
p_status->time_cur = 0;
- DVR_PB_DG(1, "unlock---");
+ DVR_PB_DEBUG("unlock---");
dvr_mutex_unlock(&player->lock);
return DVR_SUCCESS;
@@ -4009,13 +4009,13 @@
void _dvr_dump_segment(DVR_PlaybackSegmentInfo_t *segment) {
if (segment != NULL) {
- DVR_PB_DG(1, "segment id: %lld", segment->segment_id);
- DVR_PB_DG(1, "segment flag: %d", segment->flags);
- DVR_PB_DG(1, "segment location: [%s]", segment->location);
- DVR_PB_DG(1, "segment vpid: 0x%x vfmt:0x%x", segment->pids.video.pid,segment->pids.video.format);
- DVR_PB_DG(1, "segment apid: 0x%x afmt:0x%x", segment->pids.audio.pid,segment->pids.audio.format);
- DVR_PB_DG(1, "segment pcr pid: 0x%x pcr fmt:0x%x", segment->pids.pcr.pid,segment->pids.pcr.format);
- DVR_PB_DG(1, "segment sub apid: 0x%x sub afmt:0x%x", segment->pids.ad.pid,segment->pids.ad.format);
+ DVR_PB_INFO("segment id: %lld", segment->segment_id);
+ DVR_PB_INFO("segment flag: %d", segment->flags);
+ DVR_PB_INFO("segment location: [%s]", segment->location);
+ DVR_PB_INFO("segment vpid: 0x%x vfmt:0x%x", segment->pids.video.pid,segment->pids.video.format);
+ DVR_PB_INFO("segment apid: 0x%x afmt:0x%x", segment->pids.audio.pid,segment->pids.audio.format);
+ DVR_PB_INFO("segment pcr pid: 0x%x pcr fmt:0x%x", segment->pids.pcr.pid,segment->pids.pcr.format);
+ DVR_PB_INFO("segment sub apid: 0x%x sub afmt:0x%x", segment->pids.ad.pid,segment->pids.ad.format);
}
}
@@ -4023,7 +4023,7 @@
DVR_Playback_t *player = (DVR_Playback_t *) handle;
if (player == NULL) {
- DVR_PB_DG(1, "player is NULL");
+ DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
}
@@ -4049,14 +4049,14 @@
DVR_RETURN_IF_FALSE(player);
DVR_RETURN_IF_FALSE(func);
- DVR_PB_DG(1, "in ");
+ DVR_PB_INFO("in ");
dvr_mutex_lock(&player->lock);
player->dec_func = func;
player->dec_userdata = userdata;
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "out ");
+ DVR_PB_INFO("out ");
return DVR_SUCCESS;
}
@@ -4067,7 +4067,7 @@
DVR_RETURN_IF_FALSE(p_secure_buf);
DVR_RETURN_IF_FALSE(len);
- DVR_PB_DG(1, "in ");
+ DVR_PB_INFO("in ");
dvr_mutex_lock(&player->lock);
player->is_secure_mode = 1;
@@ -4075,6 +4075,6 @@
player->secure_buffer_size = len;
dvr_mutex_unlock(&player->lock);
- DVR_PB_DG(1, "out");
+ DVR_PB_INFO("out");
return DVR_SUCCESS;
}