Added a check for libjpeg

Original commit message from CVS:
Added a check for libjpeg
Added and action for the load menu in gstplay
Fixed drag and drop in gstplay
More verbose errors in gstasyndisksrc
This commit is contained in:
Wim Taymans 2001-01-02 12:04:46 +00:00
parent ae0d5d1889
commit baf7b1747c
7 changed files with 70 additions and 17 deletions

View file

@ -13,6 +13,7 @@
#undef HAVE_XAUDIO
#undef HAVE_CSSAUTH
#undef HAVE_VORBIS
#undef HAVE_LIBJPEG
#undef HAVE_NASM
#undef HAVE_ATOMIC_H

View file

@ -2,7 +2,7 @@
# Run this to generate all the initial makefiles, etc.
DIE=0
package=gstreamer
package=GStreamer
srcfile=gst/gstobject.h
(autoconf --version) < /dev/null > /dev/null 2>&1 || {

View file

@ -270,6 +270,13 @@ HAVE_VORBIS=yes
AC_DEFINE(HAVE_VORBIS),
HAVE_VORBIS=no, )
dnl Check for libvorbis
AC_MSG_CHECKING(libjpeg library)
AC_CHECK_LIB(jpeg, jpeg_set_defaults,
HAVE_LIBJPEG=yes
AC_DEFINE(HAVE_LIBJPEG),
HAVE_LIBJPEG=no, )
dnl Check for cdparanoia
AC_MSG_CHECKING(CDparanoia library)
@ -460,6 +467,7 @@ AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
AM_CONDITIONAL(HAVE_XAUDIO, test "x$HAVE_XAUDIO" = "xyes")
AM_CONDITIONAL(HAVE_CSSAUTH, test "x$HAVE_CSSAUTH" = "xyes")
AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBIS" = "xyes")
AM_CONDITIONAL(HAVE_LIBJPEG, test "x$HAVE_LIBJPEG" = "xyes")
AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
AM_CONDITIONAL(HAVE_LIBXV, test "x$HAVE_LIBXV" = "xyes")

View file

@ -319,7 +319,8 @@ gboolean gst_asyncdisksrc_open_file (GstAsyncDiskSrc *src)
/* open the file */
src->fd = open (src->filename, O_RDONLY);
if (src->fd < 0) {
gst_element_error (GST_ELEMENT (src), "opening file");
perror ("open");
gst_element_error (GST_ELEMENT (src), g_strconcat("opening file \"", src->filename, "\"", NULL));
return FALSE;
} else {
/* find the file length */

View file

@ -42,17 +42,6 @@ on_preferences1_activate (GtkMenuItem *menuitem,
}
void
on_open2_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GladeXML *xml;
xml = glade_xml_new(DATADIR "gstmediaplay.glade", "fileselection1");
/* connect the signals in the interface */
glade_xml_signal_autoconnect(xml);
open_file_selection = GTK_FILE_SELECTION(glade_xml_get_widget(xml, "fileselection1"));
}
void on_about_activate(GtkWidget *widget, gpointer data)
{
GladeXML *xml;

View file

@ -41,10 +41,14 @@ target_drag_data_received (GtkWidget *widget,
gint y,
GtkSelectionData *data,
guint info,
guint time)
guint time,
GstMediaPlay *play)
{
if (strstr (data->data, "file:")) {
g_print ("Got: %s\n",data->data);
g_print ("Got: %s\n",&data->data[5]);
gdk_threads_leave ();
gst_media_play_start_uri (play, g_strchomp(&data->data[5]));
gdk_threads_enter ();
}
}
@ -166,7 +170,7 @@ gst_media_play_init(GstMediaPlay *mplay)
GDK_ACTION_COPY);
gtk_signal_connect (GTK_OBJECT (mplay->window), "drag_data_received",
GTK_SIGNAL_FUNC (target_drag_data_received),
NULL);
mplay);
mplay->play = gst_play_new();
@ -241,6 +245,55 @@ gst_media_play_start_uri (GstMediaPlay *play,
}
}
typedef struct {
GtkWidget *selection;
GstMediaPlay *play;
} file_select;
static void
on_load_file_selected (GtkWidget *button,
file_select *data)
{
GtkWidget *selector = data->selection;
GstMediaPlay *play = data->play;
gchar *file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
gdk_threads_leave();
gst_media_play_start_uri (play, file_name);
gdk_threads_enter();
g_free (data);
}
void
on_open2_activate (GtkWidget *widget,
GstMediaPlay *play)
{
GtkWidget *file_selector;
file_select *file_data = g_new0 (file_select, 1);
file_selector = gtk_file_selection_new("Please select a file to load.");
file_data->selection = file_selector;
file_data->play = play;
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
"clicked", GTK_SIGNAL_FUNC (on_load_file_selected),
file_data);
/* Ensure that the dialog box is destroyed when the user clicks a button. */
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
"clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->cancel_button),
"clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
/* Display that dialog */
gtk_widget_show (file_selector);
}
static void
gst_media_play_set_arg (GtkObject *object,
GtkArg *arg,

View file

@ -319,7 +319,8 @@ gboolean gst_asyncdisksrc_open_file (GstAsyncDiskSrc *src)
/* open the file */
src->fd = open (src->filename, O_RDONLY);
if (src->fd < 0) {
gst_element_error (GST_ELEMENT (src), "opening file");
perror ("open");
gst_element_error (GST_ELEMENT (src), g_strconcat("opening file \"", src->filename, "\"", NULL));
return FALSE;
} else {
/* find the file length */