Added MPEG1 video parser.

Original commit message from CVS:
Added MPEG1 video parser.
This commit is contained in:
Wim Taymans 2000-02-08 22:36:20 +00:00
parent f6ba2d4db2
commit b2e0448541
3 changed files with 22 additions and 3 deletions

View file

@ -299,6 +299,7 @@ plugins/mpeg2/ac3dec/Makefile
plugins/mpeg1/Makefile
plugins/mpeg1/mpeg_play/Makefile
plugins/mpeg1/parse/Makefile
plugins/mpeg1video/parse/Makefile
plugins/effects/Makefile
plugins/effects/stereo/Makefile
plugins/effects/volume/Makefile

View file

@ -29,6 +29,7 @@ GstTypeFactory _factories[] = {
{ "audio/mpeg audio/mp3", ".mp2 .mp3 .mpa .mpega", mp3_typefind },
{ "audio/wav", ".wav", wav_typefind },
{ "audio/ac3", ".ac3", NULL },
{ "video/mpeg video/mpeg1", ".mpg", NULL },
{ NULL, NULL, NULL },
};

View file

@ -15,8 +15,8 @@ void mp1parse_info_chain(GstPad *pad,GstBuffer *buf) {
void new_pad_created(GstElement *parse, GstPad *pad) {
GstElementFactory *parsefactory, *decodefactory, *playfactory;
GstElement *parse_audio, *decode, *play;
GstPipeline *audio_pipeline;
GstElement *parse_audio, *parse_video, *decode, *play;
GstPipeline *audio_pipeline, *video_pipeline;
g_print("a new pad %s was created\n", gst_pad_get_name(pad));
@ -30,7 +30,7 @@ void new_pad_created(GstElement *parse, GstPad *pad) {
playfactory = gst_elementfactory_find("audiosink");
g_return_if_fail(playfactory != NULL);
parse_audio = gst_elementfactory_create(parsefactory,"parse");
parse_audio = gst_elementfactory_create(parsefactory,"parse_audio");
g_return_if_fail(parse_audio != NULL);
decode = gst_elementfactory_create(decodefactory,"decode");
g_return_if_fail(decode != NULL);
@ -56,6 +56,23 @@ void new_pad_created(GstElement *parse, GstPad *pad) {
gst_element_set_state(GST_ELEMENT(audio_pipeline),GST_STATE_RUNNING);
}
else if (strncmp(gst_pad_get_name(pad), "video_", 6) == 0) {
parsefactory = gst_elementfactory_find("mp1videoparse");
g_return_if_fail(parsefactory != NULL);
parse_video = gst_elementfactory_create(parsefactory,"parse_video");
g_return_if_fail(parse_video != NULL);
video_pipeline = gst_pipeline_new("video_pipeline");
g_return_if_fail(video_pipeline != NULL);
gst_bin_add(GST_BIN(video_pipeline),GST_ELEMENT(parse_video));
gst_pad_connect(gst_element_get_pad(parse,gst_pad_get_name(pad)),
gst_element_get_pad(parse_video,"sink"));
g_print("setting to RUNNING state\n");
gst_element_set_state(GST_ELEMENT(video_pipeline),GST_STATE_RUNNING);
}
}
int main(int argc,char *argv[]) {