projects
/
platform
/
upstream
/
gstreamer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git]
/
gst
/
gstregistrybinary.c
diff --git
a/gst/gstregistrybinary.c
b/gst/gstregistrybinary.c
index
ac33965
..
2e6451b
100644
(file)
--- a/
gst/gstregistrybinary.c
+++ b/
gst/gstregistrybinary.c
@@
-18,8
+18,8
@@
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- * Boston, MA 0211
1-1307
, USA.
+ * Free Software Foundation, Inc., 5
1 Franklin St, Fifth Floor
,
+ * Boston, MA 0211
0-1301
, USA.
*/
/* FIXME:
*/
/* FIXME:
@@
-56,6
+56,8
@@
#include <gst/gstelement.h>
#include <gst/gsttypefind.h>
#include <gst/gsttypefindfactory.h>
#include <gst/gstelement.h>
#include <gst/gsttypefind.h>
#include <gst/gsttypefindfactory.h>
+#include <gst/gstdeviceproviderfactory.h>
+#include <gst/gstdynamictypefactory.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
#include <gst/gstenumtypes.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
#include <gst/gstenumtypes.h>
@@
-219,10
+221,11
@@
gst_registry_binary_cache_write (BinaryRegistryCache * cache,
{
long written;
if (offset != cache->currentoffset) {
{
long written;
if (offset != cache->currentoffset) {
- if (lseek (cache->cache_fd, offset, SEEK_SET)
!=
0) {
- GST_ERROR ("Seeking to new offset failed
"
);
- return
FALSE
;
+ if (lseek (cache->cache_fd, offset, SEEK_SET)
<
0) {
+ GST_ERROR ("Seeking to new offset failed
: %s", g_strerror (errno)
);
+ return
-1
;
}
}
+ GST_LOG ("Seeked from offset %lu to %lu", offset, cache->currentoffset);
cache->currentoffset = offset;
}
cache->currentoffset = offset;
}
@@
-245,12
+248,13
@@
gst_registry_binary_cache_finish (BinaryRegistryCache * cache, gboolean success)
if (close (cache->cache_fd) < 0)
goto close_failed;
if (close (cache->cache_fd) < 0)
goto close_failed;
- if (success) {
- /* Only do the rename if we wrote the entire file successfully */
- if (g_rename (cache->tmp_location, cache->location) < 0) {
- GST_ERROR ("g_rename() failed: %s", g_strerror (errno));
- goto rename_failed;
- }
+ if (!success)
+ goto fail_after_close;
+
+ /* Only do the rename if we wrote the entire file successfully */
+ if (g_rename (cache->tmp_location, cache->location) < 0) {
+ GST_ERROR ("g_rename() failed: %s", g_strerror (errno));
+ goto rename_failed;
}
g_free (cache->tmp_location);
}
g_free (cache->tmp_location);
@@
-298,7
+302,7
@@
gst_registry_binary_write_chunk (BinaryRegistryCache * cache,
gchar padder[ALIGNMENT] = { 0, };
int padsize = 0;
gchar padder[ALIGNMENT] = { 0, };
int padsize = 0;
- /* Padding to insert the struct that requi
e
re word alignment */
+ /* Padding to insert the struct that require word alignment */
if ((chunk->align) && (alignment (*file_position) != 0)) {
padsize = ALIGNMENT - alignment (*file_position);
if (gst_registry_binary_cache_write (cache, *file_position,
if ((chunk->align) && (alignment (*file_position) != 0)) {
padsize = ALIGNMENT - alignment (*file_position);
if (gst_registry_binary_cache_write (cache, *file_position,
@@
-332,7
+336,7
@@
gst_registry_binary_initialize_magic (GstBinaryRegistryMagic * m)
{
memset (m, 0, sizeof (GstBinaryRegistryMagic));
{
memset (m, 0, sizeof (GstBinaryRegistryMagic));
- if (!
strn
cpy (m->magic, GST_MAGIC_BINARY_REGISTRY_STR,
+ if (!
mem
cpy (m->magic, GST_MAGIC_BINARY_REGISTRY_STR,
GST_MAGIC_BINARY_REGISTRY_LEN)
|| !strncpy (m->version, GST_MAGIC_BINARY_VERSION_STR,
GST_MAGIC_BINARY_VERSION_LEN)) {
GST_MAGIC_BINARY_REGISTRY_LEN)
|| !strncpy (m->version, GST_MAGIC_BINARY_VERSION_STR,
GST_MAGIC_BINARY_VERSION_LEN)) {
@@
-353,7
+357,8
@@
gst_registry_binary_initialize_magic (GstBinaryRegistryMagic * m)
* Returns: %TRUE on success.
*/
gboolean
* Returns: %TRUE on success.
*/
gboolean
-gst_registry_binary_write_cache (GstRegistry * registry, const char *location)
+priv_gst_registry_binary_write_cache (GstRegistry * registry, GList * plugins,
+ const char *location)
{
GList *walk;
GstBinaryRegistryMagic magic;
{
GList *walk;
GstBinaryRegistryMagic magic;
@@
-369,13
+374,13
@@
gst_registry_binary_write_cache (GstRegistry * registry, const char *location)
goto fail;
/* iterate trough the list of plugins and fit them into binary structures */
goto fail;
/* iterate trough the list of plugins and fit them into binary structures */
- for (walk =
registry->plugins; walk; walk = g_list_next (walk)
) {
+ for (walk =
plugins; walk != NULL; walk = walk->next
) {
GstPlugin *plugin = GST_PLUGIN (walk->data);
if (!plugin->filename)
continue;
GstPlugin *plugin = GST_PLUGIN (walk->data);
if (!plugin->filename)
continue;
- if (
plugin->flags & GST_PLUGIN_FLAG_CACHED
) {
+ if (
GST_OBJECT_FLAG_IS_SET (plugin, GST_PLUGIN_FLAG_CACHED)
) {
GStatBuf statbuf;
if (g_stat (plugin->filename, &statbuf) < 0 ||
GStatBuf statbuf;
if (g_stat (plugin->filename, &statbuf) < 0 ||
@@
-503,7
+508,8
@@
fail:
* Returns: %TRUE on success.
*/
gboolean
* Returns: %TRUE on success.
*/
gboolean
-gst_registry_binary_read_cache (GstRegistry * registry, const char *location)
+priv_gst_registry_binary_read_cache (GstRegistry * registry,
+ const char *location)
{
GMappedFile *mapped = NULL;
gchar *contents = NULL;
{
GMappedFile *mapped = NULL;
gchar *contents = NULL;
@@
-521,7
+527,8
@@
gst_registry_binary_read_cache (GstRegistry * registry, const char *location)
/* make sure these types exist */
GST_TYPE_ELEMENT_FACTORY;
GST_TYPE_TYPE_FIND_FACTORY;
/* make sure these types exist */
GST_TYPE_ELEMENT_FACTORY;
GST_TYPE_TYPE_FIND_FACTORY;
- GST_TYPE_INDEX_FACTORY;
+ GST_TYPE_DEVICE_PROVIDER_FACTORY;
+ GST_TYPE_DYNAMIC_TYPE_FACTORY;
#ifndef GST_DISABLE_GST_DEBUG
timer = g_timer_new ();
#ifndef GST_DISABLE_GST_DEBUG
timer = g_timer_new ();