]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
gst/gsttypes.h: get rid of GST_O_READONLY, GST_FILE_MODE_READ and
authorBenjamin Otte <otte@gnome.org>
Mon, 12 Jul 2004 21:57:35 +0000 (21:57 +0000)
committerBenjamin Otte <otte@gnome.org>
Mon, 12 Jul 2004 21:57:35 +0000 (21:57 +0000)
Original commit message from CVS:
* gst/gsttypes.h:
get rid of GST_O_READONLY, GST_FILE_MODE_READ and
GST_FILE_MODE_WRITE, I don't want them in the exported headers. It
just causes support madness
* gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
make it work without this
* gst/indexers/gstfileindex.c: (_file_index_id_save_entries),
(gst_file_index_commit):
glib IO channels don't want binary mode
* testsuite/bytestream/filepadsink.c: (main):
* testsuite/bytestream/test1.c: (read_param_file):
use "rb" instead of GST_FILE_MODE_READ, it works on POSIX systems

ChangeLog
gst/elements/gstfilesrc.c
gst/gsttypes.h
gst/indexers/gstfileindex.c
plugins/elements/gstfilesrc.c
plugins/indexers/gstfileindex.c
tests/old/testsuite/bytestream/filepadsink.c
tests/old/testsuite/bytestream/test1.c
testsuite/bytestream/filepadsink.c
testsuite/bytestream/test1.c

index 21ebedc7735f14aad506b02a407aab50b1d97d4a..2b39b8e2a7af00168ddbdee19c3dd6ab0d1cb20b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2004-07-12  Benjamin Otte  <otte@gnome.org>
+
+       * gst/gsttypes.h:
+         get rid of GST_O_READONLY, GST_FILE_MODE_READ and
+         GST_FILE_MODE_WRITE, I don't want them in the exported headers. It
+         just causes support madness
+       * gst/elements/gstfilesrc.c: (gst_filesrc_open_file):
+         make it work without this
+       * gst/indexers/gstfileindex.c: (_file_index_id_save_entries),
+       (gst_file_index_commit):
+         glib IO channels don't want binary mode
+       * testsuite/bytestream/filepadsink.c: (main):
+       * testsuite/bytestream/test1.c: (read_param_file):
+         use "rb" instead of GST_FILE_MODE_READ, it works on POSIX systems
+
 2004-07-12  Benjamin Otte  <otte@gnome.org>
 
        * gst/gstelement.c: (gst_element_class_init),
index 22c4cd9c979512cb03ae02f68c93ecdc9800134e..3cb1959e70e66b8ba14cd6fac1a6e0e92cc1a960 100644 (file)
 #ifndef S_ISSOCK
 #define S_ISSOCK(x) (0)
 #endif
+/* FIXME: is that enough or should we do #ifdef __WIN32__ stuff? */
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
 
 /**********************************************************************
  * GStreamer Default File Source
@@ -756,7 +760,7 @@ gst_filesrc_open_file (GstFileSrc * src)
   GST_INFO_OBJECT (src, "opening file %s", src->filename);
 
   /* open the file */
