diff options
-rw-r--r-- | packaging/capi-media-streamrecorder.spec | 2 | ||||
-rw-r--r-- | test/streamrecorder_test.c | 21 |
2 files changed, 18 insertions, 5 deletions
diff --git a/packaging/capi-media-streamrecorder.spec b/packaging/capi-media-streamrecorder.spec index 4f68fe9..3fc25f3 100644 --- a/packaging/capi-media-streamrecorder.spec +++ b/packaging/capi-media-streamrecorder.spec @@ -1,6 +1,6 @@ Name: capi-media-streamrecorder Summary: A Streamrecorder library in Tizen Native API -Version: 0.0.8 +Version: 0.0.9 Release: 0 Group: Multimedia/Other License: Apache-2.0 diff --git a/test/streamrecorder_test.c b/test/streamrecorder_test.c index 991a608..9f83c50 100644 --- a/test/streamrecorder_test.c +++ b/test/streamrecorder_test.c @@ -241,10 +241,7 @@ media_packet_h streamrecorder_make_media_packet(int video, void *data, int size) } media_format_set_video_width(output_fmt, 1280); media_format_set_video_height(output_fmt, 720); - if (media_format_set_video_frame_rate(output_fmt, 30)) { - g_print("media_format_set_video_frame_rate failed\n"); - return NULL; - } + media_format_set_video_frame_rate(output_fmt, 30); } else { media_format_set_audio_mime(output_fmt, MEDIA_FORMAT_PCM); media_format_set_audio_channel(output_fmt, 1); @@ -269,6 +266,19 @@ media_packet_h streamrecorder_make_media_packet(int video, void *data, int size) return out_pkt; } +static void _consume_completed_cb(void *buffer , void *user_data) +{ + media_packet_h pkt = NULL; + media_format_h fmt = NULL; + LOGD("_consume_completed_cb : Used mediapacket will be free"); + + pkt = buffer; + media_packet_get_format(pkt, &fmt); + media_format_unref(fmt); + media_packet_destroy(pkt); + return; +} + void feed_video_es(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer data) { guint n; @@ -285,6 +295,7 @@ void feed_video_es(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer gst_memory_map(mem, &map, GST_MAP_READ); out_pkt = streamrecorder_make_media_packet(1, map.data, map.size); gst_memory_unmap(mem, &map); + gst_buffer_unref(buffer); if (out_pkt) { media_packet_set_pts(out_pkt, buffer->pts); media_packet_set_extra(out_pkt, buffer); @@ -737,6 +748,8 @@ static gboolean mode_change() return -1; } + err = streamrecorder_set_buffer_consume_completed_cb(hmstreamrecorder->recorder, _consume_completed_cb, NULL); + g_timer_reset(timer); err = streamrecorder_prepare(hmstreamrecorder->recorder); |