Various fixes due to the gsize.
: print format is corrected.
: webrtc_get_data() is revised to have unsigned long* type for
it's the second out-param.
Missing '%' command is added to have valid usr/lib[64] dir in
the spec file.
Fix build error in case of using define for tv profile.
[Version] 0.2.61
[Issue Type] Build and API
Change-Id: Ide1b0241b1b8f20e26a422d2d9a1ab4be69f87f7
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
SET(CMAKE_INSTALL_PREFIX /usr)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
SET(PC_NAME ${fw_name})
SET(PC_REQUIRED ${pc_dependents})
SET(PC_LDFLAGS -l${fw_name})
-SET(PC_CFLAGS -I\${includedir}/media)
CONFIGURE_FILE(
${fw_name}.pc.in
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @see webrtc_data_channel_message_cb()
*/
-int webrtc_get_data(webrtc_bytes_data_h bytes, const char **data, unsigned int *size);
+int webrtc_get_data(webrtc_bytes_data_h bytes, const char **data, unsigned long *size);
/**
* @}
typedef struct _webrtc_bytes_data_s {
void *data;
- unsigned int size;
+ unsigned long size;
} webrtc_bytes_data_s;
typedef struct _element_info_s {
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.2.60
+Version: 0.2.61
Release: 0
Group: Multimedia/API
License: Apache-2.0
%package devel
Summary: Multimedia WebRTC Library in Tizen Native API (Development)
-Group: TO_BE/FILLED_IN
+Group: Multimedia/Development
Requires: %{name} = %{version}-%{release}
%description devel
cp %{SOURCE1001} .
%build
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
export CFLAGS+=" -DSYSCONFDIR=\\\"%{_hal_sysconfdir}\\\""
export CXXFLAGS+=" -DSYSCONFDIR=\\\"%{_hal_sysconfdir}\\\""
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
%if "%{tizen_profile_name}" == "tv"
-DTIZEN_PROFILE_TV=on
%else
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}/usr/bin
-cp test/webrtc_test %{buildroot}/usr/bin
+mkdir -p %{buildroot}%{_bindir}
+cp test/webrtc_test %{buildroot}%{_bindir}
%make_install
%files
%manifest %{name}.manifest
-%{_libdir}/libcapi-media-webrtc.so.*
+%{_libdir}/lib%{name}.so.*
+%{_bindir}/webrtc_test
%license LICENSE.APLv2
-/usr/bin/*
%files devel
%{_includedir}/media/*.h
%{_libdir}/pkgconfig/*.pc
-%{_libdir}/libcapi-media-webrtc.so
+%{_libdir}/lib%{name}.so
return WEBRTC_ERROR_NONE;
}
-int webrtc_get_data(webrtc_bytes_data_h bytes, const char **data, unsigned int *size)
+int webrtc_get_data(webrtc_bytes_data_h bytes, const char **data, unsigned long *size)
{
webrtc_bytes_data_s *_bytes = (webrtc_bytes_data_s*)bytes;
*data = (const char*)_bytes->data;
*size = _bytes->size;
- LOG_INFO("data[%p] size[%u]", *data, *size);
+ LOG_INFO("data[%p] size[%lu]", *data, *size);
return WEBRTC_ERROR_NONE;
}
RET_IF(channel == NULL, "channel is NULL");
- LOG_DEBUG("channel[%p, %s] bytes[%p, size:%u] user_data[%p]",
+ LOG_DEBUG("channel[%p, %s] bytes[%p, size:%"G_GSIZE_FORMAT"] user_data[%p]",
channel, GST_OBJECT_NAME(data_channel), bytes, g_bytes_get_size(bytes), user_data);
if (channel->message_cb.callback) {
webrtc_bytes_data_s data = { 0, };
- data.data = (void*)g_bytes_get_data(bytes, &data.size);
+ gsize size;
+ data.data = (void*)g_bytes_get_data(bytes, &size);
+ data.size = (unsigned long)size;
LOG_DEBUG(">>> callback[%p] user_data[%p]", channel->message_cb.callback, channel->message_cb.user_data);
((webrtc_data_channel_message_cb)(channel->message_cb.callback))((webrtc_data_channel_h)channel, WEBRTC_DATA_CHANNEL_TYPE_BYTES, &data, channel->message_cb.user_data);
gst_structure_set(structure, key, type, (gchar*)value, NULL);
break;
default:
- LOG_ERROR("not supported GType(%d)", type);
+ LOG_ERROR("not supported GType(%d)", (int)type);
}
}
LOG_ERROR("failed to media_packet_set_codec_data()");
ret = WEBRTC_ERROR_INVALID_OPERATION;
}
- LOG_DEBUG("codec_data[%p, size:%u] is set to the media packet[%p]", buff_info.data, buff_info.size, packet);
+ LOG_DEBUG("codec_data[%p, size:%"G_GSIZE_FORMAT"] is set to the media packet[%p]", buff_info.data, buff_info.size, packet);
gst_buffer_unmap(codec_data, &buff_info);
}
buff_info.size = size;
- LOG_DEBUG("buffer[%p], buff_info[data:%p, size:%u]", buffer, buff_info.data, buff_info.size);
+ LOG_DEBUG("buffer[%p], buff_info[data:%p, size:%"G_GSIZE_FORMAT"]", buffer, buff_info.data, buff_info.size);
gst_buffer_unmap(buffer, &buff_info);
}
GST_BUFFER_DURATION(buffer) = duration;
gst_buffer_append_memory(buffer, mem);
- LOG_DEBUG("buffer[%p, pts:%llu, dts:%llu, duration:%llu, tizen memory:%p]", buffer, pts, dts, duration, mem);
+ LOG_DEBUG("buffer[%p, pts:%"G_GUINT64_FORMAT", dts:%"G_GUINT64_FORMAT", duration:%"G_GUINT64_FORMAT", tizen memory:%p]",
+ buffer, pts, dts, duration, mem);
return buffer;
}
}
GST_BUFFER_DURATION(buffer) = duration;
- LOG_DEBUG("new gst buffer[%p, pts:%llu, dts:%llu, duration:%llu]", buffer, pts, dts, duration);
+ LOG_DEBUG("new gst buffer[%p, pts:%"G_GUINT64_FORMAT", dts:%"G_GUINT64_FORMAT", duration:%"G_GUINT64_FORMAT"]",
+ buffer, pts, dts, duration);
g_signal_emit_by_name(G_OBJECT(appsrc), "push-buffer", buffer, &gst_ret, NULL);
if (gst_ret != GST_FLOW_OK) {
const char *videosink_factory_name;
GstElement *videosink;
GstElement *videoconvert;
- int ret = WEBRTC_ERROR_NONE;
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(link_with == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "link_with is NULL");
#ifndef TIZEN_TV
if (source->display->type == WEBRTC_DISPLAY_TYPE_OVERLAY && webrtc->ini.resource_acquisition.video_overlay) {
- if ((ret = _acquire_resource_for_type(webrtc, MM_RESOURCE_MANAGER_RES_TYPE_VIDEO_OVERLAY))) {
+ int ret;
+ if ((ret = _acquire_resource_for_type(webrtc, MM_RESOURCE_MANAGER_RES_TYPE_VIDEO_OVERLAY)) != WEBRTC_ERROR_NONE) {
SAFE_GST_OBJECT_UNREF(videosink);
SAFE_GST_OBJECT_UNREF(videoconvert);
return ret;
conn->receive_buffer = NULL;
}
if (conn->expected_size > MAX_EXPECTED_SIZE)
- g_print("expected_size[%llu], too big to alloc memory, skip it\n", conn->expected_size);
+ g_print("expected_size[%"G_GUINT64_FORMAT"], too big to alloc memory, skip it\n", conn->expected_size);
else
conn->receive_buffer = (char *)calloc(conn->expected_size, sizeof(char));
}
} else if (type == WEBRTC_DATA_CHANNEL_TYPE_BYTES) {
webrtc_bytes_data_h *data = message;
const char *data_p;
- unsigned int size;
+ unsigned long size;
int i = 0;
webrtc_get_data(data, &data_p, &size);
- g_print("bytes message[%p, size:%u]\n", data_p, size);
+ g_print("bytes message[%p, size:%lu]\n", data_p, size);
if (conn->expected_size > 0 && conn->expected_name) {
- g_print("downloading [%s], size[%llu / %llu]\n", conn->expected_name, conn->sum_size, conn->expected_size);
+ g_print("downloading [%s], size[%"G_GUINT64_FORMAT" / %"G_GUINT64_FORMAT"]\n", conn->expected_name, conn->sum_size, conn->expected_size);
if (conn->receive_buffer == NULL) {
g_print("receive_buffer is null, skip copying it\n");
ret |= media_packet_set_dts(packet, last_dts);
ret |= media_packet_set_duration(packet, GST_BUFFER_DURATION(buffer));
- g_print("buffer[%p], size[%u], pts[%llu], dts[%llu], duration[%llu]\n",
+ g_print("buffer[%p], size[%"G_GSIZE_FORMAT"], pts[%"G_GUINT64_FORMAT"], dts[%"G_GUINT64_FORMAT"], duration[%"G_GUINT64_FORMAT"]\n",
buffer, gst_buffer_get_size(buffer), last_pts, last_dts, GST_BUFFER_DURATION(buffer));
/* FIXME: We put the gstbuffer to extra field of media packet. It does not guarantee the validity of the gstbuffer
last_pts = pts = base_pts + GST_BUFFER_PTS(buffer);
last_dts = dts = base_dts + GST_BUFFER_DTS(buffer);
duration = GST_BUFFER_DURATION(buffer);
- g_print("buffer[%p], size[%u], pts[%llu], dts[%llu], duration[%llu]\n", buffer, size, last_pts, last_dts, duration);
+ g_print("buffer[%p], size[%"G_GSIZE_FORMAT"], pts[%"G_GUINT64_FORMAT"], dts[%"G_GUINT64_FORMAT"], duration[%"G_GUINT64_FORMAT"]\n",
+ buffer, size, last_pts, last_dts, duration);
ret = media_packet_set_pts(packet, last_pts);
if (ret != MEDIA_PACKET_ERROR_NONE) {