-  src->fd = open (src->filename, GST_O_READONLY);
+  src->fd = open (src->filename, O_RDONLY | O_BINARY);
   if (src->fd < 0) {
     if (errno == ENOENT)
       GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
index ccd17672137b3a32e873df23c8aeee64711c31f1..836cb4ad3bd68dae6feea5f08c1f55c22cc33668 100644 (file)
@@ -66,15 +66,6 @@ typedef enum {
 #define GST_PADDING 4
 #define GST_PADDING_INIT       { 0 }
 
-#ifdef WIN32
-#define GST_FILE_MODE_READ  "rb"
-#define GST_FILE_MODE_WRITE "wb"
-#define GST_O_READONLY      O_RDONLY|O_BINARY
-#else
-#define GST_FILE_MODE_READ  "r"
-#define GST_FILE_MODE_WRITE "w"
-#define GST_O_READONLY      O_RDONLY
-#endif
 
 G_END_DECLS
 
index de4528d44780cd42f10d189731f999a27b751599..ee7d8918d43712b7c3826c44f6d047ad5be69409 100644 (file)
@@ -543,7 +543,7 @@ _file_index_id_save_entries (gpointer * _key,
 
   err = NULL;
   path = g_strdup_printf ("%s/%d", prefix, ii->id);
-  chan = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+  chan = g_io_channel_new_file (path, "w", &err);
   g_free (path);
   if (err)
     goto fail;
@@ -605,7 +605,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
   }
 
   path = g_strdup_printf ("%s/gstindex.xml", index->location);
-  tocfile = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+  tocfile = g_io_channel_new_file (path, "w", &err);
   g_free (path);
   if (err) {
     GST_ERROR_OBJECT (index, "%s", err->message);
index 22c4cd9c979512cb03ae02f68c93ecdc9800134e..3cb1959e70e66b8ba14cd6fac1a6e0e92cc1a960 100644 (file)
 #ifndef S_ISSOCK
 #define S_ISSOCK(x) (0)
 #endif
+/* FIXME: is that enough or should we do #ifdef __WIN32__ stuff? */
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
 
 /**********************************************************************
  * GStreamer Default File Source
@@ -756,7 +760,7 @@ gst_filesrc_open_file (GstFileSrc * src)
   GST_INFO_OBJECT (src, "opening file %s", src->filename);
 
   /* open the file */
-  src->fd = open (src->filename, GST_O_READONLY);
+  src->fd = open (src->filename, O_RDONLY | O_BINARY);
   if (src->fd < 0) {
     if (errno == ENOENT)
       GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
index de4528d44780cd42f10d189731f999a27b751599..ee7d8918d43712b7c3826c44f6d047ad5be69409 100644 (file)
@@ -543,7 +543,7 @@ _file_index_id_save_entries (gpointer * _key,
 
   err = NULL;
   path = g_strdup_printf ("%s/%d", prefix, ii->id);
-  chan = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+  chan = g_io_channel_new_file (path, "w", &err);
   g_free (path);
   if (err)
     goto fail;
@@ -605,7 +605,7 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id)
   }
 
   path = g_strdup_printf ("%s/gstindex.xml", index->location);
-  tocfile = g_io_channel_new_file (path, GST_FILE_MODE_WRITE, &err);
+  tocfile = g_io_channel_new_file (path, "w", &err);
   g_free (path);
   if (err) {
     GST_ERROR_OBJECT (index, "%s", err->message);
index 7ac762687976795dfb45a853db531396819c9662..550fda4f1dc6a1ca6d79dbcec53a0c57e0a9bc6f 100644 (file)
@@ -259,7 +259,7 @@ main (gint argc, gchar ** argv)
   if (!gst_element_link (src, sink))
     g_assert_not_reached ();
   g_object_set (src, "location", THE_FILE, NULL);
-  GST_FP_SINK (sink)->stream = fopen (THE_FILE, GST_FILE_MODE_READ);
+  GST_FP_SINK (sink)->stream = fopen (THE_FILE, "rb");
   g_assert (GST_FP_SINK (sink)->stream);
   /* check correct file sizes */
   if (fseek (GST_FP_SINK (sink)->stream, 0, SEEK_END) != 0)
index 81ef3f046f41df162c09003b7d845f2121b7904d..fde56402c6d3916a7abd68fded5fb15a324885d3 100644 (file)
@@ -68,7 +68,7 @@ read_param_file (gchar * filename)
   gchar *scan_str;
   gboolean res = TRUE;
 
-  fp = fopen (filename, GST_FILE_MODE_READ);
+  fp = fopen (filename, "rb");
   if (fp == NULL)
     return FALSE;
 
index 7ac762687976795dfb45a853db531396819c9662..550fda4f1dc6a1ca6d79dbcec53a0c57e0a9bc6f 100644 (file)
@@ -259,7 +259,7 @@ main (gint argc, gchar ** argv)
   if (!gst_element_link (src, sink))
     g_assert_not_reached ();
   g_object_set (src, "location", THE_FILE, NULL);
-  GST_FP_SINK (sink)->stream = fopen (THE_FILE, GST_FILE_MODE_READ);
+  GST_FP_SINK (sink)->stream = fopen (THE_FILE, "rb");
   g_assert (GST_FP_SINK (sink)->stream);
   /* check correct file sizes */
   if (fseek (GST_FP_SINK (sink)->stream, 0, SEEK_END) != 0)
index 81ef3f046f41df162c09003b7d845f2121b7904d..fde56402c6d3916a7abd68fded5fb15a324885d3 100644 (file)
@@ -68,7 +68,7 @@ read_param_file (gchar * filename)
   gchar *scan_str;
   gboolean res = TRUE;
 
-  fp = fopen (filename, GST_FILE_MODE_READ);
+  fp = fopen (filename, "rb");
   if (fp == NULL)
     return FALSE;