return ret;
}
+static void
+_mm_decode_add_sink(handle_s *handle , GstElement* sink_elements)
+{
+
+ if (!handle) {
+ debug_error("[ERROR] - handle");
+ return;
+ }
+
+ if (!handle->property) {
+ debug_error("[ERROR] - handle property");
+ return;
+ }
+
+ if(sink_elements) {
+ handle->property->sink_elements = g_list_append(handle->property->sink_elements, sink_elements);
+ debug_log("g_list_append");
+ }
+
+}
+
static int
_mm_decode_audio_output_create(handle_s *handle)
return MM_ERROR_TRANSCODE_INTERNAL;
}
+ _mm_decode_add_sink(handle, handle->decoder_audp->decsinkaudioqueue);
+
handle->decoder_audp->decaudiosinkpad = gst_element_get_static_pad (handle->decoder_audp->decsinkaudioqueue, "sink");
if (!handle->decoder_audp->decaudiosinkpad) {
debug_error("decaudiosinkpad could not be created");
return MM_ERROR_TRANSCODE_INTERNAL;
}
+ _mm_decode_add_sink(handle, handle->decoder_vidp->decsinkvideoqueue);
+
handle->decoder_vidp->decvideosinkpad = gst_element_get_static_pad(handle->decoder_vidp->decsinkvideoqueue,"sink");
if (!handle->decoder_vidp->decvideosinkpad) {
debug_error("decvideosinkpad element could not be created. Exiting");
g_object_set(G_OBJECT(gst_bin_get_by_name(GST_BIN(handle->encodebin->encbin), "audio_encode")), AACCOMPLIANCE, AACCOMPLIANCELEVEL, NULL);
}
- g_object_get(G_OBJECT(handle->encodebin->encbin), "use-aenc-queue", &(handle->encodebin->use_aencqueue), NULL);
- debug_log("use_aencqueue : %d", handle->encodebin->use_aencqueue);
+ g_object_get(G_OBJECT(handle->encodebin->encbin), "use-aenc-queue", &(handle->encodebin->aencqueue), NULL);
+ debug_log("aencqueue : %s", GST_ELEMENT_NAME(handle->encodebin->aencqueue));
}
return ret;
#include "mm_transcode.h"
#include "mm_transcode_internal.h"
-static void _mm_transcode_add_sink(handle_s *handle, GstElement* sink_elements);
static void _mm_transcode_audio_capsfilter(GstCaps *caps, handle_s *handle);
static void _mm_transcode_video_capsfilter(GstCaps *caps, handle_s *handle);
static void _mm_transcode_video_capsfilter_call(handle_s *handle);
gint64 start_pos_ts = handle->param->start_pos * G_GINT64_CONSTANT(1000000);
- if (GST_BUFFER_TIMESTAMP_IS_VALID (GST_PAD_PROBE_INFO_BUFFER(info))) {
+ if (GST_BUFFER_PTS_IS_VALID (GST_PAD_PROBE_INFO_BUFFER(info))) {
if (0 == handle->property->AUDFLAG++) {
- _mm_transcode_audio_capsfilter(gst_pad_get_current_caps (pad), handle); /* Need to audio caps converting when amrnbenc*/ /* Not drop buffer with 'return FALSE'*/
+ GstCaps *current_caps = gst_pad_get_current_caps (pad);
+ /* Need to audio caps converting when amrnbenc*/
+ /* Not drop buffer with 'return FALSE'*/
+ _mm_transcode_audio_capsfilter(current_caps, handle);
+
+ if (current_caps)
+ gst_caps_unref(current_caps);
if (handle->param->seeking) {
debug_log("[AUDIO BUFFER TIMESTAMP] ([%"G_GUINT64_FORMAT"])", start_pos_ts);
- GST_BUFFER_TIMESTAMP (GST_PAD_PROBE_INFO_BUFFER(info)) = start_pos_ts;
+ GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) = start_pos_ts;
+ }
+ }
+ }
+ return GST_PAD_PROBE_OK;
+}
+
+GstPadProbeReturn
+_mm_cb_video_output_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data)
+{
+ handle_s *handle = (handle_s*) user_data;
+
+ if (!handle) {
+ debug_error("[ERROR] - handle");
+ return GST_PAD_PROBE_REMOVE;
+ }
+
+ if (!handle->property) {
+ debug_error("[ERROR] - handle property");
+ return GST_PAD_PROBE_REMOVE;
+ }
+
+ gint64 start_pos_ts = handle->param->start_pos * G_GINT64_CONSTANT(1000000);
+
+ if (GST_BUFFER_PTS_IS_VALID (GST_PAD_PROBE_INFO_BUFFER(info))) {
+ if (0 == handle->property->VIDFLAG++) {
+ GstCaps *current_caps = gst_pad_get_current_caps (pad);
+ /* Not drop buffer with 'return FALSE'*/
+ _mm_transcode_video_capsfilter(current_caps, handle);
+
+ if (current_caps)
+ gst_caps_unref(current_caps);
+
+ if(handle->param->seeking) {
+ debug_log("[VIDEO BUFFER TIMESTAMP] ([%"G_GUINT64_FORMAT"])", start_pos_ts);
+ GST_BUFFER_PTS (GST_PAD_PROBE_INFO_BUFFER(info)) = start_pos_ts;
}
}
}
return GST_PAD_PROBE_OK;
}
+
GstAutoplugSelectResult
_mm_cb_decode_bin_autoplug_select(GstElement * element, GstPad * pad, GstCaps * caps, GstElementFactory * factory, handle_s *handle)
{
return GST_AUTOPLUG_SELECT_TRY;
}
memset(handle->property->audiodecodename, 0, ENC_BUFFER_SIZE);
- strncpy(handle->property->audiodecodename, feature_name, ENC_BUFFER_SIZE-1);
+ strncpy(handle->property->audiodecodename, feature_name, strlen(feature_name));
debug_log ("[audio decode name %s : %s]", caps_str, handle->property->audiodecodename);
}
if(g_strrstr(caps_str, "video")) {
- if(g_strrstr(feature_name, "omx")) {
+ if(g_strrstr(feature_name, "omx") || g_strrstr(feature_name, "sprd")) {
/* emit autoplug-select to see what we should do with it. */
debug_log("SKIP HW Codec");
return GST_AUTOPLUG_SELECT_SKIP;
return GST_AUTOPLUG_SELECT_TRY;
}
memset(handle->property->videodecodename, 0, ENC_BUFFER_SIZE);
- strncpy(handle->property->videodecodename, feature_name, ENC_BUFFER_SIZE-1);
+ strncpy(handle->property->videodecodename, feature_name, strlen(feature_name));
debug_log ("[video decode name %s : %s]", caps_str, handle->property->videodecodename);
}
return TRUE;
}
-GstPadProbeReturn
-_mm_cb_video_output_stream_probe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data)
-{
- handle_s *handle = (handle_s*) user_data;
-
- if (!handle) {
- debug_error("[ERROR] - handle");
- return GST_PAD_PROBE_REMOVE;
- }
-
- if (!handle->property) {
- debug_error("[ERROR] - handle property");
- return GST_PAD_PROBE_REMOVE;
- }
-
- gint64 start_pos_ts = handle->param->start_pos * G_GINT64_CONSTANT(1000000);
-
- if (GST_BUFFER_TIMESTAMP_IS_VALID (GST_PAD_PROBE_INFO_BUFFER(info))) {
- if (0 == handle->property->VIDFLAG++) {
- _mm_transcode_video_capsfilter(gst_pad_get_current_caps (pad), handle); /* Not drop buffer with 'return FALSE'*/
-
- if(handle->param->seeking) {
- debug_log("[VIDEO BUFFER TIMESTAMP] ([%"G_GUINT64_FORMAT"])", start_pos_ts);
- GST_BUFFER_TIMESTAMP (GST_PAD_PROBE_INFO_BUFFER(info)) = start_pos_ts;
- }
- }
- }
- return GST_PAD_PROBE_OK;
-}
-
gboolean
_mm_cb_transcode_bus(GstBus * bus, GstMessage * message, gpointer userdata)
{
memset(param->outputfile, 0, BUFFER_SIZE);
strncpy(param->outputfile, out_Filename, strlen (out_Filename));
debug_log("%s(%d)", param->outputfile, strlen (out_Filename));
- debug_log("output file name: %s", param->outputfile);
} else {
debug_error("out_Filename error");
return MM_ERROR_INVALID_ARGUMENT;