The first functional video sink... Removed all of the video stuff from the MPEG video decoder. Fixed a bug in smoothw...

Original commit message from CVS:
The first functional video sink... Removed all of the video stuff
from the MPEG video decoder. Fixed a bug in smoothwave.
The MPEG video decoder still does the YUV->RGB conversion.
This commit is contained in:
Wim Taymans 2000-02-18 23:07:33 +00:00
parent 13198c06fa
commit 48c04a1661
3 changed files with 43 additions and 6 deletions

View file

@ -25,6 +25,16 @@
typedef struct _MetaVideoRaw MetaVideoRaw;
enum {
GST_META_VIDEORAW_RGB15,
GST_META_VIDEORAW_RGB16,
GST_META_VIDEORAW_RGB24, // RGB
GST_META_VIDEORAW_RGB32,
GST_META_VIDEORAW_YUV420, // YUV planar
GST_META_VIDEORAW_YUV422
};
struct _MetaVideoRaw {
GstMeta meta;

View file

@ -1,6 +1,6 @@
#noinst_PROGRAMS = basic m types a r plugin w s args mpg123 mcut push qtest
noinst_PROGRAMS = qtest spectrum record wave mp3 teardown buffer mp3parse \
mpeg2parse mp1parse mp3play ac3parse ac3play dvdcat fake cobin
mpeg2parse mp1parse mp3play ac3parse ac3play dvdcat fake cobin videotest
SUBDIRS = xml cothreads bindings
@ -8,6 +8,10 @@ spectrum_CFLAGS = $(shell gnome-config --cflags gnomeui)
spectrum_LDFLAGS = $(shell gnome-config --libs gnomeui)
wave_CFLAGS = $(shell gnome-config --cflags gnomeui)
wave_LDFLAGS = $(shell gnome-config --libs gnomeui)
videotest_CFLAGS = $(shell gnome-config --cflags gnomeui)
videotest_LDFLAGS = $(shell gnome-config --libs gnomeui)
mp1parse_CFLAGS = $(shell gnome-config --cflags gnomeui)
mp1parse_LDFLAGS = $(shell gnome-config --libs gnomeui)
buffer_SOURCES = buffer.c mem.c
teardown_SOURCES = teardown.c mem.c

View file

@ -1,6 +1,9 @@
#include <gnome.h>
#include <gst/gst.h>
extern gboolean _gst_plugin_spew;
gboolean idle_func(gpointer data);
void eof(GstSrc *src) {
g_print("have eos, quitting\n");
@ -13,11 +16,13 @@ void mp1parse_info_chain(GstPad *pad,GstBuffer *buf) {
}
void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
GstElement *parse_audio, *parse_video, *decode, *decode_video, *play;
GstElement *parse_audio, *parse_video, *decode, *decode_video, *play, *show;
GstElement *audio_queue, *video_queue;
GstElement *audio_thread, *video_thread;
GstPad *infopad;
GtkWidget *appwindow;
g_print("***** a new pad %s was created\n", gst_pad_get_name(pad));
// connect to audio pad
@ -71,12 +76,24 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
g_return_if_fail(parse_video != NULL);
decode = gst_elementfactory_make("mpeg_play","decode_video");
g_return_if_fail(decode_video != NULL);
show = gst_elementfactory_make("videosink","show");
g_return_if_fail(show != NULL);
g_print("setting size\n");
//gtk_object_set(GTK_OBJECT(show),"width",384,NULL);
//gtk_object_set(GTK_OBJECT(show),"height",288,NULL);
appwindow = gnome_app_new("MPEG1 player","MPEG1 player");
gnome_app_set_contents(GNOME_APP(appwindow),
gst_util_get_widget_arg(GTK_OBJECT(show),"widget"));
gtk_widget_show_all(appwindow);
// create the thread and pack stuff into it
video_thread = gst_thread_new("video_thread");
g_return_if_fail(video_thread != NULL);
gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(parse_video));
gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(decode));
gst_bin_add(GST_BIN(video_thread),GST_ELEMENT(show));
// set up pad connections
gst_element_add_ghost_pad(GST_ELEMENT(video_thread),
@ -84,7 +101,7 @@ void new_pad_created(GstElement *parse,GstPad *pad,GstElement *pipeline) {
gst_pad_connect(gst_element_get_pad(parse_video,"src"),
gst_element_get_pad(decode,"sink"));
gst_pad_connect(gst_element_get_pad(decode,"src"),
infopad);
gst_element_get_pad(show,"sink"));
// construct queue and connect everything in the main pipeline
video_queue = gst_elementfactory_make("queue","video_queue");
@ -113,6 +130,7 @@ int main(int argc,char *argv[]) {
_gst_plugin_spew = TRUE;
gst_init(&argc,&argv);
gnome_init("MPEG1 Video player","0.0.1",argc,argv);
gst_plugin_load_all();
pipeline = gst_pipeline_new("pipeline");
@ -144,8 +162,13 @@ int main(int argc,char *argv[]) {
xmlSaveFile("mp1parse.xml",gst_xml_write(GST_ELEMENT(pipeline)));
g_print("about to enter loop\n");
while (1) {
gst_src_push(GST_SRC(src));
}
g_idle_add(idle_func,src);
gtk_main();
}
gboolean idle_func(gpointer data) {
gst_src_push(GST_SRC(data));
return TRUE;
}