| FUNCTION DEFINITIONS |
| |
========================================================================================== */
+#ifdef __DEBUG__
+static void
+print_tag(const GstTagList *list, const gchar *tag, gpointer unused)
+{
+ gint i, count;
+
+ count = gst_tag_list_get_tag_size(list, tag);
+
+ LOGD("count = %d", count);
+
+ for (i = 0; i < count; i++) {
+ gchar *str;
+
+ if (gst_tag_get_type(tag) == G_TYPE_STRING) {
+ if (!gst_tag_list_get_string_index(list, tag, i, &str))
+ g_assert_not_reached();
+ } else {
+ str = g_strdup_value_contents(gst_tag_list_get_value_index(list, tag, i));
+ }
+
+ if (i == 0)
+ g_print(" %15s: %s", gst_tag_get_nick(tag), str);
+ else
+ g_print(" : %s", str);
+
+ g_free(str);
+ }
+}
+#endif
static gboolean
__mmplayer_check_error_posted_from_activated_track(mmplayer_t *player, gchar *src_element_name)
__mmplayer_gst_handle_async_done_message(player, msg);
break;
- #if 0 /* delete unnecessary logs */
+#ifdef __DEBUG__
case GST_MESSAGE_REQUEST_STATE: LOGD("GST_MESSAGE_REQUEST_STATE"); break;
case GST_MESSAGE_STEP_START: LOGD("GST_MESSAGE_STEP_START"); break;
case GST_MESSAGE_QOS: LOGD("GST_MESSAGE_QOS"); break;
case GST_MESSAGE_SEGMENT_START: LOGD("GST_MESSAGE_SEGMENT_START"); break;
case GST_MESSAGE_SEGMENT_DONE: LOGD("GST_MESSAGE_SEGMENT_DONE"); break;
case GST_MESSAGE_LATENCY: LOGD("GST_MESSAGE_LATENCY"); break;
- #endif
+#endif
default:
break;
case GST_MESSAGE_TAG:
__mmplayer_gst_extract_tag_from_msg(player, message);
- #if 0 // debug
+#ifdef __DEBUG__
{
GstTagList *tags = NULL;
}
break;
}
- #endif
+#endif
break;
case GST_MESSAGE_DURATION_CHANGED:
GST_BUFFER_OFFSET(buffer) = (guint64)buf->offset;
GST_BUFFER_OFFSET_END(buffer) = (guint64)(buf->offset + len);
- //LOGD("feed buffer %p, offset %u-%u length %u", buffer, buf->offset, (buf->offset+len), len);
+#ifdef __DEBUG__
+ LOGD("feed buffer %p, offset %u-%u length %u", buffer, buf->offset, (buf->offset+len), len);
+#endif
g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);
buf->offset += len;
dec_caps = gst_pad_query_caps(srcpad, NULL);
if (dec_caps) {
- //LOGD("got pad %s:%s , dec_caps %" GST_PTR_FORMAT, GST_DEBUG_PAD_NAME(srcpad), dec_caps);
+#ifdef __DEBUG__
+ LOGD("got pad %s:%s , dec_caps %" GST_PTR_FORMAT, GST_DEBUG_PAD_NAME(srcpad), dec_caps);
+#endif
g_object_set(G_OBJECT(decodebin), "sink-caps", dec_caps, NULL);
gst_caps_unref(dec_caps);
}
| |
========================================================================================== */
-#if 0 //debug
-static void
-print_tag(const GstTagList *list, const gchar *tag, gpointer unused)
-{
- gint i, count;
-
- count = gst_tag_list_get_tag_size(list, tag);
-
- LOGD("count = %d", count);
-
- for (i = 0; i < count; i++) {
- gchar *str;
-
- if (gst_tag_get_type(tag) == G_TYPE_STRING) {
- if (!gst_tag_list_get_string_index(list, tag, i, &str))
- g_assert_not_reached();
- } else {
- str = g_strdup_value_contents(gst_tag_list_get_value_index(list, tag, i));
- }
-
- if (i == 0)
- g_print(" %15s: %s", gst_tag_get_nick(tag), str);
- else
- g_print(" : %s", str);
-
- g_free(str);
- }
-}
-#endif
-
/* This function should be called after the pipeline goes PAUSED or higher
state. */
gboolean
mmplayer_state_e pending_state = MM_PLAYER_STATE_NUM;
MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
-
- //LOGD("incomming command : %d ", command);
-
+#ifdef __DEBUG__
+ LOGD("incomming command : %d ", command);
+#endif
current_state = MMPLAYER_CURRENT_STATE(player);
pending_state = MMPLAYER_PENDING_STATE(player);
for (idx = MM_PLAYER_TRACK_TYPE_AUDIO; idx < MM_PLAYER_TRACK_TYPE_TEXT; idx++) {
if ((player->gapless.update_segment[idx] == TRUE) ||
!(player->selector[idx].event_probe_id)) {
- /* LOGW("[%d] skip", idx); */
+#ifdef __DEBUG__
+ LOGW("[%d] skip", idx);
+#endif
continue;
}
break;
}
+#ifdef __DEBUG__
LOGD("[%d] Adjusting QOS event: %" GST_TIME_FORMAT
" - %" GST_TIME_FORMAT " = %" GST_TIME_FORMAT,
stream_type, GST_TIME_ARGS(timestamp),
GST_TIME_ARGS(running_time_diff),
GST_TIME_ARGS(timestamp - running_time_diff));
+#endif
timestamp -= running_time_diff;
goto ERROR;
MMPLAYER_LOG_GST_CAPS_TYPE(caps);
- /* LOGD("detected mimetype : %s", name); */
+#ifdef __DEBUG__
+ LOGD("detected mimetype : %s", name);
+#endif
if (strstr(name, "video")) {
gint stype = 0;
goto ERROR;
caps_str = gst_caps_to_string(caps);
-
- /* LOGD("detected mimetype : %s", name); */
+#ifdef __DEBUG__
+ LOGD("detected mimetype : %s", name);
+#endif
if (strstr(name, "audio")) {
if (player->pipeline->audiobin == NULL) {
const gchar *audio_format = gst_structure_get_string(str, "format");
audio_stream.data_size = a_buffer->data_size;
audio_stream.data = a_buffer->pcm_data;
audio_stream.pcm_format = a_buffer->pcm_format;
-
- /* LOGD("[%"G_GUINT64_FORMAT"] send data size:%d, %p", audio_stream.channel_mask, audio_stream.data_size, player->audio_decoded_cb_user_param); */
+#ifdef __DEBUG__
+ LOGD("[%"G_GUINT64_FORMAT"] send data size:%d, %p", audio_stream.channel_mask, audio_stream.data_size, player->audio_decoded_cb_user_param);
+#endif
player->audio_decoded_cb(&audio_stream, player->audio_decoded_cb_user_param);
MMPLAYER_FLEAVE();
GstCaps *caps = gst_pad_get_current_caps(pad);
GstStructure *structure = gst_caps_get_structure(caps, 0);
-
- /* MMPLAYER_LOG_GST_CAPS_TYPE(caps); */
+#ifdef __DEBUG__
+ MMPLAYER_LOG_GST_CAPS_TYPE(caps);
+#endif
pcm_format = gst_structure_get_string(structure, "format");
gst_structure_get_int(structure, "rate", &rate);
gst_structure_get_int(structure, "channels", &channel);
mmplayer_audio_stream_buff_t *tmp = (mmplayer_audio_stream_buff_t *)l->data;
if (tmp) {
if (channel_mask == tmp->channel_mask) {
- /* LOGD("[%"G_GUINT64_FORMAT"] total: %d, data: %d, buffer: %d", channel_mask, tmp->data_size, a_size, tmp->buff_size); */
+#ifdef __DEBUG__
+ LOGD("[%"G_GUINT64_FORMAT"] total: %d, data: %d, buffer: %d", channel_mask, tmp->data_size, a_size, tmp->buff_size);
+#endif
if (tmp->data_size + a_size < tmp->buff_size) {
memcpy(tmp->pcm_data + tmp->data_size, a_data, a_size);
tmp->data_size += a_size;
goto DONE;
}
memcpy(a_buffer->pcm_data, a_data, a_size);
- /* LOGD("new [%"G_GUINT64_FORMAT"] total:%d buff:%d", channel_mask, a_buffer->data_size, a_buffer->buff_size); */
+#ifdef __DEBUG__
+ LOGD("new [%"G_GUINT64_FORMAT"] total:%d buff:%d", channel_mask, a_buffer->data_size, a_buffer->buff_size);
+#endif
player->audio_stream_buff_list = g_list_append(player->audio_stream_buff_list, a_buffer);
} else {
/* If sync is TRUE, send data directly. */
}
/* release */
for (i = 0; i < arg_count; i++) {
- //LOGD("release - argv[%d] : %s", i, argv2[i]);
+#ifdef __DEBUG__
+ LOGD("release - argv[%d] : %s", i, argv2[i]);
+#endif
MMPLAYER_FREEIF(argv2[i]);
}
"max-video-height", player->adaptive_info.limit.height, NULL);
} else if (g_strrstr(klass, "Demuxer")) {
- //LOGD("plugged element is demuxer. take it");
+#ifdef __DEBUG__
+ LOGD("plugged element is demuxer. take it");
+#endif
player->pipeline->mainbin[MMPLAYER_M_DEMUX].id = MMPLAYER_M_DEMUX;
player->pipeline->mainbin[MMPLAYER_M_DEMUX].gst = element;
}
MMPLAYER_RETURN_VAL_IF_FAIL(dump_data, GST_PAD_PROBE_PASS);
gst_buffer_map(buffer, &probe_info, GST_MAP_READ);
-
-// LOGD("buffer timestamp = %" GST_TIME_FORMAT, GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(buffer)));
-
+#ifdef __DEBUG__
+ LOGD("buffer timestamp = %" GST_TIME_FORMAT, GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(buffer)));
+#endif
fwrite(probe_info.data, 1, probe_info.size , dump_data);
gst_buffer_unmap(buffer, &probe_info);
{
MMPLAYER_FENTER();
if (buffer) {
- // LOGD("unref internal gst buffer %p", buffer);
+#ifdef __DEBUG__
+ LOGD("unref internal gst buffer %p", buffer);
+#endif
gst_buffer_unref((GstBuffer *)buffer);
buffer = NULL;
}
return NULL;
}
- /* MMPLAYER_LOG_GST_CAPS_TYPE(caps); */
+#ifdef __DEBUG__
+ MMPLAYER_LOG_GST_CAPS_TYPE(caps);
+#endif
structure = gst_caps_get_structure(caps, 0);
gst_structure_get_int(structure, "width", &width);
gst_structure_get_int(structure, "height", &height);