Name: libmm-streamrecorder
Summary: Media Stream Recorder library
-Version: 0.0.30
+Version: 0.0.31
Release: 0
Group: Multimedia/Other
License: Apache-2.0
{
GstCaps *caps = NULL;
-
+ gchar *type = NULL;
switch (srcfmt) {
case MM_STREAMRECORDER_INPUT_FORMAT_NV12 :
caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "NV12", "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, rate, scale, NULL);
if (!caps)
_mmstreamrec_dbg_err("failed to alloc caps");
- /* gchar *type = gst_caps_to_string(caps); */
+ type = gst_caps_to_string(caps);
- /* _mmstreamrec_dbg_warn("Set srcpad caps: %s",type); */
+ _mmstreamrec_dbg_warn("Set srcfmt %d caps: %s",srcfmt, type);
- /* g_free(type); */
+ g_free(type);
return caps;
}
GST_BUFFER_DURATION(stream_buffer->buffer) = GST_CLOCK_TIME_NONE;
if (streamtype == MM_STREAM_TYPE_VIDEO) {
- if (format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 || format == MM_STREAMRECORDER_INPUT_FORMAT_NV21) {
+ if (format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+ format == MM_STREAMRECORDER_INPUT_FORMAT_NV21) {
MMVideoBuffer *video_buf = (MMVideoBuffer *)buffer;
+
/* Buffer at 0th position */
gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
video_buf->data[0], size, 0, size, video_buf->data[0], NULL));
/* Buffer at 1st position */
gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
- video_buf, sizeof(MMVideoBuffer), 0, sizeof(MMVideoBuffer), stream_buffer, _mmstreamrecorder_buffer_destroy));
+ video_buf->data[1], size / 2, 0, size / 2, stream_buffer, _mmstreamrecorder_buffer_destroy));
} else {
gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
buffer, size, 0, size, stream_buffer, _mmstreamrecorder_buffer_destroy));
MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_ENCBIN].gst, "auto-colorspace", hstreamrecorder->ini.encsink_bin_auto_colorspace);
- if (video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 || video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV21 )
+ if (video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+ video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV21)
video_src_format = MM_STREAMRECORDER_INPUT_FORMAT_I420;
caps = gst_set_videosrcpad_caps_sw(video_src_format, video_width, video_height, video_fps, 1);
MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_ENCBIN].gst, "vcaps", caps);
- if (video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV12)
+ if (video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+ video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV21)
MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_VCONV].gst, "dst-buffer-num", hstreamrecorder->ini.convert_output_buffer_num);
/* state tuning */
if (sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst) {
- /*_mmstreamrec_dbg_log("Buffer Push start , time stamp %ld",timestamp);*/
- /* srcpad = gst_element_get_static_pad(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst, "src"); */
- /* srccaps = gst_pad_get_current_caps(srcpad); */
srccaps = gst_set_videosrcpad_caps_sw(video_src, video_width, video_height, video_fps, 1);
if (srccaps) {
gst_app_src_set_caps((GstAppSrc *) sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst, srccaps);