Commit 899d2982 authored by smaynard's avatar smaynard

add MPEG 1 & 2 audio decoder to manual pipeline to test issues reported from plugfest

parent 19d4dca9
...@@ -44,6 +44,8 @@ static gboolean g_use_manual_elements_pipeline = FALSE; ...@@ -44,6 +44,8 @@ static gboolean g_use_manual_elements_pipeline = FALSE;
static gboolean g_use_simple_pipeline = FALSE; static gboolean g_use_simple_pipeline = FALSE;
static gboolean g_use_two_pipelines = FALSE; static gboolean g_use_two_pipelines = FALSE;
static gboolean g_use_auto_audio = FALSE; static gboolean g_use_auto_audio = FALSE;
static gboolean g_use_mpeg_audio = FALSE;
static gboolean g_use_ac3_audio = TRUE;
static gboolean g_download_buffering = FALSE; static gboolean g_download_buffering = FALSE;
static gboolean g_handle_buffering = FALSE; static gboolean g_handle_buffering = FALSE;
...@@ -458,6 +460,18 @@ static gboolean process_cmd_line_args(int argc, char *argv[]) ...@@ -458,6 +460,18 @@ static gboolean process_cmd_line_args(int argc, char *argv[])
g_use_auto_audio = TRUE; g_use_auto_audio = TRUE;
g_print("Set to use auto audio sink\n"); g_print("Set to use auto audio sink\n");
} }
else if (strstr(argv[i], "mpeg_audio") != NULL)
{
g_use_mpeg_audio = TRUE;
g_use_ac3_audio = FALSE;
g_print("Set to use mpeg audio\n");
}
else if (strstr(argv[i], "ac3_audio") != NULL)
{
g_use_ac3_audio = TRUE;
g_use_mpeg_audio = FALSE;
g_print("Set to use ac3 audio\n");
}
else if (strstr(argv[i], "download_buffering") != NULL) else if (strstr(argv[i], "download_buffering") != NULL)
{ {
g_download_buffering = TRUE; g_download_buffering = TRUE;
...@@ -567,6 +581,8 @@ static gboolean process_cmd_line_args(int argc, char *argv[]) ...@@ -567,6 +581,8 @@ static gboolean process_cmd_line_args(int argc, char *argv[])
g_printerr("Invalid option: %s\n", argv[i]); g_printerr("Invalid option: %s\n", argv[i]);
g_printerr("Usage:\n"); g_printerr("Usage:\n");
g_printerr("\t auto_audio \t\t create and use auto audio sink in playbin pipeline\n"); g_printerr("\t auto_audio \t\t create and use auto audio sink in playbin pipeline\n");
g_printerr("\t ac3_audio \t\t use ac3parse and avdec_ac3 in manual pipeline\n");
g_printerr("\t mpeg_audio \t\t use mpegaudioparse and avdec_mp2float in manual pipeline\n");
g_printerr("\t byte \t\t use byte format for query and seek\n"); g_printerr("\t byte \t\t use byte format for query and seek\n");
g_printerr("\t changes=x \t\t where x is number of 2x increase rate changes\n"); g_printerr("\t changes=x \t\t where x is number of 2x increase rate changes\n");
g_printerr("\t dot \t\t generate dot file of pipeline diagram\n"); g_printerr("\t dot \t\t generate dot file of pipeline diagram\n");
...@@ -979,17 +995,31 @@ static gboolean create_manual_elements_pipeline(GstElement* pipeline) ...@@ -979,17 +995,31 @@ static gboolean create_manual_elements_pipeline(GstElement* pipeline)
return FALSE; return FALSE;
} }
g_aparse = gst_element_factory_make ("ac3parse", "ac3parse"); if (g_use_ac3_audio == TRUE)
{
g_aparse = gst_element_factory_make ("ac3parse", "audioparser");
g_avdec = gst_element_factory_make ("avdec_ac3", "audiodecoder");
}
else if (g_use_mpeg_audio == TRUE)
{
g_aparse = gst_element_factory_make ("mpegaudioparse", "audioparser");
g_avdec = gst_element_factory_make ("avdec_mp2float", "audiodecoder");
}
else
{
g_aparse = NULL;
g_avdec = NULL;
}
if (!g_aparse) if (!g_aparse)
{ {
g_printerr ("%s() - ac3parse element could not be created.\n", __FUNCTION__); g_printerr ("%s() - audioparse element could not be created.\n", __FUNCTION__);
return FALSE; return FALSE;
} }
g_avdec = gst_element_factory_make ("avdec_ac3", "avdec_ac3");
if (!g_avdec) if (!g_avdec)
{ {
g_printerr ("%s() - avdec_ac3 element could not be created.\n", __FUNCTION__); g_printerr ("%s() - audiodecoder element could not be created.\n", __FUNCTION__);
return FALSE; return FALSE;
} }
...@@ -1051,7 +1081,7 @@ tsdemux_cb_pad_added (GstElement *tsdemux, ...@@ -1051,7 +1081,7 @@ tsdemux_cb_pad_added (GstElement *tsdemux,
g_printerr("%s() - problems in setup of video elements\n", __FUNCTION__); g_printerr("%s() - problems in setup of video elements\n", __FUNCTION__);
} }
} }
else if (strncmp (caps_string, "audio/x-ac3", 11) == 0) else if (strncmp (caps_string, "audio/", 6) == 0)
{ {
if (link_audio_elements(name, tsdemux_src_pad, caps)) if (link_audio_elements(name, tsdemux_src_pad, caps))
{ {
...@@ -1169,7 +1199,7 @@ link_audio_elements(gchar* name, GstPad* tsdemux_src_pad, GstCaps* caps) ...@@ -1169,7 +1199,7 @@ link_audio_elements(gchar* name, GstPad* tsdemux_src_pad, GstCaps* caps)
GstElementClass *klass; GstElementClass *klass;
gboolean is_linked = FALSE; gboolean is_linked = FALSE;
g_print("%s() - dynamic Audio-pad created, linking %s to queue/ac3parser\n", __FUNCTION__, name); g_print("%s() - dynamic Audio-pad created, linking %s to queue/audioparser\n", __FUNCTION__, name);
// Link tsdemux src pad to queue // Link tsdemux src pad to queue
queue_in_pad = gst_element_get_compatible_pad(g_queue, tsdemux_src_pad, caps); queue_in_pad = gst_element_get_compatible_pad(g_queue, tsdemux_src_pad, caps);
...@@ -1194,7 +1224,9 @@ link_audio_elements(gchar* name, GstPad* tsdemux_src_pad, GstCaps* caps) ...@@ -1194,7 +1224,9 @@ link_audio_elements(gchar* name, GstPad* tsdemux_src_pad, GstCaps* caps)
return FALSE; return FALSE;
} }
// Link queue to ac3parse just using default element links // Link queue to audioparser just using default element links
g_print("%s() - audioparser(%p), audiodecoder(%p)\n",
__FUNCTION__, g_aparse, g_avdec);
if (!gst_element_link_many ( if (!gst_element_link_many (
g_queue, g_aparse, g_avdec, g_queue, g_aparse, g_avdec,
NULL)) NULL))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment