problom with constructing GstBuffer

Ugly Face xuchangxue365812 at 126.com
Tue Jan 7 05:11:41 PST 2014


Thanks for your kindly reply. 
I change my code like this:

memcpy(GST_BUFFER_DATA(buffer) , (*env)->GetByteArrayElements(env, fdata, 
JNI_FALSE), data_len);
//GST_BUFFER_DATA (buffer) = (*env)->GetByteArrayElements(env, fdata, 
JNI_FALSE);

and the program dose not exit with error anymore . However, the pipe still
does not work properly . I wonder if more paramters of gstbuffer should be
set to get things work? 

My gstbuffer is construced like this:

	int data_len = 115200;
	int frame_rate = 15;
	GstBuffer *buffer;
	buffer = gst_buffer_new_and_alloc(data_len);
	CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);

	GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (data->frame_num,
GST_SECOND, frame_rate);
	GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale (1, GST_SECOND,
frame_rate);

	data->frame_num++;
	memcpy(GST_BUFFER_DATA(buffer) , (*env)->GetByteArrayElements(env, fdata, 
JNI_FALSE), data_len);
	//GST_BUFFER_DATA (buffer) = (*env)->GetByteArrayElements(env, fdata, 
JNI_FALSE);
	gst_app_src_push_buffer(data->appsrc, buffer);
	gst_buffer_unref(buffer);

do you think it wil work with raw NV21 data?



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/problom-with-constructing-GstBuffer-tp4664432p4664527.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list